diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js
index 0ad9ad7f4..237fdad0c 100644
--- a/e2e/helpers/selectors.js
+++ b/e2e/helpers/selectors.js
@@ -391,7 +391,7 @@ export default {
intrastadCheckbox: '.vn-popover.shown vn-horizontal:nth-child(3) > vn-check[label="Intrastat"]',
originCheckbox: '.vn-popover.shown vn-horizontal:nth-child(3) > vn-check[label="Origin"]',
buyerCheckbox: '.vn-popover.shown vn-horizontal:nth-child(3) > vn-check[label="Buyer"]',
- densityCheckbox: '.vn-popover.shown vn-horizontal:nth-child(3) > vn-check[label="Density"]',
+ weightByPieceCheckbox: '.vn-popover.shown vn-horizontal:nth-child(3) > vn-check[label="Weight/Piece"]',
saveFieldsButton: '.vn-popover.shown vn-button[label="Save"] > button'
},
itemFixedPrice: {
diff --git a/e2e/paths/04-item/09_index.spec.js b/e2e/paths/04-item/09_index.spec.js
index f9262863d..6e0a4bd5c 100644
--- a/e2e/paths/04-item/09_index.spec.js
+++ b/e2e/paths/04-item/09_index.spec.js
@@ -31,7 +31,7 @@ describe('Item index path', () => {
await page.waitToClick(selectors.itemsIndex.intrastadCheckbox);
await page.waitToClick(selectors.itemsIndex.originCheckbox);
await page.waitToClick(selectors.itemsIndex.buyerCheckbox);
- await page.waitToClick(selectors.itemsIndex.densityCheckbox);
+ await page.waitToClick(selectors.itemsIndex.weightByPieceCheckbox);
await page.waitToClick(selectors.itemsIndex.saveFieldsButton);
const message = await page.waitForSnackbar();
@@ -64,7 +64,7 @@ describe('Item index path', () => {
await page.waitToClick(selectors.itemsIndex.intrastadCheckbox);
await page.waitToClick(selectors.itemsIndex.originCheckbox);
await page.waitToClick(selectors.itemsIndex.buyerCheckbox);
- await page.waitToClick(selectors.itemsIndex.densityCheckbox);
+ await page.waitToClick(selectors.itemsIndex.weightByPieceCheckbox);
await page.waitToClick(selectors.itemsIndex.saveFieldsButton);
const message = await page.waitForSnackbar();
diff --git a/modules/entry/back/methods/entry/editLatestBuys.js b/modules/entry/back/methods/entry/editLatestBuys.js
index 72bee98ae..2642d4f4d 100644
--- a/modules/entry/back/methods/entry/editLatestBuys.js
+++ b/modules/entry/back/methods/entry/editLatestBuys.js
@@ -52,7 +52,7 @@ module.exports = Self => {
switch (field) {
case 'size':
- case 'density':
+ case 'weightByPiece':
case 'description':
case 'packingOut':
modelName = 'Item';
diff --git a/modules/entry/back/methods/entry/latestBuysFilter.js b/modules/entry/back/methods/entry/latestBuysFilter.js
index 00f72ea14..b920f4b58 100644
--- a/modules/entry/back/methods/entry/latestBuysFilter.js
+++ b/modules/entry/back/methods/entry/latestBuysFilter.js
@@ -157,7 +157,7 @@ module.exports = Self => {
i.image,
i.id AS itemFk,
i.size,
- i.density,
+ i.weightByPiece,
it.code,
i.typeFk,
i.family,
diff --git a/modules/entry/front/latest-buys/index.html b/modules/entry/front/latest-buys/index.html
index 768c8c7ee..fc44ddfc2 100644
--- a/modules/entry/front/latest-buys/index.html
+++ b/modules/entry/front/latest-buys/index.html
@@ -68,8 +68,8 @@
Origin
|
-
- Density
+ |
+ Weight/Piece
|
Active
@@ -183,7 +183,7 @@
{{::buy.intrastat}}
| {{::buy.origin}} |
- {{::buy.density}} |
+ {{::buy.weightByPiece}} |
{
i.subName,
i.isActive,
i.stems,
- i.density,
+ i.weightByPiece,
i.stemMultiplier,
i.typeFk,
i.isFloramondo,
diff --git a/modules/item/back/models/item.json b/modules/item/back/models/item.json
index 01b6ba093..704c97434 100644
--- a/modules/item/back/models/item.json
+++ b/modules/item/back/models/item.json
@@ -53,9 +53,9 @@
"type": "number",
"description": "Relevancy"
},
- "density": {
+ "weightByPiece": {
"type": "number",
- "description": "Density"
+ "description": "WeightByPiece"
},
"stemMultiplier": {
"type": "number",
diff --git a/modules/item/front/basic-data/index.html b/modules/item/front/basic-data/index.html
index 22fd33a07..8d1afe4e1 100644
--- a/modules/item/front/basic-data/index.html
+++ b/modules/item/front/basic-data/index.html
@@ -124,9 +124,8 @@
Buyer
-
- Density
+ |
+ Weight/Piece
|
Multiplier
@@ -117,7 +117,7 @@
{{::item.userName}}
| |
- {{::item.density}} |
+ {{::item.weightByPiece}} |
{{::item.stemMultiplier}} |
-
+
diff --git a/modules/travel/back/methods/travel/extraCommunityFilter.js b/modules/travel/back/methods/travel/extraCommunityFilter.js
index feb16d052..34e0ff7fa 100644
--- a/modules/travel/back/methods/travel/extraCommunityFilter.js
+++ b/modules/travel/back/methods/travel/extraCommunityFilter.js
@@ -130,8 +130,8 @@ module.exports = Self => {
SUM(b.stickers) AS stickers,
s.id AS cargoSupplierFk,
s.nickname AS cargoSupplierNickname,
- CAST(SUM(i.density * b.stickers * IF(pkg.volume, pkg.volume, pkg.width * pkg.depth * pkg.height) / 1000000 ) as DECIMAL(10,0)) as loadedKg,
- CAST(SUM(167.5 * b.stickers * IF(pkg.volume, pkg.volume, pkg.width * pkg.depth * pkg.height) / 1000000 ) as DECIMAL(10,0)) as volumeKg
+ CAST(SUM(b.weight * b.stickers) as DECIMAL(10,0)) as loadedKg,
+ CAST(SUM(vc.aerealVolumetricDensity * b.stickers * IF(pkg.volume, pkg.volume, pkg.width * pkg.depth * pkg.height) / 1000000) as DECIMAL(10,0)) as volumeKg
FROM travel t
LEFT JOIN supplier s ON s.id = t.cargoSupplierFk
LEFT JOIN entry e ON e.travelFk = t.id
@@ -143,7 +143,8 @@ module.exports = Self => {
JOIN warehouse wo ON wo.id = t.warehouseOutFk
JOIN country c ON c.id = wo.countryFk
LEFT JOIN continent cnt ON cnt.id = c.continentFk
- JOIN agencyMode am ON am.id = t.agencyModeFk`
+ JOIN agencyMode am ON am.id = t.agencyModeFk
+ JOIN vn.volumeConfig vc`
);
stmt.merge(conn.makeWhere(filter.where));
@@ -165,15 +166,16 @@ module.exports = Self => {
SUM(b.stickers) AS stickers,
e.evaNotes,
e.notes,
- CAST(SUM(i.density * b.stickers * IF(pkg.volume, pkg.volume, pkg.width * pkg.depth * pkg.height) / 1000000 ) as DECIMAL(10,0)) as loadedkg,
- CAST(SUM(167.5 * b.stickers * IF(pkg.volume, pkg.volume, pkg.width * pkg.depth * pkg.height) / 1000000 ) as DECIMAL(10,0)) as volumeKg
- FROM tmp.travel tr
+ CAST(SUM(b.weight * b.stickers) AS DECIMAL(10,0)) as loadedkg,
+ CAST(SUM(vc.aerealVolumetricDensity * b.stickers * IF(pkg.volume, pkg.volume, pkg.width * pkg.depth * pkg.height) / 1000000) AS DECIMAL(10,0)) as volumeKg
+ FROM tmp.travel tr
JOIN entry e ON e.travelFk = tr.id
JOIN buy b ON b.entryFk = e.id
JOIN packaging pkg ON pkg.id = b.packageFk
JOIN item i ON i.id = b.itemFk
JOIN itemType it ON it.id = i.typeFk
- JOIN supplier s ON s.id = e.supplierFk`
+ JOIN supplier s ON s.id = e.supplierFk
+ JOIN vn.volumeConfig vc`
);
stmt.merge(conn.makeGroupBy('e.id'));
diff --git a/print/templates/reports/extra-community/sql/entries.sql b/print/templates/reports/extra-community/sql/entries.sql
index ad2529a1c..a90bf8b0b 100644
--- a/print/templates/reports/extra-community/sql/entries.sql
+++ b/print/templates/reports/extra-community/sql/entries.sql
@@ -1,17 +1,18 @@
SELECT
- e.id,
- e.travelFk,
- e.ref,
- s.name AS supplierName,
- SUM(b.stickers) AS stickers,
- CAST(SUM(i.density * b.stickers * IF(pkg.volume, pkg.volume, pkg.width * pkg.depth * pkg.height) / 1000000 ) as DECIMAL(10,0)) as loadedKg,
- CAST(SUM(167.5 * b.stickers * IF(pkg.volume, pkg.volume, pkg.width * pkg.depth * pkg.height) / 1000000 ) as DECIMAL(10,0)) as volumeKg
-FROM travel t
- JOIN entry e ON e.travelFk = t.id
- JOIN buy b ON b.entryFk = e.id
- JOIN packaging pkg ON pkg.id = b.packageFk
- JOIN item i ON i.id = b.itemFk
- JOIN itemType it ON it.id = i.typeFk
- JOIN supplier s ON s.id = e.supplierFk
- WHERE t.id IN(?)
-GROUP BY e.id
\ No newline at end of file
+ e.id,
+ e.travelFk,
+ e.ref,
+ s.name AS supplierName,
+ SUM(b.stickers) AS stickers,
+ CAST(SUM(b.weight * b.stickers) as DECIMAL(10,0)) as loadedKg,
+ CAST(SUM(vc.aerealVolumetricDensity * b.stickers * IF(pkg.volume, pkg.volume, pkg.width * pkg.depth * pkg.height) / 1000000) as DECIMAL(10,0)) as volumeKg
+ FROM travel t
+ JOIN entry e ON e.travelFk = t.id
+ JOIN buy b ON b.entryFk = e.id
+ JOIN packaging pkg ON pkg.id = b.packageFk
+ JOIN item i ON i.id = b.itemFk
+ JOIN itemType it ON it.id = i.typeFk
+ JOIN supplier s ON s.id = e.supplierFk
+ JOIN vn.volumeConfig vc
+ WHERE t.id IN(?)
+ GROUP BY e.id
\ No newline at end of file
diff --git a/print/templates/reports/extra-community/sql/travels.sql b/print/templates/reports/extra-community/sql/travels.sql
index f8a4e0142..b0987c330 100644
--- a/print/templates/reports/extra-community/sql/travels.sql
+++ b/print/templates/reports/extra-community/sql/travels.sql
@@ -6,9 +6,10 @@ SELECT
t.kg,
am.id AS agencyModeFk,
SUM(b.stickers) AS stickers,
- CAST(SUM(i.density * b.stickers * IF(pkg.volume, pkg.volume, pkg.width * pkg.depth * pkg.height) / 1000000 ) as DECIMAL(10,0)) as loadedKg,
- CAST(SUM(167.5 * b.stickers * IF(pkg.volume, pkg.volume, pkg.width * pkg.depth * pkg.height) / 1000000 ) as DECIMAL(10,0)) as volumeKg
+ CAST(SUM(b.weight * b.stickers) as DECIMAL(10,0)) as loadedKg,
+ CAST(SUM(vc.aerealVolumetricDensity * b.stickers * IF(pkg.volume, pkg.volume, pkg.width * pkg.depth * pkg.height) / 1000000) as DECIMAL(10,0)) as volumeKg
FROM travel t
+ JOIN volumeConfig vc
LEFT JOIN supplier s ON s.id = t.cargoSupplierFk
LEFT JOIN entry e ON e.travelFk = t.id
LEFT JOIN buy b ON b.entryFk = e.id
|