8093-devToTest_2442_3 #3100
|
@ -1,7 +1,8 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`stockBought_calculate`(
|
||||
vDated DATE
|
||||
)BEGIN
|
||||
)
|
||||
proc: BEGIN
|
||||
/**
|
||||
* Calculate the stock of the auction warehouse from the inventory date to 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.
|
||||
*/
|
||||
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;
|
||||
|
||||
CREATE OR REPLACE TEMPORARY TABLE tStockBought
|
||||
|
|
|
@ -29,8 +29,7 @@ module.exports = Self => {
|
|||
dated.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 = {
|
||||
where: {dated},
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const {models} = require('vn-loopback/server/server');
|
||||
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();
|
||||
minDate.setHours(0, 0, 0, 0);
|
||||
const maxDate = Date.vnNew();
|
||||
|
|
Loading…
Reference in New Issue