2019-03-28 10:55:23 +00:00
|
|
|
import ngModule from '../module';
|
2020-03-17 13:43:46 +00:00
|
|
|
import Section from 'salix/components/section';
|
2019-03-28 10:55:23 +00:00
|
|
|
import './style.scss';
|
|
|
|
|
2020-03-17 13:43:46 +00:00
|
|
|
class Controller extends Section {
|
2019-03-28 10:55:23 +00:00
|
|
|
set invoiceOut(value) {
|
|
|
|
this._invoiceOut = value;
|
|
|
|
if (value && value.id)
|
|
|
|
this.getSummary();
|
|
|
|
}
|
|
|
|
|
|
|
|
get invoiceOut() {
|
|
|
|
return this._invoiceOut;
|
|
|
|
}
|
|
|
|
|
|
|
|
getSummary() {
|
2020-04-25 09:50:04 +00:00
|
|
|
return this.$http.get(`InvoiceOuts/${this.invoiceOut.id}/summary`)
|
|
|
|
.then(res => this.summary = res.data);
|
2019-03-28 10:55:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-24 12:22:30 +00:00
|
|
|
ngModule.vnComponent('vnInvoiceOutSummary', {
|
2019-03-28 10:55:23 +00:00
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller,
|
|
|
|
bindings: {
|
|
|
|
invoiceOut: '<'
|
|
|
|
}
|
|
|
|
});
|