This commit is contained in:
parent
459f6601b7
commit
80985fbd56
|
@ -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
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue