资源描述:
《oracleerp的sql脚本》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、/**************************/oracleERP的SQL脚本/**************************/库存货位列表.sqlselectinventory_location_id,organization_id,description,subinventory_code,segment1inventory_location_codefromMTL_ITEM_LOCATIONSorderbysubinventory_code,inventory_location_code;库存会计期间.sqlSELECTSTATUS,PERIOD_NAME,PERIO
2、D_NUMBER,PERIOD_YEAR,START_DATE,END_DATE,CLOSE_DATE,REC_TYPE,ORGANIZATION_IDFROMORG_ACCT_PERIODS_VWHERE((rec_type='ORG_PERIOD'))orderbyEND_DATEdesc;库存组织列.sqlselecta.organization_id,a.nameFROMhr_all_organization_unitsawherea.organization_id>82;事物处理活动列表.sqlselect*frommfg_lookupswherelookup_type='MT
3、L_TRANSACTION_ACTION'ORDERBYLOOKUP_CODE;事物处理来源类型列表.sqlSELECTTRANSACTION_SOURCE_TYPE_NAME,DESCRIPTION,VALIDATED_FLAG,TRANSACTION_SOURCE_TYPE_ID,USER_DEFINED_FLAG,DISABLE_DATEFROMMTL_TXN_SOURCE_TYPESWHEREUSER_DEFINED_FLAG='N'orderbytransaction_source_type_name;接收事物处理.sqlSELECTt.po_header_id,t.po_li
4、ne_id,t.po_release_id,SUM(DECODE(t.transaction_type,'DELIVER',t.quantity,'RETURNTORECEIVING',DECODE(t.destination_type_code,'INVENTORY',-t.quantity,'EXPENSE',-t.quantity,0),'CORRECT',DECODE(t.destination_type_code,'INVENTORY',t.quantity,'EXPENSE',t.quantity,0),0))deliver_qtya,SUM(t.po_unit_price*
5、t.currency_conversion_rate*DECODE(t.transaction_type,'DELIVER',t.quantity,'RETURNTORECEIVING',DECODE(t.destination_type_code,'INVENTORY',-t.quantity,'EXPENSE',-t.quantity,0),'CORRECT',DECODE(t.destination_type_code,'INVENTORY',t.quantity,'EXPENSE',t.quantity,0),0))deliver_amount,SUM(DECODE(t.tran
6、saction_type,'RECEIVE',t.quantity,'RETURNTOVENDOR',-t.quantity,'CORRECT',DECODE(t.destination_type_code,'RECEIVING',t.quantity,0),0))receive_qtya,SUM(t.po_unit_price*t.currency_conversion_rate*DECODE(t.transaction_type,'RECEIVE',t.quantity,'RETURNTOVENDOR',-t.quantity,'CORRECT',DECODE(t.destinati
7、on_type_code,'RECEIVING',t.quantity,0),0))receive_amount,t.unit_of_measure,rsl.item_id,rsl.item_revision,rsl.item_description,g.period_year,g.period_number,rsl.from_organization_idFROMpo.rcv_transactionst,apps.org_acct