mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
E-Invoice - Fix a problem Regenerating E-Invoice does not pick up latest reimport data
This commit is contained in:
@@ -65,6 +65,11 @@ class RegenerateInvoiceBookingV2Processor
|
||||
->orderBy('created_at', 'asc')
|
||||
->first();
|
||||
|
||||
$latestInvoice = $booking->transactions()
|
||||
->whereIn('type', [TransactionType::INVOICE])
|
||||
->latest()
|
||||
->first();
|
||||
|
||||
Log::info('RegenerateInvoiceBookingV2Processor booking: ' . json_encode($booking->marking));
|
||||
|
||||
// get the first bill_no
|
||||
@@ -99,7 +104,7 @@ class RegenerateInvoiceBookingV2Processor
|
||||
$this->deletesDocument->execute($row);
|
||||
}
|
||||
|
||||
$kvpCopies = $firstInvoice->attributesKVP->map(function ($kvp) {
|
||||
$kvpCopies = $latestInvoice->attributesKVP->map(function ($kvp) {
|
||||
return $kvp->replicate();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user