salix/modules/invoiceIn/front/summary/index.js

36 lines
975 B
JavaScript
Raw Normal View History

2021-04-15 08:46:23 +00:00
import ngModule from '../module';
import Summary from 'salix/components/summary';
import './style.scss';
class Controller extends Summary {
set invoiceIn(value) {
this._invoiceIn = value;
if (value && value.id)
this.getSummary();
}
get invoiceIn() {
return this._invoiceIn;
}
getSummary() {
return this.$http.get(`InvoiceIns/${this.invoiceIn.id}/summary`)
.then(res => this.summary = res.data);
}
2021-06-30 06:26:03 +00:00
// 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;
}
2021-04-15 08:46:23 +00:00
}
ngModule.vnComponent('vnInvoiceInSummary', {
template: require('./index.html'),
controller: Controller,
bindings: {
invoiceIn: '<'
}
});