salix/modules/invoiceIn/front/tax/index.html

150 lines
5.0 KiB
HTML
Raw Normal View History

2021-06-09 08:20:18 +00:00
<vn-crud-model
vn-id="model"
url="InvoiceInTaxes"
2021-06-30 06:26:03 +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="Expenses"
data="expenses"
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>
<append>
2023-05-05 06:12:38 +00:00
<vn-icon-button
2022-05-12 06:27:04 +00:00
vn-tooltip="Create expense"
icon="add_circle"
vn-click-stop="createExpense.show()">
</vn-icon-button>
</append>
2021-06-09 08:20:18 +00:00
</vn-autocomplete>
<vn-input-number vn-one
2021-06-25 05:47:53 +00:00
disabled="$ctrl.invoiceIn.currency.code != 'EUR'"
2021-06-29 08:33:01 +00:00
step="0.01"
2021-06-25 07:30:24 +00:00
label="Taxable base"
2021-06-09 08:20:18 +00:00
ng-model="invoiceInTax.taxableBase"
rule>
</vn-input-number>
2021-06-25 05:47:53 +00:00
<vn-autocomplete vn-three
2021-06-25 07:30:24 +00:00
label="Sage tax"
2021-06-09 08:20:18 +00:00
ng-model="invoiceInTax.taxTypeSageFk"
2021-07-03 07:19:03 +00:00
url="SageTaxTypes"
2021-06-09 08:20:18 +00:00
show-field="vat"
2021-07-12 13:27:36 +00:00
fields="['id', 'vat', 'rate']"
2021-06-09 08:20:18 +00:00
search-function="{or: [{id: $search}, {vat: {like: '%'+ $search +'%'}}]}"
2021-08-09 12:06:23 +00:00
selection="taxRateSelection"
2021-06-09 08:20:18 +00:00
rule>
2023-05-05 06:12:38 +00:00
<tpl-item>
<div>{{::vat}}</div>
<div class="text-secondary text-caption">#{{::id}}</div>
</tpl-item>
2021-06-09 08:20:18 +00:00
</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"
2021-07-03 07:19:03 +00:00
url="SageTransactionTypes"
2021-06-09 08:20:18 +00:00
show-field="transaction"
search-function="{or: [{id: $search}, {transaction: {like: '%'+ $search +'%'}}]}"
rule>
2023-05-05 06:12:38 +00:00
<tpl-item>
<div>{{::transaction}}</div>
<div class="text-secondary text-caption">#{{::id}}</div>
</tpl-item>
2021-06-09 08:20:18 +00:00
</vn-autocomplete>
2021-08-09 12:06:23 +00:00
<vn-textfield
2021-06-25 05:47:53 +00:00
disabled="true"
2021-06-25 07:30:24 +00:00
label="Rate"
2021-08-09 12:06:23 +00:00
field="$ctrl.taxRate(invoiceInTax, taxRateSelection) | currency:'EUR':2">
</vn-textfield>
<vn-input-number
2021-06-25 05:47:53 +00:00
disabled="$ctrl.invoiceIn.currency.code == 'EUR'"
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>
2023-05-05 06:12:38 +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>
2023-05-05 06:12:38 +00:00
<!-- Dialog of create expense-->
<vn-dialog
vn-id="createExpense"
on-accept="$ctrl.onResponse()">
<tpl-body>
2022-05-12 06:27:04 +00:00
<section>
<h5 class="vn-py-sm">{{$ctrl.$t('New expense')}}</h5>
<vn-horizontal>
<vn-textfield vn-one
vn-id="code"
2023-05-05 06:12:38 +00:00
label="Code"
2022-05-12 06:27:04 +00:00
ng-model="$ctrl.expense.code"
required="true"
vn-focus>
</vn-textfield>
<vn-check
vn-one
label="It's a withholding"
2022-05-12 06:27:04 +00:00
ng-model="$ctrl.expense.isWithheld">
</vn-check>
</vn-horizontal>
<vn-horizontal>
<vn-textfield vn-one
vn-id="description"
2023-05-05 06:12:38 +00:00
label="Description"
2022-05-12 06:27:04 +00:00
ng-model="$ctrl.expense.description"
required="true">
</vn-textfield>
</vn-horizontal>
</section>
</tpl-body>
<tpl-buttons>
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
<button response="accept" translate>Save</button>
</tpl-buttons>
2023-05-05 06:12:38 +00:00
</vn-dialog>