Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Discount Amount and iba Amount columns #1145

Merged
merged 2 commits into from
Sep 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/ADempiere/Form/VPOS/Order/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
>
<template v-for="(valueOrder, item, key) in orderLineDefinition">
<el-table-column
v-if="(valueOrder.columnName === 'ConvertedAmount' && !isEmptyValue(currentPointOfSales.displayCurrency)) || valueOrder.columnName !== 'ConvertedAmount'"
v-if="displayLabel(valueOrder)"
:key="key"
:column-key="valueOrder.columnName"
:label="valueOrder.label"
Expand Down
29 changes: 28 additions & 1 deletion src/components/ADempiere/Form/VPOS/Order/orderLineMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,23 @@ export default {
isNumeric: true,
size: '110px'
},
discountTotal: {
columnName: 'DiscountTotal',
label: this.$t('form.pos.tableProduct.displayDiscuentAmount'),
isNumeric: true,
size: 'auto'
},
discounDisplayTaxAmounttTotal: {
columnName: 'DisplayTaxAmount',
label: this.$t('form.pos.tableProduct.displayTaxAmount'),
isNumeric: true,
size: 'auto'
},
grandTotal: {
columnName: 'GrandTotal',
label: 'Total',
isNumeric: true,
isVisible: true,
size: 'auto'
},
convertedAmount: {
Expand Down Expand Up @@ -225,6 +238,16 @@ export default {
})
}
},
displayLabel(row) {
if (row.columnName === 'ConvertedAmount') {
return !this.isEmptyValue(this.currentPointOfSales.displayCurrency)
} else if (row.columnName === 'DiscountTotal') {
return this.currentPointOfSales.isDisplayDiscount
} else if (row.columnName === 'DisplayTaxAmount') {
return this.currentPointOfSales.isDisplayTaxAmount
}
return true
},
/**
* Show the correct display format
* @param {object} row record
Expand All @@ -242,11 +265,15 @@ export default {
} else if (columnName === 'QtyOrdered') {
return this.formatQuantity(row.quantityOrdered)
} else if (columnName === 'Discount') {
return this.formatPercent(row.discount / 100)
return this.formatQuantity(row.discount) + '%'
} else if (columnName === 'GrandTotal') {
return this.formatPrice(row.grandTotal, currency)
} else if (columnName === 'ConvertedAmount') {
return this.formatPrice(row.grandTotal / this.totalAmountConverted, this.currentPointOfSales.displayCurrency.iso_code)
} else if (columnName === 'DiscountTotal') {
return this.formatPrice(row.priceList * (row.discountRate / 100))
} else if (columnName === 'DisplayTaxAmount') {
return this.formatPrice((row.priceList * row.taxRate.rate / 100))
}
},
productPrice(price, discount) {
Expand Down
2 changes: 2 additions & 0 deletions src/lang/ADempiere/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,8 @@ export default {
editQuantities: 'Edit Quantities',
pin: 'Insert Pin',
remove: 'Remove',
displayTaxAmount: 'Tax Amount',
displayDiscountAmount: 'Amount of Discount',
empty: 'Enter the product name, code or UPC'
},
order: {
Expand Down
2 changes: 2 additions & 0 deletions src/lang/ADempiere/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,8 @@ export default {
editQuantities: 'Editar Cantidades',
pin: 'Ingrese Pin',
remove: 'Eliminar',
displayTaxAmount: 'Monto del Impuesto',
displayDiscuentAmount: 'Monto del Descuento',
empty: 'Ingrese el nombre del producto, código o UPC'
},
order: {
Expand Down