mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-03 12:18:46 +02:00
feat: Allow ceil & floor functions in salary slip formulae (#35475)
This commit is contained in:
@@ -1,17 +1,18 @@
|
|||||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||||
# License: GNU General Public License v3. See license.txt
|
# License: GNU General Public License v3. See license.txt
|
||||||
|
|
||||||
import datetime
|
from datetime import date
|
||||||
import math
|
|
||||||
|
|
||||||
import frappe
|
import frappe
|
||||||
from frappe import _, msgprint
|
from frappe import _, msgprint
|
||||||
from frappe.model.naming import make_autoname
|
from frappe.model.naming import make_autoname
|
||||||
from frappe.utils import (
|
from frappe.utils import (
|
||||||
add_days,
|
add_days,
|
||||||
|
ceil,
|
||||||
cint,
|
cint,
|
||||||
cstr,
|
cstr,
|
||||||
date_diff,
|
date_diff,
|
||||||
|
floor,
|
||||||
flt,
|
flt,
|
||||||
formatdate,
|
formatdate,
|
||||||
get_first_day,
|
get_first_day,
|
||||||
@@ -57,8 +58,10 @@ class SalarySlip(TransactionBase):
|
|||||||
"float": float,
|
"float": float,
|
||||||
"long": int,
|
"long": int,
|
||||||
"round": round,
|
"round": round,
|
||||||
"date": datetime.date,
|
"date": date,
|
||||||
"getdate": getdate,
|
"getdate": getdate,
|
||||||
|
"ceil": ceil,
|
||||||
|
"floor": floor,
|
||||||
}
|
}
|
||||||
|
|
||||||
def autoname(self):
|
def autoname(self):
|
||||||
@@ -959,7 +962,7 @@ class SalarySlip(TransactionBase):
|
|||||||
tax_slab.allow_tax_exemption, payroll_period=payroll_period
|
tax_slab.allow_tax_exemption, payroll_period=payroll_period
|
||||||
)
|
)
|
||||||
future_structured_taxable_earnings = current_taxable_earnings.taxable_earnings * (
|
future_structured_taxable_earnings = current_taxable_earnings.taxable_earnings * (
|
||||||
math.ceil(remaining_sub_periods) - 1
|
ceil(remaining_sub_periods) - 1
|
||||||
)
|
)
|
||||||
|
|
||||||
# get taxable_earnings, addition_earnings for current actual payment days
|
# get taxable_earnings, addition_earnings for current actual payment days
|
||||||
|
|||||||
Reference in New Issue
Block a user