Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

Commit

Permalink
feat: POS Support Create New Order From RMA (#842)
Browse files Browse the repository at this point in the history
  • Loading branch information
elsiosanchez authored Sep 6, 2023
1 parent 3097a70 commit 606d317
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 24 deletions.
54 changes: 30 additions & 24 deletions components/ADempiere/Form/VPOS/Options/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -501,15 +501,15 @@
</el-card>
</el-col>
<!-- Create New Order RMA -->
<el-col v-if="allowsReturnOrder" :span="size" style="padding-left: 12px;padding-right: 12px;padding-bottom: 10px;">
<el-col v-if="isOnlyRMA" :span="size" style="padding-left: 12px;padding-right: 12px;padding-bottom: 10px;">
<el-card shadow="hover" style="height: 100px">
<p
:class="classblockOption"
@click="adviserPin ? validateOption($t('form.pos.optionsPoinSales.salesOrder.copyOrder')) : newOrderRMA()"
@click="adviserPin ? validateOption($t('form.pos.optionsPoinSales.salesOrder.newOrderFromRMA')) : newOrderRMA()"
>
<i class="el-icon-document-copy" />
<br>
{{ $t('form.pos.createNewOrderRMA') }}
{{ $t('form.pos.optionsPoinSales.salesOrder.newOrderFromRMA') }}
</p>
</el-card>
</el-col>
Expand Down Expand Up @@ -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'

Expand Down Expand Up @@ -1299,6 +1302,9 @@ export default {
isAllowsAllocateSeller() {
return this.currentPointOfSales.isAllowsAllocateSeller
},
isOnlyRMA() {
return this.currentOrder.isRma
},
allowsConfirmShipment() {
return this.currentPointOfSales.isAllowsConfirmShipment
},
Expand Down Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions components/ADempiere/Form/VPOS/OrderList/fastOrder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,14 @@ export default {
},
isVisible: false,
isShow: true
},
{
title: this.$t('form.byInvoice.return'),
params: {
isOnlyRMA: true
},
isVisible: false,
isShow: true
}
]
},
Expand Down

0 comments on commit 606d317

Please sign in to comment.