API Forum

This forum is in read-only mode.
Please refer to our API support in case you have any questions.
We can be reached at api@e-conomic.com
e-conomic API developer forum

Order_UpgradeToInvoice

0
$invoiceHandle = $client-> Order_UpgradeToInvoice (array('orderHandle'=>$orderHandle))-> Order_UpgradeToInvoiceResult; What parameters does $orderHandle have? i have tried with orderNumber - orderId I can not make it work
created Sep 11, 2015 by suulut
50% Accept Rate

edited Sep 11, 2015 by suulut
Q 8 A 5 C 2

2 Answers

+1
 
Best answer

Hi suulut

An order handle is order.id wrapped as handle.

https://api.e-conomic.com/secure/api1/EconomicWebService.asmx?op=Order_GetData

<Handle>
    <Id>int</Id>
</Handle>

E.g. upgrading order 123:

<Order_UpgradeToInvoice xmlns="http://e-conomic.com">
      <orderHandle>
        <Id>123</Id>
      </orderHandle>
    </Order_UpgradeToInvoice>
answered Sep 14, 2015 by olej
selected Oct 5, 2015 by suulut
0
Hi Olej, Thank you for the reply.
I belive that it is the order.id i'm using in my script ? If anyone disagree please post an answer.
<?php
require_once ("config/config.php");
$OrderHandles = $client->Order_GetAllCurrent()->Order_GetAllCurrentResult->OrderHandle;
 
$orderDataObjects = $client->Order_GetDataArray(array('entityHandles' => $OrderHandles))->Order_GetDataArrayResult->OrderData; // Gets all of the info for the orders
 
foreach ($orderDataObjects as $i => $orderData) { ?>
<form name="ordre_faktura" Method="POST" action="XXX.php">
<td><table>
<tr><td ><?php print $orderData->Number; ?>&nbsp;</td></tr>
<tr><td ><?php print $orderData->DebtorName; ?>&nbsp;</td></tr>
<tr><td ><?php print $orderData->DebtorAddress; ?>&nbsp;</td></tr>
<tr><td ><?php print $orderData->DebtorPostalCode;?>&nbsp;</td></tr>
<tr><td ><?php print $orderData->DebtorCity; ?>&nbsp;</td></tr>
<tr><td ><?php print $orderData->NetAmount; ?>&nbsp;</td></tr>
<tr><td><input type="submit" value="Opgrader ti faktura"></td></tr>
<tr><td><input type="hidden" name="id" value="<?php print $orderData->Id; ?>"></td></tr>
</table></td>
</form>
<?php } ?>
 
XXX.php
<?php
require_once ("config/config.php");
$IdHandles = $_POST['id']; //Gets the order.id
$invoiceHandle = $client->Order_UpgradeToInvoice(array('orderHandle'=> $IdHandles))-> Order_UpgradeToInvoiceResult;//upgrades to invoice
?>
But this don't work :/

 

answered Sep 14, 2015 by suulut
edited Sep 15, 2015 by suulut

Network

Find all the documentation and resources you need to build great apps.
Go to Developer site

Newsletter

Get the latest news and important info from the e-conomic developer world.
Sign up now

Visma e-conomic A/S
...