From 426249f9bfee12405155477da3ac0dc56b69683d Mon Sep 17 00:00:00 2001 From: bernat Date: Tue, 19 Jan 2021 12:50:11 +0100 Subject: [PATCH 01/11] 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 02/11] 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 03/11] 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 04/11] 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 a84555430f4a61a52bcf317586e86a9c7a3d501a Mon Sep 17 00:00:00 2001 From: joan Date: Thu, 1 Apr 2021 13:32:42 +0200 Subject: [PATCH 05/11] Updated readme extensions --- README.md | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2e14b5905..2aa2b9f21 100644 --- a/README.md +++ b/README.md @@ -66,15 +66,38 @@ For end-to-end tests run from project's root. $ gulp e2e ``` -## Recommended tools +## Required Visual Studio Code extensions -* Visual Studio Code +Open Visual Studio Code, press Ctrl+P and paste the following commands. -In Visual Studio Code we use the ESLint extension. Open Visual Studio Code, press Ctrl+P and paste the following command. +In Visual Studio Code we use the ESLint extension. ``` ext install dbaeumer.vscode-eslint ``` +Gitlens for visualization of code authorship +``` +ext install eamodio.gitlens +``` + +Spanish language pack +``` +ext install ms-ceintl.vscode-language-pack-es +``` + +## Recommended extensions + +Material icon Theme +``` +ext install pkief.material-icon-theme +``` + +Material UI Themes +``` +ext install equinusocio.vsc-material-theme +``` + + ## Built With * [angularjs](https://angularjs.org/) From 21de6a0f7ce14ee48a9f1b874861193ddcdf6136 Mon Sep 17 00:00:00 2001 From: joan Date: Thu, 1 Apr 2021 13:34:21 +0200 Subject: [PATCH 06/11] Updated readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2aa2b9f21..da51fe093 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ For end-to-end tests run from project's root. $ gulp e2e ``` -## Required Visual Studio Code extensions +## Visual Studio Code extensions Open Visual Studio Code, press Ctrl+P and paste the following commands. @@ -85,7 +85,7 @@ Spanish language pack ext install ms-ceintl.vscode-language-pack-es ``` -## Recommended extensions +### Recommended extensions Material icon Theme ``` From 389f10bda057530ddb626d744b734e5551e2a701 Mon Sep 17 00:00:00 2001 From: joan Date: Thu, 1 Apr 2021 13:51:55 +0200 Subject: [PATCH 07/11] 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 08/11] 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 09/11] 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"> + + Date: Thu, 1 Apr 2021 14:20:00 +0200 Subject: [PATCH 10/11] 2866 - Limit descriptor photo size to width 100% --- front/salix/components/descriptor-popover/style.scss | 2 +- front/salix/components/descriptor/style.scss | 2 +- modules/item/front/descriptor/index.js | 1 - modules/item/front/descriptor/style.scss | 9 --------- 4 files changed, 2 insertions(+), 12 deletions(-) delete mode 100644 modules/item/front/descriptor/style.scss diff --git a/front/salix/components/descriptor-popover/style.scss b/front/salix/components/descriptor-popover/style.scss index 3fc35a0af..6ae8675bf 100644 --- a/front/salix/components/descriptor-popover/style.scss +++ b/front/salix/components/descriptor-popover/style.scss @@ -2,7 +2,7 @@ .vn-descriptor-popover { vn-descriptor-content > .descriptor { - width: 260px; + width: 256px; & > .header > a:first-child { visibility: hidden; diff --git a/front/salix/components/descriptor/style.scss b/front/salix/components/descriptor/style.scss index f51137620..d15c60938 100644 --- a/front/salix/components/descriptor/style.scss +++ b/front/salix/components/descriptor/style.scss @@ -11,7 +11,7 @@ vn-descriptor-content { & > img[ng-src] { min-height: 16em; display: block; - width: 256px; + max-width: 100%; height: 256px; } diff --git a/modules/item/front/descriptor/index.js b/modules/item/front/descriptor/index.js index 195a97d13..bdf95fb61 100644 --- a/modules/item/front/descriptor/index.js +++ b/modules/item/front/descriptor/index.js @@ -1,6 +1,5 @@ import ngModule from '../module'; import Descriptor from 'salix/components/descriptor'; -import './style.scss'; class Controller extends Descriptor { constructor($element, $, $rootScope) { diff --git a/modules/item/front/descriptor/style.scss b/modules/item/front/descriptor/style.scss deleted file mode 100644 index e15fbae96..000000000 --- a/modules/item/front/descriptor/style.scss +++ /dev/null @@ -1,9 +0,0 @@ - -vn-item-descriptor { - img[ng-src] { - min-height: 16em; - height: 100%; - width: 100%; - display: block; - } -} \ No newline at end of file From 9bbf43c590ad12fded733d4f21ff6f4ecde83938 Mon Sep 17 00:00:00 2001 From: joan Date: Fri, 2 Apr 2021 14:34:16 +0200 Subject: [PATCH 11/11] Replace http with https --- modules/item/back/methods/item-image-queue/downloadImages.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/item/back/methods/item-image-queue/downloadImages.js b/modules/item/back/methods/item-image-queue/downloadImages.js index 2d2e8af91..05b223598 100644 --- a/modules/item/back/methods/item-image-queue/downloadImages.js +++ b/modules/item/back/methods/item-image-queue/downloadImages.js @@ -50,8 +50,9 @@ module.exports = Self => { const fileName = srcFile.replace(/\.|\/|:|\?|\\|=|%/g, ''); const file = `${fileName}.png`; const filePath = path.join(tempPath, file); + const imageUrl = image.url.replace('http://', 'https://'); - https.get(image.url, async response => { + https.get(imageUrl, async response => { if (response.statusCode != 200) { const error = new Error(`Could not download the image. Status code ${response.statusCode}`);