From 47542914715be72c257a731900d02d463d0cfec8 Mon Sep 17 00:00:00 2001 From: Elsio Sanchez <45974454+elsiosanchez@users.noreply.github.com> Date: Mon, 4 Sep 2023 17:16:05 -0400 Subject: [PATCH] Fix: overdrawn invoice (#839) --- .../Collection/overdrawnInvoice/index.vue | 11 ++--- .../ADempiere/Form/VPOS/Options/index.vue | 45 ++++++++++++++++++- .../Form/VPOS/Order/line/editLineMobile.vue | 1 + .../ADempiere/Form/VPOS/Order/line/index.vue | 1 + components/ADempiere/Form/VPOS/posMixin.js | 3 +- .../Form/VPOS/templateDevice/desktop.vue | 1 + 6 files changed, 54 insertions(+), 8 deletions(-) diff --git a/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/index.vue b/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/index.vue index 2bf969be..b6a31d65 100644 --- a/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/index.vue +++ b/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/index.vue @@ -1269,7 +1269,8 @@ export default { openPinPayment(pin) { validatePin({ posUuid: this.currentPointOfSales.uuid, - pin: this.pinPostPayment + pin: this.pinPostPayment, + orderId: this.currentOrder.id }) .then(response => { this.pinPostPayment = '' @@ -1682,7 +1683,7 @@ export default { typeRefund: this.option, action: 'openBalanceInvoice', value: this.currentOrder.openAmount, - requestedAccess: 'IsAllowsInvoiceOpen', + requestedAccess: this.currentPointOfSales.currentOrder.openAmount > 0 ? 'IsAllowsInvoiceOpen' : 'IsAllowsWriteOffAmount', label: this.$t('form.pos.pinMessage.invoiceOpen') } this.visible = true @@ -1777,7 +1778,7 @@ export default { action: 'openBalanceInvoice', type: 'actionPos', label: this.$t('form.pos.pinMessage.invoiceOpen'), - requestedAccess: 'IsAllowsInvoiceOpen' + requestedAccess: this.currentPointOfSales.currentOrder.openAmount > 0 ? 'IsAllowsInvoiceOpen' : 'IsAllowsWriteOffAmount' } this.visible = true this.$store.dispatch('changePopoverOverdrawnInvoice', { attributePin, visible: true }) @@ -1826,7 +1827,7 @@ export default { action: 'openBalanceInvoice', type: 'actionPos', label: this.$t('form.pos.pinMessage.invoiceOpen'), - requestedAccess: 'IsAllowsInvoiceOpen' + requestedAccess: this.currentPointOfSales.currentOrder.openAmount > 0 ? 'IsAllowsInvoiceOpen' : 'IsAllowsWriteOffAmount' } this.visible = true this.$store.dispatch('changePopoverOverdrawnInvoice', { attributePin, visible: true }) @@ -1875,7 +1876,7 @@ export default { action: 'openBalanceInvoice', type: 'actionPos', label: this.$t('form.pos.pinMessage.invoiceOpen'), - requestedAccess: 'IsAllowsInvoiceOpen' + requestedAccess: this.currentPointOfSales.currentOrder.openAmount > 0 ? 'IsAllowsInvoiceOpen' : 'IsAllowsWriteOffAmount' } this.visible = true this.$store.dispatch('sendCreateCustomerAccount', this.$store.getters.getAddRefund) diff --git a/components/ADempiere/Form/VPOS/Options/index.vue b/components/ADempiere/Form/VPOS/Options/index.vue index 956d7d9a..3c2e2c22 100644 --- a/components/ADempiere/Form/VPOS/Options/index.vue +++ b/components/ADempiere/Form/VPOS/Options/index.vue @@ -500,6 +500,19 @@

+ + + +

+ +
+ {{ $t('form.pos.createNewOrderRMA') }} +

+
+
@@ -541,7 +554,7 @@

- +

{ @@ -2117,6 +2134,31 @@ export default { // } // }) }, + newOrderRMA() { + if (isEmptyValue(this.currentOrder.uuid)) { + return '' + } + // newOrderFromRMA({ + // posId: this.currentPointOfSales.id, + // sourceRmaId: this.currentOrder.id, + // salesRepresentativeId: this.currentPointOfSales.salesRepresentative.id + // }) + // .then(response => { + // this.$store.dispatch('reloadOrder', { orderUuid: response.uuid }) + // this.$message({ + // type: 'success', + // message: 'Ok', + // showClose: true + // }) + // }) + // .catch(error => { + // this.$message({ + // type: 'error', + // message: error.message, + // showClose: true + // }) + // }) + }, copyOrder() { // TODO: Support Copy Order if (isEmptyValue(this.currentOrder.uuid)) { @@ -2142,7 +2184,6 @@ export default { showClose: true }) }) - console.info('Support Copy Order', this.currentOrder.uuid) }, copyLineOrder() { const process = this.$store.getters.getProcess(this.posProcess[1].uuid) diff --git a/components/ADempiere/Form/VPOS/Order/line/editLineMobile.vue b/components/ADempiere/Form/VPOS/Order/line/editLineMobile.vue index f21613c9..1e3932fe 100644 --- a/components/ADempiere/Form/VPOS/Order/line/editLineMobile.vue +++ b/components/ADempiere/Form/VPOS/Order/line/editLineMobile.vue @@ -534,6 +534,7 @@ export default { validatePin({ posUuid: this.currentPointOfSales.uuid, pin, + orderId: this.currentOrder.id, requestedAccess }) .then(response => { diff --git a/components/ADempiere/Form/VPOS/Order/line/index.vue b/components/ADempiere/Form/VPOS/Order/line/index.vue index e1da4cf7..4ee7fb3b 100644 --- a/components/ADempiere/Form/VPOS/Order/line/index.vue +++ b/components/ADempiere/Form/VPOS/Order/line/index.vue @@ -534,6 +534,7 @@ export default { validatePin({ posUuid: this.currentPointOfSales.uuid, pin, + orderId: this.currentOrder.id, requestedAccess }) .then(response => { diff --git a/components/ADempiere/Form/VPOS/posMixin.js b/components/ADempiere/Form/VPOS/posMixin.js index 4f307e8e..fa791b98 100644 --- a/components/ADempiere/Form/VPOS/posMixin.js +++ b/components/ADempiere/Form/VPOS/posMixin.js @@ -277,7 +277,8 @@ export default { posUuid: this.currentPointOfSales.uuid, pin, requestedAmount: (typeof value === 'number') ? value : '', - requestedAccess + requestedAccess, + orderId: this.currentOrder.id }) .then(response => { this.validatePin = true diff --git a/components/ADempiere/Form/VPOS/templateDevice/desktop.vue b/components/ADempiere/Form/VPOS/templateDevice/desktop.vue index 7f5e2c5c..48e64775 100644 --- a/components/ADempiere/Form/VPOS/templateDevice/desktop.vue +++ b/components/ADempiere/Form/VPOS/templateDevice/desktop.vue @@ -256,6 +256,7 @@ export default { validatePin({ posUuid: this.$store.getters.posAttributes.currentPointOfSales.uuid, pin: this.inputPin, + orderId: this.currentOrder.id, requestedAccess: this.actionCommand.requestedAccess }) .then(response => {