Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bill editing error in dev environment #772

Open
nikgli opened this issue Jan 2, 2025 · 1 comment
Open

Bill editing error in dev environment #772

nikgli opened this issue Jan 2, 2025 · 1 comment

Comments

@nikgli
Copy link

nikgli commented Jan 2, 2025

Steps to reproduce

In a dev env, using the latest development branch:

  1. Create a warehouse
  2. Create some items
  3. Add a few manual journal entries
  4. Create an invoice (issue occurs both on draft and delivered invoices)
  5. Edit the invoice by changing the quantity of some of the items. Both "Save & Deliver" and "Save as Draft" result in the error message: "Something went wrong! Please try again."

Detailed logs from the webapp

{
    "data": {
        "message": "update `SALES_INVOICES` set `INVOICE_DATE` = '2025-01-02', `DUE_DATE` = '2025-01-02', `BALANCE` = NaN, `UPDATED_AT` = '2025/01/02 15:54:06' where `SALES_INVOICES`.`ID` = 9 - ER_BAD_FIELD_ERROR: Unknown column 'NaN' in 'field list'",
        "type": "UnknownDatabaseError",
        "data": {}
    },
    "status": 500,
    "statusText": "Internal Server Error",
    "headers": {
        "access-control-allow-headers": "*",
        "access-control-allow-methods": "*",
        "access-control-allow-origin": "*",
        "connection": "close",
        "content-length": "284",
        "content-type": "application/json; charset=utf-8",
        "date": "Thu, 02 Jan 2025 07:54:06 GMT",
        "etag": "W/\"11c-F2Nwqs62DqUjq9LsmUQLLvPeAn8\"",
        "strict-transport-security": "max-age=15552000; includeSubDomains",
        "vary": "Accept-Encoding",
        "x-content-type-options": "nosniff",
        "x-dns-prefetch-control": "off",
        "x-download-options": "noopen",
        "x-frame-options": "SAMEORIGIN",
        "x-powered-by": "Express",
        "x-xss-protection": "1; mode=block"
    },
    "config": {
        "transitional": {
            "silentJSONParsing": true,
            "forcedJSONParsing": true,
            "clarifyTimeoutError": false
        },
        "adapter": [
            "xhr",
            "http",
            "fetch"
        ],
        "transformRequest": [
            null
        ],
        "transformResponse": [
            null
        ],
        "timeout": 0,
        "xsrfCookieName": "XSRF-TOKEN",
        "xsrfHeaderName": "X-XSRF-TOKEN",
        "maxContentLength": -1,
        "maxBodyLength": -1,
        "env": {},
        "headers": {
            "Accept": "application/json, text/plain, */*",
            "Content-Type": "application/json",
            "X-Access-Token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiZXhwIjoxNzQwOTg0ODM5LjI0MSwiaWF0IjoxNzM1ODAwODM5fQ.blNLyIdWDf-NDJ8DKNJZ5Qmj7bgj_3lGDQSQjjY2I70",
            "organization-id": "18e5dr6awm5c3mspr",
            "Accept-Language": "en"
        },
        "method": "post",
        "url": "/api/sales/invoices/9",
        "data": "{\"attachments\":[],\"currency_code\":\"CNY\",\"customer_id\":2,\"discount_type\":\"amount\",\"due_date\":\"2025-01-01T16:00:00.000Z\",\"entries\":[{\"amount\":3000,\"index\":1,\"item_id\":1042,\"quantity\":1,\"rate\":3000,\"tax_amount\":0,\"tax_rate\":0},{\"amount\":702,\"index\":2,\"item_id\":1033,\"quantity\":2,\"rate\":351,\"tax_amount\":0,\"tax_rate\":0}],\"exchange_rate\":1,\"invoice_date\":\"2025-01-01T16:00:00.000Z\",\"invoice_message\":\"\",\"invoice_no\":\"INV-00009\",\"payment_methods\":[],\"pdf_template_id\":6,\"reference_no\":\"\",\"terms_conditions\":\"\",\"warehouse_id\":1,\"inclusive_exclusive_tax\":\"inclusive\",\"balance\":\"3702.00\",\"delivered\":false}"
    },
    "request": {
        "url": "/api/sales/invoices/9"
    }
}

Additional information

This issue doesn't occur when using docker-compose.prod.yml, suggesting that this might be either related to some recent changes in the development branch, or, something related to my local setup that I'm missing.

Copy link

linear bot commented Jan 2, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant