我需要将应付款管理系统缩放窗口的内容返回给我正在编写的另一个应用程序。我已成功使用eConnect撤回应付款管理系统事务条目,但无法找到获取订单项详细信息的位置。有人能指出我正确的方向吗?我从未与Dynamics合作过。我并不反对直接进入数据库,但(到目前为止)还没有找到很好的数据库设计参考。
非常感谢任何帮助。
答案 0 :(得分: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
}