$Line->setQuantity(5); $Line->setItemName('Keiths Item'); $SalesReceipt->addSalesReceiptLine($Line); print_r($SalesReceipt); print $SalesReceipt->asQBXML(QUICKBOOKS_ADD_SALESRECEIPT); exit; $JournalEntry = new QuickBooks_Object_JournalEntry(); $JournalEntry->setTransactionDate('2009-02-02'); $DebitLine = new QuickBooks_Object_JournalEntry_JournalDebitLine(); $DebitLine->setAmount(45.0); $DebitLine->setAccountName('Test'); $JournalEntry->addDebitLine($DebitLine); $CreditLine1 = new QuickBooks_Object_JournalEntry_JournalCreditLine(); $CreditLine1->setAmount(25.0); $CreditLine1->setAccountName('Services'); $JournalEntry->addCreditLine($CreditLine1); $CreditLine2 = new QuickBooks_Object_JournalEntry_JournalCreditLine(); $CreditLine2->setAmount(20.0); $CreditLine2->setAccountName('Sales'); $JournalEntry->addCreditLine($CreditLine2); //print_r($JournalEntry); print $JournalEntry->asQBXML(QUICKBOOKS_ADD_JOURNALENTRY); exit; $Customer = new QuickBooks_Object_Customer(); $Customer->setFirstName('Keith'); $Customer->set('LastName', 'Palmer'); $Customer->set('ShipAddress Addr1', '56 Cowles Road'); $Customer->setShipAddress('56 Cowles Road', '', '', '', '', 'Willington', 'CT'); $defaults = array('ShipAddress Addr2' => 'bla', 'ShipAddress Country' => 'United States'); //print_r($Customer->getShipAddress(null, $defaults)); //print($Customer->asXML(QUICKBOOKS_OBJECT_XML_DROP, "\t", 'CustomerAdd'));
$priority_of_add_estimate_request = 10; // Make sure this is lower than the customer add it depends on if ($API->addEstimate($Estimate, '_quickbooks_ca_estimate_add_callback', $primary_key_of_estimate_in_your_application, $priority_of_add_estimate_request)) { print 'Queued up a request to add estimate #' . $primary_key_of_estimate_in_your_application . ' to QuickBooks!' . "\n"; } // Journal entry $JournalEntry = new QuickBooks_Object_JournalEntry(); $JournalEntry->setTransactionDate('January 2, 2009'); $DebitLine = new QuickBooks_Object_JournalEntry_JournalDebitLine(); $DebitLine->setAmount(45.0); $DebitLine->setAccountName('Test Bank Account'); $JournalEntry->addDebitLine($DebitLine); $CreditLine = new QuickBooks_Object_JournalEntry_JournalCreditLine(); $CreditLine->setAmount(45.0); $CreditLine->setAccountName('Automobile Expense'); $JournalEntry->addCreditLine($CreditLine); if ($API->addJournalEntry($JournalEntry, '_quickbooks_ca_journalentry_add_callback')) { print 'Queued up an add journal entry request to QuickBooks!' . "\n"; } // Adding a payment for a customer $Payment = new QuickBooks_Object_ReceivePayment(); $Payment->setCustomerApplicationID($primary_key_of_customer_in_your_application); $Payment->setRefNumber(1234); $Payment->setTxnDate(date('Y-m-d')); $Payment->setTotalAmount(50.0); $Payment->setIsAutoApply(true); $priority_of_add_payment_request = 5; // Make sure this is lower than the customer add it depends on if ($API->addReceivePayment($Payment, '_quickbooks_ca_payment_add_callback', null, $priority_of_add_payment_request)) { print 'Queued up a request to add a payment to QuickBooks!' . "\n"; }
<?php require_once '../QuickBooks.php'; $JE = new QuickBooks_Object_JournalEntry(); $JE->setTxnDate('2011-01-01'); $JE->setMemo('test memo'); $CreditLine = new QuickBooks_Object_JournalEntry_JournalCreditLine(); $CreditLine->setAccountName('test'); $JE->addCreditLine($CreditLine); print $JE->asQBXML(QUICKBOOKS_ADD_JOURNALENTRY);