fix bill seeder

This commit is contained in:
omair saleh
2022-02-22 01:23:48 +08:00
parent 06802e1f78
commit e37290c527
@@ -178,6 +178,7 @@ class CreateInvoiceTransactionProcessor
ApprovalStatus::COMPLETED,
'purchase_orders'
);
/** @var Document $document */
$document = $this->createsDocument->execute($po_order_transaction->booking, $document_object);
$this->createsFile->execute($document, $document_object);
@@ -210,9 +211,8 @@ class CreateInvoiceTransactionProcessor
$booking_currency_average_rate = $this->calculatesBookingCurrencyAverageRate->execute($booking, TransactionType::BILL);
$transaction = $booking->transactions()
->where('type', TransactionType::BILL)
->first();
$transaction = $booking->transactions()->payments()->where('status', ApprovalStatus::COMPLETED)->first()
->transactions()->where('type', TransactionType::BILL)->first();
$transaction_object = new TransactionObject(
$billNumber,