diff --git a/components/ADempiere/Form/VPOS/Options/index.vue b/components/ADempiere/Form/VPOS/Options/index.vue index 3c2e2c22..5d196a63 100644 --- a/components/ADempiere/Form/VPOS/Options/index.vue +++ b/components/ADempiere/Form/VPOS/Options/index.vue @@ -501,15 +501,15 @@ - +


- {{ $t('form.pos.createNewOrderRMA') }} + {{ $t('form.pos.optionsPoinSales.salesOrder.newOrderFromRMA') }}

@@ -1012,6 +1012,9 @@ import { copyOrder, processOrder } from '@/api/ADempiere/form/point-of-sales.js' +import { + newOrderFromRMA +} from '@/api/ADempiere/form/ReturnRMA.js' import { createShipment, shipments } from '@/api/ADempiere/form/point-of-sales.js' import { validatePin } from '@/api/ADempiere/form/point-of-sales.js' @@ -1299,6 +1302,9 @@ export default { isAllowsAllocateSeller() { return this.currentPointOfSales.isAllowsAllocateSeller }, + isOnlyRMA() { + return this.currentOrder.isRma + }, allowsConfirmShipment() { return this.currentPointOfSales.isAllowsConfirmShipment }, @@ -2135,29 +2141,29 @@ export default { // }) }, newOrderRMA() { - if (isEmptyValue(this.currentOrder.uuid)) { + if (isEmptyValue(this.currentOrder.id)) { 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 - // }) - // }) + 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 diff --git a/components/ADempiere/Form/VPOS/OrderList/fastOrder.vue b/components/ADempiere/Form/VPOS/OrderList/fastOrder.vue index 91024a64..569f9649 100644 --- a/components/ADempiere/Form/VPOS/OrderList/fastOrder.vue +++ b/components/ADempiere/Form/VPOS/OrderList/fastOrder.vue @@ -402,6 +402,14 @@ export default { }, isVisible: false, isShow: true + }, + { + title: this.$t('form.byInvoice.return'), + params: { + isOnlyRMA: true + }, + isVisible: false, + isShow: true } ] },