New: Add webservice to create a product

This commit is contained in:
eldy 2011-10-02 01:23:57 +02:00
parent fe30491a45
commit 409fd169cf
5 changed files with 436 additions and 77 deletions

View File

@ -22,12 +22,13 @@ For users:
- New: Can search on part of barcode into POS module.
For developers:
- New: Add webservice to get or create a prodcut or service.
- Qual: Removed no more used external libraries.
- Qual: Cleaned a lot of dead code.
- Qual: Parent templates classes were moved as abstract classes.
- Qual: Add more "hooks".
- Qual: Add "canvas" feature to overwrite page of thirdparty, contact, product with yours.
- More OOP (usage of "abstract", "static", ...), unifformize constructors.
- More OOP (usage of "abstract", "static", ...), uniformize constructors.
***** ChangeLog for 3.1 compared to 3.0 *****

View File

@ -45,7 +45,8 @@ class Product extends CommonObject
var $id ;
//! Ref
var $ref;
var $libelle;
var $libelle; // TODO deprecated
var $label;
var $description;
//! Prix de vente
var $price; // Price without tax
@ -68,14 +69,14 @@ class Product extends CommonObject
var $localtax2_tx;
//! Type 0 for regular product, 1 for service (Advanced feature: 2 for assembly kit, 3 for stock kit)
var $type;
var $typestring;
//! Stock
var $stock_reel;
//! Average price value for product entry into stock (PMP)
var $pmp;
//! Stock alert
var $seuil_stock_alerte;
//! Duree de validite du service
var $duration_value;
//! Unite de duree
@ -188,9 +189,9 @@ class Product extends CommonObject
/**
* Insert product into database
*
* @param user User making insert
* @param notrigger Disable triggers
* @return int Id of product/service if OK or number of error < 0
* @param User $user User making insert
* @param int $notrigger Disable triggers
* @return int Id of product/service if OK or number of error < 0
*/
function create($user,$notrigger=0)
{
@ -255,6 +256,7 @@ class Product extends CommonObject
dol_syslog("Product::Create ref=".$this->ref." price=".$this->price." price_ttc=".$this->price_ttc." tva_tx=".$this->tva_tx." price_base_type=".$this->price_base_type." Category : ".$this->catid, LOG_DEBUG);
$now=dol_now();
$this->db->begin();
@ -287,7 +289,7 @@ class Product extends CommonObject
$sql.= ", canvas";
$sql.= ", finished";
$sql.= ") VALUES (";
$sql.= $this->db->idate(mktime());
$sql.= $this->db->idate($now);
$sql.= ", ".$conf->entity;
$sql.= ", '".$this->ref."'";
$sql.= ", ".price2num($price_min_ht);
@ -357,7 +359,8 @@ class Product extends CommonObject
else
{
// Product already exists with this ref
$langs->trans("Error")." : ".$langs->trans("ErrorProductAlreadyExists",$this->ref);
$langs->load("products");
$this->error = $langs->transnoentitiesnoconv("ErrorProductAlreadyExists",$this->ref);
}
}
else
@ -391,9 +394,9 @@ class Product extends CommonObject
/**
* Update a record into database
*
* @param id Id of product
* @param user Object user making update
* @return int 1 if OK, -1 if ref already exists, -2 if other error
* @param int $id Id of product
* @param User $user Object user making update
* @return int 1 if OK, -1 if ref already exists, -2 if other error
*/
function update($id, $user)
{
@ -1047,6 +1050,11 @@ class Product extends CommonObject
$this->label = $object->label;
$this->description = $object->description;
$this->note = $object->note;
$this->type = $object->fk_product_type;
$this->status = $object->tosell;
$this->status_buy = $object->tobuy;
$this->customcode = $object->customcode;
$this->country_id = $object->fk_country;
$this->country_code = getCountry($this->country_id,2,$this->db);
@ -1062,14 +1070,10 @@ class Product extends CommonObject
$this->localtax1_tx = $object->localtax1_tx;
$this->localtax2_tx = $object->localtax2_tx;
$this->type = $object->fk_product_type;
$this->status = $object->tosell;
$this->status_buy = $object->tobuy;
$this->finished = $object->finished;
$this->duration = $object->duration;
$this->duration_value = substr($object->duration,0,dol_strlen($object->duration)-1);
$this->duration_unit = substr($object->duration,-1);
$this->seuil_stock_alerte = $object->seuil_stock_alerte;
$this->canvas = $object->canvas;
$this->weight = $object->weight;
$this->weight_units = $object->weight_units;
@ -1085,6 +1089,7 @@ class Product extends CommonObject
$this->accountancy_code_buy = $object->accountancy_code_buy;
$this->accountancy_code_sell= $object->accountancy_code_sell;
$this->seuil_stock_alerte = $object->seuil_stock_alerte;
$this->stock_reel = $object->stock;
$this->pmp = $object->pmp;

View File

@ -246,8 +246,8 @@ $server->register(
/**
* Get invoice from id, ref or ref_ext
*
* @param object $authentication
*
* @param array $authentication Array of authentication information
* @return array Array result
*/
function getInvoice($authentication,$id='',$ref='',$ref_ext='')
{
@ -352,6 +352,9 @@ function getInvoice($authentication,$id='',$ref='',$ref_ext='')
/**
* Get list of invoices for third party
*
* @param array $authentication Array of authentication information
* @return array Array result
*/
function getInvoicesForThirdParty($authentication,$idthirdparty)
{
@ -467,7 +470,11 @@ function getInvoicesForThirdParty($authentication,$idthirdparty)
/**
* Get list of invoices for third party
* Create an invoice
*
* @param array $authentication Array of authentication information
* @param Facture $invoice Invoice
* @return array Array result
*/
function createInvoice($authentication,$invoice)
{
@ -475,7 +482,7 @@ function createInvoice($authentication,$invoice)
$now=dol_now();
dol_syslog("Function: createInvoiceForThirdParty login=".$authentication['login']." idthirdparty=".$idthirdparty);
dol_syslog("Function: createInvoiceForThirdParty login=".$authentication['login']);
if ($authentication['entity']) $conf->entity=$authentication['entity'];
@ -488,17 +495,17 @@ function createInvoice($authentication,$invoice)
if (! $error)
{
$newinvoice=new Facture($db);
$newinvoice->socid=$invoice['thirdparty_id'];
$newinvoice->type=$invoice['type'];
$newinvoice->ref_ext=$invoice['ref_ext'];
$newinvoice->date=$invoice['date'];
$newinvoice->date_lim_reglement=$invoice['date_due'];
$newinvoice->note=$invoice['note'];
$newinvoice->note_public=$invoice['note_public'];
$newinvoice->statut=$invoice['status'];
$newinvoice->fk_project=$invoice['project_id'];
$newinvoice->date_creation=$now;
$newobject=new Facture($db);
$newobject->socid=$invoice['thirdparty_id'];
$newobject->type=$invoice['type'];
$newobject->ref_ext=$invoice['ref_ext'];
$newobject->date=$invoice['date'];
$newobject->date_lim_reglement=$invoice['date_due'];
$newobject->note=$invoice['note'];
$newobject->note_public=$invoice['note_public'];
$newobject->statut=$invoice['status'];
$newobject->fk_project=$invoice['project_id'];
$newobject->date_creation=$now;
foreach($invoice['lines'] as $line)
{
$newline=new FactureLigne($db);
@ -517,35 +524,32 @@ function createInvoice($authentication,$invoice)
$db->begin();
$result=$newinvoice->create($user,0,0);
$result=$newobject->create($fuser,0,0);
if ($result < 0)
{
$error++;
}
if ($newinvoice->statut == 1) // We want invoice validated
if ($newobject->statut == 1) // We want invoice validated
{
$newinvoice->validate($user);
$result=$newobject->validate($fuser);
if ($result < 0)
{
$error++;
}
}
$result=$newinvoice->create($user,0,0);
if ($result < 0)
{
$error++;
}
if (! $error)
{
$db->commit();
$objectresp=array('result'=>array('result_code'=>'OK', 'result_label'=>''),'id'=>$newinvoice->id,'ref'=>$newinvoice->ref);
$objectresp=array('result'=>array('result_code'=>'OK', 'result_label'=>''),'id'=>$newobject->id,'ref'=>$newobject->ref);
}
else
{
$db->rollback();
$error++;
$errorcode='KO';
$errorlabel=$newinvoice->error;
$errorlabel=$newobject->error;
}
}

View File

@ -89,18 +89,31 @@ $server->wsdl->addComplexType(
'',
array(
'id' => array('name'=>'id','type'=>'xsd:string'),
'ref' => array('name'=>'name','type'=>'xsd:string'),
'ref' => array('name'=>'ref','type'=>'xsd:string'),
'ref_ext' => array('name'=>'ref_ext','type'=>'xsd:string'),
'label' => array('name'=>'label','type'=>'xsd:string'),
'type' => array('name'=>'type','type'=>'xsd:string'),
'label' => array('name'=>'label','type'=>'xsd:string'),
'description' => array('name'=>'description','type'=>'xsd:string'),
'date_creation' => array('name'=>'date_creation','type'=>'xsd:dateTime'),
'date_modification' => array('name'=>'date_modification','type'=>'xsd:dateTime'),
'note' => array('name'=>'note','type'=>'xsd:string'),
'tobuy' => array('name'=>'tobuy','type'=>'xsd:string'),
'tosell' => array('name'=>'tosell','type'=>'xsd:string'),
'type' => array('name'=>'type','type'=>'xsd:string'),
'status_tobuy' => array('name'=>'status_tobuy','type'=>'xsd:string'),
'status_tosell' => array('name'=>'status_tosell','type'=>'xsd:string'),
'barcode' => array('name'=>'barcode','type'=>'xsd:string'),
'country_id' => array('name'=>'country_id','type'=>'xsd:string')
'barcode_type' => array('name'=>'barcode_type','type'=>'xsd:string'),
'country_id' => array('name'=>'country_id','type'=>'xsd:string'),
'country_code' => array('name'=>'country_code','type'=>'xsd:string'),
'customcode' => array('name'=>'customcode','type'=>'xsd:string'),
'price_net' => array('name'=>'price_net','type'=>'xsd:string'),
'price' => array('name'=>'price','type'=>'xsd:string'),
'price_base_type' => array('name'=>'price_base_type','type'=>'xsd:string'),
'stock_alert' => array('name'=>'stock_alert','type'=>'xsd:string'),
'stock_real' => array('name'=>'stock_real','type'=>'xsd:string'),
'stock_pmp' => array('name'=>'stock_pmp','type'=>'xsd:string'),
'canvas' => array('name'=>'canvas','type'=>'xsd:string'),
'import_key' => array('name'=>'import_key','type'=>'xsd:string')
)
);
@ -113,19 +126,6 @@ $styledoc='rpc'; // rpc/document (document is an extend into SOAP 1.0 to s
$styleuse='encoded'; // encoded/literal/literal wrapped
// Better choice is document/literal wrapped but literal wrapped not supported by nusoap.
// Register WSDL
$server->register(
'createProductOrService',
// Entry values
array('authentication'=>'tns:authentication','product'=>'tns:product'),
// Exit values
array('result'=>'tns:result','id'=>'xsd:string'),
$ns,
$ns.'#createProductOrService',
$styledoc,
$styleuse,
'WS to create a product or service'
);
// Register WSDL
$server->register(
@ -141,8 +141,26 @@ $server->register(
'WS to get product or service'
);
// Register WSDL
$server->register(
'createProductOrService',
// Entry values
array('authentication'=>'tns:authentication','product'=>'tns:product'),
// Exit values
array('result'=>'tns:result','id'=>'xsd:string'),
$ns,
$ns.'#createProductOrService',
$styledoc,
$styleuse,
'WS to create a product or service'
);
// Full methods code
/**
* Get produt or service
*
* @param array $authentication Array of authentication information
*/
function getProductOrService($authentication,$id='',$ref='',$ref_ext='')
{
global $db,$conf,$langs;
@ -178,18 +196,31 @@ function getProductOrService($authentication,$id='',$ref='',$ref_ext='')
'result'=>array('result_code'=>'OK', 'result_label'=>''),
'product'=>array(
'id' => $product->id,
'ref' => $product->name,
'ref' => $product->ref,
'ref_ext' => $product->ref_ext,
'label' => $product->label,
'description' => $product->description,
'date_creation' => $product->date_creation,
'date_modification' => $product->date_modification,
'note' => $product->note,
'tobuy' => $product->tobuy,
'tosell' => $product->tosell,
'type' => $product->type,
'status_tosell' => $product->status,
'status_tobuy' => $product->status_buy,
'type' => $product->type,
'barcode' => $product->barcode,
'country_id' => $product->country_id
'barcode_type' => $product->barcode_type,
'country_id' => $product->country_id>0?$product->country_id:'',
'country_code' => $product->country_code,
'custom_code' => $product->customcode,
'price_net' => $product->price,
'price' => ($product->price_ttc-$product->price),
'vat_rate' => $product->tva_tx,
'price_base_type' => $product->price_base_type,
'stock_real' => $product->stock_reel,
'stock_alert' => $product->seuil_stock_alerte,
'pmp' => $product->pmp,
'import_key' => $product->import_key
));
}
else
@ -214,6 +245,114 @@ function getProductOrService($authentication,$id='',$ref='',$ref_ext='')
}
/**
* Create an invoice
*
* @param array $authentication Array of authentication information
* @param Product $product Product
* @return array Array result
*/
function createProductOrService($authentication,$product)
{
global $db,$conf,$langs;
$now=dol_now();
dol_syslog("Function: createProductOrService login=".$authentication['login']);
if ($authentication['entity']) $conf->entity=$authentication['entity'];
// Init and check authentication
$objectresp=array();
$errorcode='';$errorlabel='';
$error=0;
$fuser=check_authentication($authentication,$error,$errorcode,$errorlabel);
// Check parameters
if ($product['price_net'] > 0) $product['price_base_type']='HT';
if ($product['price'] > 0) $product['price_base_type']='TTC';
if ($product['price_net'] > 0 && $product['price'] > 0)
{
$error++; $errorcode='KO'; $errorlabel="You must choose between price or price_net to provide price.";
}
if (! $error)
{
include_once(DOL_DOCUMENT_ROOT.'/lib/company.lib.php');
$newobject=new Product($db);
$newobject->ref=$product['ref'];
$newobject->ref_ext=$product['ref_ext'];
$newobject->type=$product['type'];
$newobject->libelle=$product['label']; // TODO deprecated
$newobject->label=$product['label'];
$newobject->description=$product['description'];
$newobject->note=$product['note'];
$newobject->status=$product['status_tosell'];
$newobject->status_buy=$product['status_tobuy'];
$newobject->price=$product['price_net'];
$newobject->price_ttc=$product['price'];
$newobject->tva_tx=$product['vat_rate'];
$newobject->price_base_type=$product['price_base_type'];
$newobject->date_creation=$now;
$newobject->stock_reel=$product['stock_real'];
$newobject->pmp=$product['pmp'];
$newobject->seuil_stock_alert=$product['stock_alert'];
$newobject->country_id=$product['country_id'];
if ($product['country_code']) $newobject->country_id=getCountry($product['country_code'],3);
$newobject->customcode=$product['customcode'];
$newobject->canvas=$product['canvas'];
/*foreach($product['lines'] as $line)
{
$newline=new FactureLigne($db);
$newline->type=$line['type'];
$newline->desc=$line['desc'];
$newline->fk_product=$line['fk_product'];
$newline->total_ht=$line['total_net'];
$newline->total_vat=$line['total_vat'];
$newline->total_ttc=$line['total'];
$newline->vat=$line['vat_rate'];
$newline->qty=$line['qty'];
$newline->fk_product=$line['product_id'];
}*/
//var_dump($product['ref_ext']);
//var_dump($product['lines'][0]['type']);
$db->begin();
$result=$newobject->create($fuser,0);
if ($result <= 0)
{
$error++;
}
if (! $error)
{
$db->commit();
$objectresp=array('result'=>array('result_code'=>'OK', 'result_label'=>''),'id'=>$newobject->id,'ref'=>$newobject->ref);
}
else
{
$db->rollback();
$error++;
$errorcode='KO';
$errorlabel=$newobject->error;
}
}
if ($error)
{
$objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel));
}
return $objectresp;
}
// Return the results.
$server->service($HTTP_RAW_POST_DATA);

View File

@ -55,16 +55,16 @@
<soap:address location="http://localhost/dolibarrnew/webservices/server_other.php"/>
</port>
</service>
</definitions>]]></con:content><con:type>http://schemas.xmlsoap.org/wsdl/</con:type></con:part></con:definitionCache><con:endpoints><con:endpoint>http://localhost/dolibarrnew/webservices/server_other.php</con:endpoint></con:endpoints><con:operation isOneWay="false" action="http://www.dolibarr.org/ns/#getVersions" name="getVersions" bindingOperationName="getVersions" type="Request-Response" inputName="" receivesAttachments="false" sendsAttachments="false" anonymous="optional"><con:settings/><con:call name="Request 1"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers">&lt;xml-fragment/></con:setting></con:settings><con:encoding>UTF-8</con:encoding><con:endpoint>http://localhost/dolibarrnew/webservices/server_other.php</con:endpoint><con:request><![CDATA[<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.dolibarr.org/ns/">
</definitions>]]></con:content><con:type>http://schemas.xmlsoap.org/wsdl/</con:type></con:part></con:definitionCache><con:endpoints><con:endpoint>http://localhostdolibarr/dolibarrnew/webservices/server_other.php</con:endpoint></con:endpoints><con:operation isOneWay="false" action="http://www.dolibarr.org/ns/#getVersions" name="getVersions" bindingOperationName="getVersions" type="Request-Response" inputName="" receivesAttachments="false" sendsAttachments="false" anonymous="optional"><con:settings/><con:call name="Request 1"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers">&lt;xml-fragment/></con:setting></con:settings><con:encoding>UTF-8</con:encoding><con:endpoint>http://localhostdolibarr/dolibarrnew/webservices/server_other.php</con:endpoint><con:request><![CDATA[<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.dolibarr.org/ns/">
<soapenv:Header/>
<soapenv:Body>
<ns:getVersions soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<authentication xsi:type="ns:authentication">
<!--You may enter the following 5 items in any order-->
<dolibarrkey xsi:type="xsd:string">?</dolibarrkey>
<dolibarrkey xsi:type="xsd:string">dolibarrkey</dolibarrkey>
<sourceapplication xsi:type="xsd:string">?</sourceapplication>
<login xsi:type="xsd:string">?</login>
<password xsi:type="xsd:string">?</password>
<login xsi:type="xsd:string">admin</login>
<password xsi:type="xsd:string">admin</password>
<entity xsi:type="xsd:string"></entity>
</authentication>
</ns:getVersions>
@ -341,7 +341,7 @@
<soap:address location="http://localhost/dolibarrnew/webservices/server_invoice.php"/>
</port>
</service>
</definitions>]]></con:content><con:type>http://schemas.xmlsoap.org/wsdl/</con:type></con:part></con:definitionCache><con:endpoints><con:endpoint>http://localhost/dolibarrnew/webservices/server_invoice.php</con:endpoint></con:endpoints><con:operation isOneWay="false" action="http://www.dolibarr.org/ns/#createInvoice" name="createInvoice" bindingOperationName="createInvoice" type="Request-Response" inputName="" receivesAttachments="false" sendsAttachments="false" anonymous="optional"><con:settings/><con:call name="Request 1"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers">&lt;xml-fragment/></con:setting></con:settings><con:encoding>UTF-8</con:encoding><con:endpoint>http://localhost/dolibarrnew/webservices/server_invoice.php</con:endpoint><con:request><![CDATA[<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.dolibarr.org/ns/">
</definitions>]]></con:content><con:type>http://schemas.xmlsoap.org/wsdl/</con:type></con:part></con:definitionCache><con:endpoints><con:endpoint>http://localhostdolibarr/dolibarrnew/webservices/server_invoice.php</con:endpoint></con:endpoints><con:operation isOneWay="false" action="http://www.dolibarr.org/ns/#createInvoice" name="createInvoice" bindingOperationName="createInvoice" type="Request-Response" inputName="" receivesAttachments="false" sendsAttachments="false" anonymous="optional"><con:settings/><con:call name="Request 1"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers">&lt;xml-fragment/></con:setting></con:settings><con:encoding>UTF-8</con:encoding><con:endpoint>http://localhostdolibarr/dolibarrnew/webservices/server_invoice.php</con:endpoint><con:request><![CDATA[<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.dolibarr.org/ns/">
<soapenv:Header/>
<soapenv:Body>
<ns:createInvoice soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
@ -394,13 +394,71 @@
</invoice>
</ns:createInvoice>
</soapenv:Body>
</soapenv:Envelope>]]></con:request><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508" action="http://www.dolibarr.org/ns/#createInvoice"/><con:wsrmConfig version="1.2"/></con:call></con:operation><con:operation isOneWay="false" action="http://www.dolibarr.org/ns/#getInvoice" name="getInvoice" bindingOperationName="getInvoice" type="Request-Response" inputName="" receivesAttachments="false" sendsAttachments="false" anonymous="optional"><con:settings/><con:call name="Request 1"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers">&lt;xml-fragment/></con:setting></con:settings><con:encoding>UTF-8</con:encoding><con:endpoint>http://localhost/dolibarrnew/webservices/server_invoice.php</con:endpoint><con:request><![CDATA[<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.dolibarr.org/ns/">
</soapenv:Envelope>]]></con:request><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508" action="http://www.dolibarr.org/ns/#createInvoice"/><con:wsrmConfig version="1.2"/></con:call><con:call name="Request 2"><con:settings/><con:encoding>UTF-8</con:encoding><con:endpoint>http://localhostdolibarr/dolibarrnew/webservices/server_invoice.php</con:endpoint><con:request><![CDATA[<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.dolibarr.org/ns/">
<soapenv:Header/>
<soapenv:Body>
<ns:createInvoice soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<authentication xsi:type="ns:authentication">
<!--You may enter the following 5 items in any order-->
<dolibarrkey xsi:type="xsd:string">?</dolibarrkey>
<sourceapplication xsi:type="xsd:string">?</sourceapplication>
<login xsi:type="xsd:string">?</login>
<password xsi:type="xsd:string">?</password>
<entity xsi:type="xsd:string">?</entity>
</authentication>
<invoice xsi:type="ns:invoice">
<!--You may enter the following 22 items in any order-->
<id xsi:type="xsd:string">?</id>
<ref xsi:type="xsd:string">?</ref>
<ref_ext xsi:type="xsd:string">?</ref_ext>
<thirdparty_id xsi:type="xsd:int">?</thirdparty_id>
<fk_user_author xsi:type="xsd:string">?</fk_user_author>
<fk_user_valid xsi:type="xsd:string">?</fk_user_valid>
<date xsi:type="xsd:date">?</date>
<date_due xsi:type="xsd:date">?</date_due>
<date_creation xsi:type="xsd:dateTime">?</date_creation>
<date_validation xsi:type="xsd:dateTime">?</date_validation>
<date_modification xsi:type="xsd:dateTime">?</date_modification>
<type xsi:type="xsd:int">?</type>
<total_net xsi:type="xsd:double">?</total_net>
<total_vat xsi:type="xsd:double">?</total_vat>
<total xsi:type="xsd:double">?</total>
<note xsi:type="xsd:string">?</note>
<note_public xsi:type="xsd:string">?</note_public>
<status xsi:type="xsd:int">?</status>
<close_code xsi:type="xsd:string">?</close_code>
<close_note xsi:type="xsd:string">?</close_note>
<project_id xsi:type="xsd:string">?</project_id>
<lines xsi:type="ns:LinesArray2">
<!--Zero or more repetitions:-->
<line xsi:type="ns:line">
<!--You may enter the following 14 items in any order-->
<id xsi:type="xsd:string">?</id>
<type xsi:type="xsd:int">?</type>
<desc xsi:type="xsd:string">?</desc>
<total_net xsi:type="xsd:double">?</total_net>
<total_vat xsi:type="xsd:double">?</total_vat>
<total xsi:type="xsd:double">?</total>
<vat_rate xsi:type="xsd:double">?</vat_rate>
<qty xsi:type="xsd:double">?</qty>
<date_start xsi:type="xsd:date">?</date_start>
<date_end xsi:type="xsd:date">?</date_end>
<product_id xsi:type="xsd:int">?</product_id>
<product_ref xsi:type="xsd:string">?</product_ref>
<product_label xsi:type="xsd:string">?</product_label>
<product_desc xsi:type="xsd:string">?</product_desc>
</line>
</lines>
</invoice>
</ns:createInvoice>
</soapenv:Body>
</soapenv:Envelope>]]></con:request><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508" action="http://www.dolibarr.org/ns/#createInvoice"/><con:wsrmConfig version="1.2"/></con:call></con:operation><con:operation isOneWay="false" action="http://www.dolibarr.org/ns/#getInvoice" name="getInvoice" bindingOperationName="getInvoice" type="Request-Response" inputName="" receivesAttachments="false" sendsAttachments="false" anonymous="optional"><con:settings/><con:call name="Request 1"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers">&lt;xml-fragment/></con:setting></con:settings><con:encoding>UTF-8</con:encoding><con:endpoint>http://localhostdolibarr/dolibarrnew/webservices/server_invoice.php</con:endpoint><con:request><![CDATA[<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.dolibarr.org/ns/">
<soapenv:Header/>
<soapenv:Body>
<ns:getInvoice soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<authentication xsi:type="ns:authentication">
<!--You may enter the following 5 items in any order-->
<dolibarrkey xsi:type="xsd:string">?</dolibarrkey>
<dolibarrkey xsi:type="xsd:string">dolibarrkey</dolibarrkey>
<sourceapplication xsi:type="xsd:string">?</sourceapplication>
<login xsi:type="xsd:string">admin</login>
<password xsi:type="xsd:string">admin</password>
@ -411,7 +469,7 @@
<ref_ext xsi:type="xsd:string"></ref_ext>
</ns:getInvoice>
</soapenv:Body>
</soapenv:Envelope>]]></con:request><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508" action="http://www.dolibarr.org/ns/#getInvoice"/><con:wsrmConfig version="1.2"/></con:call></con:operation><con:operation isOneWay="false" action="http://www.dolibarr.org/ns/#getInvoicesForThirdParty" name="getInvoicesForThirdParty" bindingOperationName="getInvoicesForThirdParty" type="Request-Response" inputName="" receivesAttachments="false" sendsAttachments="false" anonymous="optional"><con:settings/><con:call name="Request 1"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers">&lt;xml-fragment/></con:setting></con:settings><con:encoding>UTF-8</con:encoding><con:endpoint>http://localhost/dolibarrnew/webservices/server_invoice.php</con:endpoint><con:request><![CDATA[<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.dolibarr.org/ns/">
</soapenv:Envelope>]]></con:request><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508" action="http://www.dolibarr.org/ns/#getInvoice"/><con:wsrmConfig version="1.2"/></con:call></con:operation><con:operation isOneWay="false" action="http://www.dolibarr.org/ns/#getInvoicesForThirdParty" name="getInvoicesForThirdParty" bindingOperationName="getInvoicesForThirdParty" type="Request-Response" inputName="" receivesAttachments="false" sendsAttachments="false" anonymous="optional"><con:settings/><con:call name="Request 1"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers">&lt;xml-fragment/></con:setting></con:settings><con:encoding>UTF-8</con:encoding><con:endpoint>http://localhostdolibarr/dolibarrnew/webservices/server_invoice.php</con:endpoint><con:request><![CDATA[<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.dolibarr.org/ns/">
<soapenv:Header/>
<soapenv:Body>
<ns:getInvoicesForThirdParty soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
@ -601,4 +659,156 @@
<idthirdparty xsi:type="xsd:string">all</idthirdparty>
</ns:getSupplierInvoicesForThirdParty>
</soapenv:Body>
</soapenv:Envelope>]]></con:request><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508" action="http://www.dolibarr.org/ns/#getSupplierInvoicesForThirdParty"/><con:wsrmConfig version="1.2"/></con:call></con:operation></con:interface><con:properties/><con:wssContainer/></con:soapui-project>
</soapenv:Envelope>]]></con:request><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508" action="http://www.dolibarr.org/ns/#getSupplierInvoicesForThirdParty"/><con:wsrmConfig version="1.2"/></con:call></con:operation></con:interface><con:interface xsi:type="con:WsdlInterface" wsaVersion="NONE" name="WebServicesDolibarrProductOrServiceBinding" type="wsdl" bindingName="{http://www.dolibarr.org/ns/}WebServicesDolibarrProductOrServiceBinding" soapVersion="1_1" anonymous="optional" definition="http://localhostdolibarr/dolibarrnew/webservices/server_productorservice.php?wsdl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:settings/><con:definitionCache type="TEXT" rootPart="http://localhostdolibarr/dolibarrnew/webservices/server_productorservice.php?wsdl"><con:part><con:url>http://localhostdolibarr/dolibarrnew/webservices/server_productorservice.php?wsdl</con:url><con:content><![CDATA[<definitions targetNamespace="http://www.dolibarr.org/ns/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://www.dolibarr.org/ns/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
<xsd:schema targetNamespace="http://www.dolibarr.org/ns/">
<xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<xsd:import namespace="http://schemas.xmlsoap.org/wsdl/"/>
<xsd:complexType name="authentication">
<xsd:all>
<xsd:element name="dolibarrkey" type="xsd:string"/>
<xsd:element name="sourceapplication" type="xsd:string"/>
<xsd:element name="login" type="xsd:string"/>
<xsd:element name="password" type="xsd:string"/>
<xsd:element name="entity" type="xsd:string"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="result">
<xsd:all>
<xsd:element name="result_code" type="xsd:string"/>
<xsd:element name="result_label" type="xsd:string"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="product">
<xsd:all>
<xsd:element name="id" type="xsd:string"/>
<xsd:element name="ref" type="xsd:string"/>
<xsd:element name="ref_ext" type="xsd:string"/>
<xsd:element name="type" type="xsd:string"/>
<xsd:element name="label" type="xsd:string"/>
<xsd:element name="description" type="xsd:string"/>
<xsd:element name="date_creation" type="xsd:dateTime"/>
<xsd:element name="date_modification" type="xsd:dateTime"/>
<xsd:element name="note" type="xsd:string"/>
<xsd:element name="tobuy" type="xsd:string"/>
<xsd:element name="tosell" type="xsd:string"/>
<xsd:element name="barcode" type="xsd:string"/>
<xsd:element name="barcode_type" type="xsd:string"/>
<xsd:element name="country_id" type="xsd:string"/>
<xsd:element name="country_code" type="xsd:string"/>
<xsd:element name="customcode" type="xsd:string"/>
<xsd:element name="price_net" type="xsd:string"/>
<xsd:element name="price_vat" type="xsd:string"/>
<xsd:element name="price" type="xsd:string"/>
<xsd:element name="price_base_type" type="xsd:string"/>
<xsd:element name="stock_alert" type="xsd:string"/>
<xsd:element name="stock_real" type="xsd:string"/>
<xsd:element name="stock_pmp" type="xsd:string"/>
<xsd:element name="canvas" type="xsd:string"/>
<xsd:element name="import_key" type="xsd:string"/>
</xsd:all>
</xsd:complexType>
</xsd:schema>
</types>
<message name="createProductOrServiceRequest">
<part name="authentication" type="tns:authentication"/>
<part name="product" type="tns:product"/>
</message>
<message name="createProductOrServiceResponse">
<part name="result" type="tns:result"/>
<part name="id" type="xsd:string"/>
</message>
<message name="getProductOrServiceRequest">
<part name="authentication" type="tns:authentication"/>
<part name="id" type="xsd:string"/>
<part name="ref" type="xsd:string"/>
<part name="ref_ext" type="xsd:string"/>
</message>
<message name="getProductOrServiceResponse">
<part name="result" type="tns:result"/>
<part name="product" type="tns:product"/>
</message>
<portType name="WebServicesDolibarrProductOrServicePortType">
<operation name="createProductOrService">
<documentation>WS to create a product or service</documentation>
<input message="tns:createProductOrServiceRequest"/>
<output message="tns:createProductOrServiceResponse"/>
</operation>
<operation name="getProductOrService">
<documentation>WS to get product or service</documentation>
<input message="tns:getProductOrServiceRequest"/>
<output message="tns:getProductOrServiceResponse"/>
</operation>
</portType>
<binding name="WebServicesDolibarrProductOrServiceBinding" type="tns:WebServicesDolibarrProductOrServicePortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="createProductOrService">
<soap:operation soapAction="http://www.dolibarr.org/ns/#createProductOrService" style="rpc"/>
<input>
<soap:body use="encoded" namespace="http://www.dolibarr.org/ns/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body use="encoded" namespace="http://www.dolibarr.org/ns/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
<operation name="getProductOrService">
<soap:operation soapAction="http://www.dolibarr.org/ns/#getProductOrService" style="rpc"/>
<input>
<soap:body use="encoded" namespace="http://www.dolibarr.org/ns/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body use="encoded" namespace="http://www.dolibarr.org/ns/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
</binding>
<service name="WebServicesDolibarrProductOrService">
<port name="WebServicesDolibarrProductOrServicePort" binding="tns:WebServicesDolibarrProductOrServiceBinding">
<soap:address location="http://localhostdolibarr/dolibarrnew/webservices/server_productorservice.php"/>
</port>
</service>
</definitions>]]></con:content><con:type>http://schemas.xmlsoap.org/wsdl/</con:type></con:part></con:definitionCache><con:endpoints><con:endpoint>http://localhostdolibarr/dolibarrnew/webservices/server_productorservice.php</con:endpoint></con:endpoints><con:operation isOneWay="false" action="http://www.dolibarr.org/ns/#createProductOrService" name="createProductOrService" bindingOperationName="createProductOrService" type="Request-Response" inputName="" receivesAttachments="false" sendsAttachments="false" anonymous="optional"><con:settings/><con:call name="Request 1"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers">&lt;xml-fragment/></con:setting></con:settings><con:encoding>UTF-8</con:encoding><con:endpoint>http://localhostdolibarr/dolibarrnew/webservices/server_productorservice.php</con:endpoint><con:request><![CDATA[<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.dolibarr.org/ns/">
<soapenv:Header/>
<soapenv:Body>
<ns:createProductOrService soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<authentication xsi:type="ns:authentication">
<!--You may enter the following 5 items in any order-->
<dolibarrkey xsi:type="xsd:string">?</dolibarrkey>
<sourceapplication xsi:type="xsd:string">?</sourceapplication>
<login xsi:type="xsd:string">?</login>
<password xsi:type="xsd:string">?</password>
<entity xsi:type="xsd:string">?</entity>
</authentication>
<product xsi:type="ns:product">
<!--You may enter the following 18 items in any order-->
<ref xsi:type="xsd:string">PPP</ref>
<ref_ext xsi:type="xsd:string"></ref_ext>
<label xsi:type="xsd:string">PPP Label</label>
<description xsi:type="xsd:string">Description of PPP</description>
<note xsi:type="xsd:string">xxxxx</note>
<tobuy xsi:type="xsd:string">1</tobuy>
<tosell xsi:type="xsd:string">0</tosell>
<type xsi:type="xsd:string">1</type>
<barcode xsi:type="xsd:string">123456</barcode>
<country_code xsi:type="xsd:string">FR</country_code>
<stock_alert xsi:type="xsd:string">10</stock_alert>
</product>
</ns:createProductOrService>
</soapenv:Body>
</soapenv:Envelope>]]></con:request><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508" action="http://www.dolibarr.org/ns/#createProductOrService"/><con:wsrmConfig version="1.2"/></con:call></con:operation><con:operation isOneWay="false" action="http://www.dolibarr.org/ns/#getProductOrService" name="getProductOrService" bindingOperationName="getProductOrService" type="Request-Response" inputName="" receivesAttachments="false" sendsAttachments="false" anonymous="optional"><con:settings/><con:call name="Request 1"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers">&lt;xml-fragment/></con:setting></con:settings><con:encoding>UTF-8</con:encoding><con:endpoint>http://localhostdolibarr/dolibarrnew/webservices/server_productorservice.php</con:endpoint><con:request><![CDATA[<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.dolibarr.org/ns/">
<soapenv:Header/>
<soapenv:Body>
<ns:getProductOrService soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<authentication xsi:type="ns:authentication">
<!--You may enter the following 5 items in any order-->
<dolibarrkey xsi:type="xsd:string">dolibarrkey</dolibarrkey>
<sourceapplication xsi:type="xsd:string">?</sourceapplication>
<login xsi:type="xsd:string">admin</login>
<password xsi:type="xsd:string">admin</password>
<entity xsi:type="xsd:string"></entity>
</authentication>
<id xsi:type="xsd:string">1</id>
<ref xsi:type="xsd:string"></ref>
<ref_ext xsi:type="xsd:string"></ref_ext>
</ns:getProductOrService>
</soapenv:Body>
</soapenv:Envelope>]]></con:request><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:wsaConfig mustUnderstand="NONE" version="200508" action="http://www.dolibarr.org/ns/#getProductOrService"/><con:wsrmConfig version="1.2"/></con:call></con:operation></con:interface><con:properties/><con:wssContainer/></con:soapui-project>