Commit 548aa879 authored by dpawar's avatar dpawar

changes in function


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@95324 ce508802-f39f-4f6c-b175-0d175dae99d5
parent a80c3f4b
...@@ -107,6 +107,11 @@ Function taroqc.fn_pod_chk ( as_saleorder in sorder.sale_order%type) ...@@ -107,6 +107,11 @@ Function taroqc.fn_pod_chk ( as_saleorder in sorder.sale_order%type)
begin_date varchar2(8); begin_date varchar2(8);
end_date varchar2(8); end_date varchar2(8);
itemCodeL varchar2(10);
lineTraceL number;
lotNoL varchar2(15);
lotSlL varchar2(15);
BEGIN BEGIN
cnumber := 0; cnumber := 0;
...@@ -114,7 +119,7 @@ BEGIN ...@@ -114,7 +119,7 @@ BEGIN
select '''' || replace(var_value,',',' '',''') || ' ''' into inv_type_list from disparm where var_name = 'POD_INV_TYPE' and prd_code = '999999'; select '''' || replace(var_value,',',' '',''') || ' ''' into inv_type_list from disparm where var_name = 'POD_INV_TYPE' and prd_code = '999999';
exception when others then exception when others then
return -1; return -99;
end; end;
begin begin
...@@ -151,22 +156,22 @@ BEGIN ...@@ -151,22 +156,22 @@ BEGIN
return -2; return -2;
end; end;
if pod_cnt > 0 then if pod_cnt > 0 then
hdr_sql_stmt := 'select sum(d.quantity__resale),sum(d.quantity__inv) from spl_sales_por_hdr h,spl_sales_por_det d where h.tran_id=d.tran_id and h.invoice_id = '''||ls_invoiceid||''' and h.confirmed =''Y'' group by d.item_code,d.line_no__trace,d.lot_no,d.lot_sl'; hdr_sql_stmt := 'select sum(d.quantity__resale),d.quantity__inv, d.item_code,d.line_no__trace,d.lot_no,d.lot_sl from spl_sales_por_hdr h,spl_sales_por_det d where h.tran_id=d.tran_id and h.invoice_id = '''||ls_invoiceid||''' and h.confirmed =''Y'' group by d.quantity__inv, d.item_code, d.line_no__trace, d.lot_no, d.lot_sl';
begin begin --new
open dtl_cur for hdr_sql_stmt;-- for check invoice amt and resale amt match or not. open dtl_cur for hdr_sql_stmt;-- for check invoice amt and resale amt match or not.
<<continue2>> <<continue2>>
Loop Loop
FETCH dtl_cur INTO podqty_sum,inv_qty; FETCH dtl_cur INTO podqty_sum,inv_qty,itemCodeL,lineTraceL,lotNoL,lotSlL;
EXIT WHEN dtl_cur%NOTFOUND; EXIT WHEN dtl_cur%NOTFOUND;
if dtl_cur%FOUND then if dtl_cur%FOUND then
if podqty_sum < inv_qty then if podqty_sum < inv_qty then
return 1; return 1;
else else
goto continue2; goto continue2;
end if; end if;
end if; end if;
end LOOP; end LOOP;
end; end; --new end
CLOSE dtl_cur; CLOSE dtl_cur;
--exit --exit
...@@ -183,8 +188,16 @@ BEGIN ...@@ -183,8 +188,16 @@ BEGIN
END LOOP; END LOOP;
-- Close cursor: -- Close cursor:
CLOSE inv_cur; CLOSE inv_cur;
exception when others then exception
return -1; when CURSOR_ALREADY_OPEN then
return -88;
WHEN TOO_MANY_ROWS THEN
return -77;
WHEN INVALID_CURSOR THEN
return -66;
WHEN INVALID_NUMBER THEN
return -55;
end; end;
return cnumber; return cnumber;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment