壹佰网|ERP100 - 企业信息化知识门户

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 717|回复: 5

[二次开发] mmt表和rt表都可以找出采购入库单,两者有何区别?????

[复制链接]
发表于 2013/4/11 15:53:39 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。如果您注册时有任何问题请联系客服QQ: 83569622  。

您需要 登录 才可以下载或查看,没有帐号?注册

x
表inv.mtl_material_transactions的字段
transaction_source_type_id=1 and mmt.transaction_type_id=18时,表示采购接收入库


表PO.RCV_TRANSACTIONS的字段TRANSACTION_TYPE='RECEIVE'时,也表示采购接收入库

这两种表示方法有何区别呀???????

发表于 2013/4/11 20:25:38 | 显示全部楼层
RT记录的是接收的历史事务记录,MMT是库存的历史事务。
记录的东西不一样,你说的能查出来,只不过是因为MMT和RT都有Purchasing的关联字段而已,但其他字段呢,记录的是不同模块的东西。

查eTRM。
 楼主| 发表于 2013/4/12 10:53:30 | 显示全部楼层
tianpan 发表于 2013/4/11 20:25
RT记录的是接收的历史事务记录,MMT是库存的历史事务。
记录的东西不一样,你说的能查出来,只不过是因为M ...

--采购接收进仓
select pv.segment1
       ,sum(decode(rt.currency_code,
                  'CNY',
                  nvl(RT.PO_UNIT_PRICE, 0) * (ATC.TAX_RATE + 100) / 100,
                  nvl(RT.PO_UNIT_PRICE, 0)
                  )*mmt.transaction_quantity
            ) 接收进仓金额
  from inv.mtl_material_transactions mmt
       ,po.rcv_transactions  rt
       ,po.po_line_locations_all plla
       ,po.po_vendors            pv
       ,ap.ap_tax_codes_all      atc
where mmt.organization_id=4 and rt.organization_id = 4
   and mmt.rcv_transaction_id=rt.transaction_id
   and mmt.transaction_source_type_id=1 and mmt.transaction_type_id=18
   and plla.tax_name = atc.name
   and rt.vendor_id=pv.vendor_id
   and rt.po_line_location_id= plla.line_location_id
   and mmt.transaction_date >= to_date('&b_date', 'yymmdd')
   and mmt.transaction_date<to_date('&e_date', 'yymmdd') +1
group by pv.segment1


--供应商交货金额  
select pv.vendor_name
       ,sum(decode(pha.currency_code,
                  'CNY',
                  nvl(RT.PO_UNIT_PRICE, 0) * (ATC.TAX_RATE + 100) / 100,
                  nvl(RT.PO_UNIT_PRICE, 0)
                  )*rt.quantity
            ) 供应商交货金额
  from po.rcv_transactions      rt
       ,po.po_headers_all        pha
       ,po.po_lines_all pla
       ,po.po_line_locations_all plla
       ,po.po_vendors            pv
       ,po.po_vendor_sites_all   pvs
       ,ap.ap_tax_codes_all      atc
       ,ap.ap_terms at
where rt.organization_id = 4
   and pha.po_header_id = pla.po_header_id and pla.po_line_id=plla.po_line_id
   and pha.vendor_id =pv.vendor_id and pv.enabled_flag='Y'
   and pvs.vendor_id = pv.vendor_id
   and plla.tax_name = atc.name
   and at.term_id=pv.terms_id
   and rt.po_header_id=pha.po_header_id
   and rt.po_line_location_id= plla.line_location_id
   and rt.vendor_site_id=pvs.vendor_site_id
   and rt.transaction_type = 'RECEIVE'
   and rt.transaction_date >= to_date('&b_date', 'yymmdd')
   and rt.transaction_date < to_date('&e_date', 'yymmdd') + 1
group by pv.vendor_name

这两种情况下金额是一样的,请问我要表示采购入库时,到底是用mmt还是用rt,
按我掌握的资料理解,采购接收入库时,会先rt表插入数据,之后才在mmt表插入数据的

发表于 2013/4/12 14:03:24 | 显示全部楼层
看你需求了。
如果你需要查看已经完成入库的数量,使用MMT。
RT(rt.transaction_type = 'RECEIVE')表示只是接受但未入库的情况。
发表于 2013/7/3 21:47:52 | 显示全部楼层
tianpan 发表于 2013/4/12 14:03
看你需求了。
如果你需要查看已经完成入库的数量,使用MMT。
RT(rt.transaction_type = 'RECEIVE')表示 ...

RT (rt.transaction_type = 'DELIVER')时才表示接收入库,才会在MMT 表中插入记录
发表于 2013/7/9 11:20:11 | 显示全部楼层
好问题,好解答,谢谢各位大侠。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|手机版|壹佰网 ERP100 ( 京ICP备19053597号-2 )

Copyright © 2005-2012 北京海之大网络技术有限责任公司 服务器托管由互联互通
手机:13911575376
网站技术点击发送消息给对方83569622   广告&合作 点击发送消息给对方27675401   点击发送消息给对方634043306   咨询及人才点击发送消息给对方138011526

GMT+8, 2025/11/29 04:17 , Processed in 0.019113 second(s), 14 queries , File On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表