mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
Amendment for Yien to do testing at dev environment
This commit is contained in:
+4
-3
@@ -137,7 +137,7 @@ class CheckStorageInvoiceTransactionProcessor
|
||||
$arrivalDateAtChinaWarehouse = Carbon::parse($transport->drop_date);
|
||||
// $arrivalDateAtChinaWarehouse = Carbon::parse('2023-11-01 00:00:00');
|
||||
$dateToCompare = Carbon::parse('2023-11-01 00:00:00'); //cief todo: to update this
|
||||
if ($dateToCompare->isAfter($arrivalDateAtChinaWarehouse)) {
|
||||
if ($arrivalDateAtChinaWarehouse->isAfter($dateToCompare)) {
|
||||
Log::channel('storage_invoices')->info('dateToCompare: '.$dateToCompare.', arrivalDateAtChinaWarehouse: '.$arrivalDateAtChinaWarehouse);
|
||||
$schedule = $transport->schedules->last();
|
||||
if ($schedule) {
|
||||
@@ -186,6 +186,7 @@ class CheckStorageInvoiceTransactionProcessor
|
||||
$price_cbm = $pricePerCBM * $cbm * $resultNumberOfDaysExceeded;
|
||||
|
||||
if(!$storageInvoice && $resultNumberOfDaysExceeded > 0 && $transaction->status != ApprovalStatus::COMPLETED){
|
||||
Log::channel('storage_invoices')->info('Created $transaction->id: '.$transaction->id);
|
||||
$billNumber = $this->generatesTransactionBillNumber->execute('STOR-');
|
||||
$storageInvoice = $this->createStorageInvoiceTransaction($destinationWarehousePackage, $billNumber, $company_module_id, $price_cbm);
|
||||
$storageInvoiceId = $storageInvoice->id;
|
||||
@@ -194,8 +195,8 @@ class CheckStorageInvoiceTransactionProcessor
|
||||
else if($storageInvoice){
|
||||
$amount = $storageInvoice->amount;
|
||||
$epsilon = 0.0001; // Tolerance for the comparison
|
||||
Log::channel('storage_invoices')->info('$transaction->id,: '.$transaction->id);
|
||||
Log::channel('storage_invoices')->info('$storageInvoice->status,: '.$storageInvoice->status);
|
||||
Log::channel('storage_invoices')->info('Updated $transaction->id: '.$transaction->id);
|
||||
Log::channel('storage_invoices')->info('$storageInvoice->status: '.$storageInvoice->status);
|
||||
Log::channel('storage_invoices')->info('price_cbm: '.$price_cbm."-".gettype($price_cbm));
|
||||
|
||||
if(abs($price_cbm - $amount) > $epsilon && $storageInvoice->status !== ApprovalStatus::COMPLETED){
|
||||
|
||||
Reference in New Issue
Block a user