【问题标题】:Netsuite Item Fulfillment Invalid Line ItemsNetsuite 项目履行无效的行项目
【发布时间】:2019-05-05 12:49:42
【问题描述】:

我正在尝试使用 PHP Netsuite Api 将 SalesOrder 设置为已完成,但我不断收到以下错误:

VALID_LINE_ITEM_REQD - 您必须至少有一个有效的订单项 这笔交易。

我正在使用https://github.com/ryanwinchester/netsuite-php 库。

到目前为止,我有以下内容。我也尝试过使用在一些示例中看到的 Initialise 方法,但它们似乎都给出了相同的错误。如果有帮助,我们正在使用高级库存管理。

$itemFulfillment = new ItemFulfillment();

// Sales Order
$itemFulfillment->createdFrom = new RecordRef();
$itemFulfillment->createdFrom->internalId = <SALES_ORDER_ID>;

$itemFulfillment->shipStatus = ItemFulfillmentShipStatus::_shipped;

// Customer
$itemFulfillment->entity = new RecordRef();
$itemFulfillment->entity->internalId = <CUSTOMER_ID>;

// List
$fullfillmentList = new ItemFulfillmentItemList();
$fullfillmentList->replaceAll = true;

foreach($salesOrder->itemList->item as $saleItem) {
    $item = new ItemFulfillmentItem();
    $item->location = new RecordRef();
    $item->location->internalId = 4;
    $item->item = new RecordRef();
    $item->item->internalId = $saleItem->item->internalId;
    $item->itemIsFulfilled = true;
    $item->itemReceive = true;
    $item->quantity = $saleItem->quantity;
    $item->orderLine = $saleItem->line;           

    // Department Reference
    $departmentRec = new RecordRef();
    $departmentRec->internalId = 5;
    $item->department = $departmentRec;

    $fullfillmentList->item[] = $item;
}

$itemFulfillment->itemList = $fullfillmentList;


$request = new AddRequest();
$request->record = $itemFulfillment;

$client->add($request);

任何帮助都会很棒。 :)

【问题讨论】:

    标签: php netsuite suitetalk


    【解决方案1】:
    • 确保物品在库存中
    • 确保该项目可供您的子公司使用
    • 确保正确提交子列表(如果适用)
    • 转储 $saleItem 以查看其中的内容以确保注释为空

    【讨论】:

      【解决方案2】:

      将销售订单转换为

      跨子公司项目履行记录将返回一个 “VALID_LINE_ITEM_REQD >

      如果我们未在 defaultValue 参数中指定inventoryLocation,则您必须至少有一个有效的订单项进行此交易”错误。

      function createIF(soId, invLocation) { var itemFulfillment = record.transform({ fromType: record.Type.SALES_ORDER, fromId: soId, toType: record.Type.ITEM_FULFILLMENT, defaultValues: { inventorylocation: invLocation } }); /** * You can insert other script logic here */ var ifID = itemFulfillment.save(); return ifID; }

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2022-12-04
        • 2018-12-27
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多