TIPTOP成本計(jì)算邏輯axcp500DECODING_第1頁
TIPTOP成本計(jì)算邏輯axcp500DECODING_第2頁
TIPTOP成本計(jì)算邏輯axcp500DECODING_第3頁
TIPTOP成本計(jì)算邏輯axcp500DECODING_第4頁
TIPTOP成本計(jì)算邏輯axcp500DECODING_第5頁
已閱讀5頁,還剩8頁未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

1、成本階:99 原料無工單(采購料件) ima08=p/v/z98 原料有工單有bom97 成品或半成品有工單無bom0-96 成品或半成品有工單有bomcca_file 庫存成本期初ccb_file 庫存成本當(dāng)月入庫調(diào)整金額ccc_file 庫存月加權(quán)成本ccg_file 每月工單主件在制成本(依工單別的分批在制成本) 即工單上階成本cch_file 每月工單元件在制成本 即工單下階成本計(jì)算范圍:有下列情況之一的料件,均納入計(jì)算范圍:1 tlf檔當(dāng)期有異動(dòng)的料件 tlf2當(dāng)期有投入工時(shí)的料件 ccj3有工單備料且有投入工時(shí)的料件 sfa/sfb/ccj4當(dāng)期有上階在制成本的料件(ccg有余額)

2、5當(dāng)期有下階在制成本的料件(cch未余額)6有庫存期初開帳的料件cca7當(dāng)期工單有期初在制開帳金額的料件 ccf8當(dāng)期工單有在制調(diào)整金額的料件ccl9當(dāng)期工單有工單發(fā)退料異動(dòng)的料件sfb/tlf select 成本階ima57,料號(hào)ima01,須計(jì)算重工否ccd03,低階碼ima16,來源碼ima08,分群碼ima06,其他分群碼ima09-11,成本分群碼ima12,where ima料號(hào)=tlf 料號(hào) and tlf異動(dòng)日期為當(dāng)前期間 and tlf902倉庫不為jit倉庫 and 倉庫不為0 #tlf檔當(dāng)期有異動(dòng)的料件unionwhere ima料號(hào)=工單檔sfb料號(hào) and 投入工時(shí)c

3、cj01在當(dāng)期期間 and ccj04工單號(hào)=工單檔工單號(hào)sfb01 #當(dāng)期有投入工時(shí)的料件unionwhere ima料號(hào)=備料檔料號(hào)sfa03 and 投入工時(shí)ccj01在當(dāng)期期間 and ccj04工單號(hào)=工單檔工單號(hào)sfb01 and sfa備料檔料號(hào)=sfb工單檔料號(hào) #有工單備料且有投入工時(shí)的料件unionwhere ima料號(hào)=在制成本檔料號(hào)ccg and 在制成本為當(dāng)期 and ccg91/92當(dāng)期在制成本數(shù)量或單價(jià)不為零 #當(dāng)期有上階在制成本的料件unionwhere ima料號(hào)=在制成本元件檔cch料號(hào) and 在制成本為當(dāng)期 and cch91/92當(dāng)期在制成本數(shù)量或單價(jià)

4、不為零 #當(dāng)期有下階在制成本的料件unionwhere ima料號(hào)=庫存期初開帳料號(hào)cca #有庫存期初開帳的料件unionwhere ccf 期初在制開帳金額檔料號(hào)=工單檔料號(hào)sfb and ima料號(hào)=sfb工單料號(hào) and 期初在制開帳金額不為零 #當(dāng)期工單有期初在制開帳金額的料件unionwhere ccl當(dāng)期在制調(diào)整金額料號(hào)=工單料號(hào)ima and ima 料號(hào)=工單料號(hào)sfb #當(dāng)期工單有在制調(diào)整金額的料件unionwhere (未結(jié)案工單sfb38 is null or結(jié)案日在當(dāng)前期間內(nèi)) and ima料號(hào)=工單料號(hào)sfb05 and tlf單據(jù)日期在當(dāng)前期間內(nèi) and tlf

5、工單單號(hào)=sfb工單單號(hào) and tlf13異動(dòng)命令代號(hào)為“asfi5*” #當(dāng)期工單有工單發(fā)退料異動(dòng)的料件例如:select ima57,ima01,ccd03,ima16,ima08,ima06, ima09,ima10,ima11,ima12from ima_file,tlf_file,outer ccd_filewhere ima57=ccd01 and ima01 matches * and ima01 not matches misc* and ima01 = tlf01 and tlf06 between 00/01/01 and 00/01/31 and tlf902 not

6、in (select jce02 from jce_file) and tlf907 != 0 group by 1,2,3,4,5,6,7,8,9,10unionselect ima57,ima01,ccd03,ima16,ima08,ima06, ima09,ima10,ima11,ima12from ima_file, ccj_file,sfb_file,outer ccd_filewhere ima57=ccd01 and ima01 matches * and ima01 not matches misc* and ima01 = sfb05 and ccj01 between 00

7、/01/01 and 00/01/31 and ccj04 = sfb01 group by 1,2,3,4,5,6,7,8,9,10unionselect ima57,ima01,ccd03,ima16,ima08,ima06, ima09,ima10,ima11,ima12from ima_file, ccj_file,sfb_file,sfa_file,outer ccd_filewhere ima57=ccd01 and ima01 matches * and ima01 not matches misc* and ima01 = sfa03 and ccj01 between 00/

8、01/01 and 00/01/31 and ccj04 = sfb01 and sfb01 = sfa01 group by 1,2,3,4,5,6,7, 8,9,10unionselect ima57,ima01,ccd03,ima16,ima08,ima06, ima09,ima10,ima11,ima12from ima_file, ccg_file,outer ccd_filewhere ima57=ccd01 and ima01 matches * and ima01 not matches misc* and ima01 = ccg04 and ccg02= 1999 and c

9、cg03= 12 and (ccg91 !=0 or ccg92 !=0 or ccg92a !=0 or ccg92b !=0 or ccg92c!=0 or ccg92d !=0 or ccg92e !=0 ) group by 1,2,3,4,5,6,7,8,9,10unionselect ima57,ima01,ccd03,ima16,ima08,ima06, ima09,ima10,ima11,ima12from ima_file,cch_file,outer ccd_filewhere ima57=ccd01 and ima01 matches * and ima01 not ma

10、tches misc* and ima01 = cch04 and cch02=1999 and cch03=12 and (cch91!=0 or cch92 !=0 or cch92a!=0 or cch92b !=0 or cch92c!=0 or cch92d !=0 or cch92e !=0 ) group by 1,2,3,4,5,6,7,8,9,10unionselect ima57,ima01,ccd03,ima16,ima08,ima06, ima09,ima10,ima11,ima12from ima_file,cca_file,outer ccd_file where

11、ima57=ccd01 and ima01 matches * and ima01 not matches misc* and ima01=cca01 and cca02= 1999 and cca03= 12 group by 1,2,3,4,5,6,7,8,9,10unionselect ima57,ima01,ccd03,ima16,ima08,ima06, ima09,ima10,ima11,ima12from ima_file,ccf_file,sfb_file,outer ccd_filewhere ima57=ccd01 and ima01 matches * and ima01

12、 not matches misc* and ccf01=sfb01 and ima01 = sfb05 and ccf02=1999 and ccf03=12and (ccf11 !=0 or ccf12!=0 or ccf12a !=0 or ccf12b !=0 or ccf12c !=0 or ccf12d !=0 or ccf12e !=0 ) group by 1,2,3,4,5,6,7,8,9,10unionselect ima57,ima01,ccd03,ima16,ima08,ima06, ima09,ima10,ima11,ima12from ima_file,ccl_fi

13、le,sfb_file,outer ccd_filewhere ima57=ccd01 and ima01 matches * and ima01 not matches misc* and ccl01 = sfb01 and ima01 = sfb05 and ccl02= 2000 and ccl03= 1 group by 1,2,3,4,5,6,7,8,9,10unionselect ima57,ima01,ccd03,ima16,ima08,ima06,ima09,ima10,ima11,ima12from ima_file,tlf_file,sfb_file,outer ccd_f

14、ilewhere ima57=ccd01 and ima01 matches * and ima01 not matches misc* and (sfb38 between 00/01/01 and 00/01/31 or sfb38 is null ) and ima01 = sfb05 and tlf06 between 00/01/01 and 00/01/31 and tlf62 = sfb01 and tlf131,5 = asfi5 group by 1,2,3,4,5,6,7,8,9,10into temp tlf_temp with no log計(jì)算過程:排序方式:uniqu

15、e ima57,ima01,ccd03,ima16 ima57 desc/ima16/ima01成本階為99 :1、ccc清零,取上期結(jié)存轉(zhuǎn)本期期初2、由tlf 計(jì)算入出庫數(shù)量,由apb101計(jì)算入庫(采購)成本3、加上入庫調(diào)整金額4、計(jì)算所有出庫成本及結(jié)存5、更新ccc-file成本階不為99:1、處理當(dāng)前成本階所有料件重工2、ccc清零,取上期結(jié)存轉(zhuǎn)本期期初3、處理wip在制成本4、由tlf 計(jì)算入出庫數(shù)量,入庫成本(外購料件)5、加上入庫調(diào)整金額6、加上wip入庫金額7、計(jì)算所有出庫成本及結(jié)存8、更新ccc-file處理重工重工處理過程:以當(dāng)前成本階的所有料件為計(jì)算范圍,1、p500_r

16、ework1先處理重工wip及完成品入庫, p500_wip_rework處理重工在制成本(以重工工單sfb99=y為范圍),步驟與處理一般在制相同:wip_1計(jì)算主件部分成本;wip_2計(jì)算元件投入成本;wip_3計(jì)算元件轉(zhuǎn)出成本;wip_4處理主件sum成本。2、p500_rework2計(jì)算所有重工出庫成本及結(jié)存, p500_ccg2_cost加上wip重工入庫成本(ccg32在制轉(zhuǎn)出金額ccc28); p500_ccc_tot(2) 計(jì)算所有出庫成本及結(jié)存;3、記錄拆件式工單的投入及轉(zhuǎn)出(sfb02=11) 找所有拆件式工單; wipx_1計(jì)算拆件式wip主件部分成本; wipx_2計(jì)算

17、拆件式wip元件投入成本; wipx_3計(jì)算拆件式wip元件轉(zhuǎn)出成本; wipx_4計(jì)算拆件式wip主件sum成本; p500_ccc_tot(2)計(jì)算所有出庫成本及結(jié)存;main刪除本期已有資料,取上期結(jié)存轉(zhuǎn)本期期初p500_last0找計(jì)算范圍(取本期有異動(dòng)之資料計(jì)算tlf)抓資料到 tlf_tmpfetch 成本階/料號(hào)/重工否/低階碼 (按成本階降序排列) 來計(jì)算for each if 當(dāng)前料件成本階不同push 料號(hào)p500_rework 重工處理 (本成本階所有料件)pop 料號(hào) end if 保存當(dāng)前料件料號(hào)g_ima01_t 將當(dāng)前料件當(dāng)期成本檔歸零 ccc_file p500

18、_ccc_0 取料件上期結(jié)存p500_last if 當(dāng)前料件不是原料(成本階數(shù)不為99)處理wip在制成本 p500_wip end if由tlf_file 計(jì)算入出庫數(shù)量及采購成本 p500_tlf加入出庫調(diào)整金額 p500_ccb_cost if 當(dāng)前料件不是原料(成本階數(shù)不為99)加上wip入庫金額 p500_ccg_cost end if 計(jì)算所有出庫成本及結(jié)存 p500_ccc_tot(1) 計(jì)算結(jié)果寫入當(dāng)期成本檔p500_ccc_insend foreachif 上一料號(hào)為null 則 上一料號(hào)置零if 上一成本階為null 則上一成本階置零第二次處理重工p500_reworke

19、nd mainp500_last0()delete 本期成本資料 delete from ccc_file where ccc02= 2000 and ccc03= 1 and ccc01 in(select ima01 from ima_file where ima01 matches * and ima01 not matches misc*)取上期及開帳成本 select ima01 from ccc_file,ima_file where ccc02=1999 and ccc03=12 and ccc01=ima01 and ima01 matches * and ima01 not

20、matches misc* union select ima01 from cca_file,ima_file where cca02= 1999 and cca03= 12 and cca01=ima01 and ima01 matches * and ima01 not matches misc* call p500_ccc_0() 清零 select * into g_ccc.* from ccc_file where ccc01 = l_ima01 and ccc02=last_yy and ccc03=last_mm 先取上月結(jié)存 select * into l_cca.* from

21、 cca_file where cca01=g_ccc.ccc01 and cca02=last_yy and cca03=last_mm 再取期初開帳p500_rework()取當(dāng)前料件成本階的ccd03 (須計(jì)算重工否)if須重工先計(jì)算wip及完成品入庫p500_rework1再計(jì)算所有出庫成本及結(jié)存p500_rework2記錄wip-拆件式工單在制成本(工單性質(zhì)為11)目的為取重工后單價(jià) p500_wipx0end ifend p500_rework2p500_rework1()在須計(jì)算的資料中抓當(dāng)前料件異動(dòng)資料 tlf_tmpforeach 料件從ccc_file 中抓當(dāng)期資料,否則置

22、零處理wip重工成本(重工sfb99=y -工單檔sfb_file 重工否) p500_wip_reworkend foreachend p500_rework1p500_rework2()在須計(jì)算的資料中抓當(dāng)前成本階所有料件異動(dòng)資料 tlf_tmpforeach 料件從ccc_file 中抓當(dāng)期資料,否則置零加上wip重工入庫金額p500_ccg2_cost計(jì)算所有出庫成本及結(jié)存 p500_ccc_tot(2)更新ccc_file p500_ccc_updend endp500_wipx0()在須計(jì)算的資料中抓當(dāng)前料件異動(dòng)資料 tlf_tmpforeach 料件從ccc_file 中抓當(dāng)期資

23、料,否則置零 p500_wipxend endp500_last0()取上期結(jié)存轉(zhuǎn)本月期初p500_tlf對(duì)某一料件由tlf檔分類統(tǒng)計(jì)入出庫數(shù)量并分別取入庫成本,出庫成本暫未處理(由tlf 取異動(dòng)單類型xxx/單號(hào)xxx1/項(xiàng)次xxx2) when tlf131,4=axmt or tlf13 = aomt800 銷貨領(lǐng)出let g_ccc.ccc61=g_ccc.ccc61+q_tlf.tlf10*u_sign call p500_ccc63_cost(u_sign)if u_sign = 1 then let g_ccc.ccc64=g_ccc.ccc64+q_tlf.tlf10*u_si

24、gn end ifwhen q_tlf.tlf13=aimt301 or q_tlf.tlf13=aimt311 #報(bào)廢異動(dòng)(aimt303,aimt313)應(yīng)列入雜項(xiàng)異動(dòng)中 or q_tlf.tlf13 = aimt303 or q_tlf.tlf13 =aimt313let g_ccc.ccc41=g_ccc.ccc41+q_tlf.tlf10*u_signwhen q_tlf.tlf131,5=asfi5 #工單發(fā)料 if g_sfb99=y then #重工領(lǐng)出 let g_ccc.ccc25=g_ccc.ccc25+q_tlf.tlf10*u_sign else #一般工單領(lǐng)出 le

25、t g_ccc.ccc31=g_ccc.ccc31+q_tlf.tlf10*u_sign end ifwhen q_tlf.tlf131,5=asft6 #工單入庫 if q_tlf.tlf02 = 65 or q_tlf.tlf03 = 65 then #拆件工單(成本由wip處理) let g_ccc.ccc31=g_ccc.ccc31+q_tlf.tlf10*u_sign else if g_sfb99=y then #重工入庫(成本由重工wip轉(zhuǎn)出) let g_ccc.ccc27=g_ccc.ccc27+q_tlf.tlf10*u_sign else #一般入庫 let g_ccc.

26、ccc21=g_ccc.ccc21+q_tlf.tlf10*u_sign call p500_ccc22_cost() #取成本 end if end ifwhen q_tlf.tlf13 = aimt302 or q_tlf.tlf13 = aimt312 let g_ccc.ccc21=g_ccc.ccc21+q_tlf.tlf10 let g_ccc.ccc43=g_ccc.ccc43+q_tlf.tlf10 call p500_ccc22_cost()u_flag為入出庫標(biāo)志when u_flag=1 #一般工單入庫、采購入、倉退 let g_ccc.ccc21=g_ccc.ccc21

27、+q_tlf.tlf10*u_sign call p500_ccc22_cost() #取入庫成本when u_flag=5 #調(diào)整 let g_ccc.ccc51=g_ccc.ccc51+q_tlf.tlf10*u_signwhen u_flag=6 #盤差 let g_ccc.ccc71=g_ccc.ccc71+q_tlf.tlf10*u_sign otherwise continue foreachp500_ccc22_cost()取入庫成本工單入庫成本暫不處理 (tlf13 matches asf*) 工單入庫成本應(yīng)由wip轉(zhuǎn)入,故加工費(fèi)于wip_2_22()歸入投入成本,再轉(zhuǎn)入庫如為

28、委外退庫暫不處理if q_tlf.tlf13 matches apmt107* then let l_pmm02=null select pmm02 into l_pmm02 from pmm_file where pmm01=q_tlf.tlf036 and pmm18 x if l_pmm02=sub then return end if #-委外退庫亦由wip轉(zhuǎn)出 end ifwhen q_tlf.tlf13 matches aimt30* #雜項(xiàng)入zzzcall p500_ccc44_cost() let amt=l_ccc23 * q_tlf.tlf10 * u_signwhen q

29、_tlf.tlf13 = aimt720 or #調(diào)撥入zzzq_tlf.tlf13 = aimp700 or q_tlf.tlf13 = aimp701 let amt = g_ccc.ccc23 * q_tlf.tlf10 #直接取上月平均單價(jià)otherwise #取發(fā)發(fā)票請(qǐng)款立帳金額select apa44,sum(apb101) #帳款單身成本分?jǐn)偙編沤痤~為了配合成本分?jǐn)傋鳂I(yè)aapt900 故改apb10為取apb101 from apb_file,apa_filewhere apb21=xxx1 and apb22=xxx2 #xxx1為tlf單據(jù)號(hào),xxx2為項(xiàng)次and apb01

30、=apa01 and apa00 = 11 #帳款性質(zhì)為進(jìn)貨發(fā)票and apa75 != y and apa42 = n #非外購資料且未作廢帳款 and apa02 between g_bdate and g_edate group by 1問題:為何不判斷確認(rèn)否?apa41=yselect apa44,sum(apb101) #扣除折讓部分(退貨) from apb_file,apa_file where apb21=xxx1 and apb22=xxx2 and apb01=apa01 and apa00 = 21 and apa58 = 2 and apa75 != y #帳款為退貨折

31、讓 and apa42 = n and apa02 between g_bdate and g_edategroup by 1金額取絕對(duì)值若為外購信用狀入庫則取到貨分?jǐn)偤蠼痤~sum(ale09)select alk72,sum(ale09) from ale_file ,alk_filewhere ale16=xxx1 and ale17=xxx2 and ale01=alk01group by 1更新tlf 檔,其中雜收不更新,由axct500確定if q_tlf.tlf13 != aimt302 and q_tlf.tlf13 != aimt312 then update tlf_file

32、 set (tlf21,tlf221,tlf222,tlf2231,tlf2232,tlf224, tlf211,tlf212,tlf65) =(amt,amta,amtb,amtc,amtd,amte,today,g_time,l_apa44)where rowid=q_tlf_rowedp500_ccc44_cost()取雜項(xiàng)入庫成本先取本月雜項(xiàng)入庫金額檔inb_file (手工維護(hù))如無單價(jià)則取期初開帳金額 cca_file仍無單價(jià)則取上月平均ccc_file ccc23p500_ccc63_cost()本月銷貨收入p500_ccb_cost()加入庫庫調(diào)整金額p500_ccg_cost

33、()加上wip入庫金額(工單主件在制成本)非重工的、非預(yù)測(cè)工單、非拆件式工單的工單主件在制成本p500_ccg2_cost()加上wip重工入庫金額重工的、非預(yù)測(cè)工單、非拆件式工單的工單主件在制成本p500_ccc_tot(1 or 2) 計(jì)算所有出庫成本及結(jié)存1第一階段,先不處理重工2第二階段,處理重工if 2 則處理重工 p500_ccc_ccc26 ccc26重工領(lǐng)出金額p500_ccc_ccc23 ccc23本月平均單價(jià)if 第一階段且當(dāng)前成本階不須計(jì)算重工 或 第二階段let 本月工單領(lǐng)用成本=0 g_ccc_ccc32let 本月雜項(xiàng)領(lǐng)用成本=0 42let 本月其他領(lǐng)用成本=0

34、52let 本月銷貨成本=0 62/62a/62b/62c/62d/62elet 本月盤盈虧金額=0 72let 本月銷退成本=0 66/66a-ep500_tlf21_updend iflet 本月結(jié)存數(shù)量ccc91=上月結(jié)存數(shù)量ccc11+本月入庫數(shù)量ccc21(采購入+工單入+委外入)+本月重工領(lǐng)出ccc25+本月重工入庫數(shù)量ccc27+本月工單領(lǐng)用數(shù)量ccc31+本月雜項(xiàng)領(lǐng)用數(shù)量ccc41+本月其他調(diào)整數(shù)量ccc51+本月銷貨數(shù)量ccc61+本月盤盈虧數(shù)量ccc71let 本月結(jié)存金額ccc92=上月結(jié)存金額ccc12+本月入庫金額ccc22(材料22a+人工22b+制費(fèi)22c+加工2

35、2d+其他22e)+本月重工領(lǐng)出金額ccc26+本月重工入庫金額ccc28+本月工單領(lǐng)用成本ccc32+本月雜項(xiàng)領(lǐng)用成本ccc42+本月其他調(diào)整成本ccc52+本月銷貨成本ccc62+本月盤盈虧金額ccc72銷退數(shù)量ccc64和銷退成本ccc66未考慮?let 本月結(jié)存材料金額=本月結(jié)存數(shù)量ccc91*本月平均單價(jià)-材料ccc223a人工制費(fèi)委外其他差異金額ccc93p500_ccc_ccc26處理重工領(lǐng)出金額p500_ccc_ccc23()計(jì)算本月重工工單部分的平均單價(jià)先取期初開帳,再取上月余額進(jìn)行計(jì)算平均單價(jià)p500_tlf_upd()更新tlf 檔單價(jià)p500_ccc_ins()更新cc

36、c檔成本金額p500_cch_0()將工單元件在在制成本檔按上月期末轉(zhuǎn)本月期初,其余歸零p500_cch_01()將工單元件在在制成本檔全部歸零wip_del()刪除工單在制成本檔(ccg/cch)p500_wip()處理wip工單在制成本(工單性質(zhì)1/7)select * from sfb_file #找當(dāng)前料件在制工單(非重工) where sfb05 =g_ima01 and sfb02!= 13 and sfb02 != 11 and (sfb99 is null or sfb99 = or sfb99=n) and (sfb38 is null or sfb38 = g_bdate)

37、 # 工單成會(huì)結(jié)帳日 and (sfb81 is null or sfb81 = g_edate) # 工單開立日期 order by sfb01先delete ccg/cch wip_del計(jì)算每張工單的wip主件部分成本(ccg) wip_1()計(jì)算每張工單的wip元件投入成本(cch) wip_2()計(jì)算每張工單的wip元件轉(zhuǎn)出成本(cch) wip_3()計(jì)算每張工單的wip主件sum成本(ccg) wip_4()p500_wip_rework()處理wip-rework在制成本(重工sfb99=y)先delete ccg/cch wip_del2計(jì)算每張工單的wip主件部分成本(cc

38、g) wip_1()計(jì)算每張工單的wip元件投入成本(cch) wip_2()計(jì)算每張工單的wip元件轉(zhuǎn)出成本(cch) wip_3()計(jì)算每張工單的wip主件sum成本(ccg) wip_4()wip_1()計(jì)算每張工單的wip主件部分成本(ccg)將mccg歸零p500_mccg_0wip上期期末數(shù)量轉(zhuǎn)本期期初(先取在制工單成本數(shù)量ccg91,再取在制開帳檔數(shù)量ccf11)工時(shí)統(tǒng)計(jì)wip_ccg20(取ccj檔工單合計(jì)工時(shí))計(jì)算每張工單wip主件轉(zhuǎn)出數(shù)量wip_ccg31 (取tlf檔成品入庫-成品退庫)更新ccg_filewip_ccg20()select sum(ccj05) into

39、 mccg.ccg20 from ccj_file #取ccj檔工單合計(jì)工時(shí) where ccj04=g_sfb.sfb01 and ccj01 between g_bdate and g_edatewip_ccg31()計(jì)算工單wip主件轉(zhuǎn)出數(shù)量select sum(tlf10*tlf60) into g_make_qty from tlf_file # 當(dāng)月成品入庫量 where tlf62=g_sfb.sfb01 and tlf06 between g_bdate and g_edate and (tlf03 = 50) and tlf13 matches asft6*and (tlf0

40、1 = g_sfb.sfb05)select sum(tlf10*tlf60) into g_make_qty2 from tlf_file #當(dāng)月成品退庫量 where tlf62=g_sfb.sfb01 and tlf06 between g_bdate and g_edate and (tlf02 = 50) and tlf13 matches asft6*and (tlf01 = g_sfb.sfb05)轉(zhuǎn)出數(shù)量(以負(fù)數(shù)表示)=退庫量-入庫量wip_ccg21()計(jì)算每張工單的wip主件投入數(shù)量抓工單發(fā)料底稿sfq的成套發(fā)料(sfp=1)-成套退料(sfp=6)wip_2()計(jì)算每張工單的wip元件期初/本期投入成本cchstep1. wip元件上期末轉(zhuǎn)本期期初 wip_2_1step2-1 wip元件本期投入材料(依工單發(fā)料/退料檔) wip_2_21計(jì)算每張工單的wip主件投入數(shù)量 wip_ccg21step2-2 wip元件 本期投入人工制費(fèi) wip_2_22step2-3 wip元件 本期投入調(diào)整成本 wip_2_23wip_2_1()先取cch檔上期轉(zhuǎn)本期期初再取ccf在制開帳檔轉(zhuǎn)本期期初wip_2_21()wip元件 本期投入材料(依工單發(fā)/退料檔) 同時(shí)結(jié)出投入金額select tlf01,ima08,ima57,tlf02,tlf03,tlf13,s

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論