|
@@ -101,7 +101,7 @@ class EiruAccountInterest(models.Model):
|
|
@api.model
|
|
@api.model
|
|
def get_account_invoice_interest(self, invoice=None, partner=None):
|
|
def get_account_invoice_interest(self, invoice=None, partner=None):
|
|
_logger.info('Verify invoice')
|
|
_logger.info('Verify invoice')
|
|
- domain = [('state', '=', 'open'),('is_interest', '=', False), ('type', '=', 'out_invoice')]
|
|
|
|
|
|
+ domain = [('state', '=', 'open'),('is_interest', '=', False),('type', '=', 'out_invoice')]
|
|
|
|
|
|
if (invoice):
|
|
if (invoice):
|
|
domain.append(('id', '=', invoice))
|
|
domain.append(('id', '=', invoice))
|
|
@@ -121,11 +121,14 @@ class EiruAccountInterest(models.Model):
|
|
def get_move_line_in_invoice(self, invoice):
|
|
def get_move_line_in_invoice(self, invoice):
|
|
_logger.info('Get Move Line')
|
|
_logger.info('Get Move Line')
|
|
accountInvoice = self.env['account.invoice'].browse(invoice)
|
|
accountInvoice = self.env['account.invoice'].browse(invoice)
|
|
-
|
|
|
|
dateServer = self._convert_str_to_datetime(self.get_date())
|
|
dateServer = self._convert_str_to_datetime(self.get_date())
|
|
|
|
|
|
domain = [('state','!=','draft'), ('credit','<=', 0),('invoice','=',accountInvoice.id)]
|
|
domain = [('state','!=','draft'), ('credit','<=', 0),('invoice','=',accountInvoice.id)]
|
|
for line in self.env['account.move.line'].search(domain):
|
|
for line in self.env['account.move.line'].search(domain):
|
|
|
|
+
|
|
|
|
+ if(not line.date_maturity):
|
|
|
|
+ return False
|
|
|
|
+
|
|
expiredDays = dateServer - self._convert_str_to_datetime(line.date_maturity)
|
|
expiredDays = dateServer - self._convert_str_to_datetime(line.date_maturity)
|
|
if (line.date_interest):
|
|
if (line.date_interest):
|
|
expiredDays = dateServer - self._convert_str_to_datetime(line.date_interest)
|
|
expiredDays = dateServer - self._convert_str_to_datetime(line.date_interest)
|