tickets deleted excluded #2601

Merged
pako merged 4 commits from 7420-supplierPackaging_ReportSource into dev 2024-06-19 05:17:59 +00:00
5 changed files with 60 additions and 4 deletions
Showing only changes of commit 66ed958c72 - Show all commits

View File

@ -21,6 +21,9 @@ BEGIN
CALL cache.available_refresh(vCalcFk, FALSE, vWarehouseFk, vDated); CALL cache.available_refresh(vCalcFk, FALSE, vWarehouseFk, vDated);
-- Añadido temporalmente para que no se cuelgue la db
SET vShowType = TRUE;
WITH itemTags AS ( WITH itemTags AS (
SELECT i.id, SELECT i.id,
typeFk, typeFk,
@ -35,7 +38,7 @@ BEGIN
t.name, t.name,
it.value it.value
FROM vn.item i FROM vn.item i
LEFT JOIN vn.itemTag it FORCE INDEX(itemTagItemPriority) ON it.itemFk = i.id LEFT JOIN vn.itemTag it ON it.itemFk = i.id
AND it.priority = vPriority AND it.priority = vPriority
LEFT JOIN vn.tag t ON t.id = it.tagFk LEFT JOIN vn.tag t ON t.id = it.tagFk
WHERE i.id = vSelf WHERE i.id = vSelf
@ -65,7 +68,7 @@ BEGIN
iss.visible located, iss.visible located,
b.price2 b.price2
FROM vn.item i FROM vn.item i
JOIN cache.available a FORCE INDEX (calc_id_4) ON a.item_id = i.id JOIN cache.available a ON a.item_id = i.id
AND a.calc_id = vCalcFk AND a.calc_id = vCalcFk
LEFT JOIN vn.itemProposal ip ON ip.mateFk = i.id LEFT JOIN vn.itemProposal ip ON ip.mateFk = i.id
AND ip.itemFk = vSelf AND ip.itemFk = vSelf

View File

@ -0,0 +1,17 @@
CREATE TABLE IF NOT EXISTS travelKgPercentage (
value INT(3) PRIMARY KEY,
className VARCHAR(50)
);
INSERT INTO travelKgPercentage (value, className)
VALUES
(80, 'primary'),
(100, 'alert');
INSERT INTO salix.ACL
SET model = 'TravelKgPercentage',
property = '*',
accessType = 'READ',
permission = 'ALLOW',
principalType = 'ROLE',
principalId = 'employee';

View File

@ -138,7 +138,19 @@ module.exports = Self => {
b.stickers * b.stickers *
IF(pkg.volume, pkg.volume, pkg.width * pkg.depth * pkg.height) / 1000000 IF(pkg.volume, pkg.volume, pkg.width * pkg.depth * pkg.height) / 1000000
) as DECIMAL(10,0) ) as DECIMAL(10,0)
) as volumeKg ) as volumeKg,
GREATEST(
CAST(SUM(b.weight * b.stickers) AS INT),
CAST(
SUM(vc.aerealVolumetricDensity *
b.stickers *
IF(pkg.volume,
pkg.volume,
pkg.width * pkg.depth * pkg.height
) / 1000000
) AS INT
)
/ t.kg * 100, 0) percentageKg
FROM travel t FROM travel t
LEFT JOIN supplier s ON s.id = t.cargoSupplierFk LEFT JOIN supplier s ON s.id = t.cargoSupplierFk
LEFT JOIN entry e ON e.travelFk = t.id LEFT JOIN entry e ON e.travelFk = t.id

View File

@ -11,6 +11,9 @@
"Thermograph": { "Thermograph": {
"dataSource": "vn" "dataSource": "vn"
}, },
"TravelKgPercentage": {
"dataSource": "vn"
},
"TravelThermograph": { "TravelThermograph": {
"dataSource": "vn" "dataSource": "vn"
}, },

View File

@ -0,0 +1,21 @@
{
"name": "TravelKgPercentage",
"base": "VnModel",
"mixins": {
"Loggable": true
},
"options": {
"mysql": {
"table": "travelKgPercentage"
}
},
"properties": {
"value": {
"type": "number",
"id": true
},
"className": {
"type": "string"
}
}
}