|
@@ -6,8 +6,8 @@ DELIMITER //
|
|
|
create procedure pl1_stock_io_ledger_detail( _listToken varchar(21), _sdate varchar(8), _edate varchar(8),
|
|
|
_s1 varchar(32), _e1 varchar(32), _s2 varchar(32), _e2 varchar(32),
|
|
|
_s3 varchar(32), _e3 varchar(32), _s4 varchar(32), _e4 varchar(32),
|
|
|
-_where varchar(386), _having varchar(386), _orderby varchar(64),
|
|
|
-_branch int, _storage int, _target int)
|
|
|
+_having varchar(386), _orderby varchar(64),
|
|
|
+_branch int, _storage int, _member_company_id int, _lt_filter int)
|
|
|
|
|
|
BEGIN
|
|
|
|
|
@@ -54,7 +54,7 @@ end if;
|
|
|
select begin_bal_qty, bad_begin_bal_qty
|
|
|
into _first_bal, _first_bad_bal
|
|
|
from dbr_bal_item
|
|
|
-where yyyy_mm = substring(_sdate, 1, 6) and storage_id = _storage and item_id = _target;
|
|
|
+where yyyy_mm = substring(_sdate, 1, 6) and storage_id = _storage and item_id = _lt_filter;
|
|
|
|
|
|
insert into dbt_list_type1 ( created_on, list_token, c3, d4, d5, order_by)
|
|
|
values ( unix_timestamp(), _listToken, '이월재고', _first_bal, _first_bad_bal, '19000101');
|
|
@@ -67,7 +67,7 @@ select unix_timestamp(), _listToken,
|
|
|
io_date, deal_name, concat(slip_no,' / ', stk.seq_no ), company_name, if(stk.bad_in_qty+stk.bad_out_qty = 0, '0', '1'),
|
|
|
io_prc, stk.in_qty, stk.out_qty, concat( io_date, '-', slip_no, '-', seq_no)
|
|
|
from dbr_stock_io as stk
|
|
|
-where io_date between _sdate and _edate and storage_id = _storage and stk.item_id = _target;
|
|
|
+where io_date between _sdate and _edate and storage_id = _storage and stk.item_id = _lt_filter;
|
|
|
|
|
|
-- compute line_bal
|
|
|
set _line_bal = _first_bal;
|
|
@@ -92,7 +92,7 @@ open _line_cur;
|
|
|
close _line_cur;
|
|
|
|
|
|
-- write list_sum
|
|
|
-select item_code, concat(item_name,' / ',sub_name ) into _item_code, _item_sub_name from dbr_item where id = _target;
|
|
|
+select item_code, concat(item_name,' / ',sub_name ) into _item_code, _item_sub_name from dbr_item where id = _lt_filter;
|
|
|
insert into dbt_list_sum
|
|
|
( created_on, list_token, c1, c2, c3, c4, d1, d2, d3, d4)
|
|
|
values (unix_timestamp(), _listToken, _item_code, _item_sub_name, _sdate, _edate,
|