Update server_invoice.php

Create Facture with mode_reglement and cond_reglement using thirdparty information.
This commit is contained in:
Ignacio José Lizarán Rus 2014-10-29 17:43:01 +01:00
parent 1669700148
commit fa61faec58

View File

@ -525,7 +525,15 @@ function createInvoice($authentication,$invoice)
$newobject->statut=0; // We start with status draft
$newobject->fk_project=$invoice['project_id'];
$newobject->date_creation=$now;
$newobject->mode_reglement_id = $invoice['payment_mode_id'];
//take mode_reglement and cond_reglement from thirdparty
$soc = new Societe($db);
$res=$soc->fetch($newobject->socid);
if ($res > 0) {
$newobject->mode_reglement_id = ! empty($invoice['payment_mode_id'])?$invoice['payment_mode_id']:$soc->mode_reglement_id;
$newobject->cond_reglement_id = $soc->cond_reglement_id;
}
else $newobject->mode_reglement_id = $invoice['payment_mode_id'];
// Trick because nusoap does not store data with same structure if there is one or several lines
$arrayoflines=array();