|
|
发表于 2006/12/21 17:03:17
|
显示全部楼层
select a.TRX_NUMBER,
a.comments cw_number,
arc.CUSTOMER_NAME 客户,
b.sales_order 销售定单,
b.description 物料描述,
b.uom_code 物料单位,
t.subinventory_code sub ,
t.transaction_id id,
-t.primary_quantity quantity,
-t.primary_quantity*b.unit_selling_price je
from apps.ra_customer_trx_lines_all b
,apps.RA_CUSTOMER_TRX_ALL a
,inv.mtl_material_transactions t
,apps.ar_customers_v arc
where b.org_id = 82
and a.customer_trx_id=b.customer_trx_id
and b.QUANTITY_CREDITED IS not NULL
and arc.customer_number=nvl(:客户,arc.customer_number)
and decode(substr(b.sales_order ,2,1),1,'内销',2,'内销',3,'出口')=:销售分类
and t.organization_id=83
and t.transaction_date between sysdate-100 and sysdate
and t.transaction_type_id in ('15','37')
and arc.customer_id=a.sold_to_customer_id
and T.TRX_SOURCE_LINE_ID=to_number(B.interface_line_attribute6)
and TO_CHAR(a.trx_date,'YYYYMMDD') between :起始日期 and :结束日期
看看上面这个退货处理的思路 |
|