mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
[IMP] hr_commission: add option for tax excluded invoice total
This commit is contained in:
@@ -39,10 +39,11 @@ class AccountInvoice(models.Model):
|
||||
return res
|
||||
|
||||
def amount_for_commission(self):
|
||||
# TODO Should toggle in Config Params
|
||||
if hasattr(self, 'margin') and self.company_id.commission_amount_type == 'on_invoice_margin':
|
||||
sign = -1 if self.type in ['in_refund', 'out_refund'] else 1
|
||||
return self.margin * sign
|
||||
elif self.company_id.commission_amount_type == 'on_invoice_untaxed':
|
||||
return self.amount_untaxed_invoice_signed
|
||||
return self.amount_total_company_signed
|
||||
|
||||
@api.multi
|
||||
|
||||
@@ -15,4 +15,5 @@ class ResCompany(models.Model):
|
||||
commission_amount_type = fields.Selection([
|
||||
('on_invoice_margin', 'On Invoice Margin'),
|
||||
('on_invoice_total', 'On Invoice Total'),
|
||||
('on_invoice_untaxed', 'On Invoice Total Tax Excluded'),
|
||||
], string='Commission Base', default='on_invoice_margin')
|
||||
|
||||
Reference in New Issue
Block a user