コード例 #1
0
$SalesReceipt->addSalesReceiptLine($Line1);

print('qbXML SalesReceipt for QuickBooks qbXML US editions: ' . "\r\n");
print($SalesReceipt->asQBXML(QUICKBOOKS_ADD_SALESRECEIPT, null, QUICKBOOKS_LOCALE_UNITED_STATES));

print("\r\n\r\n");

print('qbXML SalesReceipt for QuickBooks qbXML Online Edition: ' . "\r\n");
print($SalesReceipt->asQBXML(QUICKBOOKS_ADD_SALESRECEIPT, null, QUICKBOOKS_LOCALE_ONLINE_EDITION));


exit;
*/
// Create a new Customer object
$Customer = new QuickBooks_QBXML_Object_Customer();
// Set some fields
$Customer->setFullName('Contractors:ConsoliBYTE, LLC:Keith Palmer');
$Customer->setCustomerTypeFullName('Web:Direct');
$Customer->setNotes('Test notes go here.');
print 'qbXML Customer for QuickBooks qbXML (latest version the framework supports): ' . "\r\n";
print $Customer->asQBXML(QUICKBOOKS_ADD_CUSTOMER);
print "\r\n\r\n";
print 'qbXML Customer for QuickBooks qbXML US editions: ' . "\r\n";
print $Customer->asQBXML(QUICKBOOKS_ADD_CUSTOMER, null, QuickBooks_QBXML::LOCALE_UNITED_STATES);
print "\r\n\r\n";
print 'qbXML Customer for QuickBooks qbXML Online Edition: ' . "\r\n";
print $Customer->asQBXML(QUICKBOOKS_ADD_CUSTOMER, null, QuickBooks_QBXML::LOCALE_ONLINE_EDITION);
print "\r\n\r\n";
$Customer->setListID('1234');
$Customer->setEditSequence('5678');
コード例 #2
0
<?php

require_once '../QuickBooks.php';
$Customer = new QuickBooks_QBXML_Object_Customer();
$Customer->setName('Child Derpé Customer Name');
$Customer->setPhone('860-634-1602');
$Customer->setEmail('*****@*****.**');
$Customer->setFirstName('Keith');
$Customer->setLastName('Palmer');
// Set the parent of the customer
$Customer->setParentFullName('Parent & Customer Name');
// You could also set the parent customer by ListID too
//$Customer->setParentListID('ABCD-1234');
print $Customer->asQBXML(QUICKBOOKS_ADD_CUSTOMER, 6.0, QUICKBOOKS_LOCALE_ONLINE_EDITION);
コード例 #3
0
 function _quickbooks_customer_add_request($requestID, $user, $action, $ID, $extra, &$err, $last_action_time, $last_actionident_time, $version, $locale)
 {
     //Fetch the customer using ORM with the unique ID
     $mycustomer = ORM::factory('customer', $ID);
     //Fetch all your customer details using the ID passed back up to this function
     $firstname = $mycustomer->firstname;
     $lastname = $mycustomer->lastname;
     $fullname = $firstname . ' ' . $lastname;
     //Generate a QBXML object
     $Customer = new QuickBooks_QBXML_Object_Customer();
     $Customer->setFullName($fullname);
     $Customer->setFirstName($firstname);
     $Customer->setLastName($lastname);
     $Customer->setCompanyName($companyname);
     //Format the proper QBXML to return to the web connector
     $qbxml = $Customer->asQBXML('CustomerAddRq');
     $qbxml = $this->formatForOutput($qbxml);
     //Log that the customer has been generated
     Kohana::$log->add(Log::NOTICE, "\nCustomer QBXML:\n" . $qbxml);
     //send down to web connector
     return $qbxml;
 }