update export-customer-order

This commit is contained in:
edmondlang
2023-02-21 09:58:47 +08:00
parent 32936af538
commit 615e3e7683
+6 -3
View File
@@ -378,9 +378,12 @@ Route::get('/export-customer-order/{marking}', 'Exports\ExportCompanyModuleSumma
Route::get('/customer/summary/monthly', function () {
// $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', '>=', 9)->whereYear('loading_date', 2022)->get();
$marking = '769SMC';
$connection = CompanyConnection::where('invitee_reference', $marking)->first();
$companyModuleId = $connection->invitee->id;
foreach ($containers as $container){
$packingLists = $container->packingLists()->get()->filter(function ($packingList) {
return $packingList->owner->company_module_id === 248;
$packingLists = $container->packingLists()->get()->filter(function ($packingList) use ($companyModuleId){
return $packingList->owner->company_module_id === $companyModuleId;
});
if (!count($packingLists)) continue;
@@ -405,7 +408,7 @@ Route::get('/customer/summary/monthly', function () {
foreach ($packages as $package){
echo '<tr>
<td>'.$container->loading_date->format('d-m-Y').'</td>
<td>MS/CIEF/769SMC/'.$packingList->owner->reference.'</td>
<td>MS/CIEF/769SMC/'.$packingList->owner->owner->reference.'</td>
<td>'.$container->reference.'</td>
<td>'.$package->description.'</td>
<td>'.$package->quantity.'</td>