2983 - Invoice tickets from ticket index #685

Merged
carlosjr merged 7 commits from 2983-ticket_invoice into dev 2021-07-01 12:57:59 +00:00
3 changed files with 50 additions and 2 deletions
Showing only changes of commit 0941b2423e - Show all commits

View File

@ -166,6 +166,15 @@
vn-tooltip="Payment on account..."
tooltip-position="left">
</vn-button>
<vn-button class="round sm vn-mb-sm"
icon="icon-invoices"
ng-click="invoiceOptions.show($event)"
ng-show="$ctrl.totalChecked > 0"
vn-tooltip="Make invoice..."
tooltip-position="left"
vn-acl="invoicing"
vn-acl-action="remove">
</vn-button>
<a ui-sref="ticket.create($ctrl.clientParams())" vn-bind="+">
<vn-button class="round md vn-mb-sm"
icon="add"
@ -173,6 +182,28 @@
tooltip-position="left">
</vn-button>
</a>
<vn-menu vn-id="invoiceOptions">
<vn-item
name="makeQuickInvoice"
ng-click="makeInvoiceConfirmation.show()"
ng-show="$ctrl.totalChecked === 1"
translate>
Quick invoice
</vn-item>
<vn-item
ng-click="makeInvoiceConfirmation.show()"
name="makeInvoice"
translate>
Multiple invoices
</vn-item>
<vn-item
ng-click="makeInvoiceConfirmation.show()"
name="makeInvoice"
translate>
Rectificative invoice
</vn-item>
</vn-menu>
</vn-vertical>
</div>
<vn-popup vn-id="summary">
@ -224,4 +255,12 @@
Copy value
</vn-item>
</slot-menu>
</vn-contextmenu>
</vn-contextmenu>
<!-- Make invoice confirmation dialog -->
<vn-confirm
vn-id="makeInvoiceConfirmation"
on-accept="$ctrl.makeInvoice()"
question="You are going to invoice this ticket"
message="Are you sure you want to invoice this ticket?">
</vn-confirm>

View File

@ -8,6 +8,7 @@ export default class Controller extends Section {
super($element, $);
this.vnReport = vnReport;
}
setDelivered() {
const checkedTickets = this.checked;
let ids = [];
@ -159,6 +160,13 @@ export default class Controller extends Section {
}
return {};
}
makeInvoice() {
const [ticket] = this.checked;
return this.$http.post(`Tickets/${ticket.id}/makeInvoice`)
.then(() => this.$.model.refresh())
.then(() => this.vnApp.showSuccess(this.$t('Ticket invoiced')));
}
}
Controller.$inject = ['$element', '$scope', 'vnReport'];

View File

@ -11,4 +11,5 @@ Remove filter: Quitar filtro por selección
Remove all filters: Eliminar todos los filtros
Copy value: Copiar valor
No verified data: Sin datos comprobados
Component lack: Faltan componentes
Component lack: Faltan componentes
Quick invoice: Factura rápida