Merge branch 'dev' into 7457-orderFilter

This commit is contained in:
Pablo Natek 2024-11-15 06:17:04 +00:00
commit d8e728e823
204 changed files with 2233 additions and 10033 deletions

View File

@ -39,6 +39,9 @@ module.exports = Self => {
const xmlString = response.data;
const parser = new DOMParser();
const xmlDoc = parser.parseFromString(xmlString, 'text/xml');
await Self.rawSql('CALL util.debugAdd(?,?);', ['cancelShipment', xmlDoc]);
const result = xmlDoc.getElementsByTagName('Mensaje')[0].textContent;
return result.toLowerCase().includes('se ha cancelado correctamente');
};

View File

@ -139,6 +139,12 @@
"StarredModule": {
"dataSource": "vn"
},
"SaySimpleCountry": {
"dataSource": "vn"
},
"SaySimpleConfig": {
"dataSource": "vn"
},
"TempContainer": {
"dataSource": "tempStorage"
},

View File

@ -44,6 +44,11 @@
"type": "belongsTo",
"model": "Continent",
"foreignKey": "continentFk"
},
"saySimpleCountry": {
"type": "hasOne",
"model": "SaySimpleCountry",
"foreignKey": "countryFk"
}
},
"acls": [
@ -54,4 +59,4 @@
"permission": "ALLOW"
}
]
}
}

View File

@ -0,0 +1,29 @@
{
"name": "SaySimpleConfig",
"base": "VnModel",
"options": {
"mysql": {
"table": "saySimpleConfig"
}
},
"properties": {
"id": {
"type": "number",
"id": true
},
"url": {
"type": "string"
},
"defaultChannel": {
"type": "number"
}
},
"acls": [
{
"accessType": "READ",
"principalType": "ROLE",
"principalId": "$authenticated",
"permission": "ALLOW"
}
]
}

View File

@ -0,0 +1,26 @@
{
"name": "SaySimpleCountry",
"base": "VnModel",
"options": {
"mysql": {
"table": "saySimpleCountry"
}
},
"properties": {
"countryFk": {
"type": "number",
"id": true
},
"channel": {
"type": "number"
}
},
"acls": [
{
"accessType": "READ",
"principalType": "ROLE",
"principalId": "$authenticated",
"permission": "ALLOW"
}
]
}

View File

@ -4,7 +4,7 @@ USE `util`;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
INSERT INTO `version` VALUES ('vn-database','11278','fe10f03459a153fc213bf64e352804c043f94590','2024-10-03 07:47:47','11281');
INSERT INTO `version` VALUES ('vn-database','11311','315864403260623fede9f0471ef3d9036faf23b1','2024-11-12 08:00:59','11336');
INSERT INTO `versionLog` VALUES ('vn-database','10107','00-firstScript.sql','jenkins@10.0.2.69','2022-04-23 10:53:53',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','10112','00-firstScript.sql','jenkins@10.0.2.69','2022-05-09 09:14:53',NULL,NULL);
@ -988,6 +988,7 @@ INSERT INTO `versionLog` VALUES ('vn-database','11194','00-firstScript.sql','jen
INSERT INTO `versionLog` VALUES ('vn-database','11195','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-09-03 08:58:01',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11196','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-09-18 07:28:14',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11197','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-09-03 08:58:01',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11198','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-12 07:42:49',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11201','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-08-27 13:04:26',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11204','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-09-03 08:58:01',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11205','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-09-04 13:54:55',NULL,NULL);
@ -1013,6 +1014,7 @@ INSERT INTO `versionLog` VALUES ('vn-database','11225','01-firstScript.sql','jen
INSERT INTO `versionLog` VALUES ('vn-database','11225','02-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-10-03 07:47:41',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11227','00-addWorkerTimeControlMailAcl.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-10-03 07:47:41',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11229','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-09-16 08:24:17',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11230','00-addClientObservationType.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-12 07:42:52',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11234','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-10-03 07:47:42',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11235','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-10-03 07:47:43',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11236','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-10-03 07:47:43',NULL,NULL);
@ -1021,18 +1023,53 @@ INSERT INTO `versionLog` VALUES ('vn-database','11237','00-firstScript.sql','jen
INSERT INTO `versionLog` VALUES ('vn-database','11239','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-09-17 12:57:06',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11240','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-10-03 07:47:43',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11241','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-09-20 09:08:25',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11242','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-12 07:42:52',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11246','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-09-18 12:39:53',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11247','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-09-19 12:10:08',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11248','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-09-23 11:12:17',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11249','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-10-03 07:47:43',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11251','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-12 07:43:38',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11251','01-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-12 07:57:30',NULL,'Connection lost: The server closed the connection.');
INSERT INTO `versionLog` VALUES ('vn-database','11253','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-09-20 14:41:27',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11254','00-thermographTemperature.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-12 08:00:13',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11254','01-thermographFk.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-12 08:00:15',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11255','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-10-03 07:47:43',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11256','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-09-23 12:18:24',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11258','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-12 08:00:15',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11260','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-12 08:00:15',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11261','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-12 08:00:15',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11262','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-10-03 07:47:43',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11263','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-09-27 12:05:32',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11264','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-12 08:00:15',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11271','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-12 08:00:15',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11272','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-12 08:00:15',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11273','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-10-03 10:50:51',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11274','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-12 08:00:16',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11274','00-firstScript2.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-12 08:00:29',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11274','00-firstScript3.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-12 08:00:30',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11274','00-firstScript5.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-12 08:00:35',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11274','00-firstScript6.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-12 08:00:35',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11274','00-firstScript7.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-12 08:00:36',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11277','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-12 08:00:36',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11278','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-10-03 07:47:43',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11279','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-10-02 08:05:24',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11280','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-10-02 08:46:50',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11281','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-12 08:00:36',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11283','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-12 08:00:36',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11284','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-12 08:00:36',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11285','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-12 08:00:37',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11287','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-12 08:00:37',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11288','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-10-10 08:26:34',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11289','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-10-15 07:01:33',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11290','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-12 08:00:37',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11291','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-10-17 09:10:30',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11294','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-12 08:00:37',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11295','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-10-10 08:45:13',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11298','00-closure.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-12 08:00:37',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11300','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-10-18 08:27:05',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11302','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-12 08:00:57',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11308','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-10-23 12:41:55',NULL,NULL);
INSERT INTO `versionLog` VALUES ('vn-database','11311','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-12 08:00:57',NULL,NULL);
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
@ -1407,6 +1444,8 @@ INSERT INTO `roleInherit` VALUES (376,124,21,19336);
INSERT INTO `roleInherit` VALUES (377,47,49,19295);
INSERT INTO `roleInherit` VALUES (378,101,15,19294);
INSERT INTO `roleInherit` VALUES (379,103,121,19294);
INSERT INTO `roleInherit` VALUES (381,119,123,19295);
INSERT INTO `roleInherit` VALUES (382,48,72,783);
INSERT INTO `userPassword` VALUES (1,7,1,0,2,1);
@ -2045,7 +2084,7 @@ INSERT INTO `ACL` VALUES (756,'Route','findOne','READ','ALLOW','ROLE','employee'
INSERT INTO `ACL` VALUES (757,'Route','getRoutesByWorker','READ','ALLOW','ROLE','employee',NULL);
INSERT INTO `ACL` VALUES (758,'Route','canViewAllRoute','READ','ALLOW','ROLE','deliveryAssistant',NULL);
INSERT INTO `ACL` VALUES (759,'Route','cmr','READ','ALLOW','ROLE','employee',NULL);
INSERT INTO `ACL` VALUES (760,'Route','downloadCmrsZip','READ','ALLOW','ROLE','employee',NULL);
INSERT INTO `ACL` VALUES (760,'Cmr','downloadZip','READ','ALLOW','ROLE','employee',NULL);
INSERT INTO `ACL` VALUES (761,'Route','downloadZip','READ','ALLOW','ROLE','employee',NULL);
INSERT INTO `ACL` VALUES (762,'Route','filter','READ','ALLOW','ROLE','employee',NULL);
INSERT INTO `ACL` VALUES (763,'Route','getByWorker','READ','ALLOW','ROLE','employee',NULL);
@ -2174,7 +2213,6 @@ INSERT INTO `ACL` VALUES (892,'WorkerIncome','*','*','ALLOW','ROLE','hr',NULL);
INSERT INTO `ACL` VALUES (893,'PayrollComponent','*','*','ALLOW','ROLE','hr',NULL);
INSERT INTO `ACL` VALUES (894,'Worker','__get__incomes','*','ALLOW','ROLE','hr',NULL);
INSERT INTO `ACL` VALUES (895,'ItemShelvingLog','*','READ','ALLOW','ROLE','production',NULL);
INSERT INTO `ACL` VALUES (897,'WorkerLog','*','READ','ALLOW','ROLE','employee',NULL);
INSERT INTO `ACL` VALUES (901,'WorkerTimeControl','sendMail','WRITE','ALLOW','ROLE','system',NULL);
INSERT INTO `ACL` VALUES (902,'Entry','filter','READ','ALLOW','ROLE','supplier',NULL);
INSERT INTO `ACL` VALUES (903,'Entry','getBuys','READ','ALLOW','ROLE','supplier',NULL);
@ -2190,7 +2228,6 @@ INSERT INTO `ACL` VALUES (912,'Worker','__get__medicalReview','*','ALLOW','ROLE'
INSERT INTO `ACL` VALUES (913,'VnToken','*','READ','ALLOW','ROLE','developer',10578);
INSERT INTO `ACL` VALUES (914,'VnToken','killSession','*','ALLOW','ROLE','developer',10578);
INSERT INTO `ACL` VALUES (915,'ACL','*','WRITE','ALLOW','ROLE','developerBoss',10578);
INSERT INTO `ACL` VALUES (916,'Entry','getBuysCsv','READ','ALLOW','ROLE','supplier',10578);
INSERT INTO `ACL` VALUES (917,'InvoiceOut','refundAndInvoice','WRITE','ALLOW','ROLE','administrative',10578);
INSERT INTO `ACL` VALUES (918,'Worker','__get__descriptor','READ','ALLOW','ROLE','employee',10578);
INSERT INTO `ACL` VALUES (919,'Worker','findById','READ','ALLOW','ROLE','employee',10578);
@ -2212,6 +2249,7 @@ INSERT INTO `ACL` VALUES (935,'BankEntity','*','WRITE','ALLOW','ROLE','financial
INSERT INTO `ACL` VALUES (936,'Device','handleUser','*','ALLOW','ROLE','employee',10578);
INSERT INTO `ACL` VALUES (937,'WorkerTimeControlMail','count','READ','ALLOW','ROLE','employee',10578);
INSERT INTO `ACL` VALUES (938,'Worker','__get__mail','READ','ALLOW','ROLE','hr',10578);
INSERT INTO `ACL` VALUES (939,'Machine','*','*','ALLOW','ROLE','productionBoss',10578);
INSERT INTO `fieldAcl` VALUES (1,'Client','name','update','employee');
INSERT INTO `fieldAcl` VALUES (2,'Client','contact','update','employee');
@ -2407,6 +2445,8 @@ INSERT INTO `claimResponsible` VALUES (22,'Paletizadores',0,'pal');
INSERT INTO `claimResponsible` VALUES (23,'Preparación Previa',0,'pre');
INSERT INTO `claimResponsible` VALUES (24,'Almacén PCA',0,'war');
INSERT INTO `claimResponsible` VALUES (25,'Huelga',0,'str');
INSERT INTO `claimResponsible` VALUES (27,'Prep. por caja',0,'');
INSERT INTO `claimResponsible` VALUES (45,'Negativo',0,'neg');
INSERT INTO `claimReason` VALUES (1,'Prisas',0);
INSERT INTO `claimReason` VALUES (2,'Novato',0);
@ -2449,6 +2489,9 @@ INSERT INTO `claimReason` VALUES (52,'Mala gestión comercial',0);
INSERT INTO `claimReason` VALUES (53,'Mala gestión comprador',0);
INSERT INTO `claimReason` VALUES (54,'A2',0);
INSERT INTO `claimReason` VALUES (55,'Entrega 48h o más',0);
INSERT INTO `claimReason` VALUES (56,'Error cliente',0);
INSERT INTO `claimReason` VALUES (57,'A2/B1',0);
INSERT INTO `claimReason` VALUES (58,'Seguro',0);
INSERT INTO `claimRedelivery` VALUES (1,'Cliente');
INSERT INTO `claimRedelivery` VALUES (2,'No dev./No especif.');
@ -2456,6 +2499,7 @@ INSERT INTO `claimRedelivery` VALUES (3,'Reparto');
INSERT INTO `claimRedelivery` VALUES (4,'Agencia');
INSERT INTO `claimRedelivery` VALUES (5,'Tour');
INSERT INTO `claimRedelivery` VALUES (6,'Fuera Peninsula');
INSERT INTO `claimRedelivery` VALUES (7,'Francia');
INSERT INTO `claimResult` VALUES (1,'Otros daños');
INSERT INTO `claimResult` VALUES (2,'Roces');
@ -2533,39 +2577,39 @@ INSERT INTO `continent` VALUES (3,'África','AF');
INSERT INTO `continent` VALUES (4,'Europa','EU');
INSERT INTO `continent` VALUES (5,'Oceanía','OC');
INSERT INTO `department` VALUES (1,'VN','VERDNATURA',1,114,763,0,0,0,0,26,NULL,'/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (1,'VN','VERDNATURA',1,116,763,0,0,0,0,26,NULL,'/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (22,'shopping','COMPRAS',2,5,NULL,72,0,0,1,1,1,'/1/',NULL,1,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (23,'CMA','CAMARA',15,16,NULL,72,1,1,2,0,37,'/1/37/',NULL,0,NULL,0,1,1,1,NULL,NULL,NULL,'PREVIOUS');
INSERT INTO `department` VALUES (31,'it','INFORMATICA',6,7,NULL,72,0,0,1,0,1,'/1/','informatica-cau',1,NULL,1,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (34,'accounting','CONTABILIDAD',8,9,NULL,0,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (35,'finance','FINANZAS',10,11,NULL,0,0,0,1,0,1,'/1/',NULL,1,'begonya@verdnatura.es',1,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (36,'labor','LABORAL',12,13,NULL,0,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (31,'it','INFORMATICA',6,7,NULL,72,0,0,1,0,1,'/1/','informatica-cau',1,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (34,'accounting','CONTABILIDAD',8,9,NULL,0,0,0,1,0,1,'/1/',NULL,1,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (35,'finance','FINANZAS',10,11,NULL,0,0,0,1,0,1,'/1/',NULL,1,'begonya@verdnatura.es',0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (36,'labor','LABORAL',12,13,NULL,0,0,0,1,0,1,'/1/',NULL,1,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (37,'PROD','PRODUCCION',14,37,NULL,72,1,1,1,11,1,'/1/',NULL,0,NULL,0,1,1,1,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (38,'picking','SACADO',17,18,NULL,72,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,1,NULL,NULL,NULL,'ON_PREPARATION');
INSERT INTO `department` VALUES (38,'picking','SACADO',17,18,NULL,72,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,1,0,1,NULL,NULL,NULL,'ON_PREPARATION');
INSERT INTO `department` VALUES (39,'packing','ENCAJADO',19,20,NULL,72,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,1,NULL,NULL,NULL,'PACKING');
INSERT INTO `department` VALUES (41,'administration','ADMINISTRACION',38,39,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (43,'VT','VENTAS',40,73,NULL,0,0,0,1,16,1,'/1/',NULL,1,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (44,'management','GERENCIA',74,75,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (45,'logistic','LOGISTICA',76,77,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (46,'delivery','REPARTO',78,79,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,1,0,0,NULL,NULL,NULL,'DELIVERY');
INSERT INTO `department` VALUES (48,'storage','ALMACENAJE',80,81,NULL,0,1,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,'STORAGE');
INSERT INTO `department` VALUES (49,NULL,'PROPIEDAD',82,83,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (52,NULL,'CARGA AEREA',84,85,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (53,'marketing','MARKETING Y COMUNICACIÓN',41,42,NULL,72,0,0,2,0,43,'/1/43/',NULL,1,NULL,1,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (54,NULL,'ORNAMENTALES',86,87,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (41,'administration','ADMINISTRACION',38,39,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (43,'VT','VENTAS',40,75,NULL,0,0,0,1,17,1,'/1/',NULL,1,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (44,'management','GERENCIA',76,77,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (45,'logistic','LOGISTICA',78,79,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (46,'delivery','REPARTO',80,81,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,1,0,0,NULL,NULL,NULL,'DELIVERY');
INSERT INTO `department` VALUES (48,'storage','ALMACENAJE',82,83,NULL,0,1,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,'STORAGE');
INSERT INTO `department` VALUES (49,NULL,'PROPIEDAD',84,85,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (52,NULL,'CARGA AEREA',86,87,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (53,'marketing','MARKETING Y COMUNICACIÓN',41,42,NULL,72,0,0,2,0,43,'/1/43/',NULL,1,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (54,NULL,'ORNAMENTALES',88,89,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (55,NULL,'TALLER NATURAL',21,22,14548,72,0,0,2,0,37,'/1/37/',NULL,0,NULL,0,1,1,0,1118,NULL,NULL,NULL);
INSERT INTO `department` VALUES (56,NULL,'TALLER ARTIFICIAL',23,24,8470,72,0,0,2,0,37,'/1/37/',NULL,0,NULL,0,1,1,0,1927,NULL,NULL,NULL);
INSERT INTO `department` VALUES (58,'CMP','CAMPOS',88,91,NULL,72,0,0,1,1,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,'FIELD');
INSERT INTO `department` VALUES (59,'maintenance','MANTENIMIENTO',92,93,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,1,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (60,'claims','RECLAMACIONES',43,44,NULL,72,0,0,2,0,43,'/1/43/',NULL,0,NULL,1,1,0,0,NULL,NULL,NULL,'CLAIM');
INSERT INTO `department` VALUES (61,NULL,'VNH',94,97,NULL,73,0,0,1,1,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (66,NULL,'VERDNAMADRID',98,99,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (58,'CMP','CAMPOS',90,93,NULL,72,0,0,1,1,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,'FIELD');
INSERT INTO `department` VALUES (59,'maintenance','MANTENIMIENTO',94,95,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,1,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (60,'claims','RECLAMACIONES',43,44,NULL,72,0,0,2,0,43,'/1/43/',NULL,0,NULL,0,1,0,0,NULL,NULL,NULL,'CLAIM');
INSERT INTO `department` VALUES (61,NULL,'VNH',96,99,NULL,73,0,0,1,1,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (66,NULL,'VERDNAMADRID',100,101,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (68,NULL,'COMPLEMENTOS',25,26,NULL,72,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,1,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (69,NULL,'VERDNABARNA',100,101,NULL,74,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (69,NULL,'VERDNABARNA',102,103,NULL,74,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (80,'spainTeam5','EQUIPO ESPAÑA 5',45,46,4250,0,0,0,2,0,43,'/1/43/','es5_equipo',1,'es5@verdnatura.es',0,0,0,0,NULL,NULL,'5300',NULL);
INSERT INTO `department` VALUES (86,NULL,'LIMPIEZA',102,103,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (89,NULL,'COORDINACION',104,105,NULL,0,1,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (90,NULL,'TRAILER',95,96,NULL,0,0,0,2,0,61,'/1/61/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (86,NULL,'LIMPIEZA',104,105,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (89,NULL,'COORDINACION',106,107,NULL,0,1,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (90,NULL,'TRAILER',97,98,NULL,0,0,0,2,0,61,'/1/61/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (91,'artificial','ARTIFICIAL',27,28,NULL,0,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,'PREVIOUS');
INSERT INTO `department` VALUES (92,NULL,'EQUIPO SILVERIO',47,48,1203,0,0,0,2,0,43,'/1/43/','sdc_equipo',0,'gestioncomercial@verdnatura.es',0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (94,'spainTeam2','EQUIPO ESPAÑA 2',49,50,3797,0,0,0,2,0,43,'/1/43/','es2_equipo',1,'es2@verdnatura.es',0,0,0,0,NULL,NULL,'5100',NULL);
@ -2573,23 +2617,24 @@ INSERT INTO `department` VALUES (95,'spainTeam1','EQUIPO ESPAÑA 1',51,52,24065,
INSERT INTO `department` VALUES (96,NULL,'EQUIPO C LOPEZ',53,54,4661,0,0,0,2,0,43,'/1/43/','cla_equipo',0,'gestioncomercial@verdnatura.es',0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (115,NULL,'EQUIPO CLAUDI',55,56,3810,0,0,0,2,0,43,'/1/43/','csr_equipo',0,'gestioncomercial@verdnatura.es',0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (123,NULL,'EQUIPO ELENA BASCUÑANA',57,58,7102,0,0,0,2,0,43,'/1/43/','ebt_equipo',0,'gestioncomercial@verdnatura.es',0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (124,NULL,'CONTROL INTERNO',106,107,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,1,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (124,NULL,'CONTROL INTERNO',108,109,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (125,'spainTeam3','EQUIPO ESPAÑA 3',59,60,1118,0,0,0,2,0,43,'/1/43/','es3_equipo',1,'es3@verdnatura.es',0,0,0,0,NULL,NULL,'5200',NULL);
INSERT INTO `department` VALUES (126,NULL,'PRESERVADO',29,30,NULL,0,0,0,2,0,37,'/1/37/',NULL,0,NULL,0,1,1,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (128,NULL,'PALETIZADO',31,32,NULL,0,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,'PALLETIZING');
INSERT INTO `department` VALUES (130,NULL,'REVISION',33,34,NULL,0,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,1,NULL,NULL,NULL,'ON_CHECKING');
INSERT INTO `department` VALUES (131,'greenhouse','INVERNADERO',89,90,NULL,0,0,0,2,0,58,'/1/58/',NULL,0,NULL,0,1,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (131,'greenhouse','INVERNADERO',91,92,NULL,0,0,0,2,0,58,'/1/58/',NULL,0,NULL,0,1,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (132,NULL,'EQUIPO DC',61,62,1731,0,0,0,2,0,43,'/1/43/','dc_equipo',1,'gestioncomercial@verdnatura.es',0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (133,'franceTeam','EQUIPO FRANCIA',63,64,1731,72,0,0,2,0,43,'/1/43/','fr_equipo',1,'gestionfrancia@verdnatura.es',0,0,0,0,NULL,NULL,'3300',NULL);
INSERT INTO `department` VALUES (134,'portugalTeam','EQUIPO PORTUGAL',65,66,6264,0,0,0,2,0,43,'/1/43/','pt_equipo',1,'portugal@verdnatura.es',0,0,0,0,NULL,NULL,'3500',NULL);
INSERT INTO `department` VALUES (135,'routers','ENRUTADORES',108,109,NULL,0,0,0,1,0,1,'/1/',NULL,1,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (136,'heavyVehicles','VEHICULOS PESADOS',110,111,NULL,0,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (137,'sorter','SORTER',112,113,NULL,0,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (135,'routers','ENRUTADORES',110,111,NULL,0,0,0,1,0,1,'/1/',NULL,1,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (136,'heavyVehicles','VEHICULOS PESADOS',112,113,NULL,0,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (137,'sorter','SORTER',114,115,NULL,0,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (139,'spainTeam4','EQUIPO ESPAÑA 4',67,68,3803,0,0,0,2,0,43,'/1/43/','es4_equipo',1,'es4@verdnatura.es',0,0,0,0,NULL,NULL,'5400',NULL);
INSERT INTO `department` VALUES (140,'hollandTeam','EQUIPO HOLANDA',69,70,NULL,0,0,0,2,0,43,'/1/43/','nl_equipo',1,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (140,'internationalTeam','EQUIPO INTERNACIONAL',69,70,33320,0,0,0,2,0,43,'/1/43/','int_equipo',1,'international@verdnatura.es',0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (141,NULL,'PREVIA',35,36,NULL,0,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,1,NULL,NULL,NULL,'PREVIOUS');
INSERT INTO `department` VALUES (146,NULL,'VERDNACOLOMBIA',3,4,NULL,72,0,0,2,0,22,'/1/22/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
INSERT INTO `department` VALUES (147,'spainTeamAsia','EQUIPO ESPAÑA ASIA',71,72,40214,0,0,0,2,0,43,'/1/43/','esA_equipo',0,'esA@verdnatura.es',0,0,0,0,NULL,NULL,'5500',NULL);
INSERT INTO `department` VALUES (148,NULL,'CAPTATION FRANCIA',73,74,NULL,0,0,0,2,0,43,'/1/43/',NULL,0,NULL,0,0,0,0,NULL,NULL,'6000',NULL);
INSERT INTO `docuware` VALUES (1,'deliveryNote','Albaranes cliente','find','find','N__ALBAR_N',NULL);
INSERT INTO `docuware` VALUES (2,'deliveryNote','Albaranes cliente','store','Archivar','N__ALBAR_N',NULL);

View File

@ -502,7 +502,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','receipt','alexm@%','0000-
INSERT IGNORE INTO `tables_priv` VALUES ('','hedera','grafana','visitUser','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','referenceRate','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','salesPerson','report','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','cache','productionBoss','available','guillermo@10.5.1.2','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyerAssistant','producer','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','time','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','coolerAssist','role','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','config__','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
@ -605,7 +605,6 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','project','jua
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','productionConfig','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','manager','productionConfig','alexm@%','0000-00-00 00:00:00','Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','creditInsurance','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','cache','productionBoss','visible','guillermo@10.5.1.2','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','errorProduction__','alexm@%','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','invoiceOut','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','coolerAssist','Tickets','alexm@%','0000-00-00 00:00:00','Update','');
@ -792,7 +791,6 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','hr','Movimientos','alexm@%
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','coolerAssist','buy','alexm@%','0000-00-00 00:00:00','Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','itemMinimumQuantity','jenkins@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','adminOfficer','receipt','guillermo@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Insert','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyerBoss','producer','alexm@%','0000-00-00 00:00:00','Update','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','administrative','link','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','hr','link','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','delivery','vehicle','alexm@%','0000-00-00 00:00:00','Select','');
@ -971,7 +969,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','officeBoss','ticketPackagingSt
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','workerRelatives','guillermo@db-proxy1.static.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','productionAssi','ticketPackagingStartingStock','alexm@%','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','supplierPackaging','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','workerDocument','alexm@%','0000-00-00 00:00:00','Select,Insert','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','supplierContact','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','invoiceCorrection','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','ink','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','zone','alexm@%','0000-00-00 00:00:00','Select','');
@ -1471,9 +1469,31 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','productionAssi','tillSerial','
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','stockBuyed','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','alertLevel','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','workerActivityType','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','priceDelta','jenkins@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','priceDelta','jenkins@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','parkingLog','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','travelLog','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','supplierContact','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','workerDms','alexm@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','itemLog','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','account','developer','user','juan@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','claimManager','claimReason','alexm@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','claimManager','claimResponsible','alexm@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','claimManager','claimResult','alexm@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','claimManager','claimRedelivery','alexm@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logisticAssist','producer','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logisticAssist','itemStateTag','alexm@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logisticAssist','material','alexm@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logisticAssist','saleUnit','alexm@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logisticAssist','origin','alexm@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','itemType','jgallego@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','deliveryAssistant','delivery','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logisticAssist','itemFarmingTag','jenkins@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logisticAssist','itemWrappingTag','jenkins@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logisticAssist','itemLanguageTag','jenkins@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logisticAssist','itemStemTag','jenkins@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logisticAssist','itemBaseTag','jenkins@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logisticAssist','itemBreederTag','jenkins@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','itemShelvingLog','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
/*!40000 ALTER TABLE `tables_priv` ENABLE KEYS */;
/*!40000 ALTER TABLE `columns_priv` DISABLE KEYS */;
@ -1853,7 +1873,6 @@ INSERT IGNORE INTO `procs_priv` VALUES ('','vn','claimManager','buy_getVolumeByE
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','buyer','buy_getVolumeByEntry','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','entry_moveNotPrinted','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','buy_getVolume','FUNCTION','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','buyer','stockbuyedbyworker','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','buy_getsplit','PROCEDURE','juan@db-proxy2.static.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','salesAssistant','subordinategetlist','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','buyer','buy_afterUpsert','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
@ -2001,7 +2020,6 @@ INSERT IGNORE INTO `procs_priv` VALUES ('','vn','hr','logshow','PROCEDURE','alex
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','buyerBoss','supplierpackaging_reportsource','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','financialBoss','supplierexpenses','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','grafana','firstdayofweek','FUNCTION','juan@db-proxy2.static.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','buyer','stockbuyed_add','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','administrative','mail_insert','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','administrative','duaParcialMake','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','palletizerBoss','packingsite_startcollection','PROCEDURE','alexm@db-proxy2.static.verdnatura.es','Execute','0000-00-00 00:00:00');
@ -2211,7 +2229,10 @@ INSERT IGNORE INTO `procs_priv` VALUES ('','vn','guest','ticketCalculatePurge','
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','buyer','buy_getUltimate','PROCEDURE','guillermo@db-proxy2.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','cooler','buy_getUltimate','PROCEDURE','guillermo@db-proxy2.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','bs','buyerBoss','waste_addSales','PROCEDURE','jenkins@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','bs','grafana','waste_addSales','PROCEDURE','guillermo@db-proxy2.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','saletracking_sectorcollectionaddprevok','PROCEDURE','alexm@db-proxy2.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','salesAssistant','saleSplit','PROCEDURE','carlosap@db-proxy2.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','itemShelvingSale_deleteAdded','PROCEDURE','guillermo@db-proxy1.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','buy_getUltimate','PROCEDURE','guillermo@db-proxy2.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
/*!40000 ALTER TABLE `procs_priv` ENABLE KEYS */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;

File diff suppressed because it is too large Load Diff

View File

@ -1128,6 +1128,28 @@ DELIMITER ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
/*!50003 SET character_set_client = utf8mb4 */ ;
/*!50003 SET character_set_results = utf8mb4 */ ;
/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `hedera`.`orderRow_afterInsert`
AFTER INSERT ON `orderRow`
FOR EACH ROW
BEGIN
UPDATE `order`
SET rowUpdated = util.VN_NOW()
WHERE id = NEW.orderFk;
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
/*!50003 SET character_set_client = @saved_cs_client */ ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
--
-- Current Database: `pbx`
@ -2432,11 +2454,21 @@ DELIMITER ;;
AFTER UPDATE ON `business`
FOR EACH ROW
BEGIN
DECLARE vIsActive BOOL;
DECLARE vExtension VARCHAR(10);
CALL worker_updateBusiness(NEW.workerFk);
IF NOT (OLD.workerFk <=> NEW.workerFk) THEN
CALL worker_updateBusiness(OLD.workerFk);
END IF;
IF NOT (OLD.departmentFk <=> NEW.departmentFk) THEN
SELECT COUNT(*) INTO vIsActive FROM worker WHERE businessFk = NEW.id;
IF vIsActive THEN
CALL queueMember_updateQueue(NEW.id);
END IF;
END IF;
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@ -6554,6 +6586,9 @@ BEGIN
SET NEW.userFk = account.myUser_getId();
END IF;
IF NEW.shelvingFk <> OLD.shelvingFk THEN
SET NEW.movingState = NULL;
END IF;
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@ -6654,11 +6689,11 @@ DELIMITER ;;
AFTER INSERT ON `itemShelvingSale`
FOR EACH ROW
BEGIN
UPDATE sale s
JOIN operator o ON o.workerFk = account.myUser_getId()
SET s.isPicked = IF(o.isOnReservationMode, s.isPicked, TRUE)
WHERE id = NEW.saleFk;
JOIN sector se ON se.id = o.sectorFk
SET s.isPicked = IF(IFNULL(se.isOnReservationMode, o.isOnReservationMode), s.isPicked, TRUE)
WHERE s.id = NEW.saleFk;
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@ -9988,6 +10023,8 @@ DELIMITER ;;
BEFORE INSERT ON `ticketRefund`
FOR EACH ROW
BEGIN
CALL ticketRefund_upsert(NEW.refundTicketFk, NEW.originalTicketFk);
SET NEW.editorFk = account.myUser_getId();
END */;;
DELIMITER ;
@ -10008,6 +10045,8 @@ DELIMITER ;;
BEFORE UPDATE ON `ticketRefund`
FOR EACH ROW
BEGIN
CALL ticketRefund_upsert(NEW.refundTicketFk, NEW.originalTicketFk);
SET NEW.editorFk = account.myUser_getId();
END */;;
DELIMITER ;
@ -10678,6 +10717,15 @@ DELIMITER ;;
FOR EACH ROW
BEGIN
SET NEW.editorFk = account.myUser_getId();
IF NEW.travelFk IS NULL AND
(SELECT COUNT(*) FROM travelThermograph
WHERE thermographFk = NEW.thermographFk
AND travelFk IS NULL
AND id <> NEW.id) > 0
THEN
CALL util.throw('Duplicate thermographFk without travelFk not allowed.');
END IF;
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@ -10698,6 +10746,15 @@ DELIMITER ;;
FOR EACH ROW
BEGIN
SET NEW.editorFk = account.myUser_getId();
IF NEW.travelFk IS NULL AND
(SELECT COUNT(*) FROM travelThermograph
WHERE thermographFk = NEW.thermographFk
AND travelFk IS NULL
AND id <> NEW.id) > 0
THEN
CALL util.throw('Duplicate thermographFk without travelFk not allowed.');
END IF;
END */;;
DELIMITER ;
/*!50003 SET sql_mode = @saved_sql_mode */ ;
@ -11469,4 +11526,4 @@ USE `vn2008`;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2024-10-03 7:43:14
-- Dump completed on 2024-11-12 7:06:44

View File

@ -400,11 +400,11 @@ INSERT INTO `vn`.`client`(`id`,`name`,`fi`,`socialName`,`contact`,`street`,`city
(1108, 'Charles Xavier', '22641921P', 'PROFESSOR X', 'Beast', '3800 VICTORY PKWY, CINCINNATI, OH 45207, USA', 'Gotham', 46460, 1111111111, 222222222, 1, 'CharlesXavier@mydomain.com', NULL, 0, 1234567890, 0, 5, 1, 300, 13, 1, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, NULL, 0, 0, 19, 0, 'florist','normal'),
(1109, 'Bruce Banner', '16104829E', 'HULK', 'Black widow', 'SOMEWHERE IN NEW YORK', 'Gotham', 46460, 1111111111, 222222222, 1, 'BruceBanner@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 0, 0, NULL, 0, 0, 9, 0, 'florist','normal'),
(1110, 'Jessica Jones', '58282869H', 'JESSICA JONES', 'Luke Cage', 'NYCC 2015 POSTER', 'Gotham', 46460, 1111111111, 222222222, 1, 'JessicaJones@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 0, NULL, 0, 0, NULL, 1, 'florist','normal'),
(1111, 'Missing', NULL, 'MISSING MAN', 'Anton', 'THE SPACE, UNIVERSE FAR AWAY', 'Gotham', 46460, 1111111111, 222222222, 1, NULL, NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 0, 1, 0, NULL, 1, 0, NULL, 0, 'others','loses'),
(1112, 'Trash', NULL, 'GARBAGE MAN', 'Unknown name', 'NEW YORK CITY, UNDERGROUND', 'Gotham', 46460, 1111111111, 222222222, 1, NULL, NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 0, 1, 0, NULL, 1, 0, NULL, 0, 'others','loses');
(1111, 'Missing', NULL, 'MISSING MAN', 'Anton', 'THE SPACE, UNIVERSE FAR AWAY', 'Gotham', 46460, 1111111111, 222222222, 0, NULL, NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 0, 1, 0, NULL, 1, 0, NULL, 0, 'others','loses'),
(1112, 'Trash', NULL, 'GARBAGE MAN', 'Unknown name', 'NEW YORK CITY, UNDERGROUND', 'Gotham', 46460, 1111111111, 222222222, 0, NULL, NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 0, 1, 0, NULL, 1, 0, NULL, 0, 'others','loses');
INSERT INTO `vn`.`client`(`id`, `name`, `fi`, `socialName`, `contact`, `street`, `city`, `postcode`, `isRelevant`, `email`, `iban`,`dueDay`,`accountingAccount`, `isEqualizated`, `provinceFk`, `hasToInvoice`, `credit`, `countryFk`, `isActive`, `quality`, `payMethodFk`,`created`, `isTaxDataChecked`)
SELECT id, name, CONCAT(RPAD(CONCAT(id,9),8,id),'A'), UPPER(CONCAT(name, 'Social')), CONCAT(name, 'Contact'), UPPER(CONCAT(name, 'Street')), 'GOTHAM', 46460, 1, CONCAT(name,'@mydomain.com'), NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, 10, 5, util.VN_CURDATE(), 1
SELECT id, name, CONCAT(RPAD(CONCAT(id,9),8,id),'A'), UPPER(CONCAT(name, 'Social')), CONCAT(name, 'Contact'), UPPER(CONCAT(name, 'Street')), 'GOTHAM', 46460, 0, CONCAT(name,'@mydomain.com'), NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, 10, 5, util.VN_CURDATE(), 1
FROM `account`.`role` `r`
WHERE `r`.`hasLogin` = 1;
@ -2476,7 +2476,8 @@ INSERT INTO `vn`.`dmsType`
(20, 'Reclamación', 1, 1, 'claim'),
(21, 'Entrada', 1, 1, 'entry'),
(22, 'Proveedor', 1, 1, 'supplier'),
(23, 'Termografos', 35, 35, 'thermograph');
(23, 'Termografos', 35, 35, 'thermograph'),
(24, 'Sello de calidad', 1, 1, 'qualitySeal');
INSERT INTO `vn`.`dms`(`id`, `dmsTypeFk`, `file`, `contentType`, `workerFk`, `warehouseFk`, `companyFk`, `hardCopyNumber`, `hasFile`, `reference`, `description`, `created`)
VALUES
@ -2954,9 +2955,9 @@ INSERT INTO `vn`.`routeConfig` (`id`, `defaultWorkCenterFk`)
VALUES
(1, 9);
INSERT INTO `vn`.`productionConfig` (`isPreviousPreparationRequired`, `ticketPrintedMax`, `ticketTrolleyMax`, `rookieDays`, `notBuyingMonths`, `id`, `isZoneClosedByExpeditionActivated`, `maxNotReadyCollections`, `minTicketsToCloseZone`, `movingTicketDelRoute`, `defaultZone`, `defautlAgencyMode`, `hasUniqueCollectionTime`, `maxCollectionWithoutUser`, `pendingCollectionsOrder`, `pendingCollectionsAge`, `backupPrinterNotificationDelay`)
INSERT INTO `vn`.`productionConfig` (`isPreviousPreparationRequired`, `ticketPrintedMax`, `ticketTrolleyMax`, `rookieDays`, `notBuyingMonths`, `id`, `isZoneClosedByExpeditionActivated`, `maxNotReadyCollections`, `minTicketsToCloseZone`, `movingTicketDelRoute`, `defaultZone`, `defautlAgencyMode`, `hasUniqueCollectionTime`, `maxCollectionWithoutUser`, `pendingCollectionsOrder`, `pendingCollectionsAge`, `backupPrinterNotificationDelay`, `clientSelfConsumptionFk`, `addressSelfConsumptionFk`)
VALUES
(0, 8, 80, 0, 0, 1, 0, 15, 25, -1, 697, 1328, 0, 1, 8, 6, 3600);
(0, 8, 80, 0, 0, 1, 0, 15, 25, -1, 697, 1328, 0, 1, 8, 6, 3600, 1112, 12);
INSERT INTO `vn`.`collection` (`id`, `created`, `workerFk`, `stateFk`, `itemPackingTypeFk`, `saleTotalCount`, `salePickedCount`, `trainFk`, `sectorFk`, `wagons`)
VALUES
@ -4007,4 +4008,23 @@ INSERT IGNORE INTO pbx.queueMember
UPDATE vn.department SET pbxQueue = '1000' WHERE name = "CAMARA";
UPDATE vn.department SET pbxQueue = '2000' WHERE name = "VENTAS";
INSERT INTO srt.buffer (id, x, y, `size`, `length`, stateFk, typeFk, isActive, code, stratus, hasWorkerWaiting, reserve, routeFk, dayMinute, lastUnloaded, hasStrapper, typeDefaultFk, motors, editorFk)
VALUES (0, 0, 0, 0, NULL, 3, 1, 0, 'ENT', 0, 0, NULL, NULL, NULL, NULL, 0, 1, 1, NULL),
(1, 0, 9900, 0, NULL, 1, 0, 0, 'NOK', 0, 0, NULL, NULL, NULL, NULL, 0, 1, 1, NULL),
(2, 0, 0, 450, 13000, 1, 0, 1, '01A', 1, 1, NULL, NULL, NULL, NULL, 0, 1, 1, NULL),
(3, 1400, 0, 450, 13000, 1, 0, 1, '01B', 1, 0, NULL, NULL, NULL, NULL, 0, 1, 1, NULL),
(4, 0, 500, 500, 13000, 1, 4, 1, '02A', 2, 1, NULL, NULL, NULL, NULL, 1, 4, 13, NULL),
(5, 1400, 500, 500, 13000, 1, 4, 1, '02B', 2, 1, NULL, NULL, NULL, NULL, 1, 4, 13, NULL),
(6, 0, 1000, 500, 13000, 1, 1, 1, '03A', 3, 0, NULL, NULL, NULL, NULL, 0, 1, 1, NULL),
(7, 1400, 1000, 500, 13000, 1, 1, 1, '03B', 3, 0, NULL, NULL, NULL, NULL, 0, 1, 1, NULL),
(8, 0, 1500, 500, 13000, 1, 0, 1, '04A', 4, 0, NULL, NULL, NULL, NULL, 0, 1, 1, NULL),
(9, 1400, 1500, 500, 13000, 1, 1, 1, '04B', 4, 0, NULL, NULL, NULL, NULL, 0, 1, 1, NULL),
(10, 0, 2000, 500, 13000, 1, 1, 1, '05A', 5, 0, NULL, NULL, NULL, NULL, 0, 1, 1, NULL);
INSERT IGNORE INTO vn.saySimpleCountry (countryFk, channel)
VALUES (19, '1169'),
(8, '1183');
INSERT IGNORE INTO vn.saySimpleConfig (url, defaultChannel)
VALUES ('saysimle-url-mock', 1320);

View File

@ -7,8 +7,7 @@ AS SELECT `u`.`id` AS `id`,
`u`.`email` AS `email`,
`u`.`nickname` AS `nickname`,
`u`.`lang` AS `lang`,
`u`.`role` AS `role`,
`u`.`recoverPass` AS `recoverPass`
`u`.`role` AS `role`
FROM `account`.`user` `u`
WHERE `u`.`name` = `myUser_getName`()
WITH CASCADED CHECK OPTION

View File

@ -9,45 +9,54 @@ BEGIN
* @param vOrder El identificador del pedido
* @return tmp.orderTax Bases imponibles, IVA y recargo de equivalencia
*/
-- No poner create or replace, ya que da problemas
DROP TEMPORARY TABLE IF EXISTS tmp.addressCompany;
CREATE TEMPORARY TABLE tmp.addressCompany
(INDEX (addressFk, companyFk))
ENGINE = MEMORY
SELECT DISTINCT o.address_id addressFk, o.company_id companyFk
FROM tmp.`order` tmpOrder
JOIN hedera.`order` o ON o.id = tmpOrder.orderFk;
JOIN `order` o ON o.id = tmpOrder.orderFk;
CALL vn.addressTaxArea;
CALL vn.addressTaxArea();
-- Calcula el IVA y el recargo desglosado.
DROP TEMPORARY TABLE IF EXISTS tmp.orderTax;
CREATE TEMPORARY TABLE tmp.orderTax
(INDEX (orderFk))
CREATE OR REPLACE TEMPORARY TABLE tmp.orderTax
(PRIMARY KEY (orderFk, code, rate))
ENGINE = MEMORY
SELECT o.id orderFk,
WITH orders AS (
SELECT tor.orderFk,
oro.amount * oro.price total,
s.countryFk,
ata.areaFk,
itc.taxClassFk
FROM hedera.orderRow oro
JOIN tmp.order tor ON tor.orderFk = oro.orderFk
JOIN hedera.`order` o ON o.id = tor.orderFk
JOIN vn.item i ON i.id = oro.itemFk
JOIN vn.`client` c ON c.id = o.customer_id
JOIN vn.supplier s ON s.id = o.company_id
JOIN tmp.addressTaxArea ata ON ata.addressFk = o.address_id
AND ata.companyFk = o.company_id
JOIN vn.itemTaxCountry itc ON itc.itemFk = i.id
AND itc.countryFk = s.countryFk
HAVING total
)
SELECT o.orderFk,
tc.code,
SUM(m.amount * m.price) taxableBase,
SUM(o.total) taxableBase,
pgc.rate
FROM tmp.`order` tmpOrder
JOIN `order` o ON o.id = tmpOrder.orderFk
JOIN orderRow m ON m.orderFk = o.id
JOIN vn.item i ON i.id = m.itemFk
JOIN vn.`client` c ON c.id = o.customer_id
JOIN vn.supplier s ON s.id = o.company_id
JOIN tmp.addressTaxArea ata
ON ata.addressFk = o.address_id AND ata.companyFk = o.company_id
JOIN vn.itemTaxCountry itc
ON itc.itemFk = i.id AND itc.countryFk = s.countryFk
JOIN vn.bookingPlanner bp
ON bp.countryFk = s.countryFk
AND bp.taxAreaFk = ata.areaFk
AND bp.taxClassFk = itc.taxClassFk
JOIN vn.pgc ON pgc.`code` = bp.pgcFk
FROM orders o
JOIN vn.bookingPlanner bp ON bp.countryFk = o.countryFk
AND bp.taxAreaFk = o.areaFk
AND bp.taxClassFk = o.taxClassFk
JOIN vn.pgc ON pgc.code = bp.pgcFk
JOIN vn.taxClass tc ON tc.id = bp.taxClassFk
GROUP BY tmpOrder.orderFk, pgc.`code`, pgc.rate
HAVING taxableBase != 0;
GROUP BY o.orderFk, pgc.code, pgc.rate
HAVING taxableBase
ORDER BY bp.priority;
-- No poner create or replace, ya que da problemas
DROP TEMPORARY TABLE IF EXISTS tmp.orderAmount;
CREATE TEMPORARY TABLE tmp.orderAmount
(INDEX (orderFk))

View File

@ -56,7 +56,7 @@ BEGIN
AND ts.id IS NULL;
DELETE FROM claim WHERE ticketCreated < v4Years;
-- Robert ubicacion anterior de travelLog comentario para debug
DELETE FROM zoneEvent WHERE `type` = 'day' AND dated < v3Months;
DELETE FROM zoneEvent WHERE dated < v2Months OR ended < v2Months;
DELETE b FROM buy b
JOIN entryConfig e ON e.defaultEntry = b.entryFk
WHERE b.created < v2Months;

View File

@ -146,8 +146,6 @@ BEGIN
DELETE pb
FROM tmp.productionBuffer pb
JOIN state s ON s.id = pb.state
JOIN agencyMode am ON am.id = pb.agencyModeFk
JOIN agency a ON a.id = am.agencyFk
LEFT JOIN (
SELECT pb.ticketFk, MAX(i.`size`) maxSize
FROM tmp.productionBuffer pb
@ -158,7 +156,7 @@ BEGIN
) sub ON sub.ticketFk = pb.ticketFk
JOIN productionConfig pc
WHERE pb.shipped <> util.VN_CURDATE()
OR (pb.ubicacion IS NULL AND a.isOwn)
OR pb.ubicacion IS NULL
OR (NOT s.isPreparable AND NOT s.isPrintable)
OR pb.collectionH IS NOT NULL
OR pb.collectionV IS NOT NULL

View File

@ -0,0 +1,93 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`expedition_selfConsumptionPackaging`(
vSelf INT,
vAction ENUM('add', 'remove')
)
BEGIN
/**
* Maneja el consumo de cajas para autoconsumo, permitiendo
* añadir o quitar cajas utilizadas según la acción indicada.
*
* @param vSelf Id de expedición
*/
DECLARE vClientFk INT;
DECLARE vAddressFk INT;
DECLARE vItemFk INT;
DECLARE vItemName VARCHAR(50);
DECLARE vWarehouseFk INT;
DECLARE vCreated DATE;
DECLARE vTicketFk INT;
DECLARE vSaleFk INT;
DECLARE vQuantity INT;
IF vAction NOT IN ('add', 'remove') THEN
CALL util.throw('Action not supported');
END IF;
SELECT pc.clientSelfConsumptionFk,
pc.addressSelfConsumptionFk,
i.id,
i.name,
t.warehouseFk,
e.created
INTO vClientFk,
vAddressFk,
vItemFk,
vItemName,
vWarehouseFk,
vCreated
FROM expedition e
JOIN packaging p ON p.id = e.packagingFk
JOIN item i ON i.id = p.itemFk
JOIN ticket t ON t.id = e.ticketFk
JOIN productionConfig pc
WHERE e.id = vSelf;
IF vClientFk IS NULL OR vAddressFk IS NULL THEN
CALL util.throw('Some config parameters are not set');
END IF;
SET vCreated = DATE(vCreated);
SELECT id INTO vTicketFk
FROM ticket
WHERE shipped BETWEEN vCreated AND util.dayEnd(vCreated)
AND clientFk = vClientFk
AND addressFk = vAddressFk
AND warehouseFk = vWarehouseFk;
IF vTicketFk IS NULL AND vAction = 'add' THEN
INSERT INTO ticket(clientFk, warehouseFk, shipped, nickname, addressFk)
VALUES (vClientFk, vWarehouseFk, vCreated, 'CAJAS AUTOCONSUMO', vAddressFk);
SET vTicketFk = LAST_INSERT_ID();
END IF;
SELECT id, quantity INTO vSaleFk, vQuantity
FROM sale
WHERE itemFk = vItemFk
AND ticketFk = vTicketFk
LIMIT 1;
IF vAction = 'add' THEN
IF vSaleFk IS NOT NULL THEN
UPDATE sale
SET quantity = quantity + 1
WHERE id = vSaleFk;
ELSE
INSERT INTO sale(itemFk, ticketFk, concept, quantity)
VALUES (vItemFk, vTicketFk, vItemName, 1);
END IF;
ELSE
IF vSaleFk IS NOT NULL THEN
IF vQuantity > 1 THEN
UPDATE sale
SET quantity = quantity - 1
WHERE id = vSaleFk;
ELSE
DELETE FROM sale WHERE id = vSaleFk;
END IF;
END IF;
END IF;
END$$
DELIMITER ;

View File

@ -42,7 +42,6 @@ BEGIN
i.minimum `min`,
p.name producer,
o.code origin,
v.visible - IFNULL(vVisibleItemShelving, 0) unlocated,
a.available,
vVisibleItemShelving,
v.visible,

View File

@ -127,7 +127,7 @@ BEGIN
LEFT JOIN tItemShelvingStock_byWarehouse issw ON issw.itemFk = i.id
AND issw.warehouseFk = t.warehouseFk
WHERE IFNULL(v.visible, 0) < s.quantity
AND IFNULL(av.available, 0) < s.quantity
AND IFNULL(av.available, 0) < 0
AND IFNULL(issw.visible, 0) < s.quantity
AND NOT s.isPicked
AND NOT s.reserved
@ -190,7 +190,7 @@ BEGIN
LEFT JOIN tItemShelvingStock_byWarehouse issw ON issw.itemFk = i.id
AND issw.warehouseFk = t.warehouseFk
WHERE IFNULL(v.visible, 0) < s.quantity
AND IFNULL(av.available, 0) >= s.quantity
AND IFNULL(av.available, 0) >= 0
AND IFNULL(issw.visible, 0) < s.quantity
AND s.quantity > 0
AND NOT s.isPicked

View File

@ -7,13 +7,13 @@ proc: BEGIN
* Calculate the stock of the auction warehouse from the inventory date to vDated
* without taking into account the outputs of the same day vDated
*
* @param vDated Date to calculate the stock.
* @param vDated Date to calculate the stock
*/
IF vDated < util.VN_CURDATE() THEN
LEAVE proc;
END IF;
CREATE OR REPLACE TEMPORARY TABLE tStockBought
CREATE OR REPLACE TEMPORARY TABLE tCurrentData
SELECT workerFk, reserve
FROM stockBought
WHERE dated = vDated
@ -21,15 +21,28 @@ proc: BEGIN
DELETE FROM stockBought WHERE dated = vDated;
CREATE OR REPLACE TEMPORARY TABLE tStockSold
SELECT it.workerFk,
SUM(ic.cm3 * ito.quantity / vc.palletM3 / 1000000) sold
FROM itemTicketOut ito
JOIN item i ON i.id = ito.itemFk
JOIN itemType it ON it.id = i.typeFk
JOIN ticket t ON t.id = ito.ticketFk
JOIN warehouse wh ON wh.id = t.warehouseFk
JOIN itemCost ic ON ic.itemFk = ito.itemFk
AND ic.warehouseFk = t.warehouseFk
JOIN volumeConfig vc
WHERE ito.shipped BETWEEN vDated AND util.dayEnd(vDated)
AND wh.code = 'VNH'
GROUP BY it.workerFk;
CALL item_calculateStock(vDated);
INSERT INTO stockBought(workerFk, bought, dated)
CREATE OR REPLACE TEMPORARY TABLE tStockBought
SELECT it.workerFk,
ROUND(SUM(
(ti.quantity / b.packing) *
buy_getVolume(b.id)
) / vc.palletM3 / 1000000, 1) bought,
vDated
SUM((ti.quantity / b.packing) *
buy_getVolume(b.id)
) / vc.palletM3 / 1000000 bought
FROM itemType it
JOIN item i ON i.typeFk = it.id
LEFT JOIN tmp.item ti ON ti.itemFk = i.id
@ -43,20 +56,33 @@ proc: BEGIN
GROUP BY it.workerFk
HAVING bought;
INSERT INTO stockBought(workerFk, bought, dated)
SELECT tb.workerFk,
ROUND(GREATEST(tb.bought - IFNULL(ts.sold, 0), 0), 2),
vDated
FROM tStockBought tb
LEFT JOIN tStockSold ts ON ts.workerFk = tb.workerFk;
UPDATE stockBought s
JOIN tStockBought ts ON ts.workerFk = s.workerFk
JOIN tCurrentData ts ON ts.workerFk = s.workerFk
SET s.reserve = ts.reserve
WHERE s.dated = vDated;
INSERT INTO stockBought (workerFk, reserve, dated)
SELECT ts.workerFk, ts.reserve, vDated
FROM tStockBought ts
FROM tCurrentData ts
WHERE ts.workerFk NOT IN (
SELECT workerFk
FROM stockBought
WHERE dated = vDated
);
DROP TEMPORARY TABLE tStockBought, tmp.item, tmp.buyUltimate;
UPDATE stockBought s
JOIN tStockSold ts ON ts.workerFk = s.workerFk
SET s.bought = IF(s.bought < ts.sold, ROUND(s.bought - ts.sold, 1), 0)
WHERE s.dated = vDated;
DROP TEMPORARY TABLE tCurrentData, tmp.item, tmp.buyUltimate, tStockSold;
END$$
DELIMITER ;

View File

@ -0,0 +1,74 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`stockBuyedByWorker`(
vDated DATE,
vWorker INT
)
BEGIN
/**
* Inserta el volumen de compra de un comprador
* en stockBuyed de acuerdo con la fecha.
*
* @param vDated Fecha de compra
* @param vWorker Id de trabajador
*/
CREATE OR REPLACE TEMPORARY TABLE tStockBuyed
(INDEX (userFk))
ENGINE = MEMORY
SELECT requested, reserved, userFk
FROM stockBuyed
WHERE dated = vDated
AND userFk = vWorker;
DELETE FROM stockBuyed
WHERE dated = vDated
AND userFk = vWorker;
CALL item_calculateStock(vDated);
INSERT INTO stockBuyed(userFk, buyed, `dated`, reserved, requested, description)
SELECT it.workerFk,
SUM((ti.quantity / b.packing) * buy_getVolume(b.id)) / vc.palletM3 / 1000000,
vDated,
sb.reserved,
sb.requested,
u.name
FROM itemType it
JOIN item i ON i.typeFk = it.id
LEFT JOIN tmp.item ti ON ti.itemFk = i.id
JOIN itemCategory ic ON ic.id = it.categoryFk
JOIN warehouse wh ON wh.code = 'VNH'
JOIN tmp.buyUltimate bu ON bu.itemFk = i.id
AND bu.warehouseFk = wh.id
JOIN buy b ON b.id = bu.buyFk
JOIN volumeConfig vc
JOIN account.`user` u ON u.id = it.workerFk
LEFT JOIN tStockBuyed sb ON sb.userFk = it.workerFk
WHERE ic.display
AND it.workerFk = vWorker;
SELECT b.entryFk Id_Entrada,
i.id Id_Article,
i.name Article,
ti.quantity Cantidad,
(ac.conversionCoefficient * (ti.quantity / b.packing) * buy_getVolume(b.id))
/ (vc.trolleyM3 * 1000000) buyed,
b.packagingFk id_cubo,
b.packing
FROM tmp.item ti
JOIN item i ON i.id = ti.itemFk
JOIN itemType it ON i.typeFk = it.id
JOIN itemCategory ic ON ic.id = it.categoryFk
JOIN worker w ON w.id = it.workerFk
JOIN auctionConfig ac
JOIN tmp.buyUltimate bu ON bu.itemFk = i.id
AND bu.warehouseFk = ac.warehouseFk
JOIN buy b ON b.id = bu.buyFk
JOIN volumeConfig vc
WHERE ic.display
AND w.id = vWorker;
DROP TEMPORARY TABLE tmp.buyUltimate,
tmp.item,
tStockBuyed;
END$$
DELIMITER ;

View File

@ -0,0 +1,70 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`stockBuyed_add`(
vDated DATE
)
BEGIN
/**
* Inserta el volumen de compra por comprador
* en stockBuyed de acuerdo con la fecha.
*
* @param vDated Fecha de compra
*/
CREATE OR REPLACE TEMPORARY TABLE tStockBuyed
(INDEX (userFk))
ENGINE = MEMORY
SELECT requested, reserved, userFk
FROM stockBuyed
WHERE dated = vDated;
DELETE FROM stockBuyed WHERE dated = vDated;
CALL item_calculateStock(vDated);
INSERT INTO stockBuyed(userFk, buyed, `dated`, description)
SELECT it.workerFk,
SUM((ti.quantity / b.packing) * buy_getVolume(b.id)) / vc.palletM3 / 1000000,
vDated,
u.name
FROM itemType it
JOIN item i ON i.typeFk = it.id
LEFT JOIN tmp.item ti ON ti.itemFk = i.id
JOIN itemCategory ic ON ic.id = it.categoryFk
JOIN warehouse wh ON wh.code = 'VNH'
JOIN tmp.buyUltimate bu ON bu.itemFk = i.id AND bu.warehouseFk = wh.id
JOIN buy b ON b.id = bu.buyFk
JOIN volumeConfig vc
JOIN account.`user` u ON u.id = it.workerFk
JOIN workerDepartment wd ON wd.workerFk = u.id
JOIN department d ON d.id = wd.departmentFk
WHERE ic.display
AND d.code IN ('shopping', 'logistic', 'franceTeam')
GROUP BY it.workerFk;
INSERT INTO stockBuyed(buyed, dated, description)
SELECT SUM(ic.cm3 * ito.quantity / vc.palletM3 / 1000000),
vDated,
IF(c.code = 'ES', p.name, c.name) destiny
FROM itemTicketOut ito
JOIN ticket t ON t.id = ito.ticketFk
JOIN `address` a ON a.id = t.addressFk
JOIN province p ON p.id = a.provinceFk
JOIN country c ON c.id = p.countryFk
JOIN warehouse wh ON wh.id = t.warehouseFk
JOIN itemCost ic ON ic.itemFk = ito.itemFk
AND ic.warehouseFk = t.warehouseFk
JOIN volumeConfig vc
WHERE ito.shipped BETWEEN vDated AND util.dayend(vDated)
AND wh.code = 'VNH'
GROUP BY destiny;
UPDATE stockBuyed s
JOIN tStockBuyed ts ON ts.userFk = s.userFk
SET s.requested = ts.requested,
s.reserved = ts.reserved
WHERE s.dated = vDated;
DROP TEMPORARY TABLE tmp.buyUltimate,
tmp.item,
tStockBuyed;
END$$
DELIMITER ;

View File

@ -3,87 +3,124 @@ CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`ticket_splitItemPacki
vSelf INT,
vOriginalItemPackingTypeFk VARCHAR(1)
)
proc:BEGIN
BEGIN
/**
* Clona y reparte las líneas de ventas de un ticket en funcion del tipo de empaquetado.
* Respeta el id de ticket original para el tipo de empaquetado propuesto.
* Clona y reparte las ventas de un ticket en funcion del tipo de empaquetado.
* Respeta el id inicial para el tipo propuesto.
*
* @param vSelf Id ticket
* @param vOriginalItemPackingTypeFk Tipo empaquetado que se mantiene el ticket original
* @param vOriginalItemPackingTypeFk Tipo para el que se reserva el número de ticket original
* @return table tmp.ticketIPT(ticketFk, itemPackingTypeFk)
*/
DECLARE vDone INT DEFAULT FALSE;
DECLARE vHasItemPackingType BOOL;
DECLARE vItemPackingTypeFk INT;
DECLARE vItemPackingTypeFk VARCHAR(1) DEFAULT 'H';
DECLARE vNewTicketFk INT;
DECLARE vPackingTypesToSplit INT;
DECLARE vDone INT DEFAULT FALSE;
DECLARE vItemPackingTypes CURSOR FOR
SELECT DISTINCT itemPackingTypeFk
FROM tSalesToMove;
DECLARE vSaleGroup CURSOR FOR
SELECT itemPackingTypeFk
FROM tSaleGroup
WHERE itemPackingTypeFk IS NOT NULL
ORDER BY (itemPackingTypeFk = vOriginalItemPackingTypeFk) DESC;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
SELECT COUNT(*) INTO vHasItemPackingType
FROM ticket t
JOIN sale s ON s.ticketFk = t.id
JOIN item i ON i.id = s.itemFk
WHERE t.id = vSelf
AND i.itemPackingTypeFk = vOriginalItemPackingTypeFk;
START TRANSACTION;
SELECT id
FROM sale
WHERE ticketFk = vSelf
AND NOT quantity
FOR UPDATE;
DELETE FROM sale
WHERE NOT quantity
AND ticketFk = vSelf;
CREATE OR REPLACE TEMPORARY TABLE tSale
(PRIMARY KEY (id))
ENGINE = MEMORY
SELECT s.id, i.itemPackingTypeFk, IFNULL(sv.litros, 0) litros
FROM sale s
JOIN item i ON i.id = s.itemFk
LEFT JOIN saleVolume sv ON sv.saleFk = s.id
WHERE s.ticketFk = vSelf;
CREATE OR REPLACE TEMPORARY TABLE tSaleGroup
ENGINE = MEMORY
SELECT itemPackingTypeFk, SUM(litros) totalLitros
FROM tSale
GROUP BY itemPackingTypeFk;
SELECT COUNT(*) INTO vPackingTypesToSplit
FROM tSaleGroup
WHERE itemPackingTypeFk IS NOT NULL;
CREATE OR REPLACE TEMPORARY TABLE tmp.ticketIPT(
ticketFk INT,
itemPackingTypeFk VARCHAR(1)
) ENGINE=MEMORY
SELECT vSelf ticketFk, vOriginalItemPackingTypeFk itemPackingTypeFk;
) ENGINE = MEMORY;
IF NOT vHasItemPackingType THEN
LEAVE proc;
END IF;
CASE vPackingTypesToSplit
WHEN 0 THEN
INSERT INTO tmp.ticketIPT(ticketFk, itemPackingTypeFk)
VALUES(vSelf, vItemPackingTypeFk);
WHEN 1 THEN
INSERT INTO tmp.ticketIPT(ticketFk, itemPackingTypeFk)
SELECT vSelf, itemPackingTypeFk
FROM tSaleGroup
WHERE itemPackingTypeFk IS NOT NULL;
ELSE
OPEN vSaleGroup;
FETCH vSaleGroup INTO vItemPackingTypeFk;
CREATE OR REPLACE TEMPORARY TABLE tSalesToMove (
ticketFk INT,
saleFk INT,
itemPackingTypeFk INT
) ENGINE=MEMORY;
INSERT INTO tmp.ticketIPT(ticketFk, itemPackingTypeFk)
VALUES(vSelf, vItemPackingTypeFk);
INSERT INTO tSalesToMove (saleFk, itemPackingTypeFk)
SELECT s.id, i.itemPackingTypeFk
FROM ticket t
JOIN sale s ON s.ticketFk = t.id
JOIN item i ON i.id = s.itemFk
WHERE t.id = vSelf
AND i.itemPackingTypeFk <> vOriginalItemPackingTypeFk;
l: LOOP
SET vDone = FALSE;
FETCH vSaleGroup INTO vItemPackingTypeFk;
OPEN vItemPackingTypes;
IF vDone THEN
LEAVE l;
END IF;
l: LOOP
SET vDone = FALSE;
FETCH vItemPackingTypes INTO vItemPackingTypeFk;
CALL ticket_Clone(vSelf, vNewTicketFk);
IF vDone THEN
LEAVE l;
END IF;
INSERT INTO tmp.ticketIPT(ticketFk, itemPackingTypeFk)
VALUES(vNewTicketFk, vItemPackingTypeFk);
END LOOP;
CALL ticket_Clone(vSelf, vNewTicketFk);
CLOSE vSaleGroup;
UPDATE tSalesToMove
SET ticketFk = vNewTicketFk
WHERE itemPackingTypeFk = vItemPackingTypeFk;
SELECT s.id
FROM sale s
JOIN tSale ts ON ts.id = s.id
JOIN tmp.ticketIPT t ON t.itemPackingTypeFk = ts.itemPackingTypeFk
FOR UPDATE;
END LOOP;
UPDATE sale s
JOIN tSale ts ON ts.id = s.id
JOIN tmp.ticketIPT t ON t.itemPackingTypeFk = ts.itemPackingTypeFk
SET s.ticketFk = t.ticketFk;
CLOSE vItemPackingTypes;
SELECT itemPackingTypeFk INTO vItemPackingTypeFk
FROM tSaleGroup sg
WHERE sg.itemPackingTypeFk IS NOT NULL
ORDER BY sg.itemPackingTypeFk
LIMIT 1;
UPDATE sale s
JOIN tSalesToMove stm ON stm.saleFk = s.id
SET s.ticketFk = stm.ticketFk
WHERE stm.ticketFk;
UPDATE sale s
JOIN tSale ts ON ts.id = s.id
JOIN tmp.ticketIPT t ON t.itemPackingTypeFk = vItemPackingTypeFk
SET s.ticketFk = t.ticketFk
WHERE ts.itemPackingTypeFk IS NULL;
END CASE;
INSERT INTO tmp.ticketIPT (ticketFk, itemPackingTypeFk)
SELECT ticketFk, itemPackingTypeFk
FROM tSalesToMove
GROUP BY ticketFk;
COMMIT;
DROP TEMPORARY TABLE tSalesToMove;
DROP TEMPORARY TABLE
tSale,
tSaleGroup;
END$$
DELIMITER ;

View File

@ -7,6 +7,7 @@ BEGIN
SET packages = (SELECT COUNT(counter)-1
FROM expedition e WHERE e.ticketFk = OLD.ticketFk and e.freightItemFk)
WHERE t.id = OLD.ticketFk;
CALL expedition_selfConsumptionPackaging(OLD.id, 'remove');
END$$
DELIMITER ;

View File

@ -1,3 +1,2 @@
UPDATE vn.sale
SET originalQuantity = quantity
WHERE originalQuantity IS NULL
-- Debido a que tardaba mucho en la subida a master, se ha creado una nueva versión para que el proceso no se vea afectado y se ejecute por la noche.
-- Se crea de nuevo en la versión 11344-grayBamboo

View File

@ -0,0 +1,71 @@
CREATE TABLE IF NOT EXISTS `vn`.`itemTextureTag` (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(50) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name_UNIQUE` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT
CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Natural y encerado');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Natural y esponjoso');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Natural y foam');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Natural y látex');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Arenosa');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Aterciopelado');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Engomado');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Flocado');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Foam');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Gasa');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Goma');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Látex');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Latón');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Mate');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Metálico');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Natural');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Natural y engomado');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Plastificado');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Plastificado y engomado');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Plastificado y rugoso');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Pluma');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Plástico');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Plástico engomado');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Poliéster');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Poliéster texturizado');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Rugoso');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Rígido');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Seminatural');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Silicona');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Suave');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Tela');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Tela con brillo');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Tela con texturas');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Tela dura');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Tela engomada');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Tela escarchada');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Tela flocada');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Tela flocada engomada');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Tela foam');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Tela micro peach');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Tela plastificada');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Tela plástico engomado');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Tela poliéster');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Tela PVC');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Tela ratan');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Tela rigida');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Tela rugosa');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Tela rústica');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Tela sintética');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Tela y cristal');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Tela y foam');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Tela y goma');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Tela y látex');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Tela y madera');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Tela y plástico');
INSERT IGNORE INTO `vn`.`itemTextureTag` (`name`) VALUES ('Tela y seco');
UPDATE vn.tag
SET isFree=0,
sourceTable='itemTextureTag'
WHERE name= 'Textura';
GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE vn.itemTextureTag TO logisticAssist;

View File

@ -0,0 +1,16 @@
CREATE TABLE IF NOT EXISTS vn.saySimpleCountry(
countryFk MEDIUMINT(8) UNSIGNED,
channel INT(4) COMMENT 'channel de whatsapp de saySimple',
PRIMARY KEY (countryFk),
CONSTRAINT `saySimpleCountry_FK` FOREIGN KEY (`countryFk`) REFERENCES vn.country (`id`) ON UPDATE CASCADE
);
CREATE TABLE IF NOT EXISTS vn.saySimpleConfig(
id INT AUTO_INCREMENT PRIMARY KEY,
url VARCHAR(255) NOT NULL
);
INSERT IGNORE INTO vn.saySimpleCountry (countryFk, channel)
VALUES (19, 1169),
(8, 1183),
(NULL, 1320);

View File

@ -0,0 +1,2 @@
ALTER TABLE vn.supplier ADD companySize ENUM('small', 'medium', 'big') NULL;

View File

@ -0,0 +1,8 @@
DELETE FROM salix.ACL
WHERE property IN ('cmrs', 'cmr', 'downloadCmrsZip')
AND model = 'Route';
INSERT INTO salix.ACL (model,property,principalId)
VALUES ('Cmr','filter','production'),
('Cmr','downloadZip','production'),
('Cmr','print','production')

View File

@ -0,0 +1 @@
ALTER TABLE vn.productionConfig DROP COLUMN hasNewLabelMrwMethod;

View File

@ -0,0 +1,2 @@
-- Place your SQL code here
RENAME TABLE vn.stockBuyed__ TO vn.stockBuyed;

View File

@ -0,0 +1 @@
ALTER TABLE vn.dua ADD comment TEXT DEFAULT NULL NULL;

View File

@ -0,0 +1,9 @@
INSERT INTO salix.ACL (model, property, accessType, principalId)
VALUES ('Collection', 'create', 'WRITE', 'productionBoss'),
('Collection', 'upsert', 'WRITE', 'productionBoss'),
('Collection', 'replaceById', 'WRITE', 'productionBoss'),
('Collection', 'updateAll', 'WRITE', 'productionBoss'),
('Collection', 'updateAttributes', 'WRITE', 'productionBoss'),
('Collection', 'deleteById', 'WRITE', 'productionBoss'),
('Collection', 'destroyAll', 'WRITE', 'productionBoss'),
('Collection', 'destroyById', 'WRITE', 'productionBoss');

View File

@ -0,0 +1,3 @@
UPDATE vn.sale
SET originalQuantity = quantity
WHERE originalQuantity IS NULL

View File

@ -0,0 +1,2 @@
ALTER TABLE account.user CHANGE recoverPass recoverPass__ tinyint(3) unsigned NOT NULL DEFAULT 1 COMMENT '@deprecated 2024-11-13';
ALTER TABLE account.user CHANGE sync sync__ tinyint(4) NOT NULL DEFAULT 0 COMMENT '@deprecated 2024-11-13';

View File

@ -0,0 +1,9 @@
DROP TABLE IF EXISTS vn.saySimpleConfig;
CREATE TABLE vn.saySimpleConfig(
id INT AUTO_INCREMENT PRIMARY KEY,
url VARCHAR(255) NOT NULL,
defaultChannel VARCHAR(128)
);
ALTER TABLE vn.saySimpleCountry MODIFY COLUMN channel VARCHAR(128);

View File

@ -0,0 +1,2 @@
ALTER TABLE vn.clientObservation MODIFY COLUMN observationTypeFk tinyint(3) unsigned DEFAULT 4 NOT NULL;
UPDATE vn.clientObservation SET observationTypeFk=4 WHERE observationTypeFk=0;

View File

@ -1,133 +0,0 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
describe('Item summary path', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('employee', 'item');
});
afterAll(async() => {
await browser.close();
});
it('should search for an item', async() => {
await page.doSearch('Ranged weapon');
const resultsCount = await page.countElement(selectors.itemsIndex.searchResult);
await page.waitForTextInElement(selectors.itemsIndex.firstSearchResult, 'Ranged weapon');
await page.waitToClick(selectors.itemsIndex.firstResultPreviewButton);
const isVisible = await page.isVisible(selectors.itemSummary.basicData);
expect(resultsCount).toBe(4);
expect(isVisible).toBeTruthy();
});
it(`should check the item summary preview shows fields from basic data`, async() => {
await page.waitForTextInElement(selectors.itemSummary.basicData, 'Ranged weapon longbow 200cm');
const result = await page.waitToGetProperty(selectors.itemSummary.basicData, 'innerText');
expect(result).toContain('Ranged weapon longbow 200cm');
});
it(`should check the item summary preview shows fields from tags`, async() => {
await page.waitForTextInElement(selectors.itemSummary.tags, 'Brown');
const result = await page.waitToGetProperty(selectors.itemSummary.tags, 'innerText');
expect(result).toContain('Brown');
});
it(`should check the item summary preview shows fields from botanical`, async() => {
await page.waitForTextInElement(selectors.itemSummary.botanical, 'Abelia');
const result = await page.waitToGetProperty(selectors.itemSummary.botanical, 'innerText');
expect(result).toContain('Abelia');
});
it(`should check the item summary preview shows fields from barcode`, async() => {
await page.waitForTextInElement(selectors.itemSummary.barcode, '1');
const result = await page.waitToGetProperty(selectors.itemSummary.barcode, 'innerText');
expect(result).toContain('1');
});
it(`should close the summary popup`, async() => {
await page.closePopup();
await page.waitForSelector(selectors.itemSummary.basicData, {hidden: true});
});
it('should search for other item', async() => {
await page.doSearch('Melee Reinforced');
const resultsCount = await page.countElement(selectors.itemsIndex.searchResult);
await page.waitToClick(selectors.itemsIndex.firstResultPreviewButton);
await page.waitForSelector(selectors.itemSummary.basicData, {visible: true});
expect(resultsCount).toBe(3);
});
it(`should now check the item summary preview shows fields from basic data`, async() => {
await page.waitForTextInElement(selectors.itemSummary.basicData, 'Melee Reinforced weapon combat fist 15cm');
const result = await page.waitToGetProperty(selectors.itemSummary.basicData, 'innerText');
expect(result).toContain('Melee Reinforced weapon combat fist 15cm');
});
it(`should now check the item summary preview shows fields from tags`, async() => {
await page.waitForTextInElement(selectors.itemSummary.tags, 'Silver');
const result = await page.waitToGetProperty(selectors.itemSummary.tags, 'innerText');
expect(result).toContain('Silver');
});
it(`should now check the item summary preview shows fields from botanical`, async() => {
await page.waitForTextInElement(selectors.itemSummary.botanical, '-');
const result = await page.waitToGetProperty(selectors.itemSummary.botanical, 'innerText');
expect(result).toContain('-');
});
it(`should now close the summary popup`, async() => {
await page.closePopup();
await page.waitForSelector(selectors.itemSummary.basicData, {hidden: true});
});
it(`should navigate to one of the items detailed section`, async() => {
await page.accessToSearchResult('Melee weapon combat fist 15cm');
await page.waitForState('item.card.summary');
});
it(`should check the descritor edit button is not visible for employee`, async() => {
const visibleButton = await page.isVisible(selectors.itemDescriptor.editButton);
expect(visibleButton).toBeFalsy();
});
it(`should check the item summary shows fields from basic data section`, async() => {
await page.waitForTextInElement(selectors.itemSummary.basicData, 'Melee weapon combat fist 15cm');
const result = await page.waitToGetProperty(selectors.itemSummary.basicData, 'innerText');
expect(result).toContain('Melee weapon combat fist 15cm');
});
it(`should check the item summary shows fields from tags section`, async() => {
const result = await page.waitToGetProperty(selectors.itemSummary.tags, 'innerText');
expect(result).toContain('Silver');
});
it(`should check the item summary shows fields from botanical section`, async() => {
const result = await page.waitToGetProperty(selectors.itemSummary.botanical, 'innerText');
expect(result).toContain('procera');
});
it(`should check the item summary shows fields from barcodes section`, async() => {
const result = await page.waitToGetProperty(selectors.itemSummary.barcode, 'innerText');
expect(result).toContain('4');
});
});

View File

@ -1,64 +0,0 @@
import getBrowser from '../../helpers/puppeteer';
const $ = {
form: 'vn-item-basic-data form',
intrastatForm: '.vn-dialog.shown form',
newIntrastatButton: 'vn-item-basic-data vn-icon-button[vn-tooltip="New intrastat"] > button'
};
describe('Item Edit basic data path', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('buyer', 'item');
await page.accessToSearchResult('Melee weapon combat fist 15cm');
});
beforeEach(async() => {
await page.accessToSection('item.card.basicData');
});
afterAll(async() => {
await browser.close();
});
it(`should edit the item basic data and confirm the item data was edited`, async() => {
const values = {
type: 'Anthurium',
intrastat: 'Coral y materiales similares',
relevancy: 1,
generic: 'Pallet',
isActive: false,
priceInKg: true,
isFragile: true,
packingOut: 5
};
const message = await page.sendForm($.form, values);
await page.reloadSection('item.card.basicData');
const formValues = await page.fetchForm($.form, Object.keys(values));
expect(message.isSuccess).toBeTrue();
expect(formValues).toEqual(values);
});
it(`should create a new intrastat and save it`, async() => {
await page.click($.newIntrastatButton);
await page.waitForSelector($.intrastatForm);
await page.fillForm($.intrastatForm, {
id: '588420239',
description: 'Tropical Flowers'
});
await page.respondToDialog('accept');
const message = await page.sendForm($.form);
await page.reloadSection('item.card.basicData');
const formValues = await page.fetchForm($.form, ['intrastat']);
expect(message.isSuccess).toBeTrue();
expect(formValues).toEqual({intrastat: 'Tropical Flowers'});
});
});

View File

@ -1,48 +0,0 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
describe('Item edit tax path', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('buyer', 'item');
await page.accessToSearchResult('Ranged weapon longbow 200cm');
await page.accessToSection('item.card.tax');
});
afterAll(async() => {
await browser.close();
});
it(`should add the item tax to all countries`, async() => {
await page.autocompleteSearch(selectors.itemTax.firstClass, 'General VAT');
await page.autocompleteSearch(selectors.itemTax.secondClass, 'General VAT');
await page.waitToClick(selectors.itemTax.submitTaxButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it(`should confirm the first item tax class was edited`, async() => {
await page.reloadSection('item.card.tax');
const firstVatType = await page.waitToGetProperty(selectors.itemTax.firstClass, 'value');
expect(firstVatType).toEqual('General VAT');
});
it(`should confirm the second item tax class was edited`, async() => {
const secondVatType = await page
.waitToGetProperty(selectors.itemTax.secondClass, 'value');
expect(secondVatType).toEqual('General VAT');
});
it(`should edit the first class without saving the form`, async() => {
await page.autocompleteSearch(selectors.itemTax.firstClass, 'Reduced VAT');
const firstVatType = await page.waitToGetProperty(selectors.itemTax.firstClass, 'value');
expect(firstVatType).toEqual('Reduced VAT');
});
});

View File

@ -1,79 +0,0 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
describe('Item create tags path', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('buyer', 'item');
await page.accessToSearchResult('Ranged weapon longbow 200cm');
await page.accessToSection('item.card.tags');
});
afterAll(async() => {
await browser.close();
});
it('should create a new tag and delete a former one', async() => {
await page.waitToClick(selectors.itemTags.fourthRemoveTagButton);
await page.waitToClick(selectors.itemTags.addItemTagButton);
await page.autocompleteSearch(selectors.itemTags.seventhTag, 'Ancho de la base');
await page.write(selectors.itemTags.seventhValue, '50');
await page.clearInput(selectors.itemTags.seventhRelevancy);
await page.write(selectors.itemTags.seventhRelevancy, '4');
await page.waitToClick(selectors.itemTags.submitItemTagsButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it('should confirm the fourth row data is the expected one', async() => {
await page.reloadSection('item.card.tags');
await page.waitForSelector('vn-item-tags');
let result = await page.waitToGetProperty(selectors.itemTags.fourthTag, 'value');
expect(result).toEqual('Ancho de la base');
result = await page
.waitToGetProperty(selectors.itemTags.fourthValue, 'value');
expect(result).toEqual('50');
result = await page
.waitToGetProperty(selectors.itemTags.fourthRelevancy, 'value');
expect(result).toEqual('4');
});
it('should confirm the fifth row data is the expected one', async() => {
let tag = await page
.waitToGetProperty(selectors.itemTags.fifthTag, 'value');
let value = await page
.waitToGetProperty(selectors.itemTags.fifthValue, 'value');
let relevancy = await page
.waitToGetProperty(selectors.itemTags.fifthRelevancy, 'value');
expect(tag).toEqual('Color');
expect(value).toEqual('Brown');
expect(relevancy).toEqual('5');
});
it('should confirm the sixth row data is the expected one', async() => {
let tag = await page
.waitToGetProperty(selectors.itemTags.sixthTag, 'value');
let value = await page
.waitToGetProperty(selectors.itemTags.sixthValue, 'value');
let relevancy = await page
.waitToGetProperty(selectors.itemTags.sixthRelevancy, 'value');
expect(tag).toEqual('Categoria');
expect(value).toEqual('+1 precission');
expect(relevancy).toEqual('6');
});
});

View File

@ -1,66 +0,0 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
describe('Item Create botanical path', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('buyer', 'item');
await page.accessToSearchResult('Ranged weapon pistol 9mm');
await page.accessToSection('item.card.botanical');
});
afterAll(async() => {
await browser.close();
});
it(`should create a new botanical for the item`, async() => {
await page.autocompleteSearch(selectors.itemBotanical.genus, 'Abelia');
await page.autocompleteSearch(selectors.itemBotanical.species, 'dealbata');
await page.waitToClick(selectors.itemBotanical.submitBotanicalButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it(`should confirm the Genus for the item was created`, async() => {
await page.waitForTextInField(selectors.itemBotanical.genus, 'Abelia');
const result = await page
.waitToGetProperty(selectors.itemBotanical.genus, 'value');
expect(result).toEqual('Abelia');
});
it(`should confirm the Species for the item was created`, async() => {
const result = await page
.waitToGetProperty(selectors.itemBotanical.species, 'value');
expect(result).toEqual('dealbata');
});
it(`should edit botanical for the item`, async() => {
await page.autocompleteSearch(selectors.itemBotanical.genus, 'Abies');
await page.autocompleteSearch(selectors.itemBotanical.species, 'decurrens');
await page.waitToClick(selectors.itemBotanical.submitBotanicalButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it(`should confirm the Genus for the item was edited`, async() => {
await page.waitForTextInField(selectors.itemBotanical.genus, 'Abies');
const result = await page
.waitToGetProperty(selectors.itemBotanical.genus, 'value');
expect(result).toEqual('Abies');
});
it(`should confirm the Species for the item was edited`, async() => {
const result = await page
.waitToGetProperty(selectors.itemBotanical.species, 'value');
expect(result).toEqual('decurrens');
});
});

View File

@ -1,37 +0,0 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
describe('Item Create barcodes path', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('buyer', 'item');
await page.accessToSearchResult('Ranged weapon longbow 200cm');
await page.accessToSection('item.card.itemBarcode');
});
afterAll(async() => {
await browser.close();
});
it(`should click create a new code and delete a former one`, async() => {
await page.waitToClick(selectors.itemBarcodes.firstCodeRemoveButton);
await page.waitToClick(selectors.itemBarcodes.addBarcodeButton);
await page.write(selectors.itemBarcodes.thirdCode, '5');
await page.waitToClick(selectors.itemBarcodes.submitBarcodesButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it(`should confirm the barcode 5 is created and it is now the third barcode as the first was deleted`, async() => {
await page.reloadSection('item.card.itemBarcode');
await page.waitForTextInField(selectors.itemBarcodes.thirdCode, '5');
const result = await page
.waitToGetProperty(selectors.itemBarcodes.thirdCode, 'value');
expect(result).toEqual('5');
});
});

View File

@ -1,65 +0,0 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
const $ = {
form: 'vn-item-create form'
};
describe('Item Create', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('buyer', 'item');
});
afterAll(async() => {
await browser.close();
});
it('should access to the create item view by clicking the create floating button', async() => {
await page.waitToClick(selectors.itemsIndex.createItemButton);
await page.waitForState('item.create');
});
it('should return to the item index by clickig the cancel button', async() => {
await page.waitToClick(selectors.itemCreateView.cancelButton);
await page.waitForState('item.index');
});
it('should now access to the create item view by clicking the create floating button', async() => {
await page.waitToClick(selectors.itemsIndex.createItemButton);
await page.waitForState('item.create');
});
it('should throw an error when insert an invalid priority', async() => {
const values = {
name: 'Infinity Gauntlet',
type: 'Crisantemo',
intrastat: 'Coral y materiales similares',
origin: 'Holand',
priority: null
};
const message = await page.sendForm($.form, values);
expect(message.text).toContain('Valid priorities');
});
it('should create the Infinity Gauntlet item', async() => {
const values = {
name: 'Infinity Gauntlet',
type: 'Crisantemo',
intrastat: 'Coral y materiales similares',
origin: 'Holand',
priority: '2'
};
await page.fillForm($.form, values);
const formValues = await page.fetchForm($.form, Object.keys(values));
const message = await page.sendForm($.form);
expect(message.isSuccess).toBeTrue();
expect(formValues).toEqual(values);
});
});

View File

@ -1,141 +0,0 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
describe('Item regularize path', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('employee', 'item');
});
afterAll(async() => {
await browser.close();
});
it('should edit the user local warehouse', async() => {
await page.waitForSpinnerLoad();
await page.waitToClick(selectors.globalItems.userMenuButton);
await page.autocompleteSearch(selectors.globalItems.userLocalWarehouse, 'Warehouse Four');
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it('should check the local settings were saved', async() => {
const userLocalWarehouse = await page
.waitToGetProperty(selectors.globalItems.userLocalWarehouse, 'value');
await page.closePopup();
expect(userLocalWarehouse).toContain('Warehouse Four');
});
it('should search for a specific item', async() => {
await page.accessToSearchResult('Ranged weapon pistol 9mm');
await page.waitForState('item.card.summary');
});
it('should open the regularize dialog and check the warehouse matches the local user settings', async() => {
await page.waitToClick(selectors.itemDescriptor.moreMenu);
await page.waitToClick(selectors.itemDescriptor.moreMenuRegularizeButton);
const result = await page.waitToGetProperty(selectors.itemDescriptor.regularizeWarehouse, 'value');
expect(result).toEqual('Warehouse Four');
});
it('should regularize the item', async() => {
await page.write(selectors.itemDescriptor.regularizeQuantity, '100');
await page.autocompleteSearch(selectors.itemDescriptor.regularizeWarehouse, 'Warehouse One');
await page.waitToClick(selectors.itemDescriptor.regularizeSaveButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it('should click on the Tickets button of the top bar menu', async() => {
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.waitForSelector(selectors.globalItems.applicationsMenuVisible);
await Promise.all([
page.waitForNavigation({waitUntil: ['load', 'networkidle0', 'domcontentloaded']}),
page.waitToClick(selectors.globalItems.ticketsButton)
]);
await page.waitForState('ticket.index');
});
it('should clear the user local settings now', async() => {
await page.waitToClick(selectors.globalItems.userMenuButton);
await page.waitForContentLoaded();
await page.clearInput(selectors.globalItems.userConfigFirstAutocomplete);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it('should search for the ticket with alias missing', async() => {
await page.keyboard.press('Escape');
await page.accessToSearchResult('missing');
await page.waitForState('ticket.card.summary');
});
it(`should check the ticket sale quantity is showing a negative value`, async() => {
await page.waitForTextInElement(selectors.ticketSummary.firstSaleQuantity, '-100');
const result = await page
.waitToGetProperty(selectors.ticketSummary.firstSaleQuantity, 'innerText');
expect(result).toContain('-100');
});
it(`should check the ticket sale discount is 100%`, async() => {
const result = await page
.waitToGetProperty(selectors.ticketSummary.firstSaleDiscount, 'innerText');
expect(result).toContain('100 %');
});
it('should now click on the Items button of the top bar menu', async() => {
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.waitForSelector(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.itemsButton);
await page.waitForState('item.index');
});
it('should search for the item once again', async() => {
await page.accessToSearchResult('Ranged weapon pistol 9mm');
await page.waitForState('item.card.summary');
});
it('should regularize the item once more', async() => {
await page.waitToClick(selectors.itemDescriptor.moreMenu);
await page.waitToClick(selectors.itemDescriptor.moreMenuRegularizeButton);
await page.write(selectors.itemDescriptor.regularizeQuantity, '100');
await page.autocompleteSearch(selectors.itemDescriptor.regularizeWarehouse, 'Warehouse One');
await page.waitToClick(selectors.itemDescriptor.regularizeSaveButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it('should again click on the Tickets button of the top bar menu', async() => {
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.waitForSelector(selectors.globalItems.applicationsMenuVisible);
await Promise.all([
page.waitForNavigation({waitUntil: ['load', 'networkidle0', 'domcontentloaded']}),
page.waitToClick(selectors.globalItems.ticketsButton)
]);
await page.waitForState('ticket.index');
});
it('should search for the ticket missing once again', async() => {
await page.accessToSearchResult('Missing');
await page.waitForState('ticket.card.summary');
});
it(`should check the ticket contains now two sales`, async() => {
await page.waitForTextInElement(selectors.ticketSummary.firstSaleQuantity, '-100');
const result = await page.countElement(selectors.ticketSummary.sale);
expect(result).toEqual(2);
});
});

View File

@ -1,84 +0,0 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
describe('Item index path', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('salesPerson', 'item');
await page.waitToClick(selectors.globalItems.searchButton);
});
afterAll(async() => {
await browser.close();
});
it('should click on the fields to show button to open the list of columns to show', async() => {
await page.waitToClick(selectors.itemsIndex.shownColumns);
const visible = await page.isVisible(selectors.itemsIndex.shownColumnsList);
expect(visible).toBeTruthy();
});
it('should unmark all checkboxes except the first and the last ones', async() => {
await page.waitToClick(selectors.itemsIndex.idCheckbox);
await page.waitToClick(selectors.itemsIndex.stemsCheckbox);
await page.waitToClick(selectors.itemsIndex.sizeCheckbox);
await page.waitToClick(selectors.itemsIndex.typeCheckbox);
await page.waitToClick(selectors.itemsIndex.categoryCheckbox);
await page.waitToClick(selectors.itemsIndex.intrastadCheckbox);
await page.waitToClick(selectors.itemsIndex.originCheckbox);
await page.waitToClick(selectors.itemsIndex.buyerCheckbox);
await page.waitToClick(selectors.itemsIndex.weightByPieceCheckbox);
await page.waitToClick(selectors.itemsIndex.saveFieldsButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it('should navigate forth and back to see the images column is still visible', async() => {
await page.closePopup();
await page.waitToClick(selectors.itemsIndex.firstSearchResult);
await page.waitToClick(selectors.itemDescriptor.goBackToModuleIndexButton);
await page.waitToClick(selectors.globalItems.searchButton);
await page.waitForSelector(selectors.itemsIndex.searchResult);
await page.waitImgLoad(selectors.itemsIndex.firstItemImage);
const imageVisible = await page.isVisible(selectors.itemsIndex.firstItemImageTd);
expect(imageVisible).toBeTruthy();
});
it('should check the ids column is not visible', async() => {
await page.waitForSelector(selectors.itemsIndex.firstItemId, {hidden: true});
});
it('should mark all unchecked boxes to leave the index as it was', async() => {
await page.waitToClick(selectors.itemsIndex.shownColumns);
await page.waitToClick(selectors.itemsIndex.idCheckbox);
await page.waitToClick(selectors.itemsIndex.stemsCheckbox);
await page.waitToClick(selectors.itemsIndex.sizeCheckbox);
await page.waitToClick(selectors.itemsIndex.typeCheckbox);
await page.waitToClick(selectors.itemsIndex.categoryCheckbox);
await page.waitToClick(selectors.itemsIndex.intrastadCheckbox);
await page.waitToClick(selectors.itemsIndex.originCheckbox);
await page.waitToClick(selectors.itemsIndex.buyerCheckbox);
await page.waitToClick(selectors.itemsIndex.weightByPieceCheckbox);
await page.waitToClick(selectors.itemsIndex.saveFieldsButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it('should now navigate forth and back to see the ids column is now visible', async() => {
await page.closePopup();
await page.waitToClick(selectors.itemsIndex.firstSearchResult);
await page.waitToClick(selectors.itemDescriptor.goBackToModuleIndexButton);
await page.waitToClick(selectors.globalItems.searchButton);
await page.waitForSelector(selectors.itemsIndex.searchResult);
const idVisible = await page.isVisible(selectors.itemsIndex.firstItemId);
expect(idVisible).toBeTruthy();
});
});

View File

@ -1,45 +0,0 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
describe('Item log path', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('developer', 'item');
});
afterAll(async() => {
await browser.close();
});
it(`should search for the Knowledge artifact to confirm it isn't created yet`, async() => {
await page.doSearch('Knowledge artifact');
const nResults = await page.countElement(selectors.itemsIndex.searchResult);
expect(nResults).toEqual(1);
});
it('should access to the create item view by clicking the create floating button', async() => {
await page.waitToClick(selectors.itemsIndex.createItemButton);
await page.waitForState('item.create');
});
it('should create the Knowledge artifact item', async() => {
await page.write(selectors.itemCreateView.temporalName, 'Knowledge artifact');
await page.autocompleteSearch(selectors.itemCreateView.type, 'Crisantemo');
await page.autocompleteSearch(selectors.itemCreateView.intrastat, 'Coral y materiales similares');
await page.autocompleteSearch(selectors.itemCreateView.origin, 'Holand');
await page.waitToClick(selectors.itemCreateView.createButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it('should return to the items index by clicking the return to items button', async() => {
await page.waitToClick(selectors.itemBasicData.goToItemIndexButton);
await page.waitForSelector(selectors.itemsIndex.createItemButton);
await page.waitForState('item.index');
});
});

View File

@ -1,41 +0,0 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
describe('Item descriptor path', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('buyer', 'item');
await page.accessToSearchResult('1');
await page.accessToSection('item.card.basicData');
});
afterAll(async() => {
await browser.close();
});
it('should set the item to inactive', async() => {
await page.waitToClick(selectors.itemBasicData.isActiveCheckbox);
await page.waitToClick(selectors.itemBasicData.submitBasicDataButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it('should reload the section and check the inactive icon is visible', async() => {
await page.reloadSection('item.card.basicData');
const visibleIcon = await page.isVisible(selectors.itemDescriptor.inactiveIcon);
expect(visibleIcon).toBeTruthy();
});
it('should set the item back to active', async() => {
await page.waitToClick(selectors.itemBasicData.isActiveCheckbox);
await page.waitToClick(selectors.itemBasicData.submitBasicDataButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
});

View File

@ -1,45 +0,0 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
describe('Item request path', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('buyer', 'item');
await page.accessToSection('item.request');
});
afterAll(async() => {
await browser.close();
});
it('should reach the item request section', async() => {
await page.waitForState('item.request');
});
it('should fill the id and quantity then check the concept was updated', async() => {
await page.writeOnEditableTD(selectors.itemRequest.firstRequestItemID, '4');
await page.writeOnEditableTD(selectors.itemRequest.firstRequestQuantity, '10');
await page.waitForTextInElement(selectors.itemRequest.firstRequestConcept, 'Melee weapon heavy shield 100cm');
let filledConcept = await page.waitToGetProperty(selectors.itemRequest.firstRequestConcept, 'innerText');
expect(filledConcept).toContain('Melee weapon heavy shield 100cm');
});
it('should check the status of the request should now be accepted', async() => {
let status = await page.waitToGetProperty(selectors.itemRequest.firstRequestStatus, 'innerText');
expect(status).toContain('Accepted');
});
it('should now click on the second declain request icon then type the reason', async() => {
await page.waitToClick(selectors.itemRequest.secondRequestDecline);
await page.write(selectors.itemRequest.declineReason, 'Not quite as expected');
await page.respondToDialog('accept');
let status = await page.waitToGetProperty(selectors.itemRequest.secondRequestStatus, 'innerText');
expect(status).toContain('Denied');
});
});

View File

@ -1,97 +0,0 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
const $ = selectors.itemFixedPrice;
describe('Item fixed prices path', () => {
let browser;
let page;
let httpRequest;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('buyer', 'item');
await page.accessToSection('item.fixedPrice');
page.on('request', req => {
if (req.url().includes(`FixedPrices/filter`))
httpRequest = req.url();
});
});
afterAll(async() => {
await browser.close();
});
it('should filter using all the fields', async() => {
await page.write($.generalSearchFilter, 'item');
await page.keyboard.press('Enter');
expect(httpRequest).toContain('search=item');
await page.click($.chip);
await page.click($.reignFilter);
expect(httpRequest).toContain('categoryFk');
await page.autocompleteSearch($.typeFilter, 'Alstroemeria');
expect(httpRequest).toContain('typeFk');
await page.click($.chip);
await page.autocompleteSearch($.buyerFilter, 'buyerNick');
expect(httpRequest).toContain('buyerFk');
await page.click($.chip);
await page.autocompleteSearch($.warehouseFilter, 'Algemesi');
expect(httpRequest).toContain('warehouseFk');
await page.click($.chip);
await page.click($.mineFilter);
expect(httpRequest).toContain('mine=true');
await page.click($.chip);
await page.click($.hasMinPriceFilter);
expect(httpRequest).toContain('hasMinPrice=true');
await page.click($.chip);
await page.click($.addTag);
await page.autocompleteSearch($.tagFilter, 'Color');
await page.autocompleteSearch($.tagValueFilter, 'Brown');
expect(httpRequest).toContain('tags');
await page.click($.chip);
});
it('should click on the add new fixed price button', async() => {
await page.waitToClick($.add);
await page.waitForSelector($.fourthFixedPrice);
});
it('should fill the fixed price data', async() => {
const now = Date.vnNew();
await page.autocompleteSearch($.fourthWarehouse, 'Warehouse one');
await page.writeOnEditableTD($.fourthGroupingPrice, '1');
await page.writeOnEditableTD($.fourthPackingPrice, '1');
await page.write($.fourthMinPrice, '1');
await page.pickDate($.fourthStarted, now);
await page.pickDate($.fourthEnded, now);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it('should reload the section and check the created price has the expected ID', async() => {
await page.goto(`http://localhost:5000/#!/item/fixed-price`);
await page.autocompleteSearch($.warehouseFilter, 'Warehouse one');
await page.click($.chip);
const result = await page.waitToGetProperty($.fourthItemID, 'value');
expect(result).toContain('13');
});
});

View File

@ -1,99 +0,0 @@
import selectors from '../../../helpers/selectors.js';
import getBrowser from '../../../helpers/puppeteer';
describe('Ticket List sale path', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('employee', 'ticket');
await page.accessToSearchResult('13');
await page.accessToSection('ticket.card.sale');
});
afterAll(async() => {
await browser.close();
});
it('should confirm the first ticket sale contains the colour tag', async() => {
const value = await page
.waitToGetProperty(selectors.ticketSales.firstSaleColour, 'innerText');
expect(value).toContain('Black');
});
it('should confirm the first sale contains the price', async() => {
const value = await page
.waitToGetProperty(selectors.ticketSales.firstSalePrice, 'innerText');
expect(value).toContain('1.72');
});
it('should confirm the first sale contains the discount', async() => {
const value = await page
.waitToGetProperty(selectors.ticketSales.firstSaleDiscount, 'innerText');
expect(value).toContain('0.00%');
});
it('should confirm the first sale contains the total import', async() => {
const value = await page
.waitToGetProperty(selectors.ticketSales.firstSaleImport, 'innerText');
expect(value).toContain('34.40');
});
it('should add an empty item to the sale list', async() => {
await page.waitToClick(selectors.ticketSales.newItemButton);
const sales = await page
.countElement(selectors.ticketSales.saleLine);
expect(sales).toEqual(2);
});
it('should select a valid item to be added as the second item in the sales list', async() => {
let searchValue = 'Melee weapon heavy shield 100cm';
await page.autocompleteSearch(selectors.ticketSales.secondSaleIdAutocomplete, searchValue);
await page.waitToClick(selectors.ticketSales.secondSaleQuantityCell);
await page.type(selectors.ticketSales.secondSaleQuantity, '8');
await page.keyboard.press('Enter');
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it('should update the description of the new sale', async() => {
await page.click(selectors.ticketSales.secondSaleConceptCell);
await page.write(selectors.ticketSales.secondSaleConceptInput, 'Aegis of Valor');
await page.keyboard.press('Enter');
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it('should add a third empty item to the sale list', async() => {
await page.waitToClick(selectors.ticketSales.newItemButton);
await page.waitForNumberOfElements(selectors.ticketSales.saleLine, 3);
const sales = await page.countElement(selectors.ticketSales.saleLine);
expect(sales).toEqual(3);
});
it('should select the 2nd and 3th item and delete both', async() => {
await page.waitToClick(selectors.ticketSales.secondSaleCheckbox);
await page.waitToClick(selectors.ticketSales.thirdSaleCheckbox);
await page.waitToClick(selectors.ticketSales.deleteSaleButton);
await page.waitToClick(selectors.globalItems.acceptButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it(`should verify there's only 1 single line remaining`, async() => {
const sales = await page.countElement(selectors.ticketSales.saleLine);
expect(sales).toEqual(1);
});
});

View File

@ -1,415 +0,0 @@
import selectors from '../../../helpers/selectors.js';
import getBrowser from '../../../helpers/puppeteer';
describe('Ticket Edit sale path', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('salesPerson', 'ticket');
await page.accessToSearchResult('16');
await page.accessToSection('ticket.card.sale');
});
afterAll(async() => {
await browser.close();
});
it(`should click on the first sale claim icon to navigate over there`, async() => {
await page.waitToClick(selectors.ticketSales.firstSaleClaimIcon);
await page.waitForNavigation();
await page.goBack();
await page.goBack();
});
it('should navigate to the tickets index', async() => {
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.waitForSelector(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.ticketsButton);
await page.waitForState('ticket.index');
});
it(`should search for a ticket and then navigate to it's sales`, async() => {
await page.accessToSearchResult('16');
await page.accessToSection('ticket.card.sale');
});
it(`should set the ticket as libre`, async() => {
const searchValue = 'libre';
await page.waitToClick(selectors.ticketSales.stateMenuButton);
await page.write(selectors.ticketSales.moreMenuState, searchValue);
try {
await page.waitForFunction(searchValue => {
const element = document.querySelector('li.active');
if (element)
return element.innerText.toLowerCase().includes(searchValue.toLowerCase());
}, {}, searchValue);
} catch (error) {
const builtSelector = await page.selectorFormater(selectors.ticketSales.moreMenuState);
const inputValue = await page.evaluate(() => {
return document.querySelector('.vn-drop-down.shown vn-textfield input').value;
});
throw new Error(`${builtSelector} value is ${inputValue}! ${error}`);
}
await page.waitForState('ticket.card.sale');
await page.keyboard.press('Enter');
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it(`should check it's state is libre now`, async() => {
await page.waitForTextInElement(selectors.ticketDescriptor.stateLabelValue, 'Libre');
const result = await page.waitToGetProperty(selectors.ticketDescriptor.stateLabelValue, 'innerText');
expect(result).toEqual('State Libre');
});
it(`should set the ticket as OK`, async() => {
await page.waitToClick(selectors.ticketSales.setOk);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it(`should check it's state is OK now`, async() => {
await page.waitForTextInElement(selectors.ticketDescriptor.stateLabelValue, 'OK');
const result = await page.waitToGetProperty(selectors.ticketDescriptor.stateLabelValue, 'innerText');
expect(result).toEqual('State OK');
});
it(`should check the zoomed image isn't present`, async() => {
const result = await page.countElement(selectors.ticketSales.firstSaleZoomedImage);
expect(result).toEqual(0);
});
it(`should click on the thumbnail image of the 1st sale and see the zoomed image`, async() => {
await page.waitToClick(selectors.ticketSales.firstSaleThumbnailImage);
const result = await page.countElement(selectors.ticketSales.firstSaleZoomedImage);
expect(result).toEqual(1);
});
it(`should click on the zoomed image to close it`, async() => {
await page.waitToClick(selectors.ticketSales.firstSaleZoomedImage);
const result = await page.countElement(selectors.ticketSales.firstSaleZoomedImage);
expect(result).toEqual(0);
});
it(`should click on the first sale ID making now the item descriptor visible`, async() => {
await page.waitToClick(selectors.ticketSales.firstSaleId);
await page.waitImgLoad(selectors.ticketSales.firstSaleDescriptorImage);
const visible = await page.isVisible(selectors.ticketSales.saleDescriptorPopover);
expect(visible).toBeTruthy();
});
it(`should click on the descriptor image of the 1st sale and see the zoomed image`, async() => {
await page.waitToClick('vn-item-descriptor img');
const result = await page.countElement(selectors.ticketSales.firstSaleZoomedImage);
expect(result).toEqual(1);
});
it(`should now click on the zoomed image to close it`, async() => {
await page.waitToClick(selectors.ticketSales.firstSaleZoomedImage);
const result = await page.countElement(selectors.ticketSales.firstSaleZoomedImage);
expect(result).toEqual(0);
});
it(`should click on the summary icon of the item-descriptor to access to the item summary`, async() => {
await page.waitToClick(selectors.ticketSales.saleDescriptorPopoverSummaryButton);
await page.waitForState('item.card.summary');
});
it('should return to ticket sales section', async() => {
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.waitForSelector(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.ticketsButton);
await page.accessToSearchResult('16');
await page.accessToSection('ticket.card.sale');
});
it('should remove 1 from the first sale quantity', async() => {
await page.waitToClick(selectors.ticketSales.firstSaleQuantityCell);
await page.waitForSelector(selectors.ticketSales.firstSaleQuantity);
await page.type(selectors.ticketSales.firstSaleQuantity, '9\u000d');
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it('should update the price', async() => {
await page.waitToClick(selectors.ticketSales.firstSalePrice);
await page.waitForSelector(selectors.ticketSales.firstSalePriceInput);
await page.type(selectors.ticketSales.firstSalePriceInput, '5\u000d');
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it('should confirm the price have been updated', async() => {
const result = await page.waitToGetProperty(selectors.ticketSales.firstSalePrice, 'innerText');
expect(result).toContain('5.00');
});
it('should confirm the total price for that item have been updated', async() => {
const result = await page.waitToGetProperty(selectors.ticketSales.firstSaleImport, 'innerText');
expect(result).toContain('45.00');
});
it('should update the discount', async() => {
await page.waitToClick(selectors.ticketSales.firstSaleDiscount);
await page.waitForSelector(selectors.ticketSales.firstSaleDiscountInput);
await page.type(selectors.ticketSales.firstSaleDiscountInput, '50');
await page.waitToClick(selectors.ticketSales.saveSaleDiscountButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it('should confirm the discount have been updated', async() => {
await page.waitForTextInElement(selectors.ticketSales.firstSaleDiscount, '50.00%');
const result = await page.waitToGetProperty(selectors.ticketSales.firstSaleDiscount, 'innerText');
expect(result).toContain('50.00%');
});
it('should confirm the total import for that item have been updated', async() => {
await page.waitForTextInElement(selectors.ticketSales.firstSaleImport, '22.50');
const result = await page.waitToGetProperty(selectors.ticketSales.firstSaleImport, 'innerText');
expect(result).toContain('22.50');
});
it('should recalculate price of sales', async() => {
await page.waitToClick(selectors.ticketSales.firstSaleCheckbox);
await page.waitToClick(selectors.ticketSales.secondSaleCheckbox);
await page.waitToClick(selectors.ticketSales.moreMenu);
await page.waitToClick(selectors.ticketSales.moreMenuRecalculatePrice);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it('should log in as salesAssistant and navigate to ticket sales', async() => {
await page.loginAndModule('salesAssistant', 'ticket');
await page.accessToSearchResult('15');
await page.accessToSection('ticket.card.sale');
});
it('should select the first sale and create a refund with warehouse', async() => {
await page.waitToClick(selectors.ticketSales.firstSaleCheckbox);
await page.waitToClick(selectors.ticketSales.moreMenu);
await page.waitToClick(selectors.ticketSales.moreMenuRefund);
await page.waitToClick(selectors.ticketSales.refundWithWarehouse);
await page.waitForSnackbar();
await page.waitForState('ticket.card.sale');
});
it('should select the first sale and create a refund without warehouse', async() => {
await page.accessToSearchResult('18');
await page.waitToClick(selectors.ticketSales.firstSaleCheckbox);
await page.waitToClick(selectors.ticketSales.moreMenu);
await page.waitToClick(selectors.ticketSales.moreMenuRefund);
await page.waitToClick(selectors.ticketSales.refundWithoutWarehouse);
await page.waitForSnackbar();
await page.waitForState('ticket.card.sale');
});
it('should show error trying to delete a ticket with a refund', async() => {
await page.loginAndModule('salesPerson', 'ticket');
await page.accessToSearchResult('8');
await page.waitToClick(selectors.ticketDescriptor.moreMenu);
await page.waitToClick(selectors.ticketDescriptor.moreMenuDeleteTicket);
await page.waitToClick(selectors.globalItems.acceptButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Tickets with associated refunds can\'t be deleted');
await page.waitToClick(selectors.globalItems.cancelButton);
});
it('should select the third sale and create a claim of it', async() => {
await page.accessToSearchResult('16');
await page.accessToSection('ticket.card.sale');
await page.waitToClick(selectors.ticketSales.thirdSaleCheckbox);
await page.waitToClick(selectors.ticketSales.moreMenu);
await page.waitToClick(selectors.ticketSales.moreMenuCreateClaim);
await page.waitToClick(selectors.globalItems.acceptButton);
await page.waitForNavigation();
});
it('should search for a ticket then access to the sales section', async() => {
await page.goBack();
await page.goBack();
await page.loginAndModule('salesPerson', 'ticket');
await page.accessToSearchResult('16');
await page.accessToSection('ticket.card.sale');
});
it('should select the third sale and delete it', async() => {
await page.waitToClick(selectors.ticketSales.thirdSaleCheckbox);
await page.waitToClick(selectors.ticketSales.deleteSaleButton);
await page.waitToClick(selectors.globalItems.acceptButton);
await page.waitForSpinnerLoad();
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it(`should confirm the third sale was deleted`, async() => {
const result = await page.countElement(selectors.ticketSales.saleLine);
expect(result).toEqual(3);
});
it('should select the second sale and transfer it to a valid ticket', async() => {
const targetTicketId = '12';
await page.waitToClick(selectors.ticketSales.secondSaleCheckbox);
await page.waitToClick(selectors.ticketSales.transferSaleButton);
await page.waitToClick(selectors.ticketSales.transferQuantityCell);
await page.type(selectors.ticketSales.transferQuantityInput, '10\u000d');
await page.type(selectors.ticketSales.moveToTicketInput, targetTicketId);
await page.waitToClick(selectors.ticketSales.moveToTicketButton);
await page.expectURL(`ticket/${targetTicketId}/sale`);
});
it('should confirm the transfered line is the correct one', async() => {
await page.waitForSelector(selectors.ticketSales.secondSaleText);
const result = await page.waitToGetProperty(selectors.ticketSales.secondSaleText, 'innerText');
expect(result).toContain(`Melee weapon heavy shield`);
});
it('should confirm the transfered quantity is the correct one', async() => {
const result = await page.waitToGetProperty(selectors.ticketSales.firstSaleQuantityCell, 'innerText');
expect(result).toContain('20');
});
it('should go back to the original ticket sales section', async() => {
await page.waitToClick(selectors.ticketDescriptor.goBackToModuleIndexButton);
await page.accessToSearchResult('16');
await page.accessToSection('ticket.card.sale');
});
it(`should confirm the original ticket has still three lines`, async() => {
await page.waitForSelector(selectors.ticketSales.saleLine);
const result = await page.countElement(selectors.ticketSales.saleLine);
expect(result).toEqual(3);
});
it(`should confirm the second sale quantity is now half of it's original value after the transfer`, async() => {
const result = await page.waitToGetProperty(selectors.ticketSales.secondSaleQuantityCell, 'innerText');
expect(result).toContain('10');
});
it('should go back to the receiver ticket sales section', async() => {
await page.waitToClick(selectors.ticketDescriptor.goBackToModuleIndexButton);
await page.accessToSearchResult('12');
await page.accessToSection('ticket.card.sale');
});
it('should transfer the sale back to the original ticket', async() => {
const targetTicketId = '16';
await page.waitToClick(selectors.ticketSales.secondSaleCheckbox);
await page.waitToClick(selectors.ticketSales.transferSaleButton);
await page.type(selectors.ticketSales.moveToTicketInput, targetTicketId);
await page.waitToClick(selectors.ticketSales.moveToTicketButton);
await page.expectURL(`ticket/${targetTicketId}/sale`);
});
it('should confirm the original ticket received the line', async() => {
const expectedLines = 4;
await page.waitForNumberOfElements(selectors.ticketSales.saleLine, expectedLines);
const result = await page.countElement(selectors.ticketSales.saleLine);
expect(result).toEqual(expectedLines);
});
it(`should throw an error when attempting to create a ticket for an inactive client`, async() => {
await page.waitToClick(selectors.ticketSales.firstSaleCheckbox);
await page.waitToClick(selectors.ticketSales.transferSaleButton);
await page.waitToClick(selectors.ticketSales.moveToNewTicketButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain(`You can't create a ticket for an inactive client`);
await page.closePopup();
});
it('should go now to the ticket sales section of an active, not frozen client', async() => {
await page.waitToClick(selectors.ticketDescriptor.goBackToModuleIndexButton);
await page.accessToSearchResult('13');
await page.accessToSection('ticket.card.sale');
});
it(`should select all sales, tranfer them to a new ticket and delete the sender ticket as it would've been left empty`, async() => {
const senderTicketId = '13';
await page.waitToClick(selectors.ticketSales.selectAllSalesCheckbox);
await page.waitToClick(selectors.ticketSales.transferSaleButton);
await page.waitToClick(selectors.ticketSales.moveToNewTicketButton);
await page.evaluate((selector, ticketId) => {
return document.querySelector(selector).innerText.toLowerCase().indexOf(`#${ticketId}`) == -1;
}, selectors.ticketDescriptor.id, senderTicketId);
await page.waitForState('ticket.card.sale');
});
it('should confirm the new ticket received the line', async() => {
const expectedLines = 1;
const result = await page.countElement(selectors.ticketSales.saleLine);
expect(result).toEqual(expectedLines);
});
it('should check the first sale reserved icon isnt visible', async() => {
const result = await page.isVisible(selectors.ticketSales.firstSaleReservedIcon);
expect(result).toBeFalsy();
});
it('should mark the first sale as reserved', async() => {
await page.waitToClick(selectors.ticketSales.firstSaleCheckbox);
await page.waitToClick(selectors.ticketSales.moreMenu);
await page.waitToClick(selectors.ticketSales.moreMenuReserve);
await page.closePopup();
await page.waitForClassNotPresent(selectors.ticketSales.firstSaleReservedIcon, 'ng-hide');
const result = await page.isVisible(selectors.ticketSales.firstSaleReservedIcon);
expect(result).toBeTruthy();
});
it('should unmark the first sale as reserved', async() => {
await page.waitToClick(selectors.ticketSales.moreMenu);
await page.waitToClick(selectors.ticketSales.moreMenuUnmarkReseved);
await page.waitForClassPresent(selectors.ticketSales.firstSaleReservedIcon, 'ng-hide');
const result = await page.isVisible(selectors.ticketSales.firstSaleReservedIcon);
expect(result).toBeFalsy();
});
it('should log in as Production role and go to a target ticket summary', async() => {
await page.loginAndModule('production', 'ticket');
await page.accessToSearchResult('13');
await page.waitForState('ticket.card.summary');
});
it(`should check the ticket is deleted`, async() => {
await page.waitForSelector(selectors.ticketDescriptor.isDeletedIcon);
});
});

View File

@ -1,50 +0,0 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
describe('Ticket Create notes path', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('employee', 'ticket');
await page.accessToSearchResult('5');
await page.accessToSection('ticket.card.observation');
});
afterAll(async() => {
await browser.close();
});
it('should create a new note', async() => {
await page.waitToClick(selectors.ticketNotes.addNoteButton);
await page.autocompleteSearch(selectors.ticketNotes.firstNoteType, 'ItemPicker');
await page.write(selectors.ticketNotes.firstDescription, 'description');
await page.waitToClick(selectors.ticketNotes.submitNotesButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it('should confirm the note is the expected one', async() => {
await page.reloadSection('ticket.card.observation');
const result = await page
.waitToGetProperty(selectors.ticketNotes.firstNoteType, 'value');
expect(result).toEqual('ItemPicker');
const firstDescription = await page
.waitToGetProperty(selectors.ticketNotes.firstDescription, 'value');
expect(firstDescription).toEqual('description');
});
it('should delete the note', async() => {
await page.waitToClick(selectors.ticketNotes.firstNoteRemoveButton);
await page.waitToClick(selectors.ticketNotes.submitNotesButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
});

View File

@ -1,32 +0,0 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
describe('Ticket expeditions and log path', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('production', 'ticket');
await page.accessToSearchResult('1');
await page.accessToSection('ticket.card.expedition');
});
afterAll(async() => {
await browser.close();
});
it(`should delete a former expedition and confirm the remaining expedition are the expected ones`, async() => {
await page.waitToClick(selectors.ticketExpedition.thirdSaleCheckbox);
await page.waitToClick(selectors.ticketExpedition.deleteExpeditionButton);
await page.waitToClick(selectors.globalItems.acceptButton);
await page.reloadSection('ticket.card.expedition');
await page.waitForSelector(selectors.ticketExpedition.expeditionRow, {});
const result = await page
.countElement(selectors.ticketExpedition.expeditionRow);
expect(result).toEqual(6);
});
});

View File

@ -1,78 +0,0 @@
import getBrowser from '../../helpers/puppeteer';
const $ = {
firstPackage: 'vn-autocomplete[label="Package"]',
firstQuantity: 'vn-ticket-package vn-horizontal:nth-child(1) vn-input-number[ng-model="package.quantity"]',
firstRemovePackageButton: 'vn-icon-button[vn-tooltip="Remove package"]',
addPackageButton: 'vn-icon-button[vn-tooltip="Add package"]',
savePackagesButton: `button[type=submit]`
};
describe('Ticket Create packages path', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('employee', 'ticket');
await page.accessToSearchResult('1');
await page.accessToSection('ticket.card.package');
});
afterAll(async() => {
await browser.close();
});
it(`should attempt create a new package but receive an error if package is blank`, async() => {
await page.waitToClick($.firstRemovePackageButton);
await page.waitToClick($.addPackageButton);
await page.write($.firstQuantity, '99');
await page.waitToClick($.savePackagesButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Package cannot be blank');
});
it(`should delete the first package and receive and error to save a new one with blank quantity`, async() => {
await page.clearInput($.firstQuantity);
await page.autocompleteSearch($.firstPackage, 'Container medical box 100cm');
await page.waitToClick($.savePackagesButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Some fields are invalid');
});
it(`should confirm the quantity input isn't invalid yet`, async() => {
const result = await page
.evaluate(selector => {
return document.querySelector(`${selector} input`).checkValidity();
}, $.firstQuantity);
expect(result).toBeTruthy();
});
it(`should create a new package with correct data`, async() => {
await page.clearInput($.firstQuantity);
await page.write($.firstQuantity, '-99');
await page.waitToClick($.savePackagesButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it(`should confirm the first select is the expected one`, async() => {
await page.reloadSection('ticket.card.package');
await page.waitForTextInField($.firstPackage, 'Container medical box 100cm');
const result = await page.waitToGetProperty($.firstPackage, 'value');
expect(result).toEqual('Container medical box 100cm');
});
it(`should confirm quantity is just a number and the string part was ignored by the imput number`, async() => {
await page.waitForTextInField($.firstQuantity, '-99');
const result = await page.waitToGetProperty($.firstQuantity, 'value');
expect(result).toEqual('-99');
});
});

View File

@ -1,72 +0,0 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
describe('Ticket Create new tracking state path', () => {
let browser;
let page;
afterAll(async() => {
await browser.close();
});
describe('as production', () => {
it('should log into the ticket 1 tracking', async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('production', 'ticket');
await page.accessToSearchResult('1');
await page.accessToSection('ticket.card.tracking.index');
});
it('should access to the create state view by clicking the create floating button', async() => {
await page.waitToClick(selectors.ticketTracking.createStateButton);
await page.waitForSelector(selectors.createStateView.state, {visible: true});
await page.waitForState('ticket.card.tracking.edit');
});
it(`should create a new state`, async() => {
await page.autocompleteSearch(selectors.createStateView.state, 'OK');
await page.waitToClick(selectors.createStateView.saveStateButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
});
describe('as salesPerson', () => {
it('should now log into the ticket 1 tracking', async() => {
await page.loginAndModule('salesPerson', 'ticket');
await page.accessToSearchResult('1');
await page.accessToSection('ticket.card.tracking.index');
});
it('should now access to the create state view by clicking the create floating button', async() => {
await page.waitForSelector('.vn-popup', {hidden: true});
await page.waitToClick(selectors.ticketTracking.createStateButton);
await page.waitForState('ticket.card.tracking.edit');
});
it(`should attemp to create an state for which salesPerson doesn't have permissions`, async() => {
await page.autocompleteSearch(selectors.createStateView.state, 'Encajado');
await page.waitToClick(selectors.createStateView.saveStateButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain(`You don't have enough privileges`);
});
it(`should make sure the worker gets autocomplete uppon selecting the assigned state`, async() => {
await page.autocompleteSearch(selectors.createStateView.state, 'asignado');
const result = await page
.waitToGetProperty(selectors.createStateView.worker, 'value');
expect(result).toEqual('salesperson');
});
it(`should succesfully create a valid state`, async() => {
await page.waitToClick(selectors.createStateView.saveStateButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
});
});

View File

@ -1,143 +0,0 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
describe('Ticket Edit basic data path', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('employee', 'ticket');
await page.accessToSearchResult('11');
await page.accessToSection('ticket.card.basicData.stepOne');
});
afterAll(async() => {
await browser.close();
});
it(`should confirm the zone autocomplete is disabled unless your role is productionBoss`, async() => {
await page.waitForSelector(selectors.ticketBasicData.zone, {});
const disabled = await page.evaluate(selector => {
return document.querySelector(selector).disabled;
}, `${selectors.ticketBasicData.zone} input`);
expect(disabled).toBeTruthy();
});
it(`should now log as productionBoss to perform the rest of the tests`, async() => {
await page.loginAndModule('productionBoss', 'ticket');
await page.accessToSearchResult('11');
await page.accessToSection('ticket.card.basicData.stepOne');
});
it(`should confirm the zone autocomplete is enabled for the role productionBoss`, async() => {
await page.waitForSpinnerLoad();
await page.waitForSelector(selectors.ticketBasicData.zone);
const disabled = await page.evaluate(selector => {
return document.querySelector(selector).disabled;
}, `${selectors.ticketBasicData.zone} input`);
expect(disabled).toBeFalsy();
});
it(`should check the zone is for Gotham247`, async() => {
let zone = await page
.waitToGetProperty(selectors.ticketBasicData.zone, 'value');
expect(zone).toContain('Zone 247 A');
});
it(`should edit the ticket agency then check there are no zones for it`, async() => {
await page.autocompleteSearch(selectors.ticketBasicData.agency, 'Super-Man delivery');
let emptyZone = await page
.expectPropertyValue(selectors.ticketBasicData.zone, 'value', '');
expect(emptyZone).toBeTruthy();
});
it(`should edit the ticket zone then check the agency is for the new zone`, async() => {
await page.clearInput(selectors.ticketBasicData.agency);
await page.autocompleteSearch(selectors.ticketBasicData.zone, 'Zone expensive A');
let zone = await page
.waitToGetProperty(selectors.ticketBasicData.agency, 'value');
expect(zone).toContain('Gotham247Expensive');
});
it(`should click next`, async() => {
await page.waitToClick(selectors.ticketBasicData.nextStepButton);
await page.waitForState('ticket.card.basicData.stepTwo');
});
it(`should have a price diference`, async() => {
const result = await page
.waitToGetProperty(selectors.ticketBasicData.stepTwoTotalPriceDif, 'innerText');
expect(result).toContain('-€228.25');
});
it(`should select a new reason for the changes made then click on finalize`, async() => {
await page.waitToClick(selectors.ticketBasicData.chargesReason);
await page.waitToClick(selectors.ticketBasicData.finalizeButton);
await page.waitForState('ticket.card.summary');
});
it(`should not find ticket`, async() => {
await page.doSearch('29');
const count = await page.countElement(selectors.ticketsIndex.searchResult);
expect(count).toEqual(0);
});
it(`should split ticket without negatives`, async() => {
const newAgency = 'Gotham247';
const newDate = Date.vnNew();
newDate.setDate(newDate.getDate() - 1);
await page.accessToSearchResult('14');
await page.accessToSection('ticket.card.basicData.stepOne');
await page.autocompleteSearch(selectors.ticketBasicData.agency, newAgency);
await page.pickDate(selectors.ticketBasicData.shipped, newDate);
await page.waitToClick(selectors.ticketBasicData.nextStepButton);
await page.waitToClick(selectors.ticketBasicData.finalizeButton);
await page.waitForState('ticket.card.summary');
const newTicketAgency = await page
.waitToGetProperty(selectors.ticketDescriptor.descriptorDeliveryAgency, 'innerText');
const newTicketDate = await page
.waitToGetProperty(selectors.ticketDescriptor.descriptorDeliveryDate, 'innerText');
expect(newAgency).toEqual(newTicketAgency);
expect(newTicketDate).toContain(newDate.getDate());
});
it(`should new ticket have sale of old ticket`, async() => {
await page.accessToSection('ticket.card.sale');
await page.waitForState('ticket.card.sale');
const item = await page.waitToGetProperty(selectors.ticketSales.firstSaleId, 'innerText');
expect(item).toEqual('4');
});
it(`should old ticket have old date and agency`, async() => {
const oldDate = Date.vnNew();
const oldAgency = 'Super-Man delivery';
await page.accessToSearchResult('14');
const oldTicketAgency = await page
.waitToGetProperty(selectors.ticketDescriptor.descriptorDeliveryAgency, 'innerText');
const oldTicketDate = await page
.waitToGetProperty(selectors.ticketDescriptor.descriptorDeliveryDate, 'innerText');
expect(oldTicketAgency).toEqual(oldAgency);
expect(oldTicketDate).toContain(oldDate.getDate());
});
});

View File

@ -1,30 +0,0 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
describe('Ticket List components path', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('employee', 'ticket');
await page.accessToSearchResult('1');
await page.accessToSection('ticket.card.components');
});
afterAll(async() => {
await browser.close();
});
it('should confirm the total base is correct', async() => {
const name = 'Base €';
const minLength = name.length;
await page.waitPropertyLength(selectors.ticketComponents.base, 'innerText', minLength);
const base = await page.waitToGetProperty(selectors.ticketComponents.base, 'innerText');
expect(base).toContain('Base');
expect(base.length).toBeGreaterThan(minLength);
});
});

View File

@ -1,123 +0,0 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
describe('Ticket descriptor path', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('buyerBoss', 'ticket');
await page.accessToSection('ticket.weekly.index');
});
afterAll(async() => {
await browser.close();
});
it('should count the amount of tickets in the turns section', async() => {
const result = await page.countElement(selectors.ticketsIndex.weeklyTicket);
expect(result).toEqual(6);
});
it('should go back to the ticket index then search and access a ticket summary', async() => {
await page.accessToSection('ticket.index');
await page.accessToSearchResult('33');
});
it('should add the ticket to thursday turn using the descriptor more menu', async() => {
await page.waitToClick(selectors.ticketDescriptor.moreMenu);
await page.waitToClick(selectors.ticketDescriptor.moreMenuAddToTurn);
await page.waitToClick(selectors.ticketDescriptor.thursdayButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Current ticket deleted and added to shift');
});
it('should again click on the Tickets button of the top bar menu', async() => {
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.waitForSelector(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.ticketsButton);
await page.waitForState('ticket.index');
});
it('should confirm the ticket 33 was added to thursday', async() => {
await page.accessToSection('ticket.weekly.index');
const result = await page.waitToGetProperty(selectors.ticketsIndex.thirdWeeklyTicket, 'value');
expect(result).toEqual('Thursday');
});
it('should click on the Tickets button of the top bar menu once more', async() => {
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.waitForSelector(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.ticketsButton);
await page.waitForState('ticket.index');
});
it('should now search for the ticket 33', async() => {
await page.accessToSearchResult('33');
await page.waitForState('ticket.card.summary');
});
it('should add the ticket to saturday turn using the descriptor more menu', async() => {
await page.waitToClick(selectors.ticketDescriptor.moreMenu);
await page.waitToClick(selectors.ticketDescriptor.moreMenuAddToTurn);
await page.waitToClick(selectors.ticketDescriptor.saturdayButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Current ticket deleted and added to shift');
});
it('should click on the Tickets button of the top bar menu once again', async() => {
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.waitForSelector(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.ticketsButton);
await page.waitForState('ticket.index');
});
it('should confirm the ticket 33 was added on saturday', async() => {
await page.accessToSection('ticket.weekly.index');
await page.waitForTimeout(5000);
const result = await page.waitToGetProperty(selectors.ticketsIndex.thirdWeeklyTicket, 'value');
expect(result).toEqual('Saturday');
});
it('should now search for the weekly ticket 33', async() => {
await page.doSearch('33');
const nResults = await page.countElement(selectors.ticketsIndex.searchWeeklyResult);
expect(nResults).toEqual(2);
});
it('should delete the weekly ticket 33', async() => {
await page.waitToClick(selectors.ticketsIndex.firstWeeklyTicketDeleteIcon);
await page.waitToClick(selectors.ticketsIndex.acceptDeleteTurn);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it('should confirm the sixth weekly ticket was deleted', async() => {
await page.doSearch();
const nResults = await page.countElement(selectors.ticketsIndex.searchWeeklyResult);
expect(nResults).toEqual(6);
});
it('should update the agency then remove it afterwards', async() => {
await page.autocompleteSearch(selectors.ticketsIndex.firstWeeklyTicketAgency, 'Gotham247');
let message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
await page.clearInput(selectors.ticketsIndex.firstWeeklyTicketAgency);
message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
});

View File

@ -1,77 +0,0 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
describe('Ticket purchase request path', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('salesPerson', 'ticket');
await page.accessToSearchResult('1');
await page.accessToSection('ticket.card.request.index');
});
afterAll(async() => {
await browser.close();
});
it('should add a new request', async() => {
await page.waitToClick(selectors.ticketRequests.addRequestButton);
await page.write(selectors.ticketRequests.descriptionInput, 'New stuff');
await page.write(selectors.ticketRequests.quantity, '9');
await page.autocompleteSearch(selectors.ticketRequests.atender, 'buyerNick');
await page.write(selectors.ticketRequests.price, '999');
await page.waitToClick(selectors.ticketRequests.saveButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it('should have been redirected to the request index', async() => {
await page.waitForState('ticket.card.request.index');
});
it(`should edit the third request quantity as it's state is still new`, async() => {
await page.write(selectors.ticketRequests.thirdRequestQuantity, '9');
await page.keyboard.press('Enter');
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it('should check the new request was added', async() => {
await page.reloadSection('ticket.card.request.index');
const result = await page.waitToGetProperty(selectors.ticketRequests.thirdRequestQuantity, 'value');
expect(result).toEqual('99');
});
it(`should check the first request can't be edited as its state is different to new`, async() => {
await page.waitForClassPresent(selectors.ticketRequests.firstRequestQuantity, 'disabled');
const result = await page.isDisabled(selectors.ticketRequests.firstRequestQuantity);
expect(result).toBe(true);
});
it(`should check the second request can't be edited as its state is different to new`, async() => {
await page.waitForClassPresent(selectors.ticketRequests.secondRequestQuantity, 'disabled');
const result = await page.isDisabled(selectors.ticketRequests.secondRequestQuantity);
expect(result).toBe(true);
});
it('should delete the added request', async() => {
await page.waitToClick(selectors.ticketRequests.thirdRemoveRequestButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it('should check the request was deleted', async() => {
await page.reloadSection('ticket.card.request.index');
await page.waitForSelector(selectors.ticketRequests.addRequestButton);
await page.waitForSelector(selectors.ticketRequests.thirdDescription, {hidden: true});
});
});

View File

@ -1,148 +0,0 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
describe('Ticket descriptor path', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('salesperson', 'ticket');
});
afterAll(async() => {
await browser.close();
});
describe('Delete ticket', () => {
it('should search for an specific ticket', async() => {
await page.accessToSearchResult('18');
await page.waitForState('ticket.card.summary');
});
it(`should update the shipped hour using the descriptor menu`, async() => {
await page.waitToClick(selectors.ticketDescriptor.moreMenu);
await page.waitToClick(selectors.ticketDescriptor.moreMenuChangeShippedHour);
await page.pickTime(selectors.ticketDescriptor.changeShippedHour, '08:15');
await page.waitToClick(selectors.ticketDescriptor.acceptChangeHourButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Shipped hour updated');
});
it(`should confirm the ticket descriptor shows the correct shipping hour`, async() => {
await page.waitForState('ticket.card.summary');
const result = await page
.waitToGetProperty(selectors.ticketDescriptor.descriptorDeliveryDate, 'innerText');
expect(result).toContain('08:15');
});
it('should delete the ticket using the descriptor menu', async() => {
await page.waitToClick(selectors.ticketDescriptor.moreMenu);
await page.waitToClick(selectors.ticketDescriptor.moreMenuDeleteTicket);
await page.waitToClick(selectors.ticketDescriptor.acceptDialog);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Ticket deleted. You can undo this action within the first hour');
});
it('should have been relocated to the ticket index', async() => {
await page.waitForState('ticket.index');
});
it(`should search for the deleted ticket and check the deletedTicket icon and it's date`, async() => {
await page.write(selectors.ticketsIndex.topbarSearch, '18');
await page.waitToClick(selectors.globalItems.searchButton);
await page.waitForState('ticket.card.summary');
await page.isVisible(selectors.ticketDescriptor.isDeletedIcon);
const result = await page.waitToGetProperty(selectors.ticketsIndex.searchResultDate, 'innerText');
expect(result).toContain(2000);
});
});
describe('Restore ticket', () => {
it('should restore the ticket using the descriptor menu', async() => {
await page.waitToClick(selectors.ticketDescriptor.moreMenu);
await page.waitToClick(selectors.ticketDescriptor.moreMenuRestoreTicket);
await page.waitToClick(selectors.ticketDescriptor.acceptDialog);
await page.waitForState('ticket.card.summary');
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
});
describe('Make invoice', () => {
it('should login as administrative role then search for a ticket', async() => {
const invoiceableTicketId = '14';
await page.loginAndModule('administrative', 'ticket');
await page.accessToSearchResult(invoiceableTicketId);
await page.waitForState('ticket.card.summary');
});
it(`should make sure the ticket doesn't have an invoiceOutFk yet`, async() => {
const result = await page
.waitToGetProperty(selectors.ticketSummary.invoiceOutRef, 'innerText');
expect(result).toEqual('-');
});
it('should invoice the ticket using the descriptor menu', async() => {
await page.waitToClick(selectors.ticketDescriptor.moreMenu);
await page.waitForContentLoaded();
await page.waitToClick(selectors.ticketDescriptor.moreMenuMakeInvoice);
await page.waitToClick(selectors.ticketDescriptor.acceptInvoiceOutButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Ticket invoiced');
});
it(`should make sure the ticket summary have an invoiceOutFk`, async() => {
await page.waitForTextInElement(selectors.ticketSummary.invoiceOutRef, 'T4444445');
const result = await page.waitToGetProperty(selectors.ticketSummary.invoiceOutRef, 'innerText');
expect(result).toEqual('T4444445');
});
it(`should regenerate the invoice using the descriptor menu`, async() => {
const expectedMessage = 'The invoice PDF document has been regenerated';
await page.waitToClick(selectors.ticketDescriptor.moreMenu);
await page.waitForContentLoaded();
await page.waitToClick(selectors.ticketDescriptor.moreMenuRegenerateInvoice);
await page.respondToDialog('accept');
const message = await page.waitForSnackbar();
expect(message.text).toContain(expectedMessage);
});
});
describe('SMS', () => {
it('should send the payment SMS using the descriptor menu', async() => {
await page.waitToClick(selectors.ticketDescriptor.moreMenu);
await page.waitToClick(selectors.ticketDescriptor.moreMenuSMSOptions);
await page.waitToClick(selectors.ticketDescriptor.moreMenuPaymentSMS);
await page.waitForSelector(selectors.ticketDescriptor.SMStext);
await page.waitPropertyLength(selectors.ticketDescriptor.SMStext, 'value', 128);
await page.waitToClick(selectors.ticketDescriptor.sendSMSbutton);
const message = await page.waitForSnackbar();
expect(message).toBeDefined();
});
it('should send the import SMS using the descriptor menu', async() => {
await page.waitToClick(selectors.ticketDescriptor.moreMenuSMSOptions);
await page.waitToClick(selectors.ticketDescriptor.moreMenuSendImportSms);
await page.waitForSelector(selectors.ticketDescriptor.SMStext);
await page.waitPropertyLength(selectors.ticketDescriptor.SMStext, 'value', 144);
await page.waitToClick(selectors.ticketDescriptor.sendSMSbutton);
const message = await page.waitForSnackbar();
expect(message).toBeDefined();
});
});
});

View File

@ -1,127 +0,0 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
describe('Ticket services path', () => {
let browser;
let page;
const invoicedTicketId = '1';
afterAll(async() => {
await browser.close();
});
describe('as employee', () => {
it('should log in as employee, search for an invoice and get to services', async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('employee', 'ticket');
await page.accessToSearchResult(invoicedTicketId);
await page.accessToSection('ticket.card.service');
});
it('should find the add descripton button disabled for this user role', async() => {
await page.waitForClassPresent(selectors.ticketService.firstAddServiceTypeButton, 'disabled');
await page.waitToClick(selectors.ticketService.addServiceButton);
await page.waitForSelector(selectors.ticketService.firstAddServiceTypeButton);
const disabled = await page.isDisabled(selectors.ticketService.firstAddServiceTypeButton);
expect(disabled).toBe(true);
});
it('should receive an error if you attempt to save a service without access rights', async() => {
await page.clearInput(selectors.ticketService.firstPrice);
await page.write(selectors.ticketService.firstPrice, '999');
await page.waitToClick(selectors.ticketService.saveServiceButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain(`The current ticket can't be modified`);
});
});
describe('as administrative', () => {
let editableTicketId = '16';
it('should navigate to the services of a target ticket', async() => {
await page.loginAndModule('administrative', 'ticket');
await page.accessToSearchResult(editableTicketId);
await page.accessToSection('ticket.card.service');
});
it('should click on the add button to prepare the form to create a new service', async() => {
await page.waitToClick(selectors.ticketService.addServiceButton);
const result = await page
.isVisible(selectors.ticketService.firstServiceType);
expect(result).toBeTruthy();
});
it('should receive an error if you attempt to save it with empty fields', async() => {
await page.waitToClick(selectors.ticketService.saveServiceButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain(`can't be blank`);
});
it('should click on the add new service type to open the dialog', async() => {
await page.waitToClick(selectors.ticketService.firstAddServiceTypeButton);
await page.waitForSelector('.vn-dialog.shown');
const result = await page.isVisible(selectors.ticketService.newServiceTypeName);
expect(result).toBeTruthy();
});
it('should receive an error if service type is empty on submit', async() => {
await page.waitToClick(selectors.ticketService.saveServiceTypeButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain(`Name can't be empty`);
});
it('should create a new service type then add price then create the service', async() => {
await page.write(selectors.ticketService.newServiceTypeName, 'Documentos');
await page.waitToClick(selectors.ticketService.saveServiceTypeButton);
await page.write(selectors.ticketService.firstPrice, '999');
await page.waitToClick(selectors.ticketService.saveServiceButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it('should confirm the service description was created correctly', async() => {
await page.reloadSection('ticket.card.service');
const result = await page
.waitToGetProperty(selectors.ticketService.firstServiceType, 'value');
expect(result).toEqual('Documentos');
});
it('should confirm the service quantity was created correctly', async() => {
const result = await page
.waitToGetProperty(selectors.ticketService.firstQuantity, 'value');
expect(result).toEqual('1');
});
it('should confirm the service price was created correctly', async() => {
const result = await page
.waitToGetProperty(selectors.ticketService.firstPrice, 'value');
expect(result).toEqual('999');
});
it('should delete the service', async() => {
await page.waitToClick(selectors.ticketService.fistDeleteServiceButton);
await page.waitForNumberOfElements(selectors.ticketService.serviceLine, 0);
await page.waitToClick(selectors.ticketService.saveServiceButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it(`should confirm the service was removed`, async() => {
await page.reloadSection('ticket.card.service');
const nResults = await page.countElement(selectors.ticketService.serviceLine);
expect(nResults).toEqual(0);
});
});
});

View File

@ -1,69 +0,0 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
describe('Ticket create path', () => {
let browser;
let page;
let nextMonth = Date.vnNew();
nextMonth.setMonth(nextMonth.getMonth() + 1);
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('salesPerson', 'ticket');
});
afterAll(async() => {
await browser.close();
});
it('should open the new ticket form', async() => {
await page.waitToClick(selectors.ticketsIndex.newTicketButton);
await page.waitForState('ticket.create');
});
it('should succeed to create a ticket', async() => {
await page.autocompleteSearch(selectors.createTicketView.client, 'Clark Kent');
await page.pickDate(selectors.createTicketView.deliveryDate, nextMonth);
await page.autocompleteSearch(selectors.createTicketView.warehouse, 'Warehouse Two');
await page.autocompleteSearch(selectors.createTicketView.agency, 'Gotham247');
await page.waitToClick(selectors.createTicketView.createButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it('should check the url is now the summary of the ticket', async() => {
await page.waitForState('ticket.card.summary');
});
it('should again open the new ticket form', async() => {
await page.waitToClick(selectors.globalItems.returnToModuleIndexButton);
await page.waitToClick(selectors.ticketsIndex.newTicketButton);
await page.waitForState('ticket.create');
});
it('should succeed to create another ticket for the same client', async() => {
await page.autocompleteSearch(selectors.createTicketView.client, 'Clark Kent');
await page.pickDate(selectors.createTicketView.deliveryDate, nextMonth);
await page.autocompleteSearch(selectors.createTicketView.warehouse, 'Warehouse One');
await page.autocompleteSearch(selectors.createTicketView.agency, 'Gotham247');
await page.waitToClick(selectors.createTicketView.createButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it('should check the url is now the summary of the created ticket', async() => {
await page.waitForState('ticket.card.summary');
});
it('should delete the current ticket', async() => {
await page.waitToClick(selectors.ticketDescriptor.moreMenu);
await page.waitToClick(selectors.ticketDescriptor.moreMenuDeleteTicket);
await page.waitToClick(selectors.ticketDescriptor.acceptDialog);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Ticket deleted. You can undo this action within the first hour');
});
});

View File

@ -1,37 +0,0 @@
import getBrowser from '../../helpers/puppeteer';
const $ = {
form: 'vn-ticket-create-card',
moreMenu: 'vn-client-descriptor vn-icon-button[icon=more_vert]',
simpleTicketButton: '.vn-menu [name="simpleTicket"]'
};
describe('Ticket create from client path', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('employee', 'client');
await page.accessToSearchResult('Petter Parker');
});
afterAll(async() => {
await browser.close();
});
it('should create simple ticket and check if the client details are the expected ones', async() => {
await page.waitToClick($.moreMenu);
await page.waitToClick($.simpleTicketButton);
await page.waitForState('ticket.create');
const values = {
client: 'Petter Parker',
address: 'Petter Parker'
};
const formValues = await page.fetchForm($.form, Object.keys(values));
expect(formValues).toEqual(values);
});
});

View File

@ -1,108 +0,0 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
describe('Ticket Summary path', () => {
let browser;
let page;
const ticketId = '20';
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
});
afterAll(async() => {
await browser.close();
});
it('should navigate to the target ticket summary section', async() => {
await page.loginAndModule('employee', 'ticket');
await page.accessToSearchResult(ticketId);
await page.waitForState('ticket.card.summary');
});
it(`should display details from the ticket and it's client on the top of the header`, async() => {
await page.waitForTextInElement(selectors.ticketSummary.header, 'Bruce Banner');
const result = await page.waitToGetProperty(selectors.ticketSummary.header, 'innerText');
expect(result).toContain(`Ticket #${ticketId}`);
expect(result).toContain('Bruce Banner (1109)');
expect(result).toContain('Somewhere in Thailand');
});
it('should display ticket details', async() => {
let result = await page
.waitToGetProperty(selectors.ticketSummary.state, 'innerText');
expect(result).toContain('Arreglar');
});
it('should display delivery details', async() => {
let result = await page
.waitToGetProperty(selectors.ticketSummary.route, 'innerText');
expect(result).toContain('3');
});
it('should display the ticket total', async() => {
let result = await page
.waitToGetProperty(selectors.ticketSummary.total, 'innerText');
expect(result).toContain('€155.54');
});
it('should display the ticket line(s)', async() => {
let result = await page
.waitToGetProperty(selectors.ticketSummary.firstSaleItemId, 'innerText');
expect(result).toContain('2');
});
it(`should click on the first sale ID to make the item descriptor visible`, async() => {
await page.waitToClick(selectors.ticketSummary.firstSaleItemId);
await page.waitImgLoad(selectors.ticketSummary.firstSaleDescriptorImage);
const visible = await page.isVisible(selectors.ticketSummary.itemDescriptorPopover);
expect(visible).toBeTruthy();
});
it(`should check the url for the item diary link of the descriptor is for the right item id`, async() => {
await page.waitForSelector(selectors.ticketSummary.itemDescriptorPopoverItemDiaryButton, {visible: true});
});
it('should log in as production then navigate to the summary of the same ticket', async() => {
await page.loginAndModule('production', 'ticket');
await page.accessToSearchResult(ticketId);
await page.waitForState('ticket.card.summary');
});
it('should set the ticket state to OK using the top right button', async() => {
const searchValue = 'OK';
await page.waitToClick(selectors.ticketSummary.stateButton);
await page.write(selectors.ticketSummary.stateAutocomplete, searchValue);
try {
await page.waitForFunction(text => {
const element = document.querySelector('li.active');
if (element)
return element.innerText.toLowerCase().includes(text.toLowerCase());
}, {}, searchValue);
} catch (error) {
const state = await page.evaluate(() => {
const stateSelector = 'vn-ticket-summary vn-label-value:nth-child(1) > section > span';
return document.querySelector(stateSelector).value;
});
throw new Error(`${stateSelector} innerText is ${state}! ${error}`);
}
await page.keyboard.press('Enter');
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it('should confirm the ticket state was updated', async() => {
await page.waitForSpinnerLoad();
const result = await page.waitToGetProperty(selectors.ticketSummary.state, 'innerText');
expect(result).toContain('OK');
});
});

View File

@ -1,34 +0,0 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
describe('Ticket log path', () => {
let browser;
let page;
const ticketId = '5';
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
});
afterAll(async() => {
await browser.close();
});
it('should navigate to the target ticket notes section', async() => {
await page.loginAndModule('employee', 'ticket');
await page.accessToSearchResult(ticketId);
await page.accessToSection('ticket.card.observation');
await page.waitForState('ticket.card.observation');
});
it('should create a new note for the test', async() => {
await page.waitToClick(selectors.ticketNotes.addNoteButton);
await page.autocompleteSearch(selectors.ticketNotes.firstNoteType, 'ItemPicker');
await page.write(selectors.ticketNotes.firstDescription, 'description');
await page.waitToClick(selectors.ticketNotes.submitNotesButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
});

View File

@ -1,70 +0,0 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
const $ = {
newPayment: '.vn-dialog.shown',
anyBalanceLine: 'vn-client-balance-index vn-tbody > vn-tr',
firstLineReference: 'vn-client-balance-index vn-tbody > vn-tr:nth-child(1) > vn-td-editable'
};
describe('Ticket index payout path', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('administrative', 'ticket');
await page.waitForState('ticket.index');
});
afterAll(async() => {
await browser.close();
});
it('should check the second ticket from a client and 1 of another', async() => {
await page.waitToClick(selectors.globalItems.searchButton);
await page.waitToClick(selectors.ticketsIndex.thirdTicketCheckbox);
await page.waitToClick(selectors.ticketsIndex.fifthTicketCheckbox);
await page.waitToClick(selectors.ticketsIndex.payoutButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('You cannot make a payment on account from multiple clients');
});
it('should search for tickets of the same client then open the payout form', async() => {
await page.waitToClick(selectors.ticketsIndex.openAdvancedSearchButton);
await page.write(selectors.ticketsIndex.advancedSearchClient, '1101');
await page.keyboard.press('Enter');
await page.waitForNumberOfElements(selectors.ticketsIndex.anySearchResult, 10);
await page.waitToClick(selectors.ticketsIndex.firstTicketCheckbox);
await page.waitToClick(selectors.ticketsIndex.secondTicketCheckbox);
await page.waitToClick(selectors.ticketsIndex.payoutButton);
await page.waitForSelector(selectors.ticketsIndex.payoutCompany);
});
it('should fill the company and bank to perform a payout and check a new balance line was entered', async() => {
await page.fillForm($.newPayment, {
company: 'VNL',
bank: 'cash',
amountPaid: 100,
description: 'Payment',
viewReceipt: false
});
await page.respondToDialog('accept');
const message = await page.waitForSnackbar();
await page.waitToClick(selectors.globalItems.homeButton);
await page.selectModule('client');
await page.accessToSearchResult('1101');
await page.accessToSection('client.card.balance.index');
await page.waitForSelector($.anyBalanceLine);
const count = await page.countElement($.anyBalanceLine);
const reference = await page.innerText($.firstLineReference);
expect(message.isSuccess).toBeTrue();
expect(count).toEqual(4);
expect(reference).toContain('Payment');
});
});

View File

@ -1,49 +0,0 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
describe('Ticket DMS path', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('employee', 'ticket');
await page.accessToSearchResult('1');
await page.accessToSection('ticket.card.dms.index');
});
afterAll(async() => {
await browser.close();
});
it('should import a document', async() => {
await page.waitToClick(selectors.ticketDms.import);
await page.autocompleteSearch(selectors.ticketDms.document, '1');
await page.waitToClick(selectors.ticketDms.saveImport);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it(`should check there's a listed document now`, async() => {
const result = await page.countElement(selectors.ticketDms.anyDocument);
expect(result).toEqual(1);
});
it('should attempt to import an existing document on this ticket', async() => {
await page.waitToClick(selectors.ticketDms.import);
await page.autocompleteSearch(selectors.ticketDms.document, '1');
await page.waitToClick(selectors.ticketDms.saveImport);
const message = await page.waitForSnackbar();
expect(message.text).toContain('This document already exists on this ticket');
});
it(`should check there's still one document`, async() => {
const result = await page.countElement(selectors.ticketDms.anyDocument);
expect(result).toEqual(1);
});
});

View File

@ -1,50 +0,0 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
describe('Ticket expeditions', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('production', 'ticket');
await page.accessToSearchResult('1');
await page.accessToSection('ticket.card.expedition');
});
afterAll(async() => {
await browser.close();
});
it(`should move one expedition to new ticket withoute route`, async() => {
await page.waitToClick(selectors.ticketExpedition.thirdSaleCheckbox);
await page.waitToClick(selectors.ticketExpedition.moveExpeditionButton);
await page.waitToClick(selectors.ticketExpedition.moreMenuWithoutRoute);
await page.waitToClick(selectors.ticketExpedition.saveButton);
await page.waitForState('ticket.card.summary');
await page.accessToSection('ticket.card.expedition');
await page.waitForSelector(selectors.ticketExpedition.expeditionRow, {});
const result = await page
.countElement(selectors.ticketExpedition.expeditionRow);
expect(result).toEqual(2);
});
it(`should move one expedition to new ticket with route`, async() => {
await page.waitToClick(selectors.ticketExpedition.firstSaleCheckbox);
await page.waitToClick(selectors.ticketExpedition.moveExpeditionButton);
await page.waitToClick(selectors.ticketExpedition.moreMenuWithRoute);
await page.write(selectors.ticketExpedition.newRouteId, '1');
await page.waitToClick(selectors.ticketExpedition.saveButton);
await page.waitForState('ticket.card.summary');
await page.accessToSection('ticket.card.expedition');
await page.waitForSelector(selectors.ticketExpedition.expeditionRow, {});
const result = await page
.countElement(selectors.ticketExpedition.expeditionRow);
expect(result).toEqual(2);
});
});

View File

@ -1,99 +0,0 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
describe('Ticket Future path', () => {
let browser;
let page;
let httpRequest;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('employee', 'ticket');
await page.accessToSection('ticket.future');
page.on('request', req => {
if (req.url().includes(`Tickets/getTicketsFuture`))
httpRequest = req.url();
});
});
afterAll(async() => {
await browser.close();
});
it('should search with required data, check three last tickets and move to the future', async() => {
await page.waitToClick(selectors.ticketFuture.openAdvancedSearchButton);
await page.clearInput(selectors.ticketFuture.warehouseFk);
await page.waitToClick(selectors.ticketFuture.submit);
let message = await page.waitForSnackbar();
expect(message.text).toContain('warehouseFk is a required argument');
await page.waitToClick(selectors.ticketFuture.openAdvancedSearchButton);
await page.clearInput(selectors.ticketFuture.futureScopeDays);
await page.waitToClick(selectors.ticketFuture.submit);
message = await page.waitForSnackbar();
expect(message.text).toContain('futureScopeDays is a required argument');
await page.waitToClick(selectors.ticketFuture.openAdvancedSearchButton);
await page.clearInput(selectors.ticketFuture.originScopeDays);
await page.waitToClick(selectors.ticketFuture.submit);
message = await page.waitForSnackbar();
expect(message.text).toContain('originScopeDays is a required argument');
await page.waitToClick(selectors.ticketFuture.openAdvancedSearchButton);
await page.waitToClick(selectors.ticketFuture.submit);
expect(httpRequest).toBeDefined();
await page.waitToClick(selectors.ticketFuture.openAdvancedSearchButton);
await page.autocompleteSearch(selectors.ticketFuture.ipt, 'H');
await page.waitToClick(selectors.ticketFuture.submit);
expect(httpRequest).toContain('ipt=H');
await page.waitToClick(selectors.ticketFuture.openAdvancedSearchButton);
await page.clearInput(selectors.ticketFuture.ipt);
await page.autocompleteSearch(selectors.ticketFuture.futureIpt, 'H');
await page.waitToClick(selectors.ticketFuture.submit);
expect(httpRequest).toContain('futureIpt=H');
await page.waitToClick(selectors.ticketFuture.openAdvancedSearchButton);
await page.clearInput(selectors.ticketFuture.futureIpt);
await page.autocompleteSearch(selectors.ticketFuture.state, 'Free');
await page.waitToClick(selectors.ticketFuture.submit);
expect(httpRequest).toContain('state=0');
await page.waitToClick(selectors.ticketFuture.openAdvancedSearchButton);
await page.clearInput(selectors.ticketFuture.state);
await page.autocompleteSearch(selectors.ticketFuture.futureState, 'Free');
await page.waitToClick(selectors.ticketFuture.submit);
expect(httpRequest).toContain('futureState=0');
await page.waitToClick(selectors.ticketFuture.openAdvancedSearchButton);
await page.clearInput(selectors.ticketFuture.state);
await page.clearInput(selectors.ticketFuture.futureState);
await page.waitToClick(selectors.ticketFuture.submit);
await page.waitForNumberOfElements(selectors.ticketFuture.searchResult, 5);
await page.waitToClick(selectors.ticketFuture.multiCheck);
await page.waitToClick(selectors.ticketFuture.firstCheck);
await page.waitToClick(selectors.ticketFuture.moveButton);
await page.waitToClick(selectors.globalItems.acceptButton);
message = await page.waitForSnackbar();
expect(message.text).toContain('Tickets moved successfully!');
});
});

View File

@ -1,79 +0,0 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
describe('Ticket Advance path', () => {
let browser;
let page;
let httpRequest;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('employee', 'ticket');
await page.accessToSection('ticket.advance');
page.on('request', req => {
if (req.url().includes(`Tickets/getTicketsAdvance`))
httpRequest = req.url();
});
});
afterAll(async() => {
await browser.close();
});
it('should search with the required data, check the first ticket and move to the present', async() => {
await page.waitToClick(selectors.ticketAdvance.openAdvancedSearchButton);
await page.clearInput(selectors.ticketAdvance.warehouseFk);
await page.waitToClick(selectors.ticketAdvance.submit);
let message = await page.waitForSnackbar();
expect(message.text).toContain('warehouseFk is a required argument');
await page.waitToClick(selectors.ticketAdvance.openAdvancedSearchButton);
await page.clearInput(selectors.ticketAdvance.dateToAdvance);
await page.waitToClick(selectors.ticketAdvance.submit);
message = await page.waitForSnackbar();
expect(message.text).toContain('dateToAdvance is a required argument');
await page.waitToClick(selectors.ticketAdvance.openAdvancedSearchButton);
await page.clearInput(selectors.ticketAdvance.dateFuture);
await page.waitToClick(selectors.ticketAdvance.submit);
message = await page.waitForSnackbar();
expect(message.text).toContain('dateFuture is a required argument');
await page.waitToClick(selectors.ticketAdvance.openAdvancedSearchButton);
await page.waitToClick(selectors.ticketAdvance.submit);
expect(httpRequest).toBeDefined();
await page.waitToClick(selectors.ticketAdvance.openAdvancedSearchButton);
await page.autocompleteSearch(selectors.ticketAdvance.futureIpt, 'H');
await page.waitToClick(selectors.ticketAdvance.submit);
expect(httpRequest).toContain('futureIpt=H');
await page.waitToClick(selectors.ticketAdvance.openAdvancedSearchButton);
await page.clearInput(selectors.ticketAdvance.futureIpt);
await page.waitToClick(selectors.ticketAdvance.submit);
await page.waitToClick(selectors.ticketAdvance.openAdvancedSearchButton);
await page.autocompleteSearch(selectors.ticketAdvance.ipt, 'H');
await page.waitToClick(selectors.ticketAdvance.submit);
expect(httpRequest).toContain('ipt=H');
await page.waitToClick(selectors.ticketAdvance.openAdvancedSearchButton);
await page.clearInput(selectors.ticketAdvance.ipt);
await page.waitToClick(selectors.ticketAdvance.submit);
await page.waitToClick(selectors.ticketAdvance.firstCheck);
await page.waitToClick(selectors.ticketAdvance.moveButton);
await page.waitToClick(selectors.ticketAdvance.acceptButton);
message = await page.waitForSnackbar();
expect(message.text).toContain('Tickets moved successfully!');
});
});

View File

@ -70,10 +70,18 @@ export default class App {
if (this.logger.$params.q) {
let tableValue = this.logger.$params.q;
const q = JSON.parse(tableValue);
if (typeof q === 'number')
tableValue = JSON.stringify({id: tableValue});
newRoute = newRoute.concat(`?table=${tableValue}`);
if (Array.isArray(tableValue)) {
const [key, param1, param2] = tableValue;
const payload = key === 'createForm'
? {[param1]: param2}
: {[key]: param1};
newRoute += `?${key}=${JSON.stringify(payload)}`;
} else {
const q = JSON.parse(tableValue);
if (typeof q === 'number')
tableValue = JSON.stringify({id: tableValue});
newRoute = newRoute.concat(`?table=${tableValue}`);
}
} else if (!hasId && this.logger.$params.id && newRoute.indexOf(this.logger.$params.id) < 0)
newRoute = newRoute.concat(`${this.logger.$params.id}`);

View File

@ -2,7 +2,7 @@ const {Report, Email} = require('vn-print');
module.exports = Self => {
Self.printReport = async function(ctx, id, reportName) {
const args = Object.assign({}, ctx.args);
const args = Object.assign({id}, ctx.args);
const params = {lang: ctx.req.getLocale()};
delete args.ctx;

View File

@ -241,9 +241,8 @@
"The height must be greater than 50cm": "The height must be greater than 50cm",
"The maximum height of the wagon is 200cm": "The maximum height of the wagon is 200cm",
"The quantity claimed cannot be greater than the quantity of the line": "The quantity claimed cannot be greater than the quantity of the line",
"There are tickets for this area, delete them first": "There are tickets for this area, delete them first",
"ticketLostExpedition": "The ticket [{{ticketId}}]({{{ticketUrl}}}) has the following lost expedition:{{ expeditionId }}",
"null": "null",
"Invalid or expired verification code": "Invalid or expired verification code",
"There are tickets for this area, delete them first": "There are tickets for this area, delete them first",
"ticketLostExpedition": "The ticket [{{ticketId}}]({{{ticketUrl}}}) has the following lost expedition:{{ expeditionId }}",
"Payment method is required": "Payment method is required"
}
}

View File

@ -15,7 +15,5 @@ columns:
image: image
hasGrant: has grant
userFk: user
recoverPass: recover password
role: role
sync: pending sync
lastPassChange: password changed

View File

@ -15,7 +15,5 @@ columns:
image: imagen
hasGrant: puede delegar
userFk: usuario
recoverPass: recuperar contraseña
role: rol
sync: Pendiente de sincronizar
lastPassChange: contraseña modificada

View File

@ -1,4 +1,3 @@
const ParameterizedSQL = require('loopback-connector').ParameterizedSQL;
const buildFilter = require('vn-loopback/util/filter').buildFilter;
const mergeFilters = require('vn-loopback/util/filter').mergeFilters;

View File

@ -54,7 +54,10 @@ module.exports = Self => {
{
relation: 'country',
scope: {
fields: ['name']
fields: ['id', 'name'],
include: {
relation: 'saySimpleCountry',
}
}
},
{

View File

@ -55,7 +55,7 @@
"relation": "user",
"scope": {
"fields": [
"nickname"
"name"
]
}
}

View File

@ -99,7 +99,7 @@
<div ng-transclude="btnThree">
<vn-quick-link
tooltip="New order"
state="['order.create', {clientFk: $ctrl.id}]"
state="['order.index', {q: ['createForm', 'clientFk', $ctrl.id]}]"
icon="icon-basketadd">
</vn-quick-link>
</div>

View File

@ -6,6 +6,9 @@ module.exports = Self => {
arg: 'workerFk',
type: 'number',
description: 'The id for a buyer',
}, {
arg: 'filter',
type: 'object',
},
{
arg: 'dated',
@ -23,7 +26,7 @@ module.exports = Self => {
}
});
Self.getStockBought = async(workerFk, dated = Date.vnNew()) => {
Self.getStockBought = async(workerFk, filter, dated = Date.vnNew()) => {
const models = Self.app.models;
const today = Date.vnNew();
dated.setHours(0, 0, 0, 0);
@ -31,7 +34,7 @@ module.exports = Self => {
await models.StockBought.rawSql(`CALL vn.stockBought_calculate(?)`, [dated]);
const filter = {
const defaultFilter = {
where: {dated},
include: [
{
@ -53,6 +56,6 @@ module.exports = Self => {
if (workerFk) filter.where.workerFk = workerFk;
return models.StockBought.find(filter);
return models.StockBought.find({...filter, ...defaultFilter});
};
};

View File

@ -1,3 +1,4 @@
const ParameterizedSQL = require('loopback-connector').ParameterizedSQL;
module.exports = Self => {
Self.remoteMethod('getStockBoughtDetail', {
description: 'Returns the detail of stock bought for a given date and a worker',
@ -12,6 +13,9 @@ module.exports = Self => {
type: 'string',
description: 'The date to filter',
required: true,
}, {
arg: 'filter',
type: 'object',
}
],
returns: {
@ -24,11 +28,10 @@ module.exports = Self => {
}
});
Self.getStockBoughtDetail = async(workerFk, dated) => {
const models = Self.app.models;
Self.getStockBoughtDetail = async(workerFk, dated, filter, options) => {
const conn = Self.dataSource.connector;
const myOptions = {};
let tx;
let result;
if (typeof options == 'object')
Object.assign(myOptions, options);
@ -39,8 +42,10 @@ module.exports = Self => {
}
try {
await models.StockBought.rawSql(`CALL vn.item_calculateStock(?)`, [dated], myOptions);
result = await Self.rawSql(
const stmts = [];
stmts.push(new ParameterizedSQL(`CALL vn.item_calculateStock(?)`, [dated]));
const query = new ParameterizedSQL(
`SELECT b.entryFk entryFk,
i.id itemFk,
i.name itemName,
@ -61,11 +66,17 @@ module.exports = Self => {
JOIN volumeConfig vc
WHERE ic.display
AND w.id = ?`,
[workerFk], myOptions
[workerFk]
);
await Self.rawSql(`DROP TEMPORARY TABLE tmp.item, tmp.buyUltimate;`, [], myOptions);
stmts.push(query.merge(conn.makeSuffix(filter)));
stmts.push(new ParameterizedSQL(`DROP TEMPORARY TABLE tmp.item, tmp.buyUltimate`));
const sql = ParameterizedSQL.join(stmts, ';');
const result = await conn.executeStmt(sql, myOptions);
if (tx) await tx.commit();
return result;
return result[1];
} catch (e) {
await tx.rollback();
throw e;

View File

@ -1,57 +0,0 @@
<vn-crud-model
vn-id="model"
url="ItemBarcodes"
fields="['id', 'itemFk', 'code']"
link="{itemFk: $ctrl.$params.id}"
data="barcodes"
auto-load="true">
</vn-crud-model>
<vn-watcher
vn-id="watcher"
data="barcodes"
form="form">
</vn-watcher>
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md">
<vn-card class="vn-pa-lg">
<vn-horizontal ng-repeat="barcode in barcodes track by $index">
<vn-textfield
vn-three
label="Code"
ng-model="barcode.code"
vn-acl="buyer, replenisher"
vn-focus>
</vn-textfield>
<vn-none>
<vn-icon-button
vn-acl="buyer,replenisher"
pointer
vn-tooltip="Remove barcode"
icon="delete"
ng-click="model.remove($index)">
</vn-icon-button>
</vn-none>
</vn-horizontal>
<vn-one>
<vn-icon-button
vn-acl="buyer, replenisher"
vn-tooltip="Add barcode"
vn-bind="+"
icon="add_circle"
ng-click="model.insert()">
</vn-icon-button>
</vn-one>
</vn-card>
<vn-button-bar>
<vn-submit
disabled="!watcher.dataChanged()"
label="Save">
</vn-submit>
<!-- # #2680 Undo changes button bugs -->
<!-- <vn-button
class="cancel"
label="Undo changes"
disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()">
</vn-button> -->
</vn-button-bar>
</form>

View File

@ -1,17 +0,0 @@
import ngModule from '../module';
import Section from 'salix/components/section';
export default class Controller extends Section {
onSubmit() {
this.$.watcher.check();
this.$.model.save().then(() => {
this.$.watcher.notifySaved();
this.$.watcher.updateOriginalData();
});
}
}
ngModule.vnComponent('vnItemBarcode', {
template: require('./index.html'),
controller: Controller
});

View File

@ -1,318 +0,0 @@
<mg-ajax
path="Items/{{patch.params.id}}"
options="vnPatch"
override="{filter: {include: [{relation: 'itemType'}, {relation: 'origin'}, {relation: 'ink'}, {relation: 'producer'}, {relation: 'expense'}]}}">
</mg-ajax>
<vn-watcher
vn-id="watcher"
data="$ctrl.item"
form="form"
save="patch">
</vn-watcher>
<vn-crud-model
auto-load="true"
url="Origins"
data="originsData"
order="name"
vn-id="origin-model">
</vn-crud-model>
<form name="form" ng-submit="watcher.submit()" ng-cloak class="vn-w-md">
<vn-card class="vn-pa-lg">
<vn-horizontal>
<vn-autocomplete
url="ItemTypes"
label="Type"
show-field="name"
value-field="id"
ng-model="$ctrl.item.typeFk"
vn-name="type"
initial-data="$ctrl.item.itemType"
fields="['categoryFk']"
include="'category'">
<tpl-item>
<div>{{::name}}</div>
<div class="text-caption text-secondary">
{{::category.name}}
</div>
</tpl-item>
</vn-autocomplete>
<vn-textfield
label="Reference"
ng-model="$ctrl.item.comment"
vn-name="comment"
rule>
</vn-textfield>
<vn-input-number
min="0"
label="Relevancy"
ng-model="$ctrl.item.relevancy"
vn-name="relevancy"
rule>
</vn-input-number>
</vn-horizontal>
<vn-horizontal>
<vn-input-number
min="0"
label="stems"
ng-model="$ctrl.item.stems"
vn-name="stems"
rule>
</vn-input-number>
<vn-input-number
min="0"
label="Multiplier"
ng-model="$ctrl.item.stemMultiplier"
vn-name="stemMultiplier">
</vn-input-number>
<vn-autocomplete
label="Generic"
url="Items/withName"
ng-model="$ctrl.item.genericFk"
vn-name="generic"
show-field="name"
value-field="id"
search-function="$ctrl.itemSearchFunc($search)"
order="id DESC"
tabindex="1">
<tpl-item>
<div>{{::name}}</div>
<div class="text-caption text-secondary">
#{{::id}}
</div>
</tpl-item>
<append>
<vn-icon-button
icon="filter_alt"
vn-click-stop="$ctrl.showFilterDialog($ctrl.item)"
vn-tooltip="Filter...">
</vn-icon-button>
</append>
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete
url="Intrastats"
label="Intrastat"
show-field="description"
value-field="id"
ng-model="$ctrl.item.intrastatFk"
vn-name="intrastat"
search-function="{or: [{id: {like: $search +'%'}}, {description: {like: '%'+ $search +'%'}}]}"
initial-data="$ctrl.item.intrastat">
<tpl-item>
<div>{{::description}}</div>
<div class="text-caption text-secondary">
#{{::id}}
</div>
</tpl-item>
<append>
<vn-icon-button
icon="add_circle"
vn-tooltip="New intrastat"
ng-click="$ctrl.showIntrastat($event)">
</vn-icon-button>
</append>
</vn-autocomplete>
<vn-autocomplete
url="Expenses"
label="Expense"
ng-model="$ctrl.item.expenseFk"
vn-name="expense"
initial-data="$ctrl.item.expense">
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal>
<vn-input-number
min="0"
label="Weight/Piece"
ng-model="$ctrl.item.weightByPiece"
vn-name="weightByPiece"
rule>
</vn-input-number>
<vn-input-number
min="0"
label="Units/Box"
ng-model="$ctrl.item.packingOut"
vn-name="packingOut"
rule>
</vn-input-number>
<vn-input-number
min="0"
label="Recycled Plastic"
ng-model="$ctrl.item.recycledPlastic"
vn-name="recycledPlastic"
rule>
</vn-input-number>
<vn-input-number
min="0"
label="Non recycled plastic"
ng-model="$ctrl.item.nonRecycledPlastic"
vn-name="nonRecycledPlastic"
rule>
</vn-input-number>
</vn-horizontal>
<vn-horizontal>
<vn-check
label="Active"
ng-model="$ctrl.item.isActive"
vn-name="isActive">
</vn-check>
<vn-check
label="Price in kg"
ng-model="$ctrl.item.hasKgPrice"
vn-name="priceInKg">
</vn-check>
<vn-check
label="Fragile"
ng-model="$ctrl.item.isFragile"
vn-name="isFragile"
info="Is shown at website, app that this item cannot travel (wreath, palms, ...)">
</vn-check>
<vn-check
label="Do photo"
ng-model="$ctrl.item.isPhotoRequested"
vn-name="isPhotoRequested"
info="This item does need a photo">
</vn-check>
</vn-horizontal>
<vn-horizontal>
<vn-textarea
label="Description"
ng-model="$ctrl.item.description"
vn-name="description"
rule>
</vn-textarea>
</vn-horizontal>
</vn-card>
<vn-button-bar>
<vn-submit
disabled="!watcher.dataChanged()"
label="Save">
</vn-submit>
<vn-button
class="cancel"
label="Undo changes"
disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()">
</vn-button>
</vn-button-bar>
</form>
<!-- Create custom agent dialog -->
<vn-dialog class="edit"
vn-id="intrastat"
on-accept="$ctrl.onIntrastatAccept()"
message="New intrastat">
<tpl-body>
<vn-horizontal>
<vn-input-number
vn-focus
label="Identifier"
ng-model="$ctrl.newIntrastat.intrastatId"
vn-name="id"
required="true">
</vn-input-number>
</vn-horizontal>
<vn-horizontal>
<vn-textfield
label="Description"
ng-model="$ctrl.newIntrastat.description"
vn-name="description"
required="true">
</vn-textfield>
</vn-horizontal>
</tpl-body>
<tpl-buttons>
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
<button response="accept" translate>Create</button>
</tpl-buttons>
</vn-dialog>
<!-- Filter item dialog -->
<vn-dialog
vn-id="filterDialog"
message="Filter item">
<tpl-body class="itemFilter">
<vn-horizontal>
<vn-textfield
label="Name"
ng-model="$ctrl.itemFilterParams.name"
vn-focus>
</vn-textfield>
<vn-textfield
label="Size"
ng-model="$ctrl.itemFilterParams.size">
</vn-textfield>
<vn-autocomplete
label="Producer"
ng-model="$ctrl.itemFilterParams.producerFk"
url="Producers"
show-field="name"
value-field="id">
</vn-autocomplete>
<vn-autocomplete
label="Type"
ng-model="$ctrl.itemFilterParams.typeFk"
url="ItemTypes"
show-field="name"
value-field="id">
</vn-autocomplete>
<vn-autocomplete
label="Color"
ng-model="$ctrl.itemFilterParams.inkFk"
url="Inks"
show-field="name"
value-field="id">
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal class="vn-mb-md">
<vn-button vn-none
label="Search"
ng-click="$ctrl.filter()">
</vn-button>
</vn-horizontal>
<vn-crud-model
vn-id="itemsModel"
url="Items/withName"
filter="$ctrl.itemFilter"
data="items"
limit="10">
</vn-crud-model>
<vn-data-viewer
model="itemsModel"
class="vn-w-lg">
<vn-table class="scrollable">
<vn-thead>
<vn-tr>
<vn-th shrink>ID</vn-th>
<vn-th expand>Item</vn-th>
<vn-th number>Size</vn-th>
<vn-th expand>Producer</vn-th>
<vn-th>Color</vn-th>
</vn-tr>
</vn-thead>
<vn-tbody>
<a ng-repeat="item in items"
class="clickable vn-tr search-result"
ng-click="$ctrl.selectItem(item.id)">
<vn-td shrink>
<span
vn-click-stop="itemDescriptor.show($event, item.id)"
class="link">
{{::item.id}}
</span>
</vn-td>
<vn-td expand>{{::item.name}}</vn-td>
<vn-td number>{{::item.size}}</vn-td>
<vn-td expand>{{::item.producer.name}}</vn-td>
<vn-td>{{::item.ink.name}}</vn-td>
</a>
</vn-tbody>
</vn-table>
</vn-data-viewer>
<vn-item-descriptor-popover
vn-id="item-descriptor"
warehouse-fk="$ctrl.vnConfig.warehouseFk">
</vn-item-descriptor-popover>
</tpl-body>
</vn-dialog>

View File

@ -1,87 +0,0 @@
import ngModule from '../module';
import Section from 'salix/components/section';
class Controller extends Section {
showIntrastat(event) {
if (event.defaultPrevented) return;
event.preventDefault();
this.newIntrastat = {
taxClassFk: this.item.taxClassFk
};
this.$.intrastat.show();
}
onIntrastatAccept() {
const query = `Items/${this.$params.id}/createIntrastat`;
return this.$http.patch(query, this.newIntrastat)
.then(res => this.item.intrastatFk = res.data.id);
}
itemSearchFunc($search) {
return /^\d+$/.test($search)
? {id: $search}
: {name: {like: '%' + $search + '%'}};
}
showFilterDialog(item) {
this.activeItem = item;
this.itemFilterParams = {};
this.itemFilter = {
include: [
{
relation: 'producer',
scope: {
fields: ['name']
}
},
{
relation: 'ink',
scope: {
fields: ['name']
}
}
]
};
this.$.filterDialog.show();
}
selectItem(id) {
this.activeItem['genericFk'] = id;
this.$.filterDialog.hide();
}
filter() {
const filter = this.itemFilter;
const params = this.itemFilterParams;
const where = {};
for (let key in params) {
const value = params[key];
if (!value) continue;
switch (key) {
case 'name':
where[key] = {like: `%${value}%`};
break;
case 'producerFk':
case 'typeFk':
case 'size':
case 'inkFk':
where[key] = value;
}
}
filter.where = where;
this.$.itemsModel.applyFilter(filter);
}
}
ngModule.vnComponent('vnItemBasicData', {
template: require('./index.html'),
bindings: {
item: '<'
},
controller: Controller
});

View File

@ -1,32 +0,0 @@
import './index.js';
describe('vnItemBasicData', () => {
describe('Component vnItemBasicData', () => {
let $httpBackend;
let $scope;
let controller;
beforeEach(ngModule('item'));
beforeEach(inject(($componentController, $rootScope, _$httpBackend_) => {
$httpBackend = _$httpBackend_;
$scope = $rootScope.$new();
const $element = angular.element('<vn-item-basic-data></vn-item-basic-data>');
controller = $componentController('vnItemBasicData', {$element, $scope});
controller.$.watcher = {};
controller.$params.id = 1;
controller.item = {id: 1, name: 'Rainbow Coral'};
}));
describe('onIntrastatAccept()', () => {
it('should pass the data to the watcher', () => {
const newIntrastatId = 20;
$httpBackend.expect('PATCH', 'Items/1/createIntrastat').respond({id: 20});
controller.onIntrastatAccept();
$httpBackend.flush();
expect(controller.item.intrastatFk).toEqual(newIntrastatId);
});
});
});
});

View File

@ -1,19 +0,0 @@
Reference: Referencia
Full name calculates based on tags 1-3. Is not recommended to change it manually: >-
El nombre completo se calcula
basado en los tags 1-3.
No se recomienda cambiarlo manualmente
Is active: Activo
Expense: Gasto
Price in kg: Precio en kg
New intrastat: Nuevo intrastat
Identifier: Identificador
Fragile: Frágil
Is shown at website, app that this item cannot travel (wreath, palms, ...): Se muestra en la web, app que este artículo no puede viajar (coronas, palmas, ...)
Multiplier: Multiplicador
Generic: Genérico
This item does need a photo: Este artículo necesita una foto
Do photo: Hacer foto
Recycled Plastic: Plástico reciclado
Non recycled plastic: Plástico no reciclado
Minimum sales quantity: Cantidad mínima de venta

View File

@ -1,102 +0,0 @@
<vn-watcher
vn-id="watcher"
data="$ctrl.botanical"
form="form">
</vn-watcher>
<form name="form" ng-submit="$ctrl.onSubmit()" ng-cloak class="vn-w-md">
<vn-card class="vn-pa-lg">
<vn-horizontal>
<vn-autocomplete
label="Genus"
ng-model="$ctrl.botanical.genusFk"
url="Genera"
show-field="name"
value-field="id">
<append>
<vn-icon-button
icon="add_circle"
vn-tooltip="New genus"
ng-click="$ctrl.showGenus($event)"
vn-acl="logisticBoss"
vn-acl-action="remove">
</vn-icon-button>
</append>
</vn-autocomplete>
<vn-autocomplete
label="Species"
ng-model="$ctrl.botanical.specieFk"
url="Species"
show-field="name"
value-field="id">
<tpl-item>
<div>{{name}}</div>
<div class="text-caption text-secondary">
{{genus.name}}
</div>
</tpl-item>
<append>
<vn-icon-button
icon="add_circle"
vn-tooltip="New species"
ng-click="$ctrl.showSpecies($event)"
vn-acl="logisticBoss"
vn-acl-action="remove">
</vn-icon-button>
</append>
</vn-autocomplete>
</vn-horizontal>
</vn-card>
<vn-button-bar>
<vn-submit
disabled="!watcher.dataChanged()"
label="Save">
</vn-submit>
<!-- # #2680 Undo changes button bugs -->
<!-- <vn-button
class="cancel"
label="Undo changes"
disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()">
</vn-button> -->
</vn-button-bar>
</form>
<!-- Create new genus dialog -->
<vn-dialog class="edit"
vn-id="genus"
on-response="$ctrl.onGenusResponse($response)"
on-accept="$ctrl.onGenusAccept()"
message="New genus">
<tpl-body>
<vn-horizontal>
<vn-textfield vn-one vn-focus
label="Latin genus name"
ng-model="$ctrl.data.name"
required="true">
</vn-textfield>
</vn-horizontal>
</tpl-body>
<tpl-buttons>
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
<button response="accept" translate>Create</button>
</tpl-buttons>
</vn-dialog>
<!-- Create new species dialog -->
<vn-dialog class="edit"
vn-id="species"
on-response="$ctrl.onSpeciesResponse($response)"
on-accept="$ctrl.onSpeciesAccept()"
message="New species">
<tpl-body>
<vn-horizontal>
<vn-textfield vn-one vn-focus
label="Latin species name"
ng-model="$ctrl.data.name"
required="true">
</vn-textfield>
</vn-horizontal>
</tpl-body>
<tpl-buttons>
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
<button response="accept" translate>Create</button>
</tpl-buttons>
</vn-dialog>

View File

@ -1,99 +0,0 @@
import ngModule from '../module';
import Section from 'salix/components/section';
class Controller extends Section {
get item() {
return this._item;
}
set item(value) {
this._item = value;
if (value)
this.getBotanicalData();
}
showGenus(event) {
if (event.defaultPrevented) return;
event.preventDefault();
this.$.genus.show();
}
showSpecies(event) {
if (event.defaultPrevented) return;
event.preventDefault();
this.$.species.show();
}
onGenusAccept() {
try {
if (!this.data.name)
throw new Error(`The name of the genus can't be empty`);
this.$http.post(`genera`, this.data).then(res => {
this.vnApp.showMessage(this.$t('The genus has been created'));
this.emit('response', {$response: res.data});
this.onGenusResponse(res.data);
});
} catch (e) {
this.vnApp.showError(this.$t(e.message));
return false;
}
return true;
}
onSpeciesAccept() {
try {
if (!this.data.name)
throw new Error(`The name of the species can't be empty`);
this.$http.post(`species`, this.data).then(res => {
this.vnApp.showMessage(this.$t('The species has been created'));
this.emit('response', {$response: res.data});
this.onSpeciesResponse(res.data);
});
} catch (e) {
this.vnApp.showError(this.$t(e.message));
return false;
}
return true;
}
getBotanicalData() {
const filter = {
where: {itemFk: this.item.id}
};
const filterParams = encodeURIComponent(JSON.stringify(filter));
this.$http.get(`ItemBotanicals?filter=${filterParams}`).then(res => {
if (res.data[0])
this.botanical = res.data[0];
else
this.botanical = {itemFk: this.item.id};
});
}
onSubmit() {
this.$.watcher.check();
this.$http.patch(`ItemBotanicals`, this.botanical).then(() => {
this.$.watcher.notifySaved();
this.$.watcher.updateOriginalData();
});
}
onGenusResponse(response) {
this.botanical.genusFk = response.id;
}
onSpeciesResponse(response) {
this.botanical.specieFk = response.id;
}
}
ngModule.vnComponent('vnItemBotanical', {
template: require('./index.html'),
bindings: {
item: '<'
},
controller: Controller
});

View File

@ -1,179 +0,0 @@
import './index.js';
describe('vnItemBotanical', () => {
describe('Component vnItemBotanical', () => {
let $httpBackend;
let $scope;
let controller;
let vnApp;
beforeEach(ngModule('item'));
beforeEach(inject(($componentController, $rootScope, _$httpBackend_, _vnApp_) => {
$httpBackend = _$httpBackend_;
vnApp = _vnApp_;
jest.spyOn(vnApp, 'showError');
$scope = $rootScope.$new();
const $element = angular.element('<vn-item-botanical></vn-item-botanical>');
controller = $componentController('vnItemBotanical', {$element, $scope});
controller.item = {id: 5};
controller.$params = {itemFk: 5};
controller.$ = {
watcher: {
check: () => {},
notifySaved: () => {},
updateOriginalData: () => {}},
genus: {
show: () => {}
},
species: {
show: () => {}
}};
}));
beforeEach(() => {
const response = {data: 'MyResult'};
$httpBackend.whenRoute('GET', 'ItemBotanicals').respond(response);
});
describe('showGenus()', () => {
it('should do nothing in genus field if it default is prevented', () => {
const event = {
defaultPrevented: true,
preventDefault: () => {}
};
jest.spyOn(event, 'preventDefault');
jest.spyOn(controller.$.genus, 'show');
controller.showGenus(event);
expect(event.preventDefault).not.toHaveBeenCalledWith();
expect(controller.$.genus.show).not.toHaveBeenCalledWith();
});
it('should call show function in genus field when the default is not prevented', () => {
const event = {
defaultPrevented: false,
preventDefault: () => {}
};
jest.spyOn(event, 'preventDefault');
jest.spyOn(controller.$.genus, 'show');
controller.showGenus(event);
expect(event.preventDefault).toHaveBeenCalledWith();
expect(controller.$.genus.show).toHaveBeenCalledWith();
});
});
describe('showSpecies()', () => {
it('should do nothing in species field if it default is prevented', () => {
const event = {
defaultPrevented: true,
preventDefault: () => {}
};
jest.spyOn(event, 'preventDefault');
jest.spyOn(controller.$.species, 'show');
controller.showSpecies(event);
expect(event.preventDefault).not.toHaveBeenCalledWith();
expect(controller.$.species.show).not.toHaveBeenCalledWith();
});
it('should call show function in species field when the default is not prevented', () => {
const event = {
defaultPrevented: false,
preventDefault: () => {}
};
jest.spyOn(event, 'preventDefault');
jest.spyOn(controller.$.species, 'show');
controller.showSpecies(event);
expect(event.preventDefault).toHaveBeenCalledWith();
expect(controller.$.species.show).toHaveBeenCalledWith();
});
});
describe('onGenusAccept()', () => {
it('should throw an error if the item botanical has no genus name', () => {
jest.spyOn(controller.vnApp, 'showMessage');
controller.data = {};
controller.onGenusAccept();
expect(controller.vnApp.showError).toHaveBeenCalledWith(`The name of the genus can't be empty`);
});
it('should add the new genus', () => {
controller.data = {
id: 4,
name: 'Anilius'
};
$httpBackend.expectPOST('genera', controller.data).respond(200, controller.data);
controller.onGenusAccept();
$httpBackend.flush();
controller.onGenusResponse(controller.data);
expect(controller.botanical.genusFk).toEqual(controller.data.id);
});
});
describe('onSpeciesAccept()', () => {
it('should throw an error if the item botanical has no species name', () => {
jest.spyOn(controller.vnApp, 'showMessage');
controller.data = {};
controller.onSpeciesAccept();
expect(controller.vnApp.showError).toHaveBeenCalledWith(`The name of the species can't be empty`);
});
it('should add the new species', () => {
controller.data = {
id: 2,
name: 'Spasiva'
};
$httpBackend.expectPOST('species', controller.data).respond(200, controller.data);
controller.onSpeciesAccept();
$httpBackend.flush();
controller.onSpeciesResponse(controller.data);
});
});
describe('onSubmit()', () => {
it('should make HTTP POST request to save the genus and species data', () => {
jest.spyOn(controller.$.watcher, 'updateOriginalData');
jest.spyOn(controller.$.watcher, 'check');
jest.spyOn(controller.$.watcher, 'notifySaved');
$httpBackend.expectPATCH('ItemBotanicals').respond();
controller.onSubmit();
$httpBackend.flush();
expect(controller.$.watcher.updateOriginalData).toHaveBeenCalledWith();
expect(controller.$.watcher.check).toHaveBeenCalledWith();
expect(controller.$.watcher.notifySaved).toHaveBeenCalledWith();
});
});
describe('getBotanicalData()', () => {
it('should get the species and genus data references of the item', () => {
controller.getBotanicalData();
$httpBackend.flush();
expect(controller.botanical).toEqual(controller.$params);
});
});
});
});

View File

@ -1,5 +0,0 @@
The genus has been created: El genus ha sido creado
The species has been created: La especie ha sido creada
Latin species name: Nombre de la especie en latín
Latin genus name: Nombre del genus en latín
Species: Especie

View File

@ -1,8 +0,0 @@
<vn-portal slot="menu">
<vn-item-descriptor
warehouse-fk="$ctrl.warehouseFk"
item="$ctrl.item"
card-reload="$ctrl.reload()"></vn-item-descriptor>
<vn-left-menu source="card"></vn-left-menu>
</vn-portal>
<ui-view></ui-view>

View File

@ -1,33 +0,0 @@
import ngModule from '../module';
import ModuleCard from 'salix/components/module-card';
class Controller extends ModuleCard {
reload() {
this.$http.get(`Items/${this.$params.id}/getCard`)
.then(res => this.item = res.data);
this.$http.get('ItemConfigs/findOne')
.then(res => {
if (this.$state.getCurrentPath()[4].state.name === 'item.card.diary') return;
this.warehouseFk = res.data.warehouseFk;
this.getWarehouseName(res.data.warehouseFk);
});
}
getWarehouseName(warehouseFk) {
const filter = {
where: {id: warehouseFk}
};
this.$http.get('Warehouses/findOne', {filter})
.then(res => {
this.warehouseText = this.$t('WarehouseFk', {
warehouseName: res.data.name
});
});
}
}
ngModule.vnComponent('vnItemCard', {
template: require('./index.html'),
controller: Controller
});

View File

@ -1,32 +0,0 @@
import './index.js';
describe('Item', () => {
describe('Component vnItemCard', () => {
let controller;
let $httpBackend;
let $state;
let data = {id: 1, name: 'fooName'};
beforeEach(ngModule('item'));
beforeEach(inject(($componentController, _$httpBackend_, $stateParams, _$state_) => {
$httpBackend = _$httpBackend_;
$state = _$state_;
$state.getCurrentPath = () => [null, null, null, null, {state: {name: 'item.card.diary'}}];
let $element = angular.element('<div></div>');
controller = $componentController('vnItemCard', {$element});
$stateParams.id = data.id;
$httpBackend.whenRoute('GET', 'Items/:id/getCard').respond(data);
}));
it('should request data and set it on the controller', () => {
$httpBackend.expect('GET', `ItemConfigs/findOne`).respond({});
controller.reload();
$httpBackend.flush();
expect(controller.item).toEqual(data);
});
});
});

View File

@ -1,95 +0,0 @@
<vn-watcher
vn-id="watcher"
url="Items/new"
data="$ctrl.item"
insert-mode="true"
form="form">
</vn-watcher>
<vn-crud-model
auto-load="true"
url="Origins"
data="originsData"
order="name"
vn-id="origin-model">
</vn-crud-model>
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md">
<vn-card class="vn-pa-lg">
<vn-horizontal>
<vn-textfield
label="Name"
ng-model="$ctrl.item.provisionalName"
vn-name="name"
vn-focus>
</vn-textfield>
<vn-autocomplete
ng-model="$ctrl.item.tag"
url="Tags"
show-field="name"
value-field="id"
label="Tag"
vn-name="tag">
</vn-autocomplete>
<vn-autocomplete
data="$ctrl.validPriorities"
label="Priority"
ng-model="$ctrl.item.priority"
show-field="priority"
value-field="priority"
vn-name="priority">
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete
label="Type"
ng-model="$ctrl.item.typeFk"
vn-name="type"
url="ItemTypes"
fields="['code', 'categoryFk']"
search-function="{or: [{code: {like: $search +'%'}}, {name: {like: '%'+ $search +'%'}}]}"
include="'category'">
<tpl-item>
<div style="display: flex;">
<div style="width: 3em; padding-right: 1em;">{{::code}}</div>
<div>{{::name}}</div>
</div>
<div class="text-caption text-secondary">
{{category.name}}
</div>
</tpl-item>
</vn-autocomplete>
<vn-autocomplete
label="Intrastat"
ng-model="$ctrl.item.intrastatFk"
vn-name="intrastat"
url="Intrastats"
show-field="description"
search-function="{or: [{id: {like: $search +'%'}}, {description: {like: '%'+ $search +'%'}}]}">
<tpl-item>
<div>{{::description}}</div>
<div class="text-caption text-secondary">
#{{::id}}
</div>
</tpl-item>
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete
data="originsData"
label="Origin"
ng-model="$ctrl.item.originFk"
vn-name="origin">
</vn-autocomplete>
</vn-horizontal>
</vn-card>
<vn-button-bar>
<vn-submit
disabled="!watcher.dataChanged()"
label="Create">
</vn-submit>
<vn-button
class="cancel"
label="Cancel"
ui-sref="item.index">
</vn-button>
</vn-button-bar>
</form>

View File

@ -1,40 +0,0 @@
import ngModule from '../module';
import Section from 'salix/components/section';
class Controller extends Section {
constructor($element, $) {
super($element, $);
this.fetchDefaultPriorityTag();
}
fetchDefaultPriorityTag() {
this.validPriorities = [];
const filter = {fields: ['defaultPriority', 'defaultTag', 'validPriorities'], limit: 1};
this.$http.get(`ItemConfigs`, {filter})
.then(res => {
if (res.data) {
const dataRow = res.data[0];
dataRow.validPriorities.forEach(priority => {
this.validPriorities.push({priority});
});
this.item = {
priority: dataRow.defaultPriority,
tag: dataRow.defaultTag
};
}
});
}
onSubmit() {
this.$.watcher.submit().then(
json => this.$state.go('item.card.basicData', {id: json.data.id})
);
}
}
Controller.$inject = ['$element', '$scope'];
ngModule.vnComponent('vnItemCreate', {
template: require('./index.html'),
controller: Controller
});

View File

@ -1,37 +0,0 @@
import './index.js';
describe('Item', () => {
describe('Component vnItemCreate', () => {
let $scope;
let $state;
let controller;
beforeEach(ngModule('item'));
beforeEach(inject(($componentController, $rootScope, _$state_) => {
$scope = $rootScope.$new();
$state = _$state_;
$scope.watcher = {
submit: () => {
return {
then: callback => {
callback({data: {id: 1}});
}
};
}
};
const $element = angular.element('<vn-item-create></vn-item-create>');
controller = $componentController('vnItemCreate', {$element, $scope});
}));
describe('onSubmit()', () => {
it(`should call submit() on the watcher then expect a callback`, () => {
jest.spyOn($state, 'go');
controller.onSubmit();
expect(controller.$state.go).toHaveBeenCalledWith('item.card.basicData', {id: 1});
});
});
});
});

View File

@ -1 +0,0 @@
Temporal name: Nombre temporal

View File

@ -1,2 +0,0 @@
<vn-card>
</vn-card>

View File

@ -1,21 +0,0 @@
import ngModule from '../module';
import Section from 'salix/components/section';
class Controller extends Section {
constructor($element, $) {
super($element, $);
}
async $onInit() {
this.$state.go('item.card.summary', {id: this.$params.id});
window.location.href = await this.vnApp.getUrl(`item/${this.$params.id}/diary`);
}
}
ngModule.vnComponent('vnItemDiary', {
template: require('./index.html'),
controller: Controller,
bindings: {
item: '<'
}
});

Some files were not shown because too many files have changed in this diff Show More