2021-06-09 08:20:18 +00:00
|
|
|
<vn-crud-model
|
|
|
|
vn-id="model"
|
|
|
|
url="InvoiceInTaxes"
|
2021-06-25 05:47:53 +00:00
|
|
|
fields="['id', 'invoiceInFk', 'taxableBase', 'expenseFk', 'foreignValue', 'taxTypeSageFk', 'transactionTypeSageFk']"
|
2021-06-09 08:20:18 +00:00
|
|
|
link="{invoiceInFk: $ctrl.$params.id}"
|
|
|
|
data="$ctrl.taxes"
|
|
|
|
auto-load="true">
|
|
|
|
</vn-crud-model>
|
|
|
|
<vn-crud-model
|
|
|
|
url="SageTaxTypes"
|
|
|
|
data="sageTaxTypes"
|
|
|
|
auto-load="true">
|
|
|
|
</vn-crud-model>
|
|
|
|
<vn-crud-model
|
|
|
|
url="Expenses"
|
|
|
|
data="expenses"
|
|
|
|
auto-load="true">
|
|
|
|
</vn-crud-model>
|
|
|
|
<vn-crud-model
|
|
|
|
url="SageTransactionTypes"
|
|
|
|
data="sageTransactionType"
|
|
|
|
auto-load="true">
|
|
|
|
</vn-crud-model>
|
|
|
|
<vn-watcher
|
|
|
|
vn-id="watcher"
|
2021-06-15 07:02:00 +00:00
|
|
|
data="$ctrl.taxes"
|
2021-06-09 08:20:18 +00:00
|
|
|
form="form">
|
|
|
|
</vn-watcher>
|
2021-06-16 16:36:42 +00:00
|
|
|
<form name="form" ng-submit="$ctrl.onSubmit()">
|
2021-06-09 08:20:18 +00:00
|
|
|
<vn-card class="vn-pa-lg">
|
|
|
|
<vn-horizontal ng-repeat="invoiceInTax in $ctrl.taxes">
|
2021-06-25 05:47:53 +00:00
|
|
|
<vn-autocomplete vn-three vn-id="expense" vn-focus
|
2021-06-09 08:20:18 +00:00
|
|
|
label="Expense"
|
|
|
|
ng-model="invoiceInTax.expenseFk"
|
|
|
|
data="expenses"
|
|
|
|
show-field="id"
|
|
|
|
rule>
|
|
|
|
<tpl-item>{{id}}: {{name}}</tpl-item>
|
|
|
|
</vn-autocomplete>
|
|
|
|
<vn-input-number vn-one
|
2021-06-25 05:47:53 +00:00
|
|
|
disabled="$ctrl.invoiceIn.currency.code != 'EUR'"
|
|
|
|
vn-id="taxableBase"
|
2021-06-09 08:20:18 +00:00
|
|
|
type="number"
|
2021-06-25 07:30:24 +00:00
|
|
|
label="Taxable base"
|
2021-06-09 08:20:18 +00:00
|
|
|
ng-model="invoiceInTax.taxableBase"
|
2021-06-25 05:47:53 +00:00
|
|
|
on-change="$ctrl.setTaxRate = $value"
|
2021-06-09 08:20:18 +00:00
|
|
|
rule>
|
|
|
|
</vn-input-number>
|
2021-06-25 05:47:53 +00:00
|
|
|
|
|
|
|
<vn-autocomplete vn-three
|
|
|
|
vn-id="taxTypeSage"
|
2021-06-25 07:30:24 +00:00
|
|
|
label="Sage tax"
|
2021-06-09 08:20:18 +00:00
|
|
|
ng-model="invoiceInTax.taxTypeSageFk"
|
|
|
|
data="sageTaxTypes"
|
|
|
|
show-field="vat"
|
|
|
|
search-function="{or: [{id: $search}, {vat: {like: '%'+ $search +'%'}}]}"
|
2021-06-25 05:47:53 +00:00
|
|
|
selection="$ctrl.setTaxRate"
|
2021-06-09 08:20:18 +00:00
|
|
|
rule>
|
|
|
|
<tpl-item>{{id}}: {{vat}}</tpl-item>
|
|
|
|
</vn-autocomplete>
|
2021-06-25 05:47:53 +00:00
|
|
|
<vn-autocomplete vn-three
|
2021-06-25 07:30:24 +00:00
|
|
|
label="Sage transaction"
|
2021-06-09 08:20:18 +00:00
|
|
|
ng-model="invoiceInTax.transactionTypeSageFk"
|
|
|
|
data="sageTransactionType"
|
|
|
|
show-field="transaction"
|
|
|
|
search-function="{or: [{id: $search}, {transaction: {like: '%'+ $search +'%'}}]}"
|
|
|
|
rule>
|
|
|
|
<tpl-item>{{id}}: {{transaction}}</tpl-item>
|
|
|
|
</vn-autocomplete>
|
2021-06-25 05:47:53 +00:00
|
|
|
<vn-input-number vn-one
|
|
|
|
disabled="true"
|
2021-06-09 08:20:18 +00:00
|
|
|
type="number"
|
2021-06-25 07:30:24 +00:00
|
|
|
label="Rate"
|
2021-06-25 05:47:53 +00:00
|
|
|
step="0.01"
|
|
|
|
tabindex="-1"
|
|
|
|
ng-model="$ctrl.taxRate">
|
2021-06-09 08:20:18 +00:00
|
|
|
</vn-input-number>
|
2021-06-15 07:02:00 +00:00
|
|
|
<vn-input-number vn-one
|
2021-06-25 05:47:53 +00:00
|
|
|
disabled="$ctrl.invoiceIn.currency.code == 'EUR'"
|
2021-06-09 08:20:18 +00:00
|
|
|
type="number"
|
2021-06-25 07:30:24 +00:00
|
|
|
label="Foreign value"
|
2021-06-09 08:20:18 +00:00
|
|
|
ng-model="invoiceInTax.foreignValue"
|
|
|
|
rule>
|
|
|
|
</vn-input-number>
|
|
|
|
<vn-none>
|
|
|
|
<vn-icon-button
|
|
|
|
vn-tooltip="Remove tax"
|
|
|
|
icon="delete"
|
|
|
|
ng-click="model.remove($index)"
|
|
|
|
tabindex="-1">
|
|
|
|
</vn-icon-button>
|
|
|
|
</vn-none>
|
|
|
|
</vn-horizontal>
|
|
|
|
<vn-one>
|
|
|
|
<vn-icon-button
|
|
|
|
vn-bind="+"
|
|
|
|
vn-tooltip="Add tax"
|
|
|
|
icon="add_circle"
|
|
|
|
ng-click="$ctrl.add()">
|
|
|
|
</vn-icon-button>
|
|
|
|
</vn-one>
|
|
|
|
</vn-card>
|
2021-06-25 05:47:53 +00:00
|
|
|
<vn-button-bar>
|
2021-06-09 08:20:18 +00:00
|
|
|
<vn-submit
|
|
|
|
disabled="!watcher.dataChanged()"
|
|
|
|
label="Save">
|
|
|
|
</vn-submit>
|
|
|
|
</vn-button-bar>
|
|
|
|
</form>
|