Fix: checkstyle

This commit is contained in:
Regis Houssin 2012-12-15 11:39:47 +01:00
parent bbbfc8c018
commit 65090c582d
8 changed files with 317 additions and 308 deletions

View File

@ -341,7 +341,7 @@ if ($id > 0 || ! empty($ref))
foreach(array('internal','external') as $source) foreach(array('internal','external') as $source)
{ {
$tab = $object->liste_contact(-1,$source); $tab = $object->liste_contact(-1,$source);
$num=sizeof($tab); $num=count($tab);
$i = 0; $i = 0;
while ($i < $num) while ($i < $num)

View File

@ -736,7 +736,7 @@ class pdf_einstein extends ModelePDFCommandes
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
$index++; $index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl=''; $tvacompl='';
if (preg_match('/\*/',$tvakey)) if (preg_match('/\*/',$tvakey))
@ -748,7 +748,7 @@ class pdf_einstein extends ModelePDFCommandes
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
} }
} }
@ -775,7 +775,7 @@ class pdf_einstein extends ModelePDFCommandes
$index++; $index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl=''; $tvacompl='';
if (preg_match('/\*/',$tvakey)) if (preg_match('/\*/',$tvakey))
@ -787,7 +787,7 @@ class pdf_einstein extends ModelePDFCommandes
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
} }
@ -837,7 +837,7 @@ class pdf_einstein extends ModelePDFCommandes
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
$index++; $index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl=''; $tvacompl='';
if (preg_match('/\*/',$tvakey)) if (preg_match('/\*/',$tvakey))
@ -849,14 +849,14 @@ class pdf_einstein extends ModelePDFCommandes
if ($localtax_type == '7') { // amount on order if ($localtax_type == '7') { // amount on order
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvakey), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvakey), 0, 'R', 1);
} }
else else
{ {
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
} }
} }
@ -881,7 +881,7 @@ class pdf_einstein extends ModelePDFCommandes
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
$index++; $index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl=''; $tvacompl='';
if (preg_match('/\*/',$tvakey)) if (preg_match('/\*/',$tvakey))
@ -893,7 +893,7 @@ class pdf_einstein extends ModelePDFCommandes
if ($localtax_type == '7') { // amount on order if ($localtax_type == '7') { // amount on order
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvakey), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvakey), 0, 'R', 1);
} }
else else
@ -901,7 +901,7 @@ class pdf_einstein extends ModelePDFCommandes
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
} }
} }

View File

@ -868,7 +868,7 @@ class pdf_crabe extends ModelePDFFactures
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
$index++; $index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl=''; $tvacompl='';
if (preg_match('/\*/',$tvakey)) if (preg_match('/\*/',$tvakey))
@ -880,7 +880,7 @@ class pdf_crabe extends ModelePDFFactures
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
} }
} }
@ -907,7 +907,7 @@ class pdf_crabe extends ModelePDFFactures
$index++; $index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl=''; $tvacompl='';
if (preg_match('/\*/',$tvakey)) if (preg_match('/\*/',$tvakey))
@ -919,7 +919,7 @@ class pdf_crabe extends ModelePDFFactures
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
} }
@ -969,7 +969,7 @@ class pdf_crabe extends ModelePDFFactures
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
$index++; $index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl=''; $tvacompl='';
if (preg_match('/\*/',$tvakey)) if (preg_match('/\*/',$tvakey))
@ -981,14 +981,14 @@ class pdf_crabe extends ModelePDFFactures
if ($localtax_type == '7') { // amount on order if ($localtax_type == '7') { // amount on order
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvakey), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvakey), 0, 'R', 1);
} }
else else
{ {
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
} }
} }
@ -1014,7 +1014,7 @@ class pdf_crabe extends ModelePDFFactures
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
$index++; $index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl=''; $tvacompl='';
if (preg_match('/\*/',$tvakey)) if (preg_match('/\*/',$tvakey))
@ -1026,7 +1026,7 @@ class pdf_crabe extends ModelePDFFactures
if ($localtax_type == '7') { // amount on order if ($localtax_type == '7') { // amount on order
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvakey), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvakey), 0, 'R', 1);
} }
else else
@ -1034,7 +1034,7 @@ class pdf_crabe extends ModelePDFFactures
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
} }
} }

View File

@ -769,7 +769,7 @@ class pdf_azur extends ModelePDFPropales
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
$index++; $index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl=''; $tvacompl='';
if (preg_match('/\*/',$tvakey)) if (preg_match('/\*/',$tvakey))
@ -781,7 +781,7 @@ class pdf_azur extends ModelePDFPropales
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
} }
} }
@ -808,7 +808,7 @@ class pdf_azur extends ModelePDFPropales
$index++; $index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl=''; $tvacompl='';
if (preg_match('/\*/',$tvakey)) if (preg_match('/\*/',$tvakey))
@ -820,7 +820,7 @@ class pdf_azur extends ModelePDFPropales
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
} }
@ -870,7 +870,7 @@ class pdf_azur extends ModelePDFPropales
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
$index++; $index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl=''; $tvacompl='';
if (preg_match('/\*/',$tvakey)) if (preg_match('/\*/',$tvakey))
@ -882,14 +882,14 @@ class pdf_azur extends ModelePDFPropales
if ($localtax_type == '7') { // amount on order if ($localtax_type == '7') { // amount on order
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvakey), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvakey), 0, 'R', 1);
} }
else else
{ {
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
} }
} }
@ -914,7 +914,7 @@ class pdf_azur extends ModelePDFPropales
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
$index++; $index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl=''; $tvacompl='';
if (preg_match('/\*/',$tvakey)) if (preg_match('/\*/',$tvakey))
@ -926,7 +926,7 @@ class pdf_azur extends ModelePDFPropales
if ($localtax_type == '7') { // amount on order if ($localtax_type == '7') { // amount on order
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvakey), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvakey), 0, 'R', 1);
} }
else else
@ -934,7 +934,7 @@ class pdf_azur extends ModelePDFPropales
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
} }
} }

View File

@ -1223,7 +1223,7 @@ class Product extends CommonObject
$sql.= " WHERE fk_product_price = '".$this->prices_by_qty_id[$i]."'"; $sql.= " WHERE fk_product_price = '".$this->prices_by_qty_id[$i]."'";
$sql.= " ORDER BY quantity ASC"; $sql.= " ORDER BY quantity ASC";
$resultat=array(); $resultat=array();
$resql = $this->db->query($sql) ; $resql = $this->db->query($sql);
if ($resql) if ($resql)
{ {
$ii=0; $ii=0;
@ -1276,7 +1276,7 @@ class Product extends CommonObject
$sql.= " WHERE fk_product_price = '".$this->prices_by_qty_id[0]."'"; $sql.= " WHERE fk_product_price = '".$this->prices_by_qty_id[0]."'";
$sql.= " ORDER BY quantity ASC"; $sql.= " ORDER BY quantity ASC";
$resultat=array(); $resultat=array();
$resql = $this->db->query($sql) ; $resql = $this->db->query($sql);
if ($resql) if ($resql)
{ {
$ii=0; $ii=0;

View File

@ -1,6 +1,7 @@
<?php <?php
/* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 JF FERRY <jfefe@aternatik.fr> * Copyright (C) 2012 JF FERRY <jfefe@aternatik.fr>
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -55,169 +56,181 @@ $server->wsdl->schemaTargetNamespace=$ns;
// Define WSDL content // Define WSDL content
$server->wsdl->addComplexType( $server->wsdl->addComplexType(
'authentication', 'authentication',
'complexType', 'complexType',
'struct', 'struct',
'all', 'all',
'', '',
array( array(
'dolibarrkey' => array('name'=>'dolibarrkey','type'=>'xsd:string'), 'dolibarrkey' => array('name'=>'dolibarrkey','type'=>'xsd:string'),
'sourceapplication' => array('name'=>'sourceapplication','type'=>'xsd:string'), 'sourceapplication' => array('name'=>'sourceapplication','type'=>'xsd:string'),
'login' => array('name'=>'login','type'=>'xsd:string'), 'login' => array('name'=>'login','type'=>'xsd:string'),
'password' => array('name'=>'password','type'=>'xsd:string'), 'password' => array('name'=>'password','type'=>'xsd:string'),
'entity' => array('name'=>'entity','type'=>'xsd:string'), 'entity' => array('name'=>'entity','type'=>'xsd:string')
) )
); );
$server->wsdl->addComplexType( $server->wsdl->addComplexType(
'line', 'line',
'complexType', 'complexType',
'struct', 'struct',
'all', 'all',
'', '',
array( array(
'id' => array('name'=>'id','type'=>'xsd:string'), 'id' => array('name'=>'id','type'=>'xsd:string'),
'fk_commande' => array('name'=>'fk_commande','type'=>'xsd:int'), 'fk_commande' => array('name'=>'fk_commande','type'=>'xsd:int'),
'fk_parent_line' => array('name'=>'fk_parent_line','type'=>'xsd:int'), 'fk_parent_line' => array('name'=>'fk_parent_line','type'=>'xsd:int'),
'desc' => array('name'=>'desc','type'=>'xsd:string'), 'desc' => array('name'=>'desc','type'=>'xsd:string'),
'qty' => array('name'=>'qty','type'=>'xsd:int'), 'qty' => array('name'=>'qty','type'=>'xsd:int'),
'price' => array('name'=>'price','type'=>'xsd:double'), 'price' => array('name'=>'price','type'=>'xsd:double'),
'subprice' => array('name'=>'subprice','type'=>'xsd:double'), 'subprice' => array('name'=>'subprice','type'=>'xsd:double'),
'tva_tx' => array('name'=>'tva_tx','type'=>'xsd:double'), 'tva_tx' => array('name'=>'tva_tx','type'=>'xsd:double'),
'remise' => array('name'=>'remise','type'=>'xsd:double'), 'remise' => array('name'=>'remise','type'=>'xsd:double'),
'remise_percent' => array('name'=>'remise_percent','type'=>'xsd:double'), 'remise_percent' => array('name'=>'remise_percent','type'=>'xsd:double'),
'fk_product' => array('name'=>'fk_product','type'=>'xsd:int'), 'fk_product' => array('name'=>'fk_product','type'=>'xsd:int'),
'product_type' => array('name'=>'product_type','type'=>'xsd:int'), 'product_type' => array('name'=>'product_type','type'=>'xsd:int'),
'total_ht' => array('name'=>'total_ht','type'=>'xsd:double'), 'total_ht' => array('name'=>'total_ht','type'=>'xsd:double'),
'total_tva' => array('name'=>'totaltva','type'=>'xsd:double'), 'total_tva' => array('name'=>'totaltva','type'=>'xsd:double'),
'total_ttc' => array('name'=>'total_ttc','type'=>'xsd:double'), 'total_ttc' => array('name'=>'total_ttc','type'=>'xsd:double'),
'date_start' => array('name'=>'date_start','type'=>'xsd:string'), 'date_start' => array('name'=>'date_start','type'=>'xsd:string'),
'date_end' => array('name'=>'date_end','type'=>'xsd:string'), 'date_end' => array('name'=>'date_end','type'=>'xsd:string'),
// From product // From product
'product_ref' => array('name'=>'product_ref','type'=>'xsd:string'), 'product_ref' => array('name'=>'product_ref','type'=>'xsd:string'),
'product_label' => array('name'=>'product_label','type'=>'xsd:string'), 'product_label' => array('name'=>'product_label','type'=>'xsd:string'),
'product_desc' => array('name'=>'product_desc','type'=>'xsd:string') 'product_desc' => array('name'=>'product_desc','type'=>'xsd:string')
) )
); );
$server->wsdl->addComplexType( $server->wsdl->addComplexType(
'LinesArray', 'LinesArray',
'complexType', 'complexType',
'array', 'array',
'', '',
'SOAP-ENC:Array', 'SOAP-ENC:Array',
array(), array(),
array( array(
array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:line[]') array(
), 'ref'=>'SOAP-ENC:arrayType',
'tns:line' 'wsdl:arrayType'=>'tns:line[]'
); )
$server->wsdl->addComplexType( ),
'LinesArray2', 'tns:line'
'complexType',
'array',
'sequence',
'',
array(
'line' => array(
'name' => 'line',
'type' => 'tns:line',
'minOccurs' => '0',
'maxOccurs' => 'unbounded'
)
)
);
$server->wsdl->addComplexType(
'order',
'complexType',
'struct',
'all',
'',
array(
'id' => array('name'=>'id','type'=>'xsd:string'),
'ref' => array('name'=>'ref','type'=>'xsd:string'),
'ref_client' => array('name'=>'ref_client','type'=>'xsd:string'),
'ref_ext' => array('name'=>'ref_ext','type'=>'xsd:string'),
'ref_int' => array('name'=>'ref_int','type'=>'xsd:string'),
'socid' => array('name'=>'socid','type'=>'xsd:int'),
'statut' => array('name'=>'statut','type'=>'xsd:int'),
'facturee' => array('name'=>'facturee','type'=>'xsd:string'),
'total_ht' => array('name'=>'total_ht','type'=>'xsd:double'),
'total_tva' => array('name'=>'total_tva','type'=>'xsd:double'),
'total_localtax1' => array('name'=>'total_localtax1','type'=>'xsd:double'),
'total_localtax2' => array('name'=>'total_localtax2','type'=>'xsd:double'),
'total_ttc' => array('name'=>'total_ttc','type'=>'xsd:double'),
'date' => array('name'=>'date','type'=>'xsd:date'),
'date_commande' => array('name'=>'date_commande','type'=>'xsd:date'),
'remise' => array('name'=>'remise','type'=>'xsd:string'),
'remise_percent' => array('name'=>'remise_percent','type'=>'xsd:string'),
'remise_absolue' => array('name'=>'remise_absolue','type'=>'xsd:string'),
'source' => array('name'=>'source','type'=>'xsd:string'),
'note' => array('name'=>'note','type'=>'xsd:string'),
'note_public' => array('name'=>'note_public','type'=>'xsd:string'),
'fk_project' => array('name'=>'fk_project','type'=>'xsd:string'),
'mode_reglement_id' => array('name'=>'mode_reglement_id','type'=>'xsd:string'),
'mode_reglement_code' => array('name'=>'mode_reglement_code','type'=>'xsd:string'),
'mode_reglement' => array('name'=>'mode_reglement','type'=>'xsd:string'),
'cond_reglement_id' => array('name'=>'cond_reglement_id','type'=>'xsd:string'),
'cond_reglement_code' => array('name'=>'cond_reglement_code','type'=>'xsd:string'),
'cond_reglement' => array('name'=>'cond_reglement','type'=>'xsd:string'),
'cond_reglement_doc' => array('name'=>'cond_reglement_doc','type'=>'xsd:string'),
'date_livraison' => array('name'=>'date_livraison','type'=>'xsd:date'),
'fk_delivery_address' => array('name'=>'fk_delivery_address','type'=>'xsd:int'),
'demand_reason_id' => array('name'=>'demand_reason_id','type'=>'xsd:string'),
'lines' => array('name'=>'lines','type'=>'tns:LinesArray')
)
); );
$server->wsdl->addComplexType( $server->wsdl->addComplexType(
'OrdersArray', 'LinesArray2',
'complexType', 'complexType',
'array', 'array',
'', 'sequence',
'SOAP-ENC:Array', '',
array(), array(
array( 'line' => array(
array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:order[]') 'name' => 'line',
), 'type' => 'tns:line',
'tns:order' 'minOccurs' => '0',
'maxOccurs' => 'unbounded'
)
)
); );
$server->wsdl->addComplexType( $server->wsdl->addComplexType(
'OrdersArray2', 'order',
'complexType', 'complexType',
'array', 'struct',
'sequence', 'all',
'', '',
array( array(
'order' => array( 'id' => array('name'=>'id','type'=>'xsd:string'),
'name' => 'invoice', 'ref' => array('name'=>'ref','type'=>'xsd:string'),
'type' => 'tns:invoice', 'ref_client' => array('name'=>'ref_client','type'=>'xsd:string'),
'minOccurs' => '0', 'ref_ext' => array('name'=>'ref_ext','type'=>'xsd:string'),
'maxOccurs' => 'unbounded' 'ref_int' => array('name'=>'ref_int','type'=>'xsd:string'),
) 'socid' => array('name'=>'socid','type'=>'xsd:int'),
) 'statut' => array('name'=>'statut','type'=>'xsd:int'),
'facturee' => array('name'=>'facturee','type'=>'xsd:string'),
'total_ht' => array('name'=>'total_ht','type'=>'xsd:double'),
'total_tva' => array('name'=>'total_tva','type'=>'xsd:double'),
'total_localtax1' => array('name'=>'total_localtax1','type'=>'xsd:double'),
'total_localtax2' => array('name'=>'total_localtax2','type'=>'xsd:double'),
'total_ttc' => array('name'=>'total_ttc','type'=>'xsd:double'),
'date' => array('name'=>'date','type'=>'xsd:date'),
'date_commande' => array('name'=>'date_commande','type'=>'xsd:date'),
'remise' => array('name'=>'remise','type'=>'xsd:string'),
'remise_percent' => array('name'=>'remise_percent','type'=>'xsd:string'),
'remise_absolue' => array('name'=>'remise_absolue','type'=>'xsd:string'),
'source' => array('name'=>'source','type'=>'xsd:string'),
'note' => array('name'=>'note','type'=>'xsd:string'),
'note_public' => array('name'=>'note_public','type'=>'xsd:string'),
'fk_project' => array('name'=>'fk_project','type'=>'xsd:string'),
'mode_reglement_id' => array('name'=>'mode_reglement_id','type'=>'xsd:string'),
'mode_reglement_code' => array('name'=>'mode_reglement_code','type'=>'xsd:string'),
'mode_reglement' => array('name'=>'mode_reglement','type'=>'xsd:string'),
'cond_reglement_id' => array('name'=>'cond_reglement_id','type'=>'xsd:string'),
'cond_reglement_code' => array('name'=>'cond_reglement_code','type'=>'xsd:string'),
'cond_reglement' => array('name'=>'cond_reglement','type'=>'xsd:string'),
'cond_reglement_doc' => array('name'=>'cond_reglement_doc','type'=>'xsd:string'),
'date_livraison' => array('name'=>'date_livraison','type'=>'xsd:date'),
'fk_delivery_address' => array('name'=>'fk_delivery_address','type'=>'xsd:int'),
'demand_reason_id' => array('name'=>'demand_reason_id','type'=>'xsd:string'),
'lines' => array('name'=>'lines','type'=>'tns:LinesArray')
)
); );
$server->wsdl->addComplexType( $server->wsdl->addComplexType(
'result', 'OrdersArray',
'complexType', 'complexType',
'struct', 'array',
'all', '',
'', 'SOAP-ENC:Array',
array( array(),
'result_code' => array('name'=>'result_code','type'=>'xsd:string'), array(
'result_label' => array('name'=>'result_label','type'=>'xsd:string'), array(
) 'ref'=>'SOAP-ENC:arrayType',
'wsdl:arrayType'=>'tns:order[]'
)
),
'tns:order'
);
$server->wsdl->addComplexType(
'OrdersArray2',
'complexType',
'array',
'sequence',
'',
array(
'order' => array(
'name' => 'invoice',
'type' => 'tns:invoice',
'minOccurs' => '0',
'maxOccurs' => 'unbounded'
)
)
);
$server->wsdl->addComplexType(
'result',
'complexType',
'struct',
'all',
'',
array(
'result_code' => array(
'name'=>'result_code',
'type'=>'xsd:string'
),
'result_label' => array(
'name'=>'result_label',
'type'=>'xsd:string'
),
)
); );
@ -230,54 +243,50 @@ $styleuse='encoded'; // encoded/literal/literal wrapped
// Better choice is document/literal wrapped but literal wrapped not supported by nusoap. // Better choice is document/literal wrapped but literal wrapped not supported by nusoap.
// Register WSDL // Register WSDL
$server->register('getOrder', $server->register(
// Entry values 'getOrder',
array('authentication'=>'tns:authentication','id'=>'xsd:string','ref'=>'xsd:string','ref_ext'=>'xsd:string'), array('authentication'=>'tns:authentication','id'=>'xsd:string','ref'=>'xsd:string','ref_ext'=>'xsd:string'), // Entry values
// Exit values array('result'=>'tns:result','order'=>'tns:order'), // Exit values
array('result'=>'tns:result','order'=>'tns:order'), $ns,
$ns, $ns.'#getOrder',
$ns.'#getOrder', $styledoc,
$styledoc, $styleuse,
$styleuse, 'WS to get a particular invoice'
'WS to get a particular invoice'
); );
$server->register('getOrdersForThirdParty', $server->register(
// Entry values 'getOrdersForThirdParty',
array('authentication'=>'tns:authentication','idthirdparty'=>'xsd:string'), array('authentication'=>'tns:authentication','idthirdparty'=>'xsd:string'), // Entry values
// Exit values array('result'=>'tns:result','orders'=>'tns:OrdersArray2'), // Exit values
array('result'=>'tns:result','orders'=>'tns:OrdersArray2'), $ns,
$ns, $ns.'#getOrdersForThirdParty',
$ns.'#getOrdersForThirdParty', $styledoc,
$styledoc, $styleuse,
$styleuse, 'WS to get all orders of a third party'
'WS to get all orders of a third party'
); );
$server->register('createOrder', $server->register(
// Entry values 'createOrder',
array('authentication'=>'tns:authentication','order'=>'tns:order'), array('authentication'=>'tns:authentication','order'=>'tns:order'), // Entry values
// Exit values array('result'=>'tns:result','id'=>'xsd:string'), // Exit values
array('result'=>'tns:result','id'=>'xsd:string'), $ns,
$ns, $ns.'#createOrder',
$ns.'#createOrder', $styledoc,
$styledoc, $styleuse,
$styleuse, 'WS to create an order'
'WS to create an order'
); );
// Register WSDL // Register WSDL
$server->register('validOrder', $server->register(
// Entry values 'validOrder',
array('authentication'=>'tns:authentication','id'=>'xsd:string'), array('authentication'=>'tns:authentication','id'=>'xsd:string'), // Entry values
// Exit values array('result'=>'tns:result'), // Exit values
array('result'=>'tns:result'), $ns,
$ns, $ns.'#validOrder',
$ns.'#validOrder', $styledoc,
$styledoc, $styleuse,
$styleuse, 'WS to valid an order'
'WS to valid an order'
); );
/** /**
@ -605,7 +614,7 @@ function createOrder($authentication,$order)
$now=dol_now(); $now=dol_now();
dol_syslog("Function: createOrder login=".$authentication['login']." socid :".$order['socid'] ); dol_syslog("Function: createOrder login=".$authentication['login']." socid :".$order['socid']);
// Init and check authentication // Init and check authentication
$objectresp=array(); $objectresp=array();