Merge commit 'cc781697073254f247402b2cf8849bc21cbef70e' into test
gitea/salix/test This commit looks good Details

This commit is contained in:
Joan Sanchez 2019-05-08 07:16:31 +02:00
commit f083dd1208
35 changed files with 516 additions and 193 deletions

View File

@ -7,10 +7,6 @@ ALTER TABLE `vn2008`.`Colas`
CHANGE COLUMN `Id_Impresora` `Id_Impresora` TINYINT(3) UNSIGNED NULL DEFAULT NULL , CHANGE COLUMN `Id_Impresora` `Id_Impresora` TINYINT(3) UNSIGNED NULL DEFAULT NULL ,
CHANGE COLUMN `Id_Prioridad` `Id_Prioridad` TINYINT(3) UNSIGNED NULL DEFAULT NULL ; CHANGE COLUMN `Id_Prioridad` `Id_Prioridad` TINYINT(3) UNSIGNED NULL DEFAULT NULL ;
ALTER TABLE `vn2008`.`Colas` ALTER TABLE `vn2008`.`Colas`
ADD CONSTRAINT `Colas_ibfk_4`
FOREIGN KEY (`Id_Impresora`)
REFERENCES `vn2008`.`Impresoras` (`Id_Impresora`)
ON UPDATE CASCADE,
ADD CONSTRAINT `Colas_ibfk_3` ADD CONSTRAINT `Colas_ibfk_3`
FOREIGN KEY (`Id_Prioridad`) FOREIGN KEY (`Id_Prioridad`)
REFERENCES `vn2008`.`Prioridades` (`Id_Prioridad`) REFERENCES `vn2008`.`Prioridades` (`Id_Prioridad`)

View File

@ -3,10 +3,6 @@
ALTER TABLE `vn`.`itemTaxCountry` AUTO_INCREMENT = 1; ALTER TABLE `vn`.`itemTaxCountry` AUTO_INCREMENT = 1;
ALTER TABLE `vn2008`.`Consignatarios` AUTO_INCREMENT = 1; ALTER TABLE `vn2008`.`Consignatarios` AUTO_INCREMENT = 1;
INSERT INTO `vn`.`ticketConfig` (`id`, `scopeDays`)
VALUES
('1', '6');
INSERT INTO `account`.`mailConfig` (`id`, `domain`) INSERT INTO `account`.`mailConfig` (`id`, `domain`)
VALUES VALUES
('1', 'verdnatura.es'); ('1', 'verdnatura.es');
@ -24,18 +20,18 @@ DELETE FROM `vn`.`worker` WHERE name ='customer';
INSERT INTO `account`.`user`(`id`,`name`,`password`,`role`,`active`,`email`,`lang`) INSERT INTO `account`.`user`(`id`,`name`,`password`,`role`,`active`,`email`,`lang`)
VALUES VALUES
(101, 'BruceWayne', 'ac754a330530832ba1bf7687f577da91', 2 , 1, 'BruceWayne@mydomain.com', 'es'), (101, 'BruceWayne', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'BruceWayne@mydomain.com', 'es'),
(102, 'PetterParker', 'ac754a330530832ba1bf7687f577da91', 2 , 1, 'PetterParker@mydomain.com', 'es'), (102, 'PetterParker', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'PetterParker@mydomain.com', 'es'),
(103, 'ClarkKent', 'ac754a330530832ba1bf7687f577da91', 2 , 1, 'ClarkKent@mydomain.com', 'es'), (103, 'ClarkKent', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'ClarkKent@mydomain.com', 'es'),
(104, 'TonyStark', 'ac754a330530832ba1bf7687f577da91', 2 , 1, 'TonyStark@mydomain.com', 'es'), (104, 'TonyStark', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'TonyStark@mydomain.com', 'es'),
(105, 'MaxEisenhardt', 'ac754a330530832ba1bf7687f577da91', 2 , 1, 'MaxEisenhardt@mydomain.com', 'es'), (105, 'MaxEisenhardt', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'MaxEisenhardt@mydomain.com', 'es'),
(106, 'DavidCharlesHaller', 'ac754a330530832ba1bf7687f577da91', 1 , 1, 'DavidCharlesHaller@mydomain.com', 'es'), (106, 'DavidCharlesHaller', 'ac754a330530832ba1bf7687f577da91', 1, 1, 'DavidCharlesHaller@mydomain.com', 'es'),
(107, 'HankPym', 'ac754a330530832ba1bf7687f577da91', 1 , 1, 'HankPym@mydomain.com', 'es'), (107, 'HankPym', 'ac754a330530832ba1bf7687f577da91', 1, 1, 'HankPym@mydomain.com', 'es'),
(108, 'CharlesXavier', 'ac754a330530832ba1bf7687f577da91', 1, 1, 'CharlesXavier@mydomain.com', 'es'), (108, 'CharlesXavier', 'ac754a330530832ba1bf7687f577da91', 1, 1, 'CharlesXavier@mydomain.com', 'es'),
(109, 'BruceBanner', 'ac754a330530832ba1bf7687f577da91', 1 , 1, 'BruceBanner@mydomain.com', 'es'), (109, 'BruceBanner', 'ac754a330530832ba1bf7687f577da91', 1, 1, 'BruceBanner@mydomain.com', 'es'),
(110, 'JessicaJones', 'ac754a330530832ba1bf7687f577da91', 1 , 1, 'JessicaJones@mydomain.com', 'es'), (110, 'JessicaJones', 'ac754a330530832ba1bf7687f577da91', 1, 1, 'JessicaJones@mydomain.com', 'es'),
(111, 'Missing', 'ac754a330530832ba1bf7687f577da91', 2 , 0, NULL, 'es'), (111, 'Missing', 'ac754a330530832ba1bf7687f577da91', 2, 0, NULL, 'es'),
(112, 'Trash', 'ac754a330530832ba1bf7687f577da91', 2 , 0, NULL, 'es'); (112, 'Trash', 'ac754a330530832ba1bf7687f577da91', 2, 0, NULL, 'es');
INSERT INTO `vn2008`.`Trabajadores`(`CodigoTrabajador`, `Id_Trabajador`, `Nombre`, `Apellidos`, `user_id`) INSERT INTO `vn2008`.`Trabajadores`(`CodigoTrabajador`, `Id_Trabajador`, `Nombre`, `Apellidos`, `user_id`)
VALUES VALUES
@ -56,11 +52,11 @@ INSERT INTO `vn`.`country`(`id`, `country`, `isUeeMember`, `code`, `currencyFk`)
INSERT INTO `vn`.`warehouse`(`id`, `name`, `isComparative`, `isInventory`, `hasAvailable`, `isManaged`) INSERT INTO `vn`.`warehouse`(`id`, `name`, `isComparative`, `isInventory`, `hasAvailable`, `isManaged`)
VALUES VALUES
(1, 'Warehouse One', 0, 1, 1, 1), (1, 'Warehouse One', 0, 1, 1, 1),
(2, 'Warehouse Two', 0, 1, 1, 1), (2, 'Warehouse Two', 0, 1, 1, 1),
(3, 'Warehouse Three', 1, 1, 1, 1), (3, 'Warehouse Three', 1, 1, 1, 1),
(4, 'Warehouse Four', 1, 1, 1, 1), (4, 'Warehouse Four', 1, 1, 1, 1),
(5, 'Warehouse Five', 1, 0, 1, 0); (5, 'Warehouse Five', 1, 0, 1, 0);
INSERT INTO `vn`.`warehouseAlias`(`id`, `name`) INSERT INTO `vn`.`warehouseAlias`(`id`, `name`)
VALUES VALUES
@ -114,7 +110,7 @@ UPDATE `vn`.`agencyMode` SET `deliveryMethodFk` = 1 WHERE `id` = 8;
UPDATE `vn`.`agencyMode` SET `deliveryMethodFk` = 4 WHERE `id` = 23; UPDATE `vn`.`agencyMode` SET `deliveryMethodFk` = 4 WHERE `id` = 23;
UPDATE `vn`.`agencyMode` SET `deliveryMethodFk` = 1 WHERE `id` = 10; UPDATE `vn`.`agencyMode` SET `deliveryMethodFk` = 1 WHERE `id` = 10;
UPDATE `vn`.`agencyMode` SET `web` = 1 WHERE `id` = 1; UPDATE `vn`.`agencyMode` SET `web` = 1;
UPDATE `vn`.`agencyMode` SET `code` = 'refund' WHERE `id` = 23; UPDATE `vn`.`agencyMode` SET `code` = 'refund' WHERE `id` = 23;
@ -594,14 +590,21 @@ INSERT INTO `vn`.`intrastat`(`id`, `description`, `taxClassFk`, `taxCodeFk`)
INSERT INTO `vn`.`item`(`id`, `typeFk`, `size`, `inkFk`, `stems`, `originFk`, `description`, `producerFk`, `intrastatFk`, `isOnOffer`, `expenceFk`, `isBargain`, `comment`, `relevancy`, `image`, `taxClassFk`, `subName`) INSERT INTO `vn`.`item`(`id`, `typeFk`, `size`, `inkFk`, `stems`, `originFk`, `description`, `producerFk`, `intrastatFk`, `isOnOffer`, `expenceFk`, `isBargain`, `comment`, `relevancy`, `image`, `taxClassFk`, `subName`)
VALUES VALUES
(1 , 2, 70, 'AMA', 1 , 1, 'One of the infinity gems', 1, 06021010, 0, 2000000000, 0, NULL, 0, 66540, 1, NULL), (1, 2, 70, 'AMA', 1, 1, NULL, 1, 06021010, 0, 2000000000, 0, NULL, 0, 66540, 1, NULL),
(2 , 2, 70, 'AZL', 1 , 2, 'One of the infinity gems', 1, 06021010, 0, 2000000000, 0, NULL, 0, 65540, 1, NULL), (2, 2, 70, 'AZL', 1, 2, NULL, 1, 06021010, 0, 2000000000, 0, NULL, 0, 65540, 1, NULL),
(3 , 1, 60, 'AMR', 1 , 3, 'Rhodeys armor', 1, 05080000, 0, 4751000000, 0, NULL, 0, 61692, 1, NULL), (3, 1, 60, 'AMR', 1, 3, NULL, 1, 05080000, 0, 4751000000, 0, NULL, 0, 61692, 1, NULL),
(4 , 1, 60, 'AMR', 1 , 1, 'Iron Mans first armor', 1, 05080000, 1, 4751000000, 0, NULL, 0, 66090, 2, NULL), (4, 1, 60, 'AMR', 1, 1, NULL, 1, 05080000, 1, 4751000000, 0, NULL, 0, 66090, 2, NULL),
(5 , 3, 30, 'GRE', 1 , 2, 'Thors hammer!', 2, 06021010, 1, 4751000000, 0, NULL, 0, 67350, 2, NULL), (5, 3, 30, 'GRE', 1, 2, NULL, 2, 06021010, 1, 4751000000, 0, NULL, 0, 67350, 2, NULL),
(6 , 5, 30, 'GRE', 1 , 2, NULL, NULL, 06021010, 0, 4751000000, 0, NULL, 0, 67350, 2, NULL), (6, 5, 30, 'GRE', 1, 2, NULL, NULL, 06021010, 0, 4751000000, 0, NULL, 0, 67350, 2, NULL),
(7 , 5, 90, 'AZL', 1 , 2, NULL, NULL, 06021010, 0, 4751000000, 0, NULL, 0, 67350, 2, NULL), (7, 5, 90, 'AZL', 1, 2, NULL, NULL, 06021010, 0, 4751000000, 0, NULL, 0, 67350, 2, NULL),
(71, 4, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 1, 4751000000, 0, NULL, 0, NULL, 2, NULL); (8, 2, 70, 'AMA', 1, 1, NULL, 1, 06021010, 0, 2000000000, 0, NULL, 0, 66540, 1, NULL),
(9, 2, 70, 'AZL', 1, 2, NULL, 1, 06021010, 0, 2000000000, 0, NULL, 0, 65540, 1, NULL),
(10, 1, 60, 'AMR', 1, 3, NULL, 1, 05080000, 0, 4751000000, 0, NULL, 0, 61692, 1, NULL),
(11, 1, 60, 'AMR', 1, 1, NULL, 1, 05080000, 1, 4751000000, 0, NULL, 0, 66090, 2, NULL),
(12, 3, 30, 'GRE', 1, 2, NULL, 2, 06021010, 1, 4751000000, 0, NULL, 0, 67350, 2, NULL),
(13, 5, 30, 'GRE', 1, 2, NULL, NULL, 06021010, 0, 4751000000, 0, NULL, 0, 67350, 2, NULL),
(14, 5, 90, 'AZL', 1, 2, NULL, NULL, 06021010, 0, 4751000000, 0, NULL, 0, 67350, 2, NULL),
(71, 4, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 1, 4751000000, 0, NULL, 0, NULL, 2, NULL);
INSERT INTO `vn`.`expedition`(`id`, `agencyModeFk`, `ticketFk`, `isBox`, `created`, `itemFk`, `counter`, `checked`, `workerFk`) INSERT INTO `vn`.`expedition`(`id`, `agencyModeFk`, `ticketFk`, `isBox`, `created`, `itemFk`, `counter`, `checked`, `workerFk`)
VALUES VALUES
@ -626,30 +629,30 @@ INSERT INTO `vn`.`ticketPackaging`(`id`, `ticketFk`, `packagingFk`, `quantity`,
INSERT INTO `vn`.`sale`(`id`, `itemFk`, `ticketFk`, `concept`, `quantity`, `price`, `discount`, `reserved`, `isPicked`, `created`) INSERT INTO `vn`.`sale`(`id`, `itemFk`, `ticketFk`, `concept`, `quantity`, `price`, `discount`, `reserved`, `isPicked`, `created`)
VALUES VALUES
(1, 1, 1, 'Ranged weapon longbow 2m', 5, 9.10, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -15 DAY)), (1, 1, 1, 'Ranged weapon longbow 2m', 5, 9.10, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -15 DAY)),
(2, 2, 1, 'Melee weapon combat fist 15cm', 10, 1.07, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -15 DAY)), (2, 2, 1, 'Melee weapon combat fist 15cm', 10, 1.07, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -15 DAY)),
(3, 1, 1, 'Ranged weapon longbow 2m', 2, 9.10, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -15 DAY)), (3, 1, 1, 'Ranged weapon longbow 2m', 2, 9.10, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -15 DAY)),
(4, 4, 1, 'Melee weapon heavy shield 1x0.5m', 20, 3.06, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -15 DAY)), (4, 4, 1, 'Melee weapon heavy shield 1x0.5m', 20, 3.06, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -15 DAY)),
(5, 1, 2, 'Ranged weapon longbow 2m', 10, 9.10, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -10 DAY)), (5, 1, 2, 'Ranged weapon longbow 2m', 10, 9.10, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -10 DAY)),
(6, 1, 3, 'Ranged weapon longbow 2m', 15, 6.50, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -5 DAY)), (6, 1, 3, 'Ranged weapon longbow 2m', 15, 6.50, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -5 DAY)),
(7, 2, 11, 'Melee weapon combat fist 15cm', 15, 1.46, 0, 0, 0, CURDATE()), (7, 2, 11, 'Melee weapon combat fist 15cm', 15, 1.46, 0, 0, 0, CURDATE()),
(8, 4, 11, 'Melee weapon heavy shield 1x0.5m', 10, 3.04, 0, 0, 0, CURDATE()), (8, 4, 11, 'Melee weapon heavy shield 1x0.5m', 10, 3.04, 0, 0, 0, CURDATE()),
(9, 1, 16, 'Ranged weapon longbow 2m', 5, 9.10, 0, 0, 0, CURDATE()), (9, 1, 16, 'Ranged weapon longbow 2m', 5, 9.10, 0, 0, 0, CURDATE()),
(10, 2, 16, 'Melee weapon combat fist 15cm', 10, 1.07, 0, 0, 0, CURDATE()), (10, 2, 16, 'Melee weapon combat fist 15cm', 10, 1.07, 0, 0, 0, CURDATE()),
(11, 1, 16, 'Ranged weapon longbow 2m', 2, 9.10, 0, 0, 0, CURDATE()), (11, 1, 16, 'Ranged weapon longbow 2m', 2, 9.10, 0, 0, 0, CURDATE()),
(12, 4, 16, 'Melee weapon heavy shield 1x0.5m', 20, 3.06, 0, 0, 0, CURDATE()), (12, 4, 16, 'Melee weapon heavy shield 1x0.5m', 20, 3.06, 0, 0, 0, CURDATE()),
(13, 2, 8, 'Melee weapon combat fist 15cm', 15, 1.30, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL +1 MONTH)), (13, 2, 8, 'Melee weapon combat fist 15cm', 15, 1.30, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL +1 MONTH)),
(14, 1, 8, 'Ranged weapon longbow 2m', 10, 2.30, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL +1 MONTH)), (14, 1, 8, 'Ranged weapon longbow 2m', 10, 2.30, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL +1 MONTH)),
(15, 1, 19, 'Ranged weapon longbow 2m', 10, 1.50, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL +1 DAY)), (15, 1, 19, 'Ranged weapon longbow 2m', 10, 1.50, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL +1 DAY)),
(16, 2, 20, 'Melee weapon combat fist 15cm', 15, 1.30, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL +1 DAY)), (16, 2, 20, 'Melee weapon combat fist 15cm', 15, 1.30, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL +1 DAY)),
(17, 2, 22, 'Melee weapon combat fist 15cm', 30, 2.30, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL +1 DAY)), (17, 2, 22, 'Melee weapon combat fist 15cm', 30, 2.30, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL +1 DAY)),
(18, 4, 22, 'Melee weapon heavy shield 1x0.5m', 20, 3.00, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL +1 DAY)), (18, 4, 22, 'Melee weapon heavy shield 1x0.5m', 20, 3.00, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL +1 DAY)),
(19, 1, 4, 'Ranged weapon longbow 2m', 1, 9.10, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -4 DAY)), (19, 1, 4, 'Ranged weapon longbow 2m', 1, 9.10, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -4 DAY)),
(20, 1, 5, 'Ranged weapon longbow 2m', 1, 9.10, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -3 DAY)), (20, 1, 5, 'Ranged weapon longbow 2m', 1, 9.10, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -3 DAY)),
(21, 1, 6, 'Ranged weapon longbow 2m', 1, 9.10, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -2 DAY)), (21, 1, 6, 'Ranged weapon longbow 2m', 1, 9.10, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -2 DAY)),
(22, 1, 7, 'Ranged weapon longbow 2m', 1, 9.10, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -1 DAY)), (22, 1, 7, 'Ranged weapon longbow 2m', 1, 9.10, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -1 DAY)),
(23, 1, 9, 'Ranged weapon longbow 2m', 1, 9.10, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -2 MONTH)), (23, 1, 9, 'Ranged weapon longbow 2m', 1, 9.10, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -2 MONTH)),
(24, 1, 10, 'Ranged weapon longbow 2m', 1, 9.10, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -3 MONTH)); (24, 1, 10, 'Ranged weapon longbow 2m', 1, 9.10, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -3 MONTH));
INSERT INTO `vn`.`saleChecked`(`saleFk`, `isChecked`) INSERT INTO `vn`.`saleChecked`(`saleFk`, `isChecked`)
VALUES VALUES
@ -821,56 +824,105 @@ INSERT INTO `vn`.`itemBotanical`(`itemFk`, `botanical`, `genusFk`, `specieFk`)
INSERT INTO `vn`.`itemTag`(`id`,`itemFk`,`tagFk`,`value`,`priority`) INSERT INTO `vn`.`itemTag`(`id`,`itemFk`,`tagFk`,`value`,`priority`)
VALUES VALUES
(1 , 1, 56, 'Ranged weapon', 1), (1 , 1, 56, 'Ranged weapon', 1),
(2 , 1, 58, 'longbow', 2), (2 , 1, 58, 'longbow', 2),
(3 , 1, 27, '2m', 3), (3 , 1, 27, '2m', 3),
(4 , 1, 36, 'Stark Industries', 4), (4 , 1, 36, 'Stark Industries', 4),
(5 , 1, 1, 'Brown', 5), (5 , 1, 1, 'Brown', 5),
(6 , 1, 67, 'precission', 6), (6 , 1, 67, '+1 precission', 6),
(7 , 1, 23, '1', 7), (7 , 1, 23, '1', 7),
(8 , 2, 56, 'Melee weapon', 1), (8 , 2, 56, 'Melee weapon', 1),
(9 , 2, 58, 'combat fist', 2), (9 , 2, 58, 'combat fist', 2),
(10, 2, 27, '15cm', 3), (10, 2, 27, '15cm', 3),
(11, 2, 36, 'Stark Industries', 4), (11, 2, 36, 'Stark Industries', 4),
(12, 2, 1, 'Silver', 5), (12, 2, 1, 'Silver', 5),
(13, 2, 67, 'concussion', 6), (13, 2, 67, 'concussion', 6),
(14, 2, 23, '1', 7), (14, 2, 23, '1', 7),
(15, 3, 56, 'Ranged weapon', 1), (15, 3, 56, 'Ranged weapon', 1),
(16, 3, 58, 'sniper rifle', 2), (16, 3, 58, 'sniper rifle', 2),
(17, 3, 4, '300mm', 3), (17, 3, 4, '300mm', 3),
(18, 3, 36, 'Stark Industries', 4), (18, 3, 36, 'Stark Industries', 4),
(19, 3, 1, 'Green', 5), (19, 3, 1, 'Green', 5),
(20, 3, 67, 'precission', 6), (20, 3, 67, 'precission', 6),
(21, 3, 23, '1', 7), (21, 3, 23, '1', 7),
(22, 4, 56, 'Melee weapon', 1), (22, 4, 56, 'Melee weapon', 1),
(23, 4, 58, 'heavy shield', 2), (23, 4, 58, 'heavy shield', 2),
(24, 4, 4, '1x0.5m', 3), (24, 4, 4, '1x0.5m', 3),
(25, 4, 36, 'Stark Industries', 4), (25, 4, 36, 'Stark Industries', 4),
(26, 4, 1, 'Black', 5), (26, 4, 1, 'Black', 5),
(27, 4, 67, 'containtment', 6), (27, 4, 67, 'containtment', 6),
(28, 4, 23, '1', 7), (28, 4, 23, '1', 7),
(29, 5, 56, 'Ranged weapon', 1), (29, 5, 56, 'Ranged weapon', 1),
(30, 5, 58, 'pistol', 2), (30, 5, 58, 'pistol', 2),
(31, 5, 27, '9mm', 3), (31, 5, 27, '9mm', 3),
(32, 5, 36, 'Stark Industries', 4), (32, 5, 36, 'Stark Industries', 4),
(33, 5, 1, 'Silver', 5), (33, 5, 1, 'Silver', 5),
(34, 5, 67, 'rapid fire', 6), (34, 5, 67, 'rapid fire', 6),
(35, 5, 23, '1', 7), (35, 5, 23, '1', 7),
(36, 6, 56, 'Container', 1), (36, 6, 56, 'Container', 1),
(37, 6, 58, 'ammo box', 2), (37, 6, 58, 'ammo box', 2),
(38, 6, 27, '1m', 3), (38, 6, 27, '1m', 3),
(39, 6, 36, 'Stark Industries', 4), (39, 6, 36, 'Stark Industries', 4),
(40, 6, 1, 'Green', 5), (40, 6, 1, 'Green', 5),
(41, 6, 67, 'supply', 6), (41, 6, 67, 'supply', 6),
(42, 6, 23, '1', 7), (42, 6, 23, '1', 7),
(43, 7, 56, 'Container', 1), (43, 7, 56, 'Container', 1),
(44, 7, 58, 'medical box', 2), (44, 7, 58, 'medical box', 2),
(45, 7, 27, '1m', 3), (45, 7, 27, '1m', 3),
(46, 7, 36, 'Stark Industries', 4), (46, 7, 36, 'Stark Industries', 4),
(47, 7, 1, 'White', 5), (47, 7, 1, 'White', 5),
(48, 7, 67, 'supply', 6), (48, 7, 67, 'supply', 6),
(49, 7, 23, '1', 7), (49, 7, 23, '1', 7),
(50, 71, 92, 'Shipping cost', 2); (50, 8, 56, 'Ranged Reinforced weapon', 1),
(51, 8, 58, '+1 longbow', 2),
(52, 8, 27, '2m', 3),
(53, 8, 36, 'Stark Industries', 4),
(54, 8, 1, 'Brown', 5),
(55, 8, 67, 'precission', 6),
(56, 8, 23, '1', 7),
(57, 9, 56, 'Melee Reinforced weapon', 1),
(58, 9, 58, 'combat fist', 2),
(59, 9, 27, '15cm', 3),
(60, 9, 36, 'Stark Industries', 4),
(61, 9, 1, 'Silver', 5),
(62, 9, 67, 'concussion', 6),
(63, 9, 23, '1', 7),
(64, 10, 56, 'Ranged Reinforced weapon', 1),
(65, 10, 58, 'sniper rifle', 2),
(66, 10, 4, '300mm', 3),
(67, 10, 36, 'Stark Industries', 4),
(68, 10, 1, 'Green', 5),
(69, 10, 67, 'precission', 6),
(70, 10, 23, '1', 7),
(71, 11, 56, 'Melee Reinforced weapon', 1),
(72, 11, 58, 'heavy shield', 2),
(73, 11, 4, '1x0.5m', 3),
(74, 11, 36, 'Stark Industries', 4),
(75, 11, 1, 'Black', 5),
(76, 11, 67, 'containtment', 6),
(77, 11, 23, '1', 7),
(78, 12, 56, 'Ranged Reinforced weapon', 1),
(79, 12, 58, 'pistol', 2),
(80, 12, 27, '9mm', 3),
(81, 12, 36, 'Stark Industries', 4),
(82, 12, 1, 'Silver', 5),
(83, 12, 67, 'rapid fire', 6),
(84, 12, 23, '1', 7),
(85, 13, 56, 'Chest', 1),
(86, 13, 58, 'ammo box', 2),
(87, 13, 27, '1m', 3),
(88, 13, 36, 'Stark Industries', 4),
(89, 13, 1, 'Green', 5),
(90, 13, 67, 'supply', 6),
(91, 13, 23, '1', 7),
(92, 14, 56, 'Chest', 1),
(93, 14, 58, 'medical box', 2),
(94, 14, 27, '1m', 3),
(95, 14, 36, 'Stark Industries', 4),
(96, 14, 1, 'White', 5),
(97, 14, 67, 'supply', 6),
(98, 14, 23, '1', 7),
(99, 71, 92, 'Shipping cost', 2);
INSERT INTO `vn`.`itemTypeTag`(`id`, `itemTypeFk`, `tagFk`, `priority`) INSERT INTO `vn`.`itemTypeTag`(`id`, `itemTypeFk`, `tagFk`, `priority`)
VALUES VALUES
@ -983,7 +1035,9 @@ INSERT INTO `vn`.`buy`(`id`,`entryFk`,`itemFk`,`buyingValue`,`quantity`,`package
(3, 3, 1, 20 , 100 , 1, 1, 0.700, 0.020, 0.000, 1, 1, 0, NULL, 0.00, 2.50, 2.00, 0.50, NULL, 0, 1, 0, CURDATE()), (3, 3, 1, 20 , 100 , 1, 1, 0.700, 0.020, 0.000, 1, 1, 0, NULL, 0.00, 2.50, 2.00, 0.50, NULL, 0, 1, 0, CURDATE()),
(4, 2, 2, 5 , 450 , 1, 1, 0.500, 0.100, 0.000, 10, 10, 0, NULL, 0.00, 1.30, 1.00, 0.00, NULL, 0, 1, 0, CURDATE()), (4, 2, 2, 5 , 450 , 1, 1, 0.500, 0.100, 0.000, 10, 10, 0, NULL, 0.00, 1.30, 1.00, 0.00, NULL, 0, 1, 0, CURDATE()),
(5, 3, 3, 10 , 500 , 1, 1, 1.000, 0.050, 0.000, 10, 10, 0, NULL, 0.00, 2.50, 1.00, 0.00, NULL, 0, 1, 0, CURDATE()), (5, 3, 3, 10 , 500 , 1, 1, 1.000, 0.050, 0.000, 10, 10, 0, NULL, 0.00, 2.50, 1.00, 0.00, NULL, 0, 1, 0, CURDATE()),
(6, 4, 4, 20 , 100 , 1, 1, 0.700, 0.020, 0.000, 10, 10, 1, NULL, 0.00, 2.50, 1.00, 0.00, NULL, 0, 1, 0, CURDATE()); (6, 4, 8, 20 , 1000 , 1, 1, 0.700, 0.020, 0.000, 10, 10, 1, NULL, 0.00, 2.50, 1.00, 0.00, NULL, 0, 1, 0, CURDATE()),
(7, 4, 9, 20 , 1000 , 1, 1, 0.700, 0.020, 0.000, 10, 10, 1, NULL, 0.00, 2.50, 1.00, 0.00, NULL, 0, 1, 0, CURDATE()),
(8, 4, 4, 20 , 1000 , 1, 1, 0.700, 0.020, 0.000, 10, 10, 1, NULL, 0.00, 2.50, 1.00, 0.00, NULL, 0, 1, 0, CURDATE());
INSERT INTO `vn2008`.`tblContadores`(`id`,`FechaInventario`) INSERT INTO `vn2008`.`tblContadores`(`id`,`FechaInventario`)
VALUES VALUES

View File

@ -6,24 +6,25 @@ import config from './config.js';
let currentUser; let currentUser;
Nightmare.asyncAction = function(name, func) {
Nightmare.action(name, function(...args) {
let done = args[arguments.length - 1];
func.apply(this, args)
.then(result => done(null, result))
.catch(done);
});
};
Nightmare.asyncAction('clearInput', async function(selector) {
const backSpaces = [];
for (let i = 0; i < 50; i += 1)
backSpaces.push('\u0008');
await this.write(selector, backSpaces.join(''));
});
let actions = { let actions = {
clearTextarea: function(selector, done) {
this.wait(selector)
.evaluate(inputSelector => {
return document.querySelector(inputSelector).value = '';
}, selector)
.then(done)
.catch(done);
},
clearInput: function(selector, done) {
this.wait(selector)
.evaluate(inputSelector => {
return document.querySelector(inputSelector).closest('*[model], *[field], *[value]').$ctrl.value = '';
}, selector)
.then(done)
.catch(done);
},
login: function(userName, done) { login: function(userName, done) {
if (currentUser) if (currentUser)
this.waitToClick('#logout'); this.waitToClick('#logout');
@ -334,7 +335,6 @@ let actions = {
return shapesList; return shapesList;
}, done, selector); }, done, selector);
}, },
waitForSnackbar: function(done) { waitForSnackbar: function(done) {
this.wait(500).waitForShapes('vn-snackbar .shape .text') this.wait(500).waitForShapes('vn-snackbar .shape .text')
.then(shapes => { .then(shapes => {
@ -359,8 +359,9 @@ let actions = {
}, },
accessToSearchResult: function(searchValue, done) { accessToSearchResult: function(searchValue, done) {
this.write(`vn-searchbar input`, searchValue) this.clearInput('vn-searchbar input')
.click(`vn-searchbar vn-icon[icon="search"]`) .write('vn-searchbar input', searchValue)
.click('vn-searchbar vn-icon[icon="search"]')
.wait(100) .wait(100)
.waitForNumberOfElements('.searchResult', 1) .waitForNumberOfElements('.searchResult', 1)
.evaluate(() => { .evaluate(() => {
@ -407,7 +408,7 @@ let actions = {
}); });
}, },
datePicker: function(datePickerSelector, changeMonth, done) { datePicker: function(datePickerSelector, changeMonth, day, done) {
this.wait(datePickerSelector) this.wait(datePickerSelector)
.mousedown(datePickerSelector) .mousedown(datePickerSelector)
.wait('div.flatpickr-calendar.open'); .wait('div.flatpickr-calendar.open');
@ -418,7 +419,14 @@ let actions = {
if (changeMonth < 0) if (changeMonth < 0)
this.mousedown('body > div.flatpickr-calendar.open > div.flatpickr-months > span.flatpickr-prev-month > svg'); this.mousedown('body > div.flatpickr-calendar.open > div.flatpickr-months > span.flatpickr-prev-month > svg');
const daySelector = 'div.flatpickr-calendar.open span.flatpickr-day:nth-child(16)'; let daySelector;
if (!day)
daySelector = 'div.flatpickr-calendar.open span.flatpickr-day:nth-child(16)';
if (day)
daySelector = `span.flatpickr-day[aria-label~="${day},"]:not(.prevMonthDay):not(.nextMonthDay)`;
this.wait(selector => { this.wait(selector => {
return document.querySelector(selector); return document.querySelector(selector);

View File

@ -45,12 +45,11 @@ export default {
}, },
clientBasicData: { clientBasicData: {
basicDataButton: 'vn-left-menu a[ui-sref="client.card.basicData"]', basicDataButton: 'vn-left-menu a[ui-sref="client.card.basicData"]',
nameInput: `${components.vnTextfield}[name="name"]`, nameInput: 'vn-textfield[field="$ctrl.client.name"] input',
contactInput: `${components.vnTextfield}[name="contact"]`, contactInput: 'vn-textfield[field="$ctrl.client.contact"] input',
phoneInput: `${components.vnTextfield}[name="phone"]`, phoneInput: 'vn-textfield[field="$ctrl.client.phone"] input',
mobileInput: `${components.vnTextfield}[name="mobile"]`, mobileInput: 'vn-textfield[field="$ctrl.client.mobile"] input',
faxInput: `${components.vnTextfield}[name="fax"]`, emailInput: 'vn-textfield[field="$ctrl.client.email"] input',
emailInput: `${components.vnTextfield}[name="email"]`,
salesPersonAutocomplete: 'vn-autocomplete[field="$ctrl.client.salesPersonFk"]', salesPersonAutocomplete: 'vn-autocomplete[field="$ctrl.client.salesPersonFk"]',
channelAutocomplete: 'vn-autocomplete[field="$ctrl.client.contactChannelFk"]', channelAutocomplete: 'vn-autocomplete[field="$ctrl.client.contactChannelFk"]',
saveButton: `${components.vnSubmit}` saveButton: `${components.vnSubmit}`
@ -473,7 +472,7 @@ export default {
claimStateAutocomplete: 'vn-claim-basic-data vn-autocomplete[field="$ctrl.claim.claimStateFk"]', claimStateAutocomplete: 'vn-claim-basic-data vn-autocomplete[field="$ctrl.claim.claimStateFk"]',
isPaidWithManaCheckbox: 'vn-check[field="$ctrl.claim.isChargedToMana"] md-checkbox', isPaidWithManaCheckbox: 'vn-check[field="$ctrl.claim.isChargedToMana"] md-checkbox',
responsabilityInputRange: 'vn-input-range', responsabilityInputRange: 'vn-input-range',
observationInput: 'vn-textarea[label="Observation"] textarea', observationInput: 'vn-textarea[field="$ctrl.claim.observation"] textarea',
saveButton: `${components.vnSubmit}` saveButton: `${components.vnSubmit}`
}, },
claimDetail: { claimDetail: {
@ -522,12 +521,22 @@ export default {
clientAutocomplete: 'vn-autocomplete[label="Client"]', clientAutocomplete: 'vn-autocomplete[label="Client"]',
addressAutocomplete: 'vn-autocomplete[label="Address"]', addressAutocomplete: 'vn-autocomplete[label="Address"]',
agencyAutocomplete: 'vn-autocomplete[label="Agency"]', agencyAutocomplete: 'vn-autocomplete[label="Agency"]',
landedDatePicker: 'vn-date-picker[label="Landed"]', landedDatePicker: 'vn-date-picker[label="Landed"] input',
createButton: `${components.vnSubmit}`, createButton: `${components.vnSubmit}`,
cancelButton: 'vn-button[href="#!/client/index"]' cancelButton: 'vn-button[href="#!/client/index"]'
}, },
orderCatalog: { orderCatalog: {
orderByAutocomplete: 'vn-autocomplete[label="Order by"]', orderByAutocomplete: 'vn-autocomplete[label="Order by"]',
plantRealmButton: 'vn-order-catalog > vn-side-menu vn-icon[icon="icon-plant"]',
typeAutocomplete: 'vn-autocomplete[data="$ctrl.itemTypes"]',
itemIdInput: 'vn-order-catalog > vn-side-menu vn-catalog-filter vn-textfield[model="$ctrl.itemFk"] input',
itemTagValueInput: 'vn-order-catalog > vn-side-menu vn-catalog-filter vn-textfield[model="$ctrl.value"] input',
openTagSearch: 'vn-order-catalog > vn-side-menu > div > vn-catalog-filter > div > vn-vertical > vn-textfield[model="$ctrl.value"] > div > div > div.rightIcons > t-right-icons > i',
tagAutocomplete: 'vn-order-catalog > vn-side-menu vn-catalog-filter vn-popover vn-order-catalog-search-panel vn-autocomplete[field="filter.tagFk"]',
tagValueInput: 'vn-order-catalog > vn-side-menu vn-catalog-filter vn-popover vn-order-catalog-search-panel vn-textfield[model="filter.value"] input',
searchTagButton: 'vn-order-catalog > vn-side-menu vn-catalog-filter vn-popover vn-order-catalog-search-panel > div > form > vn-horizontal:nth-child(3) > vn-submit > input',
thirdFilterRemoveButton: 'vn-order-catalog > vn-side-menu vn-catalog-filter > div > vn-horizontal.chips > vn-chip:nth-child(3) button',
fourthFilterRemoveButton: 'vn-order-catalog > vn-side-menu vn-catalog-filter > div > vn-horizontal.chips > vn-chip:nth-child(4) button',
}, },
orderBasicData: { orderBasicData: {
clientAutocomplete: 'vn-autocomplete[label="Client"]', clientAutocomplete: 'vn-autocomplete[label="Client"]',

View File

@ -22,7 +22,7 @@ describe('Item Edit basic data path', () => {
const result = await nightmare const result = await nightmare
.clearInput(selectors.itemBasicData.nameInput) .clearInput(selectors.itemBasicData.nameInput)
.write(selectors.itemBasicData.nameInput, 'Rose of Purity') .write(selectors.itemBasicData.nameInput, 'Rose of Purity')
.autocompleteSearch(selectors.itemBasicData.typeAutocomplete, 'Crisantemo') .autocompleteSearch(selectors.itemBasicData.typeAutocomplete, 'Anthurium')
.autocompleteSearch(selectors.itemBasicData.intrastatAutocomplete, 'Coral y materiales similares') .autocompleteSearch(selectors.itemBasicData.intrastatAutocomplete, 'Coral y materiales similares')
.clearInput(selectors.itemBasicData.relevancyInput) .clearInput(selectors.itemBasicData.relevancyInput)
.write(selectors.itemBasicData.relevancyInput, '1') .write(selectors.itemBasicData.relevancyInput, '1')
@ -49,7 +49,7 @@ describe('Item Edit basic data path', () => {
const result = await nightmare const result = await nightmare
.waitToGetProperty(`${selectors.itemBasicData.typeAutocomplete} input`, 'value'); .waitToGetProperty(`${selectors.itemBasicData.typeAutocomplete} input`, 'value');
expect(result).toEqual('Crisantemo'); expect(result).toEqual('Anthurium');
}); });
it(`should confirm the item intrastad was edited`, async() => { it(`should confirm the item intrastad was edited`, async() => {

View File

@ -70,7 +70,7 @@ describe('Item create tags path', () => {
.waitToGetProperty(selectors.itemTags.sixthRelevancyInput, 'value'); .waitToGetProperty(selectors.itemTags.sixthRelevancyInput, 'value');
expect(tag).toEqual('Categoria'); expect(tag).toEqual('Categoria');
expect(value).toEqual('precission'); expect(value).toEqual('+1 precission');
expect(relevancy).toEqual('6'); expect(relevancy).toEqual('6');
}); });
}); });

View File

@ -30,7 +30,6 @@ describe('Item index path', () => {
.waitToClick(selectors.itemsIndex.originCheckbox) .waitToClick(selectors.itemsIndex.originCheckbox)
.waitToClick(selectors.itemsIndex.buyerCheckbox) .waitToClick(selectors.itemsIndex.buyerCheckbox)
.waitToClick(selectors.itemsIndex.destinyCheckbox) .waitToClick(selectors.itemsIndex.destinyCheckbox)
// .waitToClick(selectors.itemsIndex.taxClassCheckbox)
.waitToClick(selectors.itemsIndex.saveFieldsButton) .waitToClick(selectors.itemsIndex.saveFieldsButton)
.waitForLastSnackbar(); .waitForLastSnackbar();
@ -68,7 +67,6 @@ describe('Item index path', () => {
.waitToClick(selectors.itemsIndex.originCheckbox) .waitToClick(selectors.itemsIndex.originCheckbox)
.waitToClick(selectors.itemsIndex.buyerCheckbox) .waitToClick(selectors.itemsIndex.buyerCheckbox)
.waitToClick(selectors.itemsIndex.destinyCheckbox) .waitToClick(selectors.itemsIndex.destinyCheckbox)
// .waitToClick(selectors.itemsIndex.taxClassCheckbox)
.waitToClick(selectors.itemsIndex.saveFieldsButton) .waitToClick(selectors.itemsIndex.saveFieldsButton)
.waitForLastSnackbar(); .waitForLastSnackbar();

View File

@ -22,7 +22,7 @@ describe('Ticket create path', () => {
const result = await nightmare const result = await nightmare
.autocompleteSearch(selectors.createTicketView.clientAutocomplete, 'Bruce Banner') .autocompleteSearch(selectors.createTicketView.clientAutocomplete, 'Bruce Banner')
.autocompleteSearch(selectors.createTicketView.addressAutocomplete, 'Bruce Banner') .autocompleteSearch(selectors.createTicketView.addressAutocomplete, 'Bruce Banner')
.datePicker(selectors.createTicketView.deliveryDateInput, 1) .datePicker(selectors.createTicketView.deliveryDateInput, 1, null)
.autocompleteSearch(selectors.createTicketView.warehouseAutocomplete, 'Warehouse One') .autocompleteSearch(selectors.createTicketView.warehouseAutocomplete, 'Warehouse One')
.autocompleteSearch(selectors.createTicketView.agencyAutocomplete, 'inhouse pickup') .autocompleteSearch(selectors.createTicketView.agencyAutocomplete, 'inhouse pickup')
.waitToClick(selectors.createTicketView.createButton) .waitToClick(selectors.createTicketView.createButton)

View File

@ -15,7 +15,7 @@ describe('Claim edit basic data path', () => {
const result = await nightmare const result = await nightmare
.autocompleteSearch(selectors.claimBasicData.claimStateAutocomplete, 'Gestionado') .autocompleteSearch(selectors.claimBasicData.claimStateAutocomplete, 'Gestionado')
.waitToClick(selectors.claimBasicData.isPaidWithManaCheckbox) .waitToClick(selectors.claimBasicData.isPaidWithManaCheckbox)
.clearInput(selectors.claimBasicData.observationInput) .clearTextarea(selectors.claimBasicData.observationInput)
.write(selectors.claimBasicData.observationInput, 'edited observation') .write(selectors.claimBasicData.observationInput, 'edited observation')
.waitToClick(selectors.claimBasicData.saveButton) .waitToClick(selectors.claimBasicData.saveButton)
.waitForSnackbar(); .waitForSnackbar();
@ -58,7 +58,7 @@ describe('Claim edit basic data path', () => {
const result = await nightmare const result = await nightmare
.autocompleteSearch(selectors.claimBasicData.claimStateAutocomplete, 'Pendiente') .autocompleteSearch(selectors.claimBasicData.claimStateAutocomplete, 'Pendiente')
.waitToClick(selectors.claimBasicData.isPaidWithManaCheckbox) .waitToClick(selectors.claimBasicData.isPaidWithManaCheckbox)
.clearInput(selectors.claimBasicData.observationInput) .clearTextarea(selectors.claimBasicData.observationInput)
.write(selectors.claimBasicData.observationInput, 'Observation one') .write(selectors.claimBasicData.observationInput, 'Observation one')
.waitToClick(selectors.claimBasicData.saveButton) .waitToClick(selectors.claimBasicData.saveButton)
.waitForSnackbar(); .waitForSnackbar();

View File

@ -65,7 +65,7 @@ describe('Order edit basic data path', () => {
.autocompleteSearch(selectors.orderBasicData.clientAutocomplete, 'Tony Stark') .autocompleteSearch(selectors.orderBasicData.clientAutocomplete, 'Tony Stark')
.autocompleteSearch(selectors.orderBasicData.addressAutocomplete, 'Tony Stark') .autocompleteSearch(selectors.orderBasicData.addressAutocomplete, 'Tony Stark')
.autocompleteSearch(selectors.orderBasicData.agencyAutocomplete, 'Silla247') .autocompleteSearch(selectors.orderBasicData.agencyAutocomplete, 'Silla247')
.clearInput(selectors.orderBasicData.observationInput) .clearTextarea(selectors.orderBasicData.observationInput)
.write(selectors.orderBasicData.observationInput, 'Observation modified') .write(selectors.orderBasicData.observationInput, 'Observation modified')
.waitToClick(selectors.orderBasicData.saveButton) .waitToClick(selectors.orderBasicData.saveButton)
.waitForLastSnackbar(); .waitForLastSnackbar();

View File

@ -0,0 +1,83 @@
import selectors from '../../helpers/selectors.js';
import createNightmare from '../../helpers/nightmare';
describe('Order catalog', () => {
const nightmare = createNightmare();
beforeAll(() => {
nightmare
.loginAndModule('employee', 'order');
});
it('should open the create new order form', async() => {
const url = await nightmare
.waitToClick(selectors.ordersIndex.createOrderButton)
.waitForURL('order/create')
.parsedUrl();
expect(url.hash).toContain('order/create');
});
it('should create a new order', async() => {
let today = new Date().getDate();
const url = await nightmare
.autocompleteSearch(selectors.createOrderView.clientAutocomplete, 'Tony Stark')
.datePicker(selectors.createOrderView.landedDatePicker, 0, today)
.autocompleteSearch(selectors.createOrderView.agencyAutocomplete, 'Silla247')
.waitToClick(selectors.createOrderView.createButton)
.waitForURL('/catalog')
.parsedUrl();
expect(url.hash).toContain('/catalog');
});
it('should add the realm and type filters and obtain results', async() => {
const result = await nightmare
.waitToClick(selectors.orderCatalog.plantRealmButton)
.autocompleteSearch(selectors.orderCatalog.typeAutocomplete, 'Anthurium')
.waitForNumberOfElements('section.product', 4)
.countElement('section.product');
expect(result).toEqual(4);
});
it('should search for the item tag value +1 and find two results', async() => {
const result = await nightmare
.write(selectors.orderCatalog.itemTagValueInput, '+1\u000d')
.waitForNumberOfElements('section.product', 2)
.countElement('section.product');
expect(result).toEqual(2);
});
it('should search for the item tag categoria +1 and find two results', async() => {
const result = await nightmare
.waitToClick(selectors.orderCatalog.openTagSearch)
.autocompleteSearch(selectors.orderCatalog.tagAutocomplete, 'categoria')
.write(selectors.orderCatalog.tagValueInput, '+1')
.waitToClick(selectors.orderCatalog.searchTagButton)
.waitForNumberOfElements('section.product', 1)
.countElement('section.product');
expect(result).toEqual(1);
});
it('should remove the tag filters and have 4 results', async() => {
const result = await nightmare
.waitToClick(selectors.orderCatalog.fourthFilterRemoveButton)
.waitToClick(selectors.orderCatalog.thirdFilterRemoveButton)
.waitForNumberOfElements('section.product', 4)
.countElement('section.product');
expect(result).toEqual(4);
});
it('should search for the item id 1 and have only 1 result', async() => {
const result = await nightmare
.write(selectors.orderCatalog.itemIdInput, '2\u000d')
.waitForNumberOfElements('section.product', 1)
.countElement('section.product');
expect(result).toEqual(1);
});
});

View File

@ -48,7 +48,7 @@ describe('Route create path', () => {
it(`should create a new route`, async() => { it(`should create a new route`, async() => {
const result = await nightmare const result = await nightmare
.autocompleteSearch(selectors.createRouteView.workerAutocomplete, 'teamManagerNick') .autocompleteSearch(selectors.createRouteView.workerAutocomplete, 'teamManagerNick')
.datePicker(selectors.createRouteView.createdDatePicker, 0) .datePicker(selectors.createRouteView.createdDatePicker, 0, null)
.autocompleteSearch(selectors.createRouteView.vehicleAutoComplete, '4444-IMK') .autocompleteSearch(selectors.createRouteView.vehicleAutoComplete, '4444-IMK')
.autocompleteSearch(selectors.createRouteView.agencyAutoComplete, 'Teleportation device') .autocompleteSearch(selectors.createRouteView.agencyAutoComplete, 'Teleportation device')
.write(selectors.createRouteView.descriptionInput, 'faster faster!!') .write(selectors.createRouteView.descriptionInput, 'faster faster!!')

View File

@ -15,13 +15,13 @@ describe('Route basic Data path', () => {
const result = await nightmare const result = await nightmare
.autocompleteSearch(selectors.routeBasicData.workerAutoComplete, 'adminBossNick') .autocompleteSearch(selectors.routeBasicData.workerAutoComplete, 'adminBossNick')
.autocompleteSearch(selectors.routeBasicData.vehicleAutoComplete, '1111-IMK') .autocompleteSearch(selectors.routeBasicData.vehicleAutoComplete, '1111-IMK')
.datePicker(selectors.routeBasicData.createdDateInput, 1) .datePicker(selectors.routeBasicData.createdDateInput, 1, null)
.clearInput(selectors.routeBasicData.kmStartInput) .clearInput(selectors.routeBasicData.kmStartInput)
.write(selectors.routeBasicData.kmStartInput, 1) .write(selectors.routeBasicData.kmStartInput, 1)
.clearInput(selectors.routeBasicData.kmEndInput) .clearInput(selectors.routeBasicData.kmEndInput)
.write(selectors.routeBasicData.kmEndInput, 2) .write(selectors.routeBasicData.kmEndInput, 2)
.datePicker(selectors.routeBasicData.startedDateInput, 1) .datePicker(selectors.routeBasicData.startedDateInput, 1, null)
.datePicker(selectors.routeBasicData.finishedDateInput, 1) .datePicker(selectors.routeBasicData.finishedDateInput, 1, null)
.waitToClick(selectors.routeBasicData.saveButton) .waitToClick(selectors.routeBasicData.saveButton)
.waitForLastSnackbar(); .waitForLastSnackbar();

View File

@ -81,5 +81,6 @@
"This ticket can't be invoiced": "Este ticket no puede ser facturado", "This ticket can't be invoiced": "Este ticket no puede ser facturado",
"That item is not available on that day": "El item no esta disponible para esa fecha", "That item is not available on that day": "El item no esta disponible para esa fecha",
"That item doesn't exists": "That item doesn't exists", "That item doesn't exists": "That item doesn't exists",
"You cannot add or modify services to an invoiced ticket": "No puedes añadir o modificar servicios a un ticket facturado" "You cannot add or modify services to an invoiced ticket": "No puedes añadir o modificar servicios a un ticket facturado",
"This ticket can not be modified": "Este ticket no puede ser modificado"
} }

View File

@ -20,20 +20,16 @@
"required": true "required": true
}, },
"travelingDays": { "travelingDays": {
"type": "Number", "type": "Number"
"required": true
}, },
"price": { "price": {
"type": "Number", "type": "Number"
"required": true
}, },
"bonus": { "bonus": {
"type": "Number", "type": "Number"
"required": true
}, },
"isVolumetric": { "isVolumetric": {
"type": "Boolean", "type": "Boolean"
"required": true
} }
}, },
"relations": { "relations": {

View File

@ -17,17 +17,14 @@ describe('item filter()', () => {
expect(result[0].id).toEqual(2); expect(result[0].id).toEqual(2);
}); });
it('should return 1 result using filter and tags', async() => { it('should return 2 results using filter and tags', async() => {
let filter = { let filter = {
order: 'isActive ASC, name', order: 'isActive ASC, name',
limit: 8 limit: 8
}; };
let tags = [{value: 'combat fist', tagFk: 58}]; let tags = [{value: 'medical box', tagFk: 58}];
let result = await app.models.Item.filter({args: {filter: filter, typeFk: 2, tags: tags}}); let result = await app.models.Item.filter({args: {filter: filter, typeFk: 5, tags: tags}});
expect(result.length).toEqual(1); expect(result.length).toEqual(2);
expect(result[0].id).toEqual(2);
expect(result[0].name).toEqual('Melee weapon combat fist 15cm');
expect(result[0].type).toEqual('Anthurium');
}); });
}); });

View File

@ -13,7 +13,7 @@ describe('order catalogFilter()', () => {
let result = await app.models.Order.catalogFilter(orderFk, orderBy, filter, tags); let result = await app.models.Order.catalogFilter(orderFk, orderBy, filter, tags);
let firstItemId = result[0].id; let firstItemId = result[0].id;
expect(result.length).toEqual(2); expect(result.length).toEqual(4);
expect(firstItemId).toEqual(1); expect(firstItemId).toEqual(1);
}); });

View File

@ -48,6 +48,11 @@ module.exports = Self => {
type: 'Number', type: 'Number',
description: 'The m3 filter', description: 'The m3 filter',
http: {source: 'query'} http: {source: 'query'}
}, {
arg: 'warehouseFk',
type: 'Number',
description: 'The warehouse filter',
http: {source: 'query'}
}, { }, {
arg: 'description', arg: 'description',
type: 'String', type: 'String',
@ -81,6 +86,7 @@ module.exports = Self => {
case 'description': case 'description':
return {'r.description': {like: `%${value}%`}}; return {'r.description': {like: `%${value}%`}};
case 'workerFk': case 'workerFk':
case 'warehouseFk':
case 'vehicleFk': case 'vehicleFk':
case 'agencyModeFk': case 'agencyModeFk':
return {[param]: value}; return {[param]: value};

View File

@ -9,6 +9,7 @@
<div class="vn-list"> <div class="vn-list">
<vn-card pad-medium-h> <vn-card pad-medium-h>
<vn-searchbar <vn-searchbar
filter="$ctrl.filter"
panel="vn-route-search-panel" panel="vn-route-search-panel"
on-search="$ctrl.onSearch($params)" on-search="$ctrl.onSearch($params)"
info="Search routes by id" info="Search routes by id"

View File

@ -4,6 +4,19 @@ export default class Controller {
constructor($scope, vnToken) { constructor($scope, vnToken) {
this.accessToken = vnToken.token; this.accessToken = vnToken.token;
this.$ = $scope; this.$ = $scope;
this.setDefaultFilter();
}
setDefaultFilter() {
let to = new Date();
to.setDate(to.getDate() + 1);
to.setHours(0, 0, 0, 0);
let from = new Date();
from.setHours(0, 0, 0, 0);
this.filter = {from, to, warehouseFk: localStorage.defaultWarehouseFk};
} }
showWorkerDescriptor(event, workerFk) { showWorkerDescriptor(event, workerFk) {

View File

@ -55,6 +55,14 @@
</vn-textfield> </vn-textfield>
</vn-horizontal> </vn-horizontal>
<vn-horizontal> <vn-horizontal>
<vn-autocomplete
vn-one
label="Warehouse"
field="filter.warehouseFk"
url="/route/api/Warehouses"
show-field="name"
value-field="id">
</vn-autocomplete>
<vn-textfield <vn-textfield
vn-one vn-one
label="Description" label="Description"

View File

@ -26,24 +26,20 @@ module.exports = Self => {
throw new UserError(`The value should be a number`); throw new UserError(`The value should be a number`);
let model = Self.app.models; let model = Self.app.models;
let ticket = await model.Ticket.find({ let ticket = await model.Ticket.findById(params.editLines[0].ticketFk, {
where: { include: {
id: params.editLines[0].ticketFk
},
include: [{
relation: 'client', relation: 'client',
scope: { scope: {
fields: ['salesPersonFk'] fields: ['salesPersonFk']
} }
}], },
fields: ['id', 'clientFk', 'refFk']
}); });
if (ticket.refFk) if (ticket.refFk)
throw new UserError(`The sales of this ticket can't be modified`); throw new UserError(`The sales of this ticket can't be modified`);
let componentToUse; let componentToUse;
let usesMana = await model.WorkerMana.findOne({where: {workerFk: ticket[0].client().salesPersonFk}, fields: 'amount'}); let usesMana = await model.WorkerMana.findOne({where: {workerFk: ticket.client().salesPersonFk}, fields: 'amount'});
if (usesMana) if (usesMana)
componentToUse = 37; componentToUse = 37;
@ -61,7 +57,7 @@ module.exports = Self => {
if (usesMana) { if (usesMana) {
query = ` query = `
call vn.manaSpellersRequery(?)`; call vn.manaSpellersRequery(?)`;
await Self.rawSql(query, [ticket[0].client().salesPersonFk]); await Self.rawSql(query, [ticket.client().salesPersonFk]);
} }
}; };
}; };

View File

@ -0,0 +1,34 @@
const app = require('vn-loopback/server/server');
describe('ticket updateEditableTicket()', () => {
const validTicketId = 12;
const invalidTicketId = 1;
const data = {addressFk: 1};
const originalData = {addressFk: 121};
afterAll(async done => {
await app.models.Ticket.updateEditableTicket(validTicketId, originalData);
done();
});
it('should throw an error if the ticket is not editable', async() => {
let error;
await app.models.Ticket.updateEditableTicket(invalidTicketId, data).catch(e => {
error = e;
}).finally(() => {
expect(error.message).toEqual('This ticket can not be modified');
});
expect(error).toBeDefined();
});
it('should edit the ticket address', async() => {
await app.models.Ticket.updateEditableTicket(validTicketId, data);
let updatedTicket = await app.models.Ticket.findById(validTicketId);
expect(updatedTicket.addressFk).toEqual(1);
});
});

View File

@ -0,0 +1,41 @@
const UserError = require('vn-loopback/util/user-error');
module.exports = Self => {
Self.remoteMethod('updateEditableTicket', {
description: 'Change data of a ticket',
accessType: 'WRITE',
accepts: [
{
arg: 'id',
type: 'number',
required: true,
description: 'Ticket id',
http: {source: 'path'}
},
{
arg: 'data',
description: 'Model instance data',
type: 'Object',
required: true,
http: {source: 'body'}
}
],
returns: {
type: 'object',
root: true
},
http: {
path: '/:id/updateEditableTicket',
verb: 'POST'
}
});
Self.updateEditableTicket = async(id, data) => {
let ticketIsEditable = await Self.app.models.Ticket.isEditable(id);
if (!ticketIsEditable)
throw new UserError('This ticket can not be modified');
let ticket = await Self.app.models.Ticket.findById(id);
await ticket.updateAttributes(data);
};
};

View File

@ -20,4 +20,5 @@ module.exports = Self => {
require('../methods/ticket/getPossibleStowaways')(Self); require('../methods/ticket/getPossibleStowaways')(Self);
require('../methods/ticket/canBeInvoiced')(Self); require('../methods/ticket/canBeInvoiced')(Self);
require('../methods/ticket/makeInvoice')(Self); require('../methods/ticket/makeInvoice')(Self);
require('../methods/ticket/updateEditableTicket')(Self);
}; };

View File

@ -51,8 +51,9 @@ class Controller {
changeShipped(response) { changeShipped(response) {
if (response === 'ACCEPT') { if (response === 'ACCEPT') {
let params = {shipped: this.newShipped}; let data = {shipped: this.newShipped};
this.$http.patch(`/ticket/api/Tickets/${this.ticket.id}`, params).then(() => { let query = `/ticket/api/Tickets/${this.ticket.id}/updateEditableTicket`;
this.$http.post(query, data).then(() => {
this.vnApp.showSuccess(this.$translate.instant('Shipped hour updated')); this.vnApp.showSuccess(this.$translate.instant('Shipped hour updated'));
this.cardReload(); this.cardReload();
}); });

View File

@ -86,8 +86,8 @@ describe('Ticket Component vnTicketDescriptor', () => {
spyOn(controller.$state, 'reload'); spyOn(controller.$state, 'reload');
spyOn(controller.vnApp, 'showSuccess'); spyOn(controller.vnApp, 'showSuccess');
$httpBackend.when('POST', `/ticket/api/Tickets/2/makeInvoice`).respond(); $httpBackend.when('POST', '/ticket/api/Tickets/2/makeInvoice').respond();
$httpBackend.expect('POST', `/ticket/api/Tickets/2/makeInvoice`).respond(); $httpBackend.expect('POST', '/ticket/api/Tickets/2/makeInvoice').respond();
controller.makeInvoice('ACCEPT'); controller.makeInvoice('ACCEPT');
$httpBackend.flush(); $httpBackend.flush();
@ -100,8 +100,8 @@ describe('Ticket Component vnTicketDescriptor', () => {
it('should make a query and show a success snackbar if the response is ACCEPT', () => { it('should make a query and show a success snackbar if the response is ACCEPT', () => {
spyOn(controller.vnApp, 'showSuccess'); spyOn(controller.vnApp, 'showSuccess');
$httpBackend.when('POST', `/invoiceOut/api/InvoiceOuts/1/regenerate`).respond(); $httpBackend.when('POST', '/invoiceOut/api/InvoiceOuts/1/regenerate').respond();
$httpBackend.expect('POST', `/invoiceOut/api/InvoiceOuts/1/regenerate`).respond(); $httpBackend.expect('POST', '/invoiceOut/api/InvoiceOuts/1/regenerate').respond();
controller.regenerateInvoice('ACCEPT'); controller.regenerateInvoice('ACCEPT');
$httpBackend.flush(); $httpBackend.flush();
@ -111,10 +111,12 @@ describe('Ticket Component vnTicketDescriptor', () => {
describe('changeShipped(response)', () => { describe('changeShipped(response)', () => {
it('should make a query and change the shipped hour if the response is ACCEPT', () => { it('should make a query and change the shipped hour if the response is ACCEPT', () => {
controller.ticket.id = 12;
spyOn(controller.vnApp, 'showSuccess'); spyOn(controller.vnApp, 'showSuccess');
spyOn(controller, 'cardReload'); spyOn(controller, 'cardReload');
$httpBackend.when('PATCH', `/ticket/api/Tickets/2`,).respond();
$httpBackend.expect('PATCH', `/ticket/api/Tickets/2`).respond(); $httpBackend.when('POST', '/ticket/api/Tickets/12/updateEditableTicket').respond();
$httpBackend.expect('POST', '/ticket/api/Tickets/12/updateEditableTicket').respond();
controller.changeShipped('ACCEPT'); controller.changeShipped('ACCEPT');
$httpBackend.flush(); $httpBackend.flush();
@ -123,4 +125,3 @@ describe('Ticket Component vnTicketDescriptor', () => {
}); });
}); });
}); });

View File

@ -44,13 +44,14 @@ class Controller {
} }
if (modified) { if (modified) {
this.$http.post(`/ticket/api/Sales/updateDiscount`, {editLines}).then(() => { this.$http.post(`/ticket/api/Sales/updateDiscount`, {editLines}).then(() => {
this.onHide();
this.vnApp.showSuccess(this.$translate.instant('Data saved!')); this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
this.clear(); this.clear();
modified = false; modified = false;
}).catch(e => { }).catch(e => {
this.vnApp.showError(e.data.error.message); this.vnApp.showError(e.data.error.message);
}); });
this.onHide();
} else } else
this.vnApp.showError(this.$translate.instant('There is no changes to save')); this.vnApp.showError(this.$translate.instant('There is no changes to save'));
} }

View File

@ -134,7 +134,7 @@
<vn-td number ng-if="!$ctrl.isEditable"> <vn-td number ng-if="!$ctrl.isEditable">
{{sale.price | currency: 'EUR':2}} {{sale.price | currency: 'EUR':2}}
</vn-td> </vn-td>
<vn-td number ng-if="$ctrl.isEditable"> <vn-td number ng-if="!$ctrl.ticket.refFk">
<span class="link" <span class="link"
vn-tooltip="Edit discount" vn-tooltip="Edit discount"
ng-click="$ctrl.showEditPopover($event, sale)"> ng-click="$ctrl.showEditPopover($event, sale)">

View File

@ -14,7 +14,7 @@ class Controller {
this.moreOptions = [ this.moreOptions = [
{callback: this.markAsReserved, name: 'Mark as reserved'}, {callback: this.markAsReserved, name: 'Mark as reserved'},
{callback: this.unmarkAsReserved, name: 'Unmark as reserved'}, {callback: this.unmarkAsReserved, name: 'Unmark as reserved'},
{callback: this.showEditDialog, name: 'Update discount'}, {callback: this.showEditDialog, name: 'Update discount', show: () => !this.hasInvoice()},
{callback: this.createClaim, name: 'Add claim'}, {callback: this.createClaim, name: 'Add claim'},
{callback: this.showSMSDialog, name: 'Send SMS'} {callback: this.showSMSDialog, name: 'Send SMS'}
]; ];
@ -60,7 +60,13 @@ class Controller {
} }
onMoreOpen() { onMoreOpen() {
let options = this.moreOptions.filter(o => o.always || this.isChecked); let options = this.moreOptions.filter(option => {
const hasShowProperty = Object.hasOwnProperty.call(option, 'show');
const shouldShow = !hasShowProperty || option.show === true ||
typeof option.show === 'function' && option.show();
return (shouldShow && (option.always || this.isChecked));
});
this.$scope.moreButton.data = options; this.$scope.moreButton.data = options;
} }
@ -337,6 +343,15 @@ class Controller {
}; };
this.$scope.sms.open(); this.$scope.sms.open();
} }
/**
* Returns if the current ticket
* is already invoiced
* @return {Boolean} - True if invoiced
*/
hasInvoice() {
return this.ticket.refFk !== null;
}
} }
Controller.$inject = ['$scope', '$state', '$http', 'vnApp', '$translate']; Controller.$inject = ['$scope', '$state', '$http', 'vnApp', '$translate'];

View File

@ -10,5 +10,15 @@ module.exports = {
por escrito al domicilio social de la entidad. La finalidad del fichero es la gestión administrativa, contabilidad, y facturación.`, por escrito al domicilio social de la entidad. La finalidad del fichero es la gestión administrativa, contabilidad, y facturación.`,
} }
}, },
pt: {
numPages: 'Página {{page}} de {{pages}}',
law: {
phytosanitary: 'VERDNATURA LEVANTE S.L - Passaporte Fitossanitário R.P. Generalitat Valenciana - Nº Comerciante: ES17462130',
privacy: `Em cumprimento do disposto na lei Orgânica 15/1999, de Protecção de Dados de Carácter Pessoal, comunicamos que os
dados pessoais que facilite se incluirão nos ficheiros automatizados de VERDNATURA LEVANTE S.L., podendo em todo momento
exercer os direitos de acesso, rectificação, cancelação e oposição, comunicando por escrito ao domicílio social da entidade.
A finalidade do ficheiro é a gestão administrativa, contabilidade e facturação.`,
}
},
}, },
}; };

View File

@ -6,5 +6,11 @@ module.exports = {
registry: `CIF: B97367486 Registro Mercantil de Valencia, Tomo 8041, Libro 5334, Folio 160, sección 8, Hoja V 102076`, registry: `CIF: B97367486 Registro Mercantil de Valencia, Tomo 8041, Libro 5334, Folio 160, sección 8, Hoja V 102076`,
} }
}, },
pt: {
company: {
fiscalAddress: 'VERDNATURA LEVANTE S.L., B97367486 Avda. Espioca, 100, 46460 Silla - www.verdnatura.es - clientes@verdnatura.es',
registry: `CIF: B97367486 Registro Mercantil de Valencia, Tomo 8041, Libro 5334, Folio 160, Sección 8, Hoja V 102076`,
}
},
}, },
}; };

View File

@ -38,5 +38,44 @@ module.exports = {
}, },
order: 'Ord. domiciliación {0}', order: 'Ord. domiciliación {0}',
}, },
pt: {
title: 'Autorização de débito directo SEPA CORE',
description: `Ao subscrever esta autorização, está a autorizar a (A) Verdnatura Levante S.L. a enviar instruções ao
seu banco para debitar a sua conta e (B) seu banco a debitar a sua conta, de acordo com as instruções da
Verdnatura Levante S.L. Os seus direitos incluem a possibilidade de exigir do seu banco o reembolso do
montante debitado, nos termos e condições acordados com o seu banco. O reembolso deve ser solicitado até um
prazo de oito semanas, a contar da data do débito na sua conta. Os seus direitos, referentes à autorização
acima referida, são explicados em declaração que pode obter no seu banco.`,
documentCopy: `Deve levar à sua Entidade Bancária uma cópia do documento assinado para que o registre e evitar a devolução`,
mandatoryFields: `TODOS OS CAMPOS DEVEM SER PREENCHIDOS OBRIGATORIAMENTE.`,
sendOrder: `UMA VEZ ASSINADA, ESTA AUTORIZAÇÃO DE DÉBITO DEVE SER ENVIADA AO CREDOR PARA SUA CUSTÓDIA E É RECOMENDÁVEL
FACILITAR UMA CÓPIA À SUA ENTIDADE BANCÁRIA.`,
supplier: {
toCompleteBySupplier: 'A preencher pelo credor',
orderReference: 'Referência da ordem',
identifier: 'Identificador do Credor',
name: 'Nome do Credor',
street: 'Morada',
location: 'CP - Município - Distrito',
country: 'País'
},
client: {
toCompleteByClient: 'A preencher pelo devedor',
name: 'Nome do devedor (Titular da conta)',
street: 'Dirección del deudor',
location: 'Cod. Postal - Município - Distrito',
country: 'País do devedor',
swift: 'Swift BIC',
accountNumber: 'Número de Conta IBAN',
accountHolder: '(Titular/es de la cuenta de cargo)',
accountNumberFormat: 'Em Portugal o IBAN é composto por 25 dígitos e começa sempre por PT',
paymentType: 'Tipos de pagamento Pagamento',
recurrent: 'Recorrente',
unique: 'Pagamento pontual',
signLocation: 'Data - Localidade',
sign: 'Assinatura e carimbo do devedor',
},
order: 'Referência da ordem {0}',
},
}, },
}; };

View File

@ -10,7 +10,15 @@ module.exports = {
conclusion: 'Gracias por tu atención.' conclusion: 'Gracias por tu atención.'
}, },
}, },
pt: {
subject: 'Autorização de débito directo SEPA CORE',
title: 'Débito directo SEPA CORE',
description: {
dear: 'Prezado Cliente',
instructions: `Para poder tramitar vossa solicitação de forma de pagamento a Débito Automático, anexamos os
documentos correspondentes à Lei de Pagamentos, que deves preencher e reenviar-nos.`,
conclusion: 'Obrigado pela atenção.'
},
},
}, },
}; };