我有一个问题。 当我在“net suite”中添加发票时,请帮助我 错误:[code] => USER_ERROR [message] =>请输入以下值:部门,班级,仓库 任何人都可以告诉我如何通过API生成“网络套件”发票。
$inv=new Invoice();
$customFormR=new RecordRef();
$customFormR->internalId =104;
//'1 Aquatic Fitness Concepts'
$inv_items= new InvoiceItem();
$itemRR = new RecordRef();
$itemRR->internalId = 25;
$itemRR->recordType = "inventoryItem";
$inv_items->item=$itemRR;
$location=new RecordRef();
$location->internalId =2;
$inv_items->location=$location;
$departmentRR=new RecordRef();
$departmentRR->internalId =6;
$inv_items->department=$departmentRR;
$classRR=new RecordRef();
$classRR->internalId =22;
$inv_items->class=$classRR;
$inv_it_list=new InvoiceItemList();
$inv_it_list->item=array($inv_items);
$inv->itemList= $inv_it_list;
$inv->entity = new RecordRef();
$inv->entity->internalId = 932;
//$inv->entity
$inv->customForm=$customFormR;
$request = new AddRequest();
$request->record = $inv;
$addResponse = $service->add($request);
if (!$addResponse->writeResponse->status->isSuccess) {
echo "ADD ERROR";
print_r($addResponse);
exit();
} else {
echo "ADD SUCCESS, id " . $addResponse->writeResponse->baseRef->internalId;
}
答案 0 :(得分:0)
在NetSuite中,您可以选择在标题级别将Location,Department,Class设置为默认值,并在行级别上设置为默认值的覆盖。
了解如何为NetSuite帐户中的交易设置位置,部门,类。您的代码显示您正在尝试在订单项级别设置这些字段。如果未启用在行级别指定它们的选项(设置 - >会计 - >会计首选项 - >常规),则您应该无法在行级别设置它们。
尝试在标题级别设置这些字段。例如:
$inv->department = $departmentRR;