2019-03-13 13:10:45 +00:00
|
|
|
import ngModule from '../module';
|
|
|
|
|
|
|
|
export default class Controller {
|
|
|
|
constructor($scope, vnToken) {
|
|
|
|
this.accessToken = vnToken.token;
|
|
|
|
this.$ = $scope;
|
2019-03-28 10:55:23 +00:00
|
|
|
this.selectedInvoiceOut = null;
|
2019-03-13 13:10:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
showClientDescriptor(event, clientFk) {
|
|
|
|
this.$.clientDescriptor.clientFk = clientFk;
|
|
|
|
this.$.clientDescriptor.parent = event.target;
|
|
|
|
this.$.clientDescriptor.show();
|
|
|
|
event.preventDefault();
|
|
|
|
event.stopImmediatePropagation();
|
|
|
|
}
|
|
|
|
|
2019-03-28 10:55:23 +00:00
|
|
|
preview(event, invoiceOut) {
|
|
|
|
this.selectedInvoiceOut = invoiceOut;
|
|
|
|
this.$.summary.show();
|
2019-03-13 13:10:45 +00:00
|
|
|
event.preventDefault();
|
|
|
|
event.stopImmediatePropagation();
|
|
|
|
}
|
|
|
|
|
|
|
|
onDescriptorLoad() {
|
|
|
|
this.$.popover.relocate();
|
|
|
|
}
|
|
|
|
|
2019-03-28 10:55:23 +00:00
|
|
|
openPdf(id, event) {
|
2019-10-24 22:53:53 +00:00
|
|
|
let url = `InvoiceOuts/${id}/download?access_token=${this.accessToken}`;
|
2019-03-13 13:10:45 +00:00
|
|
|
window.open(url, '_blank');
|
2019-03-28 10:55:23 +00:00
|
|
|
event.preventDefault();
|
|
|
|
event.stopImmediatePropagation();
|
2019-03-13 13:10:45 +00:00
|
|
|
}
|
2019-04-25 06:28:08 +00:00
|
|
|
|
|
|
|
onSearch(params) {
|
|
|
|
if (params)
|
|
|
|
this.$.model.applyFilter(null, params);
|
|
|
|
else
|
|
|
|
this.$.model.clear();
|
|
|
|
}
|
2019-03-13 13:10:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Controller.$inject = ['$scope', 'vnToken'];
|
|
|
|
|
2019-03-25 15:25:59 +00:00
|
|
|
ngModule.component('vnInvoiceOutIndex', {
|
2019-03-13 13:10:45 +00:00
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller
|
|
|
|
});
|