7199-devToTest_2316 #2287

Merged
alexm merged 169 commits from 7199-devToTest_2316 into test 2024-04-11 06:25:23 +00:00
4 changed files with 32 additions and 4 deletions
Showing only changes of commit 12fbae83c3 - Show all commits

View File

@ -1,9 +1,25 @@
DELETE FROM vn.supplierDms
WHERE dmsFk IN (
SELECT sd.dmsFk
FROM vn.supplierDms sd
LEFT JOIN vn.dms d ON d.id = sd.dmsFk
WHERE d.id IS NULL
);
DELETE FROM vn.supplierDms
WHERE supplierFk IN (
SELECT sd.supplierFk
FROM vn.supplierDms sd
LEFT JOIN vn.supplier s ON s.id = sd.supplierFk
WHERE s.id IS NULL
);
ALTER TABLE `vn`.`supplierDms` ALTER TABLE `vn`.`supplierDms`
MODIFY COLUMN supplierFk int(10) unsigned NOT NULL, MODIFY COLUMN supplierFk int(10) unsigned NOT NULL,
ADD editorFk INT UNSIGNED NULL, ADD editorFk INT UNSIGNED NULL,
ADD CONSTRAINT user_Fk FOREIGN KEY (editorFk) REFERENCES account.`user`(id), ADD CONSTRAINT user_Fk FOREIGN KEY (editorFk) REFERENCES account.`user`(id),
ADD CONSTRAINT dms_FK FOREIGN KEY (dmsFk) REFERENCES vn.dms(id) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT dms_Fk FOREIGN KEY (dmsFk) REFERENCES vn.dms(id) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT supplier_Fk FOREIGN KEY (supplierFk) REFERENCES vn.supplier(id) ON UPDATE CASCADE; ADD CONSTRAINT supplier_Fk FOREIGN KEY (supplierFk) REFERENCES vn.supplier(id) ON UPDATE CASCADE;
ALTER TABLE `supplierLog` ALTER TABLE `vn`.`supplierLog`
MODIFY COLUMN `changedModel` ENUM('Supplier','SupplierAddress','SupplierAccount','SupplierContact','SupplierDms') NOT NULL DEFAULT 'Supplier'; MODIFY COLUMN `changedModel` ENUM('Supplier','SupplierAddress','SupplierAccount','SupplierContact','SupplierDms') NOT NULL DEFAULT 'Supplier';

View File

@ -0,0 +1,12 @@
ALTER TABLE vn.country
MODIFY COLUMN code varchar(2) NOT NULL;
ALTER TABLE vn.country
ADD CONSTRAINT country_unique UNIQUE KEY (code);
ALTER TABLE vn.transitoryDuaUnified
ADD countryCodeFk varchar(2) DEFAULT 'EC' NOT NULL;
ALTER TABLE vn.transitoryDuaUnified
ADD CONSTRAINT transitoryDuaUnified_country_FK FOREIGN KEY (countryCodeFk)
REFERENCES vn.country(code);

View File

@ -63,7 +63,7 @@ module.exports = Self => {
warehouseFk: ticket.warehouseFk, warehouseFk: ticket.warehouseFk,
reference: ticket.id, reference: ticket.id,
contentType: 'application/pdf', contentType: 'application/pdf',
hasFile: true hasFile: false
}; };
const dms = await models.Dms.createFromStream(data, 'pdf', pdfStream, myOptions); const dms = await models.Dms.createFromStream(data, 'pdf', pdfStream, myOptions);

View File

@ -80,7 +80,7 @@ module.exports = Self => {
dmsTypeId: dmsTypeTicket.id, dmsTypeId: dmsTypeTicket.id,
reference: ticket.id, reference: ticket.id,
description: `Firma del cliente - Ruta ${ticket.route().id}`, description: `Firma del cliente - Ruta ${ticket.route().id}`,
hasFile: true hasFile: false
}; };
dms = await models.Dms.uploadFile(ctxUploadFile, myOptions); dms = await models.Dms.uploadFile(ctxUploadFile, myOptions);
// Si se ha subido ya la firma, no se vuelve a subir, ya que si no // Si se ha subido ya la firma, no se vuelve a subir, ya que si no