frappe / hrms

Open Source HR and Payroll Software
https://frappe.io/hr
GNU General Public License v3.0
1.39k stars 729 forks source link

Error when try to Make Bank Entry #331

Closed pooory closed 1 year ago

pooory commented 1 year ago

Information about bug

In new Version of ERPNext (V.14.16.1) installed on Frappe cloud, in Payroll Entry section after submitting the Salary Slip and button of Make Bank Entry will appear, when pushing the button below error will pop up : Server Error KeyError: 'deduction' while previously in the other Version there was not any issues with this error

Module

other

Version

ERPNext: v14.16.1 (HEAD)

Frappe Framework: v14.25.4 (HEAD)

Installation method

FrappeCloud

Relevant log output / Stack trace / Full Error Message.

No Log
ruchamahabal commented 1 year ago

It was fixed here https://github.com/frappe/hrms/pull/292

Are you still facing this issue? If yes, please open your browser console and share the traceback with us

pooory commented 1 year ago

Salary Slip will be submitted properly and Journal Entry also created after the latest update.but now error pops up when try to make Bank Entry. as picture attached above.

App Versions

{
    "chat": "0.0.1",
    "erpnext": "14.16.1",
    "frappe": "14.25.4",
    "hrms": "14.0.2",
    "payments": "0.0.1"
}

Route

Form/Payroll Entry/HR-PRUN-2023-00023

Trackeback

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 69, in application
    response = frappe.api.handle()
  File "apps/frappe/frappe/api.py", line 54, in handle
    return frappe.handler.handle()
  File "apps/frappe/frappe/handler.py", line 45, in handle
    data = execute_cmd(cmd)
  File "apps/frappe/frappe/handler.py", line 83, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "apps/frappe/frappe/__init__.py", line 1607, in call
    return fn(*args, **newargs)
  File "apps/frappe/frappe/handler.py", line 304, in run_doc_method
    response = doc.run_method(method)
  File "apps/frappe/frappe/model/document.py", line 909, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1259, in composer
    return composed(self, method, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1241, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "apps/frappe/frappe/model/document.py", line 906, in fn
    return method_object(*args, **kwargs)
  File "apps/hrms/hrms/payroll/doctype/payroll_entry/payroll_entry.py", line 664, in make_payment_entry
    self.create_journal_entry(salary_slip_total, "salary")
  File "apps/hrms/hrms/payroll/doctype/payroll_entry/payroll_entry.py", line 693, in create_journal_entry
    je_payment_amount = employee_details["earnings"] - employee_details["deduction"]
KeyError: 'deduction'

Request Data

{
    "type": "POST",
    "args": {
        "docs": "{\"name\":\"HR-PRUN-2023-00024\",\"owner\":\"----------@gmail.com\",\"creation\":\"2023-02-21 11:52:06.036569\",\"modified\":\"2023-02-21 11:52:39.091503\",\"modified_by\":\"--------------------@gmail.com\",\"docstatus\":1,\"idx\":0,\"posting_date\":\"2023-02-21\",\"payroll_frequency\":\"Monthly\",\"company\":\"-------------\",\"currency\":\"USD\",\"exchange_rate\":1,\"payroll_payable_account\":\"Payroll Payable - BFO\",\"status\":\"Submitted\",\"start_date\":\"2023-01-01\",\"end_date\":\"2023-01-31\",\"salary_slip_based_on_timesheet\":0,\"deduct_tax_for_unclaimed_employee_benefits\":0,\"deduct_tax_for_unsubmitted_tax_exemption_proof\":0,\"number_of_employees\":1,\"validate_attendance\":0,\"cost_center\":\"Main - BFO\",\"salary_slips_created\":1,\"salary_slips_submitted\":1,\"error_message\":\"\",\"doctype\":\"Payroll Entry\",\"employees\":[{\"name\":\"66b07fa318\",\"owner\":\"----------@gmail.com\",\"creation\":\"2023-02-21 11:52:06.036569\",\"modified\":\"2023-02-21 11:52:34.617917\",\"modified_by\":\"----------------@gmail.com\",\"docstatus\":1,\"idx\":1,\"employee\":\"HR-EMP-00004\",\"employee_name\":\"N-------  B----i\",\"department\":\"Accounts - BFO\",\"designation\":\"Accountant\",\"parent\":\"HR-PRUN-2023-00024\",\"parentfield\":\"employees\",\"parenttype\":\"Payroll Entry\",\"doctype\":\"Payroll Employee Detail\"}],\"payment_account\":\"Cash - BFO\",\"__unsaved\":1}",
        "method": "make_payment_entry"
    },
    "freeze": true,
    "freeze_message": "Creating Payment Entries......",
    "headers": {},
    "error_handlers": {},
    "url": "/api/method/run_doc_method"
}

Response Data

{
    "exception": "KeyError: 'deduction'"
}