frappe / erpnext

Free and Open Source Enterprise Resource Planning (ERP)
https://erpnext.com
GNU General Public License v3.0
21.77k stars 7.31k forks source link

Not able to save journal entries with VAT-5%. #39700

Open fadilsiddique opened 9 months ago

fadilsiddique commented 9 months ago

Information about bug

When creating journal entries with VAT-5% getting below error.

@rtdany10 @deepeshgarg007

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 110, in application
    response = frappe.api.handle(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/api/__init__.py", line 49, in handle
    data = endpoint(**arguments)
           ^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/api/v1.py", line 36, in handle_rpc_call
    return frappe.handler.handle()
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/handler.py", line 49, in handle
    data = execute_cmd(cmd)
           ^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/handler.py", line 85, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/__init__.py", line 1684, in call
    return fn(*args, **newargs)
           ^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/utils/typing_validations.py", line 31, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py", line 1524, in get_account_balance_and_party_type
    "balance": get_balance_on(account, date, cost_center=cost_center),
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/utils/typing_validations.py", line 31, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "apps/erpnext/erpnext/accounts/utils.py", line 296, in get_balance_on
    bal = frappe.db.sql(
          ^^^^^^^^^^^^^^
  File "apps/frappe/frappe/database/database.py", line 235, in sql
    self._cursor.execute(query, values)
  File "env/lib/python3.11/site-packages/pymysql/cursors.py", line 151, in execute
    query = self.mogrify(query, args)
            ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "env/lib/python3.11/site-packages/pymysql/cursors.py", line 129, in mogrify
    query = query % self._escape_args(args, conn)
            ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TypeError: not enough arguments for format string

}

### Response Data

{ "exception": "TypeError: not enough arguments for format string", "exc_type": "TypeError", "_exc_source": "erpnext (app)" }



### Module

accounts

### Version

erpnext: 15.11.0,
frappe: 15.12.0,

### Installation method

FrappeCloud

### Relevant log output / Stack trace / Full Error Message.

_No response_
rtdany10 commented 9 months ago

Will have to implement https://github.com/frappe/erpnext/pull/39371 in that function as well. Can you send a PR?

rtdany10 commented 9 months ago

Same error pops up in CoA with balances enabled(if an account has % in it's name). cc @ruthra-kumar

fadilsiddique commented 9 months ago

Will have to implement #39371 in that function as well. Can you send a PR?

are you still getting the error? it's gone for now but I'm not seeing any changes in the code.