Skip to content

Commit d3dc73a

Browse files
authored
Merge pull request #176 from gisce/restrict_only_operation_date_out_invoices
Forzar fecha operación solo en facturas emitidas
2 parents c092bfe + 0fb19ce commit d3dc73a

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

sii/resource.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -340,9 +340,11 @@ def get_fact_rect_sustitucion_fields(invoice, opcion=False):
340340
:return:
341341
"""
342342
rectificativa_fields = {
343-
'TipoRectificativa': 'S', # Por sustitución
344-
'FechaOperacion': get_fecha_operacion_rec(invoice)
343+
'TipoRectificativa': 'S' # Por sustitución
345344
}
345+
346+
if 'out_' in invoice.type:
347+
rectificativa_fields['FechaOperacion'] = get_fecha_operacion_rec(invoice)
346348

347349
if opcion == 1:
348350
factura_rectificada = invoice.rectifying_id

spec/serialization_spec.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -1114,7 +1114,6 @@ def group_by_tax_rate(iva_values, in_invoice):
11141114
).to(equal(
11151115
self.out_invoice_RA.rectifying_id.date_invoice
11161116
))
1117-
11181117
with it('debe contener el ImporteRectificacion'):
11191118
expect(
11201119
self.fact_RA_emitida['FacturaExpedida']
@@ -1152,7 +1151,10 @@ def group_by_tax_rate(iva_values, in_invoice):
11521151
expect(
11531152
self.fact_RA_recibida['FacturaRecibida']['TipoRectificativa']
11541153
).to(equal('S'))
1155-
1154+
with it('la FechaOperacion NO debe existir'):
1155+
expect(
1156+
self.fact_RA_recibida['FacturaRecibida'].get('FechaOperacion', False)
1157+
).to(equal(False))
11561158
with it('debe contener las FacturasRectificadas'):
11571159
expect(
11581160
self.fact_RA_recibida['FacturaRecibida']

0 commit comments

Comments
 (0)