From d4b1105cdaab3332388008aa31a036598704714b Mon Sep 17 00:00:00 2001 From: joan Date: Thu, 5 Aug 2021 13:39:11 +0200 Subject: [PATCH 1/2] Ammends --- .../back/methods/invoiceOut/createManualInvoice.js | 8 +------- modules/invoiceOut/front/index/index.html | 2 +- modules/invoiceOut/front/index/locale/es.yml | 3 ++- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/modules/invoiceOut/back/methods/invoiceOut/createManualInvoice.js b/modules/invoiceOut/back/methods/invoiceOut/createManualInvoice.js index 44d52b38f..854c1e2f9 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/createManualInvoice.js +++ b/modules/invoiceOut/back/methods/invoiceOut/createManualInvoice.js @@ -80,14 +80,11 @@ module.exports = Self => { throw new UserError('This ticket is already invoiced'); // Validates ticket amount - if (ticket.totalWithVat == 0) { - // Change state to delivered + if (ticket.totalWithVat == 0) throw new UserError(`A ticket with an amount of zero can't be invoiced`); - } // Validates ticket nagative base const hasNegativeBase = await getNegativeBase(ticketId, myOptions); - if (hasNegativeBase && company.code == 'VNL') throw new UserError(`A ticket with a negative base can't be invoiced`); } else { @@ -104,9 +101,6 @@ module.exports = Self => { companyId = company.companyFk; } - // Set shipped at night - maxShipped.setHours(23, 59, 59, 59); - // Validate invoiceable client const isClientInvoiceable = await isInvoiceable(clientId, myOptions); if (!isClientInvoiceable) diff --git a/modules/invoiceOut/front/index/index.html b/modules/invoiceOut/front/index/index.html index 9d0cc4337..2ebd7b421 100644 --- a/modules/invoiceOut/front/index/index.html +++ b/modules/invoiceOut/front/index/index.html @@ -60,7 +60,7 @@
Date: Fri, 6 Aug 2021 12:47:46 +0200 Subject: [PATCH 2/2] Added translation --- modules/invoiceOut/front/index/manual/locale/es.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/invoiceOut/front/index/manual/locale/es.yml b/modules/invoiceOut/front/index/manual/locale/es.yml index 839b212f6..826057c8d 100644 --- a/modules/invoiceOut/front/index/manual/locale/es.yml +++ b/modules/invoiceOut/front/index/manual/locale/es.yml @@ -1,4 +1,5 @@ Create manual invoice: Crear factura manual Some fields are required: Algunos campos son obligatorios Client and max shipped fields should be filled: Los campos de cliente y fecha límite deben rellenarse -Max date: Fecha límite \ No newline at end of file +Max date: Fecha límite +Serial: Serie \ No newline at end of file