diff --git a/app/Classes/Jobs/Commands/V2/ProcessSalesInvoiceReportV2CommandJob.php b/app/Classes/Jobs/Commands/V2/ProcessSalesInvoiceReportV2CommandJob.php index 008a900e..1870346c 100644 --- a/app/Classes/Jobs/Commands/V2/ProcessSalesInvoiceReportV2CommandJob.php +++ b/app/Classes/Jobs/Commands/V2/ProcessSalesInvoiceReportV2CommandJob.php @@ -14,6 +14,7 @@ use Illuminate\Foundation\Bus\Dispatchable; use Illuminate\Queue\InteractsWithQueue; use Illuminate\Queue\SerializesModels; use App\Models\Order; +use App\Models\Transaction; use Illuminate\Support\Facades\Log; @@ -39,8 +40,6 @@ class ProcessSalesInvoiceReportV2CommandJob implements ShouldQueue $start = new Carbon(); $docNo = $this->details['docno'] ?? null; - $remark1 = $this->details['remark1'] ?? null; - $remark2 = $this->details['remark2'] ?? null; $docDate = $this->details['docdate'] ?? null; $debtorCode = $this->details['debtorcode'] ?? null; $ref = $this->details['ref'] ?? null; @@ -63,8 +62,6 @@ class ProcessSalesInvoiceReportV2CommandJob implements ShouldQueue // Log for debugging Log::info("Processing Sales Invoice Report:", [ 'DocNo' => $docNo, - 'Remark1' => $remark1, - 'Remark2' => $remark2, 'DocDate' => $docDate, 'DebtorCode' => $debtorCode, 'Ref' => $ref, @@ -86,24 +83,25 @@ class ProcessSalesInvoiceReportV2CommandJob implements ShouldQueue ]); - $order = Order::where('reference', $ref)->first(); - $transactions = $order->transactions()->whereIn('transactions.type', [TransactionType::SHIPPING_INVOICE, TransactionType::STORAGE_INVOICE])->get(); - $matchedTransaction = null; - foreach ($transactions as $transaction) { - $transactionDetails = $transaction->transactionDetails; - foreach ($transactionDetails as $detail) { - $detailName = str_replace('
', ' ', $detail->name); - if ( - $detailName === $furtherDescription && - $detail->quantity == $qty && - $detail->price == $unitPrice - ) { - $matchedTransaction = $transaction; - break 2; - } - } - } + // $order = Order::where('reference', $ref)->first(); + // $transactions = $order->transactions()->whereIn('transactions.type', [TransactionType::SHIPPING_INVOICE, TransactionType::STORAGE_INVOICE])->get(); + // $matchedTransaction = null; + // foreach ($transactions as $transaction) { + // $transactionDetails = $transaction->transactionDetails; + // foreach ($transactionDetails as $detail) { + // $detailName = str_replace('
', ' ', $detail->name); + // if ( + // $detailName === $furtherDescription && + // $detail->quantity == $qty && + // $detail->price == $unitPrice + // ) { + // $matchedTransaction = $transaction; + // break 2; + // } + // } + // } + $matchedTransaction = Transaction::where('bill_no', $ref)->first(); if($matchedTransaction){ if($docNo != "" && $docNo != "<>"){ $this->updateOrCreateKeyValuePair($matchedTransaction, KVPKey::AUTOCOUNT_DOCNO_INVOICE, $docNo); diff --git a/app/Classes/Modules/Exports/Services/ExportsSalesInvoicesReport.php b/app/Classes/Modules/Exports/Services/ExportsSalesInvoicesReport.php index 76d405ce..6cdaf565 100644 --- a/app/Classes/Modules/Exports/Services/ExportsSalesInvoicesReport.php +++ b/app/Classes/Modules/Exports/Services/ExportsSalesInvoicesReport.php @@ -32,8 +32,6 @@ class ExportsSalesInvoicesReport implements FromQuery, WithHeadings, WithHeading return [ 'DocNo', 'DocDate', - 'Remark1', - 'Remark2', 'DebtorCode', 'Ref', 'ShipInfo', @@ -155,10 +153,8 @@ class ExportsSalesInvoicesReport implements FromQuery, WithHeadings, WithHeading $rows[] = [ $firstItem ? '<>' : '', //DocNo $formattedDocumentDate, //DocDate - $transaction->id, //Remark1 - $transaction->bill_no, //Remark2 $company->debtor, //DebtorCode - $order->reference, //Ref + $transaction->bill_no, //Ref $order->reference, //ShipInfo '500-0000', //AccNo 'SERVICE OR ITEM :', //DetailDescription diff --git a/app/Classes/Modules/Imports/Services/AutoCountDataImport.php b/app/Classes/Modules/Imports/Services/AutoCountDataImport.php index 5542c14b..f24ad979 100644 --- a/app/Classes/Modules/Imports/Services/AutoCountDataImport.php +++ b/app/Classes/Modules/Imports/Services/AutoCountDataImport.php @@ -59,7 +59,7 @@ class AutoCountDataImport implements ToCollection, WithHeadingRow, WithChunkRead { $optionalColumn = 'einvoicevalidationlink'; $salesInvoiceHeader = - ['docno', 'docdate', 'remark1', 'remark2', 'debtorcode', 'ref', + ['docno', 'docdate', 'debtorcode', 'ref', 'shipinfo', 'accno', 'detaildescription', 'furtherdescription', 'classification', 'projno', 'deptno', 'qty', 'unitprice', 'taxcode', 'taxableamt', 'taxrate', 'submiteinvoice', 'consolidatedeinvoice']; diff --git a/resources/views/pages/pdfs/shipping_einvoice_inner.blade.php b/resources/views/pages/pdfs/shipping_einvoice_inner.blade.php index 7716f35a..065ec493 100644 --- a/resources/views/pages/pdfs/shipping_einvoice_inner.blade.php +++ b/resources/views/pages/pdfs/shipping_einvoice_inner.blade.php @@ -157,7 +157,7 @@ -
+
Please transfer the payment to:
Bank: Maybank Berhad
@@ -169,22 +169,24 @@
- - - - - - - - - - -
- -
-

{{ $autocountEInvoiceValidationLink }}

-
+ +
+ + + +
+ {{ $autocountEInvoiceValidationLink }} +
+
+