Update the way that take the last invoice register
This commit is contained in:
parent
dace29bbde
commit
585ead2857
4
aeat.py
4
aeat.py
|
@ -587,7 +587,7 @@ class SIIReport(Workflow, ModelSQL, ModelView):
|
||||||
for invoice in invoices_list
|
for invoice in invoices_list
|
||||||
}
|
}
|
||||||
pagination = res.IndicadorPaginacion
|
pagination = res.IndicadorPaginacion
|
||||||
last_invoice = invoices_list[-1]
|
last_invoice = registers[-1].IDFactura
|
||||||
lines_to_create = []
|
lines_to_create = []
|
||||||
for reg in registers:
|
for reg in registers:
|
||||||
taxes_to_create = []
|
taxes_to_create = []
|
||||||
|
@ -749,6 +749,7 @@ class SIIReport(Workflow, ModelSQL, ModelView):
|
||||||
_logger.debug(res)
|
_logger.debug(res)
|
||||||
registers = res.RegistroRespuestaConsultaLRFacturasRecibidas
|
registers = res.RegistroRespuestaConsultaLRFacturasRecibidas
|
||||||
pagination = res.IndicadorPaginacion
|
pagination = res.IndicadorPaginacion
|
||||||
|
last_invoice = registers[-1].IDFactura
|
||||||
|
|
||||||
# FIXME: the reference is not forced to be unique
|
# FIXME: the reference is not forced to be unique
|
||||||
lines_to_create = []
|
lines_to_create = []
|
||||||
|
@ -840,7 +841,6 @@ class SIIReport(Workflow, ModelSQL, ModelView):
|
||||||
break
|
break
|
||||||
if invoices:
|
if invoices:
|
||||||
sii_report_line['invoice'] = invoices[0].id
|
sii_report_line['invoice'] = invoices[0].id
|
||||||
last_invoice = invoices[0]
|
|
||||||
lines_to_create.append(sii_report_line)
|
lines_to_create.append(sii_report_line)
|
||||||
SIIReportLine.create(lines_to_create)
|
SIIReportLine.create(lines_to_create)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue