2015-09-03 23:28:07 +00:00
|
|
|
|
2018-07-02 12:54:37 +00:00
|
|
|
Hedera.Invoices = new Class({
|
|
|
|
Extends: Hedera.Form,
|
2016-07-22 20:00:27 +00:00
|
|
|
|
2018-07-02 12:54:37 +00:00
|
|
|
donwloadRenderer: function(column, invoice) {
|
|
|
|
var invoiceId = invoice.get('id');
|
|
|
|
|
|
|
|
if (invoice.get('pdf') && invoiceId) {
|
|
|
|
var params = {
|
|
|
|
srv: 'rest:dms/invoice',
|
|
|
|
invoice: invoiceId,
|
|
|
|
token: this.conn.token
|
|
|
|
};
|
|
|
|
|
|
|
|
Object.assign(column, {
|
|
|
|
tip: _('Download PDF'),
|
|
|
|
disabled: false,
|
|
|
|
icon: 'download',
|
|
|
|
href: '?'+ Vn.Url.makeUri (params)
|
|
|
|
});
|
|
|
|
} else
|
|
|
|
Object.assign(column, {
|
|
|
|
tip: _('Request the invoice to your salesperson'),
|
|
|
|
disabled: true,
|
|
|
|
icon: 'warning',
|
|
|
|
href: null
|
|
|
|
});
|
2015-09-03 23:28:07 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|