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

Commit

Permalink
Fix: overdrawn invoice (#839)
Browse files Browse the repository at this point in the history
  • Loading branch information
elsiosanchez authored Sep 4, 2023
1 parent 40261fb commit 4754291
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ''
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 })
Expand Down Expand Up @@ -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 })
Expand Down Expand Up @@ -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)
Expand Down
45 changes: 43 additions & 2 deletions components/ADempiere/Form/VPOS/Options/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,19 @@
</p>
</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-card shadow="hover" style="height: 100px">
<p
:class="classblockOption"
@click="adviserPin ? validateOption($t('form.pos.optionsPoinSales.salesOrder.copyOrder')) : newOrderRMA()"
>
<i class="el-icon-document-copy" />
<br>
{{ $t('form.pos.createNewOrderRMA') }}
</p>
</el-card>
</el-col>
</el-row>
</el-collapse-item>

Expand Down Expand Up @@ -541,7 +554,7 @@
</p>
</el-card>
</el-col>
<el-col v-if="isAllowsCashClosing" :span="size" style="padding-left: 12px;padding-right: 12px;padding-bottom: 10px;">
<el-col v-if="isAllowsDetailCashClosing" :span="size" style="padding-left: 12px;padding-right: 12px;padding-bottom: 10px;">
<el-card shadow="hover" style="height: 100px">
<p
style="cursor: pointer; text-align: center !important; color: black;min-height: 50px;"
Expand Down Expand Up @@ -1277,6 +1290,9 @@ export default {
isAllowsCashClosing() {
return this.currentPointOfSales.isAllowsCashClosing
},
isAllowsDetailCashClosing() {
return this.currentPointOfSales.isAllowsDetailCashClosing
},
isAllowsCashWithdrawal() {
return this.currentPointOfSales.isAllowsCashWithdrawal
},
Expand Down Expand Up @@ -1799,6 +1815,7 @@ export default {
posUuid: this.currentPointOfSales.uuid,
pin,
requestedAccess,
orderId: this.currentOrder.id,
requestedAmount: value
})
.then(response => {
Expand Down Expand Up @@ -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)) {
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,7 @@ export default {
validatePin({
posUuid: this.currentPointOfSales.uuid,
pin,
orderId: this.currentOrder.id,
requestedAccess
})
.then(response => {
Expand Down
1 change: 1 addition & 0 deletions components/ADempiere/Form/VPOS/Order/line/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,7 @@ export default {
validatePin({
posUuid: this.currentPointOfSales.uuid,
pin,
orderId: this.currentOrder.id,
requestedAccess
})
.then(response => {
Expand Down
3 changes: 2 additions & 1 deletion components/ADempiere/Form/VPOS/posMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions components/ADempiere/Form/VPOS/templateDevice/desktop.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down

0 comments on commit 4754291

Please sign in to comment.