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 = []; }