frappe / erpnext

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

Process Deferred Accounting pymysql.err.ProgrammingError #43998

Closed albertfns closed 3 weeks ago

albertfns commented 3 weeks ago

Information about bug

pymysql.err.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '1203-01-02-01 - LICENCIAS Y SOFTWARE - PTK''' at line 6") Possible source of error: erpnext (app)

image

Module

assets

Version

Installation method

docker

Relevant log output / Stack trace / Full Error Message.

Syntax error in query:
select distinct item.parent
        from `tabPurchase Invoice Item` item, `tabPurchase Invoice` p
        where item.service_start_date<=%s and item.service_end_date>=%s
        and item.enable_deferred_expense = 1 and item.parent=p.name
        and item.docstatus = 1 and coalesce(item.amount, 0) > 0
        AND item.deferred_expense_account=''1203-01-02-01 - LICENCIAS Y SOFTWARE - PTK'' ('2024-10-30', '2024-09-30')

{
    "doc": "{\"name\":\"ACC-PDA-00051\",\"owner\":\"mcastillo@protelca.com\",\"creation\":\"2024-11-06 08:03:32.072493\",\"modified\":\"2024-11-06 08:16:11.207052\",\"modified_by\":\"Administrator\",\"docstatus\":0,\"idx\":0,\"company\":\"PROTELCA\",\"type\":\"Expense\",\"account\":\"1203-01-02-01 - LICENCIAS Y SOFTWARE - PTK\",\"posting_date\":\"2024-10-30\",\"start_date\":\"2024-09-30\",\"end_date\":\"2024-10-30\",\"doctype\":\"Process Deferred Accounting\",\"__last_sync_on\":\"2024-11-06T14:32:04.920Z\"}",
    "action": "Submit"
}

pymysql.err.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '1203-01-02-01 - LICENCIAS Y SOFTWARE - PTK''' at line 6")
Nihantra-Patel commented 3 weeks ago

Issue has been fixed: https://github.com/frappe/erpnext/pull/43985