Fixed the suppliers not appearing
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Pau 2022-10-18 12:29:04 +02:00
parent 047076f189
commit a204c6e2b0
8 changed files with 8 additions and 15 deletions

View File

@ -0,0 +1,2 @@
INSERT INTO vn.payDem (id,payDem)
VALUES (7,'0');

View File

@ -0,0 +1 @@
ALTER TABLE vn.supplier MODIFY COLUMN supplierActivityFk varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL NULL;

View File

@ -1,9 +0,0 @@
ALTER TABLE `vn`.`supplier` MODIFY COLUMN payMethodFk tinyint(3) unsigned DEFAULT NULL NULL;
/* ------------------------------------------------------------------------------------------- */
ALTER TABLE `vn`.`supplier` MODIFY COLUMN supplierActivityFk varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL NULL;
/* ------------------------------------------------------------------------------------------- */
ALTER TABLE `vn`.`supplierLog` MODIFY COLUMN userFk int(10) unsigned NULL;

View File

@ -0,0 +1 @@
ALTER TABLE vn.supplier MODIFY COLUMN payMethodFk tinyint(3) unsigned NULL;

View File

@ -0,0 +1 @@
ALTER TABLE vn.supplier MODIFY COLUMN supplierActivityFk varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT 'flowersPlants' NULL;

View File

@ -95,8 +95,8 @@ module.exports = Self => {
pm.name AS payMethod, pm.name AS payMethod,
pd.payDem AS payDem pd.payDem AS payDem
FROM vn.supplier s FROM vn.supplier s
JOIN vn.payMethod pm ON pm.id = s.payMethodFk LEFT JOIN vn.payMethod pm ON pm.id = s.payMethodFk
JOIN vn.payDem pd ON pd.id = s.payDemFk` LEFT JOIN vn.payDem pd ON pd.id = s.payDemFk`
); );
stmt.merge(conn.makeSuffix(filter)); stmt.merge(conn.makeSuffix(filter));

View File

@ -24,7 +24,6 @@ module.exports = Self => {
if (typeof(params) == 'string') if (typeof(params) == 'string')
params = JSON.parse(params); params = JSON.parse(params);
params.payDemFk = 1;
params.nickname = params.name; params.nickname = params.name;
if (!myOptions.transaction) { if (!myOptions.transaction) {
@ -42,7 +41,6 @@ module.exports = Self => {
}; };
} catch (e) { } catch (e) {
if (tx) await tx.rollback(); if (tx) await tx.rollback();
return params;
} }
}; };
}; };

View File

@ -11,7 +11,6 @@ describe('Supplier newSupplier()', () => {
result = result.supplier; result = result.supplier;
expect(result.name).toEqual('TestSupplier-1'); expect(result.name).toEqual('TestSupplier-1');
expect(result.payDemFk).toEqual(1);
expect(result.id).toEqual(443); expect(result.id).toEqual(443);
const createdSupplier = await app.models.Supplier.findById(result.id); const createdSupplier = await app.models.Supplier.findById(result.id);
@ -34,7 +33,7 @@ describe('Supplier newSupplier()', () => {
expect(createdSupplier.provinceFk).toBeNull(); expect(createdSupplier.provinceFk).toBeNull();
expect(createdSupplier.postCode).toBeNull(); expect(createdSupplier.postCode).toBeNull();
expect(createdSupplier.payMethodFk).toBeNull(); expect(createdSupplier.payMethodFk).toBeNull();
expect(createdSupplier.payDemFk).toEqual(1); expect(createdSupplier.payDemFk).toEqual(7);
expect(createdSupplier.payDay).toBeNull(); expect(createdSupplier.payDay).toBeNull();
expect(createdSupplier.nickname).toEqual(result.name); expect(createdSupplier.nickname).toEqual(result.name);
expect(createdSupplier.workerFk).toBeNull(); expect(createdSupplier.workerFk).toBeNull();