cambios solicitados
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Javi Gallego 2021-06-30 08:26:03 +02:00
parent 59fac7edfa
commit 9371c49922
8 changed files with 35 additions and 19 deletions

View File

@ -43,7 +43,14 @@ module.exports = Self => {
{
relation: 'invoiceInTax',
scope: {
fields: ['id', 'invoiceInFk', 'taxableBase', 'expenseFk', 'taxTypeSageFk', 'transactionTypeSageFk', 'foreignValue'],
fields: [
'id',
'invoiceInFk',
'taxableBase',
'expenseFk',
'taxTypeSageFk',
'transactionTypeSageFk',
'foreignValue'],
include: [{
relation: 'transactionTypeSage',
scope: {

View File

@ -12,7 +12,7 @@
"properties": {
"id": {
"id": true,
"type": "Number",
"type": "number",
"description": "Identifier"
},
"taxableBase": {

View File

@ -51,8 +51,8 @@
<vn-label translate>Due day</vn-label>
<vn-chip
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'}"
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}}
translate-attr="$ctrl.amountsNotMatch ? {title: 'Do not match'} : {title: 'Due day'}"
>{{$ctrl.summary.totals.totalDueDay | currency: 'EUR':2}}
</vn-chip>
</vn-one>
</vn-horizontal>
@ -83,7 +83,7 @@
<vn-td shrink>{{::tax.taxableBase | currency: 'EUR':2}}</vn-td>
<vn-td>{{::tax.taxTypeSage.vat}}</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-tr>
</vn-tbody>

View File

@ -17,6 +17,13 @@ class Controller extends Summary {
return this.$http.get(`InvoiceIns/${this.invoiceIn.id}/summary`)
.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', {

View File

@ -7,4 +7,5 @@ Booked date: Fecha contable
Accounted date: Fecha contable
Doc number: Numero documento
Sage withholding: Retención sage
Undeductible VAT: Iva no deducible
Undeductible VAT: Iva no deducible
Do not match: No coinciden

View File

@ -1,10 +1,8 @@
@import "./variables";
@import "./effects";
vn-invoice-in-summary .summary {
max-width: $width-xl;
.taxes {
border: $border-thin-light;
text-align: right;

View File

@ -1,7 +1,14 @@
<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">
@ -41,13 +48,11 @@
disabled="$ctrl.invoiceIn.currency.code != 'EUR'"
vn-id="taxableBase"
step="0.01"
type="number"
label="Taxable base"
ng-model="invoiceInTax.taxableBase"
on-change="$ctrl.setTaxRate = $value"
on-change="$ctrl.taxRateSelection = $value"
rule>
</vn-input-number>
<vn-autocomplete vn-three
vn-id="taxTypeSage"
label="Sage tax"
@ -55,7 +60,7 @@
data="sageTaxTypes"
show-field="vat"
search-function="{or: [{id: $search}, {vat: {like: '%'+ $search +'%'}}]}"
selection="$ctrl.setTaxRate"
selection="$ctrl.taxRateSelection"
rule>
<tpl-item>{{id}}: {{vat}}</tpl-item>
</vn-autocomplete>
@ -70,7 +75,6 @@
</vn-autocomplete>
<vn-input-number vn-one
disabled="true"
type="number"
label="Rate"
step="0.01"
tabindex="-1"
@ -78,7 +82,6 @@
</vn-input-number>
<vn-input-number vn-one
disabled="$ctrl.invoiceIn.currency.code == 'EUR'"
type="number"
label="Foreign value"
ng-model="invoiceInTax.foreignValue"
rule>

View File

@ -6,12 +6,12 @@ class Controller extends Section {
super($element, $);
}
get setTaxRate() {
return this._setTaxRate;
get taxRateSelection() {
return this._taxRateSelection;
}
set setTaxRate(selection) {
this._setTaxRate = selection;
set taxRateSelection(selection) {
this._taxRateSelection = selection;
const taxTypeSage = this.$.taxTypeSage.selection;
const taxableBase = this.$.taxableBase.value;
if (taxTypeSage && taxableBase)