Report Strono-Date, Booking+Fewo Notice, Custom Mail opti
This commit is contained in:
parent
644ec93c53
commit
5d55e5be3f
35 changed files with 581 additions and 41 deletions
|
|
@ -43,7 +43,7 @@ class ReportController extends Controller
|
|||
private function prozessBookingSearch()
|
||||
{
|
||||
|
||||
$query = Booking::with( 'customer', 'lead', 'service_provider_entries', 'service_provider_entries.service_provider')->select('booking.*');
|
||||
$query = Booking::with( 'customer', 'lead', 'booking_strono','service_provider_entries', 'service_provider_entries.service_provider')->select('booking.*');
|
||||
|
||||
if(Request::get('filter_travel_date_from') != ""){
|
||||
$travel_date_from = Carbon::parse(Request::get('filter_travel_date_from'))->format("Y-m-d");
|
||||
|
|
@ -106,6 +106,9 @@ class ReportController extends Controller
|
|||
->addColumn('booking_date', function (Booking $booking) {
|
||||
return $booking->getBookingDateFormat();
|
||||
})
|
||||
->addColumn('booking_strono_date', function (Booking $booking) {
|
||||
return $booking->booking_strono ? $booking->booking_strono->storno_date->format("d.m.Y") : "";
|
||||
})
|
||||
->addColumn('service_provider.names', function (Booking $booking) {
|
||||
$ret = "";
|
||||
if($booking->service_provider_entries){
|
||||
|
|
@ -154,7 +157,6 @@ class ReportController extends Controller
|
|||
|
||||
public function bookingsExport(){
|
||||
|
||||
|
||||
$query = $this->prozessBookingSearch();
|
||||
|
||||
$order = explode(",", Request::get('order'));
|
||||
|
|
@ -183,6 +185,7 @@ class ReportController extends Controller
|
|||
$headers = array(
|
||||
'BuchungsID',
|
||||
'Status',
|
||||
'Storno',
|
||||
'MyJack Nr.',
|
||||
'Organisation',
|
||||
'Reisepreis',
|
||||
|
|
@ -206,6 +209,7 @@ class ReportController extends Controller
|
|||
$total_amount_final = 0;
|
||||
|
||||
foreach($exports as $export) {
|
||||
$storno_date = $export->booking_strono ? $export->booking_strono->storno_date->format("d.m.Y") : "";
|
||||
if($export->service_provider_entries->count()){
|
||||
$new = true;
|
||||
foreach ($export->service_provider_entries as $service_provider_entry){
|
||||
|
|
@ -218,6 +222,7 @@ class ReportController extends Controller
|
|||
$columns[] = array(
|
||||
'BuchungsID' => $new ? $export->id : "",
|
||||
'Status' => $new ? $export->lead->status->name : "",
|
||||
'Storno' => $new ? $storno_date : "",
|
||||
'MyJack Nr.' => $new ? $export->merlin_order_number : "",
|
||||
'Organisation' => $new ? $export->price : "",
|
||||
'Reisepreis' => $new ? $export->price_total : "",
|
||||
|
|
@ -243,6 +248,7 @@ class ReportController extends Controller
|
|||
$columns[] = array(
|
||||
'BuchungsID' => $export->id,
|
||||
'Status' => $export->lead->status->name,
|
||||
'Storno' => $storno_date,
|
||||
'MyJack Nr.' => $export->merlin_order_number,
|
||||
'Organisation' => $export->price,
|
||||
'Reisepreis' => $export->price_total,
|
||||
|
|
@ -266,6 +272,7 @@ class ReportController extends Controller
|
|||
$columns[] = array(
|
||||
'BuchungsID' => "Total",
|
||||
'Status' => "",
|
||||
'Storno' => "",
|
||||
'MyJack Nr.' => "",
|
||||
'Organisation' => Util::_number_format($total_price),
|
||||
'Reisepreis' => Util::_number_format($total_price_total),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue