Merge pull request '4770-routes_roadmap2' (!1647) from 4770-routes_roadmap2 into dev
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
Reviewed-on: #1647 Reviewed-by: Javi Gallego <jgallego@verdnatura.es> Reviewed-by: Alex Moreno <alexm@verdnatura.es>
This commit is contained in:
commit
c88a753865
|
@ -1,68 +0,0 @@
|
||||||
const {models} = require('vn-loopback/server/server');
|
|
||||||
|
|
||||||
describe('VnUser addAlias()', () => {
|
|
||||||
const employeeId = 1;
|
|
||||||
const sysadminId = 66;
|
|
||||||
const developerId = 9;
|
|
||||||
const customerId = 2;
|
|
||||||
const mailAlias = 1;
|
|
||||||
it('should throw an error when user not has privileges', async() => {
|
|
||||||
const ctx = {req: {accessToken: {userId: employeeId}}};
|
|
||||||
const tx = await models.VnUser.beginTransaction({});
|
|
||||||
|
|
||||||
let error;
|
|
||||||
try {
|
|
||||||
const options = {transaction: tx};
|
|
||||||
|
|
||||||
await models.VnUser.addAlias(ctx, employeeId, mailAlias, options);
|
|
||||||
|
|
||||||
await tx.rollback();
|
|
||||||
} catch (e) {
|
|
||||||
error = e;
|
|
||||||
await tx.rollback();
|
|
||||||
}
|
|
||||||
|
|
||||||
expect(error.message).toContain(`You don't have grant privilege`);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should throw an error when user has privileges but not has the role from user', async() => {
|
|
||||||
const ctx = {req: {accessToken: {userId: sysadminId}}};
|
|
||||||
const tx = await models.VnUser.beginTransaction({});
|
|
||||||
|
|
||||||
let error;
|
|
||||||
try {
|
|
||||||
const options = {transaction: tx};
|
|
||||||
|
|
||||||
await models.VnUser.addAlias(ctx, employeeId, mailAlias, options);
|
|
||||||
|
|
||||||
await tx.rollback();
|
|
||||||
} catch (e) {
|
|
||||||
error = e;
|
|
||||||
await tx.rollback();
|
|
||||||
}
|
|
||||||
|
|
||||||
expect(error.message).toContain(`You cannot assign an alias that you are not assigned to`);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should add an alias', async() => {
|
|
||||||
const ctx = {req: {accessToken: {userId: developerId}}};
|
|
||||||
const tx = await models.VnUser.beginTransaction({});
|
|
||||||
|
|
||||||
let result;
|
|
||||||
try {
|
|
||||||
const options = {transaction: tx};
|
|
||||||
|
|
||||||
const user = await models.VnUser.findById(developerId, null, options);
|
|
||||||
await user.updateAttribute('hasGrant', true, options);
|
|
||||||
|
|
||||||
result = await models.VnUser.addAlias(ctx, customerId, mailAlias, options);
|
|
||||||
|
|
||||||
await tx.rollback();
|
|
||||||
} catch (e) {
|
|
||||||
await tx.rollback();
|
|
||||||
}
|
|
||||||
|
|
||||||
expect(result.mailAlias).toBe(mailAlias);
|
|
||||||
expect(result.account).toBe(customerId);
|
|
||||||
});
|
|
||||||
});
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
ALTER TABLE `vn`.`roadmap` COMMENT='Troncales diarios que se contratan';
|
||||||
|
ALTER TABLE `vn`.`roadmap` ADD price decimal(10,2) NULL;
|
||||||
|
ALTER TABLE `vn`.`roadmap` ADD driverName varchar(45) NULL;
|
||||||
|
ALTER TABLE `vn`.`roadmap` ADD name varchar(45) NOT NULL;
|
||||||
|
ALTER TABLE `vn`.`roadmap` CHANGE name name varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL AFTER id;
|
||||||
|
ALTER TABLE `vn`.`roadmap` MODIFY COLUMN etd datetime NOT NULL;
|
||||||
|
|
||||||
|
ALTER TABLE `vn`.`expeditionTruck` COMMENT='Distintas paradas que hacen los trocales';
|
||||||
|
ALTER TABLE `vn`.`expeditionTruck` DROP FOREIGN KEY expeditionTruck_FK_2;
|
||||||
|
ALTER TABLE `vn`.`expeditionTruck` ADD CONSTRAINT expeditionTruck_FK_2 FOREIGN KEY (roadmapFk) REFERENCES vn.roadmap(id) ON DELETE CASCADE ON UPDATE CASCADE;
|
|
@ -0,0 +1,6 @@
|
||||||
|
INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`)
|
||||||
|
VALUES
|
||||||
|
('Roadmap', '*', '*', 'ALLOW', 'ROLE', 'palletizerBoss'),
|
||||||
|
('Roadmap', '*', '*', 'ALLOW', 'ROLE', 'productionBoss'),
|
||||||
|
('ExpeditionTruck', '*', '*', 'ALLOW', 'ROLE', 'palletizerBoss'),
|
||||||
|
('ExpeditionTruck', '*', '*', 'ALLOW', 'ROLE', 'productionBoss');
|
|
@ -2606,9 +2606,18 @@ INSERT INTO `vn`.`zoneAgencyMode`(`id`, `agencyModeFk`, `zoneFk`)
|
||||||
(3, 6, 5),
|
(3, 6, 5),
|
||||||
(4, 7, 1);
|
(4, 7, 1);
|
||||||
|
|
||||||
INSERT INTO `vn`.`expeditionTruck` (`id`, `eta`, `description`)
|
INSERT INTO `vn`.`roadmap` (`id`, `name`, `tractorPlate`, `trailerPlate`, `phone`, `supplierFk`, `etd`, `observations`, `userFk`, `price`, `driverName`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, CONCAT(YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL +3 YEAR))), 'Best truck in fleet');
|
(1, 'val-algemesi', 'RE-001', 'PO-001', '111111111', 1, util.VN_NOW(), 'this is test observation', 1, 15, 'Batman'),
|
||||||
|
(2, 'alg-valencia', 'RE-002', 'PO-002', '111111111', 1, util.VN_NOW(), 'test observation', 1, 20, 'Robin'),
|
||||||
|
(3, 'alz-algemesi', 'RE-003', 'PO-003', '222222222', 2, DATE_ADD(util.VN_NOW(), INTERVAL 2 DAY), 'observations...', 2, 25, 'Driverman');
|
||||||
|
|
||||||
|
INSERT INTO `vn`.`expeditionTruck` (`id`, `roadmapFk`, `warehouseFk`, `eta`, `description`, `userFk`)
|
||||||
|
VALUES
|
||||||
|
(1, 1, 1, DATE_ADD(util.VN_NOW(), INTERVAL 1 DAY), 'Best truck in fleet', 1),
|
||||||
|
(2, 1, 2, DATE_ADD(util.VN_NOW(), INTERVAL '1 2' DAY_HOUR), 'Second truck in fleet', 1),
|
||||||
|
(3, 1, 3, DATE_ADD(util.VN_NOW(), INTERVAL '1 4' DAY_HOUR), 'Third truck in fleet', 1),
|
||||||
|
(4, 2, 1, DATE_ADD(util.VN_NOW(), INTERVAL 3 DAY), 'Truck red', 1);
|
||||||
|
|
||||||
INSERT INTO `vn`.`expeditionPallet` (`id`, `truckFk`, `built`, `position`, `isPrint`)
|
INSERT INTO `vn`.`expeditionPallet` (`id`, `truckFk`, `built`, `position`, `isPrint`)
|
||||||
VALUES
|
VALUES
|
||||||
|
|
|
@ -1,402 +1,411 @@
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'salixfont';
|
font-family: 'salixfont';
|
||||||
src:
|
src:
|
||||||
url('./salixfont.ttf?wtrl3') format('truetype'),
|
url('./salixfont.ttf?wtrl3') format('truetype'),
|
||||||
url('./salixfont.woff?wtrl3') format('woff'),
|
url('./salixfont.woff?wtrl3') format('woff'),
|
||||||
url('./salixfont.svg?wtrl3#salixfont') format('svg');
|
url('./salixfont.svg?wtrl3#salixfont') format('svg');
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
[class^="icon-"], [class*=" icon-"] {
|
[class^="icon-"], [class*=" icon-"] {
|
||||||
/* use !important to prevent issues with browser extensions that change fonts */
|
/* use !important to prevent issues with browser extensions that change fonts */
|
||||||
font-family: 'salixfont' !important;
|
font-family: 'salixfont' !important;
|
||||||
speak: none;
|
speak: none;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-variant: normal;
|
font-variant: normal;
|
||||||
text-transform: none;
|
text-transform: none;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
|
|
||||||
/* Better Font Rendering =========== */
|
/* Better Font Rendering =========== */
|
||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-agency-term:before {
|
.icon-trailer:before {
|
||||||
content: "\e950";
|
content: "\e967";
|
||||||
}
|
}
|
||||||
.icon-defaulter:before {
|
.icon-grafana:before {
|
||||||
content: "\e94b";
|
content: "\e965";
|
||||||
}
|
}
|
||||||
.icon-100:before {
|
.icon-trolley:before {
|
||||||
content: "\e95a";
|
content: "\e95c";
|
||||||
}
|
}
|
||||||
.icon-clientUnpaid:before {
|
.icon-agency-term:before {
|
||||||
content: "\e95b";
|
content: "\e950";
|
||||||
}
|
}
|
||||||
.icon-history:before {
|
.icon-defaulter:before {
|
||||||
content: "\e968";
|
content: "\e94b";
|
||||||
}
|
}
|
||||||
.icon-Person:before {
|
.icon-100:before {
|
||||||
content: "\e901";
|
content: "\e95a";
|
||||||
}
|
}
|
||||||
.icon-accessory:before {
|
.icon-clientUnpaid:before {
|
||||||
content: "\e90a";
|
content: "\e95b";
|
||||||
}
|
}
|
||||||
.icon-account:before {
|
.icon-history:before {
|
||||||
content: "\e92a";
|
content: "\e968";
|
||||||
}
|
}
|
||||||
.icon-actions:before {
|
.icon-Person:before {
|
||||||
content: "\e960";
|
content: "\e901";
|
||||||
}
|
}
|
||||||
.icon-addperson:before {
|
.icon-accessory:before {
|
||||||
content: "\e90e";
|
content: "\e90a";
|
||||||
}
|
}
|
||||||
.icon-agency:before {
|
.icon-account:before {
|
||||||
content: "\e938";
|
content: "\e92a";
|
||||||
}
|
}
|
||||||
.icon-albaran:before {
|
.icon-actions:before {
|
||||||
content: "\e94d";
|
content: "\e960";
|
||||||
}
|
}
|
||||||
.icon-anonymous:before {
|
.icon-addperson:before {
|
||||||
content: "\e930";
|
content: "\e90e";
|
||||||
}
|
}
|
||||||
.icon-apps:before {
|
.icon-agency:before {
|
||||||
content: "\e951";
|
content: "\e938";
|
||||||
}
|
}
|
||||||
.icon-artificial:before {
|
.icon-albaran:before {
|
||||||
content: "\e90b";
|
content: "\e94d";
|
||||||
}
|
}
|
||||||
.icon-attach:before {
|
.icon-anonymous:before {
|
||||||
content: "\e92e";
|
content: "\e930";
|
||||||
}
|
}
|
||||||
.icon-barcode:before {
|
.icon-apps:before {
|
||||||
content: "\e971";
|
content: "\e951";
|
||||||
}
|
}
|
||||||
.icon-basket:before {
|
.icon-artificial:before {
|
||||||
content: "\e914";
|
content: "\e90b";
|
||||||
}
|
}
|
||||||
.icon-basketadd:before {
|
.icon-attach:before {
|
||||||
content: "\e913";
|
content: "\e92e";
|
||||||
}
|
}
|
||||||
.icon-bin:before {
|
.icon-barcode:before {
|
||||||
content: "\e96f";
|
content: "\e971";
|
||||||
}
|
}
|
||||||
.icon-botanical:before {
|
.icon-basket:before {
|
||||||
content: "\e972";
|
content: "\e914";
|
||||||
}
|
}
|
||||||
.icon-bucket:before {
|
.icon-basketadd:before {
|
||||||
content: "\e97a";
|
content: "\e913";
|
||||||
}
|
}
|
||||||
.icon-buscaman:before {
|
.icon-bin:before {
|
||||||
content: "\e93b";
|
content: "\e96f";
|
||||||
}
|
}
|
||||||
.icon-buyrequest:before {
|
.icon-botanical:before {
|
||||||
content: "\e932";
|
content: "\e972";
|
||||||
}
|
}
|
||||||
.icon-calc_volum .path1:before {
|
.icon-bucket:before {
|
||||||
content: "\e915";
|
content: "\e97a";
|
||||||
}
|
}
|
||||||
.icon-calc_volum .path2:before {
|
.icon-buscaman:before {
|
||||||
content: "\e916";
|
content: "\e93b";
|
||||||
margin-left: -1em;
|
}
|
||||||
}
|
.icon-buyrequest:before {
|
||||||
.icon-calc_volum .path3:before {
|
content: "\e932";
|
||||||
content: "\e917";
|
}
|
||||||
margin-left: -1em;
|
.icon-calc_volum .path1:before {
|
||||||
}
|
content: "\e915";
|
||||||
.icon-calc_volum .path4:before {
|
}
|
||||||
content: "\e918";
|
.icon-calc_volum .path2:before {
|
||||||
margin-left: -1em;
|
content: "\e916";
|
||||||
}
|
margin-left: -1em;
|
||||||
.icon-calc_volum .path5:before {
|
}
|
||||||
content: "\e919";
|
.icon-calc_volum .path3:before {
|
||||||
margin-left: -1em;
|
content: "\e917";
|
||||||
}
|
margin-left: -1em;
|
||||||
.icon-calc_volum .path6:before {
|
}
|
||||||
content: "\e91a";
|
.icon-calc_volum .path4:before {
|
||||||
margin-left: -1em;
|
content: "\e918";
|
||||||
}
|
margin-left: -1em;
|
||||||
.icon-calendar:before {
|
}
|
||||||
content: "\e93d";
|
.icon-calc_volum .path5:before {
|
||||||
}
|
content: "\e919";
|
||||||
.icon-catalog:before {
|
margin-left: -1em;
|
||||||
content: "\e937";
|
}
|
||||||
}
|
.icon-calc_volum .path6:before {
|
||||||
.icon-claims:before {
|
content: "\e91a";
|
||||||
content: "\e963";
|
margin-left: -1em;
|
||||||
}
|
}
|
||||||
.icon-client:before {
|
.icon-calendar:before {
|
||||||
content: "\e928";
|
content: "\e93d";
|
||||||
}
|
}
|
||||||
.icon-clone:before {
|
.icon-catalog:before {
|
||||||
content: "\e973";
|
content: "\e937";
|
||||||
}
|
}
|
||||||
.icon-columnadd:before {
|
.icon-claims:before {
|
||||||
content: "\e954";
|
content: "\e963";
|
||||||
}
|
}
|
||||||
.icon-columndelete:before {
|
.icon-client:before {
|
||||||
content: "\e953";
|
content: "\e928";
|
||||||
}
|
}
|
||||||
.icon-components:before {
|
.icon-clone:before {
|
||||||
content: "\e946";
|
content: "\e973";
|
||||||
}
|
}
|
||||||
.icon-consignatarios:before {
|
.icon-columnadd:before {
|
||||||
content: "\e93f";
|
content: "\e954";
|
||||||
}
|
}
|
||||||
.icon-control:before {
|
.icon-columndelete:before {
|
||||||
content: "\e949";
|
content: "\e953";
|
||||||
}
|
}
|
||||||
.icon-credit:before {
|
.icon-components:before {
|
||||||
content: "\e927";
|
content: "\e946";
|
||||||
}
|
}
|
||||||
.icon-deletedTicket:before {
|
.icon-consignatarios:before {
|
||||||
content: "\e935";
|
content: "\e93f";
|
||||||
}
|
}
|
||||||
.icon-deleteline:before {
|
.icon-control:before {
|
||||||
content: "\e955";
|
content: "\e949";
|
||||||
}
|
}
|
||||||
.icon-delivery:before {
|
.icon-credit:before {
|
||||||
content: "\e939";
|
content: "\e927";
|
||||||
}
|
}
|
||||||
.icon-deliveryprices:before {
|
.icon-deletedTicket:before {
|
||||||
content: "\e91c";
|
content: "\e935";
|
||||||
}
|
}
|
||||||
.icon-details:before {
|
.icon-deleteline:before {
|
||||||
content: "\e961";
|
content: "\e955";
|
||||||
}
|
}
|
||||||
.icon-dfiscales:before {
|
.icon-delivery:before {
|
||||||
content: "\e984";
|
content: "\e939";
|
||||||
}
|
}
|
||||||
.icon-disabled:before {
|
.icon-deliveryprices:before {
|
||||||
content: "\e921";
|
content: "\e91c";
|
||||||
}
|
}
|
||||||
.icon-doc:before {
|
.icon-details:before {
|
||||||
content: "\e977";
|
content: "\e961";
|
||||||
}
|
}
|
||||||
.icon-entry:before {
|
.icon-dfiscales:before {
|
||||||
content: "\e934";
|
content: "\e984";
|
||||||
}
|
}
|
||||||
.icon-exit:before {
|
.icon-disabled:before {
|
||||||
content: "\e92f";
|
content: "\e921";
|
||||||
}
|
}
|
||||||
.icon-eye:before {
|
.icon-doc:before {
|
||||||
content: "\e976";
|
content: "\e977";
|
||||||
}
|
}
|
||||||
.icon-fixedPrice:before {
|
.icon-entry:before {
|
||||||
content: "\e90d";
|
content: "\e934";
|
||||||
}
|
}
|
||||||
.icon-flower:before {
|
.icon-exit:before {
|
||||||
content: "\e90c";
|
content: "\e92f";
|
||||||
}
|
}
|
||||||
.icon-frozen:before {
|
.icon-eye:before {
|
||||||
content: "\e900";
|
content: "\e976";
|
||||||
}
|
}
|
||||||
.icon-fruit:before {
|
.icon-fixedPrice:before {
|
||||||
content: "\e903";
|
content: "\e90d";
|
||||||
}
|
}
|
||||||
.icon-funeral:before {
|
.icon-flower:before {
|
||||||
content: "\e904";
|
content: "\e90c";
|
||||||
}
|
}
|
||||||
.icon-greenery:before {
|
.icon-frozen:before {
|
||||||
content: "\e907";
|
content: "\e900";
|
||||||
}
|
}
|
||||||
.icon-greuge:before {
|
.icon-fruit:before {
|
||||||
content: "\e944";
|
content: "\e903";
|
||||||
}
|
}
|
||||||
.icon-grid:before {
|
.icon-funeral:before {
|
||||||
content: "\e980";
|
content: "\e904";
|
||||||
}
|
}
|
||||||
.icon-handmade:before {
|
.icon-greenery:before {
|
||||||
content: "\e909";
|
content: "\e907";
|
||||||
}
|
}
|
||||||
.icon-handmadeArtificial:before {
|
.icon-greuge:before {
|
||||||
content: "\e902";
|
content: "\e944";
|
||||||
}
|
}
|
||||||
.icon-headercol:before {
|
.icon-grid:before {
|
||||||
content: "\e958";
|
content: "\e980";
|
||||||
}
|
}
|
||||||
.icon-info:before {
|
.icon-handmade:before {
|
||||||
content: "\e952";
|
content: "\e909";
|
||||||
}
|
}
|
||||||
.icon-inventory:before {
|
.icon-handmadeArtificial:before {
|
||||||
content: "\e92b";
|
content: "\e902";
|
||||||
}
|
}
|
||||||
.icon-invoice:before {
|
.icon-headercol:before {
|
||||||
content: "\e923";
|
content: "\e958";
|
||||||
}
|
}
|
||||||
.icon-invoice-in:before {
|
.icon-info:before {
|
||||||
content: "\e911";
|
content: "\e952";
|
||||||
}
|
}
|
||||||
.icon-invoice-in-create:before {
|
.icon-inventory:before {
|
||||||
content: "\e912";
|
content: "\e92b";
|
||||||
}
|
}
|
||||||
.icon-invoice-out:before {
|
.icon-invoice:before {
|
||||||
content: "\e910";
|
content: "\e923";
|
||||||
}
|
}
|
||||||
.icon-isTooLittle:before {
|
.icon-invoice-in:before {
|
||||||
content: "\e91b";
|
content: "\e911";
|
||||||
}
|
}
|
||||||
.icon-item:before {
|
.icon-invoice-in-create:before {
|
||||||
content: "\e956";
|
content: "\e912";
|
||||||
}
|
}
|
||||||
.icon-languaje:before {
|
.icon-invoice-out:before {
|
||||||
content: "\e926";
|
content: "\e910";
|
||||||
}
|
}
|
||||||
.icon-lines:before {
|
.icon-isTooLittle:before {
|
||||||
content: "\e942";
|
content: "\e91b";
|
||||||
}
|
}
|
||||||
.icon-linesprepaired:before {
|
.icon-item:before {
|
||||||
content: "\e948";
|
content: "\e956";
|
||||||
}
|
}
|
||||||
.icon-logout:before {
|
.icon-languaje:before {
|
||||||
content: "\e936";
|
content: "\e926";
|
||||||
}
|
}
|
||||||
.icon-mana:before {
|
.icon-lines:before {
|
||||||
content: "\e96a";
|
content: "\e942";
|
||||||
}
|
}
|
||||||
.icon-mandatory:before {
|
.icon-linesprepaired:before {
|
||||||
content: "\e97b";
|
content: "\e948";
|
||||||
}
|
}
|
||||||
.icon-net:before {
|
.icon-logout:before {
|
||||||
content: "\e931";
|
content: "\e936";
|
||||||
}
|
}
|
||||||
.icon-niche:before {
|
.icon-mana:before {
|
||||||
content: "\e96c";
|
content: "\e96a";
|
||||||
}
|
}
|
||||||
.icon-no036:before {
|
.icon-mandatory:before {
|
||||||
content: "\e920";
|
content: "\e97b";
|
||||||
}
|
}
|
||||||
.icon-noPayMethod:before {
|
.icon-net:before {
|
||||||
content: "\e905";
|
content: "\e931";
|
||||||
}
|
}
|
||||||
.icon-notes:before {
|
.icon-niche:before {
|
||||||
content: "\e941";
|
content: "\e96c";
|
||||||
}
|
}
|
||||||
.icon-noweb:before {
|
.icon-no036:before {
|
||||||
content: "\e91f";
|
content: "\e920";
|
||||||
}
|
}
|
||||||
.icon-onlinepayment:before {
|
.icon-noPayMethod:before {
|
||||||
content: "\e91d";
|
content: "\e905";
|
||||||
}
|
}
|
||||||
.icon-package:before {
|
.icon-notes:before {
|
||||||
content: "\e978";
|
content: "\e941";
|
||||||
}
|
}
|
||||||
.icon-payment:before {
|
.icon-noweb:before {
|
||||||
content: "\e97e";
|
content: "\e91f";
|
||||||
}
|
}
|
||||||
.icon-pbx:before {
|
.icon-onlinepayment:before {
|
||||||
content: "\e93c";
|
content: "\e91d";
|
||||||
}
|
}
|
||||||
.icon-pets:before {
|
.icon-package:before {
|
||||||
content: "\e947";
|
content: "\e978";
|
||||||
}
|
}
|
||||||
.icon-photo:before {
|
.icon-payment:before {
|
||||||
content: "\e924";
|
content: "\e97e";
|
||||||
}
|
}
|
||||||
.icon-plant:before {
|
.icon-pbx:before {
|
||||||
content: "\e908";
|
content: "\e93c";
|
||||||
}
|
}
|
||||||
.icon-polizon:before {
|
.icon-pets:before {
|
||||||
content: "\e95e";
|
content: "\e947";
|
||||||
}
|
}
|
||||||
.icon-preserved:before {
|
.icon-photo:before {
|
||||||
content: "\e906";
|
content: "\e924";
|
||||||
}
|
}
|
||||||
.icon-recovery:before {
|
.icon-plant:before {
|
||||||
content: "\e97c";
|
content: "\e908";
|
||||||
}
|
}
|
||||||
.icon-regentry:before {
|
.icon-polizon:before {
|
||||||
content: "\e964";
|
content: "\e95e";
|
||||||
}
|
}
|
||||||
.icon-reserva:before {
|
.icon-preserved:before {
|
||||||
content: "\e959";
|
content: "\e906";
|
||||||
}
|
}
|
||||||
.icon-revision:before {
|
.icon-recovery:before {
|
||||||
content: "\e94a";
|
content: "\e97c";
|
||||||
}
|
}
|
||||||
.icon-risk:before {
|
.icon-regentry:before {
|
||||||
content: "\e91e";
|
content: "\e964";
|
||||||
}
|
}
|
||||||
.icon-services:before {
|
.icon-reserva:before {
|
||||||
content: "\e94c";
|
content: "\e959";
|
||||||
}
|
}
|
||||||
.icon-settings:before {
|
.icon-revision:before {
|
||||||
content: "\e979";
|
content: "\e94a";
|
||||||
}
|
}
|
||||||
.icon-shipment-01:before {
|
.icon-risk:before {
|
||||||
content: "\e929";
|
content: "\e91e";
|
||||||
}
|
}
|
||||||
.icon-sign:before {
|
.icon-services:before {
|
||||||
content: "\e95d";
|
content: "\e94c";
|
||||||
}
|
}
|
||||||
.icon-sms:before {
|
.icon-settings:before {
|
||||||
content: "\e975";
|
content: "\e979";
|
||||||
}
|
}
|
||||||
.icon-solclaim:before {
|
.icon-shipment-01:before {
|
||||||
content: "\e95f";
|
content: "\e929";
|
||||||
}
|
}
|
||||||
.icon-solunion:before {
|
.icon-sign:before {
|
||||||
content: "\e94e";
|
content: "\e95d";
|
||||||
}
|
}
|
||||||
.icon-stowaway:before {
|
.icon-sms:before {
|
||||||
content: "\e94f";
|
content: "\e975";
|
||||||
}
|
}
|
||||||
.icon-splitline:before {
|
.icon-solclaim:before {
|
||||||
content: "\e93e";
|
content: "\e95f";
|
||||||
}
|
}
|
||||||
.icon-splur:before {
|
.icon-solunion:before {
|
||||||
content: "\e970";
|
content: "\e94e";
|
||||||
}
|
}
|
||||||
.icon-supplier:before {
|
.icon-stowaway:before {
|
||||||
content: "\e925";
|
content: "\e94f";
|
||||||
}
|
}
|
||||||
.icon-supplierfalse:before {
|
.icon-splitline:before {
|
||||||
content: "\e90f";
|
content: "\e93e";
|
||||||
}
|
}
|
||||||
.icon-tags:before {
|
.icon-splur:before {
|
||||||
content: "\e96d";
|
content: "\e970";
|
||||||
}
|
}
|
||||||
.icon-tax:before {
|
.icon-supplier:before {
|
||||||
content: "\e940";
|
content: "\e925";
|
||||||
}
|
}
|
||||||
.icon-thermometer:before {
|
.icon-supplierfalse:before {
|
||||||
content: "\e933";
|
content: "\e90f";
|
||||||
}
|
}
|
||||||
.icon-ticket:before {
|
.icon-tags:before {
|
||||||
content: "\e96b";
|
content: "\e96d";
|
||||||
}
|
}
|
||||||
.icon-ticketAdd:before {
|
.icon-tax:before {
|
||||||
content: "\e945";
|
content: "\e940";
|
||||||
}
|
}
|
||||||
.icon-traceability:before {
|
.icon-thermometer:before {
|
||||||
content: "\e962";
|
content: "\e933";
|
||||||
}
|
}
|
||||||
.icon-transaction:before {
|
.icon-ticket:before {
|
||||||
content: "\e966";
|
content: "\e96b";
|
||||||
}
|
}
|
||||||
.icon-treatments:before {
|
.icon-ticketAdd:before {
|
||||||
content: "\e922";
|
content: "\e945";
|
||||||
}
|
}
|
||||||
.icon-unavailable:before {
|
.icon-traceability:before {
|
||||||
content: "\e92c";
|
content: "\e962";
|
||||||
}
|
}
|
||||||
.icon-volume:before {
|
.icon-transaction:before {
|
||||||
content: "\e96e";
|
content: "\e966";
|
||||||
}
|
}
|
||||||
.icon-wand:before {
|
.icon-treatments:before {
|
||||||
content: "\e93a";
|
content: "\e922";
|
||||||
}
|
}
|
||||||
.icon-web:before {
|
.icon-unavailable:before {
|
||||||
content: "\e982";
|
content: "\e92c";
|
||||||
}
|
}
|
||||||
.icon-wiki:before {
|
.icon-volume:before {
|
||||||
content: "\e92d";
|
content: "\e96e";
|
||||||
}
|
}
|
||||||
.icon-worker:before {
|
.icon-wand:before {
|
||||||
content: "\e957";
|
content: "\e93a";
|
||||||
}
|
}
|
||||||
.icon-zone:before {
|
.icon-web:before {
|
||||||
content: "\e943";
|
content: "\e982";
|
||||||
}
|
}
|
||||||
|
.icon-wiki:before {
|
||||||
|
content: "\e92d";
|
||||||
|
}
|
||||||
|
.icon-worker:before {
|
||||||
|
content: "\e957";
|
||||||
|
}
|
||||||
|
.icon-zone:before {
|
||||||
|
content: "\e943";
|
||||||
|
}
|
||||||
|
|
Binary file not shown.
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 162 KiB After Width: | Height: | Size: 173 KiB |
Binary file not shown.
Binary file not shown.
|
@ -8,7 +8,7 @@ vn-client-summary .summary {
|
||||||
}
|
}
|
||||||
|
|
||||||
vn-horizontal h4 .grafana:after {
|
vn-horizontal h4 .grafana:after {
|
||||||
content: 'contact_support';
|
font-family: 'salixfont' !important;
|
||||||
font-size: 17px;
|
content: "\e965";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,14 +3,13 @@
|
||||||
|
|
||||||
vn-entry-buy-index vn-card {
|
vn-entry-buy-index vn-card {
|
||||||
max-width: $width-xl;
|
max-width: $width-xl;
|
||||||
|
|
||||||
.dark-row {
|
.dark-row {
|
||||||
background-color: lighten($color-marginal, 10%);
|
background-color: lighten($color-marginal, 10%);
|
||||||
}
|
}
|
||||||
|
|
||||||
thead tr {
|
thead tr {
|
||||||
border-left: 1px solid white;
|
border: 1px solid white;;
|
||||||
border-right: 1px solid white;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tbody tr:nth-child(1),
|
tbody tr:nth-child(1),
|
||||||
|
@ -22,7 +21,7 @@ vn-entry-buy-index vn-card {
|
||||||
tbody tr:nth-child(2) {
|
tbody tr:nth-child(2) {
|
||||||
border-bottom: 1px solid $color-spacer;
|
border-bottom: 1px solid $color-spacer;
|
||||||
}
|
}
|
||||||
|
|
||||||
tbody{
|
tbody{
|
||||||
border-bottom: 1px solid $color-spacer;
|
border-bottom: 1px solid $color-spacer;
|
||||||
}
|
}
|
||||||
|
@ -40,4 +39,4 @@ vn-entry-buy-index vn-card {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$color-font-link-medium: lighten($color-font-link, 20%)
|
$color-font-link-medium: lighten($color-font-link, 20%)
|
||||||
|
|
|
@ -0,0 +1,81 @@
|
||||||
|
const UserError = require('vn-loopback/util/user-error');
|
||||||
|
module.exports = Self => {
|
||||||
|
Self.remoteMethod('clone', {
|
||||||
|
description: 'Clones the selected routes',
|
||||||
|
accessType: 'WRITE',
|
||||||
|
accepts: [
|
||||||
|
{
|
||||||
|
arg: 'ids',
|
||||||
|
type: ['number'],
|
||||||
|
required: true,
|
||||||
|
description: 'The routes ids to clone'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
arg: 'etd',
|
||||||
|
type: 'date',
|
||||||
|
required: true,
|
||||||
|
description: 'The estimated time of departure for all roadmaps'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
returns: {
|
||||||
|
type: ['Object'],
|
||||||
|
root: true
|
||||||
|
},
|
||||||
|
http: {
|
||||||
|
path: `/clone`,
|
||||||
|
verb: 'POST'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Self.clone = async(ids, etd) => {
|
||||||
|
const tx = await Self.beginTransaction({});
|
||||||
|
try {
|
||||||
|
const models = Self.app.models;
|
||||||
|
const options = {transaction: tx};
|
||||||
|
const originalRoadmaps = await models.Roadmap.find({
|
||||||
|
where: {id: {inq: ids}},
|
||||||
|
fields: [
|
||||||
|
'id',
|
||||||
|
'name',
|
||||||
|
'tractorPlate',
|
||||||
|
'trailerPlate',
|
||||||
|
'phone',
|
||||||
|
'supplierFk',
|
||||||
|
'etd',
|
||||||
|
'observations',
|
||||||
|
'price'],
|
||||||
|
include: [{
|
||||||
|
relation: 'expeditionTruck',
|
||||||
|
scope: {
|
||||||
|
fields: ['roadmapFk', 'warehouseFk', 'eta', 'description']
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
|
||||||
|
}, options);
|
||||||
|
|
||||||
|
if (ids.length != originalRoadmaps.length)
|
||||||
|
throw new UserError(`The amount of roadmaps found don't match`);
|
||||||
|
|
||||||
|
for (const roadmap of originalRoadmaps) {
|
||||||
|
roadmap.id = undefined;
|
||||||
|
roadmap.etd = etd;
|
||||||
|
|
||||||
|
const clone = await models.Roadmap.create(roadmap, options);
|
||||||
|
|
||||||
|
const expeditionTrucks = roadmap.expeditionTruck();
|
||||||
|
expeditionTrucks.map(expeditionTruck => {
|
||||||
|
expeditionTruck.roadmapFk = clone.id;
|
||||||
|
return expeditionTruck;
|
||||||
|
});
|
||||||
|
await models.ExpeditionTruck.create(expeditionTrucks, options);
|
||||||
|
}
|
||||||
|
|
||||||
|
await tx.commit();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
} catch (e) {
|
||||||
|
await tx.rollback();
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
|
@ -0,0 +1,109 @@
|
||||||
|
const app = require('vn-loopback/server/server');
|
||||||
|
const models = require('vn-loopback/server/server').models;
|
||||||
|
|
||||||
|
describe('AgencyTerm filter()', () => {
|
||||||
|
const authUserId = 9;
|
||||||
|
const today = Date.vnNew();
|
||||||
|
today.setHours(2, 0, 0, 0);
|
||||||
|
|
||||||
|
it('should return all results matching the filter', async() => {
|
||||||
|
const tx = await models.AgencyTerm.beginTransaction({});
|
||||||
|
|
||||||
|
try {
|
||||||
|
const options = {transaction: tx};
|
||||||
|
const filter = {};
|
||||||
|
const ctx = {req: {accessToken: {userId: authUserId}}};
|
||||||
|
|
||||||
|
const agencyTerms = await models.AgencyTerm.filter(ctx, filter, options);
|
||||||
|
const firstAgencyTerm = agencyTerms[0];
|
||||||
|
|
||||||
|
expect(firstAgencyTerm.routeFk).toEqual(1);
|
||||||
|
expect(agencyTerms.length).toEqual(5);
|
||||||
|
|
||||||
|
await tx.rollback();
|
||||||
|
} catch (e) {
|
||||||
|
await tx.rollback();
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return results matching "search" searching by integer', async() => {
|
||||||
|
let ctx = {
|
||||||
|
args: {
|
||||||
|
search: 1,
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
let result = await app.models.AgencyTerm.filter(ctx);
|
||||||
|
|
||||||
|
expect(result.length).toEqual(1);
|
||||||
|
expect(result[0].routeFk).toEqual(1);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return results matching "search" searching by string', async() => {
|
||||||
|
let ctx = {
|
||||||
|
args: {
|
||||||
|
search: 'Plants SL',
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
let result = await app.models.AgencyTerm.filter(ctx);
|
||||||
|
|
||||||
|
expect(result.length).toEqual(2);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return results matching "from" and "to"', async() => {
|
||||||
|
const tx = await models.Buy.beginTransaction({});
|
||||||
|
const options = {transaction: tx};
|
||||||
|
|
||||||
|
try {
|
||||||
|
const from = Date.vnNew();
|
||||||
|
from.setHours(0, 0, 0, 0);
|
||||||
|
|
||||||
|
const to = Date.vnNew();
|
||||||
|
to.setHours(23, 59, 59, 999);
|
||||||
|
|
||||||
|
const ctx = {
|
||||||
|
args: {
|
||||||
|
from: from,
|
||||||
|
to: to
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const results = await models.AgencyTerm.filter(ctx, options);
|
||||||
|
|
||||||
|
expect(results.length).toBe(5);
|
||||||
|
|
||||||
|
await tx.rollback();
|
||||||
|
} catch (e) {
|
||||||
|
await tx.rollback();
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return results matching "agencyModeFk"', async() => {
|
||||||
|
let ctx = {
|
||||||
|
args: {
|
||||||
|
agencyModeFk: 1,
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
let result = await app.models.AgencyTerm.filter(ctx);
|
||||||
|
|
||||||
|
expect(result.length).toEqual(1);
|
||||||
|
expect(result[0].routeFk).toEqual(1);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return results matching "agencyFk"', async() => {
|
||||||
|
let ctx = {
|
||||||
|
args: {
|
||||||
|
agencyFk: 2,
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
let result = await app.models.AgencyTerm.filter(ctx);
|
||||||
|
|
||||||
|
expect(result.length).toEqual(1);
|
||||||
|
expect(result[0].routeFk).toEqual(2);
|
||||||
|
});
|
||||||
|
});
|
|
@ -5,18 +5,22 @@
|
||||||
"AgencyTermConfig": {
|
"AgencyTermConfig": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
},
|
},
|
||||||
"Route": {
|
"DeliveryPoint": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
},
|
},
|
||||||
"Vehicle": {
|
"ExpeditionTruck": {
|
||||||
|
"dataSource": "vn"
|
||||||
|
},
|
||||||
|
"Roadmap": {
|
||||||
|
"dataSource": "vn"
|
||||||
|
},
|
||||||
|
"Route": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
},
|
},
|
||||||
"RouteLog": {
|
"RouteLog": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
},
|
},
|
||||||
"DeliveryPoint": {
|
"Vehicle": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,43 @@
|
||||||
|
{
|
||||||
|
"name": "ExpeditionTruck",
|
||||||
|
"base": "VnModel",
|
||||||
|
"options": {
|
||||||
|
"mysql": {
|
||||||
|
"table": "expeditionTruck"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "number",
|
||||||
|
"id": true,
|
||||||
|
"description": "Identifier"
|
||||||
|
},
|
||||||
|
"roadmapFk": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"warehouseFk": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"eta": {
|
||||||
|
"type": "date"
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"userFk": {
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"relations": {
|
||||||
|
"roadmap": {
|
||||||
|
"type": "belongsTo",
|
||||||
|
"model": "Roadmap",
|
||||||
|
"foreignKey": "roadmapFk"
|
||||||
|
},
|
||||||
|
"warehouse": {
|
||||||
|
"type": "belongsTo",
|
||||||
|
"model": "Warehouse",
|
||||||
|
"foreignKey": "warehouseFk"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
module.exports = Self => {
|
||||||
|
require('../methods/roadmap/clone')(Self);
|
||||||
|
};
|
|
@ -0,0 +1,63 @@
|
||||||
|
{
|
||||||
|
"name": "Roadmap",
|
||||||
|
"base": "VnModel",
|
||||||
|
"options": {
|
||||||
|
"mysql": {
|
||||||
|
"table": "roadmap"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "number",
|
||||||
|
"id": true,
|
||||||
|
"description": "Identifier"
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"tractorPlate": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"trailerPlate": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"phone": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"supplierFk": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"etd": {
|
||||||
|
"type": "date"
|
||||||
|
},
|
||||||
|
"observations": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"userFk": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"price": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"driverName": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"relations": {
|
||||||
|
"worker": {
|
||||||
|
"type": "belongsTo",
|
||||||
|
"model": "Worker",
|
||||||
|
"foreignKey": "userFk"
|
||||||
|
},
|
||||||
|
"supplier": {
|
||||||
|
"type": "belongsTo",
|
||||||
|
"model": "Supplier",
|
||||||
|
"foreignKey": "supplierFk"
|
||||||
|
},
|
||||||
|
"expeditionTruck": {
|
||||||
|
"type": "hasMany",
|
||||||
|
"model": "ExpeditionTruck",
|
||||||
|
"foreignKey": "roadmapFk"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -16,3 +16,4 @@ import './agency-term/createInvoiceIn';
|
||||||
import './agency-term-search-panel';
|
import './agency-term-search-panel';
|
||||||
import './ticket-popup';
|
import './ticket-popup';
|
||||||
import './sms';
|
import './sms';
|
||||||
|
import './roadmap';
|
||||||
|
|
|
@ -0,0 +1,98 @@
|
||||||
|
<mg-ajax path="Roadmaps/{{patch.params.id}}" options="vnPatch"></mg-ajax>
|
||||||
|
<vn-watcher
|
||||||
|
vn-id="watcher"
|
||||||
|
data="$ctrl.roadmap"
|
||||||
|
form="form"
|
||||||
|
save="patch">
|
||||||
|
</vn-watcher>
|
||||||
|
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md">
|
||||||
|
<vn-card class="vn-pa-lg">
|
||||||
|
<vn-horizontal>
|
||||||
|
<vn-textfield vn-focus
|
||||||
|
vn-one
|
||||||
|
label="Roadmap"
|
||||||
|
ng-model="$ctrl.roadmap.name"
|
||||||
|
rule>
|
||||||
|
</vn-textfield>
|
||||||
|
<vn-date-picker
|
||||||
|
vn-one
|
||||||
|
label="ETD date"
|
||||||
|
ng-model="$ctrl.roadmap.etd">
|
||||||
|
</vn-date-picker>
|
||||||
|
<vn-input-time
|
||||||
|
vn-one
|
||||||
|
label="ETD hour"
|
||||||
|
ng-model="$ctrl.roadmap.etd">
|
||||||
|
</vn-input-time>
|
||||||
|
</vn-horizontal>
|
||||||
|
<vn-horizontal>
|
||||||
|
<vn-textfield
|
||||||
|
vn-one
|
||||||
|
label="Tractor plate"
|
||||||
|
ng-model="$ctrl.roadmap.tractorPlate"
|
||||||
|
rule>
|
||||||
|
</vn-textfield>
|
||||||
|
<vn-textfield
|
||||||
|
vn-one
|
||||||
|
label="Trailer plate"
|
||||||
|
ng-model="$ctrl.roadmap.trailerPlate"
|
||||||
|
rule>
|
||||||
|
</vn-textfield>
|
||||||
|
</vn-horizontal>
|
||||||
|
<vn-horizontal>
|
||||||
|
<vn-autocomplete
|
||||||
|
vn-one
|
||||||
|
ng-model="$ctrl.roadmap.supplierFk"
|
||||||
|
url="Suppliers"
|
||||||
|
show-field="nickname"
|
||||||
|
search-function="{or: [{id: $search}, {nickname: {like: '%'+ $search +'%'}}]}"
|
||||||
|
value-field="id"
|
||||||
|
order="nickname"
|
||||||
|
label="Carrier">
|
||||||
|
<tpl-item>
|
||||||
|
{{::id}} - {{::nickname}}
|
||||||
|
</tpl-item>
|
||||||
|
</vn-autocomplete>
|
||||||
|
<vn-input-number
|
||||||
|
vn-one
|
||||||
|
label="Price"
|
||||||
|
ng-model="$ctrl.roadmap.price"
|
||||||
|
rule>
|
||||||
|
</vn-input-number>
|
||||||
|
</vn-horizontal>
|
||||||
|
<vn-horizontal>
|
||||||
|
<vn-textfield
|
||||||
|
vn-one
|
||||||
|
label="Driver name"
|
||||||
|
ng-model="$ctrl.roadmap.driverName"
|
||||||
|
rule>
|
||||||
|
</vn-textfield>
|
||||||
|
<vn-textfield
|
||||||
|
vn-one
|
||||||
|
label="Phone"
|
||||||
|
ng-model="$ctrl.roadmap.phone"
|
||||||
|
rule>
|
||||||
|
</vn-textfield>
|
||||||
|
</vn-horizontal>
|
||||||
|
<vn-horizontal>
|
||||||
|
<vn-textArea
|
||||||
|
vn-one
|
||||||
|
label="Observations"
|
||||||
|
ng-model="$ctrl.roadmap.observations"
|
||||||
|
rule>
|
||||||
|
</vn-textArea>
|
||||||
|
</vn-horizontal>
|
||||||
|
</vn-card>
|
||||||
|
<vn-button-bar>
|
||||||
|
<vn-submit
|
||||||
|
disabled="!watcher.dataChanged()"
|
||||||
|
label="Save">
|
||||||
|
</vn-submit>
|
||||||
|
<vn-button
|
||||||
|
class="cancel"
|
||||||
|
label="Undo changes"
|
||||||
|
disabled="!watcher.dataChanged()"
|
||||||
|
ng-click="watcher.loadOriginalData()">
|
||||||
|
</vn-button>
|
||||||
|
</vn-button-bar>
|
||||||
|
</form>
|
|
@ -0,0 +1,16 @@
|
||||||
|
import ngModule from '../../module';
|
||||||
|
import Section from 'salix/components/section';
|
||||||
|
|
||||||
|
export default class Controller extends Section {
|
||||||
|
onSubmit() {
|
||||||
|
this.$.watcher.submit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ngModule.component('vnRoadmapBasicData', {
|
||||||
|
template: require('./index.html'),
|
||||||
|
controller: Controller,
|
||||||
|
bindings: {
|
||||||
|
roadmap: '<'
|
||||||
|
}
|
||||||
|
});
|
|
@ -0,0 +1,5 @@
|
||||||
|
<vn-portal slot="menu">
|
||||||
|
<vn-roadmap-descriptor roadmap="$ctrl.roadmap"></vn-roadmap-descriptor>
|
||||||
|
<vn-left-menu source="roadmap"></vn-left-menu>
|
||||||
|
</vn-portal>
|
||||||
|
<ui-view></ui-view>
|
|
@ -0,0 +1,19 @@
|
||||||
|
import ngModule from '../../module';
|
||||||
|
import ModuleCard from 'salix/components/module-card';
|
||||||
|
|
||||||
|
class Controller extends ModuleCard {
|
||||||
|
reload() {
|
||||||
|
const filter = {
|
||||||
|
include: [
|
||||||
|
{relation: 'supplier'}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
this.$http.get(`Roadmaps/${this.$params.id}`, {filter})
|
||||||
|
.then(res => this.roadmap = res.data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ngModule.vnComponent('vnRoadmapCard', {
|
||||||
|
template: require('./index.html'),
|
||||||
|
controller: Controller
|
||||||
|
});
|
|
@ -0,0 +1,37 @@
|
||||||
|
<vn-watcher
|
||||||
|
vn-id="watcher"
|
||||||
|
url="Roadmaps"
|
||||||
|
data="$ctrl.roadmap"
|
||||||
|
insert-mode="true"
|
||||||
|
form="form">
|
||||||
|
</vn-watcher>
|
||||||
|
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md">
|
||||||
|
<vn-card class="vn-pa-lg">
|
||||||
|
<vn-horizontal>
|
||||||
|
<vn-textfield
|
||||||
|
label="Roadmap"
|
||||||
|
ng-model="$ctrl.roadmap.name"
|
||||||
|
rule>
|
||||||
|
</vn-textfield>
|
||||||
|
<vn-date-picker
|
||||||
|
label="ETD date"
|
||||||
|
ng-model="$ctrl.roadmap.etd">
|
||||||
|
</vn-date-picker>
|
||||||
|
<vn-input-time
|
||||||
|
label="ETD hour"
|
||||||
|
ng-model="$ctrl.roadmap.etd">
|
||||||
|
</vn-input-time>
|
||||||
|
</vn-horizontal>
|
||||||
|
</vn-card>
|
||||||
|
<vn-button-bar>
|
||||||
|
<vn-submit
|
||||||
|
disabled="!watcher.dataChanged()"
|
||||||
|
label="Create">
|
||||||
|
</vn-submit>
|
||||||
|
<vn-button
|
||||||
|
class="cancel"
|
||||||
|
label="Cancel"
|
||||||
|
ui-sref="roadmap.index">
|
||||||
|
</vn-button>
|
||||||
|
</vn-button-bar>
|
||||||
|
</form>
|
|
@ -0,0 +1,23 @@
|
||||||
|
import ngModule from '../../module';
|
||||||
|
import Section from 'salix/components/section';
|
||||||
|
import './style.scss';
|
||||||
|
|
||||||
|
class Controller extends Section {
|
||||||
|
constructor($element, $, $transclude, vnReport, vnEmail) {
|
||||||
|
super($element, $, $transclude);
|
||||||
|
this.roadmap = {etd: Date.vnNew()};
|
||||||
|
}
|
||||||
|
|
||||||
|
onSubmit() {
|
||||||
|
this.$.watcher.submit().then(
|
||||||
|
res => this.$state.go('route.roadmap.card.summary', {id: res.data.id})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Controller.$inject = ['$element', '$scope'];
|
||||||
|
|
||||||
|
ngModule.vnComponent('vnRoadmapCreate', {
|
||||||
|
template: require('./index.html'),
|
||||||
|
controller: Controller
|
||||||
|
});
|
|
@ -0,0 +1,6 @@
|
||||||
|
vn-ticket-request {
|
||||||
|
.vn-textfield {
|
||||||
|
margin: 0!important;
|
||||||
|
max-width: 100px;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,39 @@
|
||||||
|
<vn-descriptor-content
|
||||||
|
module="route"
|
||||||
|
base-state="route.roadmap"
|
||||||
|
description="$ctrl.roadmap.name">
|
||||||
|
<slot-menu>
|
||||||
|
<vn-item
|
||||||
|
ng-click="deleteRoadmap.show()"
|
||||||
|
name="deleteRoadmap"
|
||||||
|
translate>
|
||||||
|
Delete roadmap
|
||||||
|
</vn-item>
|
||||||
|
</slot-menu>
|
||||||
|
<slot-body>
|
||||||
|
<div class="attributes">
|
||||||
|
<vn-label-value
|
||||||
|
label="Roadmap"
|
||||||
|
value="{{$ctrl.roadmap.name}}">
|
||||||
|
</vn-label-value>
|
||||||
|
<vn-label-value
|
||||||
|
label="ETD"
|
||||||
|
value="{{$ctrl.roadmap.etd | date:'dd/MM/yyyy HH:mm'}}">
|
||||||
|
</vn-label-value>
|
||||||
|
<vn-label-value label="Carrier">
|
||||||
|
<span ng-click="supplierDescriptor.show($event, $ctrl.roadmap.supplier.id)" class="link">
|
||||||
|
{{$ctrl.roadmap.supplier.nickname}}
|
||||||
|
</span>
|
||||||
|
</vn-label-value>
|
||||||
|
</div>
|
||||||
|
</slot-body>
|
||||||
|
</vn-descriptor-content>
|
||||||
|
<vn-confirm
|
||||||
|
vn-id="deleteRoadmap"
|
||||||
|
on-accept="$ctrl.onDelete()"
|
||||||
|
question="Are you sure you want to continue?"
|
||||||
|
message="The roadmap will be removed">
|
||||||
|
</vn-confirm>
|
||||||
|
<vn-supplier-descriptor-popover
|
||||||
|
vn-id="supplierDescriptor">
|
||||||
|
</vn-supplier-descriptor-popover>
|
|
@ -0,0 +1,26 @@
|
||||||
|
import ngModule from '../../module';
|
||||||
|
import Descriptor from 'salix/components/descriptor';
|
||||||
|
|
||||||
|
class Controller extends Descriptor {
|
||||||
|
get roadmap() {
|
||||||
|
return this.entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
set roadmap(value) {
|
||||||
|
this.entity = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
onDelete() {
|
||||||
|
return this.$http.delete(`Roadmaps/${this.roadmap.id}`)
|
||||||
|
.then(() => this.$state.go('route.roadmap'))
|
||||||
|
.then(() => this.vnApp.showSuccess(this.$t('Roadmap removed')));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ngModule.component('vnRoadmapDescriptor', {
|
||||||
|
template: require('./index.html'),
|
||||||
|
controller: Controller,
|
||||||
|
bindings: {
|
||||||
|
roadmap: '<'
|
||||||
|
}
|
||||||
|
});
|
|
@ -0,0 +1,3 @@
|
||||||
|
Delete roadmap: Eliminar troncal
|
||||||
|
The roadmap will be removed: La troncal será eliminada
|
||||||
|
Roadmap removed: Troncal eliminada
|
|
@ -0,0 +1,9 @@
|
||||||
|
import './main';
|
||||||
|
import './index/';
|
||||||
|
import './summary';
|
||||||
|
import './card';
|
||||||
|
import './descriptor';
|
||||||
|
import './create';
|
||||||
|
import './basic-data';
|
||||||
|
import './search-panel';
|
||||||
|
import './stops';
|
|
@ -0,0 +1,112 @@
|
||||||
|
<vn-auto-search
|
||||||
|
model="model">
|
||||||
|
</vn-auto-search>
|
||||||
|
<vn-data-viewer
|
||||||
|
model="model"
|
||||||
|
class="vn-w-lg">
|
||||||
|
<vn-card class="vn-pa-md vn-w-lg">
|
||||||
|
<vn-tool-bar class="vn-ma-md">
|
||||||
|
<vn-button
|
||||||
|
disabled="$ctrl.totalChecked == 0"
|
||||||
|
ng-click="$ctrl.openClonationDialog()"
|
||||||
|
icon="icon-clone"
|
||||||
|
vn-tooltip="Clone selected roadmaps">
|
||||||
|
</vn-button>
|
||||||
|
<vn-button
|
||||||
|
disabled="$ctrl.totalChecked == 0"
|
||||||
|
ng-click="deleteRoadmaps.show()"
|
||||||
|
vn-tooltip="Delete roadmap(s)"
|
||||||
|
icon="delete">
|
||||||
|
</vn-button>
|
||||||
|
</vn-tool-bar>
|
||||||
|
<vn-table model="model">
|
||||||
|
<vn-thead>
|
||||||
|
<vn-tr>
|
||||||
|
<vn-th shrink>
|
||||||
|
<vn-multi-check
|
||||||
|
model="model">
|
||||||
|
</vn-multi-check>
|
||||||
|
</vn-th>
|
||||||
|
<vn-th field="description">Roadmap</vn-th>
|
||||||
|
<vn-th field="etd" expand date>ETD</vn-th>
|
||||||
|
<vn-th field="supplierFk">Carrier</vn-th>
|
||||||
|
<vn-th field="plate">Plate</vn-th>
|
||||||
|
<vn-th field="price">Price</vn-th>
|
||||||
|
<vn-th field="observations" expand>Observations</vn-th>
|
||||||
|
<vn-th></vn-th>
|
||||||
|
</vn-tr>
|
||||||
|
</vn-thead>
|
||||||
|
<vn-tbody>
|
||||||
|
<a ng-repeat="roadmap in model.data"
|
||||||
|
class="clickable vn-tr search-result"
|
||||||
|
ui-sref="route.roadmap.card.summary({id: {{::roadmap.id}}})">
|
||||||
|
<vn-td>
|
||||||
|
<vn-check
|
||||||
|
ng-model="roadmap.checked"
|
||||||
|
vn-click-stop>
|
||||||
|
</vn-check>
|
||||||
|
</vn-td>
|
||||||
|
<vn-td>{{::roadmap.name}}</vn-td>
|
||||||
|
<vn-td expand date>{{::roadmap.etd | date:'dd/MM/yyyy HH:mm'}}</vn-td>
|
||||||
|
<vn-td expand>
|
||||||
|
<span
|
||||||
|
class="link"
|
||||||
|
vn-click-stop="supplierDescriptor.show($event, roadmap.supplierFk)">
|
||||||
|
{{::roadmap.supplier.nickname}}
|
||||||
|
</span>
|
||||||
|
</vn-td>
|
||||||
|
<vn-td>{{::roadmap.tractorPlate | dashIfEmpty}}</vn-td>
|
||||||
|
<vn-td expand>{{::roadmap.price | currency: 'EUR':2 | dashIfEmpty}}</vn-td>
|
||||||
|
<vn-td expand>{{::roadmap.observations | dashIfEmpty}}</vn-td>
|
||||||
|
<vn-td shrink>
|
||||||
|
<vn-icon-button
|
||||||
|
vn-click-stop="$ctrl.preview(roadmap)"
|
||||||
|
vn-tooltip="Preview"
|
||||||
|
icon="preview">
|
||||||
|
</vn-icon-button>
|
||||||
|
</vn-td>
|
||||||
|
</a>
|
||||||
|
</vn-tbody>
|
||||||
|
</vn-table>
|
||||||
|
</vn-card>
|
||||||
|
</vn-data-viewer>
|
||||||
|
<a
|
||||||
|
ui-sref="route.roadmap.create"
|
||||||
|
vn-tooltip="Create roadmap"
|
||||||
|
vn-bind="+"
|
||||||
|
fixed-bottom-right>
|
||||||
|
<vn-float-button icon="add"></vn-float-button>
|
||||||
|
</a>
|
||||||
|
<vn-popup vn-id="summary">
|
||||||
|
<vn-roadmap-summary
|
||||||
|
roadmap="$ctrl.roadmapSelected">
|
||||||
|
</vn-roadmap-summary>
|
||||||
|
</vn-popup>
|
||||||
|
<vn-supplier-descriptor-popover
|
||||||
|
vn-id="supplierDescriptor">
|
||||||
|
</vn-supplier-descriptor-popover>
|
||||||
|
|
||||||
|
<!-- Clonation dialog -->
|
||||||
|
<vn-dialog class="edit"
|
||||||
|
vn-id="clonationDialog"
|
||||||
|
on-accept="$ctrl.cloneSelectedRoadmaps()"
|
||||||
|
message="Select the estimated time of departure (ETD)">
|
||||||
|
<tpl-body>
|
||||||
|
<vn-horizontal>
|
||||||
|
<vn-date-picker
|
||||||
|
label="ETD"
|
||||||
|
ng-model="$ctrl.etd">
|
||||||
|
</vn-date-picker>
|
||||||
|
</vn-horizontal>
|
||||||
|
</tpl-body>
|
||||||
|
<tpl-buttons>
|
||||||
|
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
|
||||||
|
<button response="accept" translate>Clone</button>
|
||||||
|
</tpl-buttons>
|
||||||
|
</vn-dialog>
|
||||||
|
<vn-confirm
|
||||||
|
vn-id="deleteRoadmaps"
|
||||||
|
question="Are you sure you want to continue?"
|
||||||
|
message="Selected roadmaps will be removed"
|
||||||
|
on-accept="$ctrl.deleteRoadmaps()">
|
||||||
|
</vn-confirm>
|
|
@ -0,0 +1,62 @@
|
||||||
|
import ngModule from '../../module';
|
||||||
|
import Section from 'salix/components/section';
|
||||||
|
|
||||||
|
class Controller extends Section {
|
||||||
|
get checked() {
|
||||||
|
const roadmaps = this.$.model.data || [];
|
||||||
|
const checkedRoadmap = [];
|
||||||
|
for (let roadmap of roadmaps) {
|
||||||
|
if (roadmap.checked)
|
||||||
|
checkedRoadmap.push(roadmap);
|
||||||
|
}
|
||||||
|
|
||||||
|
return checkedRoadmap;
|
||||||
|
}
|
||||||
|
|
||||||
|
get totalChecked() {
|
||||||
|
return this.checked.length;
|
||||||
|
}
|
||||||
|
|
||||||
|
preview(roadmap) {
|
||||||
|
this.roadmapSelected = roadmap;
|
||||||
|
this.$.summary.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
openClonationDialog() {
|
||||||
|
this.$.clonationDialog.show();
|
||||||
|
this.etd = Date.vnNew();
|
||||||
|
}
|
||||||
|
|
||||||
|
cloneSelectedRoadmaps() {
|
||||||
|
try {
|
||||||
|
if (!this.etd)
|
||||||
|
throw new Error(`The date can't be empty`);
|
||||||
|
|
||||||
|
const roadmapsIds = [];
|
||||||
|
for (let roadmap of this.checked)
|
||||||
|
roadmapsIds.push(roadmap.id);
|
||||||
|
|
||||||
|
return this.$http.post('Roadmaps/clone', {ids: roadmapsIds, etd: this.etd}).then(() => {
|
||||||
|
this.$.model.refresh();
|
||||||
|
this.vnApp.showSuccess(this.$t('Data saved!'));
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
this.vnApp.showError(this.$t(e.message));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
deleteRoadmaps() {
|
||||||
|
console.log(this.checked);
|
||||||
|
|
||||||
|
for (const roadmap of this.checked) {
|
||||||
|
this.$http.delete(`Roadmaps/${roadmap.id}`)
|
||||||
|
.then(() => this.$.model.refresh())
|
||||||
|
.then(() => this.vnApp.showSuccess(this.$t('Roadmaps removed')));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ngModule.vnComponent('vnRoadmapIndex', {
|
||||||
|
template: require('./index.html'),
|
||||||
|
controller: Controller
|
||||||
|
});
|
|
@ -0,0 +1,3 @@
|
||||||
|
Delete roadmap(s): Eliminar troncal(es)
|
||||||
|
Selected roadmaps will be removed: Los troncales seleccionados serán eliminados
|
||||||
|
Roadmaps removed: Troncales eliminados
|
|
@ -0,0 +1,14 @@
|
||||||
|
Roadmaps: Troncales
|
||||||
|
Roadmap: Troncal
|
||||||
|
Driver name: Nombre conductor
|
||||||
|
Plate: Matrícula
|
||||||
|
Price: Precio
|
||||||
|
Observations: Observaciones
|
||||||
|
Clone selected roadmaps: Clonar troncales seleccionadas
|
||||||
|
Select the estimated time of departure (ETD): Seleccione la hora estimada de salida (ETD)
|
||||||
|
Create roadmap: Crear troncal
|
||||||
|
Tractor plate: Matrícula tractor
|
||||||
|
Trailer plate: Matrícula trailer
|
||||||
|
Carrier: Transportista
|
||||||
|
ETD date: Fecha ETD
|
||||||
|
ETD hour: Hora ETD
|
|
@ -0,0 +1,20 @@
|
||||||
|
<vn-crud-model
|
||||||
|
vn-id="model"
|
||||||
|
url="Roadmaps"
|
||||||
|
include="$ctrl.include"
|
||||||
|
auto-load="true"
|
||||||
|
limit="20">
|
||||||
|
</vn-crud-model>
|
||||||
|
<vn-portal slot="topbar">
|
||||||
|
<vn-searchbar
|
||||||
|
info="Search roadmap by id or trunk"
|
||||||
|
panel="vn-roadmap-search-panel"
|
||||||
|
model="model"
|
||||||
|
filter="$ctrl.filterParams"
|
||||||
|
expr-builder="$ctrl.exprBuilder(param, value)"
|
||||||
|
base-state="route.roadmap">
|
||||||
|
</vn-searchbar>
|
||||||
|
</vn-portal>
|
||||||
|
<ui-view>
|
||||||
|
<vn-roadmap-index></vn-roadmap-index>
|
||||||
|
</ui-view>
|
|
@ -0,0 +1,61 @@
|
||||||
|
import ngModule from '../../module';
|
||||||
|
import ModuleMain from 'salix/components/module-main';
|
||||||
|
|
||||||
|
export default class Roadmap extends ModuleMain {
|
||||||
|
constructor($element, $) {
|
||||||
|
super($element, $);
|
||||||
|
|
||||||
|
this.include = {
|
||||||
|
relation: 'supplier',
|
||||||
|
scope: {
|
||||||
|
fields: ['nickname']
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
$postLink() {
|
||||||
|
const from = Date.vnNew();
|
||||||
|
from.setHours(0, 0, 0, 0);
|
||||||
|
|
||||||
|
const to = Date.vnNew();
|
||||||
|
to.setHours(23, 59, 59, 999);
|
||||||
|
|
||||||
|
this.filterParams = {
|
||||||
|
from: from,
|
||||||
|
to: to
|
||||||
|
};
|
||||||
|
|
||||||
|
this.$.model.addFilter({where: {
|
||||||
|
and: [
|
||||||
|
{etd: {gte: from}},
|
||||||
|
{etd: {lte: to}}
|
||||||
|
]
|
||||||
|
}});
|
||||||
|
}
|
||||||
|
|
||||||
|
exprBuilder(param, value) {
|
||||||
|
switch (param) {
|
||||||
|
case 'search':
|
||||||
|
return /^\d+$/.test(value)
|
||||||
|
? {id: value}
|
||||||
|
: {name: {like: `%${value}%`}};
|
||||||
|
case 'from':
|
||||||
|
return {etd: {gte: value}};
|
||||||
|
case 'to':
|
||||||
|
return {etd: {lte: value}};
|
||||||
|
case 'supplierFk':
|
||||||
|
case 'price':
|
||||||
|
return {[param]: value};
|
||||||
|
case 'tractorPlate':
|
||||||
|
case 'trailerPlate':
|
||||||
|
case 'phone':
|
||||||
|
case 'driverName':
|
||||||
|
return {[param]: {like: `%${value}%`}};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ngModule.vnComponent('vnRoadmap', {
|
||||||
|
controller: Roadmap,
|
||||||
|
template: require('./index.html')
|
||||||
|
});
|
|
@ -0,0 +1 @@
|
||||||
|
Search roadmap by id or trunk: Buscar troncales por id o troncal
|
|
@ -0,0 +1,74 @@
|
||||||
|
<div class="search-panel">
|
||||||
|
<form id="manifold-form" ng-submit="$ctrl.onSearch()">
|
||||||
|
<vn-horizontal class="vn-px-lg vn-pt-lg">
|
||||||
|
<vn-textfield
|
||||||
|
vn-one
|
||||||
|
label="General search"
|
||||||
|
ng-model="filter.search"
|
||||||
|
info="Search routes by id"
|
||||||
|
vn-focus>
|
||||||
|
</vn-textfield>
|
||||||
|
</vn-horizontal>
|
||||||
|
<section class="vn-px-md">
|
||||||
|
<vn-horizontal class="manifold-panel vn-pa-md">
|
||||||
|
<vn-date-picker
|
||||||
|
vn-one
|
||||||
|
label="From"
|
||||||
|
ng-model="filter.from">
|
||||||
|
</vn-date-picker>
|
||||||
|
<vn-date-picker
|
||||||
|
vn-one
|
||||||
|
label="To"
|
||||||
|
ng-model="filter.to">
|
||||||
|
</vn-date-picker>
|
||||||
|
</vn-horizontal>
|
||||||
|
</section>
|
||||||
|
<vn-horizontal class="vn-px-lg">
|
||||||
|
<vn-textfield
|
||||||
|
vn-one
|
||||||
|
label="Tractor plate"
|
||||||
|
ng-model="filter.tractorPlate">
|
||||||
|
</vn-textfield>
|
||||||
|
<vn-textfield
|
||||||
|
vn-one
|
||||||
|
label="Trailer plate"
|
||||||
|
ng-model="filter.trailerPlate">
|
||||||
|
</vn-textfield>
|
||||||
|
</vn-horizontal>
|
||||||
|
<vn-horizontal class="vn-px-lg">
|
||||||
|
<vn-autocomplete
|
||||||
|
vn-one
|
||||||
|
ng-model="filter.supplierFk"
|
||||||
|
url="Suppliers"
|
||||||
|
show-field="nickname"
|
||||||
|
search-function="{or: [{id: $search}, {nickname: {like: '%'+ $search +'%'}}]}"
|
||||||
|
value-field="id"
|
||||||
|
order="nickname"
|
||||||
|
label="Carrier">
|
||||||
|
<tpl-item>
|
||||||
|
{{::id}} - {{::nickname}}
|
||||||
|
</tpl-item>
|
||||||
|
</vn-autocomplete>
|
||||||
|
<vn-input-number
|
||||||
|
vn-one
|
||||||
|
label="Price"
|
||||||
|
ng-model="filter.price">
|
||||||
|
</vn-input-number>
|
||||||
|
</vn-horizontal>
|
||||||
|
<vn-horizontal class="vn-px-lg">
|
||||||
|
<vn-textfield
|
||||||
|
vn-one
|
||||||
|
label="Driver name"
|
||||||
|
ng-model="filter.driverName">
|
||||||
|
</vn-textfield>
|
||||||
|
<vn-textfield
|
||||||
|
vn-one
|
||||||
|
label="Phone"
|
||||||
|
ng-model="filter.phone">
|
||||||
|
</vn-textfield>
|
||||||
|
</vn-horizontal>
|
||||||
|
<vn-horizontal class="vn-px-lg vn-pb-lg vn-mt-lg">
|
||||||
|
<vn-submit label="Search"></vn-submit>
|
||||||
|
</vn-horizontal>
|
||||||
|
</form>
|
||||||
|
</div>
|
|
@ -0,0 +1,7 @@
|
||||||
|
import ngModule from '../../module';
|
||||||
|
import SearchPanel from 'core/components/searchbar/search-panel';
|
||||||
|
|
||||||
|
ngModule.component('vnRoadmapSearchPanel', {
|
||||||
|
template: require('./index.html'),
|
||||||
|
controller: SearchPanel
|
||||||
|
});
|
|
@ -0,0 +1,71 @@
|
||||||
|
<vn-crud-model
|
||||||
|
vn-id="model"
|
||||||
|
url="ExpeditionTrucks"
|
||||||
|
where="{roadmapFk: $ctrl.$params.id}"
|
||||||
|
order="eta ASC"
|
||||||
|
data="$ctrl.expeditionTrucks"
|
||||||
|
auto-load="true">
|
||||||
|
</vn-crud-model>
|
||||||
|
<vn-watcher
|
||||||
|
vn-id="watcher"
|
||||||
|
data="$ctrl.expeditionTrucks"
|
||||||
|
form="form">
|
||||||
|
</vn-watcher>
|
||||||
|
<form class="vn-w-md" name="form" ng-submit="$ctrl.onSubmit()">
|
||||||
|
<vn-card class="vn-pa-lg">
|
||||||
|
<vn-horizontal ng-repeat="expeditionTruck in $ctrl.expeditionTrucks">
|
||||||
|
<vn-autocomplete vn-one
|
||||||
|
label="Warehouse"
|
||||||
|
ng-model="expeditionTruck.warehouseFk"
|
||||||
|
url="Warehouses"
|
||||||
|
show-field="name"
|
||||||
|
value-field="id"
|
||||||
|
vn-focus
|
||||||
|
rule>
|
||||||
|
</vn-autocomplete>
|
||||||
|
<vn-date-picker vn-one
|
||||||
|
label="ETA date"
|
||||||
|
ng-model="expeditionTruck.eta"
|
||||||
|
rule>
|
||||||
|
</vn-date-picker>
|
||||||
|
<vn-input-time
|
||||||
|
vn-one
|
||||||
|
label="ETA hour"
|
||||||
|
ng-model="expeditionTruck.eta">
|
||||||
|
</vn-input-time>
|
||||||
|
<vn-textArea
|
||||||
|
vn-one
|
||||||
|
label="Description"
|
||||||
|
ng-model="expeditionTruck.description"
|
||||||
|
rule>
|
||||||
|
</vn-textArea>
|
||||||
|
<vn-none>
|
||||||
|
<vn-icon-button
|
||||||
|
vn-tooltip="Remove stop"
|
||||||
|
icon="delete"
|
||||||
|
ng-click="model.remove($index)"
|
||||||
|
tabindex="-1">
|
||||||
|
</vn-icon-button>
|
||||||
|
</vn-none>
|
||||||
|
</vn-horizontal>
|
||||||
|
<vn-one>
|
||||||
|
<vn-icon-button
|
||||||
|
vn-bind="+"
|
||||||
|
vn-tooltip="Add stop"
|
||||||
|
icon="add_circle"
|
||||||
|
ng-click="$ctrl.add()">
|
||||||
|
</vn-icon-button>
|
||||||
|
</vn-one>
|
||||||
|
</vn-card>
|
||||||
|
<vn-button-bar>
|
||||||
|
<vn-submit
|
||||||
|
disabled="!watcher.dataChanged()"
|
||||||
|
label="Save">
|
||||||
|
</vn-submit>
|
||||||
|
</vn-button-bar>
|
||||||
|
</form>
|
||||||
|
<vn-confirm
|
||||||
|
vn-id="confirm"
|
||||||
|
question="Delete stop?"
|
||||||
|
on-accept="$ctrl.removeTicketFromRoute($index)">
|
||||||
|
</vn-confirm>
|
|
@ -0,0 +1,39 @@
|
||||||
|
import ngModule from '../../module';
|
||||||
|
import Section from 'salix/components/section';
|
||||||
|
|
||||||
|
export default class Controller extends Section {
|
||||||
|
add() {
|
||||||
|
const filter = {
|
||||||
|
fields: ['etd']
|
||||||
|
};
|
||||||
|
this.$http.get(`Roadmaps/${this.$params.id}`, {filter})
|
||||||
|
.then(res => {
|
||||||
|
this.roadmap = res.data;
|
||||||
|
|
||||||
|
const eta = new Date(this.roadmap.etd);
|
||||||
|
eta.setDate(eta.getDate() + 1);
|
||||||
|
|
||||||
|
this.$.model.insert({
|
||||||
|
roadmapFk: this.$params.id,
|
||||||
|
eta: eta
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
onSubmit() {
|
||||||
|
this.$.watcher.check();
|
||||||
|
this.$.model.save().then(() => {
|
||||||
|
this.$.watcher.notifySaved();
|
||||||
|
this.$.watcher.updateOriginalData();
|
||||||
|
this.$.model.refresh();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ngModule.component('vnRoadmapStops', {
|
||||||
|
template: require('./index.html'),
|
||||||
|
controller: Controller,
|
||||||
|
bindings: {
|
||||||
|
roadmap: '<'
|
||||||
|
}
|
||||||
|
});
|
|
@ -0,0 +1,4 @@
|
||||||
|
Remove stop: Eliminar parada
|
||||||
|
Add stop: Añadir parada
|
||||||
|
ETA date: Fecha ETA
|
||||||
|
ETA hour: Hora ETA
|
|
@ -0,0 +1,113 @@
|
||||||
|
<vn-card class="summary">
|
||||||
|
<h5>
|
||||||
|
<span>{{summary.id}} - {{summary.name}}</span>
|
||||||
|
</h5>
|
||||||
|
<vn-horizontal class="vn-pa-md">
|
||||||
|
<vn-one>
|
||||||
|
<vn-label-value label="Carrier">
|
||||||
|
<span ng-click="supplierDescriptor.show($event, summary.supplier.id)" class="link">
|
||||||
|
{{summary.supplier.nickname}}
|
||||||
|
</span>
|
||||||
|
</vn-label-value>
|
||||||
|
<vn-label-value
|
||||||
|
label="ETD"
|
||||||
|
value="{{summary.etd | date:'dd/MM/yyyy HH:mm'}}">
|
||||||
|
</vn-label-value>
|
||||||
|
<vn-label-value
|
||||||
|
label="Tractor plate"
|
||||||
|
value="{{summary.tractorPlate}}">
|
||||||
|
</vn-label-value>
|
||||||
|
<vn-label-value
|
||||||
|
label="Trailer plate"
|
||||||
|
value="{{summary.trailerPlate}}">
|
||||||
|
</vn-label-value>
|
||||||
|
</vn-one>
|
||||||
|
<vn-one>
|
||||||
|
<vn-label-value
|
||||||
|
label="Phone"
|
||||||
|
value="{{summary.phone}}">
|
||||||
|
</vn-label-value>
|
||||||
|
<vn-label-value
|
||||||
|
label="Worker"
|
||||||
|
value="{{summary.worker.firstName}} {{summary.worker.lastName}}">
|
||||||
|
</vn-label-value>
|
||||||
|
<vn-label-value
|
||||||
|
label="Observations"
|
||||||
|
value="{{summary.observations}}">
|
||||||
|
</vn-label-value>
|
||||||
|
</vn-one>
|
||||||
|
<vn-auto>
|
||||||
|
<h4>
|
||||||
|
<a
|
||||||
|
ui-sref="route.roadmap.card.stops({id:summary.id})"
|
||||||
|
target="_self">
|
||||||
|
<span translate vn-tooltip="Go to">Stops</span>
|
||||||
|
<vn-icon-button
|
||||||
|
vn-bind="+"
|
||||||
|
vn-tooltip="Add stop"
|
||||||
|
icon="add_circle"
|
||||||
|
vn-click-stop="addExpeditionTruck.show()">
|
||||||
|
</vn-icon-button>
|
||||||
|
</a>
|
||||||
|
</h4>
|
||||||
|
<vn-table model="model">
|
||||||
|
<vn-thead>
|
||||||
|
<vn-tr>
|
||||||
|
<vn-th>Wharehouse</vn-th>
|
||||||
|
<vn-th>ETA</vn-th>
|
||||||
|
</vn-tr>
|
||||||
|
</vn-thead>
|
||||||
|
<vn-tbody>
|
||||||
|
<vn-tr ng-repeat="expeditionTruck in summary.expeditionTruck">
|
||||||
|
<vn-td>{{expeditionTruck.warehouse.name}}</vn-td>
|
||||||
|
<vn-td expand>{{expeditionTruck.eta | date:'dd/MM/yyyy HH:mm'}}</vn-td>
|
||||||
|
</vn-tr>
|
||||||
|
</vn-tbody>
|
||||||
|
</vn-table>
|
||||||
|
</vn-auto>
|
||||||
|
</vn-horizontal>
|
||||||
|
</vn-card>
|
||||||
|
<vn-supplier-descriptor-popover
|
||||||
|
vn-id="supplierDescriptor">
|
||||||
|
</vn-supplier-descriptor-popover>
|
||||||
|
|
||||||
|
<vn-dialog
|
||||||
|
vn-id="addExpeditionTruck"
|
||||||
|
on-open="$ctrl.getETD()"
|
||||||
|
on-accept="$ctrl.onAddAccept()">
|
||||||
|
<tpl-body>
|
||||||
|
<vn-horizontal>
|
||||||
|
<vn-autocomplete
|
||||||
|
label="Warehouse"
|
||||||
|
ng-model="$ctrl.expeditionTruck.warehouseFk"
|
||||||
|
url="Warehouses"
|
||||||
|
show-field="name"
|
||||||
|
value-field="id"
|
||||||
|
vn-focus
|
||||||
|
rule>
|
||||||
|
</vn-autocomplete>
|
||||||
|
</vn-horizontal>
|
||||||
|
<vn-horizontal>
|
||||||
|
<vn-date-picker
|
||||||
|
label="ETA date"
|
||||||
|
ng-model="$ctrl.expeditionTruck.eta"
|
||||||
|
rule>
|
||||||
|
</vn-date-picker>
|
||||||
|
<vn-input-time
|
||||||
|
label="ETA hour"
|
||||||
|
ng-model="$ctrl.expeditionTruck.eta">
|
||||||
|
</vn-input-time>
|
||||||
|
</vn-horizontal>
|
||||||
|
<vn-horizontal>
|
||||||
|
<vn-textArea
|
||||||
|
label="Description"
|
||||||
|
ng-model="$ctrl.expeditionTruck.description"
|
||||||
|
rule>
|
||||||
|
</vn-textArea>
|
||||||
|
</vn-horizontal>
|
||||||
|
</tpl-body>
|
||||||
|
<tpl-buttons>
|
||||||
|
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
|
||||||
|
<button response="accept" translate>Confirm</button>
|
||||||
|
</tpl-buttons>
|
||||||
|
</vn-dialog>
|
|
@ -0,0 +1,68 @@
|
||||||
|
import ngModule from '../../module';
|
||||||
|
import Component from 'core/lib/component';
|
||||||
|
import './style.scss';
|
||||||
|
|
||||||
|
class Controller extends Component {
|
||||||
|
set roadmap(value) {
|
||||||
|
this._roadmap = value;
|
||||||
|
this.$.summary = null;
|
||||||
|
if (!value) return;
|
||||||
|
|
||||||
|
this.loadData();
|
||||||
|
}
|
||||||
|
|
||||||
|
get roadmap() {
|
||||||
|
return this._roadmap;
|
||||||
|
}
|
||||||
|
|
||||||
|
loadData() {
|
||||||
|
const filter = {
|
||||||
|
include: [
|
||||||
|
{relation: 'supplier'},
|
||||||
|
{relation: 'worker'},
|
||||||
|
{relation: 'expeditionTruck',
|
||||||
|
scope: {
|
||||||
|
include: [
|
||||||
|
{relation: 'warehouse'}
|
||||||
|
]
|
||||||
|
}}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
this.$http.get(`Roadmaps/${this.roadmap.id}`, {filter})
|
||||||
|
.then(res => this.$.summary = res.data);
|
||||||
|
}
|
||||||
|
|
||||||
|
getETD() {
|
||||||
|
const eta = new Date(this.roadmap.etd);
|
||||||
|
eta.setDate(eta.getDate() + 1);
|
||||||
|
|
||||||
|
this.expeditionTruck = {eta: eta};
|
||||||
|
}
|
||||||
|
|
||||||
|
onAddAccept() {
|
||||||
|
try {
|
||||||
|
const data = {
|
||||||
|
roadmapFk: this.roadmap.id,
|
||||||
|
warehouseFk: this.expeditionTruck.warehouseFk,
|
||||||
|
eta: this.expeditionTruck.eta,
|
||||||
|
description: this.expeditionTruck.description
|
||||||
|
};
|
||||||
|
|
||||||
|
this.$http.post(`ExpeditionTrucks`, data)
|
||||||
|
.then(() => {
|
||||||
|
this.loadData();
|
||||||
|
this.vnApp.showSuccess(this.$t('Data saved!'));
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
this.vnApp.showError(this.$t(e.message));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ngModule.component('vnRoadmapSummary', {
|
||||||
|
template: require('./index.html'),
|
||||||
|
controller: Controller,
|
||||||
|
bindings: {
|
||||||
|
roadmap: '<'
|
||||||
|
}
|
||||||
|
});
|
|
@ -0,0 +1,3 @@
|
||||||
|
Stops: Paradas
|
||||||
|
Wharehouse: Almacén
|
||||||
|
You must fill all the fields: Debes rellenar todos los campos
|
|
@ -0,0 +1,10 @@
|
||||||
|
@import "variables";
|
||||||
|
|
||||||
|
vn-roadmap-summary .summary {
|
||||||
|
a {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
height: 18.328px;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -7,12 +7,17 @@
|
||||||
"menus": {
|
"menus": {
|
||||||
"main": [
|
"main": [
|
||||||
{"state": "route.index", "icon": "icon-delivery"},
|
{"state": "route.index", "icon": "icon-delivery"},
|
||||||
{"state": "route.agencyTerm.index", "icon": "icon-agency-term"}
|
{"state": "route.agencyTerm.index", "icon": "icon-agency-term"},
|
||||||
|
{"state": "route.roadmap", "icon": "icon-trailer"}
|
||||||
],
|
],
|
||||||
"card": [
|
"card": [
|
||||||
{"state": "route.card.basicData", "icon": "settings"},
|
{"state": "route.card.basicData", "icon": "settings"},
|
||||||
{"state": "route.card.tickets", "icon": "icon-ticket"},
|
{"state": "route.card.tickets", "icon": "icon-ticket"},
|
||||||
{"state": "route.card.log", "icon": "history"}
|
{"state": "route.card.log", "icon": "history"}
|
||||||
|
],
|
||||||
|
"roadmap": [
|
||||||
|
{"state": "route.roadmap.card.basicData", "icon": "settings"},
|
||||||
|
{"state": "route.roadmap.card.stops", "icon": "icon-lines"}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"routes": [
|
"routes": [
|
||||||
|
@ -90,6 +95,46 @@
|
||||||
"route": "$ctrl.route"
|
"route": "$ctrl.route"
|
||||||
},
|
},
|
||||||
"acl": ["delivery"]
|
"acl": ["delivery"]
|
||||||
|
}, {
|
||||||
|
"url": "/roadmap?q",
|
||||||
|
"state": "route.roadmap",
|
||||||
|
"component": "vn-roadmap",
|
||||||
|
"description": "Roadmaps"
|
||||||
|
}, {
|
||||||
|
"url": "/create",
|
||||||
|
"state": "route.roadmap.create",
|
||||||
|
"component": "vn-roadmap-create",
|
||||||
|
"description": "Create roadmap"
|
||||||
|
},{
|
||||||
|
"url": "/:id",
|
||||||
|
"state": "route.roadmap.card",
|
||||||
|
"component": "vn-roadmap-card",
|
||||||
|
"abstract": true,
|
||||||
|
"description": "Detail"
|
||||||
|
},{
|
||||||
|
"url": "/summary",
|
||||||
|
"state": "route.roadmap.card.summary",
|
||||||
|
"component": "vn-roadmap-summary",
|
||||||
|
"description": "Summary",
|
||||||
|
"params": {
|
||||||
|
"roadmap": "$ctrl.roadmap"
|
||||||
|
}
|
||||||
|
},{
|
||||||
|
"url": "/basic-data",
|
||||||
|
"state": "route.roadmap.card.basicData",
|
||||||
|
"component": "vn-roadmap-basic-data",
|
||||||
|
"description": "Basic data",
|
||||||
|
"params": {
|
||||||
|
"roadmap": "$ctrl.roadmap"
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
"url": "/stops",
|
||||||
|
"state": "route.roadmap.card.stops",
|
||||||
|
"component": "vn-roadmap-stops",
|
||||||
|
"description": "Stops",
|
||||||
|
"params": {
|
||||||
|
"route": "$ctrl.roadmap"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
ng-click="deleteShelving.show()"
|
ng-click="deleteShelving.show()"
|
||||||
name="deleteShelving"
|
name="deleteShelving"
|
||||||
translate>
|
translate>
|
||||||
Delete
|
Delete shelving
|
||||||
</vn-item>
|
</vn-item>
|
||||||
</slot-menu>
|
</slot-menu>
|
||||||
<slot-body>
|
<slot-body>
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
</slot-body>
|
</slot-body>
|
||||||
</vn-descriptor-content>
|
</vn-descriptor-content>
|
||||||
<vn-confirm
|
<vn-confirm
|
||||||
vn-id="delete-shelving"
|
vn-id="deleteShelving"
|
||||||
on-accept="$ctrl.onDelete()"
|
on-accept="$ctrl.onDelete()"
|
||||||
question="Are you sure you want to continue?"
|
question="Are you sure you want to continue?"
|
||||||
message="Shelving will be removed">
|
message="Shelving will be removed">
|
||||||
|
@ -40,6 +40,6 @@
|
||||||
<vn-popup vn-id="summary">
|
<vn-popup vn-id="summary">
|
||||||
<vn-shelving-summary shelving="$ctrl.shelving"></vn-shelving-summary>
|
<vn-shelving-summary shelving="$ctrl.shelving"></vn-shelving-summary>
|
||||||
</vn-popup>
|
</vn-popup>
|
||||||
<vn-worker-descriptor-popover
|
<vn-worker-descriptor-popover
|
||||||
vn-id="workerDescriptor">
|
vn-id="workerDescriptor">
|
||||||
</vn-worker-descriptor-popover>
|
</vn-worker-descriptor-popover>
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
Delete shelving: Eliminar carro
|
||||||
|
Shelving will be removed: El carro será eliminado
|
||||||
|
Shelving removed: Carro eliminado
|
|
@ -270,7 +270,7 @@ class Controller extends Section {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.$http.post(`Tickets/invoiceTickets`, params)
|
return this.$http.post(`Tickets/invoiceTickets`, {ticketsIds: [this.id]})
|
||||||
.then(() => this.reload())
|
.then(() => this.reload())
|
||||||
.then(() => this.vnApp.showSuccess(this.$t('Ticket invoiced')));
|
.then(() => this.vnApp.showSuccess(this.$t('Ticket invoiced')));
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
</vn-textfield>
|
</vn-textfield>
|
||||||
<vn-textfield
|
<vn-textfield
|
||||||
vn-one
|
vn-one
|
||||||
label="Code"
|
label="Worker code"
|
||||||
ng-model="$ctrl.worker.code"
|
ng-model="$ctrl.worker.code"
|
||||||
maxLength="3"
|
maxLength="3"
|
||||||
on-change="$ctrl.worker.code = $ctrl.worker.code.toUpperCase()"
|
on-change="$ctrl.worker.code = $ctrl.worker.code.toUpperCase()"
|
||||||
|
|
|
@ -2,7 +2,7 @@ Firstname: Nombre
|
||||||
Lastname: Apellidos
|
Lastname: Apellidos
|
||||||
Fi: DNI/NIF/NIE
|
Fi: DNI/NIF/NIE
|
||||||
Birth: Fecha de nacimiento
|
Birth: Fecha de nacimiento
|
||||||
Code: Código de trabajador
|
Worker code: Código de trabajador
|
||||||
Province: Provincia
|
Province: Provincia
|
||||||
City: Población
|
City: Población
|
||||||
ProfileType: Tipo de perfil
|
ProfileType: Tipo de perfil
|
||||||
|
|
Loading…
Reference in New Issue