pricing rule fix
This commit is contained in:
parent
8c9fb76854
commit
2afb9b96cd
@ -201,6 +201,8 @@ def remove_pricing_rule_for_item(pricing_rule, item_details):
|
||||
item_details.margin_rate_or_amount = 0.0
|
||||
item_details.margin_type = None
|
||||
|
||||
if item_details.pricing_rule:
|
||||
item_details.pricing_rule = None
|
||||
return item_details
|
||||
|
||||
@frappe.whitelist()
|
||||
|
@ -28,8 +28,12 @@ class EmployeeLoanApplication(Document):
|
||||
|
||||
if self.repayment_method == "Repay Fixed Amount per Period":
|
||||
monthly_interest_rate = flt(self.rate_of_interest) / (12 *100)
|
||||
self.repayment_periods = math.ceil((math.log(self.repayment_amount) - math.log(self.repayment_amount - \
|
||||
(self.loan_amount*monthly_interest_rate)))/(math.log(1+monthly_interest_rate)))
|
||||
if monthly_interest_rate:
|
||||
self.repayment_periods = math.ceil((math.log(self.repayment_amount) -
|
||||
math.log(self.repayment_amount - (self.loan_amount*monthly_interest_rate))) /
|
||||
(math.log(1 + monthly_interest_rate)))
|
||||
else:
|
||||
self.repayment_periods = self.loan_amount / self.repayment_amount
|
||||
|
||||
self.total_payable_amount = self.repayment_amount * self.repayment_periods
|
||||
self.total_payable_interest = self.total_payable_amount - self.loan_amount
|
||||
|
Loading…
Reference in New Issue
Block a user