Skip to content

Commit

Permalink
[12.0] [PORT] from 11.0
Browse files Browse the repository at this point in the history
[11.0] [FIX] l10n_ar_account_withholding: Fix a bug when the date is 0000-00-00 for new inscription to padron.
  • Loading branch information
nicomacr authored and jjscarafia committed May 13, 2020
1 parent f613406 commit de45a16
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions l10n_ar_account_withholding/models/res_company.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,16 +216,16 @@ def get_cordoba_data(self, partner, date):
dict_alic = json_body.get("sdtConsultaAlicuotas")
alicuota_percepcion = float(dict_alic.get("CRD_ALICUOTA_PER"))
alicuota_retencion = float(dict_alic.get("CRD_ALICUOTA_RET"))

# Verificar que el comprobante tenga fecha dentro de la vigencia
from_date_date = fields.Date.from_string(dict_alic.get("CRD_FECHA_INICIO"))
to_date_date = fields.Date.from_string(dict_alic.get("CRD_FECHA_FIN"))
if not (from_date_date <= date_date < to_date_date):
raise UserError(
'No se puede obtener automáticamente la alicuota para la '
'fecha %s. Por favor, ingrese la misma manualmente '
'en el partner.' % date)

# Verificamos si el par_cod no es para los recien inscriptos, que vienen con fecha "0000-00-00"
if dict_alic.get("CRD_PAR_CODIGO") != 'NUE_INS':
# Verificar que el comprobante tenga fecha dentro de la vigencia
from_date_date = fields.Date.from_string(dict_alic.get("CRD_FECHA_INICIO"))
to_date_date = fields.Date.from_string(dict_alic.get("CRD_FECHA_FIN"))
if not (from_date_date <= date_date < to_date_date):
raise UserError(
'No se puede obtener automáticamente la alicuota para la '
'fecha %s. Por favor, ingrese la misma manualmente '
'en el partner.' % date)
data = {
'alicuota_percepcion': alicuota_percepcion,
'alicuota_retencion': alicuota_retencion,
Expand Down

0 comments on commit de45a16

Please sign in to comment.