我正在尝试创建从 PurchaseOrder 创建的 ItemReceipt。我在创建过程中在采购订单中手动添加我的库存项目。当我收到此订单时,NetSuite Web 服务抛出以下错误:
不允许向子列表项添加新行。
虽然我也尝试过 ItemReceiptItemList 的 replaceAll 属性。
这是我的代码:
$tranDate = new \DateTime();
$tranDate = $tranDate->format('Y-m-d\TH:i:s');
$nsInventoryDetail = new InventoryDetail();
$nsInventoryAssignmentList = new InventoryAssignmentList();
$nsInventoryAssignmentList->replaceAll = true;
$nsInventoryAssignment[0] = new InventoryAssignment();
$nsInventoryAssignment[0]->receiptInventoryNumber = 3310; //NS inventory item id
$nsInventoryAssignment[0]->quantity = 1;
$nsInventoryAssignmentList->inventoryAssignment = $nsInventoryAssignment;
$nsInventoryDetail->inventoryAssignmentList = $nsInventoryAssignmentList;
$nsItemReceiptItem = new ItemReceiptItem();
$nsItemReceiptItem->item = new RecordRef();
$nsItemReceiptItem->item->internalId = 3310;
$nsItemReceiptItem->location = new RecordRef();
$nsItemReceiptItem->location->internalId = 1; // NS inventory location id
$nsItemReceiptItem->itemReceive = true;
$nsItemReceiptItem->rate = $purchasePrice->getAmount();
$nsItemReceiptItem->currency = $purchasePrice->getCurrency();
$nsItemReceiptItem->inventoryDetail = $nsInventoryDetail;
$itemList = new ItemReceiptItemList();
$itemList->item = [$nsItemReceiptItem];
$itemList->replaceAll = true;
$nsItemReceipt = new ItemReceipt();
$nsItemReceipt->createdFrom = new RecordRef();
$nsItemReceipt->createdFrom->internalId = 1223; // NS purchase order id
$nsItemReceipt->tranDate = $tranDate;
$nsItemReceipt->itemList = $itemList;
print_r($nsItemReceipt);
$nsItemReceipt = $this->itemReceiptService->create($nsItemReceipt);
抛出以下内容:不允许向子列表项添加新行。
以下是我正在发送的 ItemReceipt 对象:
NetSuite\Sdk\ItemReceipt Object
(
[createdDate] =>
[lastModifiedDate] =>
[customForm] =>
[exchangeRate] =>
[entity] =>
[currencyName] =>
[subsidiary] =>
[createdFrom] => NetSuite\Sdk\RecordRef Object
(
[internalId] => 1223
[externalId] =>
[type] => purchaseOrder
[name] =>
)
[tranDate] => 2020-01-02T13:45:36
[partner] =>
[postingPeriod] =>
[tranId] =>
[inboundShipment] =>
[memo] =>
[itemFulfillment] =>
[currency] =>
[landedCostMethod] =>
[landedCostPerLine] =>
[itemList] => NetSuite\Sdk\ItemReceiptItemList Object
(
[item] => Array
(
[0] => NetSuite\Sdk\ItemReceiptItem Object
(
[itemReceive] => 1
[jobName] =>
[item] => NetSuite\Sdk\RecordRef Object
(
[internalId] => 3310
[externalId] =>
[type] => inventoryItem
[name] =>
)
[orderLine] =>
[line] =>
[itemName] =>
[description] =>
[location] => NetSuite\Sdk\RecordRef Object
(
[internalId] => 3
[externalId] =>
[type] => location
[name] =>
)
[onHand] =>
[quantityRemaining] =>
[quantity] =>
[unitsDisplay] =>
[unitCostOverride] =>
[inventoryDetail] => NetSuite\Sdk\InventoryDetail Object
(
[inventoryAssignmentList] => NetSuite\Sdk\InventoryAssignmentList Object
(
[inventoryAssignment] => Array
(
[0] => NetSuite\Sdk\InventoryAssignment Object
(
[internalId] =>
[issueInventoryNumber] =>
[receiptInventoryNumber] =>
[binNumber] =>
[toBinNumber] =>
[quantity] => 1
[expirationDate] =>
[quantityAvailable] =>
)
)
[replaceAll] => 1
)
[customForm] =>
[nullFieldList] =>
)
[serialNumbers] =>
[binNumbers] =>
[expirationDate] =>
[rate] => 7900
[currency] => AED
[restock] =>
[billVarianceStatus] =>
[isDropShipment] =>
[options] =>
[landedCost] =>
[customFieldList] =>
)
)
[replaceAll] => 1
)
[expenseList] =>
[landedCostsList] =>
[accountingBookDetailList] =>
[customFieldList] =>
[internalId] =>
[externalId] =>
[nullFieldList] =>
)
任何帮助都感激不尽。