CREATE TABLE IF NOT EXISTS `vn`.`mrwConfig` (
	`id` INT auto_increment NULL,
	`url` varchar(100) NULL,
	`user` varchar(100) NULL,
	`password` varchar(100) NULL,
	`franchiseCode` varchar(100) NULL,
	`subscriberCode` varchar(100) NULL,
	CONSTRAINT mrwConfig_pk PRIMARY KEY (id)
)
ENGINE=InnoDB
DEFAULT CHARSET=utf8mb3
COLLATE=utf8mb3_unicode_ci;

ALTER TABLE `vn`.`packingSite` ADD `hasNewLabelMrwMethod` BOOL NULL;

INSERT INTO vn.mrwService (agencyModeCodeFk, clientType, serviceType, kg) VALUES('mrw', 9731, 205, 10);

INSERT INTO `vn`.`mrwConfig` (`url`, `user`, `password`, `franchiseCode`, `subscriberCode`)
	VALUES ('https://sagec-test.mrw.es/MRWEnvio.asmx', '04301SGVERDNATURA', 'Verdnatura@4301V', '04301', '009731');

INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) 
	VALUES('MrwConfig', 'cancelShipment', 'WRITE', 'ALLOW', 'ROLE', 'employee');

INSERT INTO `salix`.`ACL` (`model`,`property`,`accessType`,`permission`,`principalType`,`principalId`)
	VALUES ('MrwConfig','createShipment','WRITE','ALLOW','ROLE','employee');


INSERT INTO `vn`.`agency` (`name`,`warehouseFk`,`warehouseAliasFk`,`isOwn`,`isAnyVolumeAllowed`)
	VALUES ('MRW',1,1,0,0);

INSERT INTO `vn`.`agencyMode` (`id`, `name`, `description`, `deliveryMethodFk`, `m3`, `web`, `agencyFk`, `inflation`, `isVolumetric`, `reportMail`, `showAgencyName`, `isActive`, `isExternalAgency`, `flag`, `code`, `isRiskFree`, `hasWeightVolumetric`)
	VALUES(25, 'MRW', NULL, NULL, 0.0, 0, 11, 0.00, 0, NULL, 1, 1, 0, NULL, 'MRW', 0, 0),
		(26, 'mrwEcom', NULL, NULL, 0.0, 0, 11, 0.00, 0, NULL, 1, 1, 0, NULL, 'mrwEcom', 0, 0);

INSERT INTO `vn`.`ticket` (`id`, `clientFk`, `warehouseFk`, `shipped`, `nickname`, `refFk`, `addressFk`, `workerFk`, `observations`, `isSigned`, `isLabeled`, `isPrinted`, `packages`, `location`, `hour`, `created`, `isBlocked`, `solution`, `routeFk`, `priority`, `hasPriority`, `companyFk`, `agencyModeFk`, `landed`, `isBoxed`, `isDeleted`, `zoneFk`, `zonePrice`, `zoneBonus`, `totalWithVat`, `totalWithoutVat`, `weight`, `clonedFrom`, `cmrFk`, `editorFk`)
	VALUES(44, 1101, 1, '2001-01-01 00:00:00.000', 'MRW', NULL, 1, NULL, NULL, 0, 0, 0, 1, NULL, 0, '2001-01-01 00:00:00.000', 1, NULL, 6, NULL, 1, 442, 25, '2001-01-02', 0, 0, 3, 5.00, 1.00, 8.88, 8.07, NULL, NULL, NULL, 100);

INSERT INTO vn.expedition (agencyModeFk,ticketFk,freightItemFk,created,counter,workerFk,packagingFk,hostFk,stateTypeFk,hasNewRoute,isBox,editorFk)
	VALUES (25,44,71, CURDATE(),1,18,'94','',3,0,71,100);

INSERT INTO vn.mrwService (agencyModeCodeFk, clientType, serviceType, kg) VALUES('MRW', 9731, 205, 10);
INSERT INTO vn.mrwServiceWeekday (agencyModeCodeFk, weekdays, serviceType, params) VALUES('mrwEcom', 'sat', 800, 'EntregaSabado=S');