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

[IMP] l10n_ar_withholding_ux: apply ratio on base amount #888

Open
wants to merge 1 commit into
base: 17.0
Choose a base branch
from

Conversation

pablohmontenegro
Copy link
Contributor

Tarea: 42355

@roboadhoc
Copy link

@pablohmontenegro pablohmontenegro force-pushed the 17.0-t-42355-pam branch 3 times, most recently from 528164c to 5640dfa Compare August 14, 2024 18:51
@pablohmontenegro pablohmontenegro force-pushed the 17.0-t-42355-pam branch 3 times, most recently from 1aa8549 to e592f01 Compare September 3, 2024 16:13
@pablohmontenegro pablohmontenegro force-pushed the 17.0-t-42355-pam branch 2 times, most recently from b6b2013 to bf57e37 Compare October 30, 2024 12:14
@@ -80,6 +80,7 @@ class AccountTax(models.Model):
'tax_withholding_id',
'Rules',
)
ratio = fields.Float(required=True, default=100, help="Ratio to apply to tax base amount")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Para quien haga review técnico me queda dudas si debe ser requerido, o si debemos hacer que siempre sea 100 y hacemos que sea solo visible para argentina

@@ -66,7 +66,7 @@ def get_withholding_vals(self, payment):
base_amount = vals['withholdable_base_amount']

if self.withholding_type == 'partner_tax':
amount = base_amount * (alicuota)
amount = base_amount * (alicuota) * self.ratio / 100
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
amount = base_amount * (alicuota) * self.ratio / 100
amount = base_amount * (alicuota) * (self.ratio or 100) / 100

@@ -250,7 +250,7 @@ def _compute_amount(
if self.amount_type == 'partner_tax':
date = self._context.get('invoice_date', fields.Date.context_today(self))
partner = partner and partner.sudo()
return base_amount * self.sudo().get_partner_alicuota_percepcion(partner, date)
return base_amount * self.sudo().get_partner_alicuota_percepcion(partner, date) * self.ratio / 100
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(self.ratio or 100)

@@ -80,6 +80,7 @@ class AccountTax(models.Model):
'tax_withholding_id',
'Rules',
)
ratio = fields.Float(required=True, default=100, help="Ratio to apply to tax base amount")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove default and required, extend help

Suggested change
ratio = fields.Float(required=True, default=100, help="Ratio to apply to tax base amount")
ratio = fields.Float(help="Ratio to apply to tax base amount. If left empty will be 100 % ratio")

""" Check that the total percent is not bigger than 100.0 """
for tax in self:
if not (0 < tax.ratio <= 100.0):
raise ValidationError(_('The total percentage (%s) should be less or equal to 100!', tax.ratio))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

greather than 0 and...

@@ -47,6 +47,7 @@
</div>
<field name="withholding_non_taxable_minimum"/>
<field name="withholding_non_taxable_amount"/>
<field name="ratio" invisible="country_code != 'AR'"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

            <label for="ratio" invisible="country_code != 'AR'/>
            <div invisible="country_code != 'AR'>
                <field name="ratio" class="oe_inline"/>
                %
            </div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants