import ngModule from '../module';
import Section from 'salix/components/section';

export default class Controller extends Section {
    preview(invoiceOut) {
        this.selectedInvoiceOut = invoiceOut;
        this.$.summary.show();
    }

    openPdf(id) {
        let url = `api/InvoiceOuts/${id}/download?access_token=${this.vnToken.token}`;
        window.open(url, '_blank');
    }
}

ngModule.vnComponent('vnInvoiceOutIndex', {
    template: require('./index.html'),
    controller: Controller
});