mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-08-07 18:25:45 +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
|
||||
}
|
||||
},
|
||||
{
|
||||
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
|
||||
{
|
||||
tableName,
|
||||
@ -119,62 +101,10 @@ export default [
|
||||
handleActionKeyPerformed: true,
|
||||
handleActionPerformed: true,
|
||||
handleContentSelection: true,
|
||||
displayLogic: `@TenderType@<>'X' & @TenderType@<>'Z'`,
|
||||
displayLogic: `@TenderType@<>'X'|| @TenderType@<>'Z'`,
|
||||
size: 24,
|
||||
isActiveLogics: 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">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>{{ $t('form.pos.collect.overdrawnInvoice.above') }}</span>
|
||||
<span style="float: right">
|
||||
<b>Limite Diario USD 20,00$ = Bs.S 85.000.000,00 </b> | <b>Disponible Bs.S 85.000.000,00 </b>
|
||||
<span style="float: right;text-align: end">
|
||||
<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>
|
||||
</div>
|
||||
<div class="text item">
|
||||
@ -222,7 +223,18 @@ export default {
|
||||
caseOrder() {
|
||||
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() {
|
||||
console.log(this.$store.getters.posAttributes.currentPointOfSales)
|
||||
const tenderType = this.$store.getters.getValueOfField({
|
||||
containerUuid: 'OverdrawnInvoice',
|
||||
columnName: 'TenderType'
|
||||
@ -236,7 +248,7 @@ export default {
|
||||
return this.fieldsList.filter(field => field.sequence <= 2)
|
||||
},
|
||||
hiddenFieldsList() {
|
||||
return this.fieldsList.filter(field => field.sequence > 4)
|
||||
return this.fieldsList.filter(field => field.sequence >= 3)
|
||||
},
|
||||
listCurrency() {
|
||||
return this.$store.getters.getCurrenciesList
|
||||
|
@ -34,7 +34,7 @@
|
||||
<el-card shadow="hover">
|
||||
<p
|
||||
style="cursor: pointer; text-align: center !important; color: black;min-height: 50px;"
|
||||
@click="allowsCreateOrder ? '' : newOrder"
|
||||
@click="!allowsCreateOrder ? '' : newOrder"
|
||||
>
|
||||
<i class="el-icon-news" />
|
||||
<br>
|
||||
@ -99,7 +99,7 @@
|
||||
</el-card>
|
||||
</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">
|
||||
<p
|
||||
:style="blockOption"
|
||||
@ -137,15 +137,15 @@
|
||||
</p>
|
||||
</el-card>
|
||||
</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">
|
||||
<p
|
||||
: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" />
|
||||
<br>
|
||||
Crear Nueva Orden de Devolución
|
||||
{{ $t('form.pos.optionsPoinSales.salesOrder.createNewReturnOrder') }}
|
||||
</p>
|
||||
</el-card>
|
||||
</el-col>
|
||||
@ -394,10 +394,7 @@ export default {
|
||||
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
|
||||
return this.$store.getters.posAttributes.currentPointOfSales.isAllowsCreateOrder
|
||||
},
|
||||
isShowProductsPriceList: {
|
||||
get() {
|
||||
@ -541,7 +538,7 @@ export default {
|
||||
},
|
||||
optionPin(action) {
|
||||
switch (action.label) {
|
||||
case 'Crear Nueva Orden de Devolución':
|
||||
case this.$t('form.pos.optionsPoinSales.salesOrder.createNewReturnOrder'):
|
||||
this.createNewCustomerReturnOrder()
|
||||
break
|
||||
case this.$t('form.pos.optionsPoinSales.salesOrder.completePreparedOrder'):
|
||||
|
@ -94,7 +94,7 @@
|
||||
</el-tag>
|
||||
</el-col>
|
||||
<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') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
|
@ -17,7 +17,8 @@
|
||||
import {
|
||||
findProduct,
|
||||
updateOrderLine,
|
||||
deleteOrderLine
|
||||
deleteOrderLine,
|
||||
processOrder
|
||||
} from '@/api/ADempiere/form/point-of-sales.js'
|
||||
import {
|
||||
formatDate,
|
||||
@ -57,10 +58,7 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
allowsCreateOrder() {
|
||||
if (!this.isEmptyValue(this.$store.getters.posAttributes.currentPointOfSales.isAllowsCreateOrder)) {
|
||||
return this.$store.getters.posAttributes.currentPointOfSales.isAllowsCreateOrder
|
||||
}
|
||||
return false
|
||||
return this.$store.getters.posAttributes.currentPointOfSales.isAllowsCreateOrder
|
||||
},
|
||||
allowsCollectOrder() {
|
||||
return this.$store.getters.posAttributes.currentPointOfSales.isAllowsCollectOrder
|
||||
@ -282,6 +280,8 @@ export default {
|
||||
showClose: true
|
||||
})
|
||||
})
|
||||
} else if (action.type === 'maximumRefundAllowed') {
|
||||
this.refundAllowed(action.posUuid, action.orderUuid, action.payments)
|
||||
} else if (action.type === 'actionPos') {
|
||||
switch (action.action) {
|
||||
case 'changeWarehouse':
|
||||
@ -304,6 +304,44 @@ export default {
|
||||
this.$store.dispatch('changePopoverOverdrawnInvoice', { visible: false })
|
||||
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() {
|
||||
if (this.isEmptyValue(this.currentPointOfSales)) {
|
||||
this.$message({
|
||||
@ -511,7 +549,7 @@ export default {
|
||||
},
|
||||
deleteOrderLine(lineSelection) {
|
||||
if (this.isPosRequiredPin) {
|
||||
if (this.adviserPin) {
|
||||
if (this.allowsModifyQuantity) {
|
||||
deleteOrderLine({
|
||||
orderLineUuid: lineSelection.uuid
|
||||
})
|
||||
@ -545,7 +583,7 @@ export default {
|
||||
case 'ProductValue':
|
||||
// this.findProduct(mutation.payload.value)
|
||||
// if (this.isPosRequiredPin) {
|
||||
if (!this.allowsCreateOrder) {
|
||||
if (this.allowsCreateOrder) {
|
||||
this.findProduct(mutation.payload.value)
|
||||
} else {
|
||||
const attributePin = {
|
||||
|
@ -500,7 +500,10 @@ export default {
|
||||
returned: 'Your change is',
|
||||
coupon: 'Generate a Gift Card or Vale',
|
||||
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: {
|
||||
|
@ -476,7 +476,10 @@ export default {
|
||||
returned: 'Su vuelto es',
|
||||
coupon: 'Generar una Tarjeta de Regalo o Vale',
|
||||
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: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user