fix: actualizada sql intrastat
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Vicent Llopis 2023-02-10 10:10:48 +01:00
parent 5b22096567
commit e61af5286b
1 changed files with 2 additions and 2 deletions

View File

@ -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)