fix: add party and party type for receivable & payable accounts#3876
Conversation
WalkthroughThis change modifies the PayrollEntry class to support employee-wise accounting. The 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…vable-&-payable-account
…vable-&-payable-account
…vable-&-payable-account
…vable-&-payable-account
|
Hello @elshafei-developer, The total of all these components is then credited to Payroll Payable account which is of Type: Payable as this becomes a liability to a company. If you have a valid use case where a salary component is set as payable or receivable, please share it so that this case can be handle |
|
We do not have any earning salary components configured as Payable or Receivable. Our use case is limited strictly to two deduction components: Payable (Salary Withholding) Account – used to deduct a portion of the employee’s salary that is recorded as a payable (liability) until it is settled. Receivable (Loan) Account – used to deduct installments for an employee loan, which reduces an existing receivable balance owed by the employee to the company. In both cases, these components are deductions, not earnings. They do not classify salary expenses; instead, they represent either the settlement of an existing liability or the recovery of an existing receivable that is already recognized on the balance sheet. This is the specific scenario where allowing deduction of salary components to post against Payable or Receivable accounts is required. |
|
This pull request is being marked as inactive because of no recent activity. It will be closed in 3 days if no further activity occurs. |
|
@iamkhanraheel |
Hello @elshafei-developer |
|
Just to confirm, this PR does not add
For all other account types (e.g., Expense), the existing behavior remains unchanged, and no party information is added. This adjustment simply ensures compliance with ERPNext’s GL validation rules, where Receivable and Payable accounts require Additionally, by correctly setting the party information, the entries become properly traceable in the General Ledger report. This allows filtering and reviewing Receivable/Payable balances per Employee, consistent with how ERPNext handles party-based accounts across the Accounts module. |
|
This pull request is being marked as inactive because of no recent activity. It will be closed in 3 days if no further activity occurs. |
This PR addresses an issue that occurs when
process_payroll_accounting_entry_based_on_employeeis enabled and the salary component uses an Account with type Receivable or Payable.In ERPNext, accounts of type Receivable or Payable require both
partyandparty_typeto be set in the corresponding GL Entry. However, the current payroll accounting entry logic does not assignpartyandparty_typewhen such accounts are used.As a result, the Payroll Entry fails to submit, and the accounting entry cannot be posted due to missing mandatory party information.
This PR ensures that when payroll accounting entries are generated against Receivable or Payable accounts while
process_payroll_accounting_entry_based_on_employeeis enabled, the requiredpartyandparty_typevalues are properly set, allowing the Payroll Entry to be submitted and posted successfully.backport version-15-hotfix
backport version-16-hotfix
Summary by CodeRabbit
Enhancement
Bug Fixes
✏️ Tip: You can customize this high-level summary in your review settings.