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)
begin_date varchar2(8);
end_date varchar2(8);
itemCodeL varchar2(10);
lineTraceL number;
lotNoL varchar2(15);
lotSlL varchar2(15);
BEGIN
cnumber := 0;
......@@ -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';
exception when others then
return -1;
return -99;
end;
begin
......@@ -151,12 +156,12 @@ BEGIN
return -2;
end;
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';
begin
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 --new
open dtl_cur for hdr_sql_stmt;-- for check invoice amt and resale amt match or not.
<<continue2>>
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;
if dtl_cur%FOUND then
if podqty_sum < inv_qty then
......@@ -166,7 +171,7 @@ BEGIN
end if;
end if;
end LOOP;
end;
end; --new end
CLOSE dtl_cur;
--exit
......@@ -183,8 +188,16 @@ BEGIN
END LOOP;
-- Close cursor:
CLOSE inv_cur;
exception when others then
return -1;
exception
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;
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