<?php
require_once '../PHPToolkit/NetSuiteService.php';
$service = new NetSuiteService();
$InventoryAdjustment = new InventoryAdjustment();
$InventoryAdjustment->externalId = 1000;
$InventoryAdjustment->postingPeriod = new RecordRef();
$InventoryAdjustment->postingPeriod->internalId = 81;
$InventoryAdjustment->account = new RecordRef();
$InventoryAdjustment->account->internalId = 137;
$inventoryAssignment = new InventoryAssignment();
$inventoryAssignment->receiptInventoryNumber = "SERIAL123";
$inventoryAssignmentList = new InventoryAssignmentList();
$inventoryAssignmentList->inventoryAssignment = $inventoryAssignment;
$inventoryDetail = new InventoryDetail();
$inventoryDetail->inventoryAssignmentList = $inventoryAssignmentList;
$InventoryAdjustmentInventory = new InventoryAdjustmentInventory();
$InventoryAdjustmentInventory->item = new RecordRef();
$InventoryAdjustmentInventory->item->internalId = 2326;
$InventoryAdjustmentInventory->location = new RecordRef();
$InventoryAdjustmentInventory->location->internalId = 6;
$InventoryAdjustmentInventory->adjustQtyBy = 1;
$InventoryAdjustmentInventory->inventoryDetail = $inventoryDetail;
$InventoryAdjustmentInventoryList = new InventoryAdjustmentInventoryList();
$InventoryAdjustmentInventoryList->inventory = $InventoryAdjustmentInventory;
$InventoryAdjustment->inventoryList = $InventoryAdjustmentInventoryList;
$request = new UpsertRequest();
$request->record = $InventoryAdjustment;
$upsertResponse = $service->upsert($request);
if (!$upsertResponse->writeResponse->status->isSuccess) {
echo "ADD INVENTORY ADJUSTMENT ERROR";
} else {
echo "ADD INVENTORY ADJUSTMENT SUCCESS, id " . $upsertResponse->writeResponse->baseRef->internalId;
}
?>
No comments:
Post a Comment