2019-03-28 10:55:23 +00:00
|
|
|
import ngModule from '../module';
|
2020-11-23 12:41:51 +00:00
|
|
|
import Summary from 'salix/components/summary';
|
2019-03-28 10:55:23 +00:00
|
|
|
import './style.scss';
|
|
|
|
|
2020-11-23 12:41:51 +00:00
|
|
|
class Controller extends Summary {
|
2019-03-28 10:55:23 +00:00
|
|
|
set invoiceOut(value) {
|
|
|
|
this._invoiceOut = value;
|
2021-07-13 06:59:36 +00:00
|
|
|
if (value && value.id) {
|
2019-03-28 10:55:23 +00:00
|
|
|
this.getSummary();
|
2021-07-27 13:59:59 +00:00
|
|
|
this.$.ticketsModel.url = `InvoiceOuts/${this.invoiceOut.id}/getTickets`;
|
2021-07-13 06:59:36 +00:00
|
|
|
}
|
2019-03-28 10:55:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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: '<'
|
|
|
|
}
|
|
|
|
});
|