how to set other reference when creating an Order

Forum for .PHP developers using the E-conomic API.
Exchange your ideas, tip and tricks using the API.
Best Practices

how to set other reference when creating an Order

Postby manish » Sun Jan 22, 2012 2:39 pm

hello,
How can we add other reference when creating an Order?

thanks,
manish
-
manish
 
Posts: 2
Joined: Sun Jan 22, 2012 2:30 pm

Re: how to set other reference when creating an Order

Postby Christian Estrup » Mon Jan 23, 2012 2:18 am

Hi manish,

You need to set the OtherReference property on the corresponding Order object (or, in SOAP terms: Call Order_SetOtherReference).


Best regards,
Christian Estrup
Chief Architect

Image
Online accounting
User avatar
Christian Estrup
 
Posts: 245
Joined: Tue Jun 09, 2009 6:37 pm

Re: how to set other reference when creating an Order

Postby manish » Tue Jan 24, 2012 10:06 am

Hello

Thanks for your reply..

here is my code to add set other refrence::
=======================================
$orderno = $client->Order_Create(array("debtorHandle" => $newDebtorHandle))->Order_CreateResult;

$client->Order_SetOtherReference(array('OrderHandle'=>$orderno, 'value' => '84'));



$orderline = $client->OrderLine_Create(array("orderHandle" => $orderno))->OrderLine_CreateResult;

$quantity = 1;
$description = "test desc";
$UnitCostPrice = 80;
$UnitNetPrice = 80;

$netamount = $quantity * $UnitNetPrice;


$newOrderHandle = $client->OrderLine_CreateFromData(array("data" => array(
"Handle" => $orderline,
'Id' => $orderline->Id,
'Number' => $orderline->Number,
'OrderHandle' => $orderno,
'Description' => $description,
'DeliveryDate' => date('Y-m-d\TH:i:s'),
'ProductHandle' => $productHandle,
'Quantity' => $quantity,
'UnitNetPrice' => $UnitNetPrice,
'DiscountAsPercent' => 0,
'UnitCostPrice' => $UnitCostPrice,
'TotalNetAmount' => $UnitNetPrice,
'TotalMargin' => 0,
'MarginAsPercent' => 0
)))->OrderLine_CreateFromDataResult;



But i have got a some exception warning so m not able to add
order as well as other refrence field.

Can u please check this code & let me know where is the mistake.

one thing i also want to tell u "if i do create order without refrence then it
will create but when i set otherrefrence then if
can't add orders.


Please do reply m in trouble.


Thanks
manish
-
manish
 
Posts: 2
Joined: Sun Jan 22, 2012 2:30 pm


Return to PHP



cron