2014-01-28 14:21 阅读 81

如何使用SDK(PHP)在QuickBooks Online中添加日记条目

In my project I am integrating QuickBooks Online by PHP. Here I want to add journal entry. So I have downloaded the SDK for PHP. And able to connect QuickBook Online and successfully add some customer.

But my real requirement is adding Journal Entry, but there is no example for journal entry. So I am wondering how I can add Journal using that SDK? Which class I need to use for Journal Entry? And How can I pass the journal data?

Please help me.

Thanks in Advance

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

2条回答 默认 最新

  • 已采纳
    doucao8982 doucao8982 2014-01-30 13:07

    I searched the sdk and found, there is a class IPPJournalEntry which will be used here for journal entry add. Along with this we need two more classes IPPLine, IPPJournalEntryLineDetail.


    点赞 评论 复制链接分享
  • duanji5746 duanji5746 2014-01-28 16:36

    If you're using the open-source QuickBooks PHP DevKit provided on GitHub:

    Then you can find the quick-start guide to getting connected here:

    And a detailed working example of adding a journal entry here:

    The code ends up looking something like:

    $JournalEntryService = new QuickBooks_IPP_Service_JournalEntry();
    // Main journal entry object
    $JournalEntry = new QuickBooks_IPP_Object_JournalEntry();
    // Debit line
    $Line1 = new QuickBooks_IPP_Object_Line();
    $Line1->setDescription('Line 1 description');
    $Detail1 = new QuickBooks_IPP_Object_JournalEntryLineDetail();
    // Credit line
    $Line2 = new QuickBooks_IPP_Object_Line();
    $Line2->setDescription('Line 2 description');
    $Detail2 = new QuickBooks_IPP_Object_JournalEntryLineDetail();
    if ($resp = $JournalEntryService->add($Context, $realm, $JournalEntry))
        print('Our new journal entry ID is: [' . $resp . ']');
    点赞 评论 复制链接分享