mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-08-10 20:39:48 +08:00
Add daily limit and limit per transaction (#1089)
Co-authored-by: elsiosanchez <elsiossanches@gmail.com>
This commit is contained in:
parent
f8bdcebed7
commit
37eb7240f9
@ -91,24 +91,6 @@ export default [
|
|||||||
isMandatory: true
|
isMandatory: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
tableName,
|
|
||||||
elementColumnName: 'DateTrx',
|
|
||||||
isFromDictionary: true,
|
|
||||||
overwriteDefinition: {
|
|
||||||
sequence: 5,
|
|
||||||
handleFocusGained: true,
|
|
||||||
handleFocusLost: true,
|
|
||||||
handleKeyPressed: true,
|
|
||||||
handleKeyReleased: true,
|
|
||||||
handleActionKeyPerformed: true,
|
|
||||||
handleActionPerformed: true,
|
|
||||||
size: 24,
|
|
||||||
displayLogic: `@TenderType@=='K'`,
|
|
||||||
isActiveLogics: true,
|
|
||||||
isMandatory: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// Bank
|
// Bank
|
||||||
{
|
{
|
||||||
tableName,
|
tableName,
|
||||||
@ -119,62 +101,10 @@ export default [
|
|||||||
handleActionKeyPerformed: true,
|
handleActionKeyPerformed: true,
|
||||||
handleActionPerformed: true,
|
handleActionPerformed: true,
|
||||||
handleContentSelection: true,
|
handleContentSelection: true,
|
||||||
displayLogic: `@TenderType@<>'X' & @TenderType@<>'Z'`,
|
displayLogic: `@TenderType@<>'X'|| @TenderType@<>'Z'`,
|
||||||
size: 24,
|
size: 24,
|
||||||
isActiveLogics: true,
|
isActiveLogics: true,
|
||||||
isMandatory: true
|
isMandatory: true
|
||||||
}
|
}
|
||||||
},
|
|
||||||
// type credit card
|
|
||||||
{
|
|
||||||
tableName,
|
|
||||||
elementColumnName: 'CreditCardType',
|
|
||||||
columnName: 'CreditCardType',
|
|
||||||
isFromDictionary: true,
|
|
||||||
overwriteDefinition: {
|
|
||||||
sequence: 7,
|
|
||||||
defaultValue: 'M',
|
|
||||||
handleActionKeyPerformed: true,
|
|
||||||
handleContentSelection: true,
|
|
||||||
handleActionPerformed: true,
|
|
||||||
size: 24,
|
|
||||||
displayLogic: `@TenderType@=='C'`,
|
|
||||||
isActiveLogics: true,
|
|
||||||
isMandatory: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// number credit card
|
|
||||||
{
|
|
||||||
tableName,
|
|
||||||
elementColumnName: 'CreditCardNumber',
|
|
||||||
columnName: 'CreditCardNumber',
|
|
||||||
isFromDictionary: true,
|
|
||||||
overwriteDefinition: {
|
|
||||||
sequence: 8,
|
|
||||||
handleActionKeyPerformed: true,
|
|
||||||
handleContentSelection: true,
|
|
||||||
handleActionPerformed: true,
|
|
||||||
size: 24,
|
|
||||||
displayLogic: `@TenderType@=='C'`,
|
|
||||||
isActiveLogics: true,
|
|
||||||
isMandatory: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// accountno
|
|
||||||
{
|
|
||||||
tableName,
|
|
||||||
elementColumnName: 'AccountNo',
|
|
||||||
columnName: 'AccountNo',
|
|
||||||
isFromDictionary: true,
|
|
||||||
overwriteDefinition: {
|
|
||||||
sequence: 9,
|
|
||||||
handleActionKeyPerformed: true,
|
|
||||||
handleContentSelection: true,
|
|
||||||
handleActionPerformed: true,
|
|
||||||
size: 24,
|
|
||||||
displayLogic: `@TenderType@=='M' || @TenderType@=='D'`,
|
|
||||||
isActiveLogics: true,
|
|
||||||
isMandatory: true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -60,8 +60,9 @@
|
|||||||
<el-card v-if="option === 3" class="box-card">
|
<el-card v-if="option === 3" class="box-card">
|
||||||
<div slot="header" class="clearfix">
|
<div slot="header" class="clearfix">
|
||||||
<span>{{ $t('form.pos.collect.overdrawnInvoice.above') }}</span>
|
<span>{{ $t('form.pos.collect.overdrawnInvoice.above') }}</span>
|
||||||
<span style="float: right">
|
<span style="float: right;text-align: end">
|
||||||
<b>Limite Diario USD 20,00$ = Bs.S 85.000.000,00 </b> | <b>Disponible Bs.S 85.000.000,00 </b>
|
<b>{{ $t('form.pos.collect.overdrawnInvoice.dailyLimit') }}: {{ formatPrice(maximumDailyRefundAllowed, currency.iSOCode) }} | {{ formatPrice(0, isoCode) }} | {{ $t('form.pos.collect.overdrawnInvoice.available') }}: {{ formatPrice(maximumDailyRefundAllowed, currency.iSOCode) }} | {{ formatPrice(0, isoCode) }}</b> <br>
|
||||||
|
<b>{{ $t('form.pos.collect.overdrawnInvoice.customerLimit') }}: {{ formatPrice(maximumRefundAllowed, currency.iSOCode) }} | {{ formatPrice(0, isoCode) }} </b>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="text item">
|
<div class="text item">
|
||||||
@ -222,7 +223,18 @@ export default {
|
|||||||
caseOrder() {
|
caseOrder() {
|
||||||
return this.$store.state['pointOfSales/payments/index'].dialogoInvoce.type
|
return this.$store.state['pointOfSales/payments/index'].dialogoInvoce.type
|
||||||
},
|
},
|
||||||
|
isoCode() {
|
||||||
|
return this.$store.getters.posAttributes.currentPointOfSales.displayCurrency.iso_code
|
||||||
|
},
|
||||||
|
maximumDailyRefundAllowed() {
|
||||||
|
console.log(this.$store.getters.posAttributes.currentPointOfSales.displayCurrency.iso_code)
|
||||||
|
return this.$store.getters.posAttributes.currentPointOfSales.maximumDailyRefundAllowed
|
||||||
|
},
|
||||||
|
maximumRefundAllowed() {
|
||||||
|
return this.$store.getters.posAttributes.currentPointOfSales.maximumRefundAllowed
|
||||||
|
},
|
||||||
displayeCurrency() {
|
displayeCurrency() {
|
||||||
|
console.log(this.$store.getters.posAttributes.currentPointOfSales)
|
||||||
const tenderType = this.$store.getters.getValueOfField({
|
const tenderType = this.$store.getters.getValueOfField({
|
||||||
containerUuid: 'OverdrawnInvoice',
|
containerUuid: 'OverdrawnInvoice',
|
||||||
columnName: 'TenderType'
|
columnName: 'TenderType'
|
||||||
@ -236,7 +248,7 @@ export default {
|
|||||||
return this.fieldsList.filter(field => field.sequence <= 2)
|
return this.fieldsList.filter(field => field.sequence <= 2)
|
||||||
},
|
},
|
||||||
hiddenFieldsList() {
|
hiddenFieldsList() {
|
||||||
return this.fieldsList.filter(field => field.sequence > 4)
|
return this.fieldsList.filter(field => field.sequence >= 3)
|
||||||
},
|
},
|
||||||
listCurrency() {
|
listCurrency() {
|
||||||
return this.$store.getters.getCurrenciesList
|
return this.$store.getters.getCurrenciesList
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
<el-card shadow="hover">
|
<el-card shadow="hover">
|
||||||
<p
|
<p
|
||||||
style="cursor: pointer; text-align: center !important; color: black;min-height: 50px;"
|
style="cursor: pointer; text-align: center !important; color: black;min-height: 50px;"
|
||||||
@click="allowsCreateOrder ? '' : newOrder"
|
@click="!allowsCreateOrder ? '' : newOrder"
|
||||||
>
|
>
|
||||||
<i class="el-icon-news" />
|
<i class="el-icon-news" />
|
||||||
<br>
|
<br>
|
||||||
@ -99,7 +99,7 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="size" style="padding-left: 12px;padding-right: 12px;padding-bottom: 10px;">
|
<el-col v-if="allowsReturnOrder" :span="size" style="padding-left: 12px;padding-right: 12px;padding-bottom: 10px;">
|
||||||
<el-card shadow="hover">
|
<el-card shadow="hover">
|
||||||
<p
|
<p
|
||||||
:style="blockOption"
|
:style="blockOption"
|
||||||
@ -137,15 +137,15 @@
|
|||||||
</p>
|
</p>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col v-if="allowsReturnOrder" :span="size" style="padding-left: 12px;padding-right: 12px;padding-bottom: 10px;">
|
<el-col :span="size" style="padding-left: 12px;padding-right: 12px;padding-bottom: 10px;">
|
||||||
<el-card shadow="hover">
|
<el-card shadow="hover">
|
||||||
<p
|
<p
|
||||||
:style="blockOption"
|
:style="blockOption"
|
||||||
@click="adviserPin ? validateOption('Crear Nueva Orden de Devolución') : createNewCustomerReturnOrder"
|
@click="adviserPin ? validateOption($t('form.pos.optionsPoinSales.salesOrder.createNewReturnOrder')) : createNewCustomerReturnOrder"
|
||||||
>
|
>
|
||||||
<i class="el-icon-refresh-left" />
|
<i class="el-icon-refresh-left" />
|
||||||
<br>
|
<br>
|
||||||
Crear Nueva Orden de Devolución
|
{{ $t('form.pos.optionsPoinSales.salesOrder.createNewReturnOrder') }}
|
||||||
</p>
|
</p>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -394,10 +394,7 @@ export default {
|
|||||||
return this.$store.getters.posAttributes.currentPointOfSales.isAllowsReturnOrder
|
return this.$store.getters.posAttributes.currentPointOfSales.isAllowsReturnOrder
|
||||||
},
|
},
|
||||||
allowsCreateOrder() {
|
allowsCreateOrder() {
|
||||||
if (!this.isEmptyValue(this.$store.getters.posAttributes.currentPointOfSales.isAllowsCreateOrder)) {
|
return this.$store.getters.posAttributes.currentPointOfSales.isAllowsCreateOrder
|
||||||
return this.$store.getters.posAttributes.currentPointOfSales.isAllowsCreateOrder
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
},
|
},
|
||||||
isShowProductsPriceList: {
|
isShowProductsPriceList: {
|
||||||
get() {
|
get() {
|
||||||
@ -541,7 +538,7 @@ export default {
|
|||||||
},
|
},
|
||||||
optionPin(action) {
|
optionPin(action) {
|
||||||
switch (action.label) {
|
switch (action.label) {
|
||||||
case 'Crear Nueva Orden de Devolución':
|
case this.$t('form.pos.optionsPoinSales.salesOrder.createNewReturnOrder'):
|
||||||
this.createNewCustomerReturnOrder()
|
this.createNewCustomerReturnOrder()
|
||||||
break
|
break
|
||||||
case this.$t('form.pos.optionsPoinSales.salesOrder.completePreparedOrder'):
|
case this.$t('form.pos.optionsPoinSales.salesOrder.completePreparedOrder'):
|
||||||
|
@ -94,7 +94,7 @@
|
|||||||
</el-tag>
|
</el-tag>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="14" style="padding-left: 0px; padding-right: 0px;">
|
<el-col :span="14" style="padding-left: 0px; padding-right: 0px;">
|
||||||
<el-button type="primary" :disabled="allowsCreateOrder" plain @click="newOrder">
|
<el-button type="primary" :disabled="!allowsCreateOrder" plain @click="newOrder">
|
||||||
{{ $t('form.pos.optionsPoinSales.salesOrder.newOrder') }}
|
{{ $t('form.pos.optionsPoinSales.salesOrder.newOrder') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -17,7 +17,8 @@
|
|||||||
import {
|
import {
|
||||||
findProduct,
|
findProduct,
|
||||||
updateOrderLine,
|
updateOrderLine,
|
||||||
deleteOrderLine
|
deleteOrderLine,
|
||||||
|
processOrder
|
||||||
} from '@/api/ADempiere/form/point-of-sales.js'
|
} from '@/api/ADempiere/form/point-of-sales.js'
|
||||||
import {
|
import {
|
||||||
formatDate,
|
formatDate,
|
||||||
@ -57,10 +58,7 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
allowsCreateOrder() {
|
allowsCreateOrder() {
|
||||||
if (!this.isEmptyValue(this.$store.getters.posAttributes.currentPointOfSales.isAllowsCreateOrder)) {
|
return this.$store.getters.posAttributes.currentPointOfSales.isAllowsCreateOrder
|
||||||
return this.$store.getters.posAttributes.currentPointOfSales.isAllowsCreateOrder
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
},
|
},
|
||||||
allowsCollectOrder() {
|
allowsCollectOrder() {
|
||||||
return this.$store.getters.posAttributes.currentPointOfSales.isAllowsCollectOrder
|
return this.$store.getters.posAttributes.currentPointOfSales.isAllowsCollectOrder
|
||||||
@ -282,6 +280,8 @@ export default {
|
|||||||
showClose: true
|
showClose: true
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
} else if (action.type === 'maximumRefundAllowed') {
|
||||||
|
this.refundAllowed(action.posUuid, action.orderUuid, action.payments)
|
||||||
} else if (action.type === 'actionPos') {
|
} else if (action.type === 'actionPos') {
|
||||||
switch (action.action) {
|
switch (action.action) {
|
||||||
case 'changeWarehouse':
|
case 'changeWarehouse':
|
||||||
@ -304,6 +304,44 @@ export default {
|
|||||||
this.$store.dispatch('changePopoverOverdrawnInvoice', { visible: false })
|
this.$store.dispatch('changePopoverOverdrawnInvoice', { visible: false })
|
||||||
this.setDocumentType(this.currentOrder.documentType)
|
this.setDocumentType(this.currentOrder.documentType)
|
||||||
},
|
},
|
||||||
|
refundAllowed(posUuid, orderUuid, payments) {
|
||||||
|
this.$store.dispatch('updateOrderPos', true)
|
||||||
|
this.$store.dispatch('updatePaymentPos', true)
|
||||||
|
this.$message({
|
||||||
|
type: 'info',
|
||||||
|
message: this.$t('notifications.processing'),
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
processOrder({
|
||||||
|
posUuid,
|
||||||
|
orderUuid,
|
||||||
|
createPayments: !this.isEmptyValue(payments),
|
||||||
|
payments: payments
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
this.$store.dispatch('reloadOrder', response.uuid)
|
||||||
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: this.$t('notifications.completed'),
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
this.$message({
|
||||||
|
type: 'error',
|
||||||
|
message: error.message,
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.$store.dispatch('listOrdersFromServer', {
|
||||||
|
posUuid: this.currentPointOfSales.uuid
|
||||||
|
})
|
||||||
|
this.$store.dispatch('updateOrderPos', false)
|
||||||
|
this.$store.dispatch('updatePaymentPos', false)
|
||||||
|
this.$store.commit('dialogoInvoce', { show: false })
|
||||||
|
})
|
||||||
|
},
|
||||||
withoutPOSTerminal() {
|
withoutPOSTerminal() {
|
||||||
if (this.isEmptyValue(this.currentPointOfSales)) {
|
if (this.isEmptyValue(this.currentPointOfSales)) {
|
||||||
this.$message({
|
this.$message({
|
||||||
@ -511,7 +549,7 @@ export default {
|
|||||||
},
|
},
|
||||||
deleteOrderLine(lineSelection) {
|
deleteOrderLine(lineSelection) {
|
||||||
if (this.isPosRequiredPin) {
|
if (this.isPosRequiredPin) {
|
||||||
if (this.adviserPin) {
|
if (this.allowsModifyQuantity) {
|
||||||
deleteOrderLine({
|
deleteOrderLine({
|
||||||
orderLineUuid: lineSelection.uuid
|
orderLineUuid: lineSelection.uuid
|
||||||
})
|
})
|
||||||
@ -545,7 +583,7 @@ export default {
|
|||||||
case 'ProductValue':
|
case 'ProductValue':
|
||||||
// this.findProduct(mutation.payload.value)
|
// this.findProduct(mutation.payload.value)
|
||||||
// if (this.isPosRequiredPin) {
|
// if (this.isPosRequiredPin) {
|
||||||
if (!this.allowsCreateOrder) {
|
if (this.allowsCreateOrder) {
|
||||||
this.findProduct(mutation.payload.value)
|
this.findProduct(mutation.payload.value)
|
||||||
} else {
|
} else {
|
||||||
const attributePin = {
|
const attributePin = {
|
||||||
|
@ -500,7 +500,10 @@ export default {
|
|||||||
returned: 'Your change is',
|
returned: 'Your change is',
|
||||||
coupon: 'Generate a Gift Card or Vale',
|
coupon: 'Generate a Gift Card or Vale',
|
||||||
returnMoney: 'Return money in another form of payment',
|
returnMoney: 'Return money in another form of payment',
|
||||||
adjustDocument: 'You want to Adjust Document'
|
adjustDocument: 'You want to Adjust Document',
|
||||||
|
dailyLimit: 'Daily Limit',
|
||||||
|
customerLimit: 'Customer Limit',
|
||||||
|
available: 'Available'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
keyLayout: {
|
keyLayout: {
|
||||||
|
@ -476,7 +476,10 @@ export default {
|
|||||||
returned: 'Su vuelto es',
|
returned: 'Su vuelto es',
|
||||||
coupon: 'Generar una Tarjeta de Regalo o Vale',
|
coupon: 'Generar una Tarjeta de Regalo o Vale',
|
||||||
returnMoney: 'Devolver dinero en otra forma de pago',
|
returnMoney: 'Devolver dinero en otra forma de pago',
|
||||||
adjustDocument: 'Desea Ajustar Documento'
|
adjustDocument: 'Desea Ajustar Documento',
|
||||||
|
dailyLimit: 'Limite Diario',
|
||||||
|
customerLimit: 'Limite Cliente',
|
||||||
|
available: 'Disponible'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
keyLayout: {
|
keyLayout: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user