diff --git a/front/core/components/autocomplete/index.js b/front/core/components/autocomplete/index.js index 18c277f06..a50bd8612 100755 --- a/front/core/components/autocomplete/index.js +++ b/front/core/components/autocomplete/index.js @@ -149,6 +149,9 @@ export default class Autocomplete extends Field { where: where }; + if (this.include) + filter.include = this.include; + let json = encodeURIComponent(JSON.stringify(filter)); this.$http.get(`${this.url}?filter=${json}`).then( json => this.onSelectionRequest(json.data), diff --git a/modules/client/front/balance/create/index.html b/modules/client/front/balance/create/index.html index a8ccfb7d8..1da25c8cb 100644 --- a/modules/client/front/balance/create/index.html +++ b/modules/client/front/balance/create/index.html @@ -33,7 +33,7 @@ value-field="id" fields="['accountingTypeFk']" include="{relation: 'accountingType'}" - ng-model="$ctrl.receipt.bankFk" + ng-model="$ctrl.bankFk" search-function="{or: [{id: $search}, {bank: {like: '%'+ $search +'%'}}]}" selection="$ctrl.bankSelection" order="id" diff --git a/modules/client/front/balance/create/index.js b/modules/client/front/balance/create/index.js index fedc2d7c4..e1b474452 100644 --- a/modules/client/front/balance/create/index.js +++ b/modules/client/front/balance/create/index.js @@ -7,9 +7,7 @@ class Controller extends Dialog { this.receipt = { payed: new Date(), - clientFk: this.$params.id, - companyFk: this.vnConfig.companyFk, - bankFk: this.vnConfig.bankFk + clientFk: this.$params.id }; } @@ -17,10 +15,6 @@ class Controller extends Dialog { this.receipt.payed = value; } - set bankFk(value) { - this.receipt.bankFk = value; - } - set amountPaid(value) { this.receipt.amountPaid = value; } @@ -72,6 +66,17 @@ class Controller extends Dialog { return this._deliveredAmount; } + get bankFk() { + if (!this.receipt.bankFk) + this.receipt.bankFk = this.vnConfig.bankFk; + + return this.receipt.bankFk; + } + + set bankFk(value) { + this.receipt.bankFk = value; + } + accountShortToStandard(value) { this.receipt.compensationAccount = value.replace('.', '0'.repeat(11 - value.length)); } diff --git a/modules/client/front/balance/locale/es.yml b/modules/client/front/balance/locale/es.yml new file mode 100644 index 000000000..53750799c --- /dev/null +++ b/modules/client/front/balance/locale/es.yml @@ -0,0 +1,2 @@ +Compensation: CompensaciĆ³n +Cash: Efectivo \ No newline at end of file