E-Invoice - Do not allow customer to edit PO when customer already has payment pending verification

This commit is contained in:
Dillon Ngo
2025-05-31 21:33:56 +08:00
parent cec2fe58f8
commit a82ab56a43
@@ -188,12 +188,12 @@
<div class="col" v-if="submitted">
<div class="alert alert-success padding-15" role="alert">
<div class="font-heading fs-12 all-caps bold m-b-15">Your Purchase Order {{data.purchase_order.status === 1 ? 'is Being Processed for Verification' : 'has been Approved' }}</div>
<div class="row m-b-15" v-if="(Math.round((data.paid_amount + Number.EPSILON) * 100) / 100) === 0">
<div class="row m-b-15" v-if="allowPOEditing">
<div class="col">
<div class="font-heading fs-10">If you would like to still edit your Purchase Order you can do that by clicking on the edit button below, but your purchase order verification request will be reset.</div>
</div>
</div>
<button class="btn btn-xs all-caps b-rad-none btn-default bg-master-lightest w-100" @click="submitted = false" v-if="(Math.round((data.paid_amount + Number.EPSILON) * 100) / 100) === 0">Edit Purchase Order</button>
<button class="btn btn-xs all-caps b-rad-none btn-default bg-master-lightest w-100" @click="submitted = false" v-if="allowPOEditing">Edit Purchase Order</button>
<!-- <button class="btn btn-xs all-caps b-rad-none btn-default bg-master-lightest w-100" @click="submitted = false" >Edit Purchase Order</button> -->
<button class="btn btn-xs all-caps b-rad-none btn-complete w-100 m-t-5" v-if="!data.documents.proforma_invoice && data.outstanding_amount != 0" @click="submit(route('api.booking.proforma.create', data.id), 'post', section, true, true)">Generate Proforma Invoice</button>
</div>
@@ -246,6 +246,12 @@
return this.products.reduce(function(last, product) {
return last + product.total;
}, 0);
},
allowPOEditing() {
const noPaymentsMade = Math.round((this.data.paid_amount + Number.EPSILON) * 100) / 100 === 0;
const noPendingVerifications = this.data.payment_history.every(payment => payment.status !== 1);
return noPaymentsMade && noPendingVerifications;
}
},
watch: {