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 999fafe95..d970bd15a 100644 --- a/modules/invoiceOut/front/index/index.html +++ b/modules/invoiceOut/front/index/index.html @@ -60,7 +60,7 @@