purchase order value must match booking total up to 2 decimal

This commit is contained in:
omair saleh
2021-05-25 10:52:48 +08:00
parent b9697ba890
commit ea86da26d7
@@ -123,17 +123,17 @@
<div class="font-heading all-caps fs-12 bold">Total:</div>
</div>
<div class="col-auto text-right">
<div class="font-heading muted"><span v-if="!submitted" class="bold m-r-5" :class="[{'text-danger' : poTotal !== data.amount}, {'text-success' : poTotal === data.amount}]">{{(Math.round(( poTotal + Number.EPSILON) * 100) / 100).toFixed(2)}}/</span><span class="text-primary bold m-l-5">{{(Math.round((data.amount + Number.EPSILON) * 100) / 100).toFixed(2)}} {{data.fixed_currency.short_code}}</span></div>
<div class="font-heading muted"><span v-if="!submitted" class="bold m-r-5" :class="[{'text-danger' : (Math.round((poTotal + Number.EPSILON) * 100) / 100).toFixed(2) !== (Math.round((data.amount + Number.EPSILON) * 100) / 100).toFixed(2)}, {'text-success' : poTotal === data.amount}]">{{(Math.round(( poTotal + Number.EPSILON) * 100) / 100).toFixed(2)}}/</span><span class="text-primary bold m-l-5">{{(Math.round((data.amount + Number.EPSILON) * 100) / 100).toFixed(2)}} {{data.fixed_currency.short_code}}</span></div>
</div>
</div>
<div class="row" v-if="poTotal > 0 && !submitted">
<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()">{{poTotal !== data.amount ? '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="poTotal !== data.amount">
<div class="row" v-if="(Math.round((poTotal + Number.EPSILON) * 100) / 100).toFixed(2) !== data.amount">
<div class="col">
<div class="fs-10">** you purchase order will be saved but wont be approved until your <span class="text-danger bold all-caps">purchase order's total</span> matches your <span class="text-success bold all-caps">transfer order's total</span>.</div>
</div>