Reputation: 51
I'm trying to add company name when I add a new customer, anyone can help? By the way, where is the documentation for quickboos-php devkit , I can't find it as well. The below is the code:
$CustomerService = new QuickBooks_IPP_Service_Customer();
//add basic info
$Customer = new QuickBooks_IPP_Object_Customer();
$Customer->setTitle($title);
$Customer->setGivenName($given_name);
$Customer->setMiddleName($middel_name);
$Customer->setFamilyName($family_name);
$Customer->setDisplayName($display_name);
// Phone #
$PrimaryPhone = new QuickBooks_IPP_Object_PrimaryPhone();
$PrimaryPhone->setFreeFormNumber($primary_phone);
$Customer->setPrimaryPhone($PrimaryPhone);
// Mobile #
$Mobile = new QuickBooks_IPP_Object_Mobile();
$Mobile->setFreeFormNumber($mobile);
$Customer->setMobile($Mobile);
// Bill address
$BillAddr = new QuickBooks_IPP_Object_BillAddr();
$BillAddr->setLine1($bill_address);
$BillAddr->setCity($bill_city);
$BillAddr->setCountrySubDivisionCode($bill_state);
$BillAddr->setCountry($bill_country);
$BillAddr->setPostalCode($bill_zip_code);
$Customer->setBillAddr($BillAddr);
// Shipping address
$ShipAddr = new QuickBooks_IPP_Object_ShipAddr();
$ShipAddr->setLine1($address_1);
$ShipAddr->setLine2($address_2);
$ShipAddr->setCity($city);
$ShipAddr->setCountrySubDivisionCode($province);
$ShipAddr->setCountry($country);
$ShipAddr->setPostalCode($postal_code);
$Customer->setShipAddr($ShipAddr);
$customer_id = $CustomerService->add($Context, $realm, $Customer);
Upvotes: 0
Views: 68
Reputation: 27952
The list of available fields for Customer
objects is on Intuit's website:
You're probably looking for:
CompanyName:
optional
String, maximum of 50 chars, filterable, sortable, default is null
The name of the company associated with the person or organization.
Unsurprisingly, there's a couple of corresponding methods:
$Customer->setCompanyName($v);
$v = $Customer->getCompanyName();
Upvotes: 1