phase 2 dev
This commit is contained in:
parent
5a7478907e
commit
ba48745809
59 changed files with 2692 additions and 1994 deletions
|
|
@ -172,10 +172,10 @@ class ReportBookingController extends Controller
|
|||
->orderColumn('end_date', 'end_date $1')
|
||||
->orderColumn('price', 'price $1')
|
||||
->orderColumn('booking_date', 'booking_date $1')
|
||||
->orderColumn('customer.fullName', 'customer.firstname $1')
|
||||
->orderColumn('customer.firstname', 'customer.firstname $1')
|
||||
->orderColumn('customer.name', 'customer.name $1')
|
||||
//->orderColumn('lead.status_id', 'lead.status_id $1')
|
||||
->orderColumn('customer.fullName', 'contacts.firstname $1')
|
||||
->orderColumn('customer.firstname', 'contacts.firstname $1')
|
||||
->orderColumn('customer.name', 'contacts.name $1')
|
||||
//->orderColumn('lead.status_id', 'inquiries.status_id $1')
|
||||
//->orderColumn('is_cleared', 'is_cleared $1')
|
||||
->rawColumns(['id', 'lead.status_id', 'service_provider.names'])
|
||||
->make(true);
|
||||
|
|
@ -384,9 +384,9 @@ class ReportBookingController extends Controller
|
|||
->orderColumn('end_date', 'end_date $1')
|
||||
->orderColumn('price', 'price $1')
|
||||
->orderColumn('booking_date', 'booking_date $1')
|
||||
->orderColumn('customer.firstname', 'customer.firstname $1')
|
||||
->orderColumn('customer.name', 'customer.name $1')
|
||||
//->orderColumn('lead.status_id', 'lead.status_id $1')
|
||||
->orderColumn('customer.firstname', 'contacts.firstname $1')
|
||||
->orderColumn('customer.name', 'contacts.name $1')
|
||||
//->orderColumn('lead.status_id', 'inquiries.status_id $1')
|
||||
//->orderColumn('is_cleared', 'is_cleared $1')
|
||||
->rawColumns(['id', 'old_crm', 'check_total', 'lead.status_id'])
|
||||
->make(true);
|
||||
|
|
|
|||
|
|
@ -189,10 +189,10 @@ class ReportController extends Controller
|
|||
->orderColumn('end_date', 'end_date $1')
|
||||
->orderColumn('price', 'price $1')
|
||||
->orderColumn('booking_date', 'booking_date $1')
|
||||
->orderColumn('customer.fullName', 'customer.firstname $1')
|
||||
->orderColumn('customer.firstname', 'customer.firstname $1')
|
||||
->orderColumn('customer.name', 'customer.name $1')
|
||||
//->orderColumn('lead.status_id', 'lead.status_id $1')
|
||||
->orderColumn('customer.fullName', 'contacts.firstname $1')
|
||||
->orderColumn('customer.firstname', 'contacts.firstname $1')
|
||||
->orderColumn('customer.name', 'contacts.name $1')
|
||||
//->orderColumn('lead.status_id', 'inquiries.status_id $1')
|
||||
//->orderColumn('is_cleared', 'is_cleared $1')
|
||||
->rawColumns(['id', 'lead.status_id', 'service_provider.names'])
|
||||
->make(true);
|
||||
|
|
@ -400,10 +400,10 @@ class ReportController extends Controller
|
|||
$price = 0;
|
||||
$isset = [];
|
||||
foreach ($all as $v){
|
||||
if(!in_array($v->booking->lead_id, $isset)){
|
||||
if(!in_array($v->booking->inquiry_id, $isset)){
|
||||
$price += $v->booking->isCanceled() ? $v->booking->getPriceCanceledRaw() : $v->booking->getPriceRaw();
|
||||
}
|
||||
$isset[] = $v->booking->lead_id;
|
||||
$isset[] = $v->booking->inquiry_id;
|
||||
|
||||
}
|
||||
return Util::_number_format($price);
|
||||
|
|
@ -416,8 +416,8 @@ class ReportController extends Controller
|
|||
$price = 0;
|
||||
$isset = [];
|
||||
foreach ($all as $v){
|
||||
$price += in_array($v->booking->lead_id, $isset) ? 0 : $v->booking->getPriceTotalRaw();
|
||||
$isset[] = $v->booking->lead_id;
|
||||
$price += in_array($v->booking->inquiry_id, $isset) ? 0 : $v->booking->getPriceTotalRaw();
|
||||
$isset[] = $v->booking->inquiry_id;
|
||||
}
|
||||
return Util::_number_format($price);
|
||||
})
|
||||
|
|
@ -429,8 +429,8 @@ class ReportController extends Controller
|
|||
$proceeds = 0;
|
||||
$isset = [];
|
||||
foreach ($all as $v){
|
||||
$proceeds += in_array($v->booking->lead_id, $isset) ? 0 : $v->booking->proceeds(true);
|
||||
$isset[] = $v->booking->lead_id;
|
||||
$proceeds += in_array($v->booking->inquiry_id, $isset) ? 0 : $v->booking->proceeds(true);
|
||||
$isset[] = $v->booking->inquiry_id;
|
||||
}
|
||||
return Util::_number_format($proceeds);
|
||||
/*$all = $query->get();
|
||||
|
|
@ -562,7 +562,7 @@ class ReportController extends Controller
|
|||
$ctemps[$export->booking->id][] = array(
|
||||
'Zähler' => $new ? $export->getCounter() : "",
|
||||
'MyJack Nr.' => $new ? $export->booking->merlin_order_number : "",
|
||||
'CRM Nr' => $new ? $export->booking->lead_id : "",
|
||||
'CRM Nr' => $new ? $export->booking->inquiry_id : "",
|
||||
'Kunde' => $new ? $export->booking->customer->name : "",
|
||||
'Reisedatum' => $new ? $export->booking->getStartDateFormat() : "",
|
||||
'Organisation' => $new ? ($export->booking->isCanceled() ? $export->booking->price_canceled : $export->booking->price) : "",
|
||||
|
|
@ -630,7 +630,7 @@ class ReportController extends Controller
|
|||
$ctemps[$export->booking->id][] = array(
|
||||
'Zähler' => $new ? $export->getCounter() : "",
|
||||
'MyJack Nr.' => $new ? $export->booking->merlin_order_number : "",
|
||||
'CRM Nr' => $new ? $export->booking->lead_id : "",
|
||||
'CRM Nr' => $new ? $export->booking->inquiry_id : "",
|
||||
'Kunde' => $new ? $export->booking->customer->name : "",
|
||||
'Reisedatum' => $new ? $export->booking->getStartDateFormat() : "",
|
||||
'Reiseland' => $new && $export->booking->travel_country ? $export->booking->travel_country->name : "",
|
||||
|
|
@ -725,9 +725,9 @@ class ReportController extends Controller
|
|||
->orderColumn('end_date', 'end_date $1')
|
||||
->orderColumn('price', 'price $1')
|
||||
->orderColumn('booking_date', 'booking_date $1')
|
||||
->orderColumn('customer.firstname', 'customer.firstname $1')
|
||||
->orderColumn('customer.name', 'customer.name $1')
|
||||
//->orderColumn('lead.status_id', 'lead.status_id $1')
|
||||
->orderColumn('customer.firstname', 'contacts.firstname $1')
|
||||
->orderColumn('customer.name', 'contacts.name $1')
|
||||
//->orderColumn('lead.status_id', 'inquiries.status_id $1')
|
||||
//->orderColumn('is_cleared', 'is_cleared $1')
|
||||
->rawColumns(['id', 'old_crm', 'check_total', 'lead.status_id'])
|
||||
->make(true);
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ class ReportLeadsController extends Controller
|
|||
{
|
||||
|
||||
$query = Lead::with('customer')->with('sf_guard_user')->with('status')
|
||||
->select('lead.*');
|
||||
->select('inquiries.*');
|
||||
//->where('deleted_at', '=', null);
|
||||
|
||||
/*
|
||||
|
|
@ -132,7 +132,7 @@ class ReportLeadsController extends Controller
|
|||
// $q->select('sent_at')->where('sent_at', DB::raw("(select max('sent_at') customer_mails)")); //)
|
||||
})->orderBy(
|
||||
LeadMail::select('sent_at')
|
||||
->whereColumn('lead_id', 'lead.id')
|
||||
->whereColumn('lead_id', 'inquiries.id')
|
||||
->orderBy('sent_at', 'DESC')
|
||||
->limit(1)
|
||||
, $order);
|
||||
|
|
@ -161,9 +161,9 @@ class ReportLeadsController extends Controller
|
|||
$orderByNum = [
|
||||
0 => 'id',
|
||||
1 => 'customer_id',
|
||||
2 => 'customer.firstname',
|
||||
3 => 'customer.name',
|
||||
4 => 'customer.email',
|
||||
2 => 'contacts.firstname',
|
||||
3 => 'contacts.name',
|
||||
4 => 'contacts.email',
|
||||
5 => 'request_date',
|
||||
6 => 'travel_country',
|
||||
7 => 'sf_guard_user.last_name',
|
||||
|
|
|
|||
|
|
@ -104,10 +104,10 @@ class ReportProviderController extends Controller
|
|||
$price = 0;
|
||||
$isset = [];
|
||||
foreach ($all as $v){
|
||||
if(!in_array($v->booking->lead_id, $isset)){
|
||||
if(!in_array($v->booking->inquiry_id, $isset)){
|
||||
$price += $v->booking->isCanceled() ? $v->booking->getPriceCanceledRaw() : $v->booking->getPriceRaw();
|
||||
}
|
||||
$isset[] = $v->booking->lead_id;
|
||||
$isset[] = $v->booking->inquiry_id;
|
||||
|
||||
}
|
||||
return Util::_number_format($price);
|
||||
|
|
@ -120,8 +120,8 @@ class ReportProviderController extends Controller
|
|||
$price = 0;
|
||||
$isset = [];
|
||||
foreach ($all as $v){
|
||||
$price += in_array($v->booking->lead_id, $isset) ? 0 : $v->booking->getPriceTotalRaw();
|
||||
$isset[] = $v->booking->lead_id;
|
||||
$price += in_array($v->booking->inquiry_id, $isset) ? 0 : $v->booking->getPriceTotalRaw();
|
||||
$isset[] = $v->booking->inquiry_id;
|
||||
}
|
||||
return Util::_number_format($price);
|
||||
})
|
||||
|
|
@ -133,8 +133,8 @@ class ReportProviderController extends Controller
|
|||
$proceeds = 0;
|
||||
$isset = [];
|
||||
foreach ($all as $v){
|
||||
$proceeds += in_array($v->booking->lead_id, $isset) ? 0 : $v->booking->proceeds(true);
|
||||
$isset[] = $v->booking->lead_id;
|
||||
$proceeds += in_array($v->booking->inquiry_id, $isset) ? 0 : $v->booking->proceeds(true);
|
||||
$isset[] = $v->booking->inquiry_id;
|
||||
}
|
||||
return Util::_number_format($proceeds);
|
||||
/*$all = $query->get();
|
||||
|
|
@ -272,7 +272,7 @@ class ReportProviderController extends Controller
|
|||
$ctemps[$export->booking->id][] = array(
|
||||
'Zähler' => $new ? $export->getCounter() : "",
|
||||
'MyJack Nr.' => $new ? $export->booking->merlin_order_number : "",
|
||||
'CRM Nr' => $new ? $export->booking->lead_id : "",
|
||||
'CRM Nr' => $new ? $export->booking->inquiry_id : "",
|
||||
'Kunde' => $new ? $export->booking->customer->name : "",
|
||||
'Reisedatum' => $new ? $export->booking->getStartDateFormat() : "",
|
||||
'bis' => $new ? $export->booking->getEndDateFormat() : "",
|
||||
|
|
@ -346,7 +346,7 @@ class ReportProviderController extends Controller
|
|||
$ctemps[$export->booking->id][] = array(
|
||||
'Zähler' => $new ? $export->getCounter() : "",
|
||||
'MyJack Nr.' => $new ? $export->booking->merlin_order_number : "",
|
||||
'CRM Nr' => $new ? $export->booking->lead_id : "",
|
||||
'CRM Nr' => $new ? $export->booking->inquiry_id : "",
|
||||
'Kunde' => $new ? $export->booking->customer->name : "",
|
||||
'Reisedatum' => $new ? $export->booking->getStartDateFormat() : "",
|
||||
'bis' => $new ? $export->booking->getEndDateFormat() : "",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue