feat(client_balance): add maxImport if "cash"
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Vicent Llopis 2021-11-08 08:59:42 +01:00
parent 06b72ae708
commit fbbb1ecdf6
4 changed files with 17 additions and 3 deletions

View File

@ -25,6 +25,9 @@
},
"isAutoConciliated": {
"type": "boolean"
},
"maxAmount": {
"type": "number"
}
},
"acls": [{

View File

@ -44,7 +44,8 @@
label="Amount"
ng-model="$ctrl.amountPaid"
step="0.01"
required="true">
required="true"
max="$ctrl.maxAmount">
</vn-input-number>
</vn-horizontal>
<vn-horizontal>

View File

@ -61,8 +61,14 @@ class Controller extends Dialog {
if (value) {
const accountingType = value.accountingType;
this.receipt.description =
if (this.originalDescription) {
this.receipt.description =
`${accountingType && accountingType.receiptDescription}, ${this.originalDescription}`;
} else {
this.receipt.description =
`${accountingType && accountingType.receiptDescription}`;
}
this.maxAmount = accountingType && accountingType.maxAmount;
}
}
@ -123,6 +129,9 @@ class Controller extends Dialog {
if (response !== 'accept')
return super.responseHandler(response);
if (this.bankSelection.accountingType.code == 'cash' && this.receipt.amountPaid > this.maxAmount)
return this.vnApp.showError(this.$t('Amount exceeded', {maxAmount: this.maxAmount}));
let receiptId;
return this.$http.post(`Clients/${this.clientFk}/createReceipt`, this.receipt)
.then(res => {

View File

@ -1 +1,2 @@
View receipt: Ver recibo
View receipt: Ver recibo
Amount exceeded: Según ley contra el fraude no se puede recibir cobros por importe igual o superior a {{maxAmount}}