저는 quickbooks 데스크탑 (엔터프라이즈 에디션)에서 대변 메모를 프로그래밍 방식으로/C# 코드를 통해 검색해야한다는 요구 사항이 있습니다.C# 코드를 통해 quickbooks 데스크탑에서 대변 메모를받습니다.
누구든지이 코드/방법을 사용하도록 도와 줄 수 있습니까?
감사합니다.
저는 quickbooks 데스크탑 (엔터프라이즈 에디션)에서 대변 메모를 프로그래밍 방식으로/C# 코드를 통해 검색해야한다는 요구 사항이 있습니다.C# 코드를 통해 quickbooks 데스크탑에서 대변 메모를받습니다.
누구든지이 코드/방법을 사용하도록 도와 줄 수 있습니까?
감사합니다.
CreditMemoQuery를 사용해야합니다.
화면상의 참조 가이드 - http://developer-static.intuit.com/qbsdk-current/common/newosr/index.html을 보거나 다른 요청에 대한 샘플을보고 수정하십시오.
https://developer.intuit.com/docs/0250_qb/0050_documentation/sample_code
사용 ICreditMemoQuery
객체의 QuickBooks에서 신용 메모 목록을 검색 할 수 있습니다. 다음은 QuickBooks SDK 13.0을 사용하여 대변 메모 목록을 가져 오는 샘플 C# 코드입니다.
using QBXMLRP2Lib;
using Interop.QBFC13;
public class SDKApp
{
private QBSessionManager sessionMgr;
public SDKApp()
{
// in the class constructor - sessionMgr is a member variable
sessionMgr = new QBSessionManager();
}
public void GetCreditMemoData()
{
// open connection and begin session before data fetch - intentionally skipped this code
IMsgSetRequest msgset = null;
ICreditMemoQuery creditMemoQuery = null;
try
{
// during data fetch
msgset = sessionMgr.CreateMsgSetRequest("US", 13, 0);
creditMemoQuery = msgset.AppendCreditMemoQueryRq();
creditMemoQuery.ORTxnQuery.TxnFilter.ORDateRangeFilter.ModifiedDateRangeFilter.FromModifiedDate.SetValue(new DateTime(2012, 3, 31), false); // you can apply filters too
IMsgSetResponse msgRes = sessionMgr.DoRequests(msgset);
IResponseList responseList = msgRes.ResponseList;
if (responseList.Count > 0)
{
IResponse response = responseList.GetAt(0);
ICreditMemoRetList creditMemoList = response.Detail as ICreditMemoRetList;
if (creditMemoList == null)
{
return;
}
for (int i = 0; i <= creditMemoList.Count - 1; i++)
{
ICreditMemoRet qbCreditMemo = creditMemoList.GetAt(i);
Console.WriteLine("Credit no.:" + qbCreditMemo.TxnNumber.GetValue() + " Customer:" + qbCreditMemo.CustomerRef.FullName.GetValue() + " Total:" + qbCreditMemo.TotalAmount.GetValue());
}
}
}
catch (Exception ex)
{
//handle exception here
}
finally
{
if (msgset != null)
{
Marshal.FinalReleaseComObject(msgset);
}
if (creditMemoQuery != null)
{
Marshal.FinalReleaseComObject(creditMemoQuery);
}
}
// end session and close connection after data fetch - intentionally skipped this code
}
}
희망이 있습니다.
나는 위에서 언급 한 방법을 사용했지만 Quickbooks에서 모든 대변 메모를 검색하려고합니다. Quickbooks 통합에 익숙하지 않아서 CreditMemoQuery()를 이해하는 것이 어려웠습니다. QB에서 신용 메모 만 가져 오는 관련 코드로 나를 도와 주면 좋을 것입니다. – Shyam