Skip to content
Snippets Groups Projects
Commit ae08c49d authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fix: due date and unit price into web service

parent 3fafecff
No related branches found
No related tags found
No related merge requests found
...@@ -92,11 +92,12 @@ $server->wsdl->addComplexType( ...@@ -92,11 +92,12 @@ $server->wsdl->addComplexType(
'id' => array('name'=>'id','type'=>'xsd:string'), 'id' => array('name'=>'id','type'=>'xsd:string'),
'type' => array('name'=>'type','type'=>'xsd:int'), 'type' => array('name'=>'type','type'=>'xsd:int'),
'desc' => array('name'=>'desc','type'=>'xsd:string'), 'desc' => array('name'=>'desc','type'=>'xsd:string'),
'vat_rate' => array('name'=>'vat_rate','type'=>'xsd:double'),
'qty' => array('name'=>'qty','type'=>'xsd:double'),
'unitprice' => array('name'=>'unitprice','type'=>'xsd:double'),
'total_net' => array('name'=>'total_net','type'=>'xsd:double'), 'total_net' => array('name'=>'total_net','type'=>'xsd:double'),
'total_vat' => array('name'=>'total_vat','type'=>'xsd:double'), 'total_vat' => array('name'=>'total_vat','type'=>'xsd:double'),
'total' => array('name'=>'total','type'=>'xsd:double'), 'total' => array('name'=>'total','type'=>'xsd:double'),
'vat_rate' => array('name'=>'vat_rate','type'=>'xsd:double'),
'qty' => array('name'=>'qty','type'=>'xsd:double'),
'date_start' => array('name'=>'date_start','type'=>'xsd:date'), 'date_start' => array('name'=>'date_start','type'=>'xsd:date'),
'date_end' => array('name'=>'date_end','type'=>'xsd:date'), 'date_end' => array('name'=>'date_end','type'=>'xsd:date'),
// From product // From product
...@@ -505,7 +506,6 @@ function createInvoice($authentication,$invoice) ...@@ -505,7 +506,6 @@ function createInvoice($authentication,$invoice)
$newobject->type=$invoice['type']; $newobject->type=$invoice['type'];
$newobject->ref_ext=$invoice['ref_ext']; $newobject->ref_ext=$invoice['ref_ext'];
$newobject->date=dol_stringtotime($invoice['date'],'dayrfc'); $newobject->date=dol_stringtotime($invoice['date'],'dayrfc');
$newobject->date_lim_reglement=dol_stringtotime($invoice['date_due'],'dayrfc');
$newobject->note=$invoice['note']; $newobject->note=$invoice['note'];
$newobject->note_public=$invoice['note_public']; $newobject->note_public=$invoice['note_public'];
$newobject->statut=$invoice['status']; $newobject->statut=$invoice['status'];
...@@ -524,11 +524,12 @@ function createInvoice($authentication,$invoice) ...@@ -524,11 +524,12 @@ function createInvoice($authentication,$invoice)
$newline->type=$line['type']; $newline->type=$line['type'];
$newline->desc=$line['desc']; $newline->desc=$line['desc'];
$newline->fk_product=$line['fk_product']; $newline->fk_product=$line['fk_product'];
$newline->tva_tx=$line['vat_rate'];
$newline->qty=$line['qty'];
$newline->subprice=$line['unitprice'];
$newline->total_ht=$line['total_net']; $newline->total_ht=$line['total_net'];
$newline->total_tva=$line['total_vat']; $newline->total_tva=$line['total_vat'];
$newline->total_ttc=$line['total']; $newline->total_ttc=$line['total'];
$newline->vat=$line['vat_rate'];
$newline->qty=$line['qty'];
$newline->fk_product=$line['product_id']; $newline->fk_product=$line['product_id'];
$newobject->lines[]=$newline; $newobject->lines[]=$newline;
} }
...@@ -537,7 +538,7 @@ function createInvoice($authentication,$invoice) ...@@ -537,7 +538,7 @@ function createInvoice($authentication,$invoice)
$db->begin(); $db->begin();
$result=$newobject->create($fuser,0,0); $result=$newobject->create($fuser,0,dol_stringtotime($invoice['date_due'],'dayrfc'));
if ($result < 0) if ($result < 0)
{ {
$error++; $error++;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment