fix: refs #6900 fine tunning
gitea/salix/pipeline/pr-master There was a failure building this commit Details

This commit is contained in:
Jorge Penadés 2024-09-02 08:43:53 +02:00
parent 88246174dc
commit cdaf8a7a67
2 changed files with 5 additions and 4 deletions

View File

@ -138,9 +138,9 @@ module.exports = Self => {
? {'ii.id': value}
: {'s.name': {like: `%${value}%`}};
case 'from':
return {'ii.created': {gte: value}};
return {'ii.issued': {gte: value}};
case 'to':
return {'ii.created': {lte: value}};
return {'ii.issued': {lte: value}};
case 'fi':
return {'s.nif': value};
case 'account':
@ -173,7 +173,6 @@ module.exports = Self => {
const stmt = new ParameterizedSQL(
`SELECT
ii.id,
ii.serialNumber,
ii.serial,
ii.issued,
ii.isBooked,

View File

@ -27,10 +27,12 @@ module.exports = Self => {
const [result] = await Self.rawSql(`
SELECT iit.*,
SUM(iidd.amount) totalDueDay
SUM(iidd.amount) totalDueDay,
SUM(iidd.foreignValue) totalDueDayForeignValue
FROM vn.invoiceIn ii
LEFT JOIN (
SELECT SUM(iit.taxableBase) totalTaxableBase,
SUM(iit.foreignValue) totalTaxableBaseForeignValue,
CAST(
SUM(IFNULL(iit.taxableBase * (1 + (ti.PorcentajeIva / 100)), iit.taxableBase))
AS DECIMAL(10, 2)