2010-06-21 90 views
0

我需要將應付款管理系統分配縮放窗口的內容返回到我正在編寫的另一個應用程序。我已成功使用eConnect撤回應付賬款事務條目,但無法找到獲取訂單項明細的位置。有人能指引我朝着正確的方向嗎?我從未與Dynamics合作過。我並不反對直接進入數據庫,但(至今)尚未找到DB設計的非常好的參考。需要幫助從Microsoft Dynamics GP獲取數據10

任何幫助,非常感謝。

回答

0

我打算髮布我的當前解決方案,它滿足了我的需求,但如果有人看到更好的方法來完成此操作,請讓我知道!

的SQL:

SELECT 
     P1.VENDORID 
     ,LTRIM(RTRIM(GL1.ACTNUMBR_1)) + '-' + LTRIM(RTRIM(GL1.ACTNUMBR_2)) AS 'ACCOUNT' 
     ,P2.DISTTYPE 
     ,P2.DEBITAMT 
     ,P2.CRDTAMNT 
     ,V.[Vendor Name] 
     ,P1.VCHRNMBR  
     ,P1.DOCNUMBR 
     ,P1.DOCDATE 
     ,P1.BACHNUMB 
     ,P1.TRXDSCRN 
     ,P2.DOCTYPE 
     ,C.ACTINDX 
     ,P3.DOCNUMBR 
    FROM 
     PM30200 P1 WITH(NOLOCK) 
    INNER JOIN 
     PM30600 P2 ON P1.VCHRNMBR = P2.VCHRNMBR 
    INNER JOIN 
     GL00100 GL1 ON GL1.ACTINDX = P2.DSTINDX 
    INNER JOIN 
     Vendors V ON V.[Vendor ID] = P1.VENDORID 
    LEFT OUTER JOIN 
     PM00400 P3 ON P3.TRXSORCE = P1.TRXSORCE AND P3.CNTRLTYP = 1 AND P3.DOCTYPE = 6 AND P3.VENDORID = P1.VENDORID 
    LEFT OUTER JOIN 
     CM00100 C ON C.CHEKBKID = P3.CHEKBKID 

我還創建了兩個枚舉映射的一些數據:

public enum DISTTYPE 
     { 
      Cash = 1, 
      Pay = 2, 
      Avail = 3, 
      Taken = 4, 
      Fnchg = 5, 
      Purch = 6, 
      Trade = 7, 
      Misc = 8, 
      Freight = 9, 
      Taxes = 10, 
      Write = 11, 
      Other = 12, 
      Gst = 13, 
      Wh = 14, 
      Unit = 15, 
      Round = 16 
     } 

     public enum DOCTYPE 
     { 
      Invoice = 1, 
      [Description("Finance Charge")] 
      FinanceCharge = 2, 
      [Description("Miscellaneaous Charge")] 
      MiscellaneaousCharge = 3, 
      Return = 4, 
      [Description("Credit Memo")] 
      CreditMemo = 5, 
      [Description("Manual Checks")] 
      ManualChecks = 6 
     }