fix: refs #7404 round data and fix specs
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Pablo Natek 2024-09-23 10:14:09 +02:00
parent 459f6601b7
commit 80985fbd56
2 changed files with 6 additions and 6 deletions

View File

@ -24,10 +24,10 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`stockBought_calcula
INSERT INTO stockBought(workerFk, bought, dated) INSERT INTO stockBought(workerFk, bought, dated)
SELECT it.workerFk, SELECT it.workerFk,
SUM( ROUND(SUM(
(ti.quantity / b.packing) * (ti.quantity / b.packing) *
buy_getVolume(b.id) buy_getVolume(b.id)
) / vc.palletM3 / 1000000 bought, ) / vc.palletM3 / 1000000, 1) bought,
vDated vDated
FROM itemType it FROM itemType it
JOIN item i ON i.typeFk = it.id JOIN item i ON i.typeFk = it.id

View File

@ -13,7 +13,7 @@ describe('item lastEntriesFilter()', () => {
const filter = {where: {itemFk: 1, landed: {between: [minDate, maxDate]}}}; const filter = {where: {itemFk: 1, landed: {between: [minDate, maxDate]}}};
const result = await models.Item.lastEntriesFilter(filter, options); const result = await models.Item.lastEntriesFilter(filter, options);
expect(result.length).toEqual(1); expect(result.length).toEqual(2);
await tx.rollback(); await tx.rollback();
} catch (e) { } catch (e) {
@ -37,7 +37,7 @@ describe('item lastEntriesFilter()', () => {
const filter = {where: {itemFk: 1, landed: {between: [minDate, maxDate]}}}; const filter = {where: {itemFk: 1, landed: {between: [minDate, maxDate]}}};
const result = await models.Item.lastEntriesFilter(filter, options); const result = await models.Item.lastEntriesFilter(filter, options);
expect(result.length).toEqual(5); expect(result.length).toEqual(6);
await tx.rollback(); await tx.rollback();
} catch (e) { } catch (e) {