资源描述:
《TIPTOP成本计算逻辑axcp500DECODING》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、实用文档成本阶:99原料无工单(采购料件)ima08=P/V/Z98原料有工单有BOM97成品或半成品有工单无BOM0-96成品或半成品有工单有BOMcca_file库存成本期初ccb_file库存成本当月入库调整金额ccc_file 库存月加权成本ccg_file每月工单主件在制成本(依工单别的分批在制成本)即工单上阶成本cch_file每月工单元件在制成本即工单下阶成本计算范围:有下列情况之一的料件,均纳入计算范围:1tlf档当期有异动的料件tlf2当期有投入工时的料件ccj3有工单备料且有投入工时的料件sfa/sfb/ccj4当期有上阶在制
2、成本的料件(ccg有余额)5当期有下阶在制成本的料件(cch未余额)6有库存期初开帐的料件cca7当期工单有期初在制开帐金额的料件ccf8当期工单有在制调整金额的料件ccl9当期工单有工单发退料异动的料件sfb/tlfselect成本阶ima57, 料号ima01,须计算重工否ccd03,低阶码ima16,来源码ima08,分群码ima06,其他分群码ima09-11,成本分群码ima12,whereima料号=tlf料号andtlf异动日期为当前期间andtlf902仓库不为JIT仓库and仓库不为0##tlf档当期有异动的料件UNIONWhe
3、reima料号=工单档sfb料号and投入工时ccj01在当期期间andccj04工单号=工单档工单号sfb01##当期有投入工时的料件UNIONWhereima料号=备料档料号sfa03and投入工时ccj01在当期期间andccj04工单号=工单档工单号sfb01andsfa备料档料号=sfb工单档料号##有工单备料且有投入工时的料件UNIONWhereima料号=在制成本档料号ccgand在制成本为当期andccg91/92当期在制成本数量或单价不为零##当期有上阶在制成本的料件UNIONWhereima料号=在制成本元件档cch料号and
4、在制成本为当期andcch91/92当期在制成本数量或单价不为零##当期有下阶在制成本的料件UNIONWhereima料号=库存期初开帐料号cca##有库存期初开帐的料件UNIONWhereccf期初在制开帐金额档料号=工单档料号sfbandima料号=sfb工单料号and期初在制开帐金额不为零##当期工单有期初在制开帐金额的料件UNIONWhereccl当期在制调整金额料号=工单料号imaandima料号=工单料号sfb文案大全实用文档##当期工单有在制调整金额的料件UNIONWhere(未结案工单sfb38isnullor结案日在当前期间内)
5、andima料号=工单料号sfb05andtlf单据日期在当前期间内and tlf工单单号=sfb工单单号andtlf13异动命令代号为“asfi5*”##当期工单有工单发退料异动的料件例如:SELECTima57,ima01,ccd03,ima16,ima08,ima06,ima09,ima10,ima11,ima12FROMima_file,tlf_file,OUTERccd_fileWHEREima57=ccd01ANDima01matches'*'ANDima01NOTMATCHES'MISC*'ANDima01=tlf01ANDtlf0
6、6BETWEEN'00/01/01'AND'00/01/31'ANDtlf902NOTIN(SELECTjce02FROMjce_file)ANDtlf907!=0GROUPBY1,2,3,4,5,6,7,8,9,10UNIONSELECTima57,ima01,ccd03,ima16,ima08,ima06,ima09,ima10,ima11,ima12FROMima_file,ccj_file,sfb_file,OUTERccd_fileWHEREima57=ccd01ANDima01matches'*'ANDima01NOTMATCHES'
7、MISC*'ANDima01=sfb05ANDccj01BETWEEN'00/01/01'AND'00/01/31'ANDccj04=sfb01GROUPBY1,2,3,4,5,6,7,8,9,10UNIONSELECTima57,ima01,ccd03,ima16,ima08,ima06,ima09,ima10,ima11,ima12FROMima_file,ccj_file,sfb_file,sfa_file,OUTERccd_fileWHEREima57=ccd01ANDima01matches'*'ANDima01NOTMATCHES'M
8、ISC*'ANDima01=sfa03ANDccj01BETWEEN'00/01/01'AND'00/01/31'ANDccj04=sf