This topic contains 1 reply, has 0 voices, and was last updated by nrao 9 years, 3 months ago.

  • Author
    Posts
  • #6893

    tect22

    Hi,

    Anyone here tried to receive PO through Web Service. I am encountering error on adding the Item Receipt.

    This is the soap request:

    **********************

    *************

    **********

    2013-08-13T12:00:00+02:00

    01WRR-1455

    true

    445

    1

    5272

    A397

    5272

    and this is always the response:

    WEBSERVICES_3992863_081020154 61 8470471813932057_c7f6d05299de

    USER_ERROR All lines of sublist itemList have to be specified when replace All is requested.

    Any ideas on how to solve this.

    Below is my php code.

    $ItemReceipt = new ItemReceipt();

    $ItemReceipt->createdFrom = new RecordRef();

    $ItemReceipt->createdFrom->internalId = $row[‘po_id’];

    $ItemReceipt->createdFrom->type = ‘purchaseOrder’;

    $date = $row[‘wrrdate’];

    $dateArray = date_parse_from_format ( ‘Y-m-d’, $date );

    $time = 12;

    $day = $dateArray[‘day’];

    $month = $dateArray[‘month’];

    $year = $dateArray[‘year’];

    $dateto = date(“c”, mktime($time,0,0,$month,$day,$year));

    //$dateto = implode(“/”, array_reverse(explode(“-“, $date)));

    //echo $dateto;

    $ItemReceipt->tranDate = $dateto;

    $ItemReceipt->memo = $row[‘memo’];

    $itr = new ItemReceiptItemList();

    $itr->replaceAll = true;

    $itritem[0] = new ItemReceiptItem();

    $itritem[0]->orderLine = $row[‘orderline’];

    $itritem[0]->itemReceive = true;

    $itritem[0]->item = new RecordRef();

    $itritem[0]->item->internalId = $row[‘item_id’];

    $itritem[0]->quantity = $row[‘qty’];

    $itritem[0]->line = 1;

    $itrdetail = new InventoryDetail();

    $itrassignList = new InventoryAssignmentList();

    $itrassignList->replaceAll = true;

    $itrassign[0] = new InventoryAssignment();

    $itrassign[0]->receiptInventoryNumber = $row[‘lotbatch_ser’];

    $itrassign[0]->quantity = $row[‘qty’];

    $itrassignList->inventoryAssignment = $itrassign;

    $itrdetail->inventoryAssignmentList = $itrassignList;

    $itritem[0]->inventoryDetail = $itrdetail;

    $itr->item = $itritem[0];

    $ItemReceipt->itemList = $itr;

    $ItemReceipt->itemList->replaceAll = true;

    $request = new AddRequest();

    $request->record = $ItemReceipt;

    $addResponse = $service->add($request);

    if (! $addResponse->writeResponse->status->isSuccess) {

    echo “ADD Item Receipt ERROR”;

    echo “
    “;

    echo $addResponse->writeResponse->status->statusDetail [0]->code . “:” . $addResponse->writeResponse->status->statusDetail [0]->message;

    } else {

    echo ” Item Recei[t SUCCESS, id ” . $addResponse->writeResponse->baseRef->internalId;

    }

    Any help would be greatly appreciated

    Thanks.
    This is a cached copy. Click here to see the original post.

  • #6894

    nrao

    Hi,

    By default all items are received on a PO. To only receive one item you must include the all the lineitems and specify itemReceve=false, this would allow you to partially recieve the order.

    As the error message suggests kindly include the other line items present on the Purchase Order. If you set the replaceAll = false then the behavior by default is to receive all the line items present on the PO, below is the sample I tried on my end :

    true

    2

    1

    11

    false

    1

    Hope this helps.

You must be logged in to reply to this topic.