refs #6915 test into dev #2093

Merged
juan merged 23 commits from test into dev 2024-02-23 18:05:46 +00:00
3 changed files with 14 additions and 10 deletions
Showing only changes of commit 065dd0581d - Show all commits

View File

@ -32,6 +32,7 @@
<mrw:Referencia><%= expeditionData.expeditionDataId %></mrw:Referencia>
<mrw:CodigoServicio><%= expeditionData.serviceType %></mrw:CodigoServicio>
<mrw:NumeroBultos>1</mrw:NumeroBultos>
<mrw:EntregaSabado><%= expeditionData.weekDays %></mrw:EntregaSabado>
<mrw:Peso><%= expeditionData.kg %></mrw:Peso>
<mrw:Reembolso/>
<mrw:ImporteReembolso/>

View File

@ -40,15 +40,14 @@ module.exports = Self => {
c.phone,
DATE_FORMAT(e.created, '%d/%m/%Y') created,
e.id expeditionId,
LPAD(ms.serviceType, 4 ,'0') serviceType,
pa.height,
pa.depth,
pa.width
LPAD(IF(mw.params IS NULL, ms.serviceType, mw.serviceType), 4 ,'0') serviceType,
IFNULL(mw.weekdays, "N") weekDays
FROM expedition e
JOIN packaging pa ON pa.id = e.packagingFk
JOIN ticket t ON e.ticketFk = t.id
JOIN agencyMode am ON am.id = t.agencyModeFk
JOIN mrwService ms ON ms.agencyModeCodeFk = am.code
LEFT JOIN mrwServiceWeekday mw ON mw.params = DATE_FORMAT(e.created, '%a')
JOIN client c ON t.clientFk = c.id
JOIN address a ON t.addressFk = a.id
JOIN province p ON a.provinceFk = p.id
@ -74,8 +73,8 @@ module.exports = Self => {
'Content-Type': 'text/xml; charset=utf-8'
}
});
const getLableXmlDoc = parser.parseFromString(getLabelResponse.data, 'text/xml');
const base64Binary = getLableXmlDoc.getElementsByTagName('EtiquetaFile')[0]?.textContent;
const getLabelXmlDoc = parser.parseFromString(getLabelResponse.data, 'text/xml');
const base64Binary = getLabelXmlDoc.getElementsByTagName('EtiquetaFile')[0]?.textContent;
const expedition = await models.Expedition.findById(expeditionFk);
await expedition.updateAttribute('externalId', shipmentId);

View File

@ -13,6 +13,8 @@ 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');
@ -27,12 +29,14 @@ INSERT INTO `vn`.`agency` (`name`,`warehouseFk`,`warehouseAliasFk`,`isOwn`,`isAn
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);
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
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,33,71,'2001-01-01 01:00:00.000',1,18,'94','',3,0,71,100);
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.mrwService (agencyModeCodeFk, clientType, serviceType, kg) VALUES('MRW', 9731, 205, 10);
INSERT INTO vn.mrwServiceWeekday (agencyModeCodeFk, weekdays, serviceType, params) VALUES('mrwEcom', 'sat', 800, 'EntregaSabado=S');