commit
8f36692a2a
|
|
@ -206,8 +206,8 @@ class RentPayment(models.Model):
|
|||
# payments_to_invoice = action.filtered(lambda p: p.state == 'paid' and p.collected_from_company and not p.invoice_commission_id)
|
||||
payments_to_invoice = self.env['rent.payment'].browse(active_ids).filtered(
|
||||
lambda p: p.state == 'paid' and p.collected_from_company and not p.invoice_commission_id)
|
||||
vendor_id = self.env['ir.config_parameter'].get_param('property_management.collecting_company_id')
|
||||
account_id = self.env['ir.config_parameter'].get_param('property_management.commission_account_id ')
|
||||
vendor_id = int(self.env['ir.config_parameter'].get_param('property_management.collecting_company_id'))
|
||||
account_id = int(self.env['ir.config_parameter'].get_param('property_management.commission_account_id '))
|
||||
total_commission_amount = sum(payments_to_invoice.mapped('commission_amount'))
|
||||
today_date = datetime.today().strftime('%Y-%m-%d')
|
||||
name = (_('Commission for selected payments'))
|
||||
|
|
@ -348,3 +348,5 @@ class RentPayment(models.Model):
|
|||
def get_total_amount(self):
|
||||
for rec in self:
|
||||
rec.total_amount = round(rec.untaxed_amount + rec.tax_amount,2)
|
||||
commission_percentage = self.env['ir.config_parameter'].get_param('property_management.commission_percentage')
|
||||
record.commission_amount = record.total_amount * (commission_percentage / 100) if commission_percentage else 0
|
||||
|
|
|
|||
Loading…
Reference in New Issue