Fix set of due date when invoice created from API
This commit is contained in:
parent
bca10084c5
commit
eaaea2c2f9
@ -227,7 +227,7 @@ class Invoices extends DolibarrApi
|
||||
$this->invoice->lines = $lines;
|
||||
}*/
|
||||
|
||||
if ($this->invoice->create(DolibarrApiAccess::$user, 0, $request_data["date_lim_reglement"]) < 0) {
|
||||
if ($this->invoice->create(DolibarrApiAccess::$user, 0, (empty($request_data["date_lim_reglement"]) ? 0 : $request_data["date_lim_reglement"])) < 0) {
|
||||
throw new RestException(500, "Error creating invoice", array_merge(array($this->invoice->error), $this->invoice->errors));
|
||||
}
|
||||
return $this->invoice->id;
|
||||
|
||||
@ -286,7 +286,7 @@ class Facture extends CommonInvoice
|
||||
*
|
||||
* @param User $user Object user that create
|
||||
* @param int $notrigger 1=Does not execute triggers, 0 otherwise
|
||||
* @param int $forceduedate 1=Do not recalculate due date from payment condition but force it with value
|
||||
* @param int $forceduedate If set, do not recalculate due date from payment condition but force it with value
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function create(User $user, $notrigger = 0, $forceduedate = 0)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user