hedera-web/forms/ecomerce/invoices/index.js

20 lines
491 B
JavaScript

import './style.scss';
export default new Class({
Extends: Hedera.Form,
Template: require('./ui.xml'),
onDownloadClick(column, value, row) {
var model = this.$.invoices;
var hasPdf = model.get(row, 'hasPdf');
var id = model.get(row, 'id');
if (hasPdf && id) {
let params = Vn.Url.makeUri({ access_token: this.conn.token });
window.open(`/api/InvoiceOuts/${id}/download?${params}`);
} else
Htk.Toast.showWarning(_('Request the invoice to your salesperson'));
}
});