Merge pull request #998 from expsa/setting_property

Setting property
This commit is contained in:
zainab2097 2024-09-04 13:11:27 +03:00 committed by GitHub
commit 8f36692a2a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 2 deletions

View File

@ -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