From 426249f9bfee12405155477da3ac0dc56b69683d Mon Sep 17 00:00:00 2001 From: bernat Date: Tue, 19 Jan 2021 12:50:11 +0100 Subject: [PATCH 1/7] entry index changes --- modules/entry/back/methods/entry/filter.js | 14 ++++++++--- modules/entry/front/index/index.html | 29 +++++++++++----------- modules/entry/front/index/index.js | 7 +++++- 3 files changed, 32 insertions(+), 18 deletions(-) diff --git a/modules/entry/back/methods/entry/filter.js b/modules/entry/back/methods/entry/filter.js index 42dbe3078..44d1f18e7 100644 --- a/modules/entry/back/methods/entry/filter.js +++ b/modules/entry/back/methods/entry/filter.js @@ -148,19 +148,27 @@ module.exports = Self => { s.name AS supplierName, s.nickname AS supplierAlias, co.code AS companyCode, - cu.code AS currencyCode + cu.code AS currencyCode, + IF(b.buyingValue, SUM(b.quantity * b.buyingValue), 0) AS totalEntry FROM vn.entry e JOIN vn.supplier s ON s.id = e.supplierFk JOIN vn.travel t ON t.id = e.travelFk JOIN vn.company co ON co.id = e.companyFk - JOIN vn.currency cu ON cu.id = e.currencyFk` + JOIN vn.currency cu ON cu.id = e.currencyFk + LEFT JOIN vn.buy b ON b.entryFk = e.id` ); + stmt.merge(conn.makeWhere(filter.where)); + stmt.merge(conn.makeGroupBy('b.entryFk')); + stmt.merge(conn.makeOrderBy('t.landed DESC')); + stmt.merge(conn.makeLimit(filter)); + // stmts.push(stmt); - stmt.merge(conn.makeSuffix(filter)); + // stmt.merge(conn.makeSuffix(filter)); let itemsIndex = stmts.push(stmt) - 1; let sql = ParameterizedSQL.join(stmts, ';'); let result = await conn.executeStmt(sql); + return itemsIndex === 0 ? result : result[itemsIndex]; }; }; diff --git a/modules/entry/front/index/index.html b/modules/entry/front/index/index.html index 2f3aa5636..8198db780 100644 --- a/modules/entry/front/index/index.html +++ b/modules/entry/front/index/index.html @@ -13,12 +13,11 @@ Landed Reference Supplier - Currency - Company + Import Booked Confirmed Ordered - Notes + @@ -49,19 +48,17 @@ {{::entry.ref}} {{::entry.supplierName}} - {{::entry.currencyCode}} - {{::entry.companyCode}} + {{::entry.totalEntry | currency: 'EUR': 2}} - - - - + + + + @@ -70,7 +67,11 @@ - + + + +
diff --git a/modules/entry/front/index/index.js b/modules/entry/front/index/index.js index 759ce2724..8635d3fb4 100644 --- a/modules/entry/front/index/index.js +++ b/modules/entry/front/index/index.js @@ -1,7 +1,12 @@ import ngModule from '../module'; import Section from 'salix/components/section'; -export default class Controller extends Section {} +export default class Controller extends Section { + preview(entry) { + this.entrySelected = entry; + this.$.summary.show(); + } +} ngModule.vnComponent('vnEntryIndex', { template: require('./index.html'), From e9f408d5baad167e8be5a5ae8c90904385322bbc Mon Sep 17 00:00:00 2001 From: bernat Date: Tue, 19 Jan 2021 13:44:14 +0100 Subject: [PATCH 2/7] delete comments --- modules/entry/back/methods/entry/filter.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/entry/back/methods/entry/filter.js b/modules/entry/back/methods/entry/filter.js index 44d1f18e7..5be4521b5 100644 --- a/modules/entry/back/methods/entry/filter.js +++ b/modules/entry/back/methods/entry/filter.js @@ -161,9 +161,7 @@ module.exports = Self => { stmt.merge(conn.makeGroupBy('b.entryFk')); stmt.merge(conn.makeOrderBy('t.landed DESC')); stmt.merge(conn.makeLimit(filter)); - // stmts.push(stmt); - // stmt.merge(conn.makeSuffix(filter)); let itemsIndex = stmts.push(stmt) - 1; let sql = ParameterizedSQL.join(stmts, ';'); From 0f17fca0a18b51497ada0ecc90d5b72f14a21f36 Mon Sep 17 00:00:00 2001 From: bernat Date: Wed, 20 Jan 2021 11:42:45 +0100 Subject: [PATCH 3/7] pr order by changes --- modules/entry/back/methods/entry/filter.js | 2 +- modules/entry/front/main/index.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/entry/back/methods/entry/filter.js b/modules/entry/back/methods/entry/filter.js index 5be4521b5..38e38dde9 100644 --- a/modules/entry/back/methods/entry/filter.js +++ b/modules/entry/back/methods/entry/filter.js @@ -159,7 +159,7 @@ module.exports = Self => { ); stmt.merge(conn.makeWhere(filter.where)); stmt.merge(conn.makeGroupBy('b.entryFk')); - stmt.merge(conn.makeOrderBy('t.landed DESC')); + stmt.merge(conn.makeOrderBy(filter.order)); stmt.merge(conn.makeLimit(filter)); let itemsIndex = stmts.push(stmt) - 1; diff --git a/modules/entry/front/main/index.html b/modules/entry/front/main/index.html index 6c08cd0c4..66869a1bb 100644 --- a/modules/entry/front/main/index.html +++ b/modules/entry/front/main/index.html @@ -2,6 +2,7 @@ vn-id="model" url="Entries/filter" limit="20" + order="landed DESC" auto-load="true"> From 678ee0644d7e787b055938640c1145ce8ae9dfdd Mon Sep 17 00:00:00 2001 From: bernat Date: Thu, 21 Jan 2021 09:45:18 +0100 Subject: [PATCH 4/7] delete order by in entry index --- modules/entry/back/methods/entry/filter.js | 1 - modules/entry/front/main/index.html | 1 - 2 files changed, 2 deletions(-) diff --git a/modules/entry/back/methods/entry/filter.js b/modules/entry/back/methods/entry/filter.js index 38e38dde9..82578c397 100644 --- a/modules/entry/back/methods/entry/filter.js +++ b/modules/entry/back/methods/entry/filter.js @@ -159,7 +159,6 @@ module.exports = Self => { ); stmt.merge(conn.makeWhere(filter.where)); stmt.merge(conn.makeGroupBy('b.entryFk')); - stmt.merge(conn.makeOrderBy(filter.order)); stmt.merge(conn.makeLimit(filter)); let itemsIndex = stmts.push(stmt) - 1; diff --git a/modules/entry/front/main/index.html b/modules/entry/front/main/index.html index 66869a1bb..6c08cd0c4 100644 --- a/modules/entry/front/main/index.html +++ b/modules/entry/front/main/index.html @@ -2,7 +2,6 @@ vn-id="model" url="Entries/filter" limit="20" - order="landed DESC" auto-load="true"> From 389f10bda057530ddb626d744b734e5551e2a701 Mon Sep 17 00:00:00 2001 From: joan Date: Thu, 1 Apr 2021 13:51:55 +0200 Subject: [PATCH 5/7] Removed entry import --- modules/entry/front/index/index.html | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/entry/front/index/index.html b/modules/entry/front/index/index.html index 8198db780..faa1145f4 100644 --- a/modules/entry/front/index/index.html +++ b/modules/entry/front/index/index.html @@ -13,7 +13,6 @@ Landed Reference Supplier - Import Booked Confirmed Ordered @@ -48,7 +47,6 @@ {{::entry.ref}} {{::entry.supplierName}} - {{::entry.totalEntry | currency: 'EUR': 2}} From 91c26ee5a5e78236b9cd8ba059518770197a8b83 Mon Sep 17 00:00:00 2001 From: joan Date: Thu, 1 Apr 2021 13:55:01 +0200 Subject: [PATCH 6/7] Removed filter import --- modules/entry/back/methods/entry/filter.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/modules/entry/back/methods/entry/filter.js b/modules/entry/back/methods/entry/filter.js index 82578c397..42dbe3078 100644 --- a/modules/entry/back/methods/entry/filter.js +++ b/modules/entry/back/methods/entry/filter.js @@ -148,24 +148,19 @@ module.exports = Self => { s.name AS supplierName, s.nickname AS supplierAlias, co.code AS companyCode, - cu.code AS currencyCode, - IF(b.buyingValue, SUM(b.quantity * b.buyingValue), 0) AS totalEntry + cu.code AS currencyCode FROM vn.entry e JOIN vn.supplier s ON s.id = e.supplierFk JOIN vn.travel t ON t.id = e.travelFk JOIN vn.company co ON co.id = e.companyFk - JOIN vn.currency cu ON cu.id = e.currencyFk - LEFT JOIN vn.buy b ON b.entryFk = e.id` + JOIN vn.currency cu ON cu.id = e.currencyFk` ); - stmt.merge(conn.makeWhere(filter.where)); - stmt.merge(conn.makeGroupBy('b.entryFk')); - stmt.merge(conn.makeLimit(filter)); + stmt.merge(conn.makeSuffix(filter)); let itemsIndex = stmts.push(stmt) - 1; let sql = ParameterizedSQL.join(stmts, ';'); let result = await conn.executeStmt(sql); - return itemsIndex === 0 ? result : result[itemsIndex]; }; }; From fa0b01a0d54cc5fa773e415c722ce25a7ec02e70 Mon Sep 17 00:00:00 2001 From: joan Date: Thu, 1 Apr 2021 14:00:34 +0200 Subject: [PATCH 7/7] Fixed buttons alignment --- modules/entry/front/index/index.html | 4 ++-- modules/invoiceIn/front/index/index.html | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/entry/front/index/index.html b/modules/entry/front/index/index.html index faa1145f4..b48f99aab 100644 --- a/modules/entry/front/index/index.html +++ b/modules/entry/front/index/index.html @@ -50,13 +50,13 @@ - + - + diff --git a/modules/invoiceIn/front/index/index.html b/modules/invoiceIn/front/index/index.html index c554dfd5f..d3d1f820e 100644 --- a/modules/invoiceIn/front/index/index.html +++ b/modules/invoiceIn/front/index/index.html @@ -50,6 +50,8 @@ vn-tooltip="Preview" icon="preview"> + +