(consolibyte)quickbooks-php devkit,如何添加公司名称?

时间:2016-11-23 18:07:25

标签: php quickbooks-online

我在添加新客户时尝试添加公司名称,任何人都可以提供帮助吗? 顺便说一句,quickboos-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);

1 个答案:

答案 0 :(得分: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();