Merge pull request #35267 from saurabh6790/fix-statistical-component-calculation
fix: update reference data for statistical component
This commit is contained in:
@@ -653,15 +653,17 @@ class SalarySlip(TransactionBase):
|
|||||||
amount = self.eval_condition_and_formula(struct_row, data)
|
amount = self.eval_condition_and_formula(struct_row, data)
|
||||||
|
|
||||||
if struct_row.statistical_component:
|
if struct_row.statistical_component:
|
||||||
|
default_data[struct_row.abbr] = amount
|
||||||
|
|
||||||
# update statitical component amount in reference data based on payment days
|
# update statitical component amount in reference data based on payment days
|
||||||
# since row for statistical component is not added to salary slip
|
# since row for statistical component is not added to salary slip
|
||||||
if struct_row.depends_on_payment_days:
|
if struct_row.depends_on_payment_days:
|
||||||
joining_date, relieving_date = self.get_joining_and_relieving_dates()
|
payment_days_amount = (
|
||||||
default_data[struct_row.abbr] = amount
|
flt(amount) * flt(self.payment_days) / cint(self.total_working_days)
|
||||||
data[struct_row.abbr] = flt(
|
if self.total_working_days
|
||||||
(flt(amount) * flt(self.payment_days) / cint(self.total_working_days)),
|
else 0
|
||||||
struct_row.precision("amount"),
|
|
||||||
)
|
)
|
||||||
|
data[struct_row.abbr] = payment_days_amount
|
||||||
|
|
||||||
elif amount or struct_row.amount_based_on_formula and amount is not None:
|
elif amount or struct_row.amount_based_on_formula and amount is not None:
|
||||||
default_amount = self.eval_condition_and_formula(struct_row, default_data)
|
default_amount = self.eval_condition_and_formula(struct_row, default_data)
|
||||||
|
|||||||
Reference in New Issue
Block a user