Merge branch 'dev' of https://git.verdnatura.es/salix into dev

This commit is contained in:
gerard 2018-08-29 12:44:15 +02:00
commit 52291dee68
20 changed files with 255 additions and 91 deletions

View File

@ -33,6 +33,18 @@
"claim": "$ctrl.claim" "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", "url": "/detail",
"state": "claim.card.detail", "state": "claim.card.detail",

View File

@ -0,0 +1,76 @@
<vn-watcher
vn-id="watcher"
data="$ctrl.claim"
id-field="id"
form="form"
url="/claim/api/Claims"
save="patch">
</vn-watcher>
<form name="form" ng-submit="watcher.submit()">
<vn-card pad-large>
<vn-title>Basic data</vn-title>
<vn-horizontal>
<vn-autocomplete
vn-one
disabled="true"
field="$ctrl.claim.clientFk"
url="/client/api/Clients"
show-field="name"
value-field="id"
label="Client">
</vn-autocomplete>
<vn-autocomplete
vn-one
disabled="true"
field="$ctrl.claim.workerFk"
url="/client/api/Workers"
select-fields="['firstName', 'name']"
value-field="id"
label="Worker">
<tpl-item>{{firstName}} {{name}}</tpl-item>
</vn-autocomplete>
<vn-date-picker
vn-one
enabled="false"
label="Created"
model="$ctrl.claim.created"
ini-options="{enableTime: true, dateFormat: 'd-m-Y', time_24hr: true}">
</vn-date-picker>
</vn-horizontal>
<vn-horizontal pad-small-v>
<vn-autocomplete
vn-one
field="$ctrl.claim.claimStateFk"
url="/claim/api/ClaimStates"
show-field="description"
value-field="id"
label="Claim state"
vn-focus>
</vn-autocomplete>
<vn-check
vn-one
label="Is paid with mana"
field="$ctrl.claim.isChargedToMana">
</vn-check>
<vn-input-range
vn-one
label="Responsability"
value="$ctrl.claim.responsibility"
max="4"
min="0"
step="1">
</vn-input-range>
</vn-horizontal>
</vn-horizontal>
<vn-horizontal pad-small-v>
<vn-textarea
vn-three
label="Observation"
field="$ctrl.claim.observation">
</vn-textarea>
</vn-horizontal>
</vn-card>
<vn-button-bar>
<vn-submit label="Save"></vn-submit>
</vn-button-bar>
</form>

View File

@ -0,0 +1,9 @@
import ngModule from '../module';
import './style.scss';
ngModule.component('vnClaimBasicData', {
template: require('./index.html'),
bindings: {
claim: '<'
}
});

View File

@ -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

View File

@ -0,0 +1,3 @@
vn-claim-basic-data vn-date-picker {
padding-left: 5em;
}

View File

@ -7,7 +7,6 @@ class Controller {
this.order = {}; this.order = {};
this.filter = { this.filter = {
include: [ include: [
{relation: 'claimResponsible', scope: {fields: ['description', 'responsability']}},
{relation: 'worker', scope: {fields: ['name', 'firstName']}}, {relation: 'worker', scope: {fields: ['name', 'firstName']}},
{relation: 'claimState', scope: {fields: ['id', 'description']}}, {relation: 'claimState', scope: {fields: ['id', 'description']}},
{ {

View File

@ -3,4 +3,5 @@ export * from './module';
import './index/'; import './index/';
import './card'; import './card';
import './descriptor'; import './descriptor';
import './basic-data';
// import './summary'; // import './summary';

View File

@ -26,7 +26,6 @@
<vn-th field="created">Created</vn-th> <vn-th field="created">Created</vn-th>
<vn-th field="workerFk">Worker</vn-th> <vn-th field="workerFk">Worker</vn-th>
<vn-th field="observation">Observation</vn-th> <vn-th field="observation">Observation</vn-th>
<vn-th field="claimResponsibleFk">Responsible</vn-th>
<vn-th field="claimStateFk">State</vn-th> <vn-th field="claimStateFk">State</vn-th>
<vn-th></vn-th> <vn-th></vn-th>
</vn-tr> </vn-tr>
@ -39,7 +38,6 @@
<vn-td>{{::claim.created | date:'dd/MM/yyyy'}}</vn-td> <vn-td>{{::claim.created | date:'dd/MM/yyyy'}}</vn-td>
<vn-td>{{::claim.worker.firstName}} {{::claim.worker.name}}</vn-td> <vn-td>{{::claim.worker.firstName}} {{::claim.worker.name}}</vn-td>
<vn-td>{{::claim.observation}}</vn-td> <vn-td>{{::claim.observation}}</vn-td>
<vn-td>{{::claim.claimResponsible.description}}</vn-td>
<vn-td>{{::claim.claimState.description}}</vn-td> <vn-td>{{::claim.claimState.description}}</vn-td>
<vn-td> <vn-td>
<vn-icon-button <vn-icon-button

View File

@ -19,12 +19,6 @@ export default class Controller {
fields: ['firstName', 'name'] fields: ['firstName', 'name']
} }
}, },
{
relation: 'claimResponsible',
scope: {
fields: ['description']
}
},
{ {
relation: 'claimState', relation: 'claimState',
scope: { scope: {

View File

@ -14,7 +14,7 @@
vn-id="sampleType" vn-id="sampleType"
field="$ctrl.clientSample.typeFk" field="$ctrl.clientSample.typeFk"
model="ClientSample.typeFk" model="ClientSample.typeFk"
select-fields=["id","description","code","hasCompany"] select-fields="['id','description','code','hasCompany']"
url="/client/api/Samples" url="/client/api/Samples"
show-field="description" show-field="description"
value-field="id" value-field="id"

View File

@ -12,7 +12,7 @@
<div class="mdl-chip__action"> <div class="mdl-chip__action">
<i <i
class="material-icons pointer" class="material-icons pointer"
ng-show="$ctrl.model && ($ctrl.hasFocus || $ctrl.hasMouseIn)" ng-show="$ctrl.enabled && $ctrl.model && ($ctrl.hasFocus || $ctrl.hasMouseIn)"
ng-click="$ctrl.onClear()"> ng-click="$ctrl.onClear()">
clear clear
</i> </i>

View File

@ -1,3 +1,9 @@
<div> <div>
<input type="range"> <label translate>{{::$ctrl.label}}</label>
<input
name="{{$ctrl.name}}"
class="mdl-slider mdl-js-slider"
type="range"/>
<label class="min-label" translate>Company</label>
<label class="max-label" translate>Sales/Client</label>
</div> </div>

View File

@ -2,30 +2,71 @@ import ngModule from '../../module';
import Input from '../../lib/input'; import Input from '../../lib/input';
import './style.scss'; import './style.scss';
export default class InputRange extends Input { export default class inputRange extends Input {
constructor($element, $scope, $attrs, vnTemplate, $transclude) { constructor($element, $scope) {
super($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', { ngModule.component('vnInputRange', {
template: require('./index.html'), template: require('./index.html'),
/* transclude: { controller: inputRange,
leftIcons: '?tLeftIcons',
rightIcons: '?tRightIcons'
}, */
controller: InputRange,
bindings: { bindings: {
/* value: '=model',
label: '@?', label: '@?',
name: '@?',
disabled: '<?', disabled: '<?',
readonly: '<?', min: '<?',
rule: '@?', max: '<?',
type: '@?', step: '<?',
vnTabIndex: '@?', value: '=',
onChange: '&' */ model: '='
} }
}); });

View File

@ -0,0 +1,14 @@
@import 'colors';
vn-input-range {
label {
color: $main-01;
font-size: 12px;
padding: 0 25px;
}
label.min-label, label.max-label {
color: $main-font-color;
}
label.max-label {
float: right;
}
}

View File

@ -21,11 +21,10 @@
<div class="suffix"> <div class="suffix">
<i class="material-icons clear" <i class="material-icons clear"
translate-attr="{title: 'Clear'}" translate-attr="{title: 'Clear'}"
ng-class="{visible: ng-show="!$ctrl.disabled
!$ctrl.disabled
&& $ctrl.hasValue && $ctrl.hasValue
&& ($ctrl.hasFocus) && ($ctrl.hasFocus)
&& !$ctrl.unclearable}" && !$ctrl.unclearable"
ng-click="$ctrl.clear()"> ng-click="$ctrl.clear()">
clear clear
</i> </i>

View File

@ -9,7 +9,9 @@ dateTime.$inject = ['$filter'];
export default function dateTime($filter) { export default function dateTime($filter) {
return function(input, format) { 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); ngModule.filter('dateTime', dateTime);

View File

@ -21,12 +21,16 @@
"required": true "required": true
}, },
"isChargedToMana": { "isChargedToMana": {
"type": "Number", "type": "boolean",
"required": true "required": true
}, },
"created": { "created": {
"type": "date", "type": "date",
"required": true "required": true
},
"responsibility": {
"type": "Number",
"required": true
} }
}, },
"relations": { "relations": {
@ -44,11 +48,6 @@
"type": "belongsTo", "type": "belongsTo",
"model": "Worker", "model": "Worker",
"foreignKey": "workerFk" "foreignKey": "workerFk"
}, }
"claimResponsible": {
"type": "belongsTo",
"model": "ClaimResponsible",
"foreignKey": "claimResponsibleFk"
}
} }
} }

View File

@ -17197,7 +17197,7 @@ BEGIN
DECLARE datINV DATE; DECLARE datINV DATE;
SELECT FechaInventario INTO datINV FROM tblContadores; SELECT FechaInventario INTO datINV FROM tblContadores;
ALTER TABLE `article_inventory` ALTER TABLE `article_inventory`
ADD `buy_date` datetime NOT NULL; ADD `buy_date` datetime NOT NULL;
UPDATE article_inventory INNER JOIN UPDATE article_inventory INNER JOIN
@ -17224,7 +17224,7 @@ BEGIN
GROUP BY article_id GROUP BY article_id
) )
AS buy ON article_inventory.article_id = buy.article_id AS buy ON article_inventory.article_id = buy.article_id
SET article_inventory.buy_date = buy.bdate; SET article_inventory.buy_date = buy.bdate;
END ;; END ;;
DELIMITER ; DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ; /*!50003 SET sql_mode = @saved_sql_mode */ ;
@ -22626,7 +22626,8 @@ DELIMITER ;
DELIMITER ;; DELIMITER ;;
CREATE DEFINER=`root`@`%` PROCEDURE `calling`() CREATE DEFINER=`root`@`%` PROCEDURE `calling`()
BEGIN BEGIN
DROP TEMPORARY TABLE IF EXISTS Agenda, Agenda2;
DROP TEMPORARY TABLE IF EXISTS Agenda, Agenda2;
CREATE TEMPORARY TABLE IF NOT EXISTS Agenda (Telefono varchar(15) PRIMARY KEY, Cliente VARCHAR(45)); CREATE TEMPORARY TABLE IF NOT EXISTS Agenda (Telefono varchar(15) PRIMARY KEY, Cliente VARCHAR(45));
@ -25283,7 +25284,8 @@ BEGIN
-- Insertamos los tickets que ya tienen expediciones, que fallaran si se repite la clave primaria. -- Insertamos los tickets que ya tienen expediciones, que fallaran si se repite la clave primaria.
INSERT INTO zeleVOL(Provincia, Id_Ticket, Bultos) SELECT p.name, e.ticket_id, COUNT(e.ticket_id) INSERT INTO zeleVOL(Provincia, Id_Ticket, Bultos)
SELECT p.name, e.ticket_id, COUNT(e.ticket_id)
FROM expeditions e FROM expeditions e
JOIN Tickets t ON ticket_id = Id_Ticket JOIN Tickets t ON ticket_id = Id_Ticket
JOIN Consignatarios c USING(Id_Consigna) JOIN Consignatarios c USING(Id_Consigna)
@ -25317,7 +25319,8 @@ BEGIN
GROUP BY p.name, Id_Ticket GROUP BY p.name, Id_Ticket
) sub GROUP BY province ) sub GROUP BY province
ON DUPLICATE KEY UPDATE Faltan = Faltan; ON DUPLICATE KEY UPDATE Faltan = Faltan;
-- Mostramos el resultado
-- Mostramos el resultado
SELECT Provincia, COUNT(Id_Ticket) expediciones, SUM(Bultos) Bultos, SUM(Faltan) Prevision SELECT Provincia, COUNT(Id_Ticket) expediciones, SUM(Bultos) Bultos, SUM(Faltan) Prevision
FROM zeleVOL FROM zeleVOL
@ -31855,7 +31858,8 @@ BEGIN
INSERT INTO Mensajes(Mensaje,Fecha,Remitente,Destinatario) INSERT INTO Mensajes(Mensaje,Fecha,Remitente,Destinatario)
VALUES(memTXT, NOW(),idREM, idDES); VALUES(memTXT, NOW(),idREM, idDES);
SELECT LAST_INSERT_ID() INTO last_ID;
SELECT LAST_INSERT_ID() INTO last_ID;
INSERT INTO Incidencias(Incidencia,Id_Trabajador,Destino,Fecha,Fecha_Mod) INSERT INTO Incidencias(Incidencia,Id_Trabajador,Destino,Fecha,Fecha_Mod)
@ -43405,7 +43409,7 @@ SET character_set_client = utf8;
1 AS `observation`, 1 AS `observation`,
1 AS `clientFk`, 1 AS `clientFk`,
1 AS `workerFk`, 1 AS `workerFk`,
1 AS `claimResponsibleFk`, 1 AS `responsibility`,
1 AS `isChargedToMana`, 1 AS `isChargedToMana`,
1 AS `created`*/; 1 AS `created`*/;
SET character_set_client = @saved_cs_client; SET character_set_client = @saved_cs_client;
@ -48227,38 +48231,38 @@ DELIMITER ;;
/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;; /*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;; /*!50003 SET time_zone = 'SYSTEM' */ ;;
/*!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 /*!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 vCurrentCount INT;
DECLARE vCheckSum INT; DECLARE vCheckSum INT;
DECLARE vIsAlreadyNotified BOOLEAN; DECLARE vIsAlreadyNotified BOOLEAN;
SELECT COUNT(*), SUM(id) INTO vCurrentCount, vCheckSum SELECT COUNT(*), SUM(id) INTO vCurrentCount, vCheckSum
FROM printingQueue WHERE state = 1; FROM printingQueue WHERE state = 1;
SELECT isAlreadyNotified INTO vIsAlreadyNotified SELECT isAlreadyNotified INTO vIsAlreadyNotified
FROM printingQueueCheck; FROM printingQueueCheck;
IF (SELECT lastCount FROM printingQueueCheck) = vCurrentCount AND IF (SELECT lastCount FROM printingQueueCheck) = vCurrentCount AND
(SELECT lastCheckSum FROM printingQueueCheck) = vCheckSum AND (SELECT lastCheckSum FROM printingQueueCheck) = vCheckSum AND
vIsAlreadyNotified = FALSE vIsAlreadyNotified = FALSE
THEN THEN
INSERT INTO vn2008.mail (`to`, subject, text) INSERT INTO vn2008.mail (`to`, subject, text)
VALUES ('cau@verdnatura.es', VALUES ('cau@verdnatura.es',
'servidor de impresion parado', 'servidor de impresion parado',
CONCAT('Hay ', vCurrentCount, ' lineas bloqueadas')); CONCAT('Hay ', vCurrentCount, ' lineas bloqueadas'));
UPDATE printingQueueCheck SET isAlreadyNotified = TRUE; UPDATE printingQueueCheck SET isAlreadyNotified = TRUE;
END IF; END IF;
IF (SELECT lastCount FROM printingQueueCheck) > vCurrentCount AND IF (SELECT lastCount FROM printingQueueCheck) > vCurrentCount AND
vIsAlreadyNotified = TRUE vIsAlreadyNotified = TRUE
THEN THEN
UPDATE printingQueueCheck SET isAlreadyNotified = FALSE; UPDATE printingQueueCheck SET isAlreadyNotified = FALSE;
END IF; END IF;
UPDATE printingQueueCheck UPDATE printingQueueCheck
SET lastCount = vCurrentCount, SET lastCount = vCurrentCount,
lastCheckSum = vCheckSum; lastCheckSum = vCheckSum;
END */ ;; END */ ;;
/*!50003 SET time_zone = @saved_time_zone */ ;; /*!50003 SET time_zone = @saved_time_zone */ ;;
/*!50003 SET sql_mode = @saved_sql_mode */ ;; /*!50003 SET sql_mode = @saved_sql_mode */ ;;
@ -71331,15 +71335,15 @@ DELIMITER ;
/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;; DELIMITER ;;
CREATE DEFINER=`root`@`%` PROCEDURE `myTicketGetRows`(`vTicket` INT) CREATE DEFINER=`root`@`%` PROCEDURE `myTicketGetRows`(`vTicket` INT)
BEGIN BEGIN
SELECT r.itemFk, r.quantity, r.concept, r.price, r.discount, SELECT r.itemFk, r.quantity, r.concept, r.price, r.discount,
i.image, i.category, i.size, i.stems, i.inkFk, i.image, i.category, i.size, i.stems, i.inkFk,
i.tag5, i.value5, i.tag6, i.value6, i.tag7, i.value7 i.tag5, i.value5, i.tag6, i.value6, i.tag7, i.value7
FROM myTicketRow r FROM myTicketRow r
JOIN vn.item i ON i.id = r.itemFk JOIN vn.item i ON i.id = r.itemFk
WHERE r.ticketFk = vTicket WHERE r.ticketFk = vTicket
ORDER BY r.concept; ORDER BY r.concept;
END ;; END ;;
DELIMITER ; DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ; /*!50003 SET sql_mode = @saved_sql_mode */ ;
@ -75226,7 +75230,7 @@ USE `vn`;
/*!50001 SET collation_connection = utf8_general_ci */; /*!50001 SET collation_connection = utf8_general_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`%` SQL SECURITY DEFINER */ /*!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_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */; /*!50001 SET collation_connection = @saved_col_connection */;

View File

@ -809,10 +809,10 @@ INSERT INTO `vn`.`clientSample`(`id`, `clientFk`, `typeFk`, `created`, `workerFk
( 4, 102, 2, CURDATE(), 18, 18, 567), ( 4, 102, 2, CURDATE(), 18, 18, 567),
( 5, 102, 3, CURDATE(), 19, 19, 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 VALUES
( 1, CURDATE(), 1, 'observation one' , 101, 18, 3, 0, CURDATE()), ( 1, CURDATE(), 1, 'observation one' , 101, 18, 1, 0, CURDATE()),
( 2, CURDATE(), 2, 'observation two' , 101, 18, 3, 0, CURDATE()), ( 2, CURDATE(), 2, 'observation two' , 101, 18, 2, 0, CURDATE()),
( 3, CURDATE(), 3, 'observation three' , 101, 18, 3, 0, CURDATE()); ( 3, CURDATE(), 3, 'observation three' , 101, 18, 3, 0, CURDATE());
INSERT INTO `vn`.`claimBeginning`(`id`, `claimFk`, `saleFk`, `quantity`) INSERT INTO `vn`.`claimBeginning`(`id`, `claimFk`, `saleFk`, `quantity`)

View File

@ -41,5 +41,6 @@
"The value should be a number": "El valor debe ser un numero", "The value should be a number": "El valor debe ser un numero",
"This order is not editable": "Esta orden no se puede modificar", "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 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"
} }