PaymentTerm
class PaymentTerm (View source)
Class to manage payment terms records in dictionary
Properties
| DoliDB | $db | ||
| string | $error | ||
| string[] | $errors | ||
| array<string, string> | $context | ||
| int | $id | ||
| ?int | $entity | ||
| string | $code | ||
| string | $sortorder | ||
| string | $active | ||
| string | $libelle | ||
| string | $libelle_facture | ||
| string | $type_cdr | ||
| string | $nbjour | ||
| string | $decalage |
Methods
Create in database
Load object in memory from database
Return id of default payment term
Update database
Load an object from its id and create a new one in database
Initialise an instance with random values.
Details
__construct(DoliDB $db)
Constructor
@param DoliDB $db Database handler
create($user, int $notrigger = 0)
Create in database
@param User $user User that create
fetch($id, string $code = '')
Load object in memory from database
@param int $id Id object
getDefaultId()
Return id of default payment term
@return int Return integer <0 if KO, >0 if OK
update($user = null, int $notrigger = 0)
Update database
@param User $user User that modify
int
delete(User $user, $notrigger = 0)
Delete object in database
createFromClone(User $user, int $fromid)
Load an object from its id and create a new one in database
@param User $user User making the clone
int
initAsSpecimen()
Initialise an instance with random values.
Used to build previews or test instances. id must be 0 if object instance is a specimen.