mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-28 17:03:59 +00:00
fix regenerate invoice function
This commit is contained in:
@@ -93,9 +93,15 @@ class RegenerateInvoiceBookingLogic extends AbstractControllerLogic
|
||||
|
||||
$this->updatesBookingStatus->execute($booking, ApprovalStatus::APPROVED);
|
||||
|
||||
$booking->transactions()->whereIn('type', [TransactionType::INVOICE, TransactionType::SUPPLIER_DELIVER])->delete();
|
||||
$transaction = $booking->transactions()->whereIn('type', [TransactionType::INVOICE, TransactionType::SUPPLIER_DELIVER])->get();
|
||||
foreach ($transaction as $key => $row) {
|
||||
$this->deletesTransaction->execute($row);
|
||||
}
|
||||
|
||||
$booking->documents()->delete();
|
||||
$document = $booking->documents()->get();
|
||||
foreach ($document as $key => $row) {
|
||||
$this->deletesDocument->execute($row);
|
||||
}
|
||||
|
||||
$this->createInvoiceTransactionProcessor->execute($booking);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user