P. 1
Tax Quaterly

Tax Quaterly

|Views: 22|Likes:
Published by uneed

More info:

Published by: uneed on Oct 11, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as TXT, PDF, TXT or read online from Scribd
See more
See less

09/05/2013

pdf

text

original

SELECT segment1 Vendor#,NTN, CNIC, PH_NO,user_name,vendor_name, b.

check_number, vendor_address, sect ,to_char(check_date,'YYYYMMDD') CHEK_date, taxable_amt, rate, invoice_amount, am ount_paid ,date1, CPR, amount FROM ( SELECT InvTax, api.invoice_id, substr(api.invoice_num,instr(api.invoice_num,'-')+1)

api.invoice_amount, api.amount_paid -- substr(apc.attribute1,9,2) '-' substr(apc.attribute1,6,2) '-' substr(apc.attribute1,1,4) date1, -substr(apc.attribute1,1,4) substr(apc.attribute1,6,2) substr(ap c.attribute1,9,2) apc.attribute2 LTRIM(to_char(apc.attribute3,'0999999')) CPR FROM ap_invoice_distributions_all apd, ap_invoices_all api -gl_code_combinations gl -ap_invoice_payments_all app, -ap_checks_all apc WHERE --and apd.awt_invoice_id=api.invoice_id(+) apd.dist_code_combination_id = gl.code_combination_id(+)

-- and gl.segment6 = '029302' --and --apc.check_date between '01-AUG-2008' and '30-AUG-2008' --and -- and ) a, ( SELECT app.check_id=apc.check_id(+) api.invoice_id=app.invoice_id(+)

apd.awt_invoice_id, api.created_by, apb.batch_name, api.invoice_num, fu.user_name,api.gl_date, decode(api.invoice_curren cy_code,'PKR',api.invoice_amount,api.base_amount) taxable_amt, decode(length(pov.attribute10),7,substr(pov.attribute10,1,7) '-0',po v.attribute10) NTN, pov.attribute14 PH_NO, decode(INSTR(pov.attribute11,'-'),0,substr(pov.attribute11,1,5) '-' substr(pov.attribute11,6,7) '-' substr(pov.attribute11,13,1),pov.attribute11 ) CNIC, pov.segment1, substr(pov.vendor_name,1,40) vendor_name, povs.address_line1 ' ' povs.address_line2 ' ' povs.city vendor_a ddress,wtc.attribute1 sect,substr(wtc.name,1,3) rate , apc.bank_account_name,apc.bank_account_num, apc.check_date, apc.check_number, app.amount FROM ap_batches_all ap_invoices_all ap_invoice_distributions_all gl_code_combinations gl, po_vendors po_vendor_sites_all ap_invoice_payments_all ap_checks_all ap_awt_groups apb, api, apd, pov, povs, app, apc, wtg,

2) substr(apc.user_id -pov.code_combination_id api.6.substr(apc.attribute1.invoice_id=b.'0999999'))) CPR --ap_invoice_distributions_all apd.2) substr(apc.vendor_id) -and and AND AND ) b.created_by = fu.invoice_id(+) apd.attribute 1. pov.vendor_id app.6.attribute1.invoice_id=app.invoice_id=c.invoice_id.4) s ubstr(apc.vendor_id=pov. DECODE(apc.null.1.vendor_id) AND nvl(:p _tovendor.invoice_id --and a.invoice_id=app.9.attribute1.batch_id=api.vendor_id = povs.awt_invoice_id IS NOT NULL pov.check_id=apc.attribute1.check_id=apc.attribute1.ap_tax_codes_all fnd_user WHERE and and and and and and and and wtc. ap_checks_all apc WHERE app.invoice_id(+) --and app.group_id= apd.name api.check_date between '01-OCT-2010' and '31-DEC-2010' gl.9.gl_date between :date_from and :date_to apc.invoice_id= 637053 ) c WHERE a.check_id(+) api.attribute3.dist_code_combination_id = gl.2) date1.amount_paid<>0 api.attribute1.awt_invoice_id and a.awt_origin_group_id wtg.pov.invoice_id=apd.null.attribute2 LTRIM(to_ char(apc.segment6 = '029302' AND pov.batch_id wtg. -ap_invoices_all api from ap_invoice_payments_all app.vendor_id AND povs.status_lookup_code <> 'VOIDED' -. ( select distinct app.and api.check_id and apc.2) apc.invoice_id api.4) substr(apc.'IT' substr(apc.name = wtc.vendor_id BETWEEN nvl(:p_fromvendor. fu apb.vendor_site_code='SITE-1' apd.vendor_type_lookup_code <> 'EMPLOYEE' .1.

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->