shipping sales report

This commit is contained in:
Omair Saleh
2022-11-01 15:45:46 +08:00
parent 64a7e4e0b7
commit 95fd0aa45d
+2 -2
View File
@@ -461,7 +461,7 @@ Route::get('/container/billing/{month}/{year}', function($month, $year){
foreach($containers as $container) { foreach($containers as $container) {
$packingLists = $container->packingLists; $packingLists = $container->packingLists;
$totalBillable += count($packingLists); $totalBillable += count($packingLists);
echo '<h3>'.$container->reference.'</h3>'; echo '<h3>'.$container->reference.' ('.$container->loading_date->format('d-m-Y').')</h3>';
foreach ($packingLists as $packingList) { foreach ($packingLists as $packingList) {
$invoice = $packingList->transactions() $invoice = $packingList->transactions()
@@ -481,7 +481,7 @@ Route::get('/container/billing/{month}/{year}', function($month, $year){
$totalBilled += $invoice->amount; $totalBilled += $invoice->amount;
$totalPaid += $payments->sum('amount'); $totalPaid += $payments->sum('amount');
echo '<span style="color: '.(($invoice->amount - $payments->sum('amount')) < 0.01 ? 'green' : 'red').'">'.$packingList->reference.' | Amount: '.$invoice->amount.' | Paid: '.$payments->sum('amount').' | Invoice Date: '.$invoice->created_at. (($invoice->amount - $payments->sum('amount')) < 0.01 ? '' : '('.$invoice->created_at->diffForHumans().')').'</span>'; echo '<span style="color: '.(($invoice->amount - $payments->sum('amount')) < 0.01 ? 'green' : 'red').'">'.$packingList->reference.' | Amount: '.$invoice->amount.' | Paid: '.$payments->sum('amount').' | Invoice Date: '.$invoice->created_at->format('d-m-Y'). (($invoice->amount - $payments->sum('amount')) < 0.01 ? '' : '('.$invoice->created_at->diffForHumans().')').'</span>';
echo '<br>'; echo '<br>';
} }