From e61af5286bccaf52479d6d3e7e50a0bfcd88a216 Mon Sep 17 00:00:00 2001 From: vicent Date: Fri, 10 Feb 2023 10:10:48 +0100 Subject: [PATCH] fix: actualizada sql intrastat --- print/templates/reports/invoice/sql/intrastat.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/print/templates/reports/invoice/sql/intrastat.sql b/print/templates/reports/invoice/sql/intrastat.sql index 49c97a758..211ebfe71 100644 --- a/print/templates/reports/invoice/sql/intrastat.sql +++ b/print/templates/reports/invoice/sql/intrastat.sql @@ -2,8 +2,8 @@ SELECT * FROM ( SELECT i.intrastatFk code, it.description, - SUM(CAST((s.quantity * s.price * (100 - s.discount) / 100 ) AS DECIMAL(10, 2))) subtotal, - SUM(CAST(IFNULL(i.stems, 1) * s.quantity AS DECIMAL(10, 2))) stems, + CAST(SUM(ROUND((s.quantity * s.price * (100 - s.discount) / 100 ) , 2))AS DECIMAL(10, 2)) subtotal, + SUM(IFNULL(i.stems, 1) * s.quantity) stems, CAST(SUM(IFNULL(i.stems, 1) * s.quantity * IF(ic.grams, ic.grams, IFNULL(i.weightByPiece, 0)) / 1000)