2021-02-10 14:03:11 +00:00
|
|
|
import ngModule from '../module';
|
|
|
|
import Descriptor from 'salix/components/descriptor';
|
|
|
|
|
|
|
|
class Controller extends Descriptor {
|
2021-02-12 11:19:42 +00:00
|
|
|
get invoiceIn() {
|
2021-02-10 14:03:11 +00:00
|
|
|
return this.entity;
|
|
|
|
}
|
|
|
|
|
2021-02-12 11:19:42 +00:00
|
|
|
set invoiceIn(value) {
|
2021-02-10 14:03:11 +00:00
|
|
|
this.entity = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
loadData() {
|
|
|
|
const filter = {
|
|
|
|
include: [
|
|
|
|
{
|
|
|
|
relation: 'company',
|
|
|
|
scope: {
|
|
|
|
fields: ['id', 'code']
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|
|
|
|
|
2021-02-12 11:19:42 +00:00
|
|
|
return this.getData(`InvoiceIns/${this.id}`, {filter})
|
2021-02-10 14:03:11 +00:00
|
|
|
.then(res => this.entity = res.data);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-02-12 11:19:42 +00:00
|
|
|
ngModule.vnComponent('vnInvoiceInDescriptor', {
|
2021-02-10 14:03:11 +00:00
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller,
|
|
|
|
bindings: {
|
2021-02-12 11:19:42 +00:00
|
|
|
invoiceIn: '<'
|
2021-02-10 14:03:11 +00:00
|
|
|
}
|
|
|
|
});
|