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`)