Merge branch '5858-fiscalData-validations' of https://gitea.verdnatura.es/verdnatura/salix into 5858-fiscalData-validations
gitea/salix/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Carlos Satorres 2024-02-28 14:05:45 +01:00
commit de9787642d
5 changed files with 33 additions and 5 deletions

View File

@ -387,7 +387,7 @@ INSERT INTO `vn`.`client`(`id`,`name`,`fi`,`socialName`,`contact`,`street`,`city
(1112, 'Trash', NULL, 'GARBAGE MAN', 'Unknown name', 'NEW YORK CITY, UNDERGROUND', 'Gotham', 46460, 1111111111, 222222222, 1, NULL, NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 0, 1, 0, NULL, 1, 0, NULL, 0, 1, 'others','loses');
INSERT INTO `vn`.`client`(`id`, `name`, `fi`, `socialName`, `contact`, `street`, `city`, `postcode`, `isRelevant`, `email`, `iban`,`dueDay`,`accountingAccount`, `isEqualizated`, `provinceFk`, `hasToInvoice`, `credit`, `countryFk`, `isActive`, `gestdocFk`, `quality`, `payMethodFk`,`created`, `isTaxDataChecked`)
SELECT id, name, CONCAT(RPAD(CONCAT(id,9),8,id),'A'), CONCAT(name, 'Social'), CONCAT(name, 'Contact'), CONCAT(name, 'Street'), 'GOTHAM', 46460, 1, CONCAT(name,'@mydomain.com'), NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1,NULL, 10, 5, util.VN_CURDATE(), 1
SELECT id, name, CONCAT(RPAD(CONCAT(id,9),8,id),'A'), UPPER(CONCAT(name, 'Social')), CONCAT(name, 'Contact'), CONCAT(name, 'Street'), 'GOTHAM', 46460, 1, CONCAT(name,'@mydomain.com'), NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1,NULL, 10, 5, util.VN_CURDATE(), 1
FROM `account`.`role` `r`
WHERE `r`.`hasLogin` = 1;

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`
MODIFY COLUMN supplierFk int(10) unsigned NOT NULL,
ADD editorFk INT UNSIGNED NULL,
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;
ALTER TABLE `supplierLog`
ALTER TABLE `vn`.`supplierLog`
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,
reference: ticket.id,
contentType: 'application/pdf',
hasFile: true
hasFile: false
};
const dms = await models.Dms.createFromStream(data, 'pdf', pdfStream, myOptions);

View File

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