From da463f4511d4fdcde8eb28cd0729f71e196b02bf Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Fri, 27 Jun 2025 11:59:36 +0800 Subject: [PATCH] E-Invoice - reinstate old business logic to temporary allow PO to be edited (undo, updated with new business logic) --- .../forms/PurchaseOrderFormComponent.vue | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/resources/assets/vue/components/bookings/forms/PurchaseOrderFormComponent.vue b/resources/assets/vue/components/bookings/forms/PurchaseOrderFormComponent.vue index 83b0bdc9..1009153b 100644 --- a/resources/assets/vue/components/bookings/forms/PurchaseOrderFormComponent.vue +++ b/resources/assets/vue/components/bookings/forms/PurchaseOrderFormComponent.vue @@ -200,8 +200,7 @@
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.
- - + @@ -244,8 +243,8 @@ }, created() { this.products = this.data.purchase_order ? this.data.purchase_order.details : []; - // this.submitted = this.data.purchase_order ? true : false; // - this.submitted = this.data.purchase_order ? this.data.purchase_order.status === 1 || this.data.purchase_order.status === 2: false; + this.submitted = this.data.purchase_order ? true : false; + // this.submitted = this.data.purchase_order ? this.data.purchase_order.status === 1 || this.data.purchase_order.status === 2: false; }, computed: { productTotal(){ @@ -266,15 +265,18 @@ const outstandingAmount = Math.round((this.data.outstanding_amount + Number.EPSILON) * 100) / 100 > 0; const allPaymentApproved = this.data.payment_history.every(payment => payment.status === 2); - return (noPaymentsMade && noPaymentPendingVerifications) || (paymentsMade && outstandingAmount && allPaymentApproved); + //Condition 3 + const adminBeforeApproval = this.$store.getters.isAdmin && !(this.data.purchase_order.status === 2); + + return (noPaymentsMade && noPaymentPendingVerifications) || (paymentsMade && outstandingAmount && allPaymentApproved) || adminBeforeApproval; } }, watch: { 'data': function () { if (this.data && this.data.purchase_order && this.data.purchase_order.details) { this.products = this.data.purchase_order.details; - // this.submitted = this.data.purchase_order ? true : false; - this.submitted = this.data.purchase_order ? this.data.purchase_order.status === 1 || this.data.purchase_order.status === 2: false; + this.submitted = this.data.purchase_order ? true : false; + // this.submitted = this.data.purchase_order ? this.data.purchase_order.status === 1 || this.data.purchase_order.status === 2: false; } else { this.products = []; }