From 674b959bbc30e2817b9ccf474401ea6302d887bc Mon Sep 17 00:00:00 2001 From: carlosjr Date: Thu, 11 Mar 2021 15:14:08 +0100 Subject: [PATCH] minor refactor --- modules/ticket/back/methods/ticket/canBeInvoiced.js | 4 +++- modules/ticket/front/index/index.html | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/ticket/back/methods/ticket/canBeInvoiced.js b/modules/ticket/back/methods/ticket/canBeInvoiced.js index 79c3cf69a..8300ae110 100644 --- a/modules/ticket/back/methods/ticket/canBeInvoiced.js +++ b/modules/ticket/back/methods/ticket/canBeInvoiced.js @@ -23,7 +23,9 @@ module.exports = function(Self) { }); Self.canBeInvoiced = async id => { - let ticket = await Self.app.models.Ticket.findById(id, {fields: ['id', 'refFk', 'shipped', 'totalWithVat']}); + let ticket = await Self.app.models.Ticket.findById(id, { + fields: ['id', 'refFk', 'shipped', 'totalWithVat'] + }); let query = `SELECT vn.hasSomeNegativeBase(?) AS hasSomeNegativeBase`; let [result] = await Self.rawSql(query, [id]); diff --git a/modules/ticket/front/index/index.html b/modules/ticket/front/index/index.html index 1f016b90a..13e2944e5 100644 --- a/modules/ticket/front/index/index.html +++ b/modules/ticket/front/index/index.html @@ -121,7 +121,7 @@ {{::ticket.warehouse}} - {{::ticket.totalWithVat | currency: 'EUR': 2}} + {{::(ticket.totalWithVat ? ticket.totalWithVat : 0) | currency: 'EUR': 2}}