Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] l10n_uy_edi: Parche para facturar baratec #150

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 3 additions & 27 deletions l10n_uy_edi/models/l10n_uy_cfe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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():
Expand Down