8093-devToTest_2442_3 #3100
|
@ -185,6 +185,7 @@ INSERT INTO `vn`.`warehouse`(`id`, `name`, `code`, `isComparative`, `isInventory
|
||||||
(3, 'Warehouse Three', NULL, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0),
|
(3, 'Warehouse Three', NULL, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0),
|
||||||
(4, 'Warehouse Four', NULL, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1),
|
(4, 'Warehouse Four', NULL, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1),
|
||||||
(5, 'Warehouse Five', NULL, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0),
|
(5, 'Warehouse Five', NULL, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0),
|
||||||
|
(6, 'Warehouse six', 'vnh', 1, 1, 1, 1, 0, 0, 1, 1, 0, 0),
|
||||||
(13, 'Inventory', 'inv', 1, 1, 1, 0, 0, 0, 1, 0, 0, 0),
|
(13, 'Inventory', 'inv', 1, 1, 1, 0, 0, 0, 1, 0, 0, 0),
|
||||||
(60, 'Algemesi', NULL, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0);
|
(60, 'Algemesi', NULL, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0);
|
||||||
|
|
||||||
|
@ -3941,6 +3942,11 @@ INSERT INTO vn.medicalReview
|
||||||
(id, workerFk, centerFk, `date`, `time`, isFit, amount, invoice, remark)
|
(id, workerFk, centerFk, `date`, `time`, isFit, amount, invoice, remark)
|
||||||
VALUES(3, 9, 2, '2000-01-01', '8:00', 1, 150.0, NULL, NULL);
|
VALUES(3, 9, 2, '2000-01-01', '8:00', 1, 150.0, NULL, NULL);
|
||||||
|
|
||||||
|
INSERT INTO vn.stockBought (workerFk, bought, reserve, dated)
|
||||||
|
VALUES(35, 1.00, 1.00, '2001-01-01');
|
||||||
|
INSERT INTO vn.auctionConfig (id,conversionCoefficient,warehouseFk)
|
||||||
|
VALUES (1,0.6,6);
|
||||||
|
|
||||||
INSERT INTO vn.payrollComponent
|
INSERT INTO vn.payrollComponent
|
||||||
(id, name, isSalaryAgreed, isVariable, isException)
|
(id, name, isSalaryAgreed, isVariable, isException)
|
||||||
VALUES
|
VALUES
|
||||||
|
|
|
@ -39,7 +39,7 @@ describe('Entry filter()', () => {
|
||||||
|
|
||||||
const result = await models.Entry.filter(ctx, options);
|
const result = await models.Entry.filter(ctx, options);
|
||||||
|
|
||||||
expect(result.length).toEqual(11);
|
expect(result.length).toEqual(12);
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -152,7 +152,7 @@ describe('Entry filter()', () => {
|
||||||
|
|
||||||
const result = await models.Entry.filter(ctx, options);
|
const result = await models.Entry.filter(ctx, options);
|
||||||
|
|
||||||
expect(result.length).toEqual(10);
|
expect(result.length).toEqual(11);
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
@ -45,8 +45,8 @@ module.exports = Self => {
|
||||||
i.id itemFk,
|
i.id itemFk,
|
||||||
i.name itemName,
|
i.name itemName,
|
||||||
ti.quantity,
|
ti.quantity,
|
||||||
(ac.conversionCoefficient * (ti.quantity / b.packing) * buy_getVolume(b.id))
|
ROUND((ac.conversionCoefficient * (ti.quantity / b.packing) * buy_getVolume(b.id))
|
||||||
/ (vc.trolleyM3 * 1000000) volume,
|
/ (vc.trolleyM3 * 1000000),1) volume,
|
||||||
b.packagingFk packagingFk,
|
b.packagingFk packagingFk,
|
||||||
b.packing
|
b.packing
|
||||||
FROM tmp.item ti
|
FROM tmp.item ti
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
const {models} = require('vn-loopback/server/server');
|
const {models} = require('vn-loopback/server/server');
|
||||||
describe('item lastEntriesFilter()', () => {
|
describe('item lastEntriesFilter()', () => {
|
||||||
it('should return one entry for the given item', async() => {
|
it('should return two entry for the given item', async() => {
|
||||||
const minDate = Date.vnNew();
|
const minDate = Date.vnNew();
|
||||||
minDate.setHours(0, 0, 0, 0);
|
minDate.setHours(0, 0, 0, 0);
|
||||||
const maxDate = Date.vnNew();
|
const maxDate = Date.vnNew();
|
||||||
|
@ -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) {
|
||||||
|
@ -22,7 +22,7 @@ describe('item lastEntriesFilter()', () => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return five entries for the given item', async() => {
|
it('should return six entries for the given item', async() => {
|
||||||
const minDate = Date.vnNew();
|
const minDate = Date.vnNew();
|
||||||
minDate.setHours(0, 0, 0, 0);
|
minDate.setHours(0, 0, 0, 0);
|
||||||
minDate.setMonth(minDate.getMonth() - 2, 1);
|
minDate.setMonth(minDate.getMonth() - 2, 1);
|
||||||
|
@ -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