From 3ce43909e27bb4b4ba9911aaa484d09d596c3d0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Mon, 13 May 2024 14:21:01 +0200 Subject: [PATCH] feat: Turn issues into calculated columns refs#7213 --- db/routines/vn/procedures/ticket_setProblemRequest.sql | 2 -- db/routines/vn/procedures/ticket_setProblemTaxDataChecked.sql | 4 ++-- .../vn/procedures/ticket_setProblemTooLittleItemCost.sql | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/db/routines/vn/procedures/ticket_setProblemRequest.sql b/db/routines/vn/procedures/ticket_setProblemRequest.sql index 13d918ab9..a5dc31472 100644 --- a/db/routines/vn/procedures/ticket_setProblemRequest.sql +++ b/db/routines/vn/procedures/ticket_setProblemRequest.sql @@ -8,7 +8,6 @@ BEGIN * * @param vSelf Id ticket, if NULL ALL tickets */ - CREATE OR REPLACE TEMPORARY TABLE tmp.ticket (INDEX(ticketFk)) ENGINE = MEMORY @@ -17,7 +16,6 @@ BEGIN WHERE t.shipped >= util.midnight() AND (vSelf IS NULL OR t.id = vSelf); - UPDATE tmp.ticket t JOIN ticketRequest tr ON tr.ticketFk = t.ticketFk SET t.hasProblem = TRUE diff --git a/db/routines/vn/procedures/ticket_setProblemTaxDataChecked.sql b/db/routines/vn/procedures/ticket_setProblemTaxDataChecked.sql index bf946a0ee..b6c2d8533 100644 --- a/db/routines/vn/procedures/ticket_setProblemTaxDataChecked.sql +++ b/db/routines/vn/procedures/ticket_setProblemTaxDataChecked.sql @@ -1,12 +1,12 @@ DELIMITER $$ CREATE OR REPLACE DEFINER=`root`@`localhost` - PROCEDURE `vn`.`ticket_setProblemTaxDataChecked`(vSelf INT) + PROCEDURE `vn`.`ticket_setProblemTaxDataChecked`(vClientFk INT) BEGIN /** * Update the problem of tickets, depending on whether * the client taxDataCheched is verified or not * - * @param vSelf Id ticket, if NULL all tickets + * @param vClientFk Id cliente, if NULL all clients */ CREATE OR REPLACE TEMPORARY TABLE tmp.ticket (INDEX(ticketFk)) diff --git a/db/routines/vn/procedures/ticket_setProblemTooLittleItemCost.sql b/db/routines/vn/procedures/ticket_setProblemTooLittleItemCost.sql index 178972d94..9a7852ac5 100644 --- a/db/routines/vn/procedures/ticket_setProblemTooLittleItemCost.sql +++ b/db/routines/vn/procedures/ticket_setProblemTooLittleItemCost.sql @@ -17,7 +17,7 @@ BEGIN FROM vn.ticket t JOIN vn.sale s ON s.ticketFk = t.id WHERE t.shipped >= util.midnight() - AND (s.itemFk = vItemFk OR vItemFk IS NULL) + AND (s.itemFk = vItemFk OR vItemFk IS NULL) GROUP BY t.id )SELECT ticketFk, ticket_isTooLittle(ticketFk) hasProblem FROM tickets;