diff --git a/src/api/ADempiere/form/point-of-sales.js b/src/api/ADempiere/form/point-of-sales.js
index c5a5e60f..b11c8e9b 100644
--- a/src/api/ADempiere/form/point-of-sales.js
+++ b/src/api/ADempiere/form/point-of-sales.js
@@ -906,7 +906,7 @@ export function listCurrencies({
* Tender Type
* @param {string} posUuidd - POS UUID reference
*/
-export function listTenderType({
+export function listTenderTypes({
posUuid
}) {
return request({
diff --git a/src/components/ADempiere/Form/VPOS/BusinessPartner/businessPartnerCreate.vue b/src/components/ADempiere/Form/VPOS/BusinessPartner/businessPartnerCreate.vue
index c1e108dd..0a4be469 100644
--- a/src/components/ADempiere/Form/VPOS/BusinessPartner/businessPartnerCreate.vue
+++ b/src/components/ADempiere/Form/VPOS/BusinessPartner/businessPartnerCreate.vue
@@ -91,6 +91,26 @@ export default {
unsubscribe: () => {}
}
},
+ computed: {
+ adviserPin() {
+ const value = this.$store.getters.getValueOfField({
+ containerUuid: this.containerUuid,
+ columnName: 'Value'
+ })
+ const name = this.$store.getters.getValueOfField({
+ containerUuid: this.containerUuid,
+ columnName: 'Name'
+ })
+ const isSeller = this.$store.getters.posAttributes.currentPointOfSales.isAisleSeller
+ if (!this.isEmptyValue(value) && !this.isEmptyValue(name) && isSeller) {
+ return isSeller
+ }
+ return false
+ },
+ currentPointOfSales() {
+ return this.$store.getters.posAttributes.currentPointOfSales
+ }
+ },
watch: {
showField(value) {
if (value) {
@@ -123,7 +143,7 @@ export default {
containerUuid: this.containerUuid,
formatReturn: 'name'
})
- if (this.isEmptyValue(emptyMandatoryFields)) {
+ if (this.isEmptyValue(emptyMandatoryFields) || this.adviserPin) {
this.isLoadingRecord = true
createCustomer(values)
.then(responseBPartner => {
diff --git a/src/components/ADempiere/Form/VPOS/Collection/index.vue b/src/components/ADempiere/Form/VPOS/Collection/index.vue
index 8dda8cc4..4ab7bb65 100644
--- a/src/components/ADempiere/Form/VPOS/Collection/index.vue
+++ b/src/components/ADempiere/Form/VPOS/Collection/index.vue
@@ -199,6 +199,8 @@
+ {{ $t('form.pos.collect.convertedAmount') }}: {{ formatPrice(currentOrder.grandTotal / totalAmountConverted, currentPointOfSales.displayCurrency.iso_code) }}
+
{{ $t('form.pos.collect.pending') }}:
@@ -477,6 +479,13 @@ export default {
}
return true
},
+ isPosRequiredPin() {
+ const pos = this.$store.getters.posAttributes.currentPointOfSales
+ if (!this.isEmptyValue(pos.isPosRequiredPin)) {
+ return pos.isPosRequiredPin
+ }
+ return false
+ },
validPay() {
const containerUuid = this.containerUuid
// filter by visible fields
@@ -582,6 +591,21 @@ export default {
},
overUnderPayment() {
return this.$store.state['pointOfSales/payments/index'].dialogoInvoce.success
+ },
+ totalAmountConverted() {
+ const conversionsList = this.$store.state['pointOfSales/point/index'].conversionsList
+ if (this.isEmptyValue(conversionsList) && !this.isEmptyValue(this.currentPointOfSales.conversionTypeUuid)) {
+ return 1
+ }
+ const converted = conversionsList.find(converted => {
+ if (converted.conversionTypeUuid === this.currentPointOfSales.conversionTypeUuid) {
+ return converted
+ }
+ })
+ if (!this.isEmptyValue(converted)) {
+ return converted.divideRate
+ }
+ return 1
}
},
watch: {
@@ -900,6 +924,17 @@ export default {
if (this.pay > this.currentOrder.grandTotal) {
this.$store.commit('dialogoInvoce', { show: true, type: 1 })
} else if (this.pay < this.currentOrder.grandTotal) {
+ if (this.isPosRequiredPin) {
+ const attributePin = {
+ ...payment,
+ action: 'openBalanceInvoice',
+ type: 'actionPos',
+ label: this.$t('form.pos.pinMessage.invoiceOpen')
+ }
+ this.visible = true
+ this.$store.dispatch('changePopoverOverdrawnInvoice', { attributePin, visible: true })
+ return
+ }
this.$store.commit('dialogoInvoce', { show: true, type: 2 })
} else {
this.completePreparedOrder(payment)
diff --git a/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/index.vue b/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/index.vue
index d1079677..78a47c37 100644
--- a/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/index.vue
+++ b/src/components/ADempiere/Form/VPOS/Collection/overdrawnInvoice/index.vue
@@ -21,7 +21,7 @@
:title="$t('form.pos.collect.overdrawnInvoice.title')"
:visible.sync="showDialogo"
:before-close="close"
- width="70%"
+ width="80%"
@close="close"
>
@@ -61,6 +61,9 @@
{{ $t('form.pos.collect.overdrawnInvoice.above') }}
+
+ Limite Diario USD 20,00$ = Bs.S 85.000.000,00 | Disponible Bs.S 85.000.000,00
+
+
+
+
+
+
+
+
field.sequence <= 3)
+ return this.fieldsList.filter(field => field.sequence <= 2)
},
hiddenFieldsList() {
return this.fieldsList.filter(field => field.sequence > 4)
@@ -237,6 +257,9 @@ export default {
},
emptyMandatoryFields() {
return this.$store.getters.getFieldsListEmptyMandatory({ containerUuid: 'OverdrawnInvoice', formatReturn: 'name' })
+ },
+ paymentTypeList() {
+ return this.$store.getters.getPaymentTypeList
}
},
methods: {
@@ -266,6 +289,15 @@ export default {
changeCurrency(value) {
this.currentFieldCurrency = value
},
+ changePaymentType(value) {
+ this.$store.commit('currentTenderChange', value)
+ this.currentPaymentType = value
+ this.$store.commit('updateValueOfField', {
+ containerUuid: 'OverdrawnInvoice',
+ columnName: 'TenderType',
+ value: value
+ })
+ },
optionSelected({ posUuid, orderUuid, customerDetails, payments }) {
switch (this.option) {
case 2:
diff --git a/src/components/ADempiere/Form/VPOS/Options/index.vue b/src/components/ADempiere/Form/VPOS/Options/index.vue
index 3e130c15..cf805373 100644
--- a/src/components/ADempiere/Form/VPOS/Options/index.vue
+++ b/src/components/ADempiere/Form/VPOS/Options/index.vue
@@ -34,7 +34,7 @@
@@ -90,7 +90,7 @@
@@ -103,7 +103,7 @@
@@ -129,7 +129,7 @@
@@ -137,8 +137,7 @@
-
-
+
{{ item.name }}
@@ -357,6 +356,15 @@ export default {
}
},
computed: {
+ allowsReturnOrder() {
+ return this.$store.getters.posAttributes.currentPointOfSales.isAllowsReturnOrder
+ },
+ allowsCreateOrder() {
+ if (!this.isEmptyValue(this.$store.getters.posAttributes.currentPointOfSales.isAllowsCreateOrder)) {
+ return this.$store.getters.posAttributes.currentPointOfSales.isAllowsCreateOrder
+ }
+ return false
+ },
isShowProductsPriceList: {
get() {
return this.$store.state['pointOfSales/point/index'].productPrice.isShowPopoverMenu
@@ -380,7 +388,13 @@ export default {
}
}
},
+ adviserPin() {
+ return this.$store.getters.posAttributes.currentPointOfSales.isAisleSeller
+ },
blockOption() {
+ if (this.adviserPin) {
+ return 'cursor: not-allowed; text-align: center !important; color: gray;min-height: 50px;'
+ }
if (!this.isEmptyValue(this.currentOrder.uuid)) {
return 'cursor: pointer; text-align: center !important; color: black;min-height: 50px;'
}
@@ -536,9 +550,11 @@ export default {
})
},
createNewCustomerReturnOrder() {
- createNewReturnOrder({
- orderUuid: this.$route.query.action
- })
+ if (this.isPosRequiredPin) {
+ createNewReturnOrder({
+ orderUuid: this.$route.query.action
+ })
+ }
},
showModal(action) {
this.$store.dispatch('setShowDialog', {
diff --git a/src/components/ADempiere/Form/VPOS/Order/index.vue b/src/components/ADempiere/Form/VPOS/Order/index.vue
index fd39f639..cfdd50b8 100644
--- a/src/components/ADempiere/Form/VPOS/Order/index.vue
+++ b/src/components/ADempiere/Form/VPOS/Order/index.vue
@@ -91,7 +91,7 @@
-
+
{{ $t('form.pos.optionsPoinSales.salesOrder.newOrder') }}
@@ -148,7 +148,7 @@
label-position="top"
style="float: right;display: contents;line-height: 30px;"
>
-
+
@@ -206,7 +206,7 @@
-
+
{{ labelButtonCollections }}
@@ -314,20 +315,20 @@
{{ $t('form.pos.order.order') }}: {{ currentOrder.documentNo }}
{{ $t('form.pos.order.date') }}:
-
+
{{ orderDate }}
{{ $t('form.pos.order.type') }}:{{ currentOrder.documentType.name }}
{{ $t('form.pos.order.itemQuantity') }}
-
+
{{ getItemQuantity }}
{{ $t('form.pos.order.numberLines') }}
-
+
{{ numberOfLines }}
@@ -341,7 +342,7 @@
{{ $t('form.pos.order.total') }}:
-
+
0) {
this.convertedAmount()
@@ -675,6 +690,8 @@ export default {
setTimeout(() => {
this.focusPin()
}, 500)
+ } else {
+ this.$store.dispatch('changePopoverOverdrawnInvoice', { visible: value })
}
}
},
@@ -701,33 +718,6 @@ export default {
focusPin() {
this.$refs.pin.focus()
},
- // openPin(pin) {
- // validatePin({
- // posUuid: this.currentPointOfSales.uuid,
- // pin
- // })
- // .then(response => {
- // this.validatePin = false
- // this.pin = ''
- // this.visible = false
- // this.pinAction(this.attributePin)
- // })
- // .catch(error => {
- // console.error(error.message)
- // this.$message({
- // type: 'error',
- // message: error.message,
- // showClose: true
- // })
- // this.pin = ''
- // })
- // .finally(() => {
- // this.closePin()
- // })
- // },
- // closePin() {
- // this.visible = false
- // },
closeConvertion() {
this.seeConversion = false
},
@@ -747,35 +737,47 @@ export default {
return this.formatPrice(this.currentOrder.grandTotal - this.currentOrder.totalLines, currency)
},
newOrder() {
+ this.clearOrder()
this.$store.commit('setShowPOSCollection', false)
- this.createOrder({ withLine: false, newOrder: true })
+ this.createOrder({ withLine: false, newOrder: true, customer: this.currentPointOfSales.templateBusinessPartner.uuid })
},
changePos(pointOfSales) {
this.$store.dispatch('setCurrentPOS', pointOfSales)
this.clearOrder()
},
changeWarehouse(warehouse) {
- this.attributePin = {
+ const attributePin = {
...warehouse,
action: 'changeWarehouse',
- type: 'actionPos'
+ type: 'actionPos',
+ label: this.$t('form.pos.pinMessage.warehouse')
}
- this.visible = true
+ const visible = true
+ this.visible = visible
+ this.$store.dispatch('changePopoverOverdrawnInvoice', { attributePin, visible: true })
},
changeDocumentType(documentType) {
- this.attributePin = {
- ...documentType,
- action: 'changeDocumentType',
- type: 'actionPos'
+ if (this.adviserPin) {
+ this.$store.commit('setCurrentDocumentTypePos', documentType)
+ } else {
+ const attributePin = {
+ ...documentType,
+ action: 'changeDocumentType',
+ type: 'actionPos',
+ label: this.$t('form.pos.pinMessage.documentType')
+ }
+ this.$store.dispatch('changePopoverOverdrawnInvoice', { attributePin, visible: true })
+ this.visible = true
}
- this.visible = true
},
changePriceList(priceList) {
- this.attributePin = {
+ const attributePin = {
...priceList,
action: 'changePriceList',
- type: 'actionPos'
+ type: 'actionPos',
+ label: this.$t('form.pos.pinMessage.priceList')
}
+ this.$store.dispatch('changePopoverOverdrawnInvoice', { attributePin, visible: true })
this.visible = true
},
arrowTop() {
@@ -797,41 +799,6 @@ export default {
this.currentOrderLine = this.listOrderLine[this.currentTable]
}
}
- // pinAction(action) {
- // if (action.type === 'updateOrder') {
- // switch (action.columnName) {
- // case 'QtyEntered':
- // case 'PriceEntered':
- // case 'Discount':
- // this.updateOrderLine(action)
- // break
- // case 'C_DocTypeTarget_ID': {
- // const documentTypeUuid = this.$store.getters.getValueOfField({
- // containerUuid: this.$route.meta.uuid,
- // columnName: 'C_DocTypeTarget_ID_UUID'
- // })
- // this.$store.dispatch('updateOrder', {
- // orderUuid: this.$route.query.action,
- // posUuid: this.currentPointOfSales.uuid,
- // documentTypeUuid
- // })
- // break
- // }
- // }
- // } else if (action.type === 'actionPos') {
- // switch (action.action) {
- // case 'changeWarehouse':
- // this.$store.commit('setCurrentWarehousePos', action)
- // break
- // case 'changeDocumentType':
- // this.$store.commit('setCurrentDocumentTypePos', action)
- // break
- // case 'changePriceList':
- // this.$store.commit('setCurrentPriceList', action)
- // break
- // }
- // }
- // }
}
}
diff --git a/src/components/ADempiere/Form/VPOS/posMixin.js b/src/components/ADempiere/Form/VPOS/posMixin.js
index dee9b151..843a2b78 100644
--- a/src/components/ADempiere/Form/VPOS/posMixin.js
+++ b/src/components/ADempiere/Form/VPOS/posMixin.js
@@ -16,7 +16,8 @@
import {
findProduct,
- updateOrderLine
+ updateOrderLine,
+ deleteOrderLine
} from '@/api/ADempiere/form/point-of-sales.js'
import {
formatDate,
@@ -55,8 +56,26 @@ export default {
}
},
computed: {
- getWarehouse() {
- return this.$store.getters['user/getWarehouse']
+ allowsCreateOrder() {
+ if (!this.isEmptyValue(this.$store.getters.posAttributes.currentPointOfSales.isAllowsCreateOrder)) {
+ return this.$store.getters.posAttributes.currentPointOfSales.isAllowsCreateOrder
+ }
+ return false
+ },
+ allowsCollectOrder() {
+ return this.$store.getters.posAttributes.currentPointOfSales.isAllowsCollectOrder
+ },
+ allowsModifyQuantity() {
+ return this.$store.getters.posAttributes.currentPointOfSales.isAllowsModifyQuantity
+ },
+ allowsReturnOrder() {
+ return this.$store.getters.posAttributes.currentPointOfSales.isAllowsReturnOrder
+ },
+ modifyPrice() {
+ return this.$store.getters.posAttributes.currentPointOfSales.isModifyPrice
+ },
+ adviserPin() {
+ return this.$store.getters.posAttributes.currentPointOfSales.isAisleSeller
},
isSetTemplateBP() {
const currentPOS = this.currentPointOfSales
@@ -205,6 +224,11 @@ export default {
this.pin = ''
this.visible = false
this.pinAction(this.attributePin)
+ this.$message({
+ type: 'success',
+ message: 'Acción a realizar',
+ showClose: true
+ })
})
.catch(error => {
console.error(error.message)
@@ -220,6 +244,7 @@ export default {
})
},
pinAction(action) {
+ action = this.isEmptyValue(action) ? this.$store.getters.getOverdrawnInvoice.attributePin : action
if (action.type === 'updateOrder') {
switch (action.columnName) {
case 'QtyEntered':
@@ -240,6 +265,8 @@ export default {
break
}
}
+ } else if (action.type === 'addProduct') {
+ this.findProduct(action.value)
} else if (action.type === 'actionPos') {
switch (action.action) {
case 'changeWarehouse':
@@ -251,11 +278,15 @@ export default {
case 'changePriceList':
this.$store.commit('setCurrentPriceList', action)
break
+ case 'openBalanceInvoice':
+ this.$store.commit('dialogoInvoce', { show: true, type: 2 })
+ break
}
}
},
closePin() {
this.visible = false
+ this.$store.dispatch('changePopoverOverdrawnInvoice', { visible: false })
this.setDocumentType(this.currentOrder.documentType)
},
withoutPOSTerminal() {
@@ -371,7 +402,7 @@ export default {
})
})
},
- createOrder({ withLine = false, newOrder = false }) {
+ createOrder({ withLine = false, newOrder = false, customer }) {
if (this.withoutPOSTerminal()) {
return
}
@@ -393,6 +424,9 @@ export default {
if (this.isEmptyValue(customerUuid) || id === 1000006) {
customerUuid = this.currentPointOfSales.templateBusinessPartner.uuid
}
+ if (customer) {
+ customerUuid = customer
+ }
// user session
this.$store.dispatch('createOrder', {
posUuid,
@@ -460,30 +494,91 @@ export default {
getOrderTax(currency) {
return this.formatPrice(this.currentOrder.grandTotal - this.currentOrder.totalLines, currency)
},
+ deleteOrderLine(lineSelection) {
+ if (this.isPosRequiredPin) {
+ if (this.adviserPin) {
+ deleteOrderLine({
+ orderLineUuid: lineSelection.uuid
+ })
+ .then(response => {
+ this.$store.dispatch('reloadOrder', { orderUuid: this.$store.getters.posAttributes.currentPointOfSales.currentOrder.uuid })
+ })
+ .catch(error => {
+ console.error(error.message)
+ this.$message({
+ type: 'error',
+ message: error.message,
+ showClose: true
+ })
+ })
+ } else {
+ const attributePin = {
+ ...lineSelection,
+ type: 'deleteLine',
+ label: this.$t('form.pos.pinMessage.delete')
+ }
+ this.$store.dispatch('changePopoverOverdrawnInvoice', { attributePin, visible: true })
+ this.visible = true
+ }
+ }
+ },
subscribeChanges() {
return this.$store.subscribe((mutation, state) => {
// TODO: Add container uuid comparison
if (mutation.type === 'addActionKeyPerformed') {
switch (mutation.payload.columnName) {
case 'ProductValue':
- this.findProduct(mutation.payload.value)
+ // this.findProduct(mutation.payload.value)
+ // if (this.isPosRequiredPin) {
+ if (!this.allowsCreateOrder) {
+ this.findProduct(mutation.payload.value)
+ } else {
+ const attributePin = {
+ ...mutation.payload,
+ type: 'addProduct',
+ label: this.$t('form.pos.pinMessage.addProduct')
+ }
+ this.$store.dispatch('changePopoverOverdrawnInvoice', { attributePin, visible: true })
+ this.visible = true
+ }
+ // } else {
+ // this.findProduct(mutation.payload.value)
+ // }
break
}
} else if (mutation.type === 'addActionPerformed') {
switch (mutation.payload.columnName) {
case 'QtyEntered':
- if (!this.isEmptyValue(this.$store.state['pointOfSales/orderLine/index'].line)) {
+ if (this.isPosRequiredPin && !this.isEmptyValue(this.$store.state['pointOfSales/orderLine/index'].line)) {
+ if (this.allowsModifyQuantity) {
+ this.updateOrderLine(mutation.payload)
+ } else {
+ const attributePin = {
+ ...mutation.payload,
+ type: 'updateOrder',
+ label: this.$t('form.pos.pinMessage.qtyEntered')
+ }
+ this.$store.dispatch('changePopoverOverdrawnInvoice', { attributePin, visible: true })
+ this.visible = true
+ }
+ } else if (!this.isEmptyValue(this.$store.state['pointOfSales/orderLine/index'].line)) {
this.updateOrderLine(mutation.payload)
}
break
case 'PriceEntered':
case 'Discount':
if (this.isPosRequiredPin && !this.isEmptyValue(this.$store.state['pointOfSales/orderLine/index'].line)) {
- this.attributePin = {
- ...mutation.payload,
- type: 'updateOrder'
+ if (this.modifyPrice) {
+ this.updateOrderLine(mutation.payload)
+ } else {
+ const attributePin = {
+ ...mutation.payload,
+ type: 'updateOrder',
+ label: mutation.payload.columnName === 'PriceEntered' ? this.$t('form.pos.pinMessage.price') : this.$t('form.pos.pinMessage.discount')
+ }
+ this.$store.dispatch('changePopoverOverdrawnInvoice', { attributePin, visible: true })
+ this.visible = true
}
- this.visible = true
} else if (!this.isEmptyValue(this.$store.state['pointOfSales/orderLine/index'].line)) {
this.updateOrderLine(mutation.payload)
}
@@ -494,10 +589,11 @@ export default {
columnName: 'C_DocTypeTarget_ID_UUID'
})
if (this.isPosRequiredPin && !this.isEmptyValue(documentTypeUuid) && !this.isEmptyValue(this.currentOrder.documentType.uuid)) {
- this.attributePin = {
+ const attributePin = {
...mutation.payload,
type: 'updateOrder'
}
+ this.$store.dispatch('changePopoverOverdrawnInvoice', { attributePin, visible: true })
this.visible = true
} else if (!this.isEmptyValue(documentTypeUuid) && !this.isEmptyValue(this.currentOrder.documentType.uuid)) {
this.$store.dispatch('updateOrder', {
diff --git a/src/lang/ADempiere/en.js b/src/lang/ADempiere/en.js
index 14639cda..5f2abd35 100644
--- a/src/lang/ADempiere/en.js
+++ b/src/lang/ADempiere/en.js
@@ -505,6 +505,18 @@ export default {
},
keyLayout: {
noProducto: 'No product available. Back to top'
+ },
+ pinMessage: {
+ pin: 'Enter pin for ',
+ documentType: 'change document type',
+ warehouse: 'change warehouse',
+ price: 'change price',
+ qtyEntered: 'change quantity',
+ priceList: 'change price list',
+ discount: 'add discount',
+ delete: 'delete product',
+ addProduct: 'add product',
+ invoiceOpen: 'generate invoice with an open balance'
}
},
priceChecking: {
diff --git a/src/lang/ADempiere/es.js b/src/lang/ADempiere/es.js
index d2f22853..813f5abe 100644
--- a/src/lang/ADempiere/es.js
+++ b/src/lang/ADempiere/es.js
@@ -481,6 +481,18 @@ export default {
},
keyLayout: {
noProducto: 'No hay producto disponible Regresar al Principio'
+ },
+ pinMessage: {
+ pin: 'Ingrese pin para ',
+ documentType: 'cambiar tipo de documento',
+ warehouse: 'cambiar almacen',
+ price: 'cambiar precio',
+ qtyEntered: 'cambiar cantidad',
+ priceList: 'cambiar lista de precio',
+ discount: 'agregar descuento',
+ delete: 'eliminar producto',
+ addProduct: 'agregar producto',
+ invoiceOpen: 'generar factura con un saldo abierto'
}
},
priceChecking: {
diff --git a/src/store/modules/ADempiere/pointOfSales/getters/index.js b/src/store/modules/ADempiere/pointOfSales/getters/index.js
index 466643ab..eaa19281 100644
--- a/src/store/modules/ADempiere/pointOfSales/getters/index.js
+++ b/src/store/modules/ADempiere/pointOfSales/getters/index.js
@@ -144,5 +144,9 @@ export default {
// Current POS, it can be s
getCurrenciesList: (state) => {
return state.currenciesList
+ },
+ // get Payment type list
+ getPaymentTypeList: (state) => {
+ return state.tenderTypes
}
}
diff --git a/src/store/modules/ADempiere/pointOfSales/point/actions.js b/src/store/modules/ADempiere/pointOfSales/point/actions.js
index 1d64bf8d..dea7301f 100644
--- a/src/store/modules/ADempiere/pointOfSales/point/actions.js
+++ b/src/store/modules/ADempiere/pointOfSales/point/actions.js
@@ -19,6 +19,7 @@ import {
listPointOfSales,
listWarehouses,
listDocumentTypes,
+ listTenderTypes,
listPrices,
listCurrencies
} from '@/api/ADempiere/form/point-of-sales.js'
@@ -126,6 +127,22 @@ export default {
})
})
},
+ listTenderTypesFromServer({ commit }, posUuid) {
+ listTenderTypes({
+ posUuid
+ })
+ .then(response => {
+ commit('setTenderTypesList', response.records)
+ })
+ .catch(error => {
+ console.warn(`listTenderTypesFromServer: ${error.message}. Code: ${error.code}.`)
+ showMessage({
+ type: 'error',
+ message: error.message,
+ showClose: true
+ })
+ })
+ },
setCurrentPOS({ commit, dispatch, state, rootGetters }, posToSet) {
commit('setCurrentPointOfSales', posToSet)
const oldRoute = router.app._route
@@ -143,10 +160,11 @@ export default {
dispatch('listWarehousesFromServer', posToSet.uuid)
dispatch('listDocumentTypesFromServer', posToSet.uuid)
dispatch('listCurrenciesFromServer', posToSet.uuid)
+ dispatch('listTenderTypesFromServer', posToSet.uuid)
dispatch('listPricesFromServer', posToSet)
commit('setCurrentPriceList', posToSet.priceList)
commit('setCurrentDocumentTypePos', posToSet.documentType)
- commit('setCurrentWarehousePos', rootGetters['user/getWarehouse'])
+ commit('setCurrentWarehousePos', posToSet.warehouse)
commit('resetConversionRate', [])
commit('setIsReloadKeyLayout')
commit('setIsReloadProductPrice')
diff --git a/src/store/modules/ADempiere/pointOfSales/point/mutations.js b/src/store/modules/ADempiere/pointOfSales/point/mutations.js
index 3750c26e..4ed55b56 100644
--- a/src/store/modules/ADempiere/pointOfSales/point/mutations.js
+++ b/src/store/modules/ADempiere/pointOfSales/point/mutations.js
@@ -43,6 +43,12 @@ export default {
setCurrenciesList(state, currenciesList) {
state.currenciesList = currenciesList
},
+ setTenderTypesList(state, tenderTypes) {
+ state.tenderTypes = tenderTypes
+ },
+ currentTenderChange(state, tenderChange) {
+ state.tenderChange = tenderChange
+ },
addConversionToList(state, conversion) {
state.conversionsList.push(conversion)
},
diff --git a/src/store/modules/ADempiere/pointOfSales/point/state.js b/src/store/modules/ADempiere/pointOfSales/point/state.js
index c058b7a2..aa5cc25b 100644
--- a/src/store/modules/ADempiere/pointOfSales/point/state.js
+++ b/src/store/modules/ADempiere/pointOfSales/point/state.js
@@ -37,6 +37,8 @@ export default {
listCurrency: [],
currenciesList: [],
conversionsList: [],
+ tenderTypes: [],
+ tenderChange: '',
currentPointOfSales: {},
showPOSOptions: false,
showPOSKeyLayout: false,
diff --git a/src/store/modules/ADempiere/utils.js b/src/store/modules/ADempiere/utils.js
index 6db01530..0275bdc0 100644
--- a/src/store/modules/ADempiere/utils.js
+++ b/src/store/modules/ADempiere/utils.js
@@ -31,7 +31,10 @@ const initStateUtils = {
updateOrder: false,
updatePayment: false,
createBusinessPartner: false,
- step: 0
+ step: 0,
+ overdrawnInvoice: {
+ visible: false
+ }
}
export default {
@@ -109,6 +112,9 @@ export default {
},
popoverCreateBusinessPartner(state, createBusinessPartner) {
state.createBusinessPartner = createBusinessPartner
+ },
+ popoverOverdrawnInvoice(state, payload) {
+ state.overdrawnInvoice = payload
}
},
actions: {
@@ -178,6 +184,13 @@ export default {
},
changePopover({ commit }, params) {
commit('popoverCreateBusinessPartner', params)
+ },
+ changePopoverOverdrawnInvoice({ commit }, { attributePin, visible }) {
+ const overdrawn = {
+ attributePin,
+ visible
+ }
+ commit('popoverOverdrawnInvoice', overdrawn)
}
},
getters: {
@@ -256,6 +269,9 @@ export default {
},
getStepCurrent: (state) => {
return state.step
+ },
+ getOverdrawnInvoice: (state) => {
+ return state.overdrawnInvoice
}
}
}