mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
1688 PO Automation Project, minor business logic fix
This commit is contained in:
@@ -240,6 +240,26 @@ class TransactionObject implements DataTransferObject
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the amount.
|
||||
*
|
||||
* @param float $amount
|
||||
* @return void
|
||||
*/
|
||||
public function setAmount(float $amount): void
|
||||
{
|
||||
$this->amount = $amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the original amount.
|
||||
*
|
||||
* @param float $originalAmount
|
||||
* @return void
|
||||
*/
|
||||
public function setOriginalAmount(float $originalAmount): void
|
||||
{
|
||||
$this->originalAmount = $originalAmount;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+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