From cad4f1617a466cfb99f62bff3e5bb10ee1628608 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez <=> Date: Wed, 29 Aug 2018 08:13:54 +0200 Subject: [PATCH 1/7] lint errors corrected --- client/client/src/sample/create/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/client/src/sample/create/index.html b/client/client/src/sample/create/index.html index 871bad5ee..8fdcce50c 100644 --- a/client/client/src/sample/create/index.html +++ b/client/client/src/sample/create/index.html @@ -14,7 +14,7 @@ vn-id="sampleType" field="$ctrl.clientSample.typeFk" model="ClientSample.typeFk" - select-fields=["id","description","code","hasCompany"] + select-fields="['id','description','code','hasCompany']" url="/client/api/Samples" show-field="description" value-field="id" From 072581a0fe8cd8ba6222c91b379ddf3d22d14198 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez <=> Date: Wed, 29 Aug 2018 08:14:18 +0200 Subject: [PATCH 2/7] refactor CR Joan --- client/core/src/components/date-picker/date-picker.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/core/src/components/date-picker/date-picker.html b/client/core/src/components/date-picker/date-picker.html index 60ba189d8..02046843b 100644 --- a/client/core/src/components/date-picker/date-picker.html +++ b/client/core/src/components/date-picker/date-picker.html @@ -12,7 +12,7 @@
clear From 5d6a8f773cc1db920d9f2beee9777082177a35d2 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez <=> Date: Wed, 29 Aug 2018 08:15:23 +0200 Subject: [PATCH 3/7] refactor CR Gerard --- client/core/src/components/textfield/textfield.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/client/core/src/components/textfield/textfield.html b/client/core/src/components/textfield/textfield.html index a730517ac..4f238c525 100644 --- a/client/core/src/components/textfield/textfield.html +++ b/client/core/src/components/textfield/textfield.html @@ -21,11 +21,10 @@
clear From 1b51ab7e6d08e70131e94f49a906fb902440ac1d Mon Sep 17 00:00:00 2001 From: Carlos Jimenez <=> Date: Wed, 29 Aug 2018 08:15:49 +0200 Subject: [PATCH 4/7] refactor CR Joan --- client/core/src/filters/dateTime.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/core/src/filters/dateTime.js b/client/core/src/filters/dateTime.js index 5152ee228..75e629e75 100644 --- a/client/core/src/filters/dateTime.js +++ b/client/core/src/filters/dateTime.js @@ -9,7 +9,9 @@ dateTime.$inject = ['$filter']; export default function dateTime($filter) { return function(input, format) { - return $filter('date')(new Date(input), format); + let value = typeof input === 'string' ? new Date(input) : input; + + return $filter('date')(value, format); }; } ngModule.filter('dateTime', dateTime); From b9cd86af110e224fb5fe8882c1d3f818451ca98d Mon Sep 17 00:00:00 2001 From: Carlos Jimenez <=> Date: Wed, 29 Aug 2018 08:29:54 +0200 Subject: [PATCH 5/7] traducciones --- services/loopback/common/locale/es.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/loopback/common/locale/es.json b/services/loopback/common/locale/es.json index 3536a10b8..f68d6861e 100644 --- a/services/loopback/common/locale/es.json +++ b/services/loopback/common/locale/es.json @@ -41,5 +41,6 @@ "The value should be a number": "El valor debe ser un numero", "This order is not editable": "Esta orden no se puede modificar", "You can't create an order for a frozen client": "No puedes crear una orden para un cliente congelado", - "You can't create an order for a client that has a debt": "No puedes crear una orden para un cliente con deuda" + "You can't create an order for a client that has a debt": "No puedes crear una orden para un cliente con deuda", + "is not a valid date": "No es una fecha valida" } \ No newline at end of file From aff9f57833c6ba58d96074c0d62787ed0083cdaf Mon Sep 17 00:00:00 2001 From: Carlos Jimenez <=> Date: Wed, 29 Aug 2018 09:45:37 +0200 Subject: [PATCH 6/7] #444 claim basic data --- client/claim/routes.json | 12 +++ client/claim/src/basic-data/index.html | 75 +++++++++++++ client/claim/src/basic-data/index.js | 8 ++ client/claim/src/basic-data/locale/es.yml | 6 ++ client/claim/src/card/index.js | 1 - client/claim/src/index.js | 1 + client/claim/src/index/index.html | 2 - client/claim/src/index/index.js | 6 -- .../src/components/input-range/index.html | 8 +- .../core/src/components/input-range/index.js | 71 +++++++++--- .../src/components/input-range/style.scss | 14 +++ services/claim/common/models/claim.json | 13 ++- services/db/install/dump/01-structure.sql | 102 +++++++++--------- services/db/install/dump/fixtures.sql | 6 +- 14 files changed, 241 insertions(+), 84 deletions(-) create mode 100644 client/claim/src/basic-data/index.html create mode 100644 client/claim/src/basic-data/index.js create mode 100644 client/claim/src/basic-data/locale/es.yml diff --git a/client/claim/routes.json b/client/claim/routes.json index 3d0af1acf..7cb4be051 100644 --- a/client/claim/routes.json +++ b/client/claim/routes.json @@ -33,6 +33,18 @@ "claim": "$ctrl.claim" } }, + { + "url": "/basic-data", + "state": "claim.card.basicData", + "component": "vn-claim-basic-data", + "description": "Basic data", + "params": { + "claim": "$ctrl.claim" + }, + "menu": { + "icon": "settings" + } + }, { "url": "/detail", "state": "claim.card.detail", diff --git a/client/claim/src/basic-data/index.html b/client/claim/src/basic-data/index.html new file mode 100644 index 000000000..ea4d5f6b5 --- /dev/null +++ b/client/claim/src/basic-data/index.html @@ -0,0 +1,75 @@ + + +
+ + Basic data + + + + + {{firstName}} {{name}} + + + + + + + + + + + + + + + + + + + + + +
diff --git a/client/claim/src/basic-data/index.js b/client/claim/src/basic-data/index.js new file mode 100644 index 000000000..6d350f7b6 --- /dev/null +++ b/client/claim/src/basic-data/index.js @@ -0,0 +1,8 @@ +import ngModule from '../module'; + +ngModule.component('vnClaimBasicData', { + template: require('./index.html'), + bindings: { + claim: '<' + } +}); diff --git a/client/claim/src/basic-data/locale/es.yml b/client/claim/src/basic-data/locale/es.yml new file mode 100644 index 000000000..221b17cdc --- /dev/null +++ b/client/claim/src/basic-data/locale/es.yml @@ -0,0 +1,6 @@ +Contact: Contacto +Claim state: Estado de la reclamación +Is paid with mana: Cargado al maná +Responsability: Responsabilidad +Company: Empresa +Sales/Client: Comercial/Cliente \ No newline at end of file diff --git a/client/claim/src/card/index.js b/client/claim/src/card/index.js index f77834148..59692f6f6 100644 --- a/client/claim/src/card/index.js +++ b/client/claim/src/card/index.js @@ -7,7 +7,6 @@ class Controller { this.order = {}; this.filter = { include: [ - {relation: 'claimResponsible', scope: {fields: ['description', 'responsability']}}, {relation: 'worker', scope: {fields: ['name', 'firstName']}}, {relation: 'claimState', scope: {fields: ['id', 'description']}}, { diff --git a/client/claim/src/index.js b/client/claim/src/index.js index e3775c5d3..54099a5ba 100644 --- a/client/claim/src/index.js +++ b/client/claim/src/index.js @@ -3,4 +3,5 @@ export * from './module'; import './index/'; import './card'; import './descriptor'; +import './basic-data'; // import './summary'; diff --git a/client/claim/src/index/index.html b/client/claim/src/index/index.html index 281c38b88..399111f32 100644 --- a/client/claim/src/index/index.html +++ b/client/claim/src/index/index.html @@ -26,7 +26,6 @@ Created Worker Observation - Responsible State @@ -39,7 +38,6 @@ {{::claim.created | date:'dd/MM/yyyy'}} {{::claim.worker.firstName}} {{::claim.worker.name}} {{::claim.observation}} - {{::claim.claimResponsible.description}} {{::claim.claimState.description}} - + + + +
\ No newline at end of file diff --git a/client/core/src/components/input-range/index.js b/client/core/src/components/input-range/index.js index 83a46d98b..c3c0c37da 100644 --- a/client/core/src/components/input-range/index.js +++ b/client/core/src/components/input-range/index.js @@ -2,30 +2,71 @@ import ngModule from '../../module'; import Input from '../../lib/input'; import './style.scss'; -export default class InputRange extends Input { - constructor($element, $scope, $attrs, vnTemplate, $transclude) { +export default class inputRange extends Input { + constructor($element, $scope) { super($element, $scope); + this.mdlElement = this.element.querySelector('.mdl-slider'); + componentHandler.upgradeElement(this.mdlElement); + this.mdlElement.addEventListener('change', () => { + this._value = this.input.value; + this.$.$applyAsync(); + }); + } + + get value() { + return this._value; + } + + set value(value) { + this._value = value; + this.mdlElement.MaterialSlider.change(value); + } + + get max() { + return this.input.max; + } + + set max(value) { + this.input.max = value; + } + + get min() { + return this.input.min; + } + + set min(value) { + this.input.min = value; + } + + get step() { + return this.input.step; + } + + set step(value) { + this.input.step = value; + } + + get() { + return this._model; + } + + set model(value) { + this._model = value; } } -InputRange.$inject = ['$element', '$scope', '$attrs', '$transclude']; +inputRange.$inject = ['$element', '$scope']; ngModule.component('vnInputRange', { template: require('./index.html'), -/* transclude: { - leftIcons: '?tLeftIcons', - rightIcons: '?tRightIcons' - }, */ - controller: InputRange, + controller: inputRange, bindings: { -/* value: '=model', label: '@?', - name: '@?', disabled: ' vCurrentCount AND - vIsAlreadyNotified = TRUE - THEN - UPDATE printingQueueCheck SET isAlreadyNotified = FALSE; - END IF; - - UPDATE printingQueueCheck - SET lastCount = vCurrentCount, - lastCheckSum = vCheckSum; +/*!50106 CREATE*/ /*!50117 DEFINER=`z-developer`@`%`*/ /*!50106 EVENT `printingQueueChecker` ON SCHEDULE EVERY 10 MINUTE STARTS '2018-05-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN + + DECLARE vCurrentCount INT; + DECLARE vCheckSum INT; + DECLARE vIsAlreadyNotified BOOLEAN; + + SELECT COUNT(*), SUM(id) INTO vCurrentCount, vCheckSum + FROM printingQueue WHERE state = 1; + + SELECT isAlreadyNotified INTO vIsAlreadyNotified + FROM printingQueueCheck; + + IF (SELECT lastCount FROM printingQueueCheck) = vCurrentCount AND + (SELECT lastCheckSum FROM printingQueueCheck) = vCheckSum AND + vIsAlreadyNotified = FALSE + THEN + INSERT INTO vn2008.mail (`to`, subject, text) + VALUES ('cau@verdnatura.es', + 'servidor de impresion parado', + CONCAT('Hay ', vCurrentCount, ' lineas bloqueadas')); + UPDATE printingQueueCheck SET isAlreadyNotified = TRUE; + END IF; + + IF (SELECT lastCount FROM printingQueueCheck) > vCurrentCount AND + vIsAlreadyNotified = TRUE + THEN + UPDATE printingQueueCheck SET isAlreadyNotified = FALSE; + END IF; + + UPDATE printingQueueCheck + SET lastCount = vCurrentCount, + lastCheckSum = vCheckSum; END */ ;; /*!50003 SET time_zone = @saved_time_zone */ ;; /*!50003 SET sql_mode = @saved_sql_mode */ ;; @@ -71331,15 +71335,15 @@ DELIMITER ; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`%` PROCEDURE `myTicketGetRows`(`vTicket` INT) -BEGIN - - SELECT r.itemFk, r.quantity, r.concept, r.price, r.discount, - i.image, i.category, i.size, i.stems, i.inkFk, - i.tag5, i.value5, i.tag6, i.value6, i.tag7, i.value7 - FROM myTicketRow r - JOIN vn.item i ON i.id = r.itemFk - WHERE r.ticketFk = vTicket - ORDER BY r.concept; +BEGIN + + SELECT r.itemFk, r.quantity, r.concept, r.price, r.discount, + i.image, i.category, i.size, i.stems, i.inkFk, + i.tag5, i.value5, i.tag6, i.value6, i.tag7, i.value7 + FROM myTicketRow r + JOIN vn.item i ON i.id = r.itemFk + WHERE r.ticketFk = vTicket + ORDER BY r.concept; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -75226,7 +75230,7 @@ USE `vn`; /*!50001 SET collation_connection = utf8_general_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`%` SQL SECURITY DEFINER */ -/*!50001 VIEW `claim` AS select `c`.`id` AS `id`,`c`.`Fecha` AS `ticketCreated`,`c`.`cl_est_id` AS `claimStateFk`,`c`.`notas` AS `observation`,`c`.`Id_Cliente` AS `clientFk`,`c`.`Id_Trabajador` AS `workerFk`,`c`.`sensib` AS `claimResponsibleFk`,`c`.`mana` AS `isChargedToMana`,`c`.`odbc_date` AS `created` from `vn2008`.`cl_main` `c` */; +/*!50001 VIEW `claim` AS select `c`.`id` AS `id`,`c`.`Fecha` AS `ticketCreated`,`c`.`cl_est_id` AS `claimStateFk`,`c`.`notas` AS `observation`,`c`.`Id_Cliente` AS `clientFk`,`c`.`Id_Trabajador` AS `workerFk`,`c`.`sensib` AS `responsibility`,`c`.`mana` AS `isChargedToMana`,`c`.`odbc_date` AS `created` from `vn2008`.`cl_main` `c` */; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; diff --git a/services/db/install/dump/fixtures.sql b/services/db/install/dump/fixtures.sql index db9ede044..9ed2fff65 100644 --- a/services/db/install/dump/fixtures.sql +++ b/services/db/install/dump/fixtures.sql @@ -809,10 +809,10 @@ INSERT INTO `vn`.`clientSample`(`id`, `clientFk`, `typeFk`, `created`, `workerFk ( 4, 102, 2, CURDATE(), 18, 18, 567), ( 5, 102, 3, CURDATE(), 19, 19, 567); -INSERT INTO `vn`.`claim`(`id`, `ticketCreated`, `claimStateFk`, `observation`, `clientFk`, `workerFk`, `claimResponsibleFk`, `isChargedToMana`, `created` ) +INSERT INTO `vn`.`claim`(`id`, `ticketCreated`, `claimStateFk`, `observation`, `clientFk`, `workerFk`, `responsibility`, `isChargedToMana`, `created` ) VALUES - ( 1, CURDATE(), 1, 'observation one' , 101, 18, 3, 0, CURDATE()), - ( 2, CURDATE(), 2, 'observation two' , 101, 18, 3, 0, CURDATE()), + ( 1, CURDATE(), 1, 'observation one' , 101, 18, 1, 0, CURDATE()), + ( 2, CURDATE(), 2, 'observation two' , 101, 18, 2, 0, CURDATE()), ( 3, CURDATE(), 3, 'observation three' , 101, 18, 3, 0, CURDATE()); INSERT INTO `vn`.`claimBeginning`(`id`, `claimFk`, `saleFk`, `quantity`) From 08ef7dee960dbc9e75292194df247c7aa0da9383 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez <=> Date: Wed, 29 Aug 2018 11:43:25 +0200 Subject: [PATCH 7/7] #444 style amends --- client/claim/src/basic-data/index.html | 5 +++-- client/claim/src/basic-data/index.js | 1 + client/claim/src/basic-data/style.scss | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 client/claim/src/basic-data/style.scss diff --git a/client/claim/src/basic-data/index.html b/client/claim/src/basic-data/index.html index ea4d5f6b5..774ebe315 100644 --- a/client/claim/src/basic-data/index.html +++ b/client/claim/src/basic-data/index.html @@ -44,7 +44,8 @@ url="/claim/api/ClaimStates" show-field="description" value-field="id" - label="Claim state" vn-focus> + label="Claim state" + vn-focus> + field="$ctrl.claim.observation"> diff --git a/client/claim/src/basic-data/index.js b/client/claim/src/basic-data/index.js index 6d350f7b6..be5ab2fde 100644 --- a/client/claim/src/basic-data/index.js +++ b/client/claim/src/basic-data/index.js @@ -1,4 +1,5 @@ import ngModule from '../module'; +import './style.scss'; ngModule.component('vnClaimBasicData', { template: require('./index.html'), diff --git a/client/claim/src/basic-data/style.scss b/client/claim/src/basic-data/style.scss new file mode 100644 index 000000000..5f1432879 --- /dev/null +++ b/client/claim/src/basic-data/style.scss @@ -0,0 +1,3 @@ +vn-claim-basic-data vn-date-picker { + padding-left: 5em; +}