Update api_thirdparties.class.php

This commit is contained in:
Frédéric FRANCE 2020-04-13 09:39:31 +02:00 committed by GitHub
parent 1114f0ee3d
commit 5933d2282c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1188,6 +1188,13 @@ class Thirdparties extends DolibarrApi
$account->$field = $value;
}
if (empty($account->rum)) {
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
$prelevement = new BonPrelevement($this->db);
$account->rum = $prelevement->buildRumNumber($this->company->code_client, $account->datec, $account->id);
$account->date_rum = dol_now();
}
if ($account->update(DolibarrApiAccess::$user) < 0)
throw new RestException(500, 'Error updating values');