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

20 lines
491 B
JavaScript
Raw Normal View History

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({
Extends: Hedera.Form,
2022-11-16 01:44:39 +00:00
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'));
2015-09-03 23:28:07 +00:00
}
});