Try ERPNext Buy Support Partners Foundation

Depends on Payment Days is not working in formula calculation

Github Issue: https://github.com/frappe/erpnext/issues/19413

When using a variable whose value is affected by “Depends on Payment Days (DPD)” in the formula of any other component, it takes the total value and not the value affected by “Depends on Payment Days”.

Output of bench version
erpnext 12.1.7
frappe 12.0.17

Steps to reproduce the issue

  1. Create a new Salary Structure
  2. Add a new Salary Component for example Basic Salary (BS) with a formula value as: base, and set Depends on Payment Days (DPD) as enabled.
  3. Add a new Salary Component for example Basic Salary Two (BS2) with a formula value as: BS, and with Depends on Payment Days (DPD) disabled.
  4. Test the Salary Structure with an employee that has less Payment Days than Working Days

Example configuration

Working Days: 30
Payment Days: 15
base: 1.000

Basic Salary (BS) = base
Basic Salary Two (BS2) = BS

Observed result
BS = 500 (Correct as it’s affected by DPD, he only worked half month)
BS2 = 1.000 (Incorrect as BS has a value of 500, it should be also 500)

Expected result
BS = 500
BS2 = 500

My scenario is as follows:

I need to calculate other components, taking into account the BS (affected by DPD), but adding another variable that should not be affected by DPD, example:

BS = base = 1.000 = (with DPD) = 500
X = 5.000 (Fixed value that should not be affected by DPD)
BS2= BS + X = 5.500 (But right know it displays 6.000 incorrectly as it takes BS as 1.000)

1 Like

I have a few questions too

  1. What counted in “Payment days” ?
  2. Does ERPNext count days since the Join date if an employee join in middle of month? (right now it is not when I set base salary component as Depends on Payment days)
  3. Will date marked as Absent (in Attendance tool) be excluded from “Payment days” or still be included ?