From b3724d49d5caa12a08be7fbf0c9b098bcdbfdc4c Mon Sep 17 00:00:00 2001 From: "bai.zixv" Date: Thu, 25 Apr 2024 20:51:27 +0800 Subject: [PATCH] fix: sql, view_invoices_tax, convert the month of result to utc (#859) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 将视图的返回结果日期, 统一为utc时间, 消除日期歧义. 2. 明确指出视图返回字段. 3. 视图结果,按照业务习惯,先按照最新日期排列 Note: 更新后,需要刷新线上数据库视图, 当然对目前线上无影响, 只是消除日期隐患. Reviewed-on: https://git.daoyoucloud.com/daoyoucloud/tachybase/pulls/859 Reviewed-by: sealday Co-authored-by: bai.zixv Co-committed-by: bai.zixv --- .../src/server/sqls/view_invoices_tax.sql | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/plugins/@hera/plugin-rental/src/server/sqls/view_invoices_tax.sql b/packages/plugins/@hera/plugin-rental/src/server/sqls/view_invoices_tax.sql index 91a53aae0..a20bbf1db 100644 --- a/packages/plugins/@hera/plugin-rental/src/server/sqls/view_invoices_tax.sql +++ b/packages/plugins/@hera/plugin-rental/src/server/sqls/view_invoices_tax.sql @@ -195,9 +195,16 @@ WITH RECURSIVE -- 主查询 -- 根据计算后的表,获取最终的视图 SELECT - * + row_num, + company_id, + "MONTH" AT TIME ZONE 'UTC' AS "MONTH", + input_tax_amount, + out_tax_amount, + monthly_tax_amount, + super_tax_amount, + monthly_total_tax_amount FROM G_INTIAL_TAX ORDER BY - company_id, - "MONTH" + "MONTH" DESC, + company_id