Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 4928-supplier-payMethod-notify
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Alexandre Riera 2022-12-15 09:22:36 +01:00
commit 5a975d0b05
34 changed files with 32680 additions and 35562 deletions

View File

@ -0,0 +1 @@
ALTER TABLE `vn`.`entry` DROP COLUMN `ref`;

File diff suppressed because one or more lines are too long

View File

@ -60,7 +60,7 @@ INSERT INTO `vn`.`educationLevel` (`id`, `name`)
INSERT INTO `vn`.`worker`(`id`,`code`, `firstName`, `lastName`, `userFk`, `bossFk`) INSERT INTO `vn`.`worker`(`id`,`code`, `firstName`, `lastName`, `userFk`, `bossFk`)
SELECT id,UPPER(LPAD(role, 3, '0')), name, name, id, 9 SELECT id,UPPER(LPAD(role, 3, '0')), name, name, id, 9
FROM `vn`.`user`; FROM `account`.`user`;
UPDATE `vn`.`worker` SET bossFk = NULL WHERE id = 20; UPDATE `vn`.`worker` SET bossFk = NULL WHERE id = 20;
UPDATE `vn`.`worker` SET bossFk = 20 WHERE id = 1 OR id = 9; UPDATE `vn`.`worker` SET bossFk = 20 WHERE id = 1 OR id = 9;
@ -105,20 +105,8 @@ INSERT INTO `account`.`mailForward`(`account`, `forwardTo`)
VALUES VALUES
(1, 'employee@domain.local'); (1, 'employee@domain.local');
INSERT INTO `vn`.`printer` (`id`, `name`, `path`, `isLabeler`)
VALUES
(1, 'printer1', 'path1', 0),
(2, 'printer2', 'path2', 1);
INSERT INTO `vn`.`worker`(`id`, `code`, `firstName`, `lastName`, `userFk`,`bossFk`, `phone`, `sectorFk`, `labelerFk`)
VALUES
(1106, 'LGN', 'David Charles', 'Haller', 1106, 19, 432978106, NULL, NULL),
(1107, 'ANT', 'Hank' , 'Pym' , 1107, 19, 432978107, NULL, 1),
(1108, 'DCX', 'Charles' , 'Xavier', 1108, 19, 432978108, 1, NULL),
(1109, 'HLK', 'Bruce' , 'Banner', 1109, 19, 432978109, 1, 2),
(1110, 'JJJ', 'Jessica' , 'Jones' , 1110, 19, 432978110, 2, 1);
INSERT INTO `vn`.`currency`(`id`, `code`, `name`, `ratio`) INSERT INTO `vn`.`currency`(`id`, `code`, `name`, `ratio`)
VALUES VALUES
(1, 'EUR', 'Euro', 1), (1, 'EUR', 'Euro', 1),
@ -159,6 +147,19 @@ INSERT INTO `vn`.`sector`(`id`, `description`, `warehouseFk`, `isPreviousPrepare
(1, 'First sector', 1, 1, 'FIRST'), (1, 'First sector', 1, 1, 'FIRST'),
(2, 'Second sector', 2, 0, 'SECOND'); (2, 'Second sector', 2, 0, 'SECOND');
INSERT INTO `vn`.`printer` (`id`, `name`, `path`, `isLabeler`, `sectorFk`)
VALUES
(1, 'printer1', 'path1', 0, 1),
(2, 'printer2', 'path2', 1, 1);
INSERT INTO `vn`.`worker`(`id`, `code`, `firstName`, `lastName`, `userFk`,`bossFk`, `phone`, `sectorFk`, `labelerFk`)
VALUES
(1106, 'LGN', 'David Charles', 'Haller', 1106, 19, 432978106, NULL, NULL),
(1107, 'ANT', 'Hank' , 'Pym' , 1107, 19, 432978107, NULL, NULL),
(1108, 'DCX', 'Charles' , 'Xavier', 1108, 19, 432978108, 1, NULL),
(1109, 'HLK', 'Bruce' , 'Banner', 1109, 19, 432978109, 1, NULL),
(1110, 'JJJ', 'Jessica' , 'Jones' , 1110, 19, 432978110, 2, NULL);
INSERT INTO `vn`.`parking` (`id`, `column`, `row`, `sectorFk`, `code`, `pickingOrder`) INSERT INTO `vn`.`parking` (`id`, `column`, `row`, `sectorFk`, `code`, `pickingOrder`)
VALUES VALUES
('1', 700, '01', 1, '700-01', 70001), ('1', 700, '01', 1, '700-01', 70001),
@ -216,18 +217,18 @@ INSERT INTO `vn`.`deliveryMethod`(`id`, `code`, `description`)
(3, 'PICKUP', 'Recogida'), (3, 'PICKUP', 'Recogida'),
(4, 'OTHER', 'Otros'); (4, 'OTHER', 'Otros');
INSERT INTO `vn`.`agency`(`id`, `name`, `warehouseFk`, `bankFk__`, `warehouseAliasFk`) INSERT INTO `vn`.`agency`(`id`, `name`, `warehouseFk`, `warehouseAliasFk`)
VALUES VALUES
(1, 'inhouse pickup' , 1, 1, 1), (1, 'inhouse pickup' , 1, 1),
(2, 'Super-Man delivery' , 1, 1, 1), (2, 'Super-Man delivery' , 1, 1),
(3, 'Teleportation device' , 1, 1, 1), (3, 'Teleportation device' , 1, 1),
(4, 'Entanglement' , 1, 1, 1), (4, 'Entanglement' , 1, 1),
(5, 'Quantum break device' , 1, 1, 1), (5, 'Quantum break device' , 1, 1),
(6, 'Walking' , 1, 1, 1), (6, 'Walking' , 1, 1),
(7, 'Gotham247' , 1, 1, 1), (7, 'Gotham247' , 1, 1),
(8, 'Gotham247Expensive' , 1, 1, 1), (8, 'Gotham247Expensive' , 1, 1),
(9, 'Refund' , 1, 1, 1), (9, 'Refund' , 1, 1),
(10, 'Other agency' , 1, 1, 1); (10, 'Other agency' , 1, 1);
UPDATE `vn`.`agencyMode` SET `id` = 1 WHERE `name` = 'inhouse pickup'; UPDATE `vn`.`agencyMode` SET `id` = 1 WHERE `name` = 'inhouse pickup';
UPDATE `vn`.`agencyMode` SET `id` = 2 WHERE `name` = 'Super-Man delivery'; UPDATE `vn`.`agencyMode` SET `id` = 2 WHERE `name` = 'Super-Man delivery';
@ -1132,11 +1133,11 @@ INSERT INTO `vn`.`saleComponent`(`saleFk`, `componentFk`, `value`)
(32, 36, -92.324), (32, 36, -92.324),
(32, 39, 0.994); (32, 39, 0.994);
INSERT INTO `vn`.`itemShelving` (`itemFk`, `shelvingFk`, `shelve`, `visible`, `grouping`, `packing`, `userFk`) INSERT INTO `vn`.`itemShelving` (`itemFk`, `shelvingFk`, `visible`, `grouping`, `packing`, `userFk`)
VALUES VALUES
(2, 'GVC', 'A', 1, 1, 1, 1106), (2, 'GVC', 1, 1, 1, 1106),
(4, 'HEJ', 'A', 1, 1, 1, 1106), (4, 'HEJ', 1, 1, 1, 1106),
(1, 'UXN', 'A', 2, 12, 12, 1106); (1, 'UXN', 2, 12, 12, 1106);
INSERT INTO `vn`.`itemShelvingSale` (`itemShelvingFk`, `saleFk`, `quantity`, `created`, `userFk`) INSERT INTO `vn`.`itemShelvingSale` (`itemShelvingFk`, `saleFk`, `quantity`, `created`, `userFk`)
VALUES VALUES
@ -1377,16 +1378,16 @@ INSERT INTO `vn`.`travel`(`id`,`shipped`, `landed`, `warehouseInFk`, `warehouseO
(7, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5, 4, 1, 50.00, 500, 'seventh travel', 2, 1), (7, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5, 4, 1, 50.00, 500, 'seventh travel', 2, 1),
(8, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5, 1, 1, 50.00, 500, 'eight travel', 1, 2); (8, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5, 1, 1, 50.00, 500, 'eight travel', 1, 2);
INSERT INTO `vn`.`entry`(`id`, `supplierFk`, `created`, `travelFk`, `isConfirmed`, `companyFk`, `ref`,`isExcludedFromAvailable`, `isRaid`, `notes`, `evaNotes`) INSERT INTO `vn`.`entry`(`id`, `supplierFk`, `created`, `travelFk`, `isConfirmed`, `companyFk`, `invoiceNumber`, `reference`, `isExcludedFromAvailable`, `isRaid`, `notes`, `evaNotes`)
VALUES VALUES
(1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 1, 442, 'Movement 1', 0, 0, '', ''), (1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 1, 442, 'IN2001', 'Movement 1', 0, 0, '', ''),
(2, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 2, 0, 442, 'Movement 2', 0, 0, 'this is the note two', 'observation two'), (2, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 2, 0, 442, 'IN2002', 'Movement 2', 0, 0, 'this is the note two', 'observation two'),
(3, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 3, 0, 442, 'Movement 3', 0, 0, 'this is the note three', 'observation three'), (3, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 3, 0, 442, 'IN2003', 'Movement 3', 0, 0, 'this is the note three', 'observation three'),
(4, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 2, 0, 69, 'Movement 4', 0, 0, 'this is the note four', 'observation four'), (4, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 2, 0, 69, 'IN2004', 'Movement 4', 0, 0, 'this is the note four', 'observation four'),
(5, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5, 0, 442, 'Movement 5', 0, 0, 'this is the note five', 'observation five'), (5, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5, 0, 442, 'IN2005', 'Movement 5', 0, 0, 'this is the note five', 'observation five'),
(6, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 6, 0, 442, 'Movement 6', 0, 0, 'this is the note six', 'observation six'), (6, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 6, 0, 442, 'IN2006', 'Movement 6', 0, 0, 'this is the note six', 'observation six'),
(7, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 7, 0, 442, 'Movement 7', 0, 0, 'this is the note seven', 'observation seven'), (7, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 7, 0, 442, 'IN2007', 'Movement 7', 0, 0, 'this is the note seven', 'observation seven'),
(8, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 7, 0, 442, 'Movement 8', 1, 1, '', ''); (8, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 7, 0, 442, 'IN2008', 'Movement 8', 1, 1, '', '');
INSERT INTO `bs`.`waste`(`buyer`, `year`, `week`, `family`, `itemFk`, `itemTypeFk`, `saleTotal`, `saleWaste`, `rate`) INSERT INTO `bs`.`waste`(`buyer`, `year`, `week`, `family`, `itemFk`, `itemTypeFk`, `saleTotal`, `saleWaste`, `rate`)
VALUES VALUES
@ -1406,23 +1407,23 @@ INSERT INTO `bs`.`waste`(`buyer`, `year`, `week`, `family`, `itemFk`, `itemTypeF
('HankPym', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 'Miscellaneous Accessories', 6, 1, '186', '0', '0.0'), ('HankPym', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 'Miscellaneous Accessories', 6, 1, '186', '0', '0.0'),
('HankPym', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 'Adhesives', 7, 1, '277', '0', '0.0'); ('HankPym', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK)), WEEK(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 WEEK), 1), 'Adhesives', 7, 1, '277', '0', '0.0');
INSERT INTO `vn`.`buy`(`id`,`entryFk`,`itemFk`,`buyingValue`,`quantity`,`packageFk`,`stickers`,`freightValue`,`packageValue`,`comissionValue`,`packing`,`grouping`,`groupingMode`,`location`,`price1`,`price2`,`price3`,`producer`,`printedStickers`,`isChecked`,`isIgnored`,`weight`, `created`) INSERT INTO `vn`.`buy`(`id`,`entryFk`,`itemFk`,`buyingValue`,`quantity`,`packageFk`,`stickers`,`freightValue`,`packageValue`,`comissionValue`,`packing`,`grouping`,`groupingMode`,`location`,`price1`,`price2`,`price3`, `printedStickers`,`isChecked`,`isIgnored`,`weight`, `created`)
VALUES VALUES
(1, 1, 1, 50, 5000, 4, 1, 1.500, 1.500, 0.000, 1, 1, 1, NULL, 0.00, 99.6, 99.4, NULL, 0, 1, 0, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH)), (1, 1, 1, 50, 5000, 4, 1, 1.500, 1.500, 0.000, 1, 1, 1, NULL, 0.00, 99.6, 99.4, 0, 1, 0, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH)),
(2, 2, 1, 50, 100, 4, 1, 1.500, 1.500, 0.000, 1, 1, 1, NULL, 0.00, 99.6, 99.4, NULL, 0, 1, 0, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)), (2, 2, 1, 50, 100, 4, 1, 1.500, 1.500, 0.000, 1, 1, 1, NULL, 0.00, 99.6, 99.4, 0, 1, 0, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)),
(3, 3, 1, 50, 100, 4, 1, 1.500, 1.500, 0.000, 1, 1, 0, NULL, 0.00, 99.6, 99.4, NULL, 0, 1, 0, 1, util.VN_CURDATE()), (3, 3, 1, 50, 100, 4, 1, 1.500, 1.500, 0.000, 1, 1, 0, NULL, 0.00, 99.6, 99.4, 0, 1, 0, 1, util.VN_CURDATE()),
(4, 2, 2, 5, 450, 3, 1, 1.000, 1.000, 0.000, 10, 10, 0, NULL, 0.00, 7.30, 7.00, NULL, 0, 1, 0, 2.5, util.VN_CURDATE()), (4, 2, 2, 5, 450, 3, 1, 1.000, 1.000, 0.000, 10, 10, 0, NULL, 0.00, 7.30, 7.00, 0, 1, 0, 2.5, util.VN_CURDATE()),
(5, 3, 3, 55, 500, 5, 1, 1.000, 1.000, 0.000, 1, 1, 0, NULL, 0.00, 78.3, 75.6, NULL, 0, 1, 0, 2.5, util.VN_CURDATE()), (5, 3, 3, 55, 500, 5, 1, 1.000, 1.000, 0.000, 1, 1, 0, NULL, 0.00, 78.3, 75.6, 0, 1, 0, 2.5, util.VN_CURDATE()),
(6, 4, 8, 50, 1000, 4, 1, 1.000, 1.000, 0.000, 1, 1, 1, NULL, 0.00, 99.6, 99.4, NULL, 0, 1, 0, 2.5, util.VN_CURDATE()), (6, 4, 8, 50, 1000, 4, 1, 1.000, 1.000, 0.000, 1, 1, 1, NULL, 0.00, 99.6, 99.4, 0, 1, 0, 2.5, util.VN_CURDATE()),
(7, 4, 9, 20, 1000, 3, 1, 0.500, 0.500, 0.000, 10, 10, 1, NULL, 0.00, 30.50, 29.00, NULL, 0, 1, 0, 2.5, util.VN_CURDATE()), (7, 4, 9, 20, 1000, 3, 1, 0.500, 0.500, 0.000, 10, 10, 1, NULL, 0.00, 30.50, 29.00, 0, 1, 0, 2.5, util.VN_CURDATE()),
(8, 4, 4, 1.25, 1000, 3, 1, 0.500, 0.500, 0.000, 10, 10, 1, NULL, 0.00, 1.75, 1.67, NULL, 0, 1, 0, 2.5, util.VN_CURDATE()), (8, 4, 4, 1.25, 1000, 3, 1, 0.500, 0.500, 0.000, 10, 10, 1, NULL, 0.00, 1.75, 1.67, 0, 1, 0, 2.5, util.VN_CURDATE()),
(9, 4, 4, 1.25, 1000, 3, 1, 0.500, 0.500, 0.000, 10, 10, 1, NULL, 0.00, 1.75, 1.67, NULL, 0, 1, 0, 4, util.VN_CURDATE()), (9, 4, 4, 1.25, 1000, 3, 1, 0.500, 0.500, 0.000, 10, 10, 1, NULL, 0.00, 1.75, 1.67, 0, 1, 0, 4, util.VN_CURDATE()),
(10, 5, 1, 50, 10, 4, 1, 2.500, 2.500, 0.000, 1, 1, 1, NULL, 0.00, 99.6, 99.4, NULL, 0, 1, 0, 4, util.VN_CURDATE()), (10, 5, 1, 50, 10, 4, 1, 2.500, 2.500, 0.000, 1, 1, 1, NULL, 0.00, 99.6, 99.4, 0, 1, 0, 4, util.VN_CURDATE()),
(11, 5, 4, 1.25, 10, 3, 1, 2.500, 2.500, 0.000, 10, 10, 1, NULL, 0.00, 1.75, 1.67, NULL, 0, 1, 0, 4, util.VN_CURDATE()), (11, 5, 4, 1.25, 10, 3, 1, 2.500, 2.500, 0.000, 10, 10, 1, NULL, 0.00, 1.75, 1.67, 0, 1, 0, 4, util.VN_CURDATE()),
(12, 6, 4, 1.25, 0, 3, 1, 2.500, 2.500, 0.000, 10, 10, 1, NULL, 0.00, 1.75, 1.67, NULL, 0, 1, 0, 4, util.VN_CURDATE()), (12, 6, 4, 1.25, 0, 3, 1, 2.500, 2.500, 0.000, 10, 10, 1, NULL, 0.00, 1.75, 1.67, 0, 1, 0, 4, util.VN_CURDATE()),
(13, 7, 1, 50, 0, 3, 1, 2.000, 2.000, 0.000, 1, 1, 1, NULL, 0.00, 99.6, 99.4, NULL, 0, 1, 0, 4, util.VN_CURDATE()), (13, 7, 1, 50, 0, 3, 1, 2.000, 2.000, 0.000, 1, 1, 1, NULL, 0.00, 99.6, 99.4, 0, 1, 0, 4, util.VN_CURDATE()),
(14, 7, 2, 5, 0, 3, 1, 2.000, 2.000, 0.000, 10, 10, 1, NULL, 0.00, 7.30, 7.00, NULL, 0, 1, 0, 4, util.VN_CURDATE()), (14, 7, 2, 5, 0, 3, 1, 2.000, 2.000, 0.000, 10, 10, 1, NULL, 0.00, 7.30, 7.00, 0, 1, 0, 4, util.VN_CURDATE()),
(15, 7, 4, 1.25, 0, 3, 1, 2.000, 2.000, 0.000, 10, 10, 1, NULL, 0.00, 1.75, 1.67, NULL, 0, 1, 0, 4, util.VN_CURDATE()); (15, 7, 4, 1.25, 0, 3, 1, 2.000, 2.000, 0.000, 10, 10, 1, NULL, 0.00, 1.75, 1.67, 0, 1, 0, 4, util.VN_CURDATE());
INSERT INTO `hedera`.`order`(`id`, `date_send`, `customer_id`, `delivery_method_id`, `agency_id`, `address_id`, `company_id`, `note`, `source_app`, `confirmed`,`total`, `date_make`, `first_row_stamp`, `confirm_date`) INSERT INTO `hedera`.`order`(`id`, `date_send`, `customer_id`, `delivery_method_id`, `agency_id`, `address_id`, `company_id`, `note`, `source_app`, `confirmed`,`total`, `date_make`, `first_row_stamp`, `confirm_date`)
VALUES VALUES
@ -1951,30 +1952,34 @@ INSERT INTO `vn`.`workerBusinessType` (`id`, `name`, `isFullTime`, `isPermanent`
(100, 'INDEFINIDO A TIEMPO COMPLETO', 1, 1, 1), (100, 'INDEFINIDO A TIEMPO COMPLETO', 1, 1, 1),
(109, 'CONVERSION DE TEMPORAL EN INDEFINIDO T.COMPLETO', 1, 1, 1); (109, 'CONVERSION DE TEMPORAL EN INDEFINIDO T.COMPLETO', 1, 1, 1);
INSERT INTO `vn`.`businessCategory` (`id`, `description`, `rate`)
VALUES
(1, 'basic employee', 1);
UPDATE `vn`.`business` b UPDATE `vn`.`business` b
SET `rate` = 7, SET `rate` = 7,
`workerBusinessCategoryFk` = 12, `workerBusinessCategoryFk` = 1,
`workerBusinessTypeFk` = 100, `workerBusinessTypeFk` = 100,
`amount` = 900.50 `amount` = 900.50
WHERE b.id = 1; WHERE b.id = 1;
UPDATE `vn`.`business` b UPDATE `vn`.`business` b
SET `rate` = 7, SET `rate` = 7,
`workerBusinessCategoryFk` = 12, `workerBusinessCategoryFk` = 1,
`workerBusinessTypeFk` = 100, `workerBusinessTypeFk` = 100,
`amount` = 1263.03 `amount` = 1263.03
WHERE b.id = 1106; WHERE b.id = 1106;
UPDATE `vn`.`business` b UPDATE `vn`.`business` b
SET `rate` = 7, SET `rate` = 7,
`workerBusinessCategoryFk` = 12, `workerBusinessCategoryFk` = 1,
`workerBusinessTypeFk` = 100, `workerBusinessTypeFk` = 100,
`amount` = 2000 `amount` = 2000
WHERE b.id = 1107; WHERE b.id = 1107;
UPDATE `vn`.`business` b UPDATE `vn`.`business` b
SET `rate` = 7, SET `rate` = 7,
`workerBusinessCategoryFk` = 12, `workerBusinessCategoryFk` = 1,
`workerBusinessTypeFk` = 100, `workerBusinessTypeFk` = 100,
`amount` = 1500 `amount` = 1500
WHERE b.id = 1108; WHERE b.id = 1108;
@ -2731,4 +2736,13 @@ INSERT INTO `vn`.`osTicketConfig` (`id`, `host`, `user`, `password`, `oldStatus`
INSERT INTO `vn`.`ticketLog` (`id`, `originFk`, `userFk`, `action`, `changedModel`, `oldInstance`, `newInstance`, `changedModelId`) INSERT INTO `vn`.`ticketLog` (`id`, `originFk`, `userFk`, `action`, `changedModel`, `oldInstance`, `newInstance`, `changedModelId`)
VALUES VALUES
(1, 1, 9, 'insert', 'Ticket', '{}', '{"clientFk":1, "nickname": "Bat cave"}', 1); (1, 1, 9, 'insert', 'Ticket', '{}', '{"clientFk":1, "nickname": "Bat cave"}', 1);
INSERT INTO `salix`.`url` (`appName`, `environment`, `url`)
VALUES
('lilium', 'dev', 'http://localhost:8080/#/'),
('salix', 'dev', 'http://localhost:5000/#!/');
INSERT INTO `vn`.`payDemDetail` (`id`, `detail`)
VALUES
(1, 1);

File diff suppressed because it is too large Load Diff

View File

@ -41,6 +41,7 @@ dump_tables ${TABLES[@]}
TABLES=( TABLES=(
vn vn
agencyTermConfig
alertLevel alertLevel
bookingPlanner bookingPlanner
businessType businessType

View File

@ -6,7 +6,6 @@ SCHEMAS=(
cache cache
edi edi
hedera hedera
nst
pbx pbx
postgresql postgresql
sage sage
@ -104,4 +103,4 @@ mysqldump \
| sed 's/\bLOCALTIME\b/util.VN_NOW/ig' \ | sed 's/\bLOCALTIME\b/util.VN_NOW/ig' \
| sed 's/\bLOCALTIMESTAMP\b/util.VN_NOW/ig' \ | sed 's/\bLOCALTIMESTAMP\b/util.VN_NOW/ig' \
| sed 's/ AUTO_INCREMENT=[0-9]* //g' \ | sed 's/ AUTO_INCREMENT=[0-9]* //g' \
> dump/structure.sql > dump/structure.sql

View File

@ -154,8 +154,8 @@ module.exports = Self => {
e.id, e.id,
e.supplierFk, e.supplierFk,
e.dated, e.dated,
e.ref reference, e.reference,
e.ref invoiceNumber, e.invoiceNumber,
e.isBooked, e.isBooked,
e.isExcludedFromAvailable, e.isExcludedFromAvailable,
e.notes, e.notes,

View File

@ -19,16 +19,10 @@
"type": "date" "type": "date"
}, },
"reference": { "reference": {
"type": "string", "type": "string"
"mysql": {
"columnName": "ref"
}
}, },
"invoiceNumber": { "invoiceNumber": {
"type": "string", "type": "string"
"mysql": {
"columnName": "ref"
}
}, },
"isBooked": { "isBooked": {
"type": "boolean" "type": "boolean"

View File

@ -16,7 +16,6 @@ describe('AgencyTerm createInvoiceIn()', () => {
]; ];
it('should make an invoiceIn', async() => { it('should make an invoiceIn', async() => {
pending('Include after #3638 export database');
const tx = await models.AgencyTerm.beginTransaction({}); const tx = await models.AgencyTerm.beginTransaction({});
const options = {transaction: tx}; const options = {transaction: tx};

View File

@ -89,12 +89,12 @@ module.exports = Self => {
ENGINE = MEMORY ENGINE = MEMORY
SELECT SELECT
e.id, e.id,
e.ref, e.invoiceNumber,
e.supplierFk, e.supplierFk,
t.shipped t.shipped
FROM vn.entry e FROM vn.entry e
JOIN vn.travel t ON t.id = e.travelFk JOIN vn.travel t ON t.id = e.travelFk
JOIN buy b ON b.id = b.entryFk JOIN buy b ON e.id = b.entryFk
JOIN item i ON i.id = b.itemFk JOIN item i ON i.id = b.itemFk
JOIN itemType it ON it.id = i.typeFk`); JOIN itemType it ON it.id = i.typeFk`);
stmt.merge(conn.makeWhere(filter.where)); stmt.merge(conn.makeWhere(filter.where));
@ -104,7 +104,7 @@ module.exports = Self => {
const entriesIndex = stmts.push('SELECT * FROM tmp.entry') - 1; const entriesIndex = stmts.push('SELECT * FROM tmp.entry') - 1;
stmt = new ParameterizedSQL( stmt = new ParameterizedSQL(
`SELECT `SELECT
b.id AS buyId, b.id AS buyId,
b.itemFk, b.itemFk,
b.entryFk, b.entryFk,

View File

@ -11,7 +11,7 @@ describe('supplier consumption() filter', () => {
}; };
const result = await app.models.Supplier.consumption(ctx, filter); const result = await app.models.Supplier.consumption(ctx, filter);
expect(result.length).toEqual(6); expect(result.length).toEqual(5);
}); });
it('should return a list of entries from the item id 1 and supplier 1', async() => { it('should return a list of entries from the item id 1 and supplier 1', async() => {

View File

@ -31,8 +31,8 @@
</vn-button> </vn-button>
</vn-tool-bar> </vn-tool-bar>
</section> </section>
<vn-table model="model" <vn-table model="model"
ng-repeat="entry in entries" ng-repeat="entry in entries"
ng-if="entry.buys"> ng-if="entry.buys">
<vn-thead> <vn-thead>
<vn-tr> <vn-tr>
@ -40,8 +40,8 @@
<vn-td>{{::entry.id}}</vn-td> <vn-td>{{::entry.id}}</vn-td>
<vn-th field="data">Date</vn-th> <vn-th field="data">Date</vn-th>
<vn-td>{{::entry.shipped | date: 'dd/MM/yyyy'}}</vn-td> <vn-td>{{::entry.shipped | date: 'dd/MM/yyyy'}}</vn-td>
<vn-th field="ref">Reference</vn-th> <vn-th field="invoiceNumber">Reference</vn-th>
<vn-td vn-tooltip="{{::entry.ref}}">{{::entry.ref}}</vn-td> <vn-td vn-tooltip="{{::entry.invoiceNumber}}">{{::entry.invoiceNumber}}</vn-td>
</vn-tr> </vn-tr>
</vn-thead> </vn-thead>
<vn-tbody> <vn-tbody>
@ -83,8 +83,8 @@
</vn-table> </vn-table>
</vn-card> </vn-card>
</vn-data-viewer> </vn-data-viewer>
<vn-confirm <vn-confirm
vn-id="confirm" vn-id="confirm"
question="Please, confirm" question="Please, confirm"
message="The consumption report will be sent" message="The consumption report will be sent"
on-accept="$ctrl.sendEmail()"> on-accept="$ctrl.sendEmail()">

View File

@ -1,3 +1,2 @@
Total entry: Total entrada Total entry: Total entrada
This supplier doesn't have a contact with an email address: Este proveedor no tiene ningún contacto con una dirección de email This supplier doesn't have a contact with an email address: Este proveedor no tiene ningún contacto con una dirección de email

View File

@ -11,7 +11,12 @@ module.exports = Self => {
required: true, required: true,
description: 'The ticket id', description: 'The ticket id',
http: {source: 'path'} http: {source: 'path'}
}, }, {
arg: 'labelCount',
type: 'number',
required: false,
description: 'The number of labels'
}
], ],
returns: [ returns: [
{ {

View File

@ -0,0 +1,55 @@
const {Report} = require('vn-print');
module.exports = Self => {
Self.remoteMethodCtx('expeditionPalletLabel', {
description: 'Returns the expedition pallet label',
accessType: 'READ',
accepts: [
{
arg: 'id',
type: 'number',
required: true,
description: 'The pallet id',
http: {source: 'path'}
}, {
arg: 'userFk',
type: 'number',
required: true,
description: 'The user id'
}
],
returns: [
{
arg: 'body',
type: 'file',
root: true
}, {
arg: 'Content-Type',
type: 'String',
http: {target: 'header'}
}, {
arg: 'Content-Disposition',
type: 'String',
http: {target: 'header'}
}
],
http: {
path: '/:id/expedition-pallet-label',
verb: 'GET'
}
});
Self.expeditionPalletLabel = async(ctx, id) => {
const args = Object.assign({}, ctx.args);
const params = {lang: ctx.req.getLocale()};
delete args.ctx;
for (const param in args)
params[param] = args[param];
const report = new Report('expedition-pallet-label', params);
const stream = await report.toPdfStream();
return [stream, 'application/pdf', `filename="doc-${id}.pdf"`];
};
};

View File

@ -37,4 +37,5 @@ module.exports = function(Self) {
require('../methods/ticket/merge')(Self); require('../methods/ticket/merge')(Self);
require('../methods/ticket/isRoleAdvanced')(Self); require('../methods/ticket/isRoleAdvanced')(Self);
require('../methods/ticket/collectionLabel')(Self); require('../methods/ticket/collectionLabel')(Self);
require('../methods/ticket/expeditionPalletLabel')(Self);
}; };

View File

@ -159,7 +159,8 @@ module.exports = Self => {
`SELECT `SELECT
e.id, e.id,
e.travelFk, e.travelFk,
e.ref, e.reference,
e.invoiceNumber,
e.loadPriority, e.loadPriority,
s.id AS supplierFk, s.id AS supplierFk,
s.name AS supplierName, s.name AS supplierName,
@ -168,7 +169,7 @@ module.exports = Self => {
e.notes, e.notes,
CAST(SUM(b.weight * b.stickers) AS DECIMAL(10,0)) as loadedkg, CAST(SUM(b.weight * b.stickers) AS DECIMAL(10,0)) as loadedkg,
CAST(SUM(vc.aerealVolumetricDensity * b.stickers * IF(pkg.volume, pkg.volume, pkg.width * pkg.depth * pkg.height) / 1000000) AS DECIMAL(10,0)) as volumeKg CAST(SUM(vc.aerealVolumetricDensity * b.stickers * IF(pkg.volume, pkg.volume, pkg.width * pkg.depth * pkg.height) / 1000000) AS DECIMAL(10,0)) as volumeKg
FROM tmp.travel tr FROM tmp.travel tr
JOIN entry e ON e.travelFk = tr.id JOIN entry e ON e.travelFk = tr.id
JOIN buy b ON b.entryFk = e.id JOIN buy b ON b.entryFk = e.id
JOIN packaging pkg ON pkg.id = b.packageFk JOIN packaging pkg ON pkg.id = b.packageFk

View File

@ -1,4 +1,4 @@
/* eslint max-len: ["error", { "code": 150 }]*/
const ParameterizedSQL = require('loopback-connector').ParameterizedSQL; const ParameterizedSQL = require('loopback-connector').ParameterizedSQL;
module.exports = Self => { module.exports = Self => {
Self.remoteMethod('getEntries', { Self.remoteMethod('getEntries', {
@ -25,27 +25,34 @@ module.exports = Self => {
let stmt; let stmt;
stmt = new ParameterizedSQL(` stmt = new ParameterizedSQL(`
SELECT e.travelFk, e.id, e.isConfirmed, e.ref, e.notes, e.evaNotes AS observation, SELECT
s.name AS supplierName, e.travelFk,
CAST((SUM(IF(p.volume > 0,p.volume,p.width * p.depth * IF(p.height, p.height, i.size + pconfig.upperGap)) e.id,
* b.stickers)/1000000)/((pcc.width*pcc.depth*pcc.height)/1000000) AS DECIMAL(10,2)) cc, e.isConfirmed,
CAST((SUM(IF(p.volume > 0,p.volume,p.width * p.depth * IF(p.height, p.height, i.size + pconfig.upperGap)) e.invoiceNumber,
* b.stickers)/1000000)/((ppallet.width*ppallet.depth*ppallet.height)/1000000) AS DECIMAL(10,2)) pallet, e.reference,
CAST((SUM(IF(p.volume > 0,p.volume,p.width * p.depth * IF(p.height, p.height, i.size + pconfig.upperGap)) e.notes,
* b.stickers)/1000000) AS DECIMAL(10,2)) m3, e.evaNotes AS observation,
TRUNCATE(SUM(b.stickers)/(COUNT( b.id) / COUNT( DISTINCT b.id)),0) hb, s.name AS supplierName,
CAST(SUM(b.freightValue*b.quantity) AS DECIMAL(10,2)) freightValue, CAST((SUM(IF(p.volume > 0,p.volume,p.width * p.depth * IF(p.height, p.height, i.size + pconfig.upperGap))
CAST(SUM(b.packageValue*b.quantity) AS DECIMAL(10,2)) packageValue * b.stickers)/1000000)/((pcc.width*pcc.depth*pcc.height)/1000000) AS DECIMAL(10,2)) cc,
CAST((SUM(IF(p.volume > 0,p.volume,p.width * p.depth * IF(p.height, p.height, i.size + pconfig.upperGap))
* b.stickers)/1000000)/((ppallet.width*ppallet.depth*ppallet.height)/1000000) AS DECIMAL(10,2)) pallet,
CAST((SUM(IF(p.volume > 0,p.volume,p.width * p.depth * IF(p.height, p.height, i.size + pconfig.upperGap))
* b.stickers)/1000000) AS DECIMAL(10,2)) m3,
TRUNCATE(SUM(b.stickers)/(COUNT( b.id) / COUNT( DISTINCT b.id)),0) hb,
CAST(SUM(b.freightValue*b.quantity) AS DECIMAL(10,2)) freightValue,
CAST(SUM(b.packageValue*b.quantity) AS DECIMAL(10,2)) packageValue
FROM vn.travel t FROM vn.travel t
LEFT JOIN vn.entry e ON t.id = e.travelFk LEFT JOIN vn.entry e ON t.id = e.travelFk
LEFT JOIN vn.buy b ON b.entryFk = e.id LEFT JOIN vn.buy b ON b.entryFk = e.id
LEFT JOIN vn.supplier s ON e.supplierFk = s.id LEFT JOIN vn.supplier s ON e.supplierFk = s.id
JOIN vn.item i ON i.id = b.itemFk JOIN vn.item i ON i.id = b.itemFk
LEFT JOIN vn.packaging p ON p.id = b.packageFk LEFT JOIN vn.packaging p ON p.id = b.packageFk
JOIN vn.packaging pcc ON pcc.id = 'cc' JOIN vn.packaging pcc ON pcc.id = 'cc'
JOIN vn.packaging ppallet ON ppallet.id = 'pallet 100' JOIN vn.packaging ppallet ON ppallet.id = 'pallet 100'
JOIN vn.packagingConfig pconfig JOIN vn.packagingConfig pconfig
WHERE t.id = ? WHERE t.id = ?
GROUP BY e.id;`, [ GROUP BY e.id;`, [
id id
]); ]);

View File

@ -1,28 +1,34 @@
const app = require('vn-loopback/server/server'); const models = require('vn-loopback/server/server').models;
describe('travel getEntries()', () => { describe('travel getEntries()', () => {
const travelId = 1; const travelId = 1;
it('should check the response contains the id', async() => { it('should check the response contains the id', async() => {
const entries = await app.models.Travel.getEntries(travelId); const entries = await models.Travel.getEntries(travelId);
expect(entries.length).toEqual(1); expect(entries.length).toEqual(1);
expect(entries[0].id).toEqual(1); expect(entries[0].id).toEqual(1);
}); });
it('should check the response contains the travelFk', async() => { it('should check the response contains the travelFk', async() => {
const entries = await app.models.Travel.getEntries(travelId); const entries = await models.Travel.getEntries(travelId);
expect(entries[0].travelFk).toEqual(1); expect(entries[0].travelFk).toEqual(1);
}); });
it('should check the response contains the ref', async() => { it('should check the response contains the reference', async() => {
const entries = await app.models.Travel.getEntries(travelId); const entries = await models.Travel.getEntries(travelId);
expect(entries[0].ref).toEqual('Movement 1'); expect(entries[0].reference).toEqual('Movement 1');
});
it('should check the response contains the invoiceNumber', async() => {
const entries = await models.Travel.getEntries(travelId);
expect(entries[0].invoiceNumber).toEqual('IN2001');
}); });
it('should check the response contains the m3', async() => { it('should check the response contains the m3', async() => {
const entries = await app.models.Travel.getEntries(travelId); const entries = await models.Travel.getEntries(travelId);
expect(entries[0].m3).toEqual(0.22); expect(entries[0].m3).toEqual(0.22);
}); });

View File

@ -1,6 +1,6 @@
<vn-card class="summary"> <vn-card class="summary">
<h5> <h5>
<a <a
ng-if="::$ctrl.travelData.id" ng-if="::$ctrl.travelData.id"
vn-tooltip="Go to the travel" vn-tooltip="Go to the travel"
ui-sref="travel.card.summary({id: {{::$ctrl.travelData.id}}})" ui-sref="travel.card.summary({id: {{::$ctrl.travelData.id}}})"
@ -13,15 +13,15 @@
<vn-horizontal> <vn-horizontal>
<vn-one> <vn-one>
<vn-label-value <vn-label-value
label="Shipped" label="Shipped"
value="{{$ctrl.travelData.shipped | date: 'dd/MM/yyyy'}}"> value="{{$ctrl.travelData.shipped | date: 'dd/MM/yyyy'}}">
</vn-label-value> </vn-label-value>
<vn-label-value <vn-label-value
label="Warehouse Out" label="Warehouse Out"
value="{{$ctrl.travelData.warehouseOut.name}}"> value="{{$ctrl.travelData.warehouseOut.name}}">
</vn-label-value> </vn-label-value>
<vn-check <vn-check
label="Delivered" label="Delivered"
ng-model="$ctrl.travelData.isDelivered" ng-model="$ctrl.travelData.isDelivered"
disabled="true"> disabled="true">
</vn-check> </vn-check>
@ -36,7 +36,7 @@
value="{{$ctrl.travelData.warehouseIn.name}}"> value="{{$ctrl.travelData.warehouseIn.name}}">
</vn-label-value> </vn-label-value>
<vn-check <vn-check
label="Received" label="Received"
ng-model="$ctrl.travelData.isReceived" ng-model="$ctrl.travelData.isReceived"
disabled="true"> disabled="true">
</vn-check> </vn-check>
@ -80,7 +80,7 @@
<vn-tbody> <vn-tbody>
<vn-tr ng-repeat="entry in $ctrl.entries"> <vn-tr ng-repeat="entry in $ctrl.entries">
<vn-td shrink> <vn-td shrink>
<vn-check <vn-check
ng-model="entry.isConfirmed" ng-model="entry.isConfirmed"
disabled="true"> disabled="true">
</vn-check> </vn-check>
@ -99,7 +99,7 @@
<vn-td shrink>{{entry.cc}}</vn-td> <vn-td shrink>{{entry.cc}}</vn-td>
<vn-td shrink>{{entry.pallet}}</vn-td> <vn-td shrink>{{entry.pallet}}</vn-td>
<vn-td shrink>{{entry.m3}}</vn-td> <vn-td shrink>{{entry.m3}}</vn-td>
<vn-td shrink> <vn-td shrink>
<vn-icon <vn-icon
ng-if="entry.notes.length" ng-if="entry.notes.length"
vn-tooltip="{{entry.notes}}" vn-tooltip="{{entry.notes}}"
@ -134,13 +134,13 @@
</vn-auto> </vn-auto>
<vn-auto ng-if="$ctrl.travelThermographs.length != 0"> <vn-auto ng-if="$ctrl.travelThermographs.length != 0">
<h4 ng-show="$ctrl.isBuyer"> <h4 ng-show="$ctrl.isBuyer">
<a <a
ui-sref="travel.card.thermograph.index({id:$ctrl.travelData.id})" ui-sref="travel.card.thermograph.index({id:$ctrl.travelData.id})"
target="_self"> target="_self">
<span translate vn-tooltip="Go to">Thermograph</span> <span translate vn-tooltip="Go to">Thermograph</span>
</a> </a>
</h4> </h4>
<h4 <h4
translate translate
ng-show="!$ctrl.isBuyer"> ng-show="!$ctrl.isBuyer">
Thermograph Thermograph
@ -168,6 +168,6 @@
</vn-auto> </vn-auto>
</vn-horizontal> </vn-horizontal>
</vn-card> </vn-card>
<vn-entry-descriptor-popover <vn-entry-descriptor-popover
vn-id="entryDescriptor"> vn-id="entryDescriptor">
</vn-entry-descriptor-popover> </vn-entry-descriptor-popover>

View File

@ -410,6 +410,8 @@ describe('workerTimeControl add/delete timeEntry()', () => {
describe('12h rest', () => { describe('12h rest', () => {
it('should throw an error when the 12h rest is not fulfilled yet', async() => { it('should throw an error when the 12h rest is not fulfilled yet', async() => {
pending('https://redmine.verdnatura.es/issues/4707');
activeCtx.accessToken.userId = salesBossId; activeCtx.accessToken.userId = salesBossId;
const workerId = hankPymId; const workerId = hankPymId;

40058
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -13,11 +13,12 @@ html {
font-size: 29px; font-size: 29px;
margin-left: -13px; margin-left: -13px;
} }
.outline { #outline {
border: 1px solid black; border: 1px solid black;
padding: 5px; padding: 5px;
height: 37px; height: 37px;
width: 100px; width: 100px;
max-width: 100px;
} }
#nickname { #nickname {
font-size: 22px; font-size: 22px;

View File

@ -12,13 +12,13 @@
</tr> </tr>
<tr> <tr>
<td rowspan="3"><div v-html="getBarcode(labelData.ticketFk)" id="barcode"></div></td> <td rowspan="3"><div v-html="getBarcode(labelData.ticketFk)" id="barcode"></div></td>
<td class="outline">{{labelData.workerCode || '---'}}</td> <td id="outline" class="ellipsize">{{labelData.workerCode || '---'}}</td>
</tr> </tr>
<tr> <tr>
<td class="outline">{{labelData.labelCount || 0}}</td> <td id="outline" class="ellipsize">{{labelCount || labelData.labelCount || 0}}</td>
</tr> </tr>
<tr> <tr>
<td class="outline">{{labelData.code == 'V' ? (labelData.size || 0) + 'cm' : (labelData.volume || 0) + 'm³'}}</td> <td id="outline" class="ellipsize">{{labelData.code == 'V' ? (labelData.size || 0) + 'cm' : (labelData.volume || 0) + 'm³'}}</td>
</tr> </tr>
<tr> <tr>
<td><div id="agencyDescripton" class="ellipsize">{{labelData.agencyDescription ? labelData.agencyDescription.toUpperCase() : '---'}}</div></td> <td><div id="agencyDescripton" class="ellipsize">{{labelData.agencyDescription ? labelData.agencyDescription.toUpperCase() : '---'}}</div></td>

View File

@ -11,6 +11,11 @@ module.exports = {
type: Number, type: Number,
required: true, required: true,
description: 'The ticket or collection id' description: 'The ticket or collection id'
},
labelCount: {
type: Number,
required: false,
description: 'The number of labels'
} }
}, },
async serverPrefetch() { async serverPrefetch() {

View File

@ -12,8 +12,8 @@ SELECT c.itemPackingTypeFk code,
TIME_FORMAT(t.shipped, '%H:%i') shippedHour, TIME_FORMAT(t.shipped, '%H:%i') shippedHour,
TIME_FORMAT(zo.`hour`, '%H:%i') zoneHour, TIME_FORMAT(zo.`hour`, '%H:%i') zoneHour,
DATE_FORMAT(t.shipped, '%d/%m/%y') shipped, DATE_FORMAT(t.shipped, '%d/%m/%y') shipped,
t.nickName,
tt.labelCount, tt.labelCount,
t.nickName,
COUNT(*) lineCount COUNT(*) lineCount
FROM vn.ticket t FROM vn.ticket t
JOIN vn.ticketCollection tc ON tc.ticketFk = t.id JOIN vn.ticketCollection tc ON tc.ticketFk = t.id

View File

@ -0,0 +1,12 @@
const Stylesheet = require(`vn-print/core/stylesheet`);
const path = require('path');
const vnPrintPath = path.resolve('print');
module.exports = new Stylesheet([
`${vnPrintPath}/common/css/spacing.css`,
`${vnPrintPath}/common/css/misc.css`,
`${vnPrintPath}/common/css/layout.css`,
`${vnPrintPath}/common/css/report.css`,
`${__dirname}/style.css`])
.mergeStyles();

View File

@ -0,0 +1,62 @@
html {
font-family: Arial, Helvetica, sans-serif;
}
* {
box-sizing: border-box;
font-size: 25px;
}
#truck {
width: 100%;
max-width: 150px;
height: 90px;
background-color: black;
color: white;
font-size: 50px;
font-weight: bold;
text-align: center;
}
.mainTable {
width: 100%;
height: 100%;
border: 10px solid;
border-radius: 20px;
-moz-border-radius: 20px;
-webkit-border-radius: 10px;
border-collapse: separate;
border-spacing: 0px;
}
.zoneTable{
width: 100%;
margin: 0 auto;
border-collapse: collapse;
}
#routeFk, #zone, #labels{
font-size: 30px;
}
#routeFk{
width: 120px;
padding-top: 5px;
padding-bottom: 5px;
max-width: 120px;
text-align: center;
}
#zone{
width: 305px;
max-width: 305px;
text-align: center;
}
#labels{
text-align: center;
}
#black {
background-color: rgb(102, 102, 102);
color: white;
}
#QR {
padding: 25px;
padding-left: 40px;
margin-top: 20px;
}
#additionalInfo {
padding-top: 20px;
}

View File

@ -0,0 +1,38 @@
<!DOCTYPE html>
<html>
<body>
<table class="mainTable">
<tbody>
<tr>
<td colspan="2" id="truck" class="ellipsize">{{labelData.truck || '---'}}</td>
</tr>
<tr>
<td colspan="2">
<table v-for="labelData in labelsData" class="zoneTable">
<thead>
<tr v-if="!labelData.isMatch" id="black">
<td id="routeFk" class="ellipsize">{{labelData.routeFk}}</td>
<td id="zone" class="ellipsize">{{labelData.zone || '---'}}</td>
<td id="labels" class="ellipsize">{{labelData.labels}}</td>
</tr>
<tr v-else>
<td id="routeFk" class="ellipsize">{{labelData.routeFk}}</td>
<td id="zone" class="ellipsize">{{labelData.zone || '---'}}</td>
<td id="labels" class="ellipsize">{{labelData.labels || '--'}}</td>
</tr>
</thead>
</table>
</td>
</tr>
<tr>
<td><img :src="QR" id="QR"/></td>
<td class="ellipsize">
<div id="additionalInfo"><b>Pallet: </b>{{id}}</div>
<div id="additionalInfo"><b>User: </b> {{username.name || '---'}}</div>
<div id="additionalInfo"><b>Day: </b>{{labelData.dayName.toUpperCase() || '---'}}</div>
</td>
</tr>
</tbody>
</table>
</body>
</html>

View File

@ -0,0 +1,46 @@
const Component = require(`vn-print/core/component`);
const reportBody = new Component('report-body');
const UserError = require('vn-loopback/util/user-error');
const qrcode = require('qrcode');
module.exports = {
name: 'expedition-pallet-label',
props: {
id: {
type: Number,
required: true,
description: 'The pallet id'
},
userFk: {
type: Number,
required: true,
description: 'The user id'
}
},
async serverPrefetch() {
this.labelsData = await this.rawSqlFromDef('labelData', this.id);
this.username = await this.findOneFromDef('username', this.userFk);
this.labelData = this.labelsData[0];
let QRdata = JSON.stringify({
company: 'vnl',
user: this.userFk,
created: new Date(),
table: 'expeditionPallet',
id: this.id
});
this.QR = await this.getQR(QRdata);
if (!this.labelsData.length)
throw new UserError('Empty data source');
},
methods: {
getQR(id) {
const data = String(id);
return qrcode.toDataURL(data, {margin: 0});
},
},
components: {
'report-body': reportBody.build()
},
};

View File

@ -0,0 +1 @@
reportName: labelPalletExpedition

View File

@ -0,0 +1,11 @@
{
"width": "10cm",
"height": "15cm",
"margin": {
"top": "0.5cm",
"right": "0.2cm",
"bottom": "0cm",
"left": "0cm"
},
"printBackground": true
}

View File

@ -0,0 +1,19 @@
SELECT ep.id palletFk,
t.routeFk,
et2.description truck,
r.description `zone`,
COUNT(es.id) labels,
t.warehouseFk warehouseFk,
dayname(r.created) `dayName`,
et.id <=> rm.expeditionTruckFk isMatch
FROM vn.expeditionTruck et
JOIN vn.expeditionPallet ep ON ep.truckFk = et.id
JOIN vn.expeditionScan es ON es.palletFk = ep.id
JOIN vn.expedition e ON e.id = es.expeditionFk
JOIN vn.ticket t ON t.id = e.ticketFk
JOIN vn.route r ON r.id = t.routeFk
LEFT JOIN vn2008.Rutas_monitor rm ON rm.Id_Ruta = r.id
LEFT JOIN vn.expeditionTruck et2 ON et2.id = rm.expeditionTruckFk
WHERE ep.id = ?
GROUP BY ep.id, t.routeFk
ORDER BY t.routeFk

View File

@ -0,0 +1,3 @@
SELECT `name`
FROM account.user
WHERE id = ?