Merge pull request !1202 from dev_ljm_20241129
This commit is contained in:
ljm
2025-01-08 09:50:22 +00:00
committed by Gitee
@@ -4,7 +4,7 @@ import pandas as pd
import calendar
from dateutil.relativedelta import relativedelta
from datetime import datetime, timedelta
from odoo.tools.float_utils import float_round
from numpy.ma.core import default_filler
from odoo import models, fields, api, exceptions, _
@@ -368,7 +368,9 @@ class PropertyLeaseContract(models.Model):
all_period_rent = 0
first_years_begin = self.first_years_begin if self.first_years_begin else 0
increments_every_few_years = self.increments_every_few_years
monthly_amount = self.total_area * self.unit_price # 月租金
monthly_amount = self.total_area * self.unit_price
monthly_amount = float_round(monthly_amount, precision_digits=0, rounding_method='HALF-UP') # 月租金
# 月租金
unit_price = self.unit_price # 单价
rent_free_period_month = 0
if self.rent_free_period_month:
@@ -489,11 +491,14 @@ class PropertyLeaseContract(models.Model):
if self.increment_method == "increment_price" and self.increment_value:
unit_price = unit_price + self.increment_value
monthly_amount = self.total_area * unit_price
monthly_amount = float_round(monthly_amount, precision_digits=0, rounding_method='HALF-UP') # 月租金
if self.increment_method == "percentage" and self.increment_value:
monthly_amount = monthly_amount * (1 + (self.increment_value / 100))
monthly_amount = float_round(monthly_amount, precision_digits=0, rounding_method='HALF-UP') # 月租金
unit_price = monthly_amount / self.total_area
if self.increment_method == "increment_amount" and self.increment_value:
monthly_amount = monthly_amount + self.increment_value
monthly_amount = float_round(monthly_amount, precision_digits=0, rounding_method='HALF-UP') # 月租金
unit_price = monthly_amount / self.total_area
delta = relativedelta(increments_year[1], increments_year[0])