feat: refs #8381 add initial and final temperature fields to entry model and queries
gitea/salix/pipeline/pr-dev This commit looks good
Details
gitea/salix/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
e15fc01267
commit
c15a3bfe50
|
@ -0,0 +1,3 @@
|
||||||
|
ALTER TABLE `vn`.`entry`
|
||||||
|
ADD COLUMN `initialTemperature` decimal(10,2) DEFAULT NULL COMMENT 'Temperatura de como lo recibimos del proveedor ej. en colombia',
|
||||||
|
ADD COLUMN `finalTemperature` decimal(10,2) DEFAULT NULL COMMENT 'Temperatura final de como llega a nuestras instalaciones';
|
|
@ -119,6 +119,16 @@ module.exports = Self => {
|
||||||
arg: 'invoiceAmount',
|
arg: 'invoiceAmount',
|
||||||
type: 'number',
|
type: 'number',
|
||||||
description: `The invoice amount`
|
description: `The invoice amount`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
arg: 'initialTemperature',
|
||||||
|
type: 'number',
|
||||||
|
description: 'Initial temperature value'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
arg: 'finalTemperature',
|
||||||
|
type: 'number',
|
||||||
|
description: 'Final temperature value'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
returns: {
|
returns: {
|
||||||
|
@ -170,6 +180,10 @@ module.exports = Self => {
|
||||||
case 'invoiceInFk':
|
case 'invoiceInFk':
|
||||||
param = `e.${param}`;
|
param = `e.${param}`;
|
||||||
return {[param]: value};
|
return {[param]: value};
|
||||||
|
case 'initialTemperature':
|
||||||
|
return {'e.initialTemperature': {lte: value}};
|
||||||
|
case 'finalTemperature':
|
||||||
|
return {'e.finalTemperature': {gte: value}};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
filter = mergeFilters(ctx.args.filter, {where});
|
filter = mergeFilters(ctx.args.filter, {where});
|
||||||
|
@ -204,6 +218,8 @@ module.exports = Self => {
|
||||||
e.gestDocFk,
|
e.gestDocFk,
|
||||||
e.invoiceInFk,
|
e.invoiceInFk,
|
||||||
e.invoiceAmount,
|
e.invoiceAmount,
|
||||||
|
e.initialTemperature,
|
||||||
|
e.finalTemperature,
|
||||||
t.landed,
|
t.landed,
|
||||||
s.name supplierName,
|
s.name supplierName,
|
||||||
s.nickname supplierAlias,
|
s.nickname supplierAlias,
|
||||||
|
|
|
@ -68,6 +68,12 @@
|
||||||
},
|
},
|
||||||
"invoiceAmount": {
|
"invoiceAmount": {
|
||||||
"type": "number"
|
"type": "number"
|
||||||
|
},
|
||||||
|
"initialTemperature": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"finalTemperature": {
|
||||||
|
"type": "number"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"relations": {
|
"relations": {
|
||||||
|
|
|
@ -41,7 +41,9 @@ module.exports = Self => {
|
||||||
* b.stickers)/1000000) AS DECIMAL(10,2)) m3,
|
* b.stickers)/1000000) AS DECIMAL(10,2)) m3,
|
||||||
TRUNCATE(SUM(b.stickers)/(COUNT( b.id) / COUNT( DISTINCT b.id)),0) hb,
|
TRUNCATE(SUM(b.stickers)/(COUNT( b.id) / COUNT( DISTINCT b.id)),0) hb,
|
||||||
CAST(SUM(b.freightValue*b.quantity) AS DECIMAL(10,2)) freightValue,
|
CAST(SUM(b.freightValue*b.quantity) AS DECIMAL(10,2)) freightValue,
|
||||||
CAST(SUM(b.packageValue*b.quantity) AS DECIMAL(10,2)) packageValue
|
CAST(SUM(b.packageValue*b.quantity) AS DECIMAL(10,2)) packageValue,
|
||||||
|
e.initialTemperature,
|
||||||
|
e.finalTemperature
|
||||||
FROM vn.travel t
|
FROM vn.travel t
|
||||||
LEFT JOIN vn.entry e ON t.id = e.travelFk
|
LEFT JOIN vn.entry e ON t.id = e.travelFk
|
||||||
LEFT JOIN vn.buy b ON b.entryFk = e.id
|
LEFT JOIN vn.buy b ON b.entryFk = e.id
|
||||||
|
|
Loading…
Reference in New Issue