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) {
|
if (!DolibarrApiAccess::$user->rights->societe->lire) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
|
if ($rowid == 0) {
|
||||||
$result = $this->company->fetch($rowid, $ref, $ref_ext, $barcode, $idprof1, $idprof2, $idprof3, $idprof4, $idprof5, $idprof6, $email, $ref_alias);
|
$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) {
|
if (!$result) {
|
||||||
throw new RestException(404, 'Thirdparty not found');
|
throw new RestException(404, 'Thirdparty not found');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3774,6 +3774,7 @@ class Societe extends CommonObject
|
|||||||
|
|
||||||
// Initialize parameters
|
// Initialize parameters
|
||||||
$this->id = 0;
|
$this->id = 0;
|
||||||
|
$this->entity = 1;
|
||||||
$this->name = 'THIRDPARTY SPECIMEN '.dol_print_date($now, 'dayhourlog');
|
$this->name = 'THIRDPARTY SPECIMEN '.dol_print_date($now, 'dayhourlog');
|
||||||
$this->nom = $this->name; // For backward compatibility
|
$this->nom = $this->name; // For backward compatibility
|
||||||
$this->ref_ext = 'Ref ext';
|
$this->ref_ext = 'Ref ext';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user