rellena campo rate
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
a6c093cf16
commit
82e65ec1c3
|
@ -20,6 +20,12 @@
|
|||
"mysql": {
|
||||
"columnName": "Iva"
|
||||
}
|
||||
},
|
||||
"rate": {
|
||||
"type": "number",
|
||||
"mysql": {
|
||||
"columnName": "PorcentajeIva"
|
||||
}
|
||||
}
|
||||
},
|
||||
"acls": [
|
||||
|
|
|
@ -7,4 +7,6 @@ Remove tax: Quitar iva
|
|||
Add tax: Añadir iva
|
||||
taxable base: bi
|
||||
sage tax: sage iva
|
||||
sage transaction: sage transaccion
|
||||
sage transaction: sage transaccion
|
||||
rate: cuota
|
||||
foreign value: divisa
|
|
@ -1,7 +1,7 @@
|
|||
<vn-crud-model
|
||||
vn-id="model"
|
||||
url="InvoiceInTaxes"
|
||||
fields="['id', 'invoiceInFk', 'taxableBase', 'expenseFk', 'foreignValue','taxTypeSageFk','transactionTypeSageFk']"
|
||||
fields="['id', 'invoiceInFk', 'taxableBase', 'expenseFk', 'foreignValue', 'taxTypeSageFk', 'transactionTypeSageFk']"
|
||||
link="{invoiceInFk: $ctrl.$params.id}"
|
||||
data="$ctrl.taxes"
|
||||
auto-load="true">
|
||||
|
@ -29,7 +29,7 @@
|
|||
<form name="form" ng-submit="$ctrl.onSubmit()">
|
||||
<vn-card class="vn-pa-lg">
|
||||
<vn-horizontal ng-repeat="invoiceInTax in $ctrl.taxes">
|
||||
<vn-autocomplete vn-two vn-id="expense" vn-focus
|
||||
<vn-autocomplete vn-three vn-id="expense" vn-focus
|
||||
label="Expense"
|
||||
ng-model="invoiceInTax.expenseFk"
|
||||
data="expenses"
|
||||
|
@ -38,22 +38,27 @@
|
|||
<tpl-item>{{id}}: {{name}}</tpl-item>
|
||||
</vn-autocomplete>
|
||||
<vn-input-number vn-one
|
||||
disabled="$ctrl.currency.code != 'EUR'"
|
||||
disabled="$ctrl.invoiceIn.currency.code != 'EUR'"
|
||||
vn-id="taxableBase"
|
||||
type="number"
|
||||
label="taxable base"
|
||||
ng-model="invoiceInTax.taxableBase"
|
||||
on-change="$ctrl.setTaxRate = $value"
|
||||
rule>
|
||||
</vn-input-number>
|
||||
<vn-autocomplete vn-two
|
||||
|
||||
<vn-autocomplete vn-three
|
||||
vn-id="taxTypeSage"
|
||||
label="sage tax"
|
||||
ng-model="invoiceInTax.taxTypeSageFk"
|
||||
data="sageTaxTypes"
|
||||
show-field="vat"
|
||||
search-function="{or: [{id: $search}, {vat: {like: '%'+ $search +'%'}}]}"
|
||||
selection="$ctrl.setTaxRate"
|
||||
rule>
|
||||
<tpl-item>{{id}}: {{vat}}</tpl-item>
|
||||
</vn-autocomplete>
|
||||
<vn-autocomplete vn-two
|
||||
<vn-autocomplete vn-three
|
||||
label="sage transaction"
|
||||
ng-model="invoiceInTax.transactionTypeSageFk"
|
||||
data="sageTransactionType"
|
||||
|
@ -62,14 +67,18 @@
|
|||
rule>
|
||||
<tpl-item>{{id}}: {{transaction}}</tpl-item>
|
||||
</vn-autocomplete>
|
||||
<vn-input-number vn-one disabled="true"
|
||||
<vn-input-number vn-one
|
||||
disabled="true"
|
||||
type="number"
|
||||
label="total">
|
||||
label="rate"
|
||||
step="0.01"
|
||||
tabindex="-1"
|
||||
ng-model="$ctrl.taxRate">
|
||||
</vn-input-number>
|
||||
<vn-input-number vn-one
|
||||
disabled="$ctrl.currency.code == 'EUR'"
|
||||
disabled="$ctrl.invoiceIn.currency.code == 'EUR'"
|
||||
type="number"
|
||||
label="foreignValue"
|
||||
label="foreign value"
|
||||
ng-model="invoiceInTax.foreignValue"
|
||||
rule>
|
||||
</vn-input-number>
|
||||
|
@ -91,7 +100,7 @@
|
|||
</vn-icon-button>
|
||||
</vn-one>
|
||||
</vn-card>
|
||||
<vn-button-bar>
|
||||
<vn-button-bar>
|
||||
<vn-submit
|
||||
disabled="!watcher.dataChanged()"
|
||||
label="Save">
|
||||
|
|
|
@ -20,6 +20,16 @@ class Controller extends Section {
|
|||
.then(res => this.referenceRate = res.data);
|
||||
}
|
||||
}*/
|
||||
get setTaxRate() {
|
||||
return this._setTaxRate;
|
||||
}
|
||||
set setTaxRate(selection) {
|
||||
this._setTaxRate = selection;
|
||||
const taxTypeSage = this.$.taxTypeSage.selection;
|
||||
const taxableBase = this.$.taxableBase.value;
|
||||
if (taxTypeSage && taxableBase)
|
||||
this.taxRate = (taxTypeSage.rate / 100) * taxableBase;
|
||||
}
|
||||
|
||||
add() {
|
||||
const defaultExpenseFk = 6000000001;
|
||||
|
|
Loading…
Reference in New Issue