From 20ba05a65588001c73b16a58f71844452c21d6a0 Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Wed, 10 Apr 2019 09:32:29 +0200 Subject: [PATCH 01/10] item filter by id or barcode --- db/dump/fixtures.sql | 8 +++--- modules/agency/front/basic-data/index.html | 4 +-- modules/item/back/methods/item/filter.js | 28 ++++--------------- .../back/methods/item/specs/filter.spec.js | 16 +++++++++++ 4 files changed, 27 insertions(+), 29 deletions(-) diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index a96820c05..1022eff83 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -771,10 +771,10 @@ INSERT INTO `vn`.`saleTracking`(`saleFk`, `isChecked`, `created`, `originalQuant INSERT INTO `vn`.`itemBarcode`(`id`, `itemFk`, `code`) VALUES - (1, 1 ,1 ), - (2, 1 ,2 ), - (3, 1 ,3 ), - (4, 2 ,4 ); + (1, 1, 1111111111), + (2, 1, 2222222222), + (3, 1, 3333333333), + (4, 2, 4444444444); INSERT INTO `vn`.`itemPlacement`(`id`, `itemFk`, `warehouseFk`, `code`) VALUES diff --git a/modules/agency/front/basic-data/index.html b/modules/agency/front/basic-data/index.html index 1dfeaa1c6..b6f615cef 100644 --- a/modules/agency/front/basic-data/index.html +++ b/modules/agency/front/basic-data/index.html @@ -49,13 +49,13 @@ diff --git a/modules/item/back/methods/item/filter.js b/modules/item/back/methods/item/filter.js index e0673a9fd..0da463ad4 100644 --- a/modules/item/back/methods/item/filter.js +++ b/modules/item/back/methods/item/filter.js @@ -72,7 +72,7 @@ module.exports = Self => { switch (param) { case 'search': return /^\d+$/.test(value) - ? {'i.id': {inq: value}} + ? {or: [{'i.id': value}, {'ib.code': value}]} : {'i.name': {like: `%${value}%`}}; case 'id': return {'i.id': value}; @@ -89,9 +89,6 @@ module.exports = Self => { } }); - /* case 'hasVisible': - return value ? {'v.visible': {gt: 0}} : {'v.visible': {or: [{lte: 0}, {neq: null}]}}; */ - filter = mergeFilters(ctx.args.filter, {where}); let stmts = []; let stmt; @@ -117,22 +114,10 @@ module.exports = Self => { LEFT JOIN origin ori ON ori.id = i.originFk LEFT JOIN cache.last_buy lb ON lb.item_id = i.id AND lb.warehouse_id = t.warehouseFk LEFT JOIN vn.buy b ON b.id = lb.buy_id - LEFT JOIN itemPlacement itn ON itn.itemFk = i.id AND itn.warehouseFk = t.warehouseFk` + LEFT JOIN itemPlacement itn ON itn.itemFk = i.id AND itn.warehouseFk = t.warehouseFk + LEFT JOIN itemBarcode ib ON ib.itemFk = i.id` ); - /* if (ctx.args.hasVisible !== undefined) { - stmts.push('CALL cache.visible_refresh(@visibleCalc, false, 1)'); - stmts.push('CALL cache.visible_refresh(@visibleCalc, false, 44)'); - let joinAvailable = new ParameterizedSQL( - `LEFT JOIN cache.visible v - ON v.item_id = i.id` - ); - stmt.merge(joinAvailable); - } */ - /* where v.visible > 0 -where v.visible <= 0 OR v.visible IS NULL -*/ - if (ctx.args.tags) { let i = 1; for (const tag of ctx.args.tags) { @@ -156,13 +141,10 @@ where v.visible <= 0 OR v.visible IS NULL } stmt.merge(conn.makeWhere(filter.where)); - - /* if (ctx.args.hasVisible !== undefined) - stmt.merge(`GROUP BY i.id`); - */ + stmt.merge(`GROUP BY i.id`); stmt.merge(conn.makePagination(filter)); - let itemsIndex = stmts.push(stmt) - 1; + 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/item/back/methods/item/specs/filter.spec.js b/modules/item/back/methods/item/specs/filter.spec.js index ecaa7aabe..7efb50033 100644 --- a/modules/item/back/methods/item/specs/filter.spec.js +++ b/modules/item/back/methods/item/specs/filter.spec.js @@ -1,6 +1,22 @@ const app = require('vn-loopback/server/server'); describe('item filter()', () => { + it('should return 1 result filtering by id', async() => { + let filter = {}; + let result = await app.models.Item.filter({args: {filter: filter, search: 1}}); + + expect(result.length).toEqual(1); + expect(result[0].id).toEqual(1); + }); + + it('should return 1 result filtering by barcode', async() => { + let filter = {}; + let result = await app.models.Item.filter({args: {filter: filter, search: 4444444444}}); + + expect(result.length).toEqual(1); + expect(result[0].id).toEqual(2); + }); + it('should return 1 result using filter and tags', async() => { let filter = { order: 'isActive ASC, name', From b6daab114c3628c8874dc5537282debbab0365be Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Wed, 10 Apr 2019 09:39:35 +0200 Subject: [PATCH 02/10] test fixed to previous client.balance refactors --- e2e/paths/client-module/14_risk.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/paths/client-module/14_risk.spec.js b/e2e/paths/client-module/14_risk.spec.js index b6184e4ce..58cfb5b6e 100644 --- a/e2e/paths/client-module/14_risk.spec.js +++ b/e2e/paths/client-module/14_risk.spec.js @@ -118,7 +118,7 @@ describe('Client risk path', () => { let result = await nightmare .waitToGetProperty(selectors.clientRisk.firstRiskLineBalance, 'innerText'); - expect(result).toContain('-€50.00'); + expect(result).toContain('€50.00'); }); it('should now click on the Clients button of the top bar menu', async() => { From 17f5e46497be140d68d3806a6a9d4a079328eee5 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Wed, 10 Apr 2019 09:45:45 +0200 Subject: [PATCH 03/10] #1284 Print - Informe zona --- db/dump/fixtures.sql | 16 ++++----- print/config/routes.json | 1 + print/report/rpt-route/assets/css/index.js | 7 ++++ print/report/rpt-route/assets/css/style.css | 9 ++++++ print/report/rpt-route/index.html | 15 +++++++++ print/report/rpt-route/index.js | 36 +++++++++++++++++++++ print/report/rpt-route/locale.js | 0 7 files changed, 76 insertions(+), 8 deletions(-) create mode 100644 print/report/rpt-route/assets/css/index.js create mode 100644 print/report/rpt-route/assets/css/style.css create mode 100644 print/report/rpt-route/index.html create mode 100755 print/report/rpt-route/index.js create mode 100644 print/report/rpt-route/locale.js diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index a96820c05..4461087f0 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -355,15 +355,15 @@ INSERT INTO `vn`.`creditInsurance`(`id`, `creditClassification`, `credit`, `crea (2, 2 , 6000, DATE_ADD(CURDATE(), INTERVAL -2 MONTH), NULL), (3, 3, 10000 , DATE_ADD(CURDATE(), INTERVAL -3 MONTH), NULL); -INSERT INTO `vn`.`route`(`id`, `workerFk`, `created`, `vehicleFk`, `agencyModeFk`, `description`, `m3`, `cost`, `started`, `finished`) +INSERT INTO `vn`.`route`(`id`, `time`, `workerFk`, `created`, `vehicleFk`, `agencyModeFk`, `description`, `m3`, `cost`, `started`, `finished`) VALUES - (1, 56, CURDATE(), 1, 1, 'first route', null, 10, CURDATE(), CURDATE()), - (2, 56, CURDATE(), 1, 1, 'second route', 4.2, 20, CURDATE(), CURDATE()), - (3, 56, CURDATE(), 2, 7, 'third route', 5.3, 30, CURDATE(), CURDATE()), - (4, 56, CURDATE(), 3, 7, 'fourth route', 6.4, 40, CURDATE(), CURDATE()), - (5, 56, CURDATE(), 4, 8, 'fifth route', 7.5, 50, CURDATE(), CURDATE()), - (6, 57, CURDATE(), 5, 8, 'sixth route', 8.6, 60, CURDATE(), CURDATE()), - (7, 57, CURDATE(), 6, null, 'seventh route', 9.7, 70, CURDATE(), CURDATE()); + (1, '1899-12-30 12:15:00', 56, CURDATE(), 1, 1, 'first route', null, 10, CURDATE(), CURDATE()), + (2, '1899-12-30 13:20:00', 56, CURDATE(), 1, 1, 'second route', 4.2, 20, CURDATE(), CURDATE()), + (3, '1899-12-30 14:30:00', 56, CURDATE(), 2, 7, 'third route', 5.3, 30, CURDATE(), CURDATE()), + (4, '1899-12-30 15:45:00', 56, CURDATE(), 3, 7, 'fourth route', 6.4, 40, CURDATE(), CURDATE()), + (5, '1899-12-30 16:00:00', 56, CURDATE(), 4, 8, 'fifth route', 7.5, 50, CURDATE(), CURDATE()), + (6, null, 57, CURDATE(), 5, 8, 'sixth route', 8.6, 60, CURDATE(), CURDATE()), + (7, null, 57, CURDATE(), 6, null, 'seventh route', 9.7, 70, CURDATE(), CURDATE()); INSERT INTO `vn2008`.`empresa_grupo`(`empresa_grupo_id`, `grupo`) VALUES diff --git a/print/config/routes.json b/print/config/routes.json index 88365b1d0..95e881f0a 100644 --- a/print/config/routes.json +++ b/print/config/routes.json @@ -12,6 +12,7 @@ {"type": "report", "name": "rpt-letter-debtor"}, {"type": "report", "name": "rpt-sepa-core"}, {"type": "report", "name": "rpt-receipt"}, + {"type": "report", "name": "rpt-route"}, {"type": "static", "name": "email-header"}, {"type": "static", "name": "email-footer"}, {"type": "static", "name": "report-header"}, diff --git a/print/report/rpt-route/assets/css/index.js b/print/report/rpt-route/assets/css/index.js new file mode 100644 index 000000000..06417fcee --- /dev/null +++ b/print/report/rpt-route/assets/css/index.js @@ -0,0 +1,7 @@ +const CssReader = require(`${appPath}/lib/cssReader`); + +module.exports = new CssReader([ + `${appPath}/common/css/layout.css`, + `${appPath}/common/css/report.css`, + `${__dirname}/style.css`]) + .mergeStyles(); diff --git a/print/report/rpt-route/assets/css/style.css b/print/report/rpt-route/assets/css/style.css new file mode 100644 index 000000000..82e5c33f1 --- /dev/null +++ b/print/report/rpt-route/assets/css/style.css @@ -0,0 +1,9 @@ +section .text { + font-family: Tahoma; + font-weight: bold; + color: white; + font-size: 7.5em; + text-align: center; + background-color: black; + margin-bottom: 0.2em +} \ No newline at end of file diff --git a/print/report/rpt-route/index.html b/print/report/rpt-route/index.html new file mode 100644 index 000000000..727088c82 --- /dev/null +++ b/print/report/rpt-route/index.html @@ -0,0 +1,15 @@ + + + +
+
+ +
{{route.agencyName}}
+
{{route.id}}
+
{{route.plateNumber}} {{routeTime(route.time)}}
+
+ +
+
+ + \ No newline at end of file diff --git a/print/report/rpt-route/index.js b/print/report/rpt-route/index.js new file mode 100755 index 000000000..7048acc2a --- /dev/null +++ b/print/report/rpt-route/index.js @@ -0,0 +1,36 @@ +const strftime = require('strftime'); +const database = require(`${appPath}/lib/database`); +const UserException = require(`${appPath}/lib/exceptions/userException`); + +module.exports = { + name: 'rpt-route', + async asyncData(ctx, params) { + if (!params.routeFk) + throw new UserException('No route id specified'); + + let [[route]] = await this.methods.fetchRoute(params.routeFk); + + if (!route) + throw new UserException('Route not ready'); + + return {route}; + }, + methods: { + fetchRoute(routeFk) { + return database.pool.query( + `SELECT + r.id, + r.time, + am.name agencyName, + v.numberPlate plateNumber + FROM route r + JOIN agencyMode am ON am.id = r.agencyModeFk + JOIN vehicle v ON v.id = r.vehicleFk + WHERE r.id = ?`, [routeFk]); + }, + routeTime: routeTime => { + if (routeTime) + return strftime('%H:%M', routeTime); + }, + }, +}; diff --git a/print/report/rpt-route/locale.js b/print/report/rpt-route/locale.js new file mode 100644 index 000000000..e69de29bb From 2be348113836db6421d4a6d88dbf3a0c58218708 Mon Sep 17 00:00:00 2001 From: Bernat Date: Wed, 10 Apr 2019 10:02:28 +0200 Subject: [PATCH 04/10] #1309 add icon in routes module --- front/core/styles/salixfont.css | 16 ++++++++-------- front/core/styles/salixfont.svg | 6 +++--- front/core/styles/salixfont.ttf | Bin 25188 -> 25024 bytes front/core/styles/salixfont.woff | Bin 25264 -> 25100 bytes modules/route/front/tickets/index.html | 4 ++-- modules/route/front/tickets/locale/es.yml | 1 + 6 files changed, 14 insertions(+), 13 deletions(-) mode change 100644 => 100755 front/core/styles/salixfont.svg mode change 100644 => 100755 front/core/styles/salixfont.ttf mode change 100644 => 100755 front/core/styles/salixfont.woff diff --git a/front/core/styles/salixfont.css b/front/core/styles/salixfont.css index d917ff43b..eea133d1d 100644 --- a/front/core/styles/salixfont.css +++ b/front/core/styles/salixfont.css @@ -24,7 +24,13 @@ } .icon-agency:before { - content: "\e952"; + content: "\e910"; +} +.icon-delivery:before { + content: "\e94a"; +} +.icon-wand:before { + content: "\e954"; } .icon-unavailable:before { content: "\e953"; @@ -107,9 +113,6 @@ .icon-credit:before { content: "\e90e"; } -.icon-delivery:before { - content: "\e910"; -} .icon-details:before { content: "\e911"; } @@ -155,9 +158,6 @@ .icon-info:before { content: "\e949"; } -.icon-invoices1:before { - content: "\e94a"; -} .icon-item:before { content: "\e941"; } @@ -274,4 +274,4 @@ } .icon-worker:before { content: "\e943"; -} \ No newline at end of file +} diff --git a/front/core/styles/salixfont.svg b/front/core/styles/salixfont.svg old mode 100644 new mode 100755 index 88d279a83..4b55506e4 --- a/front/core/styles/salixfont.svg +++ b/front/core/styles/salixfont.svg @@ -23,7 +23,7 @@ - + @@ -81,7 +81,7 @@ - + @@ -89,6 +89,6 @@ - + \ No newline at end of file diff --git a/front/core/styles/salixfont.ttf b/front/core/styles/salixfont.ttf old mode 100644 new mode 100755 index 7729fcd057922c2a9922cabe6c0c4ee5f1f3988a..3fb247cc116e82ecb08e1a615d5849b4072b9b1c GIT binary patch delta 1285 zcmb`GU1%It6vyw`J0H87{mkynWH&p>?965+n@yVS&VJ-;qtL=uDwfzZ#x?C`6Pre8 znm~f2Qb-LVD1OC2De;5Qhf-(|$s+hrB-+&nQ4vH?A2etY)B2DHg}!XpGmVO15d{a% zoclX-{&(*E&z&1p*t!l&1PCDwHPoTJo@e4dcUcBfC49}m8x-Xi3<)t8;d0$*hW6wMa5pcYX z{0VBtPtQ*Fmfw5v%Fl$9Iuo`mbj+sMk9^32H-k9=LgwIITqbF=dcxKO;x z>nraTVE9$&H}6Mu5j(LF1~;SZ4DAfpYxTO-g+z9a-X*C2ATbg}HEy^v1$BQDhYbS^ zp$BpQ5{Z!{86{8PYgUyp3EEbN#+sJE*ar#7q;)N-a)Li7_QN2UDN%~Y|_Nh_29u&$7Eg|a|b+$^(Fi3#ubE6#fwaF#qnUM8>oPe!omY_1Q?oDk&r4$ycZ zmqnX+4m~n5IF^A|^_*lq*7yuIoAA!pTSL^Of=pvR4S6(rH1+?iLu1QjXR}7^c8_7~2NJywUS? zuWdM!3Rs!|OcslpS}dyGZ1%3`LV*GW6!_QzV+lO$OFhfI)}LfWCZ4=i@(%n;8W=1P z^3}()1ApX7&xv^evbs^yfLr~%lvsM!@tKo2lg>lV&4$YjKe()wZ=;8z zH`GNftc`0Q#9CsTZ7=AZ`iTCNep%l(I*qCJzV_vKEdEX6!NfUxqS_VdTJO4DSswo$ Fegk%!4LJY+ delta 1147 zcmb_bZ)g)|7=PZp=UsZ~wTa2ywP`N98YmdMdK#N5*R#iQ=Q`Tpa3(z=_upRtAU?#sqv^>B z^iITV(%{ztJ!qs;J}_=w;;ZR1s5mACy(NX;xp7W zb8QRhIYZiGtq6IrgAEq}^=VIOrBt#w7{gjjN{?j*>qsF>O0Jv(QzMAI;D!)1LK|#@ zy)X)sa2n3Tci1S>Kw_jhp=*I4E4l(0MZzAIGlCnr=0uBWG;K6RlMCu*v)LjkMCMpM zNiY;;6KQosTcfp+xJk4irV=gf#K3G5t8u}6wp;R=qKA!<228VD;H_I@2G->-xT|vX zd6BOYh7@__uB0&FU{^k^aWY#iWBRKDw9o4wi3_eq!Nv6J5~Xw~EK?gDCNtML8%u-C zEM@4aXfheCOD5|iMUiAheV|BjZdW|Mon8Ht-D$+Pb6swgf#qe3V{v7lPnHywJkQPZ zobFK-dG(4eRPkbUEiH?zy*h=c8W(77D88GalG|%%yiR{nORz3eOK`&KYnIMX)<$Q9 z!rR{Uo6cK@Dw11W8h5M4=FNs>iZs6CJ%Tkeyd0(Z!Wqxc?S-#vT1nyM?qb=8+&dF9 zpac3~2(o`aDegVV^OKP%q%zbN^xkY)dx<>TeBtc=NkRtl_7t-78&a{{FT9`c=BN2{4x8gud29Jd`JCVpdW9DiKUNeg zRx6jC-Og{E&sILsd-XCg=n$LYs-?Z!^r~m)} diff --git a/front/core/styles/salixfont.woff b/front/core/styles/salixfont.woff old mode 100644 new mode 100755 index a1e0ece177d9d7dfa44b456c6447556c303b71c3..b3b3f1768779b102893cc8a62f3d1a5e92ab8029 GIT binary patch delta 1315 zcmb_bU1%It6uxKg{A4%#o86hoZg!I0naxZ#n>5><{mI`(p{1!b7^>SfUE5?gv1x>+ z2_$GLgywy{OExL1PDHpcG76Z(t6n!TV9%)EzJ`GGsqk>vH8aB+{w~{ z$yG6LcmVgwQ)i};`<#%cw@jS1PV~&2C_O{S@f%o^HsSj~xif<#a`!NgnBc37Ff+Tj zM96qE>We1wV7-27ZVKy$CUAnRnfUP4ckj-YmT=)>7v`ZIJO`hgF3p}mZUlvwOpHJE z&G7u(!XlpFZuz%S$gPaPfbl4n+i|xR!r(DOn};`Z^;*4-EVkMtn@{d!Q2$Y4BuXgO zkjfg=J)(kV|;)7z8j0f>u&l;C2ZXjz~_G@FffX0x55EQ^vHs(ooDCMgAjk|>8P8&zAg zV^WrCUts3l&mS`4k8|MQ4jINMZ-{aucYo|>jw;M5W#|pw0@hu9cmFDO#3tU*>fac6 zZ{6CUc|)>T`%0AK`}W06guKAo{kAe?ftDRCQ?ASl9}R?T4>jNnIZs|EZ~ae3u*r0$ zAB>FPWcc_EWVn|KaA(o;B=fmgJQWKOGm3X6@0S-1S(z5ACGzEaB>(;(c5vJaOTTG)M+Nf(zQ<5zwi=JCGhk9&e_q za6I%vA8@`l5EGfby|5S3NuAd-5*_j;65b}m_&yRY6vE1}x*#Nzf{@-CW;jYYTFW!c zFzaM2*BIuV-WU5Uxm3byYP>L2D5y%Ipt#cM9nr;M3KUS_W``M5;ACIxJ=bUcNhVU! z_?-#Y;IE{SL4uI4Kbsr;BUa9jF9490?FkjQm0&Tp{F3#Sjo9M0gSNHCtBt?dMf;?^ z>R=p~odxHj^L^JfH*pWS-*&Hi+)cN=PTxIYP?#1^OGUrpf5pEY7z=E)>}gpK#)CO| ztM$#ci=pqr2g5%pOKLzZsvk#MBWvv!v@R{Ly`WvyHuNrix}(42Tr?8>HZ~GF+YqaE P2fHtKZ&z*=e}LZsXEhUy delta 1183 zcmeAmBylb;M!XO|!YRI~|%PXupj%T25RTAXkJ$X5X4 zGRDJsiMgpju@69v^FTN*{HA+BesKxVKNBYY@n;O4?89iSZ2?ry1#~SF5Hd0-ybS*T z_y2#O7|@`X3}80n|HtAi49pCSn|Cq(7pw<`L>iDU#UKoHs6K-ggBL?ILpnn-Ll47D zhNVE8)b$v(8BI;plogfOLl-Q5meviqY7dQCSHnWnyN{XaJNoVpC>UntVxEOv+qTgiV`K4=ByX zt_Y#PDiv8LUks3_XMTT#OM*8^R{ZZ-F~u|q$zUi>#}0T?Ec2a z-faIqv-ueqd$YR;E3h#9`2$h|QY$VaBQ7SZ!1%uY02jNOh=Q#6zb$IK5?rE^8qA#P zV8Ve{Q^A;*SwqD*kcC-HSc-#1NZid*cYdI5S zsH~W)|;9~iy)L2NN2W8CDBc%bUZ74h2j*SO@k0=OEuW^glcf8(*>N#ohXE5aMX z`+;v2-x0ol{C@-j1o{Nt2nq-$2wMrqiMojPh;9?xC%!?lNb;7Hhtvvb1L-;$0htDw zC2|gOFXW#o>M71pGEq9AoTa=$MMx!2l}YuET8-K=wNq-})D6^Y)VFB_Y0T2J(fp*H VqCJH}`;M-O?kPRL%~}bM7y+Qc3P=C| diff --git a/modules/route/front/tickets/index.html b/modules/route/front/tickets/index.html index df04086e4..7149e1b7b 100644 --- a/modules/route/front/tickets/index.html +++ b/modules/route/front/tickets/index.html @@ -9,9 +9,9 @@ + vn-tooltip="Sort routes"> Date: Wed, 10 Apr 2019 10:43:11 +0200 Subject: [PATCH 05/10] #1326 enlazar en ticket.descriptor tres puntos --- modules/ticket/front/descriptor/index.js | 8 +++++++- modules/ticket/front/descriptor/locale/es.yml | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/ticket/front/descriptor/index.js b/modules/ticket/front/descriptor/index.js index 30f3390d4..5c7d81ab9 100644 --- a/modules/ticket/front/descriptor/index.js +++ b/modules/ticket/front/descriptor/index.js @@ -14,7 +14,8 @@ class Controller { {callback: this.showDeliveryNote, name: 'Show Delivery Note', show: true}, {callback: this.showDeleteTicketDialog, name: 'Delete ticket', show: true}, {callback: this.showChangeShipped, name: 'Change shipped hour', show: true}, - {callback: this.showSMSDialog, name: 'Send SMS', show: true} + {callback: this.showSMSDialog, name: 'Send SMS', show: true}, + {callback: this.openRptRoute, name: 'Show pallet report', show: true} ]; } @@ -109,6 +110,11 @@ class Controller { } } + openRptRoute() { + let url = `/api/report/rpt-route?routeFk=${this.ticket.routeFk}`; + window.open(url); + } + showAddStowaway() { this.$scope.addStowaway.show(); } diff --git a/modules/ticket/front/descriptor/locale/es.yml b/modules/ticket/front/descriptor/locale/es.yml index bf2a121eb..3ce9905cb 100644 --- a/modules/ticket/front/descriptor/locale/es.yml +++ b/modules/ticket/front/descriptor/locale/es.yml @@ -8,6 +8,7 @@ Add stowaway: Añadir polizón Remove stowaway: Borrar polizón Are you sure you want to delete this stowaway?: ¿Estas seguro de que quieres borrar este polizón? Show Delivery Note: Ver albarán +Show pallet report: Mostrar hoja de pallet Change shipped hour: Cambiar hora de envío Shipped hour: Hora de envío SMSPayment: >- From 9db389329d14661dbe765031df9a5804a9a0b14d Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Wed, 10 Apr 2019 10:53:00 +0200 Subject: [PATCH 06/10] renamed the it statement --- back/methods/message/specs/send.spec.js | 2 +- modules/client/back/methods/sms/specs/send.spec.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/back/methods/message/specs/send.spec.js b/back/methods/message/specs/send.spec.js index 079595b12..6749bd7cd 100644 --- a/back/methods/message/specs/send.spec.js +++ b/back/methods/message/specs/send.spec.js @@ -1,7 +1,7 @@ const app = require('vn-loopback/server/server'); describe('message send()', () => { - it('should call the send method and return the response', async() => { + it('should return a response containing the same message in params', async() => { let ctx = {req: {accessToken: {userId: 1}}}; let params = { recipientFk: 1, diff --git a/modules/client/back/methods/sms/specs/send.spec.js b/modules/client/back/methods/sms/specs/send.spec.js index 88251aba0..0045b148a 100644 --- a/modules/client/back/methods/sms/specs/send.spec.js +++ b/modules/client/back/methods/sms/specs/send.spec.js @@ -6,7 +6,7 @@ const app = require('vn-loopback/server/server'); * por destinatario inválido, pero puede llegar a fallar. */ describe('sms send()', () => { - it('should call the send method', async() => { + it('should should return the expected message and status code', async() => { let ctx = {req: {accessToken: {userId: 1}}}; let result = await app.models.Sms.send(ctx, null, 'Invalid', 'My SMS Body'); From e9102249be216f3f89c5f604a9c0b3d9c29b4983 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Wed, 10 Apr 2019 11:49:39 +0200 Subject: [PATCH 07/10] #1328 module home refactor --- front/salix/components/home/home.html | 36 +++++++++++++------------- front/salix/components/home/style.scss | 10 +++---- modules/invoiceOut/front/routes.json | 2 +- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/front/salix/components/home/home.html b/front/salix/components/home/home.html index cfc59bdc4..fa9cd9d67 100644 --- a/front/salix/components/home/home.html +++ b/front/salix/components/home/home.html @@ -1,22 +1,22 @@ diff --git a/front/salix/components/home/style.scss b/front/salix/components/home/style.scss index 72322d0e0..cab44ea73 100644 --- a/front/salix/components/home/style.scss +++ b/front/salix/components/home/style.scss @@ -16,7 +16,7 @@ vn-home { flex-direction: row; justify-content: center; flex-wrap: wrap; - max-width: 40em; + max-width: 44em; margin: 0 auto; & > a { @@ -28,7 +28,7 @@ vn-home { display: flex; flex-direction: column; height: 8em; - width: 7em; + width: 8em; margin: .5em; padding: 1em; justify-content: center; @@ -49,13 +49,13 @@ vn-home { text-align: center; } & > h4 { + max-width: 7em; text-align: center; - font-size: 16pt; - text-overflow: ellipsis; - white-space: nowrap; + font-size: 13pt; overflow: hidden; color: inherit; margin: 0; + line-height: 1.5em; /* & > .bind-letter { color: #FD0; diff --git a/modules/invoiceOut/front/routes.json b/modules/invoiceOut/front/routes.json index dbaa4be29..eb278ebd8 100644 --- a/modules/invoiceOut/front/routes.json +++ b/modules/invoiceOut/front/routes.json @@ -1,7 +1,7 @@ { "module": "invoiceOut", "name": "Invoices out", - "icon": "icon-invoices1", + "icon": "icon-invoices", "validations" : true, "dependencies": ["worker", "client", "ticket"], "routes": [ From 6f98d81db1c9d5b3434faeb5eb8b760638e94a49 Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Wed, 10 Apr 2019 12:04:11 +0200 Subject: [PATCH 08/10] fixed input time --- front/core/components/input-number/index.js | 53 ++++++++++++++++--- .../components/input-number/index.spec.js | 4 +- modules/agency/front/basic-data/index.html | 20 +++---- 3 files changed, 56 insertions(+), 21 deletions(-) diff --git a/front/core/components/input-number/index.js b/front/core/components/input-number/index.js index 458c6d61f..efae9c74a 100644 --- a/front/core/components/input-number/index.js +++ b/front/core/components/input-number/index.js @@ -21,6 +21,8 @@ export default class InputNumber extends Input { if (!isNaN(this.value)) this.input.value = this.value; + this.validateValue(); + this.emit('change', {event}); }); @@ -42,8 +44,11 @@ export default class InputNumber extends Input { * @param {Number} value - Value */ set value(value) { + if (!this.hasOwnProperty('_value') && value) + this.input.value = value; + this._value = value; - this.hasValue = this._value !== null; + this.hasValue = !(value === null || value === undefined || value === ''); if (this.hasValue) this.element.classList.add('not-empty'); @@ -102,6 +107,10 @@ export default class InputNumber extends Input { this.input.step = value; } + get validationError() { + return this.input.validationMessage; + } + /** * Increases the input value */ @@ -131,12 +140,42 @@ export default class InputNumber extends Input { */ validateValue() { if (!this.hasValidValue()) { - this.element.querySelector('.infix') - .classList.add('invalid', 'validated'); - } else { - this.element.querySelector('.infix') - .classList.remove('invalid', 'validated'); - } + this.hideError(); + this.showError(); + } else + this.hideError(); + } + + /** + * Shows the input validation error + */ + showError() { + const infixElement = this.element.querySelector('.infix'); + const infixClassList = infixElement.classList; + + const errorSpan = document.createElement('span'); + errorSpan.className = 'mdl-textfield__error'; + + const errorText = document.createTextNode(this.validationError); + + errorSpan.append(errorText); + infixElement.append(errorSpan); + + infixClassList.add('validated', 'invalid'); + } + + /** + * Hides the input validation error + */ + hideError() { + const infixElement = this.element.querySelector('.infix'); + const infixClassList = infixElement.classList; + const errorElement = this.element.querySelector('.infix span.mdl-textfield__error'); + + if (errorElement) + errorElement.remove(); + + infixClassList.remove('validated', 'invalid'); } } diff --git a/front/core/components/input-number/index.spec.js b/front/core/components/input-number/index.spec.js index 18d51512e..3da82fe21 100644 --- a/front/core/components/input-number/index.spec.js +++ b/front/core/components/input-number/index.spec.js @@ -50,7 +50,7 @@ describe('Component vnInputNumber', () => { controller.validateValue(); let classes = controller.element.querySelector('.infix').classList.toString(); - expect(classes).not.toContain('invalid validated'); + expect(classes).not.toContain('validated invalid'); }); it(`should call hasValidValue() and add the class invalid and validated`, () => { @@ -60,7 +60,7 @@ describe('Component vnInputNumber', () => { controller.validateValue(); let classes = controller.element.querySelector('.infix').classList.toString(); - expect(classes).toContain('invalid validated'); + expect(classes).toContain('validated invalid'); }); }); }); diff --git a/modules/agency/front/basic-data/index.html b/modules/agency/front/basic-data/index.html index b6f615cef..7241e1c9d 100644 --- a/modules/agency/front/basic-data/index.html +++ b/modules/agency/front/basic-data/index.html @@ -32,31 +32,27 @@ - + model="$ctrl.zone.travelingDays" + min="0" step="1"> + model="$ctrl.zone.hour"> + model="$ctrl.zone.price" + min="0" step="0.01"> + model="$ctrl.zone.bonus" + min="0" step="0.01"> From 340b8b309a74048623991ea10a1d5de0b8ff2d4f Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Wed, 10 Apr 2019 13:19:28 +0200 Subject: [PATCH 09/10] e2e fixes --- e2e/helpers/selectors.js | 1 - .../{login => 01-login}/01_login.spec.js | 0 .../01_create_client.spec.js | 0 .../02_edit_basic_data.spec.js | 0 .../03_edit_fiscal_data.spec.js | 0 .../04_edit_pay_method.spec.js | 0 .../05_add_address.spec.js | 0 .../06_add_address_notes.spec.js | 0 .../07_edit_web_access.spec.js | 0 .../08_add_notes.spec.js | 0 .../09_add_credit.spec.js | 0 .../10_add_greuge.spec.js | 0 .../11_mandate.spec.js | 0 .../12_lock_of_verified_data.spec.js | 0 .../13_log.spec.js | 0 .../14_risk.spec.js | 0 .../15_user_config.spec.js | 0 .../16_web_payment.spec.js | 0 .../01_pbx.spec.js | 0 .../01_summary.spec.js | 0 .../02_basic_data.spec.js | 0 .../03_tax.spec.js | 0 .../04_tags.spec.js | 0 .../05_niche.spec.js | 0 .../06_botanical.spec.js | 0 .../07_barcode.spec.js | 0 .../08_create_and_clone.spec.js | 0 .../09_regularize.spec.js | 0 .../10_item_index.spec.js | 0 .../11_item_log.spec.js | 0 .../12_descriptor.spec.js | 0 .../01_create_ticket_observations.spec.js | 0 .../02_ticket_expeditions_and_log.spec.js | 0 .../03_list_sale.spec.js | 0 .../04_create_ticket_packages.spec.js | 0 .../05_create_new_tracking_state.spec.js | 0 .../06_edit_basic_data_steps.spec.js | 0 .../07_edit_sale.spec.js | 0 .../08_list_components.spec.js | 0 .../09_ticket_weekly.spec.js | 0 .../10_ticket_request.spec.js | 0 .../11_ticket_diary.spec.js | 0 .../12_descriptor.spec.js | 0 .../13_create_ticket_services.spec.js | 0 .../14_create_ticket.spec.js | 0 .../15_create_ticket_from_client.spec.js | 0 .../01_edit_basic_data.spec.js | 0 .../02_create_development.spec.js | 0 .../03_detail.spec.js | 0 .../04_claim_action.spec.js | 0 .../01_edit_basic_data.spec.js | 0 .../02_lines.spec.js | 0 .../01_create.spec.js | 0 .../02_basic_data.spec.js | 0 .../03_tickets.spec.js | 22 +++---------------- 55 files changed, 3 insertions(+), 20 deletions(-) rename e2e/paths/{login => 01-login}/01_login.spec.js (100%) rename e2e/paths/{client-module => 02-client-module}/01_create_client.spec.js (100%) rename e2e/paths/{client-module => 02-client-module}/02_edit_basic_data.spec.js (100%) rename e2e/paths/{client-module => 02-client-module}/03_edit_fiscal_data.spec.js (100%) rename e2e/paths/{client-module => 02-client-module}/04_edit_pay_method.spec.js (100%) rename e2e/paths/{client-module => 02-client-module}/05_add_address.spec.js (100%) rename e2e/paths/{client-module => 02-client-module}/06_add_address_notes.spec.js (100%) rename e2e/paths/{client-module => 02-client-module}/07_edit_web_access.spec.js (100%) rename e2e/paths/{client-module => 02-client-module}/08_add_notes.spec.js (100%) rename e2e/paths/{client-module => 02-client-module}/09_add_credit.spec.js (100%) rename e2e/paths/{client-module => 02-client-module}/10_add_greuge.spec.js (100%) rename e2e/paths/{client-module => 02-client-module}/11_mandate.spec.js (100%) rename e2e/paths/{client-module => 02-client-module}/12_lock_of_verified_data.spec.js (100%) rename e2e/paths/{client-module => 02-client-module}/13_log.spec.js (100%) rename e2e/paths/{client-module => 02-client-module}/14_risk.spec.js (100%) rename e2e/paths/{client-module => 02-client-module}/15_user_config.spec.js (100%) rename e2e/paths/{client-module => 02-client-module}/16_web_payment.spec.js (100%) rename e2e/paths/{worker-module => 02-worker-module}/01_pbx.spec.js (100%) rename e2e/paths/{item-module => 03-item-module}/01_summary.spec.js (100%) rename e2e/paths/{item-module => 03-item-module}/02_basic_data.spec.js (100%) rename e2e/paths/{item-module => 03-item-module}/03_tax.spec.js (100%) rename e2e/paths/{item-module => 03-item-module}/04_tags.spec.js (100%) rename e2e/paths/{item-module => 03-item-module}/05_niche.spec.js (100%) rename e2e/paths/{item-module => 03-item-module}/06_botanical.spec.js (100%) rename e2e/paths/{item-module => 03-item-module}/07_barcode.spec.js (100%) rename e2e/paths/{item-module => 03-item-module}/08_create_and_clone.spec.js (100%) rename e2e/paths/{item-module => 03-item-module}/09_regularize.spec.js (100%) rename e2e/paths/{item-module => 03-item-module}/10_item_index.spec.js (100%) rename e2e/paths/{item-module => 03-item-module}/11_item_log.spec.js (100%) rename e2e/paths/{item-module => 03-item-module}/12_descriptor.spec.js (100%) rename e2e/paths/{ticket-module => 04-ticket-module}/01_create_ticket_observations.spec.js (100%) rename e2e/paths/{ticket-module => 04-ticket-module}/02_ticket_expeditions_and_log.spec.js (100%) rename e2e/paths/{ticket-module => 04-ticket-module}/03_list_sale.spec.js (100%) rename e2e/paths/{ticket-module => 04-ticket-module}/04_create_ticket_packages.spec.js (100%) rename e2e/paths/{ticket-module => 04-ticket-module}/05_create_new_tracking_state.spec.js (100%) rename e2e/paths/{ticket-module => 04-ticket-module}/06_edit_basic_data_steps.spec.js (100%) rename e2e/paths/{ticket-module => 04-ticket-module}/07_edit_sale.spec.js (100%) rename e2e/paths/{ticket-module => 04-ticket-module}/08_list_components.spec.js (100%) rename e2e/paths/{ticket-module => 04-ticket-module}/09_ticket_weekly.spec.js (100%) rename e2e/paths/{ticket-module => 04-ticket-module}/10_ticket_request.spec.js (100%) rename e2e/paths/{ticket-module => 04-ticket-module}/11_ticket_diary.spec.js (100%) rename e2e/paths/{ticket-module => 04-ticket-module}/12_descriptor.spec.js (100%) rename e2e/paths/{ticket-module => 04-ticket-module}/13_create_ticket_services.spec.js (100%) rename e2e/paths/{ticket-module => 04-ticket-module}/14_create_ticket.spec.js (100%) rename e2e/paths/{ticket-module => 04-ticket-module}/15_create_ticket_from_client.spec.js (100%) rename e2e/paths/{claim-module => 05-claim-module}/01_edit_basic_data.spec.js (100%) rename e2e/paths/{claim-module => 05-claim-module}/02_create_development.spec.js (100%) rename e2e/paths/{claim-module => 05-claim-module}/03_detail.spec.js (100%) rename e2e/paths/{claim-module => 05-claim-module}/04_claim_action.spec.js (100%) rename e2e/paths/{order-module => 06-order-module}/01_edit_basic_data.spec.js (100%) rename e2e/paths/{order-module => 06-order-module}/02_lines.spec.js (100%) rename e2e/paths/{route-module => 07-route-module}/01_create.spec.js (100%) rename e2e/paths/{route-module => 07-route-module}/02_basic_data.spec.js (100%) rename e2e/paths/{route-module => 07-route-module}/03_tickets.spec.js (87%) diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 1dd6587df..ff8a9db47 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -582,7 +582,6 @@ export default { secondTicketPriority: 'vn-route-tickets vn-tr:nth-child(2) vn-textfield[model="ticket.priority"] input', thirdTicketPriority: 'vn-route-tickets vn-tr:nth-child(3) vn-textfield[model="ticket.priority"] input', fourthTicketPriority: 'vn-route-tickets vn-tr:nth-child(4) vn-textfield[model="ticket.priority"] input', - fifthTicketPriority: 'vn-route-tickets vn-tr:nth-child(5) vn-textfield[model="ticket.priority"] input', firstTicketCheckbox: 'vn-route-tickets vn-tr:nth-child(1) vn-check md-checkbox', buscamanButton: 'vn-route-tickets vn-button[icon="icon-buscaman"]', firstTicketDeleteButton: 'vn-route-tickets vn-tr:nth-child(1) vn-icon[icon="delete"]', diff --git a/e2e/paths/login/01_login.spec.js b/e2e/paths/01-login/01_login.spec.js similarity index 100% rename from e2e/paths/login/01_login.spec.js rename to e2e/paths/01-login/01_login.spec.js diff --git a/e2e/paths/client-module/01_create_client.spec.js b/e2e/paths/02-client-module/01_create_client.spec.js similarity index 100% rename from e2e/paths/client-module/01_create_client.spec.js rename to e2e/paths/02-client-module/01_create_client.spec.js diff --git a/e2e/paths/client-module/02_edit_basic_data.spec.js b/e2e/paths/02-client-module/02_edit_basic_data.spec.js similarity index 100% rename from e2e/paths/client-module/02_edit_basic_data.spec.js rename to e2e/paths/02-client-module/02_edit_basic_data.spec.js diff --git a/e2e/paths/client-module/03_edit_fiscal_data.spec.js b/e2e/paths/02-client-module/03_edit_fiscal_data.spec.js similarity index 100% rename from e2e/paths/client-module/03_edit_fiscal_data.spec.js rename to e2e/paths/02-client-module/03_edit_fiscal_data.spec.js diff --git a/e2e/paths/client-module/04_edit_pay_method.spec.js b/e2e/paths/02-client-module/04_edit_pay_method.spec.js similarity index 100% rename from e2e/paths/client-module/04_edit_pay_method.spec.js rename to e2e/paths/02-client-module/04_edit_pay_method.spec.js diff --git a/e2e/paths/client-module/05_add_address.spec.js b/e2e/paths/02-client-module/05_add_address.spec.js similarity index 100% rename from e2e/paths/client-module/05_add_address.spec.js rename to e2e/paths/02-client-module/05_add_address.spec.js diff --git a/e2e/paths/client-module/06_add_address_notes.spec.js b/e2e/paths/02-client-module/06_add_address_notes.spec.js similarity index 100% rename from e2e/paths/client-module/06_add_address_notes.spec.js rename to e2e/paths/02-client-module/06_add_address_notes.spec.js diff --git a/e2e/paths/client-module/07_edit_web_access.spec.js b/e2e/paths/02-client-module/07_edit_web_access.spec.js similarity index 100% rename from e2e/paths/client-module/07_edit_web_access.spec.js rename to e2e/paths/02-client-module/07_edit_web_access.spec.js diff --git a/e2e/paths/client-module/08_add_notes.spec.js b/e2e/paths/02-client-module/08_add_notes.spec.js similarity index 100% rename from e2e/paths/client-module/08_add_notes.spec.js rename to e2e/paths/02-client-module/08_add_notes.spec.js diff --git a/e2e/paths/client-module/09_add_credit.spec.js b/e2e/paths/02-client-module/09_add_credit.spec.js similarity index 100% rename from e2e/paths/client-module/09_add_credit.spec.js rename to e2e/paths/02-client-module/09_add_credit.spec.js diff --git a/e2e/paths/client-module/10_add_greuge.spec.js b/e2e/paths/02-client-module/10_add_greuge.spec.js similarity index 100% rename from e2e/paths/client-module/10_add_greuge.spec.js rename to e2e/paths/02-client-module/10_add_greuge.spec.js diff --git a/e2e/paths/client-module/11_mandate.spec.js b/e2e/paths/02-client-module/11_mandate.spec.js similarity index 100% rename from e2e/paths/client-module/11_mandate.spec.js rename to e2e/paths/02-client-module/11_mandate.spec.js diff --git a/e2e/paths/client-module/12_lock_of_verified_data.spec.js b/e2e/paths/02-client-module/12_lock_of_verified_data.spec.js similarity index 100% rename from e2e/paths/client-module/12_lock_of_verified_data.spec.js rename to e2e/paths/02-client-module/12_lock_of_verified_data.spec.js diff --git a/e2e/paths/client-module/13_log.spec.js b/e2e/paths/02-client-module/13_log.spec.js similarity index 100% rename from e2e/paths/client-module/13_log.spec.js rename to e2e/paths/02-client-module/13_log.spec.js diff --git a/e2e/paths/client-module/14_risk.spec.js b/e2e/paths/02-client-module/14_risk.spec.js similarity index 100% rename from e2e/paths/client-module/14_risk.spec.js rename to e2e/paths/02-client-module/14_risk.spec.js diff --git a/e2e/paths/client-module/15_user_config.spec.js b/e2e/paths/02-client-module/15_user_config.spec.js similarity index 100% rename from e2e/paths/client-module/15_user_config.spec.js rename to e2e/paths/02-client-module/15_user_config.spec.js diff --git a/e2e/paths/client-module/16_web_payment.spec.js b/e2e/paths/02-client-module/16_web_payment.spec.js similarity index 100% rename from e2e/paths/client-module/16_web_payment.spec.js rename to e2e/paths/02-client-module/16_web_payment.spec.js diff --git a/e2e/paths/worker-module/01_pbx.spec.js b/e2e/paths/02-worker-module/01_pbx.spec.js similarity index 100% rename from e2e/paths/worker-module/01_pbx.spec.js rename to e2e/paths/02-worker-module/01_pbx.spec.js diff --git a/e2e/paths/item-module/01_summary.spec.js b/e2e/paths/03-item-module/01_summary.spec.js similarity index 100% rename from e2e/paths/item-module/01_summary.spec.js rename to e2e/paths/03-item-module/01_summary.spec.js diff --git a/e2e/paths/item-module/02_basic_data.spec.js b/e2e/paths/03-item-module/02_basic_data.spec.js similarity index 100% rename from e2e/paths/item-module/02_basic_data.spec.js rename to e2e/paths/03-item-module/02_basic_data.spec.js diff --git a/e2e/paths/item-module/03_tax.spec.js b/e2e/paths/03-item-module/03_tax.spec.js similarity index 100% rename from e2e/paths/item-module/03_tax.spec.js rename to e2e/paths/03-item-module/03_tax.spec.js diff --git a/e2e/paths/item-module/04_tags.spec.js b/e2e/paths/03-item-module/04_tags.spec.js similarity index 100% rename from e2e/paths/item-module/04_tags.spec.js rename to e2e/paths/03-item-module/04_tags.spec.js diff --git a/e2e/paths/item-module/05_niche.spec.js b/e2e/paths/03-item-module/05_niche.spec.js similarity index 100% rename from e2e/paths/item-module/05_niche.spec.js rename to e2e/paths/03-item-module/05_niche.spec.js diff --git a/e2e/paths/item-module/06_botanical.spec.js b/e2e/paths/03-item-module/06_botanical.spec.js similarity index 100% rename from e2e/paths/item-module/06_botanical.spec.js rename to e2e/paths/03-item-module/06_botanical.spec.js diff --git a/e2e/paths/item-module/07_barcode.spec.js b/e2e/paths/03-item-module/07_barcode.spec.js similarity index 100% rename from e2e/paths/item-module/07_barcode.spec.js rename to e2e/paths/03-item-module/07_barcode.spec.js diff --git a/e2e/paths/item-module/08_create_and_clone.spec.js b/e2e/paths/03-item-module/08_create_and_clone.spec.js similarity index 100% rename from e2e/paths/item-module/08_create_and_clone.spec.js rename to e2e/paths/03-item-module/08_create_and_clone.spec.js diff --git a/e2e/paths/item-module/09_regularize.spec.js b/e2e/paths/03-item-module/09_regularize.spec.js similarity index 100% rename from e2e/paths/item-module/09_regularize.spec.js rename to e2e/paths/03-item-module/09_regularize.spec.js diff --git a/e2e/paths/item-module/10_item_index.spec.js b/e2e/paths/03-item-module/10_item_index.spec.js similarity index 100% rename from e2e/paths/item-module/10_item_index.spec.js rename to e2e/paths/03-item-module/10_item_index.spec.js diff --git a/e2e/paths/item-module/11_item_log.spec.js b/e2e/paths/03-item-module/11_item_log.spec.js similarity index 100% rename from e2e/paths/item-module/11_item_log.spec.js rename to e2e/paths/03-item-module/11_item_log.spec.js diff --git a/e2e/paths/item-module/12_descriptor.spec.js b/e2e/paths/03-item-module/12_descriptor.spec.js similarity index 100% rename from e2e/paths/item-module/12_descriptor.spec.js rename to e2e/paths/03-item-module/12_descriptor.spec.js diff --git a/e2e/paths/ticket-module/01_create_ticket_observations.spec.js b/e2e/paths/04-ticket-module/01_create_ticket_observations.spec.js similarity index 100% rename from e2e/paths/ticket-module/01_create_ticket_observations.spec.js rename to e2e/paths/04-ticket-module/01_create_ticket_observations.spec.js diff --git a/e2e/paths/ticket-module/02_ticket_expeditions_and_log.spec.js b/e2e/paths/04-ticket-module/02_ticket_expeditions_and_log.spec.js similarity index 100% rename from e2e/paths/ticket-module/02_ticket_expeditions_and_log.spec.js rename to e2e/paths/04-ticket-module/02_ticket_expeditions_and_log.spec.js diff --git a/e2e/paths/ticket-module/03_list_sale.spec.js b/e2e/paths/04-ticket-module/03_list_sale.spec.js similarity index 100% rename from e2e/paths/ticket-module/03_list_sale.spec.js rename to e2e/paths/04-ticket-module/03_list_sale.spec.js diff --git a/e2e/paths/ticket-module/04_create_ticket_packages.spec.js b/e2e/paths/04-ticket-module/04_create_ticket_packages.spec.js similarity index 100% rename from e2e/paths/ticket-module/04_create_ticket_packages.spec.js rename to e2e/paths/04-ticket-module/04_create_ticket_packages.spec.js diff --git a/e2e/paths/ticket-module/05_create_new_tracking_state.spec.js b/e2e/paths/04-ticket-module/05_create_new_tracking_state.spec.js similarity index 100% rename from e2e/paths/ticket-module/05_create_new_tracking_state.spec.js rename to e2e/paths/04-ticket-module/05_create_new_tracking_state.spec.js diff --git a/e2e/paths/ticket-module/06_edit_basic_data_steps.spec.js b/e2e/paths/04-ticket-module/06_edit_basic_data_steps.spec.js similarity index 100% rename from e2e/paths/ticket-module/06_edit_basic_data_steps.spec.js rename to e2e/paths/04-ticket-module/06_edit_basic_data_steps.spec.js diff --git a/e2e/paths/ticket-module/07_edit_sale.spec.js b/e2e/paths/04-ticket-module/07_edit_sale.spec.js similarity index 100% rename from e2e/paths/ticket-module/07_edit_sale.spec.js rename to e2e/paths/04-ticket-module/07_edit_sale.spec.js diff --git a/e2e/paths/ticket-module/08_list_components.spec.js b/e2e/paths/04-ticket-module/08_list_components.spec.js similarity index 100% rename from e2e/paths/ticket-module/08_list_components.spec.js rename to e2e/paths/04-ticket-module/08_list_components.spec.js diff --git a/e2e/paths/ticket-module/09_ticket_weekly.spec.js b/e2e/paths/04-ticket-module/09_ticket_weekly.spec.js similarity index 100% rename from e2e/paths/ticket-module/09_ticket_weekly.spec.js rename to e2e/paths/04-ticket-module/09_ticket_weekly.spec.js diff --git a/e2e/paths/ticket-module/10_ticket_request.spec.js b/e2e/paths/04-ticket-module/10_ticket_request.spec.js similarity index 100% rename from e2e/paths/ticket-module/10_ticket_request.spec.js rename to e2e/paths/04-ticket-module/10_ticket_request.spec.js diff --git a/e2e/paths/ticket-module/11_ticket_diary.spec.js b/e2e/paths/04-ticket-module/11_ticket_diary.spec.js similarity index 100% rename from e2e/paths/ticket-module/11_ticket_diary.spec.js rename to e2e/paths/04-ticket-module/11_ticket_diary.spec.js diff --git a/e2e/paths/ticket-module/12_descriptor.spec.js b/e2e/paths/04-ticket-module/12_descriptor.spec.js similarity index 100% rename from e2e/paths/ticket-module/12_descriptor.spec.js rename to e2e/paths/04-ticket-module/12_descriptor.spec.js diff --git a/e2e/paths/ticket-module/13_create_ticket_services.spec.js b/e2e/paths/04-ticket-module/13_create_ticket_services.spec.js similarity index 100% rename from e2e/paths/ticket-module/13_create_ticket_services.spec.js rename to e2e/paths/04-ticket-module/13_create_ticket_services.spec.js diff --git a/e2e/paths/ticket-module/14_create_ticket.spec.js b/e2e/paths/04-ticket-module/14_create_ticket.spec.js similarity index 100% rename from e2e/paths/ticket-module/14_create_ticket.spec.js rename to e2e/paths/04-ticket-module/14_create_ticket.spec.js diff --git a/e2e/paths/ticket-module/15_create_ticket_from_client.spec.js b/e2e/paths/04-ticket-module/15_create_ticket_from_client.spec.js similarity index 100% rename from e2e/paths/ticket-module/15_create_ticket_from_client.spec.js rename to e2e/paths/04-ticket-module/15_create_ticket_from_client.spec.js diff --git a/e2e/paths/claim-module/01_edit_basic_data.spec.js b/e2e/paths/05-claim-module/01_edit_basic_data.spec.js similarity index 100% rename from e2e/paths/claim-module/01_edit_basic_data.spec.js rename to e2e/paths/05-claim-module/01_edit_basic_data.spec.js diff --git a/e2e/paths/claim-module/02_create_development.spec.js b/e2e/paths/05-claim-module/02_create_development.spec.js similarity index 100% rename from e2e/paths/claim-module/02_create_development.spec.js rename to e2e/paths/05-claim-module/02_create_development.spec.js diff --git a/e2e/paths/claim-module/03_detail.spec.js b/e2e/paths/05-claim-module/03_detail.spec.js similarity index 100% rename from e2e/paths/claim-module/03_detail.spec.js rename to e2e/paths/05-claim-module/03_detail.spec.js diff --git a/e2e/paths/claim-module/04_claim_action.spec.js b/e2e/paths/05-claim-module/04_claim_action.spec.js similarity index 100% rename from e2e/paths/claim-module/04_claim_action.spec.js rename to e2e/paths/05-claim-module/04_claim_action.spec.js diff --git a/e2e/paths/order-module/01_edit_basic_data.spec.js b/e2e/paths/06-order-module/01_edit_basic_data.spec.js similarity index 100% rename from e2e/paths/order-module/01_edit_basic_data.spec.js rename to e2e/paths/06-order-module/01_edit_basic_data.spec.js diff --git a/e2e/paths/order-module/02_lines.spec.js b/e2e/paths/06-order-module/02_lines.spec.js similarity index 100% rename from e2e/paths/order-module/02_lines.spec.js rename to e2e/paths/06-order-module/02_lines.spec.js diff --git a/e2e/paths/route-module/01_create.spec.js b/e2e/paths/07-route-module/01_create.spec.js similarity index 100% rename from e2e/paths/route-module/01_create.spec.js rename to e2e/paths/07-route-module/01_create.spec.js diff --git a/e2e/paths/route-module/02_basic_data.spec.js b/e2e/paths/07-route-module/02_basic_data.spec.js similarity index 100% rename from e2e/paths/route-module/02_basic_data.spec.js rename to e2e/paths/07-route-module/02_basic_data.spec.js diff --git a/e2e/paths/route-module/03_tickets.spec.js b/e2e/paths/07-route-module/03_tickets.spec.js similarity index 87% rename from e2e/paths/route-module/03_tickets.spec.js rename to e2e/paths/07-route-module/03_tickets.spec.js index 3b36bce82..0ae3fe0ad 100644 --- a/e2e/paths/route-module/03_tickets.spec.js +++ b/e2e/paths/07-route-module/03_tickets.spec.js @@ -7,19 +7,10 @@ describe('Route basic Data path', () => { beforeAll(() => { nightmare .loginAndModule('delivery', 'route') - .accessToSearchResult(1) + .accessToSearchResult(2) .accessToSection('route.card.tickets'); }); - it('should modify the first ticket priority', async() => { - const result = await nightmare - .write(selectors.routeTickets.firstTicketPriority, 5) - .write('body', '\u000d') // simulates enter - .waitForLastSnackbar(); - - expect(result).toEqual('Data saved!'); - }); - it('should now modify the first ticket priority', async() => { const result = await nightmare .write(selectors.routeTickets.firstTicketPriority, 4) @@ -85,13 +76,6 @@ describe('Route basic Data path', () => { expect(result).toEqual('4'); }); - it('should confirm the fifth ticket priority', async() => { - const result = await nightmare - .waitToGetProperty(selectors.routeTickets.fifthTicketPriority, 'value'); - - expect(result).toEqual('5'); - }); - it('should confirm the buscamanButton is disabled', async() => { const result = await nightmare .evaluate(selector => { @@ -115,7 +99,7 @@ describe('Route basic Data path', () => { const result = await nightmare .countElement('vn-route-tickets vn-textfield[model="ticket.priority"]'); - expect(result).toEqual(5); + expect(result).toEqual(4); }); it('should delete the first ticket in route', async() => { @@ -131,6 +115,6 @@ describe('Route basic Data path', () => { const result = await nightmare .countElement('vn-route-tickets vn-textfield[model="ticket.priority"]'); - expect(result).toEqual(4); + expect(result).toEqual(3); }); }); From 50d70f0f6f034e01085ddcbbf5d3909eb67edb78 Mon Sep 17 00:00:00 2001 From: jgallego Date: Wed, 10 Apr 2019 14:44:41 +0200 Subject: [PATCH 10/10] Tarea #1259 crear modelo ticketServiceType --- .../10002-lent/00-ticketServiceType.sql | 13 +++++++++++++ e2e/helpers/selectors.js | 2 +- .../13_create_ticket_services.spec.js | 2 +- modules/ticket/back/model-config.json | 3 +++ .../back/models/ticket-service-type.json | 19 +++++++++++++++++++ modules/ticket/front/services/index.html | 11 ++++++----- 6 files changed, 43 insertions(+), 7 deletions(-) create mode 100644 db/changes/10002-lent/00-ticketServiceType.sql create mode 100644 modules/ticket/back/models/ticket-service-type.json diff --git a/db/changes/10002-lent/00-ticketServiceType.sql b/db/changes/10002-lent/00-ticketServiceType.sql new file mode 100644 index 000000000..5f887a10f --- /dev/null +++ b/db/changes/10002-lent/00-ticketServiceType.sql @@ -0,0 +1,13 @@ +DROP TABLE IF EXISTS `vn`.`ticketServiceType`; + +CREATE TABLE vn.`ticketServiceType` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Lista de los posibles servicios a elegir'; + +INSERT INTO `vn`.`ticketServiceType` (`name`) VALUES ('Porte Agencia'); +INSERT INTO `vn`.`ticketServiceType` (`name`) VALUES ('Portes Retorno'); +INSERT INTO `vn`.`ticketServiceType` (`name`) VALUES ('Porte Carry'); +INSERT INTO `vn`.`ticketServiceType` (`name`) VALUES ('Cargo FITOSANITARIO'); +INSERT INTO `vn`.`ticketServiceType` (`name`) VALUES ('Documentos'); diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 1dd6587df..544ecfb43 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -455,7 +455,7 @@ export default { }, ticketService: { addServiceButton: 'vn-ticket-service > form > vn-card > div > vn-one:nth-child(3) > vn-icon-button > button > vn-icon', - firstDescriptionInput: 'vn-ticket-service vn-textfield[label="Description"] input', + firstDescriptionInput: 'vn-ticket-service vn-autocomplete[label="Documentos"]', firstQuantityInput: 'vn-ticket-service vn-input-number[label="Quantity"] input', firstPriceInput: 'vn-ticket-service vn-input-number[label="Price"] input', firstVatTypeAutocomplete: 'vn-ticket-service vn-autocomplete[label="Tax class"]', diff --git a/e2e/paths/ticket-module/13_create_ticket_services.spec.js b/e2e/paths/ticket-module/13_create_ticket_services.spec.js index 0b1c08463..34bd22a6c 100644 --- a/e2e/paths/ticket-module/13_create_ticket_services.spec.js +++ b/e2e/paths/ticket-module/13_create_ticket_services.spec.js @@ -55,7 +55,7 @@ describe('Ticket services path', () => { expect(result).toEqual('General VAT'); }); - it('should delete the service', async() => { + fit('should delete the service', async() => { const result = await nightmare .waitToClick(selectors.ticketService.fistDeleteServiceButton) .waitForNumberOfElements(selectors.ticketService.serviceLine, 0) diff --git a/modules/ticket/back/model-config.json b/modules/ticket/back/model-config.json index 06ba9bd45..a919827b4 100644 --- a/modules/ticket/back/model-config.json +++ b/modules/ticket/back/model-config.json @@ -56,6 +56,9 @@ "TicketService":{ "dataSource": "vn" }, + "TicketServiceType":{ + "dataSource": "vn" + }, "TicketTracking": { "dataSource": "vn" }, diff --git a/modules/ticket/back/models/ticket-service-type.json b/modules/ticket/back/models/ticket-service-type.json new file mode 100644 index 000000000..a17431644 --- /dev/null +++ b/modules/ticket/back/models/ticket-service-type.json @@ -0,0 +1,19 @@ +{ + "name": "TicketServiceType", + "options": { + "mysql": { + "table": "ticketServiceType" + } + }, + "properties": { + "id": { + "type": "Number", + "id": true, + "description": "Identifier" + }, + "name": { + "type": "String", + "required": true + } + } +} \ No newline at end of file diff --git a/modules/ticket/front/services/index.html b/modules/ticket/front/services/index.html index a4229b435..9f943b7a4 100644 --- a/modules/ticket/front/services/index.html +++ b/modules/ticket/front/services/index.html @@ -14,13 +14,14 @@ - - + show-field="name" + value-field="name" + field="service.description"> +