Commit 84198523 authored by dpawar's avatar dpawar

added sql


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@95235 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 08296aa7
......@@ -334,6 +334,35 @@ values
--Added on 09/JUN/2014
ALTER table SPL_SALES_POR_DET ADD PEND_QTY NUMBER(14,3);
insert into messages
(msg_no,msg_str,msg_descr,msg_type,chg_date,chg_user,chg_term)
values
('VTPODARI','POD received','Proof of Delivery already received for this invoice ID','E',sysdate,'BASE','BASE');
update pophelp set sql_str=
'select distinct invoice_id from(
select case when nvl(tt.quantity,0) <> nvl(dt.quantity,0) then
tt.invoice_id else ''NOT'' end invoice_id from ( select inv.invoice_id,tr.item_code,tr.lot_no,tr.lot_sl,tr.inv_line_no,sum(nvl(tr.quantity,0)) quantity
from invoice_trace tr join invoice inv on inv.invoice_id = tr.invoice_id and inv.site_code = ''?'' and
inv.cust_code__bil = ''?'' group by inv.invoice_id,tr.item_code,tr.lot_no,tr.lot_sl,tr.inv_line_no
) tt left outer join (select substr(rcp.remarks,-10) remarks,drcp.item_code,drcp.lot_no,drcp.lot_sl,drcp.line_no__invtrace,sum(nvl(drcp.quantity,0)) quantity
from misc_drcr_rcp rcp join misc_drcr_rdet drcp on drcp.tran_id = rcp.tran_id where drcp.item_code is not null
group by substr(rcp.remarks,-10),drcp.item_code,drcp.lot_no,drcp.lot_sl,drcp.line_no__invtrace
) dt on dt.remarks = tt.invoice_id and tt.item_code = dt.item_code and
tt.lot_no = dt.lot_no and tt.lot_sl = dt.lot_sl and tt.inv_line_no =
dt.line_no__invtrace
) datatable
where invoice_id <> ''NOT''
order by invoice_id'
where mod_name='W_PROOF_OF_DELIVERY' and field_name='INVOICE_ID';
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