Compare commits
18 Commits
dev
...
6372-Expen
Author | SHA1 | Date |
---|---|---|
David Domenech | 2a224e2823 | |
Pablo Natek | ae078f66c1 | |
David Domenech | 0fed15434d | |
Alex Moreno | 9f6bc8971c | |
Alex Moreno | 201e70175d | |
Alex Moreno | 607b908814 | |
David Domenech | a797ea7b1b | |
Alex Moreno | 2b19004783 | |
David Domenech | ba167d52ef | |
David Domenech | f2b1418419 | |
Alex Moreno | a0593804ab | |
Carlos Satorres | 4c7d7f2ab7 | |
Carlos Satorres | fac7071bae | |
Carlos Satorres | 8a2cff5308 | |
David Domenech | c348900c80 | |
David Domenech | d9119f9ab7 | |
David Domenech | 13249fae08 | |
Carlos Satorres | b6086e74c1 |
|
@ -3068,3 +3068,6 @@ INSERT INTO `vn`.`cmr` (id,truckPlate,observations,senderInstruccions,paymentIns
|
|||
VALUES (1,'123456A','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet',442,1,2,1,'Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet'),
|
||||
(2,'123456N','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet',69,3,4,2,'Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet'),
|
||||
(3,'123456B','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet',567,5,6,69,'Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet');
|
||||
|
||||
UPDATE vn.department
|
||||
SET workerFk = null;
|
||||
|
|
|
@ -1,24 +1,32 @@
|
|||
ALTER TABLE IF EXISTS vn2008.gastos_resumen DROP FOREIGN KEY IF EXISTS gastos_resumen_expense_FK;
|
||||
ALTER TABLE IF EXISTS `vn2008`.`gastos_resumen` RENAME `vn`.`expenseManual`;
|
||||
DELETE FROM vn2008.gastos_resumen
|
||||
WHERE Id_Gasto IN (
|
||||
SELECT DISTINCT g.Id_Gasto
|
||||
FROM vn2008.gastos_resumen g
|
||||
LEFT JOIN expense e ON e.id = g.Id_Gasto COLLATE utf8mb3_general_ci
|
||||
WHERE e.id IS NULL
|
||||
);
|
||||
|
||||
ALTER TABLE IF EXISTS `vn`.`expenseManual`
|
||||
ALTER TABLE `vn2008`.`gastos_resumen` DROP FOREIGN KEY gastos_resumen_expense_FK;
|
||||
ALTER TABLE IF EXISTS `vn2008`.`gastos_resumen` RENAME `vn`.`expenseManual`;
|
||||
ALTER TABLE `vn`.`expenseManual`
|
||||
CHANGE COLUMN IF EXISTS `Id_Gasto` `expenseFk` varchar(10) NOT NULL,
|
||||
CHANGE COLUMN IF EXISTS `importe` `amount` decimal(10,2) DEFAULT NULL,
|
||||
CHANGE COLUMN IF EXISTS `empresa_id` `companyFk` int(11) NOT NULL;
|
||||
|
||||
ALTER TABLE IF EXISTS vn.expenseManual COLLATE=utf8mb3_general_ci;
|
||||
ALTER TABLE vn.expenseManual MODIFY COLUMN IF EXISTS expenseFk varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL;
|
||||
|
||||
ALTER TABLE IF EXISTS vn.expenseManual MODIFY COLUMN IF EXISTS expenseFk varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL;
|
||||
|
||||
ALTER TABLE IF EXISTS vn.expenseManual ADD CONSTRAINT expenseManual_expense_FK FOREIGN KEY IF NOT EXISTS (expenseFk) REFERENCES vn.expense(id) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
ALTER TABLE IF EXISTS vn.expenseManual MODIFY COLUMN IF EXISTS companyFk int(10) unsigned NOT NULL;
|
||||
ALTER TABLE vn.expenseManual DROP PRIMARY KEY;
|
||||
|
||||
ALTER TABLE vn.expenseManual MODIFY COLUMN companyFk int(10) unsigned NULL;
|
||||
|
||||
ALTER TABLE vn.expenseManual ADD CONSTRAINT expenseManual_expense_FK FOREIGN KEY IF NOT EXISTS (expenseFk) REFERENCES vn.expense(id) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
UPDATE vn.expenseManual
|
||||
SET companyFK= NULL
|
||||
WHERE companyFk= 0;
|
||||
|
||||
ALTER TABLE IF EXISTS vn.expenseManual ADD CONSTRAINT expenseManual_company_FK FOREIGN KEY IF NOT EXISTS (companyFk) REFERENCES vn.company(id) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
ALTER TABLE vn.expenseManual ADD CONSTRAINT expenseManual_company_FK FOREIGN KEY IF NOT EXISTS (companyFk) REFERENCES vn.company(id) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
ALTER TABLE vn.expenseManual ADD COLUMN id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY FIRST;
|
||||
|
||||
ALTER TABLE vn.expenseManual ADD CONSTRAINT expenseManual_unique UNIQUE KEY IF NOT EXISTS (expenseFk,`year`,`month`,companyFk);
|
|
@ -1,8 +1,12 @@
|
|||
DROP TRIGGER IF EXISTS `vn2008`.`movement_label_afterUpdate`;
|
||||
|
||||
ALTER TABLE vn2008.movement_label DROP FOREIGN KEY movement_label_ibfk_1;
|
||||
|
||||
DROP VIEW IF EXISTS `vn`.`saleLabel`;
|
||||
|
||||
ALTER TABLE IF EXISTS `vn2008`.`movement_label` RENAME `vn`.`saleLabel`;
|
||||
|
||||
ALTER TABLE IF EXISTS `vn`.`saleLabel`
|
||||
CHANGE COLUMN IF EXISTS `Id_movimiento` `saleFk` int(11) NOT NULL;
|
||||
|
||||
ALTER TABLE vn.saleLabel ADD CONSTRAINT saleLabel_sale_FK FOREIGN KEY (saleFk) REFERENCES vn.sale(id) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
|
|
@ -139,9 +139,12 @@ describe('Worker new', () => {
|
|||
});
|
||||
|
||||
it('should create a new worker', async() => {
|
||||
const newWorker = await models.Worker.new({args: defaultWorker, req});
|
||||
|
||||
await removeWorker(newWorker.id);
|
||||
let newWorker;
|
||||
try {
|
||||
newWorker = await models.Worker.new({args: defaultWorker, req});
|
||||
} finally {
|
||||
await removeWorker(newWorker.id);
|
||||
}
|
||||
|
||||
expect(newWorker.id).toBeDefined();
|
||||
});
|
||||
|
@ -173,9 +176,12 @@ describe('Worker new', () => {
|
|||
}),
|
||||
req
|
||||
};
|
||||
const newWorker = await models.Worker.new(newWorkerData);
|
||||
|
||||
await models.Worker.destroyById(newWorker.id);
|
||||
let newWorker;
|
||||
try {
|
||||
newWorker = await models.Worker.new(newWorkerData);
|
||||
} finally {
|
||||
await models.Worker.destroyById(newWorker.id);
|
||||
}
|
||||
|
||||
expect(newWorker.id).toEqual(bruceWayneId);
|
||||
});
|
||||
|
|
|
@ -7,7 +7,8 @@ SELECT
|
|||
s.discount,
|
||||
s.itemFk,
|
||||
s.concept,
|
||||
tc.code vatType
|
||||
tc.code vatType,
|
||||
it.isPackaging
|
||||
FROM vn.invoiceOut io
|
||||
JOIN vn.ticket t ON t.refFk = io.ref
|
||||
JOIN vn.supplier su ON su.id = io.companyFk
|
||||
|
@ -34,9 +35,10 @@ SELECT
|
|||
ts.quantity,
|
||||
ts.price,
|
||||
0 discount,
|
||||
'',
|
||||
ts.description concept,
|
||||
tc.code vatType
|
||||
NULL,
|
||||
ts.description,
|
||||
tc.code,
|
||||
NULL
|
||||
FROM vn.invoiceOut io
|
||||
JOIN vn.ticket t ON t.refFk = io.ref
|
||||
JOIN vn.ticketService ts ON ts.ticketFk = t.id
|
||||
|
@ -46,3 +48,4 @@ SELECT
|
|||
JOIN vn.supplierAccount sa ON sa.id = co.supplierAccountFk
|
||||
JOIN vn.taxClass tc ON tc.id = ts.taxClassFk
|
||||
WHERE t.refFk = ?
|
||||
ORDER BY (isPackaging), concept, itemFk
|
||||
|
|
Loading…
Reference in New Issue