fix regenerate invoice function

This commit is contained in:
omair saleh
2022-01-12 04:15:32 +08:00
parent 7f6b254d30
commit a9aabc781e
@@ -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);