From 682f6f838e713c89108e5965a41a3974a96f3d5c Mon Sep 17 00:00:00 2001
From: "cam.lafit" <cam.lafit@azerttyu.net>
Date: Thu, 18 May 2017 10:36:37 +0200
Subject: [PATCH] Change argument list CreateInvoiceFromOrder

* invoice data are not mandatory
Only order information are required
---
 htdocs/webservices/server_invoice.php | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/htdocs/webservices/server_invoice.php b/htdocs/webservices/server_invoice.php
index 99202cd72e4..8f14be1a8b9 100644
--- a/htdocs/webservices/server_invoice.php
+++ b/htdocs/webservices/server_invoice.php
@@ -254,7 +254,7 @@ $server->register(
 $server->register(
 		'createInvoiceFromOrder',
 		// Entry values
-		array('authentication'=>'tns:authentication','id_order'=>'xsd:string','ref_order'=>'xsd:string','ref_ext_order'=>'xsd:string','id_invoice'=>'xsd:string','ref_invoice'=>'xsd:string','ref_ext_invoice'=>'xsd:string'),
+		array('authentication'=>'tns:authentication','id_order'=>'xsd:string','ref_order'=>'xsd:string','ref_ext_order'=>'xsd:string'),
 		// Exit values
 		array('result'=>'tns:result','id'=>'xsd:string','ref'=>'xsd:string','ref_ext'=>'xsd:string'),
 		$ns,
@@ -653,13 +653,9 @@ function createInvoice($authentication,$invoice)
  * @param	string      $id_order			id of order to copy invoice from
  * @param	string      $ref_order			ref of order to copy invoice from
  * @param	string      $ref_ext_order		ref_ext of order to copy invoice from
- * @param	string      $id_invoice			invoice id
- * @param	string      $ref_invoice		invoice ref
- * @param	string      $ref_ext_invoice	invoice ref_ext
  * @return	array							Array result
  */
-function createInvoiceFromOrder($authentication,$id_order='', $ref_order='', $ref_ext_order='', 
-		$id_invoice='', $ref_invoice='', $ref_ext_invoice='')
+function createInvoiceFromOrder($authentication,$id_order='', $ref_order='', $ref_ext_order='')
 {
 	global $db,$conf;
 
@@ -680,8 +676,6 @@ function createInvoiceFromOrder($authentication,$id_order='', $ref_order='', $re
 	// Check parameters
 	if (empty($id_order) && empty($ref_order) && empty($ref_ext_order))	{
 		$error++; $errorcode='KO'; $errorlabel="order id or ref or ref_ext is mandatory.";
-	} else if (empty($id_invoice) && empty($ref_invoice) && empty($ref_ext_invoice))	{
-		$error++; $errorcode='KO'; $errorlabel="invoice id or ref or ref_ext is mandatory.";
 	}
 	
 	//////////////////////
-- 
GitLab