refs #5842 feat: comprueba que invoiceDate no sea null
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Vicent Llopis 2023-06-15 09:50:46 +02:00
parent 14ebcf96c0
commit a50de4e509
1 changed files with 2 additions and 1 deletions

View File

@ -42,13 +42,14 @@ class Controller extends Section {
this.addresses = null;
try {
console.log(this.invoiceDate, this.minInvoicingDate);
if (this.clientsToInvoice == 'one' && !this.clientId)
throw new UserError('Choose a valid client');
if (!this.invoiceDate || !this.maxShipped)
throw new UserError('Invoice date and the max date should be filled');
if (this.invoiceDate < this.maxShipped)
throw new UserError('Invoice date can\'t be less than max date');
if (this.invoiceDate.getTime() < this.minInvoicingDate.getTime())
if (this.minInvoicingDate && this.invoiceDate.getTime() < this.minInvoicingDate.getTime())
throw new UserError('Exists an invoice with a previous date');
if (!this.companyFk)
throw new UserError('Choose a valid company');