mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-24 23:13:59 +00:00
E-Invoice - Fix batch generate E-Invoice not working
This commit is contained in:
@@ -99,7 +99,11 @@ class RegenerateInvoiceBookingV2Processor
|
||||
$this->deletesDocument->execute($row);
|
||||
}
|
||||
|
||||
$this->createInvoiceTransactionProcessor->execute($booking, $firstBillNo, [
|
||||
$kvpCopies = $firstInvoice->attributesKVP->map(function ($kvp) {
|
||||
return $kvp->replicate();
|
||||
});
|
||||
|
||||
$this->createInvoiceTransactionProcessor->execute($booking, $firstBillNo, $kvpCopies, [
|
||||
'generateEInvoice' => true,
|
||||
'generateEInvoiceWithNormalInvoiceTemplate' => $eInvoiceWithNormalInvoiceTemplate,
|
||||
'generateEInvoiceRefund' => $eInvoiceWithRefund,
|
||||
@@ -107,7 +111,7 @@ class RegenerateInvoiceBookingV2Processor
|
||||
]);
|
||||
}
|
||||
else {
|
||||
$this->createInvoiceTransactionProcessor->execute($booking, "", [
|
||||
$this->createInvoiceTransactionProcessor->execute($booking, "", null, [
|
||||
'generateEInvoice' => false,
|
||||
'generateEInvoiceWithNormalInvoiceTemplate' => $eInvoiceWithNormalInvoiceTemplate,
|
||||
'generateEInvoiceRefund' => $eInvoiceWithRefund,
|
||||
|
||||
@@ -88,11 +88,12 @@ class CreateInvoiceTransactionV2Processor
|
||||
/**
|
||||
* @param Booking $booking
|
||||
* @param String $invoiceNo
|
||||
* @param Illuminate\Support\Collection<\App\Models\KeyValuePair> $kvpCopies
|
||||
* @param array $options
|
||||
* @return void
|
||||
* @throws MalformedRequestException
|
||||
*/
|
||||
public function execute(Booking $booking, String $invoiceNo= "", array $options = [])
|
||||
public function execute(Booking $booking, String $invoiceNo= "", $kvpCopies = null, array $options = [])
|
||||
{
|
||||
$generateEInvoice = $options['generateEInvoice'] ?? false;
|
||||
$generateEInvoiceWithNormalInvoiceTemplate = $options['generateEInvoiceWithNormalInvoiceTemplate'] ?? false;
|
||||
@@ -220,6 +221,12 @@ class CreateInvoiceTransactionV2Processor
|
||||
);
|
||||
$invoice_transaction = $this->createsTransaction->execute($purchaseOrder->booking ?? $booking, $transaction_object);
|
||||
|
||||
if ($kvpCopies) {
|
||||
foreach ($kvpCopies as $kvp) {
|
||||
$invoice_transaction->attributesKVP()->save($kvp);
|
||||
}
|
||||
}
|
||||
|
||||
$voucherRedemption = $transaction->voucherRedemption;
|
||||
|
||||
// purchase order
|
||||
|
||||
Reference in New Issue
Block a user