32 require_once DOL_DOCUMENT_ROOT.
'/core/class/commonobject.class.php';
43 public $element =
'don';
48 public $table_element =
'don';
53 public $fk_element =
'fk_donation';
59 public $ismultientitymanaged = 1;
64 public $picto =
'donation';
115 public $fk_typepayment;
123 public $modepaymentid = 0;
133 public $labelStatusShort;
136 const STATUS_DRAFT = 0;
137 const STATUS_VALIDATED = 1;
138 const STATUS_PAID = 2;
139 const STATUS_CANCELED = -1;
161 return $this->
LibStatut($this->statut, $mode);
175 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
177 $langs->load(
"donations");
178 $this->labelStatus[-1] = $langs->transnoentitiesnoconv(
"Canceled");
179 $this->labelStatus[0] = $langs->transnoentitiesnoconv(
"DonationStatusPromiseNotValidated");
180 $this->labelStatus[1] = $langs->transnoentitiesnoconv(
"DonationStatusPromiseValidated");
181 $this->labelStatus[2] = $langs->transnoentitiesnoconv(
"DonationStatusPaid");
182 $this->labelStatusShort[-1] = $langs->transnoentitiesnoconv(
"Canceled");
183 $this->labelStatusShort[0] = $langs->transnoentitiesnoconv(
"DonationStatusPromiseNotValidatedShort");
184 $this->labelStatusShort[1] = $langs->transnoentitiesnoconv(
"DonationStatusPromiseValidatedShort");
185 $this->labelStatusShort[2] = $langs->transnoentitiesnoconv(
"DonationStatusPaidShort");
188 $statusType =
'status'.$status;
189 if ($status == self::STATUS_CANCELED) {
190 $statusType =
'status9';
192 if ($status == self::STATUS_PAID) {
193 $statusType =
'status6';
196 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
216 $sql =
"SELECT rowid";
217 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe";
218 $sql .=
" WHERE client IN (1, 3)";
219 $sql .=
" AND entity = ".$conf->entity;
224 $num_socs = $this->
db->num_rows(
$resql);
226 while ($i < $num_socs) {
227 $row = $this->
db->fetch_row(
$resql);
228 $socids[$i] = $row[0];
236 $this->
ref =
'SPECIMEN';
238 $this->lastname =
'Doe';
239 $this->firstname =
'John';
240 $this->socid = empty($socids[0]) ? 0 : $socids[0];
242 $this->date_valid = $now;
243 $this->amount = 100.90;
245 $this->societe =
'The Company';
246 $this->address =
'Twist road';
247 $this->zip =
'99999';
248 $this->town =
'Town';
249 $this->note_private =
'Private note';
250 $this->note_public =
'Public note';
251 $this->email =
'email@email.com';
252 $this->phone =
'0123456789';
253 $this->phone_mobile =
'0606060606';
268 $langs->load(
'main');
269 $langs->load(
'companies');
271 $error_string = array();
276 $error_string[] = $langs->trans(
'ErrorFieldRequired', $langs->transnoentitiesnoconv(
'Company').
'/'.$langs->transnoentitiesnoconv(
'Firstname').
'-'.$langs->transnoentitiesnoconv(
'Lastname'));
282 $error_string[] = $langs->trans(
'ErrorFieldRequired', $langs->transnoentitiesnoconv(
'Address'));
287 $error_string[] = $langs->trans(
'ErrorFieldRequired', $langs->transnoentitiesnoconv(
'Zip'));
292 $error_string[] = $langs->trans(
'ErrorFieldRequired', $langs->transnoentitiesnoconv(
'Town'));
297 $error_string[] = $langs->trans(
'ErrorFieldRequired', $langs->transnoentitiesnoconv(
'EMail'));
301 $this->amount = trim($this->amount);
305 for ($i = 0; $i < $len; $i++) {
306 if (!isset($map[substr($this->amount, $i, 1)])) {
307 $error_string[] = $langs->trans(
'ErrorFieldRequired', $langs->transnoentitiesnoconv(
'Amount'));
314 if (!$amount_invalid) {
315 if ($this->amount == 0) {
316 $error_string[] = $langs->trans(
'ErrorFieldRequired', $langs->transnoentitiesnoconv(
'Amount'));
319 if ($this->amount < $minimum && $minimum > 0) {
320 $error_string[] = $langs->trans(
'MinimumAmount', $langs->transnoentitiesnoconv(
'$minimum'));
327 $this->errors = $error_string;
342 public function create($user, $notrigger = 0)
344 global $conf, $langs;
351 $this->address = ($this->address > 0 ? $this->address : $this->address);
352 $this->zip = ($this->zip > 0 ? $this->zip : $this->zip);
353 $this->town = ($this->town > 0 ? $this->town : $this->town);
354 $this->country_id = ($this->country_id > 0 ? $this->country_id : $this->country_id);
355 $this->country = ($this->country ? $this->country : $this->country);
356 $this->amount =
price2num($this->amount);
359 if ($this->amount < 0) {
360 $this->error = $langs->trans(
'FieldCannotBeNegative', $langs->transnoentitiesnoconv(
"Amount"));
366 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.
"don (";
370 $sql .=
", fk_payment";
372 $sql .=
", firstname";
373 $sql .=
", lastname";
378 $sql .=
", fk_country";
380 $sql .=
", fk_projet";
381 $sql .=
", note_private";
382 $sql .=
", note_public";
383 $sql .=
", fk_user_author";
384 $sql .=
", fk_user_valid";
388 $sql .=
", phone_mobile";
389 $sql .=
") VALUES (";
390 $sql .=
"'".$this->db->idate($this->date ? $this->date : $now).
"'";
391 $sql .=
", ".((int) $conf->entity);
392 $sql .=
", ".((float) $this->amount);
393 $sql .=
", ".($this->modepaymentid ? $this->modepaymentid :
"null");
394 $sql .=
", ".($this->socid > 0 ? $this->socid :
"null");
395 $sql .=
", '".$this->db->escape($this->firstname).
"'";
396 $sql .=
", '".$this->db->escape($this->lastname).
"'";
397 $sql .=
", '".$this->db->escape($this->societe).
"'";
398 $sql .=
", '".$this->db->escape($this->address).
"'";
399 $sql .=
", '".$this->db->escape($this->zip).
"'";
400 $sql .=
", '".$this->db->escape($this->town).
"'";
401 $sql .=
", ".(int) ($this->country_id > 0 ? $this->country_id : 0);
402 $sql .=
", ".(int) $this->
public;
403 $sql .=
", ".($this->fk_project > 0 ? (int) $this->fk_project :
"null");
404 $sql .=
", ".(!empty($this->note_private) ? (
"'".$this->db->escape($this->note_private).
"'") :
"NULL");
405 $sql .=
", ".(!empty($this->note_public) ? (
"'".$this->db->escape($this->note_public).
"'") :
"NULL");
406 $sql .=
", ".((int) $user->id);
408 $sql .=
", '".$this->db->idate($this->date).
"'";
409 $sql .=
", '".(!empty($this->email) ? $this->
db->escape(trim($this->email)) :
"").
"'";
410 $sql .=
", '".(!empty($this->phone) ? $this->
db->escape(trim($this->phone)) :
"").
"'";
411 $sql .=
", '".(!empty($this->phone_mobile) ? $this->
db->escape(trim($this->phone_mobile)) :
"").
"'";
416 $this->
id = $this->
db->last_insert_id(MAIN_DB_PREFIX.
"don");
428 $this->error = $this->
db->lasterror();
429 $this->errno = $this->
db->lasterrno();
441 if (!$error && !empty($conf->global->MAIN_DISABLEDRAFTSTATUS)) {
450 $this->
db->rollback();
462 public function update($user, $notrigger = 0)
464 global $langs, $conf;
469 $this->address = ($this->address > 0 ? $this->address : $this->address);
470 $this->zip = ($this->zip > 0 ? $this->zip : $this->zip);
471 $this->town = ($this->town > 0 ? $this->town : $this->town);
472 $this->country_id = ($this->country_id > 0 ? $this->country_id : $this->country_id);
473 $this->country = ($this->country ? $this->country : $this->country);
474 $this->amount =
price2num($this->amount);
477 if ($this->amount < 0) {
478 $this->error = $langs->trans(
'FieldCannotBeNegative', $langs->transnoentitiesnoconv(
"Amount"));
484 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"don SET";
485 $sql .=
" amount = ".((float) $this->amount);
486 $sql .=
", fk_payment = ".($this->modepaymentid ? $this->modepaymentid :
"null");
487 $sql .=
", firstname = '".$this->db->escape($this->firstname).
"'";
488 $sql .=
", lastname='".$this->db->escape($this->lastname).
"'";
489 $sql .=
", societe='".$this->db->escape($this->societe).
"'";
490 $sql .=
", address='".$this->db->escape($this->address).
"'";
491 $sql .=
", zip='".$this->db->escape($this->zip).
"'";
492 $sql .=
", town='".$this->db->escape($this->town).
"'";
493 $sql .=
", fk_country = ".($this->country_id > 0 ? ((int) $this->country_id) :
'0');
494 $sql .=
", public=".((int) $this->
public);
495 $sql .=
", fk_projet=".($this->fk_project > 0 ? $this->fk_project :
'null');
496 $sql .=
", note_private=".(!empty($this->note_private) ? (
"'".$this->db->escape($this->note_private).
"'") :
"NULL");
497 $sql .=
", note_public=".(!empty($this->note_public) ? (
"'".$this->db->escape($this->note_public).
"'") :
"NULL");
498 $sql .=
", datedon='".$this->db->idate($this->date).
"'";
499 $sql .=
", date_valid=".($this->date_valid ?
"'".$this->db->idate($this->date).
"'" :
"null");
500 $sql .=
", email='".$this->db->escape(trim($this->email)).
"'";
501 $sql .=
", phone='".$this->db->escape(trim($this->phone)).
"'";
502 $sql .=
", phone_mobile='".$this->db->escape(trim($this->phone_mobile)).
"'";
503 $sql .=
", fk_statut=".((int) $this->statut);
504 $sql .=
" WHERE rowid = ".((int) $this->
id);
506 dol_syslog(get_class($this).
"::Update", LOG_DEBUG);
530 $this->
db->rollback();
534 $this->error = $this->
db->lasterror();
535 $this->errors[] = $this->error;
536 $this->
db->rollback();
537 dol_syslog(get_class($this).
"::Update error -2 ".$this->error, LOG_ERR);
550 public function delete($user, $notrigger = 0)
552 global $user, $conf, $langs;
553 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
559 if (!$error && !$notrigger) {
571 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.
"don_extrafields";
572 $sql .=
" WHERE fk_object = ".((int) $this->
id);
576 $this->errors[] = $this->
db->lasterror();
582 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.
"don";
583 $sql .=
" WHERE rowid=".((int) $this->
id);
587 $this->errors[] = $this->
db->lasterror();
596 foreach ($this->errors as $errmsg) {
597 dol_syslog(get_class($this).
"::delete ".$errmsg, LOG_ERR);
598 $this->error .= ($this->error ?
', '.$errmsg : $errmsg);
600 dol_syslog(get_class($this).
"::delete ".$this->error, LOG_ERR);
601 $this->
db->rollback();
613 public function fetch($id, $ref =
'')
617 $sql =
"SELECT d.rowid, d.datec, d.date_valid, d.tms as datem, d.datedon,";
618 $sql .=
" d.fk_soc as socid,d.firstname, d.lastname, d.societe, d.amount, d.fk_statut, d.address, d.zip, d.town, ";
619 $sql .=
" d.fk_country, d.country as country_olddata, d.public, d.amount, d.fk_payment, d.paid, d.note_private, d.note_public, d.email, d.phone, ";
620 $sql .=
" d.phone_mobile, d.fk_projet as fk_project, d.model_pdf,";
621 $sql .=
" p.ref as project_ref,";
622 $sql .=
" cp.libelle as payment_label, cp.code as payment_code,";
623 $sql .=
" c.code as country_code, c.label as country";
624 $sql .=
" FROM ".MAIN_DB_PREFIX.
"don as d";
625 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"projet as p ON p.rowid = d.fk_projet";
626 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as cp ON cp.id = d.fk_payment";
627 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as c ON d.fk_country = c.rowid";
628 $sql .=
" WHERE d.entity IN (".getEntity(
'donation').
")";
630 $sql .=
" AND d.rowid=".((int) $id);
631 } elseif (!empty($ref)) {
632 $sql .=
" AND d.ref='".$this->db->escape($ref).
"'";
635 dol_syslog(get_class($this).
"::fetch", LOG_DEBUG);
639 $obj = $this->
db->fetch_object(
$resql);
641 $this->
id = $obj->rowid;
642 $this->
ref = $obj->rowid;
643 $this->date_creation = $this->
db->jdate($obj->datec);
644 $this->datec = $this->
db->jdate($obj->datec);
645 $this->date_validation = $this->
db->jdate($obj->date_valid);
646 $this->date_valid = $this->
db->jdate($obj->date_valid);
647 $this->date_modification = $this->
db->jdate($obj->datem);
648 $this->datem = $this->
db->jdate($obj->datem);
649 $this->date = $this->
db->jdate($obj->datedon);
650 $this->socid = $obj->socid;
651 $this->firstname = $obj->firstname;
652 $this->lastname = $obj->lastname;
653 $this->societe = $obj->societe;
654 $this->statut = $obj->fk_statut;
655 $this->address = $obj->address;
656 $this->zip = $obj->zip;
657 $this->town = $obj->town;
658 $this->country_id = $obj->fk_country;
659 $this->country_code = $obj->country_code;
660 $this->country = $obj->country;
661 $this->country_olddata = $obj->country_olddata;
662 $this->email = $obj->email;
663 $this->phone = $obj->phone;
664 $this->phone_mobile = $obj->phone_mobile;
665 $this->project = $obj->project_ref;
666 $this->fk_projet = $obj->fk_project;
667 $this->fk_project = $obj->fk_project;
668 $this->
public = $obj->public;
669 $this->mode_reglement_id = $obj->fk_payment;
670 $this->mode_reglement_code = $obj->payment_code;
671 $this->mode_reglement = $obj->payment_label;
672 $this->paid = $obj->paid;
673 $this->amount = $obj->amount;
674 $this->note_private = $obj->note_private;
675 $this->note_public = $obj->note_public;
676 $this->model_pdf = $obj->model_pdf;
677 $this->modelpdf = $obj->model_pdf;
714 global $langs, $user;
720 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"don SET fk_statut = 1, fk_user_valid = ".((int) $userid).
" WHERE rowid = ".((int) $id).
" AND fk_statut = 0";
724 if ($this->
db->affected_rows(
$resql)) {
736 $this->error = $this->
db->lasterror();
744 $this->
db->rollback();
762 dol_syslog(get_class($this).
"::set_paid is deprecated, use setPaid instead", LOG_NOTICE);
763 return $this->
setPaid($id, $modepayment);
773 public function setPaid($id, $modepayment = 0)
775 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"don SET fk_statut = 2";
777 $sql .=
", fk_payment = ".((int) $modepayment);
779 $sql .=
" WHERE rowid = ".((int) $id).
" AND fk_statut = 1";
783 if ($this->
db->affected_rows(
$resql)) {
805 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"don SET fk_statut = -1 WHERE rowid = ".((int) $id);
809 if ($this->
db->affected_rows(
$resql)) {
828 public function reopen($user, $notrigger = 0)
831 if ($this->statut != self::STATUS_CANCELED) {
842 return $this->
setStatusCommon($user, self::STATUS_VALIDATED, $notrigger,
'DON_REOPEN');
859 $sql =
"SELECT sum(amount) as total";
860 $sql .=
" FROM ".MAIN_DB_PREFIX.
"don";
861 $sql .=
" WHERE fk_statut = ".((int) $param);
862 $sql .=
" AND entity = ".$conf->entity;
866 $obj = $this->
db->fetch_object(
$resql);
867 $result = $obj->total;
886 $sql =
"SELECT count(d.rowid) as nb";
887 $sql .=
" FROM ".MAIN_DB_PREFIX.
"don as d";
888 $sql .=
" WHERE d.fk_statut > 0";
889 $sql .=
" AND d.entity IN (".getEntity(
'donation').
")";
893 while ($obj = $this->
db->fetch_object(
$resql)) {
894 $this->nb[
"donations"] = $obj->nb;
900 $this->error = $this->
db->error();
914 public function getNomUrl($withpicto = 0, $notooltip = 0, $moretitle =
'', $save_lastsearch_value = -1)
916 global $conf, $langs, $hookmanager;
918 if (!empty($conf->dol_no_mouse_hover)) {
923 $label =
img_picto(
'', $this->picto).
' <u class="paddingrightonly">'.$langs->trans(
"Donation").
'</u>';
924 if (isset($this->status)) {
925 $label .=
' '.$this->getLibStatut(5);
927 if (!empty($this->
id)) {
928 $label .=
'<br><b>'.$langs->trans(
'Ref').
':</b> '.$this->id;
929 $label .=
'<br><b>'.$langs->trans(
'Date').
':</b> '.
dol_print_date($this->date,
'day');
932 $label .=
' - '.$moretitle;
935 $url = DOL_URL_ROOT.
'/don/card.php?id='.$this->id;
937 $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
938 if ($save_lastsearch_value == -1 && preg_match(
'/list\.php/', $_SERVER[
"PHP_SELF"])) {
939 $add_save_lastsearch_values = 1;
941 if ($add_save_lastsearch_values) {
942 $url .=
'&save_lastsearch_values=1';
945 $linkstart =
'<a href="'.$url.
'" title="'.
dol_escape_htmltag($label, 1).
'" class="classfortooltip">';
948 $result .= $linkstart;
950 $result .=
img_object(($notooltip ?
'' : $label), $this->picto, ($notooltip ? (($withpicto != 2) ?
'class="paddingright"' :
'') :
'class="'.(($withpicto != 2) ?
'paddingright ' :
'').
'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
952 if ($withpicto != 2) {
953 $result .= $this->ref;
957 $hookmanager->initHooks(array($this->element .
'dao'));
958 $parameters = array(
'id'=>$this->
id,
'getnomurl' => &$result);
959 $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action);
961 $result = $hookmanager->resPrint;
963 $result .= $hookmanager->resPrint;
976 $sql =
'SELECT d.rowid, d.datec, d.fk_user_author, d.fk_user_valid,';
977 $sql .=
' d.tms as datem';
978 $sql .=
' FROM '.MAIN_DB_PREFIX.
'don as d';
979 $sql .=
' WHERE d.rowid = '.((int) $id);
981 dol_syslog(get_class($this).
'::info', LOG_DEBUG);
982 $result = $this->
db->query($sql);
985 if ($this->
db->num_rows($result)) {
986 $obj = $this->
db->fetch_object($result);
987 $this->
id = $obj->rowid;
989 $this->user_creation_id = $obj->fk_user_author;
990 $this->user_validation_id = $obj->fk_user_valid;
991 $this->date_creation = $this->
db->jdate($obj->datec);
992 $this->date_modification = (!empty($obj->tms) ? $this->
db->jdate($obj->tms) :
"");
994 $this->
db->free($result);
1011 public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
1013 global $conf, $langs;
1015 $langs->load(
"bills");
1018 $modele =
'html_cerfafr';
1020 if ($this->model_pdf) {
1021 $modele = $this->model_pdf;
1022 } elseif (!empty($conf->global->DON_ADDON_MODEL)) {
1023 $modele = $conf->global->DON_ADDON_MODEL;
1027 $modelpath =
"core/modules/dons/";
1033 $err = error_reporting();
1035 @set_time_limit(120);
1036 error_reporting($err);
1038 $srctemplatepath =
'';
1041 $tmp = explode(
':', $modele, 2);
1042 if (!empty($tmp[1])) {
1044 $srctemplatepath = $tmp[1];
1048 $file =
''; $classname =
''; $filefound = 0;
1049 $dirmodels = array(
'/');
1050 if (is_array($conf->modules_parts[
'models'])) {
1051 $dirmodels = array_merge($dirmodels, $conf->modules_parts[
'models']);
1053 foreach ($dirmodels as $reldir) {
1054 foreach (array(
'html',
'doc',
'pdf') as $prefix) {
1055 $file = $prefix.
"_".preg_replace(
'/^html_/',
'', $modele).
".modules.php";
1058 $file =
dol_buildpath($reldir.
"core/modules/dons/".$file, 0);
1059 if (file_exists($file)) {
1061 $classname = $prefix.
'_'.$modele;
1076 $classname = $modele;
1077 $obj =
new $classname($this->
db);
1081 $sav_charset_output = $outputlangs->charset_output;
1082 if ($obj->write_file($object, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref) > 0) {
1083 $outputlangs->charset_output = $sav_charset_output;
1086 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
1090 $outputlangs->charset_output = $sav_charset_output;
1096 print $langs->trans(
"Error").
" ".$langs->trans(
"ErrorFileDoesNotExists", $file);
1127 if (empty($this->
id)) {
1128 $this->error =
'Missing object id';
1129 $this->errors[] = $this->error;
1130 dol_syslog(__METHOD__.
' : '.$this->error, LOG_ERR);
1134 $sql =
"SELECT SUM(amount) as sum_amount FROM ".MAIN_DB_PREFIX.
"payment_donation WHERE fk_donation = ".((int) $this->
id);
1140 $sum_amount = (
float) $this->
db->fetch_object(
$resql)->sum_amount;
1141 return (
float) $this->amount - $sum_amount;
Parent class of all other business classes (invoices, contracts, proposals, orders,...
fetch_optionals($rowid=null, $optionsArray=null)
Function to get extra fields of an object into $this->array_options This method is in most cases call...
setStatusCommon($user, $status, $notrigger=0, $triggercode='')
Set to a status.
static commonReplaceThirdparty(DoliDB $dbs, $origin_id, $dest_id, array $tables, $ignoreerrors=0)
Function used to replace a thirdparty id with another one.
insertExtraFields($trigger='', $userused=null)
Add/Update all extra fields values for the current object.
call_trigger($triggerName, $user)
Call trigger based on this instance.
Class to manage Dolibarr database access.
Class to manage donations.
getLibStatut($mode=0)
Returns the donation status label (draft, valid, abandoned, paid)
__construct($db)
Constructor.
initAsSpecimen()
Initialise an instance with random values.
create($user, $notrigger=0)
Create donation record into database.
getRemainToPay()
Function to get reamain to pay for a donation.
check($minimum=0)
Check params and init ->errors array.
setValid($user, $notrigger=0)
Validate a intervention.
valid_promesse($id, $userid, $notrigger=0)
Validate a promise of donation.
LibStatut($status, $mode=0)
Return the label of a given status.
static replaceThirdparty(DoliDB $dbs, $origin_id, $dest_id)
Function used to replace a thirdparty id with another one.
set_paid($id, $modepayment=0)
Classify the donation as paid, the donation was received.
generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
Create a document onto disk according to template module.
fetch($id, $ref='')
Load donation from database.
reopen($user, $notrigger=0)
Set cancel status.
sum_donations($param)
Sum of donations.
info($id)
Information on record.
update($user, $notrigger=0)
Update a donation record.
load_state_board()
Charge indicateurs this->nb pour le tableau de bord.
set_cancel($id)
Set donation to status cancelled.
setPaid($id, $modepayment=0)
Classify the donation as paid, the donation was received.
getNomUrl($withpicto=0, $notooltip=0, $moretitle='', $save_lastsearch_value=-1)
Return clicable name (with picto eventually)
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
dol_delete_preview($object)
Delete all preview files linked to object instance.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_now($mode='auto')
Return date for now.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dolGetStatus($statusLabel='', $statusLabelShort='', $html='', $statusType='status0', $displayMode=0, $url='', $params=array())
Output the badge of a status.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
div float
Buy price without taxes.
$conf db
API class for accounts.