Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1842258
  • 博文数量: 334
  • 博客积分: 11301
  • 博客等级: 上将
  • 技术积分: 3452
  • 用 户 组: 普通用户
  • 注册时间: 2006-10-18 10:19
个人简介

路虽弥,不行不至;事虽少,不做不成。

文章分类

全部博文(334)

文章存档

2013年(4)

2012年(19)

2011年(27)

2010年(71)

2009年(45)

2008年(15)

2007年(84)

2006年(69)

分类: Oracle

2008-10-16 16:28:14

=================实现核销AR收款明细/未核销收款查询=================

SELECT hca.account_number customer_number,
       SUBSTR (hp.party_name,
               1,
               DECODE (INSTR (hp.party_name, '    '),
                       0, 50,
                       INSTR (hp.party_name, '    ')
                      )
              ) customer_name,
       rec.receipt_number, rec.amount receipt_amount, rec.receipt_date,
       rec.currency_code, rec.status, rt.trx_number trx_number,
       DECODE (interface_header_context,
               'ORDER ENTRY', rt.purchase_order,
               ''
              ) cust_po_number,
       rt.interface_header_attribute1 sales_order, app.apply_date,
       app.amount_applied applied_amount, bank.bank_account_name
  FROM ar.ar_cash_receipts_all rec,
       ar.ar_payment_schedules_all ps,
       ar.ar_receivable_applications_all app,
       ar.ra_customer_trx_all rt,
       ar.hz_cust_accounts hca,
       ar.hz_parties hp,
       ap.ap_bank_accounts_all bank
 WHERE rec.cash_receipt_id = ps.cash_receipt_id
   AND ps.payment_schedule_id = app.payment_schedule_id(+)
   AND app.display(+) = 'Y'
   AND app.applied_customer_trx_id = rt.customer_trx_id(+)
   AND hp.party_id = hca.party_id
   AND hca.cust_account_id = ps.customer_id
   AND rec.status <> 'REV'
   AND rec.set_of_books_id = 63
   AND rec.org_id = 211
   AND bank.bank_account_id = rec.remittance_bank_account_id
   AND rec.status = '&Status'  --Value: APP,UNAPP
   AND hp.party_name LIKE '%&Customer_Name%'
   AND TO_CHAR (rec.receipt_date, 'YYYY-MM-DD') BETWEEN '&start_date'
                                                    AND '&end_date'
阅读(4673) | 评论(0) | 转发(0) |
0

上一篇:如何获取APPS的密码?

下一篇:APP-SQLAP-10771

给主人留下些什么吧!~~