purchase order value must match booking total up to 2 decimal

This commit is contained in:
omair saleh
2021-05-25 10:58:53 +08:00
parent ea86da26d7
commit 3bdc1177cc
2 changed files with 2 additions and 2 deletions
@@ -104,7 +104,7 @@ class CreatePurchaseOrderTransactionLogic extends AbstractControllerLogic
!$transaction ? $transaction = $this->createsTransaction->execute($booking, $object) : $transaction = $this->updatesTransaction->execute($transaction, $object);
$this->updatesTransactionStatus->execute($transaction, $total === $booking->fix_amount ? ApprovalStatus::PENDING_VERIFICATION : ApprovalStatus::PENDING_SUBMISSION);
$this->updatesTransactionStatus->execute($transaction, (float)number_format((float)$total , 2, '.', '') === (float)number_format((float)$booking->fix_amount, 2, '.', '') ? ApprovalStatus::PENDING_VERIFICATION : ApprovalStatus::PENDING_SUBMISSION);
$this->deletesTransactionDetails->execute($transaction);
@@ -130,7 +130,7 @@
<div class="col">
<div class="row m-b-10">
<div class="col">
<button class="btn btn-xs all-caps b-rad-none btn-primary btn-block" @click="submitForm()">{{(Math.round((poTotal + Number.EPSILON) * 100) / 100).toFixed(2) !== (Math.round((data.amount + Number.EPSILON) * 100) / 100).toFixed(2) ? 'Save Purchase Order' : 'Save & Confirm'}}</button>
<button class="btn btn-xs all-caps b-rad-none btn-primary btn-block" @click="submitForm()">{{(Math.round((poTotal + Number.EPSILON) * 100) / 100).toFixed(2) !== (Math.round((data.amount + Number.EPSILON) * 100) / 100).toFixed(2) ? 'Save Purchase Order' : 'Save & Confirm'}}</button>
</div>
</div>
<div class="row" v-if="(Math.round((poTotal + Number.EPSILON) * 100) / 100).toFixed(2) !== data.amount">