From bda1f1d9be89d8564ef715e35dd6a4ca0734ecd9 Mon Sep 17 00:00:00 2001 From: Maximiliano Mezzavilla Date: Tue, 3 Oct 2023 14:31:42 -0300 Subject: [PATCH] [FIX] l10n_uy_edi: Parche para facturar baratec Ticket: 66581 --- l10n_uy_edi/models/l10n_uy_cfe.py | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/l10n_uy_edi/models/l10n_uy_cfe.py b/l10n_uy_edi/models/l10n_uy_cfe.py index b5d0efd5..2858c912 100644 --- a/l10n_uy_edi/models/l10n_uy_cfe.py +++ b/l10n_uy_edi/models/l10n_uy_cfe.py @@ -981,7 +981,9 @@ def _uy_cfe_B11_PrecioUnitario(self, line, IndFact): res = False self.ensure_one() if self._is_uy_inv_type_cfe(): - res = float_repr(line.price_unit, 6) + line_discount_price_unit = line.price_unit * (1 - (line.discount / 100.0)) + subtotal = 1 * line_discount_price_unit + res = float_repr(subtotal, 6) if self._is_uy_remito_exp(): if IndFact == 5: res = float_repr(0, 6) @@ -1047,36 +1049,10 @@ def _l10n_uy_get_cfe_item_detail(self): 'UniMed': self._uy_cfe_B10_UniMed(line), 'MontoItem': self._uy_cfe_B24_MontoItem(line), # B24 Monto Item }) - if self._is_uy_inv_type_cfe() and line.discount: - item.update({'DescuentoPct': self._uy_cfe_B12_DescuentoPct(line), - 'DescuentoMonto': self._uy_cfe_B13_DescuentoMonto(line) - }) item.update(self._uy_cfe_B11_PrecioUnitario(line, item.get('IndFact'))) item.update(self._uy_cfe_B8_DscItem(line)) res.append(item) - return res - def _uy_cfe_B12_DescuentoPct(self, line): - """ Descuento en % - Descuento por item en % - Valor numérico de 3 enteros - y 3 decimales - """ - discount = float_repr(line.discount,3) - - return discount - - def _uy_cfe_B13_DescuentoMonto(self, line): - """ Monto descuento - Correspondiente a DescuentoPct. Totaliza todos los descuentos otorgados al item - Valor numerico de 15 enteros y 2 decimales - Si existe C12 debe existir C13 - """ - - discount = (line.price_unit * line.discount) / 100 - discount = float_repr(discount,2) - - return discount def _uy_cfe_B10_UniMed(self, line): if self._is_uy_inv_type_cfe():