@@ -990,9 +990,9 @@ def group_by_tax_rate(iva_values, in_invoice):
990
990
self .out_refund .tax_line [0 ].tax_id .amount * 100
991
991
))
992
992
993
- with description ('en los datos de una factura rectificativa emitida con IVA 5% fecha postrior vigencia' ):
993
+ with description ('en los datos de una factura rectificativa emitida con IVA 5% fecha postrior vigencia como tipo R4 ' ):
994
994
with before .all :
995
- self .out_refund , self .out_b_inovice = self .data_gen .get_out_refund_invoice_iva5 ()
995
+ self .out_refund , self .out_b_inovice = self .data_gen .get_out_refund_invoice_iva5 (sii_non_current_tax_rate = 'R4' )
996
996
self .out_refund_obj = SII (self .out_refund ).generate_object ()
997
997
self .out_b_inovice_obj = SII (self .out_b_inovice ).generate_object ()
998
998
self .fact_rect_emit = (
@@ -1008,6 +1008,100 @@ def group_by_tax_rate(iva_values, in_invoice):
1008
1008
expect (
1009
1009
self .fact_refund_emit ['FacturaExpedida' ]['FechaOperacion' ]
1010
1010
).to (equal ('01-01-2023' ))
1011
+ with it ('la TipoRectificativa debe ser S' ):
1012
+ expect (
1013
+ self .fact_refund_emit ['FacturaExpedida' ]['TipoRectificativa' ]
1014
+ ).to (equal ('S' ))
1015
+ with it ('la TipoFactura tiene que ser R4' ):
1016
+ expect (
1017
+ self .fact_refund_emit ['FacturaExpedida' ][
1018
+ 'TipoFactura' ]
1019
+ ).to (equal ('R4' ))
1020
+ with context ('en los datos de rectificación' ):
1021
+ with it ('el TipoRectificativa debe ser por sustitución (S)' ):
1022
+ expect (
1023
+ self .fact_rect_emit ['FacturaExpedida' ]['TipoRectificativa' ]
1024
+ ).to (equal ('S' ))
1025
+
1026
+ with it ('la FechaOperacion debe ser por factura original' ):
1027
+ expect (
1028
+ self .fact_rect_emit ['FacturaExpedida' ]['FechaOperacion' ]
1029
+ ).to (equal ('01-01-2023' ))
1030
+
1031
+ with before .all :
1032
+ self .importe_rectificacion = (
1033
+ self .fact_rect_emit ['FacturaExpedida' ]
1034
+ ['ImporteRectificacion' ]
1035
+ )
1036
+
1037
+ with it ('la BaseRectificada debe ser 0' ):
1038
+ expect (
1039
+ self .importe_rectificacion ['BaseRectificada' ]
1040
+ ).to (equal (0 ))
1041
+
1042
+ with it ('la CuotaRectificada debe ser 0' ):
1043
+ expect (
1044
+ self .importe_rectificacion ['CuotaRectificada' ]
1045
+ ).to (equal (0 ))
1046
+
1047
+ with context ('en los detalles del IVA' ):
1048
+ with before .all :
1049
+ detalle_iva = (
1050
+ self .fact_rect_emit ['FacturaExpedida' ]['TipoDesglose' ]
1051
+ ['DesgloseFactura' ]['Sujeta' ]['NoExenta' ]['DesgloseIVA' ]
1052
+ ['DetalleIVA' ]
1053
+ )
1054
+ self .grouped_detalle_iva = group_by_tax_rate (
1055
+ detalle_iva , in_invoice = False
1056
+ )
1057
+
1058
+ with it ('la BaseImponible debe ser la original' ):
1059
+ expect (
1060
+ self .grouped_detalle_iva [5.0 ]['BaseImponible' ]
1061
+ ).to (equal (
1062
+ self .out_refund .tax_line [0 ].base
1063
+ ))
1064
+ with it ('la CuotaRepercutida debe ser la original' ):
1065
+ expect (
1066
+ self .grouped_detalle_iva [5.0 ]['CuotaRepercutida' ]
1067
+ ).to (equal (
1068
+ - 1 * abs (self .out_refund .tax_line [0 ].tax_amount )
1069
+ ))
1070
+ with it ('el TipoImpositivo debe ser la original' ):
1071
+ expect (
1072
+ self .grouped_detalle_iva [5.0 ]['TipoImpositivo' ]
1073
+ ).to (equal (
1074
+ self .out_refund .tax_line [0 ].tax_id .amount * 100
1075
+ ))
1076
+
1077
+ with description ('en los datos de una factura rectificativa emitida con IVA 5% fecha postrior vigencia como tipo F1' ):
1078
+ with before .all :
1079
+ self .out_refund , self .out_b_inovice = self .data_gen .get_out_refund_invoice_iva5 (sii_non_current_tax_rate = 'F1' )
1080
+ self .out_refund_obj = SII (self .out_refund ).generate_object ()
1081
+ self .out_b_inovice_obj = SII (self .out_b_inovice ).generate_object ()
1082
+ self .fact_rect_emit = (
1083
+ self .out_refund_obj ['SuministroLRFacturasEmitidas' ]
1084
+ ['RegistroLRFacturasEmitidas' ]
1085
+ )
1086
+ self .fact_refund_emit = (
1087
+ self .out_b_inovice_obj ['SuministroLRFacturasEmitidas' ]
1088
+ ['RegistroLRFacturasEmitidas' ]
1089
+ )
1090
+ with context ('en los datos de abonadora' ):
1091
+ with it ('la FechaOperacion debe ser por factura original' ):
1092
+ expect (
1093
+ self .fact_refund_emit ['FacturaExpedida' ]['FechaOperacion' ]
1094
+ ).to (equal ('01-01-2023' ))
1095
+ with it ('la TipoRectificativa NO debe existir' ):
1096
+ expect (
1097
+ self .fact_refund_emit ['FacturaExpedida' ].get (
1098
+ 'TipoRectificativa' , False )
1099
+ ).to (equal (False ))
1100
+ with it ('la TipoFactura tiene que ser F1' ):
1101
+ expect (
1102
+ self .fact_refund_emit ['FacturaExpedida' ][
1103
+ 'TipoFactura' ]
1104
+ ).to (equal ('F1' ))
1011
1105
with context ('en los datos de rectificación' ):
1012
1106
with it ('el TipoRectificativa debe ser por sustitución (S)' ):
1013
1107
expect (
@@ -1084,6 +1178,14 @@ def group_by_tax_rate(iva_values, in_invoice):
1084
1178
self .fact_refund_emit ['FacturaExpedida' ].get (
1085
1179
'FechaOperacion' , False )
1086
1180
).to (equal (False ))
1181
+ with it ('la TipoRectificativa NO debe ser informado' ):
1182
+ expect (
1183
+ self .fact_refund_emit ['FacturaExpedida' ].get ('TipoRectificativa' ,False )
1184
+ ).to (equal (False ))
1185
+ with it ('la TipoFactura tiene que ser F1' ):
1186
+ expect (
1187
+ self .fact_refund_emit ['FacturaExpedida' ].get ('TipoFactura' , False )
1188
+ ).to (equal ('F1' ))
1087
1189
with context ('en los datos de rectificación' ):
1088
1190
with it ('el TipoRectificativa debe ser por sustitución (S)' ):
1089
1191
expect (
@@ -1094,6 +1196,15 @@ def group_by_tax_rate(iva_values, in_invoice):
1094
1196
expect (
1095
1197
self .fact_rect_emit ['FacturaExpedida' ].get ('FechaOperacion' , False )
1096
1198
).to (equal (False ))
1199
+ with it ('la TipoRectificativa debe ser S' ):
1200
+ expect (
1201
+ self .fact_rect_emit ['FacturaExpedida' ].get ('TipoRectificativa' ,False )
1202
+ ).to (equal ('S' ))
1203
+ with it ('la TipoFactura tiene que ser R4' ):
1204
+ expect (
1205
+ self .fact_rect_emit ['FacturaExpedida' ][
1206
+ 'TipoFactura' ]
1207
+ ).to (equal ('R4' ))
1097
1208
1098
1209
with before .all :
1099
1210
self .importe_rectificacion = (
@@ -1159,6 +1270,15 @@ def group_by_tax_rate(iva_values, in_invoice):
1159
1270
expect (
1160
1271
self .fact_refund_emit ['FacturaExpedida' ]['FechaOperacion' ]
1161
1272
).to (equal ('01-01-2023' ))
1273
+ with it ('la TipoRectificativa debe ser S' ):
1274
+ expect (
1275
+ self .fact_refund_emit ['FacturaExpedida' ]['TipoRectificativa' ]
1276
+ ).to (equal ('S' ))
1277
+ with it ('la TipoFactura tiene que ser R4' ):
1278
+ expect (
1279
+ self .fact_refund_emit ['FacturaExpedida' ][
1280
+ 'TipoFactura' ]
1281
+ ).to (equal ('R4' ))
1162
1282
with context ('en los datos de rectificación' ):
1163
1283
with it ('la FechaOperacion debe ser por factura original' ):
1164
1284
expect (
0 commit comments