From b6e413018447b4d7ef61d9c712d245e09da4000f Mon Sep 17 00:00:00 2001 From: robert Date: Fri, 3 May 2024 07:51:04 +0200 Subject: [PATCH] feat: refs #7325 item_getBalance --- db/routines/vn/procedures/item_getBalance.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/routines/vn/procedures/item_getBalance.sql b/db/routines/vn/procedures/item_getBalance.sql index 11af7e570..88583cf00 100644 --- a/db/routines/vn/procedures/item_getBalance.sql +++ b/db/routines/vn/procedures/item_getBalance.sql @@ -179,7 +179,7 @@ BEGIN LEFT JOIN alertLevel a ON a.id = t.alertLevel; ELSE - SELECT SUM(`in`) - SUM(`out`) INTO @a + SELECT IFNULL(SUM(IFNULL(`in`, 0)) - SUM(IFNULL(`out`, 0)), 0) INTO @a FROM tItemDiary WHERE shipped < vDate;