2940-invoiceInTax-section #680
|
@ -43,7 +43,14 @@ module.exports = Self => {
|
||||||
{
|
{
|
||||||
relation: 'invoiceInTax',
|
relation: 'invoiceInTax',
|
||||||
scope: {
|
scope: {
|
||||||
fields: ['id', 'invoiceInFk', 'taxableBase', 'expenseFk', 'taxTypeSageFk', 'transactionTypeSageFk', 'foreignValue'],
|
fields: [
|
||||||
|
'id',
|
||||||
|
'invoiceInFk',
|
||||||
|
'taxableBase',
|
||||||
|
'expenseFk',
|
||||||
|
'taxTypeSageFk',
|
||||||
|
'transactionTypeSageFk',
|
||||||
|
'foreignValue'],
|
||||||
include: [{
|
include: [{
|
||||||
relation: 'transactionTypeSage',
|
relation: 'transactionTypeSage',
|
||||||
scope: {
|
scope: {
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"id": {
|
"id": {
|
||||||
"id": true,
|
"id": true,
|
||||||
"type": "Number",
|
"type": "number",
|
||||||
"description": "Identifier"
|
"description": "Identifier"
|
||||||
},
|
},
|
||||||
"taxableBase": {
|
"taxableBase": {
|
||||||
|
|
|
@ -51,8 +51,8 @@
|
||||||
<vn-label translate>Due day</vn-label>
|
<vn-label translate>Due day</vn-label>
|
||||||
<vn-chip
|
<vn-chip
|
||||||
class="transparent"
|
class="transparent"
|
||||||
translate-attr=" $ctrl.summary.totals.totalDueDay != $ctrl.summary.totals.totalTaxableBase && $ctrl.summary.totals.totalDueDay != $ctrl.summary.totals.totalVat ? {title: 'No coinciden'} : {title: 'Vencimiento'}"
|
translate-attr="$ctrl.amountsNotMatch ? {title: 'Do not match'} : {title: 'Due day'}"
|
||||||
ng-class="{'alert': $ctrl.summary.totals.totalDueDay != $ctrl.summary.totals.totalTaxableBase && $ctrl.summary.totals.totalDueDay != $ctrl.summary.totals.totalVat}">{{$ctrl.summary.totals.totalDueDay | currency: 'EUR':2}}
|
>{{$ctrl.summary.totals.totalDueDay | currency: 'EUR':2}}
|
||||||
</vn-chip>
|
</vn-chip>
|
||||||
</vn-one>
|
</vn-one>
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
|
@ -83,7 +83,7 @@
|
||||||
<vn-td shrink>{{::tax.taxableBase | currency: 'EUR':2}}</vn-td>
|
<vn-td shrink>{{::tax.taxableBase | currency: 'EUR':2}}</vn-td>
|
||||||
<vn-td>{{::tax.taxTypeSage.vat}}</vn-td>
|
<vn-td>{{::tax.taxTypeSage.vat}}</vn-td>
|
||||||
<vn-td>{{::tax.transactionTypeSage.transaction}}</vn-td>
|
<vn-td>{{::tax.transactionTypeSage.transaction}}</vn-td>
|
||||||
<vn-td number shrink>{{::0.2 | percentage}}</vn-td>
|
<vn-td number shrink>{{::tax.taxRate | percentage}}</vn-td>
|
||||||
<vn-td number shrink>{{::tax.foreignValue | currency: 'USD':2}}</vn-td>
|
<vn-td number shrink>{{::tax.foreignValue | currency: 'USD':2}}</vn-td>
|
||||||
</vn-tr>
|
</vn-tr>
|
||||||
</vn-tbody>
|
</vn-tbody>
|
||||||
|
|
|
@ -17,6 +17,13 @@ class Controller extends Summary {
|
||||||
return this.$http.get(`InvoiceIns/${this.invoiceIn.id}/summary`)
|
return this.$http.get(`InvoiceIns/${this.invoiceIn.id}/summary`)
|
||||||
.then(res => this.summary = res.data);
|
.then(res => this.summary = res.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ng-class="{'alert': $ctrl.amountsNotMatch()}"
|
||||||
|
amountsNotMatch() {
|
||||||
|
const total = this.summary.totals;
|
||||||
|
console.log(total.totalDueDay != total.totalTaxableBase && total.totalDueDay != total.totalVat);
|
||||||
|
return total.totalDueDay != total.totalTaxableBase && total.totalDueDay != total.totalVat;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ngModule.vnComponent('vnInvoiceInSummary', {
|
ngModule.vnComponent('vnInvoiceInSummary', {
|
||||||
|
|
|
@ -7,4 +7,5 @@ Booked date: Fecha contable
|
||||||
Accounted date: Fecha contable
|
Accounted date: Fecha contable
|
||||||
Doc number: Numero documento
|
Doc number: Numero documento
|
||||||
Sage withholding: Retención sage
|
Sage withholding: Retención sage
|
||||||
Undeductible VAT: Iva no deducible
|
Undeductible VAT: Iva no deducible
|
||||||
|
Do not match: No coinciden
|
|
@ -1,10 +1,8 @@
|
||||||
@import "./variables";
|
@import "./variables";
|
||||||
@import "./effects";
|
|
||||||
|
|
||||||
vn-invoice-in-summary .summary {
|
vn-invoice-in-summary .summary {
|
||||||
max-width: $width-xl;
|
max-width: $width-xl;
|
||||||
|
|
||||||
|
|
||||||
.taxes {
|
.taxes {
|
||||||
border: $border-thin-light;
|
border: $border-thin-light;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
|
|
|
@ -1,7 +1,14 @@
|
||||||
<vn-crud-model
|
<vn-crud-model
|
||||||
vn-id="model"
|
vn-id="model"
|
||||||
url="InvoiceInTaxes"
|
url="InvoiceInTaxes"
|
||||||
fields="['id', 'invoiceInFk', 'taxableBase', 'expenseFk', 'foreignValue', 'taxTypeSageFk', 'transactionTypeSageFk']"
|
fields="[
|
||||||
|
'id',
|
||||||
|
'invoiceInFk',
|
||||||
|
'taxableBase',
|
||||||
|
'expenseFk',
|
||||||
|
'foreignValue',
|
||||||
|
'taxTypeSageFk',
|
||||||
|
'transactionTypeSageFk']"
|
||||||
link="{invoiceInFk: $ctrl.$params.id}"
|
link="{invoiceInFk: $ctrl.$params.id}"
|
||||||
data="$ctrl.taxes"
|
data="$ctrl.taxes"
|
||||||
auto-load="true">
|
auto-load="true">
|
||||||
|
@ -41,13 +48,11 @@
|
||||||
disabled="$ctrl.invoiceIn.currency.code != 'EUR'"
|
disabled="$ctrl.invoiceIn.currency.code != 'EUR'"
|
||||||
vn-id="taxableBase"
|
vn-id="taxableBase"
|
||||||
step="0.01"
|
step="0.01"
|
||||||
type="number"
|
|
||||||
label="Taxable base"
|
label="Taxable base"
|
||||||
ng-model="invoiceInTax.taxableBase"
|
ng-model="invoiceInTax.taxableBase"
|
||||||
on-change="$ctrl.setTaxRate = $value"
|
on-change="$ctrl.taxRateSelection = $value"
|
||||||
rule>
|
rule>
|
||||||
</vn-input-number>
|
</vn-input-number>
|
||||||
|
|
||||||
<vn-autocomplete vn-three
|
<vn-autocomplete vn-three
|
||||||
vn-id="taxTypeSage"
|
vn-id="taxTypeSage"
|
||||||
label="Sage tax"
|
label="Sage tax"
|
||||||
|
@ -55,7 +60,7 @@
|
||||||
data="sageTaxTypes"
|
data="sageTaxTypes"
|
||||||
show-field="vat"
|
show-field="vat"
|
||||||
search-function="{or: [{id: $search}, {vat: {like: '%'+ $search +'%'}}]}"
|
search-function="{or: [{id: $search}, {vat: {like: '%'+ $search +'%'}}]}"
|
||||||
selection="$ctrl.setTaxRate"
|
selection="$ctrl.taxRateSelection"
|
||||||
rule>
|
rule>
|
||||||
<tpl-item>{{id}}: {{vat}}</tpl-item>
|
<tpl-item>{{id}}: {{vat}}</tpl-item>
|
||||||
</vn-autocomplete>
|
</vn-autocomplete>
|
||||||
|
@ -70,7 +75,6 @@
|
||||||
</vn-autocomplete>
|
</vn-autocomplete>
|
||||||
<vn-input-number vn-one
|
<vn-input-number vn-one
|
||||||
disabled="true"
|
disabled="true"
|
||||||
type="number"
|
|
||||||
label="Rate"
|
label="Rate"
|
||||||
step="0.01"
|
step="0.01"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
|
@ -78,7 +82,6 @@
|
||||||
</vn-input-number>
|
</vn-input-number>
|
||||||
<vn-input-number vn-one
|
<vn-input-number vn-one
|
||||||
disabled="$ctrl.invoiceIn.currency.code == 'EUR'"
|
disabled="$ctrl.invoiceIn.currency.code == 'EUR'"
|
||||||
type="number"
|
|
||||||
label="Foreign value"
|
label="Foreign value"
|
||||||
ng-model="invoiceInTax.foreignValue"
|
ng-model="invoiceInTax.foreignValue"
|
||||||
rule>
|
rule>
|
||||||
|
|
|
@ -6,12 +6,12 @@ class Controller extends Section {
|
||||||
super($element, $);
|
super($element, $);
|
||||||
}
|
}
|
||||||
|
|
||||||
get setTaxRate() {
|
get taxRateSelection() {
|
||||||
return this._setTaxRate;
|
return this._taxRateSelection;
|
||||||
}
|
}
|
||||||
|
|
||||||
set setTaxRate(selection) {
|
set taxRateSelection(selection) {
|
||||||
this._setTaxRate = selection;
|
this._taxRateSelection = selection;
|
||||||
const taxTypeSage = this.$.taxTypeSage.selection;
|
const taxTypeSage = this.$.taxTypeSage.selection;
|
||||||
const taxableBase = this.$.taxableBase.value;
|
const taxableBase = this.$.taxableBase.value;
|
||||||
if (taxTypeSage && taxableBase)
|
if (taxTypeSage && taxableBase)
|
||||||
|
|
Loading…
Reference in New Issue