100 lines
3.3 KiB
HTML
100 lines
3.3 KiB
HTML
<vn-crud-model
|
|
vn-id="model"
|
|
url="InvoiceInTaxes"
|
|
fields="['id', 'invoiceInFk', 'taxableBase', 'expenseFk', 'foreignValue','taxTypeSageFk','transactionTypeSageFk']"
|
|
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"
|
|
data="$ctrl.taxes"
|
|
form="form">
|
|
</vn-watcher>
|
|
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-xl">
|
|
<vn-card class="vn-pa-lg">
|
|
<vn-horizontal ng-repeat="invoiceInTax in $ctrl.taxes">
|
|
<vn-autocomplete vn-two vn-id="expense" vn-focus
|
|
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
|
|
disabled="$ctrl.currency.code != 'EUR'"
|
|
type="number"
|
|
label="taxable base"
|
|
ng-model="invoiceInTax.taxableBase"
|
|
rule>
|
|
</vn-input-number>
|
|
<vn-autocomplete vn-two
|
|
label="sage tax"
|
|
ng-model="invoiceInTax.taxTypeSageFk"
|
|
data="sageTaxTypes"
|
|
show-field="vat"
|
|
search-function="{or: [{id: $search}, {vat: {like: '%'+ $search +'%'}}]}"
|
|
rule>
|
|
<tpl-item>{{id}}: {{vat}}</tpl-item>
|
|
</vn-autocomplete>
|
|
<vn-autocomplete vn-two
|
|
label="sage transaction"
|
|
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>
|
|
<vn-input-number vn-one disabled="true"
|
|
type="number"
|
|
label="total">
|
|
</vn-input-number>
|
|
<vn-input-number vn-one
|
|
disabled="$ctrl.currency.code == 'EUR'"
|
|
type="number"
|
|
label="foreignValue"
|
|
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>
|
|
<vn-button-bar>
|
|
<vn-submit
|
|
disabled="!watcher.dataChanged()"
|
|
label="Save">
|
|
</vn-submit>
|
|
</vn-button-bar>
|
|
</form> |