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"
}
},
{
"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",

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.filter = {
include: [
{relation: 'claimResponsible', scope: {fields: ['description', 'responsability']}},
{relation: 'worker', scope: {fields: ['name', 'firstName']}},
{relation: 'claimState', scope: {fields: ['id', 'description']}},
{

View File

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

View File

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

View File

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

View File

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

View File

@ -12,7 +12,7 @@
<div class="mdl-chip__action">
<i
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()">
clear
</i>

View File

@ -1,3 +1,9 @@
<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>

View File

@ -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: '<?',
readonly: '<?',
rule: '@?',
type: '@?',
vnTabIndex: '@?',
onChange: '&' */
min: '<?',
max: '<?',
step: '<?',
value: '=',
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">
<i class="material-icons clear"
translate-attr="{title: 'Clear'}"
ng-class="{visible:
!$ctrl.disabled
ng-show="!$ctrl.disabled
&& $ctrl.hasValue
&& ($ctrl.hasFocus)
&& !$ctrl.unclearable}"
&& !$ctrl.unclearable"
ng-click="$ctrl.clear()">
clear
</i>

View File

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

View File

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

View File

@ -22626,7 +22626,8 @@ DELIMITER ;
DELIMITER ;;
CREATE DEFINER=`root`@`%` PROCEDURE `calling`()
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));
@ -25283,7 +25284,8 @@ BEGIN
-- 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
JOIN Tickets t ON ticket_id = Id_Ticket
JOIN Consignatarios c USING(Id_Consigna)
@ -25317,6 +25319,7 @@ BEGIN
GROUP BY p.name, Id_Ticket
) sub GROUP BY province
ON DUPLICATE KEY UPDATE Faltan = Faltan;
-- Mostramos el resultado
SELECT Provincia, COUNT(Id_Ticket) expediciones, SUM(Bultos) Bultos, SUM(Faltan) Prevision
@ -31855,6 +31858,7 @@ BEGIN
INSERT INTO Mensajes(Mensaje,Fecha,Remitente,Destinatario)
VALUES(memTXT, NOW(),idREM, idDES);
SELECT LAST_INSERT_ID() INTO last_ID;
@ -43405,7 +43409,7 @@ SET character_set_client = utf8;
1 AS `observation`,
1 AS `clientFk`,
1 AS `workerFk`,
1 AS `claimResponsibleFk`,
1 AS `responsibility`,
1 AS `isChargedToMana`,
1 AS `created`*/;
SET character_set_client = @saved_cs_client;
@ -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 */;

View File

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

View File

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