I use the api call OrderLine_CreateFromData to create an orderline. I set the following data.
$data = array(
"Handle" => a handle,
'Id' => and id,
'Number' => a number,
'OrderHandle' => a handle,
'Description' => "abc",
'DeliveryDate' => a date,
'ProductHandle' => a handle,
'Quantity' => 1,
'UnitNetPrice' => 1000,
'DiscountAsPercent' => 0,
'UnitCostPrice' => 100.50,
'TotalNetAmount' => 1000,
'TotalMargin' => 0,
'MarginAsPercent' => 0
);
The orderline is created but the costprice is always 0.
I have read in other posts that stock management causes the costprice to be locked. But this account does not use this. I can with no problem open the interface and change the costprice. But what am I doing wrong in the API call?
$data = array(
"Handle" => a handle,
'Id' => and id,
'Number' => a number,
'OrderHandle' => a handle,
'Description' => "abc",
'DeliveryDate' => a date,
'ProductHandle' => a handle,
'Quantity' => 1,
'UnitNetPrice' => 1000,
'DiscountAsPercent' => 0,
'UnitCostPrice' => 100.50,
'TotalNetAmount' => 1000,
'TotalMargin' => 0,
'MarginAsPercent' => 0
);
The orderline is created but the costprice is always 0.
I have read in other posts that stock management causes the costprice to be locked. But this account does not use this. I can with no problem open the interface and change the costprice. But what am I doing wrong in the API call?