get thirdparty specimen with api
This commit is contained in:
parent
c41459abe4
commit
30b67aaa4f
@ -1850,8 +1850,11 @@ class Thirdparties extends DolibarrApi
|
||||
if (!DolibarrApiAccess::$user->rights->societe->lire) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
$result = $this->company->fetch($rowid, $ref, $ref_ext, $barcode, $idprof1, $idprof2, $idprof3, $idprof4, $idprof5, $idprof6, $email, $ref_alias);
|
||||
if ($rowid == 0) {
|
||||
$result = $this->company->initAsSpecimen();
|
||||
} else {
|
||||
$result = $this->company->fetch($rowid, $ref, $ref_ext, $barcode, $idprof1, $idprof2, $idprof3, $idprof4, $idprof5, $idprof6, $email, $ref_alias);
|
||||
}
|
||||
if (!$result) {
|
||||
throw new RestException(404, 'Thirdparty not found');
|
||||
}
|
||||
|
||||
@ -3774,6 +3774,7 @@ class Societe extends CommonObject
|
||||
|
||||
// Initialize parameters
|
||||
$this->id = 0;
|
||||
$this->entity = 1;
|
||||
$this->name = 'THIRDPARTY SPECIMEN '.dol_print_date($now, 'dayhourlog');
|
||||
$this->nom = $this->name; // For backward compatibility
|
||||
$this->ref_ext = 'Ref ext';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user