fix: refs #7404 back and e2e
This commit is contained in:
parent
80985fbd56
commit
3988eb0d97
|
@ -1,7 +1,8 @@
|
||||||
DELIMITER $$
|
DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`stockBought_calculate`(
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`stockBought_calculate`(
|
||||||
vDated DATE
|
vDated DATE
|
||||||
)BEGIN
|
)
|
||||||
|
proc: BEGIN
|
||||||
/**
|
/**
|
||||||
* Calculate the stock of the auction warehouse from the inventory date to vDated
|
* Calculate the stock of the auction warehouse from the inventory date to vDated
|
||||||
* without taking into account the outputs of the same day vDated
|
* without taking into account the outputs of the same day vDated
|
||||||
|
@ -9,7 +10,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`stockBought_calcula
|
||||||
* @param vDated Date to calculate the stock.
|
* @param vDated Date to calculate the stock.
|
||||||
*/
|
*/
|
||||||
IF vDated < util.VN_CURDATE() THEN
|
IF vDated < util.VN_CURDATE() THEN
|
||||||
CALL util.error('The date to calculate the stock is less than the current date');
|
LEAVE proc;
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
CREATE OR REPLACE TEMPORARY TABLE tStockBought
|
CREATE OR REPLACE TEMPORARY TABLE tStockBought
|
||||||
|
|
|
@ -29,8 +29,7 @@ module.exports = Self => {
|
||||||
dated.setHours(0, 0, 0, 0);
|
dated.setHours(0, 0, 0, 0);
|
||||||
today.setHours(0, 0, 0, 0);
|
today.setHours(0, 0, 0, 0);
|
||||||
|
|
||||||
if (dated.getTime() >= today.getTime())
|
await models.StockBought.rawSql(`CALL vn.stockBought_calculate(?)`, [dated]);
|
||||||
await models.StockBought.rawSql(`CALL vn.stockBought_calculate(?)`, [dated]);
|
|
||||||
|
|
||||||
const filter = {
|
const filter = {
|
||||||
where: {dated},
|
where: {dated},
|
||||||
|
|
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue