-
Notifications
You must be signed in to change notification settings - Fork 207
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_ar_tax: Cálculo de retención de ganancias. #1049
Open
pablohmontenegro
wants to merge
1
commit into
ingadhoc:18.0
Choose a base branch
from
adhoc-dev:18.0-h-87686-pam
base: 18.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8bd4eea
to
5b20997
Compare
4c605fe
to
176438e
Compare
zaoral
reviewed
Feb 17, 2025
Comment on lines
22
to
30
if ( | ||
fp_tax.default_tax_id.l10n_ar_tax_type in ["earnings", "earnings_scale"] | ||
and partner.imp_ganancias_padron == False | ||
): | ||
raise UserError( | ||
self.env._( | ||
"El contacto %s no tiene configurada inscripcion en impuesto a las ganancias" % partner.name | ||
) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do it before the for, In an if and use a filtered.
you can show the detail info of the error with the problematic partners
Comment on lines
14
to
35
# Si se va a calcular retención de ganancias previamente queremos que tenga configurado el partner | ||
# La inscripción imp_ganancias_padron que corresponda. | ||
if self.l10n_ar_tax_ids.filtered( | ||
lambda x: x.tax_type == tax_type | ||
and x.default_tax_id.l10n_ar_tax_type in ["earnings", "earnings_scale"] | ||
and partner.imp_ganancias_padron == False | ||
): | ||
raise UserError( | ||
self.env._("El contacto %s no tiene configurada inscripcion en impuesto a las ganancias" % partner.name) | ||
) | ||
# El filtered en la parte del "and" va a dar true para todo impuesto que no sea de ganancias. | ||
# Si llega a ser de ganancias va a dar False en los casos que no queremmos que se calcule que son | ||
# cuando no está inscripto o no corresponde. Si está activo en la inscripción de ganancias | ||
# entonces va a dar True y calculará la retención de ganancias. | ||
for fp_tax in self.l10n_ar_tax_ids.filtered( | ||
lambda x: x.tax_type == tax_type | ||
and ( | ||
x.default_tax_id.l10n_ar_tax_type not in ["earnings", "earnings_scale"] | ||
if partner.imp_ganancias_padron != "AC" | ||
else True | ||
) | ||
): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested change
# Si se va a calcular retención de ganancias previamente queremos que tenga configurado el partner | |
# La inscripción imp_ganancias_padron que corresponda. | |
if self.l10n_ar_tax_ids.filtered( | |
lambda x: x.tax_type == tax_type | |
and x.default_tax_id.l10n_ar_tax_type in ["earnings", "earnings_scale"] | |
and partner.imp_ganancias_padron == False | |
): | |
raise UserError( | |
self.env._("El contacto %s no tiene configurada inscripcion en impuesto a las ganancias" % partner.name) | |
) | |
# El filtered en la parte del "and" va a dar true para todo impuesto que no sea de ganancias. | |
# Si llega a ser de ganancias va a dar False en los casos que no queremmos que se calcule que son | |
# cuando no está inscripto o no corresponde. Si está activo en la inscripción de ganancias | |
# entonces va a dar True y calculará la retención de ganancias. | |
for fp_tax in self.l10n_ar_tax_ids.filtered( | |
lambda x: x.tax_type == tax_type | |
and ( | |
x.default_tax_id.l10n_ar_tax_type not in ["earnings", "earnings_scale"] | |
if partner.imp_ganancias_padron != "AC" | |
else True | |
) | |
): | |
for fp_tax in self.l10n_ar_tax_ids.filtered( lambda x: x.tax_type == tax_type) | |
if fp_tax.default_tax_id.l10n_ar_tax_type in ["earnings", "earnings_scale"]> | |
if partner.imp_ganancias_padron == False | |
raise UserError( | |
self.env._("El contacto %s no tiene configurada inscripcion en impuesto a las ganancias" % partner.name) | |
) | |
if partner.imp_ganancias_padron != "AC" | |
continue | |
): |
176438e
to
a5b27ef
Compare
Tarea: 87686 Cuando el contacto tiene el campo imp_ganancias_padron (Ganancias) distinto de "Activo" entonces no debe calcular retención de ganancias sin importar si la posición fiscal tiene retención de ganancias.
a5b27ef
to
f5a4217
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Tarea: 87686
Cuando el contacto tiene el campo imp_ganancias_padron (Ganancias) distinto de "Activo" entonces no debe calcular retención de ganancias sin importar si la posición fiscal tiene retención de ganancias.