2022-11-16 01:44:39 +00:00
|
|
|
import './style.scss';
|
2015-09-03 23:28:07 +00:00
|
|
|
|
2022-11-16 01:44:39 +00:00
|
|
|
export default new Class({
|
2018-07-02 12:54:37 +00:00
|
|
|
Extends: Hedera.Form,
|
2022-11-16 01:44:39 +00:00
|
|
|
Template: require('./ui.xml'),
|
2018-07-02 12:54:37 +00:00
|
|
|
|
2024-05-29 08:45:34 +00:00
|
|
|
onDownloadClick(column, value, row) {
|
|
|
|
var model = this.$.invoices;
|
|
|
|
var hasPdf = model.get(row, 'hasPdf');
|
|
|
|
var id = model.get(row, 'id');
|
2018-07-02 12:54:37 +00:00
|
|
|
|
2024-05-29 08:45:34 +00:00
|
|
|
if (hasPdf && id) {
|
|
|
|
let params = Vn.Url.makeUri({ access_token: this.conn.token });
|
|
|
|
window.open(`/api/InvoiceOuts/${id}/download?${params}`);
|
2018-07-02 12:54:37 +00:00
|
|
|
} else
|
2024-05-29 08:45:34 +00:00
|
|
|
Htk.Toast.showWarning(_('Request the invoice to your salesperson'));
|
2015-09-03 23:28:07 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|