5842-hotfix_recalcularFechaFactura #1617

Merged
alexm merged 4 commits from 5842-hotfix_recalcularFechaFactura into master 2023-06-15 08:32:16 +00:00
1 changed files with 2 additions and 1 deletions
Showing only changes of commit a50de4e509 - Show all commits

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');