English version
German version
Spanish version
French version
Italian version
Portuguese / Brazilian version
Dutch version
Greek version
Russian version
Japanese version
Korean version
Simplified Chinese version
Traditional Chinese version
Hindi version
Czech version
Slovak version
Bulgarian version
 

大平原定制?編程自動適用於應收賬款

軟件 RSS Feed





微軟大平原是三個微軟商務解決方案中型市場ERP產品:大平原,所羅門群島,Navision的。考慮到大平原,是現在非常好的候選人整合POS機 應用程序,如微軟零售管理系統或RMS和客戶關係系統,如微軟的CRM?有共同的需要,在大平原的定制和集成,尤其是在一級質譜 SQL Server的事務處理SQL查詢和存儲procedures.In這個小文章中,我們將向您展示如何創建自動適用於實用,當你整合數量龐大的銷售交易和支付。我們將與 RM20101?應收賬款打開文件和RM20201?應收款的應用打開File.Let氏參見SQL代碼:DECLARE @ curpmtamt數字(19,5)宣布@ curinvamt數字(19,5)宣布@ curpmtnum類型為varchar(20)宣布@ curinvnum 類型為varchar(20)宣布@ curinvtype intdeclare @ curpmttype intdeclare @ MaxID公司intdeclare @反廉政-創建一個臨時表#tablecreate溫度([編號]廉政身份(1,1)主鍵,CUSTNMBR類型為varchar(15),INVNUM 類型為varchar(20),INVTYPE廉政,PMTNUM類型為varchar(20),PMTTYPE廉政,INVAMT數字(19.5),PMTAMT數字(19.5),AMTAPPLIED數字(19,5))上創建索引IDX_INVNUM#溫度(INVNUM)在創建索引IDX_PMTNUM#溫度(PMTNUM) -插入 未用發票和paymentsinsert到#溫度(CUSTNMBR,INVNUM,INVTYPE,PMTNUM,PMTTYPE,INVAMT,PMTAMT,AMTAPPLIED)selectCUSTNMBR = a.CUSTNMBR,INVNUM = b.DOCNUMBR,INVTYPE = b.RMDTYPAL,PMTNUM = a.DOCNUMBR,PMTTYPE = a.RMDTYPAL,INVAMT = b.CURTRXAM,PMTAMT = a.CURTRXAM,AMTAPPLIED = 0from RM20101 ajoin RM20101 b關於(a.CUSTNMBR = b.CUSTNMBR)加入RM00101 C對(a.CUSTNMBR = c.CUSTNMBR)wherea.RMDTYPAL在(7,8,9)andb.RMDTYPAL在(1,3) anda.CURTRXAM 0 andb.CURTRXAM 0order bya.custnmbr,b.DOCDATE,a.DOCDATE,a.DOCNUMBR,b.DOCNUMBR - -遍歷每個recordselect @ MaxID公司=最大值([編號])由#tempselect @反= 1while @反= @ curpmtamt)和 (@ curpmtamt“0)和(@ curinvamt”0) -如果發票金額大於或等於支付amountbeginselect @ curinvamt = @ curinvamt - @ curpmtamt -發票金額其餘-更新的金額, 適用於從目前的發票-目前paymentupdate#tempsetAMTAPPLIED = @ curpmtamtwhere [編號] = @櫃檯-更新金額發票remainingupdate#tempsetINVAMT = @ curinvamtwhereINVNUM = @ curinvnum andINVTYPE = @ curinvtype -最新的金額付款remainingupdate#tempsetPMTAMT = 0wherePMTNUM = @ curpmtnum andPMTTYPE = @ curpmttypeendelse如果(@ curinvamt 0)和(@ curinvamt“0) -如果發票金額較小 到付款amountbeginselect @ curpmtamt = @ curpmtamt - @ curinvamt -付款金額餘下-更新的數額應用於從目前的發票-目前paymentupdate#tempsetAMTAPPLIED = @ curinvamtwhere [編號] = @櫃檯-更新金額發票remainingupdate#tempsetINVAMT = 0whereINVNUM = @ curinvnum andINVTYPE = @ curinvtype -最新的金額付款remainingupdate#tempsetPMTAMT = @ curpmtamtwherePMTNUM = @ curpmtnum andPMTTYPE = @ curpmttypeend -轉到下一個recordselect = @ @櫃檯櫃檯+ 1end -最新的RM打開的表的正確amountsupdateRM20101setCURTRXAM = b.INVAMTfromRM20101 ajoin#B的溫度(a.DOCNUMBR = b.INVNUM和a.RMDTYPAL = b.INVTYPE)updateRM20101setCURTRXAM = b.PMTAMTfromRM20101 ajoin#B的溫度(a.DOCNUMBR = b.PMTNUM和a.RMDTYPAL = b.PMTTYPE) - -創建的RM記錄或應用 已更新記錄,如果existupdateRM20201setDATE1 =轉換(類型為varchar(10),getdate(),101),GLPOSTDT =轉換(類型為varchar(10),getdate(),101),APPTOAMT = APPTOAMT + a.AMTAPPLIED,ORAPTOAM = ORAPTOAM + a.AMTAPPLIED,APFRMAPLYAMT = APFRMAPLYAMT + a.AMTAPPLIED,ActualApplyToAmount = APFRMAPLYAMT + a.AMTAPPLIEDfrom#氣溫ajoin RM20101 b關於(b.DOCNUMBR = a.INVNUM和b.RMDTYPAL = a.INVTYPE)加入RM20101 C對(c.DOCNUMBR = a.PMTNUM和c.RMDTYPAL = a.PMTTYPE)加入RM20201 D對(d.APFRDCTY = a.PMTTYPE andd.APFRDCNM = a.PMTNUM andd.APTODCTY = a.INVTYPE andd.APTODCNM = a.INVNUM)wherea.AMTAPPLIED 0insert成

文章來源: Messaggiamo.Com

Translation by Google Translator





Related:

» Seo Elite: New Seo Software!
» AntiSpywareBOT
» Reverse Mobile
» Error Nuker


網管得到HTML代碼
加上這條到你的網站!

網站管理員提交你的文章
無須登記!填寫好的表格和你的文章是在 Messaggiamo.Com 目錄!

Add to Google RSS Feed See our mobile site See our desktop site Follow us on Twitter!

提交你的文章,以 Messaggiamo.Com 目錄

分類


版權 2006-2011 Messaggiamo.Com - 網站地圖 - Privacy - 網站管理員提交你的文章,以 Messaggiamo.Com 目錄 [0.01]
Hosting by webhosting24.com
Dedicated servers sponsored by server24.eu