Skip to content

Commit

Permalink
[ADD] l10n_ar_edi_ux: compatibility with module subchange
Browse files Browse the repository at this point in the history
Be able to auto complete the missing required EDI values when the
subchange is automatically created because of the use of financial plan
  • Loading branch information
zaoral committed Feb 7, 2023
1 parent 0ccd0e4 commit fef7a7c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions l10n_ar_edi_ux/wizards/account_payment_group_invoice_wizard.py
Expand Up @@ -30,4 +30,16 @@ def get_invoice_vals(self):
'l10n_ar_afip_asoc_period_end': self.l10n_ar_afip_asoc_period_end,
origin_doc: self.origin_invoice_id
})

# Si estamos creando una nota de debito automatica con el modulo de account_payment_group_financial_surcharge
# entonces seteamos automaticamente los campos l10n_ar_afip_asoc_period_start / l10n_ar_afip_asoc_period_end
# que son necesarios para poder validar la nota de debito electronica automatica. El periodo lo seteamos
# conforme a la fecha del recibo de pago. Fecha Desde (dicha fecha - 1 mes) Fecha Hasta (la fecha mencionada)
if self.env.context.get('is_automatic_subcharge'):
period_date = self.env['account.payment.group'].browse(self.env.context.get('active_id')).payment_date
invoice_vals.update({
'l10n_ar_afip_asoc_period_start': fields.Date().subtract(period_date, months=1),
'l10n_ar_afip_asoc_period_end': period_date,
})

return invoice_vals

0 comments on commit fef7a7c

Please sign in to comment.