mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-29 17:34:02 +00:00
1688 PO Automation Project, minor business logic fix
This commit is contained in:
+5
@@ -61,6 +61,11 @@ class CreatePurchaseOrderTransactionProcessor
|
||||
/** @var Transaction $transaction */
|
||||
$transaction = $booking->transactions()->where('type', TransactionType::PURCHASE_ORDER)->first();
|
||||
|
||||
if($append){
|
||||
$object->setAmount($transaction->amount + $object->getAmount());
|
||||
$object->setOriginalAmount($transaction->original_amount + $object->getOriginalAmount());
|
||||
}
|
||||
|
||||
!$transaction ? $transaction = $this->createsTransaction->execute($booking, $object) : $transaction = $this->updatesTransaction->execute($transaction, $object);
|
||||
|
||||
$this->updatesTransactionStatus->execute($transaction, (float) number_format($object->getAmount(), 2, '.', '') === (float) number_format((float)$booking->fix_amount, 2, '.', '') ? ApprovalStatus::PENDING_VERIFICATION : ApprovalStatus::PENDING_SUBMISSION);
|
||||
|
||||
Reference in New Issue
Block a user