Commit 89c787c0 authored by ssurve's avatar ssurve

POD function updated


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@95042 ce508802-f39f-4f6c-b175-0d175dae99d5
parent f8da8a9b
...@@ -158,6 +158,7 @@ BEGIN ...@@ -158,6 +158,7 @@ BEGIN
--exit --exit
else else
-- Logic for partial POD entries starts here -- Logic for partial POD entries starts here
hdr_sql_stmt := 'select tran_id from spl_sales_por_hdr where invoice_id = '''||ls_invoiceid||''' and confirmed = ''Y'' and wf_status <> ''R'' '; hdr_sql_stmt := 'select tran_id from spl_sales_por_hdr where invoice_id = '''||ls_invoiceid||''' and confirmed = ''Y'' and wf_status <> ''R'' ';
...@@ -169,29 +170,18 @@ BEGIN ...@@ -169,29 +170,18 @@ BEGIN
EXIT WHEN dtl_cur%NOTFOUND; EXIT WHEN dtl_cur%NOTFOUND;
begin begin
dtl_sql_stmt := 'select line_no,item_code,quantity__inv into lineno,itemcode,invqty from spl_sales_por_det where tran_id = '''||ls_podtranid||''''; select sum(quantity__resale),sum(quantity__inv) into podqty_sum,inv_qty from spl_sales_por_det where tran_id = ls_podtranid group by item_code ;
begin
open item_cur for dtl_sql_stmt;-- USING ls_podtranid;
LOOP
FETCH item_cur INTO ls_podtranid,itemcode,lineno,inv_qty;
EXIT WHEN item_cur%NOTFOUND;
select sum(quantity__resale) into podqty_sum from spl_sales_por_det where tran_id = ls_podtranid and item_code = itemcode; if podqty_sum < inv_qty then
cnumber :=1;
return cnumber;
--exit;
end if;
if podqty_sum < inv_qty then
cnumber :=1;
return cnumber;
--exit;
end if;
END LOOP;
CLOSE item_cur;
end;
exception when others then exception when others then
return -1; return -1;
end; end;
END LOOP; END LOOP;
CLOSE dtl_cur; CLOSE dtl_cur;
end; end;
...@@ -209,6 +199,7 @@ BEGIN ...@@ -209,6 +199,7 @@ BEGIN
return cnumber; return cnumber;
END; END;
-- POD Function ends here -- POD Function ends here
--added cross-update sql [13/12/13] --added cross-update sql [13/12/13]
......
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