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 daily limit and limit per transaction #1089

Merged
merged 1 commit into from
Aug 20, 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
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -119,60 +101,8 @@ export default [
handleActionKeyPerformed: true,
handleActionPerformed: true,
handleContentSelection: true,
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,
displayLogic: `@TenderType@<>'X'|| @TenderType@<>'Z'`,
size: 24,
displayLogic: `@TenderType@=='M' || @TenderType@=='D'`,
isActiveLogics: true,
isMandatory: true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down Expand Up @@ -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'
Expand All @@ -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
Expand Down
17 changes: 7 additions & 10 deletions src/components/ADempiere/Form/VPOS/Options/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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'):
Expand Down
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 @@
</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>
Expand Down
52 changes: 45 additions & 7 deletions src/components/ADempiere/Form/VPOS/posMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
import {
findProduct,
updateOrderLine,
deleteOrderLine
deleteOrderLine,
processOrder
} from '@/api/ADempiere/form/point-of-sales.js'
import {
formatDate,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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':
Expand All @@ -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({
Expand Down Expand Up @@ -511,7 +549,7 @@ export default {
},
deleteOrderLine(lineSelection) {
if (this.isPosRequiredPin) {
if (this.adviserPin) {
if (this.allowsModifyQuantity) {
deleteOrderLine({
orderLineUuid: lineSelection.uuid
})
Expand Down Expand Up @@ -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 = {
Expand Down
5 changes: 4 additions & 1 deletion src/lang/ADempiere/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
5 changes: 4 additions & 1 deletion src/lang/ADempiere/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down