2016-11-23 44 views
0

我想在添加新客戶時添加公司名稱,任何人都可以提供幫助? 順便說一下,quickboos-php devkit的文檔在哪裏,我找不到它。 下面是代碼:(consolibyte)quickbooks-php devkit,如何添加公司名稱?

$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); 
+0

你看項目Github上?它具有指向文檔的所有鏈接:https://github.com/consolibyte/quickbooks-php - 另外,爲什麼要將公司名稱添加到客戶?我很確定公司和客戶是不同的實體。 –

+0

QuickBooks沒有一個單獨的「公司」實體的概念。您的客戶可能是一家公司,也可能是一名個人,具體取決於您是B2B還是B2C。客戶確實在QuickBooks中有一個公司名稱字段。 –

+0

@ KeithPalmerJr.Thanks – zif

回答

1

可用字段用於Customer對象名單是Intuit公司的網站:

你可能在尋找:

CompanyName: optional String, maximum of 50 chars, filterable, sortable, default is null The name of the company associated with the person or organization.

不出所料,有一對夫婦的相應方法:

$Customer->setCompanyName($v); 
$v = $Customer->getCompanyName();