我使用Quickbooks V3时遵循了这个程序包。https://github.com/consolibyte/quickbooks-php
我正在创建这样的项目
$ItemService = new QuickBooks_IPP_Service_Item();
$Item = new QuickBooks_IPP_Object_Item();
$Item->setName('My Item');
$Item->setType('Inventory');
$Item->setIncomeAccountRef('121');
if ($resp = $ItemService->add($this->context, $this->realm, $Item)) {
print('Our new Item ID is: [' . $resp . ']');
} else {
print($ItemService->lastError($this->context));
}
它仅在销售中显示项目,但在采购中未启用。如何创建可在所有类别中使用的项目?
您是否参考了文档?
- https://developer.intuit.com/docs/api/accounting/Item
采购项目必须定义其采购相关字段。您只定义了他们的销售相关字段:
$Item->setIncomeAccountRef('121');
您还应该指定:
- ExpenseAccountRef
- 采购描述
- 采购成本
- AssetCountryRef