fix(invoice): prevented error for invoiced tickets without sales
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
580231d30b
commit
8828247b0d
|
@ -19,12 +19,14 @@ module.exports = {
|
|||
|
||||
const map = new Map();
|
||||
|
||||
for (let ticket of tickets)
|
||||
for (let ticket of tickets) {
|
||||
ticket.sales = [];
|
||||
|
||||
map.set(ticket.id, ticket);
|
||||
}
|
||||
|
||||
for (let sale of sales) {
|
||||
const ticket = map.get(sale.ticketFk);
|
||||
if (!ticket.sales) ticket.sales = [];
|
||||
ticket.sales.push(sale);
|
||||
}
|
||||
|
||||
|
@ -93,6 +95,7 @@ module.exports = {
|
|||
},
|
||||
ticketSubtotal(ticket) {
|
||||
let subTotal = 0.00;
|
||||
console.log(ticket.sales);
|
||||
for (let sale of ticket.sales)
|
||||
subTotal += this.saleImport(sale);
|
||||
|
||||
|
|
Loading…
Reference in New Issue