阅读JournalEntry行和详细信息

时间:2014-05-21 14:02:17

标签: php quickbooks-online

在QuickBooks PHP API V3中,我获得了JournalEntries。但是我无法获得Line和Line的详细信息 - 我该怎么做?

$journalEntrys = $JournalEntryService->query($Context, $realm, "select * from JournalEntry WHERE TxnDate >= '" .$startDate ."' AND TxnDate <= '" .$endDate ."'");

//print_r($customers);

foreach ($journalEntrys as $JournalEntry)
{
    //NEED TO GET EACH LIKE AND EACH LINE DETAIL...HOW?
    $line = new QuickBooks_IPP_Object_Line();
    $line = $JournalEntry->getLine();
    array_push($returnArray, array("id"=>str_replace("}", "", str_replace("{-", "", $JournalEntry->getId())),"txnDate"=>$JournalEntry->getTxnDate(),"lines"=>$line->getId(),"TotalAmt"=>$JournalEntry->getTotalAmt()));
}

1 个答案:

答案 0 :(得分:0)

使用&#34; for&#34;循环查看这些行...

$num_lines = $JournalEntry->countLine();   // How many lines are there? 

for ($i = 0; $i < $num_lines; $i++)
{
  $Line = $JournalEntry->getLine($i);   // Get a line
  print_r($Line);   // Print out the line object

  $details = $Line->getJournalEntryLineDetail();   // Get the details
  print_r($details);   // Print out the details
}