From 8c133302d766b707ab14d071b37bfde03129fe48 Mon Sep 17 00:00:00 2001 From: Luciano Rossi Date: Thu, 23 Dec 2021 18:00:27 -0300 Subject: [PATCH] =?UTF-8?q?REL=20#185=20Modificar=20Facturaci=C3=B3n=20de?= =?UTF-8?q?=20RI=20a=20Monotributistas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- invoice.fodt | 595 ++++++++++++++++++++++++++------------------------- invoice.py | 13 +- 2 files changed, 313 insertions(+), 295 deletions(-) diff --git a/invoice.fodt b/invoice.fodt index 1cb1f9f..6e3ae4e 100644 --- a/invoice.fodt +++ b/invoice.fodt @@ -1,121 +1,115 @@ - LibreOffice/6.1.5.2$Linux_X86_64 LibreOffice_project/10$Build-22017-07-25T17:09:01.4801144491P0D + LibreOffice/5.1.6.2$Linux_X86_64 LibreOffice_project/10m0$Build-22017-07-25T17:09:01.4801144491P0D - 80698 + 80518 0 - 44485 - 18292 + 32175 + 13548 true false view2 - 13458 - 89785 + 7292 + 86274 0 - 80698 - 44484 - 98988 + 80518 + 32173 + 94065 0 - 1 + 0 false - 80 + 100 false - false - false - - false - false false - false + true + true + true + 0 + true + true + + false false + false + false + false + false + false + false + false + false + false + false + false true - true - true - false - true - false - + false + true true - - false - false - true - false + false + false false - 343152 - false + + false + false + true + false false + + false + false + false + false true - true - false - false - true + 8454927 + false + true + false + false true - true + true + false true - true + 0 + false + true + high-resolution + false + false + false + true true + true + + true + false false - false - 1 - false + true + false + false + false + + false + false + 343152 false - - false - false - - false - false - false - - false - 0 - 0 - true - + 1 + true + false false - true - false + 0 false false + + false - false - true - false - false - false - true - 8235254 - false - false - false - false - false - high-resolution - false - true - false - false - false - false - false - false - true - false - false - false - true - true - false - 0 @@ -140,7 +134,7 @@ - + @@ -609,310 +603,316 @@ - + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -920,7 +920,7 @@ - + @@ -928,18 +928,21 @@ - + - + - + + + + @@ -1081,7 +1084,10 @@ - + + + + @@ -1121,13 +1127,13 @@ - <replace text:p="set_lang(invoice.party.lang and invoice.party.lang.code or 'es')"> - <replace text:p="invoice.set_lang(invoice.party.lang and invoice.party.lang.code or 'es')"> + <replace text:p="set_lang(invoice.party.lang and invoice.party.lang.code or 'es')"> + <replace text:p="invoice.set_lang(invoice.party.lang and invoice.party.lang.code or 'es')"> - ORIGINAL + ORIGINAL @@ -1137,49 +1143,49 @@ - <if test="hasattr(company, 'logo') and company.logo"> - + <if test="hasattr(company, 'logo') and company.logo"> + - + </if> - <invoice.company.party.full_name.upper()> - <if test="invoice.company.party.addresses"> - <for each="line in invoice.company.party.addresses[0].full_address.split('-')"> - <line> - </for> - </if> - IVA <condicion_iva> + <invoice.company.party.full_name.upper()> + <if test="invoice.company.party.addresses"> + <for each="line in invoice.company.party.addresses[0].full_address.split('-')"> + <line> + </for> + </if> + IVA <condicion_iva> - <tipo_comprobante> - COD. <codigo_comprobante> + <tipo_comprobante> + COD. <codigo_comprobante> - <choose test=""> - <when test="invoice.state == 'draft'"> - FACTURA BORRADOR - </when> - <when test="invoice.state == 'validated'"> - FACTURA PROFORMA - N°:<invoice.origins or ''><', ' if (invoice.reference and invoice.origins) else ''><invoice.reference or ''> - </when> - <otherwise test=""> - <nombre_comprobante.upper()> - N°:<invoice.number and ' ' + invoice.number or ''> - </otherwise> - </choose> - Fecha:<format_date(invoice.invoice_date or today, invoice.party.lang)> - <if test="invoice.company.party.vat_number"> - CUIT: <vat_number> - </if> - <if test="iibb_type"> - IIBB:<iibb_type> - </if> - <if test="invoice.company.party.start_activity_date"> - Inicio de Actividad: <format_date(invoice.company.party.start_activity_date, invoice.party.lang)> - </if> + <choose test=""> + <when test="invoice.state == 'draft'"> + FACTURA BORRADOR + </when> + <when test="invoice.state == 'validated'"> + FACTURA PROFORMA + N°:<invoice.origins or ''><', ' if (invoice.reference and invoice.origins) else ''><invoice.reference or ''> + </when> + <otherwise test=""> + <nombre_comprobante.upper()> + N°:<invoice.number and ' ' + invoice.number or ''> + </otherwise> + </choose> + Fecha:<format_date(invoice.invoice_date or today, invoice.party.lang)> + <if test="invoice.company.party.vat_number"> + CUIT: <vat_number> + </if> + <if test="iibb_type"> + IIBB:<iibb_type> + </if> + <if test="invoice.company.party.start_activity_date"> + Inicio de Actividad: <format_date(invoice.company.party.start_activity_date, invoice.party.lang)> + </if> @@ -1187,8 +1193,8 @@ - Sr.(s) <invoice.party.full_name> - Domicilio: <invoice.invoice_address.full_address> + Sr.(s) <invoice.party.full_name> + Domicilio: <invoice.invoice_address.full_address> @@ -1197,10 +1203,10 @@ - IVA <condicion_iva_cliente> + IVA <condicion_iva_cliente> - <choose test=""><when test="invoice.party.vat_number">CUIT: <vat_number_cliente></when><when test="invoice.party.vat_number_afip_foreign">CUIT País: <invoice.party.vat_number_afip_foreign></when><otherwise test="">DNI:<dni_number_cliente></otherwise></choose> + <choose test=""><when test="invoice.party.vat_number">CUIT: <vat_number_cliente></when><when test="invoice.party.vat_number_afip_foreign">CUIT País: <invoice.party.vat_number_afip_foreign></when><otherwise test="">DNI:<dni_number_cliente></otherwise></choose> @@ -1208,7 +1214,7 @@ - <if test="invoice.pyafipws_billing_start_date">Periodo Facturado: <format_date(invoice.pyafipws_billing_start_date, invoice.party.lang)><format_date(invoice.pyafipws_billing_end_date, invoice.party.lang)></if> + <if test="invoice.pyafipws_billing_start_date">Periodo Facturado: <format_date(invoice.pyafipws_billing_start_date, invoice.party.lang)> <format_date(invoice.pyafipws_billing_end_date, invoice.party.lang)></if> @@ -1221,23 +1227,23 @@ - Description + Description - Quantity + Quantity - Unit Price + Unit Price - Amount + Amount - <for each="line in invoice.lines"> + <for each="line in invoice.lines"> @@ -1246,7 +1252,7 @@ - <choose test=""> + <choose test=""> @@ -1255,7 +1261,7 @@ - <when test="line.type == 'line'"> + <when test="line.type == 'line'"> @@ -1264,29 +1270,29 @@ - <if test="line.product"> - <line.product.rec_name> - </if> - <if test="line.description"> - <for each="line in line.description.split('\n')"> - <line> - </for> - </if> + <if test="line.product"> + <line.product.rec_name> + </if> + <if test="line.description"> + <for each="line in line.description.split('\n')"> + <line> + </for> + </if> - <(format_number(abs(line.quantity), invoice.party.lang, digits=line.unit_digits) + (line.unit and (' ' + line.unit.symbol) or '')) or ''> + <(format_number(abs(line.quantity), invoice.party.lang, digits=line.unit_digits) + (line.unit and (' ' + line.unit.symbol) or '')) or ''> - <format_number(get_line_amount(line.unit_price, line.invoice_taxes), invoice.party.lang, digits=invoice.currency.digits, monetary=invoice.currency)> + <format_number(get_line_amount(line.unit_price, line.invoice_taxes), invoice.party.lang, digits=invoice.currency.digits, monetary=invoice.currency)> - <format_currency(get_line_amount(line.amount, line.invoice_taxes, invoice.invoice_type), invoice.party.lang, currency=invoice.currency)> + <format_currency(get_line_amount(line.amount, line.invoice_taxes, invoice.invoice_type), invoice.party.lang, currency=invoice.currency)> - </when> + </when> @@ -1295,7 +1301,7 @@ - <when test="line.type == 'subtotal'"> + <when test="line.type == 'subtotal'"> @@ -1304,20 +1310,20 @@ - <for each="line in (line.description or '').split('\n')"> - <line> - </for> + <for each="line in (line.description or '').split('\n')"> + <line> + </for> - <format_currency(line.amount, invoice.party.lang, invoice.currency)> + <format_currency(line.amount, invoice.party.lang, invoice.currency)> - </when> + </when> @@ -1326,7 +1332,7 @@ - <when test="line.type == 'title'"> + <when test="line.type == 'title'"> @@ -1335,9 +1341,9 @@ - <for each="line in (line.description or '').split('\n')"> - <line> - </for> + <for each="line in (line.description or '').split('\n')"> + <line> + </for> @@ -1346,7 +1352,7 @@ - </when> + </when> @@ -1355,7 +1361,7 @@ - <otherwise test=""> + <otherwise test=""> @@ -1364,9 +1370,9 @@ - <for each="line in (line.description or '').split('\n')"> - <line> - </for> + <for each="line in (line.description or '').split('\n')"> + <line> + </for> @@ -1375,7 +1381,7 @@ - </otherwise> + </otherwise> @@ -1384,7 +1390,7 @@ - </choose> + </choose> @@ -1393,7 +1399,7 @@ - </for> + </for> @@ -1413,47 +1419,47 @@ - + - Tax + Tax - Amount + Amount - <for each="tax in get_taxes(invoice.taxes)"> + <for each="tax in get_taxes(invoice.taxes)"> - <tax.description or ''> + <tax.description or ''> - <format_currency(abs(tax.amount), invoice.party.lang, currency=invoice.currency)> + <format_currency(abs(tax.amount), invoice.party.lang, currency=invoice.currency)> - </for> + </for> - + - + @@ -1465,34 +1471,34 @@ - Gravado + Gravado - <format_currency(invoice.pyafipws_imp_neto, invoice.party.lang, currency=invoice.currency)> + <format_currency(invoice.pyafipws_imp_neto, invoice.party.lang, currency=invoice.currency)> - No gravado + No gravado - <format_currency(invoice.pyafipws_imp_tot_conc, invoice.party.lang, currency=invoice.currency)> + <format_currency(invoice.pyafipws_imp_tot_conc, invoice.party.lang, currency=invoice.currency)> - Exento + Exento - <format_currency(invoice.pyafipws_imp_op_ex, invoice.party.lang, currency=invoice.currency)> + <format_currency(invoice.pyafipws_imp_op_ex, invoice.party.lang, currency=invoice.currency)> - Percepciones + Percepciones - <format_currency(invoice.pyafipws_imp_trib, invoice.party.lang, currency=invoice.currency)> + <format_currency(invoice.pyafipws_imp_trib, invoice.party.lang, currency=invoice.currency)> @@ -1509,34 +1515,34 @@ - Subtotal: + Subtotal: - <format_currency(get_subtotal(invoice), invoice.party.lang, currency=invoice.currency)> + <format_currency(get_subtotal(invoice), invoice.party.lang, currency=invoice.currency)> - Taxes: + Taxes: - <format_currency(get_impuestos(invoice), invoice.party.lang, currency=invoice.currency)> + <format_currency(get_impuestos(invoice), invoice.party.lang, currency=invoice.currency)> - Total: + Total: - <format_currency(abs(invoice.total_amount), invoice.party.lang, currency=invoice.currency)> + <format_currency(abs(invoice.total_amount), invoice.party.lang, currency=invoice.currency)> - - - - - + + + + + @@ -1547,7 +1553,7 @@ - Payment Term + Payment Term <if test="invoice.payment_term and invoice.payment_term.description"> <for each="description in (invoice.payment_term.description or '').split('\n')"> <description> @@ -1558,45 +1564,46 @@ - Date + Date - Amount + Amount - <for each="line in invoice.lines_to_pay"> + <for each="line in invoice.lines_to_pay"> - <format_date(line.maturity_date, invoice.party.lang)> + <format_date(line.maturity_date, invoice.party.lang)> - <line.amount_second_currency and format_currency(abs(line.amount_second_currency), invoice.party.lang, invoice.currency) or format_currency(abs(line.debit - line.credit), invoice.party.lang, invoice.currency)> + <line.amount_second_currency and format_currency(abs(line.amount_second_currency), invoice.party.lang, invoice.currency) or format_currency(abs(line.debit - line.credit), invoice.party.lang, invoice.currency)> - </for> + </for> - </if> + </if> <for each="comment in (invoice.comment or '').split('\n')"> <comment> - </for> - <if test="invoice.pyafipws_cae"> + </for> + <leyenda_ley_27618> + <if test="invoice.pyafipws_cae"> - + iVBORw0KGgoAAAANSUhEUgAAAaAAAADOCAYAAAB4v9bHAAAABHNCSVQICAgIfAhkiAAAIABJ REFUeJzsnXm8VdV5939rrb33OfdeRgEVVFTECVFEUcE4IIOCiEDUDFYb82li0yEmbW2bvmna pnnrm6R5m7xv29RO5o1ttBlkFEFRcEBQVCyIQxwQBwQELnC5wzl777We94+1n3X2OVwE5M6u @@ -2261,20 +2268,20 @@ - CAE N° <invoice.pyafipws_cae> - Fecha Vto. CAE: <format_date(invoice.pyafipws_cae_due_date, company.party.lang)> + CAE N° <invoice.pyafipws_cae> + Fecha Vto. CAE: <format_date(invoice.pyafipws_cae_due_date, company.party.lang)> - Esta administración no se responsabiliza por los datos ingresados en el detalle de la operación. + Esta administración no se responsabiliza por los datos ingresados en el detalle de la operación. - </if> - - + </if> + + \ No newline at end of file diff --git a/invoice.py b/invoice.py index f3d4d78..a1c94c6 100644 --- a/invoice.py +++ b/invoice.py @@ -890,7 +890,7 @@ def _set_invoice_type_sequence(self): if company_iva == 'responsable_inscripto': if not client_iva: return None - if client_iva == 'responsable_inscripto': + if client_iva in ('responsable_inscripto', 'monotributo'): kind = 'A' elif client_iva == 'consumidor_final': kind = 'B' @@ -1995,6 +1995,7 @@ def get_context(cls, records, header, data): Invoice, invoice) context['dni_number_cliente'] = cls._get_dni_number_cliente( Invoice, invoice) + context['leyenda_ley_27618'] = cls._get_leyenda_ley_27618(invoice) context['get_impuestos'] = cls.get_impuestos context['get_line_amount'] = cls.get_line_amount context['get_taxes'] = cls.get_taxes @@ -2111,6 +2112,16 @@ def _get_dni_number_cliente(cls, Invoice, invoice): value = identifier.code return value + @classmethod + def _get_leyenda_ley_27618(cls, invoice): + if invoice.company.party.iva_condition == 'responsable_inscripto' \ + and invoice.party.iva_condition == 'monotributo': + return 'El crédito fiscal discriminado en el presente ' \ + 'comprobante, sólo podrá ser computado a efectos del ' \ + 'Régimen de Sostenimiento e Inclusión Fiscal para Pequeños ' \ + ' Contribuyentes de la Ley Nº 27.618' + return '' + @classmethod def _get_tipo_comprobante(cls, Invoice, invoice): if invoice.invoice_type: