mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
enable customer 769SMC summary in 2 different year 2022 and 2023
This commit is contained in:
+14
-3
@@ -431,10 +431,21 @@ Route::get('/settings', function () {
|
||||
Route::get('/customer/{company_module_id}/summary', 'Exports\ExportCompanyModuleSummaryController@export')->name('customer.summary.export');
|
||||
Route::get('/export-customer-order/{marking}', 'Exports\ExportCompanyModuleSummaryController@exportorderSummaryByMarking')->name('customer.orderSummary.export');
|
||||
|
||||
Route::get('/customer/summary/monthly', function () {
|
||||
Route::get('/customer/summary/{year}/monthly', function ($year) {
|
||||
if (!in_array($year, [2022, 2023])) {
|
||||
return 'Year Error!';
|
||||
}
|
||||
|
||||
// $containers = Container::whereMonth('loading_date', '>=', ((float)Carbon::now()->format('m') - 2))->whereYear('loading_date', (float)Carbon::now()->format('Y'))->get();
|
||||
// $containers = Container::whereMonth('loading_date', '>=', 1)->whereYear('loading_date', 2023)->get();
|
||||
$containers = Container::whereMonth('loading_date', '>=', 9)->whereYear('loading_date', 2022)->get();
|
||||
|
||||
if ($year == 2022) {
|
||||
$containers = Container::whereMonth('loading_date', '>=', 9)->whereYear('loading_date', 2022)->get();
|
||||
}
|
||||
|
||||
if ($year == 2023) {
|
||||
$containers = Container::whereMonth('loading_date', '>=', 1)->whereYear('loading_date', 2023)->get();
|
||||
}
|
||||
|
||||
$marking = '769SMC';
|
||||
$connection = CompanyConnection::where('invitee_reference', $marking)->first();
|
||||
$companyModuleId = $connection->invitee->id;
|
||||
|
||||
Reference in New Issue
Block a user