2016-06-14 10 views

답변

0

CreditMemoQuery를 사용해야합니다.

화면상의 참조 가이드 - http://developer-static.intuit.com/qbsdk-current/common/newosr/index.html을 보거나 다른 요청에 대한 샘플을보고 수정하십시오.

https://developer.intuit.com/docs/0250_qb/0050_documentation/sample_code

+0

나는 위에서 언급 한 방법을 사용했지만 Quickbooks에서 모든 대변 메모를 검색하려고합니다. Quickbooks 통합에 익숙하지 않아서 CreditMemoQuery()를 이해하는 것이 어려웠습니다. QB에서 신용 메모 만 가져 오는 관련 코드로 나를 도와 주면 좋을 것입니다. – Shyam

0

사용 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 
    } 
} 

희망이 있습니다.