33 require_once DOL_DOCUMENT_ROOT.
'/core/class/commonobject.class.php';
34 require_once DOL_DOCUMENT_ROOT.
'/core/class/commonpeople.class.php';
47 public $element =
'don';
52 public $table_element =
'don';
57 public $fk_element =
'fk_donation';
62 public $picto =
'donation';
109 public $phone_mobile;
115 public $mode_reglement;
120 public $mode_reglement_code;
135 public $fk_typepayment;
147 public $modepaymentid = 0;
151 const STATUS_DRAFT = 0;
152 const STATUS_VALIDATED = 1;
153 const STATUS_PAID = 2;
154 const STATUS_CANCELED = -1;
166 $this->ismultientitymanaged = 1;
178 return $this->
LibStatut($this->statut, $mode);
192 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
194 $langs->load(
"donations");
195 $this->labelStatus[-1] = $langs->transnoentitiesnoconv(
"Canceled");
196 $this->labelStatus[0] = $langs->transnoentitiesnoconv(
"DonationStatusPromiseNotValidated");
197 $this->labelStatus[1] = $langs->transnoentitiesnoconv(
"DonationStatusPromiseValidated");
198 $this->labelStatus[2] = $langs->transnoentitiesnoconv(
"DonationStatusPaid");
199 $this->labelStatusShort[-1] = $langs->transnoentitiesnoconv(
"Canceled");
200 $this->labelStatusShort[0] = $langs->transnoentitiesnoconv(
"DonationStatusPromiseNotValidatedShort");
201 $this->labelStatusShort[1] = $langs->transnoentitiesnoconv(
"DonationStatusPromiseValidatedShort");
202 $this->labelStatusShort[2] = $langs->transnoentitiesnoconv(
"DonationStatusPaidShort");
205 $statusType =
'status'.$status;
206 if ($status == self::STATUS_CANCELED) {
207 $statusType =
'status9';
209 if ($status == self::STATUS_PAID) {
210 $statusType =
'status6';
213 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
233 $sql =
"SELECT rowid";
234 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe";
235 $sql .=
" WHERE client IN (1, 3)";
236 $sql .=
" AND entity = ".$conf->entity;
239 $resql = $this->db->query(
$sql);
241 $num_socs = $this->db->num_rows($resql);
243 while ($i < $num_socs) {
244 $row = $this->db->fetch_row($resql);
245 $socids[$i] = $row[0];
253 $this->
ref =
'SPECIMEN';
255 $this->lastname =
'Doe';
256 $this->firstname =
'John';
257 $this->socid = empty($socids[0]) ? 0 : $socids[0];
259 $this->date_valid = $now;
262 $this->societe =
'The Company';
263 $this->address =
'Twist road';
264 $this->zip =
'99999';
265 $this->town =
'Town';
266 $this->note_private =
'Private note';
267 $this->note_public =
'Public note';
268 $this->email =
'email@email.com';
269 $this->phone =
'0123456789';
270 $this->phone_mobile =
'0606060606';
287 $langs->load(
'main');
288 $langs->load(
'companies');
290 $error_string = array();
296 $error_string[] = $langs->trans(
'ErrorFieldRequired', $langs->transnoentitiesnoconv(
'Company').
'/'.$langs->transnoentitiesnoconv(
'Firstname').
'-'.$langs->transnoentitiesnoconv(
'Lastname'));
302 $error_string[] = $langs->trans(
'ErrorFieldRequired', $langs->transnoentitiesnoconv(
'Address'));
307 $error_string[] = $langs->trans(
'ErrorFieldRequired', $langs->transnoentitiesnoconv(
'Zip'));
312 $error_string[] = $langs->trans(
'ErrorFieldRequired', $langs->transnoentitiesnoconv(
'Town'));
317 $error_string[] = $langs->trans(
'ErrorFieldRequired', $langs->transnoentitiesnoconv(
'EMail'));
325 for ($i = 0; $i < $len; $i++) {
326 if (!isset($map[substr((
string) $this->amount, $i, 1)])) {
327 $error_string[] = $langs->trans(
'ErrorFieldRequired', $langs->transnoentitiesnoconv(
'Amount'));
334 if (!$amount_invalid) {
335 if ($this->amount == 0) {
336 $error_string[] = $langs->trans(
'ErrorFieldRequired', $langs->transnoentitiesnoconv(
'Amount'));
339 if ($this->amount < $minimum && $minimum > 0) {
340 $error_string[] = $langs->trans(
'MinimumAmount', $minimum);
347 $this->errors = $error_string;
362 public function create($user, $notrigger = 0)
364 global $conf, $langs;
380 $this->error = $langs->trans(
'FieldCannotBeNegative', $langs->transnoentitiesnoconv(
"Amount"));
386 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.
"don (";
390 $sql .=
", fk_payment";
392 $sql .=
", firstname";
393 $sql .=
", lastname";
398 $sql .=
", fk_country";
400 $sql .=
", fk_projet";
401 $sql .=
", note_private";
402 $sql .=
", note_public";
403 $sql .=
", fk_user_author";
404 $sql .=
", fk_user_valid";
408 $sql .=
", phone_mobile";
409 $sql .=
") VALUES (";
410 $sql .=
"'".$this->db->idate($this->date ? $this->date : $now).
"'";
411 $sql .=
", ".((int) $conf->entity);
413 $sql .=
", ".($this->modepaymentid ? $this->modepaymentid :
"null");
414 $sql .=
", ".($this->socid > 0 ? $this->socid :
"null");
415 $sql .=
", '".$this->db->escape($this->firstname).
"'";
416 $sql .=
", '".$this->db->escape($this->lastname).
"'";
417 $sql .=
", '".$this->db->escape($this->societe).
"'";
418 $sql .=
", '".$this->db->escape($this->address).
"'";
419 $sql .=
", '".$this->db->escape($this->zip).
"'";
420 $sql .=
", '".$this->db->escape($this->town).
"'";
421 $sql .=
", ".(int) ($this->country_id > 0 ? $this->country_id : 0);
422 $sql .=
", ".(int) $this->
public;
423 $sql .=
", ".($this->fk_project > 0 ? (int) $this->fk_project :
"null");
424 $sql .=
", ".(!empty($this->note_private) ? (
"'".$this->db->escape($this->note_private).
"'") :
"NULL");
425 $sql .=
", ".(!empty($this->note_public) ? (
"'".$this->db->escape($this->note_public).
"'") :
"NULL");
426 $sql .=
", ".((int) $user->id);
428 $sql .=
", '".$this->db->idate($this->date).
"'";
429 $sql .=
", '".(!empty($this->email) ? $this->db->escape(trim($this->email)) :
"").
"'";
430 $sql .=
", '".(!empty($this->phone) ? $this->db->escape(trim($this->phone)) :
"").
"'";
431 $sql .=
", '".(!empty($this->phone_mobile) ? $this->db->escape(trim($this->phone_mobile)) :
"").
"'";
434 $resql = $this->db->query(
$sql);
436 $this->
id = $this->db->last_insert_id(MAIN_DB_PREFIX.
"don");
448 $this->error = $this->db->lasterror();
469 $this->db->rollback();
481 public function update($user, $notrigger = 0)
497 $this->error = $langs->trans(
'FieldCannotBeNegative', $langs->transnoentitiesnoconv(
"Amount"));
503 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"don SET";
505 $sql .=
", fk_payment = ".($this->modepaymentid ? $this->modepaymentid :
"null");
506 $sql .=
", firstname = '".$this->db->escape($this->firstname).
"'";
507 $sql .=
", lastname='".$this->db->escape($this->lastname).
"'";
508 $sql .=
", societe='".$this->db->escape($this->societe).
"'";
509 $sql .=
", address='".$this->db->escape($this->address).
"'";
510 $sql .=
", zip='".$this->db->escape($this->zip).
"'";
511 $sql .=
", town='".$this->db->escape($this->town).
"'";
512 $sql .=
", fk_country = ".($this->country_id > 0 ? ((int) $this->country_id) :
'0');
513 $sql .=
", public=".((int) $this->
public);
514 $sql .=
", fk_projet=".($this->fk_project > 0 ? $this->fk_project :
'null');
515 $sql .=
", note_private=".(!empty($this->note_private) ? (
"'".$this->db->escape($this->note_private).
"'") :
"NULL");
516 $sql .=
", note_public=".(!empty($this->note_public) ? (
"'".$this->db->escape($this->note_public).
"'") :
"NULL");
517 $sql .=
", datedon='".$this->db->idate($this->date).
"'";
518 $sql .=
", date_valid=".($this->date_valid ?
"'".$this->db->idate($this->date).
"'" :
"null");
519 $sql .=
", email='".$this->db->escape(trim($this->email)).
"'";
520 $sql .=
", phone='".$this->db->escape(trim($this->phone)).
"'";
521 $sql .=
", phone_mobile='".$this->db->escape(trim($this->phone_mobile)).
"'";
522 $sql .=
", fk_statut=".((int) $this->statut);
523 $sql .=
" WHERE rowid = ".((int) $this->
id);
525 dol_syslog(get_class($this).
"::Update", LOG_DEBUG);
526 $resql = $this->db->query(
$sql);
549 $this->db->rollback();
553 $this->error = $this->db->lasterror();
554 $this->errors[] = $this->error;
555 $this->db->rollback();
556 dol_syslog(get_class($this).
"::Update error -2 ".$this->error, LOG_ERR);
569 public function delete($user, $notrigger = 0)
571 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
577 if (!$error && !$notrigger) {
589 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.
"don_extrafields";
590 $sql .=
" WHERE fk_object = ".((int) $this->
id);
592 $resql = $this->db->query(
$sql);
594 $this->errors[] = $this->db->lasterror();
600 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.
"don";
601 $sql .=
" WHERE rowid=".((int) $this->
id);
603 $resql = $this->db->query(
$sql);
605 $this->errors[] = $this->db->lasterror();
614 foreach ($this->errors as $errmsg) {
615 dol_syslog(get_class($this).
"::delete ".$errmsg, LOG_ERR);
616 $this->error .= ($this->error ?
', '.$errmsg : $errmsg);
618 dol_syslog(get_class($this).
"::delete ".$this->error, LOG_ERR);
619 $this->db->rollback();
631 public function fetch($id, $ref =
'')
633 $sql =
"SELECT d.rowid, d.datec, d.date_valid, d.tms as datem, d.datedon,";
634 $sql .=
" d.fk_soc as socid, d.firstname, d.lastname, d.societe, d.amount, d.fk_statut as status, d.address, d.zip, d.town, ";
635 $sql .=
" d.fk_country, d.public, d.amount, d.fk_payment, d.paid, d.note_private, d.note_public, d.email, d.phone, ";
636 $sql .=
" d.phone_mobile, d.fk_projet as fk_project, d.model_pdf,";
637 $sql .=
" p.ref as project_ref,";
638 $sql .=
" cp.libelle as payment_label, cp.code as payment_code,";
639 $sql .=
" c.code as country_code, c.label as country";
640 $sql .=
" FROM ".MAIN_DB_PREFIX.
"don as d";
641 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"projet as p ON p.rowid = d.fk_projet";
642 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as cp ON cp.id = d.fk_payment";
643 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as c ON d.fk_country = c.rowid";
644 $sql .=
" WHERE d.entity IN (".getEntity(
'donation').
")";
646 $sql .=
" AND d.rowid=".((int) $id);
647 } elseif (!empty($ref)) {
648 $sql .=
" AND d.ref='".$this->db->escape($ref).
"'";
651 dol_syslog(get_class($this).
"::fetch", LOG_DEBUG);
652 $resql = $this->db->query(
$sql);
654 if ($this->db->num_rows($resql)) {
655 $obj = $this->db->fetch_object($resql);
657 $this->
id = $obj->rowid;
658 $this->
ref = $obj->rowid;
659 $this->date_creation = $this->db->jdate($obj->datec);
660 $this->datec = $this->db->jdate($obj->datec);
661 $this->date_validation = $this->db->jdate($obj->date_valid);
662 $this->date_valid = $this->db->jdate($obj->date_valid);
663 $this->date_modification = $this->db->jdate($obj->datem);
664 $this->datem = $this->db->jdate($obj->datem);
665 $this->date = $this->db->jdate($obj->datedon);
666 $this->socid = $obj->socid;
667 $this->firstname = $obj->firstname;
668 $this->lastname = $obj->lastname;
669 $this->societe = $obj->societe;
670 $this->
status = $obj->status;
671 $this->statut = $obj->status;
672 $this->address = $obj->address;
673 $this->zip = $obj->zip;
674 $this->town = $obj->town;
675 $this->country_id = $obj->fk_country;
676 $this->country_code = $obj->country_code;
677 $this->country = $obj->country;
678 $this->email = $obj->email;
679 $this->phone = $obj->phone;
680 $this->phone_mobile = $obj->phone_mobile;
681 $this->project = $obj->project_ref;
682 $this->fk_projet = $obj->fk_project;
683 $this->fk_project = $obj->fk_project;
684 $this->
public = $obj->public;
685 $this->mode_reglement_id = $obj->fk_payment;
686 $this->mode_reglement_code = $obj->payment_code;
687 $this->mode_reglement = $obj->payment_label;
688 $this->paid = $obj->paid;
689 $this->
amount = $obj->amount;
690 $this->note_private = $obj->note_private;
691 $this->note_public = $obj->note_public;
692 $this->model_pdf = $obj->model_pdf;
736 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"don SET fk_statut = 1, fk_user_valid = ".((int) $userid).
" WHERE rowid = ".((int) $id).
" AND fk_statut = 0";
738 $resql = $this->db->query(
$sql);
740 if ($this->db->affected_rows($resql)) {
752 $this->error = $this->db->lasterror();
760 $this->db->rollback();
772 public function setPaid($id, $modepayment = 0)
774 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"don SET fk_statut = 2, paid = 1";
776 $sql .=
", fk_payment = ".((int) $modepayment);
778 $sql .=
" WHERE rowid = ".((int) $id).
" AND fk_statut = 1";
780 $resql = $this->db->query(
$sql);
782 if ($this->db->affected_rows($resql)) {
805 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"don SET fk_statut = -1 WHERE rowid = ".((int) $id);
807 $resql = $this->db->query(
$sql);
809 if ($this->db->affected_rows($resql)) {
828 public function reopen($user, $notrigger = 0)
831 if ($this->statut != self::STATUS_CANCELED) {
835 return $this->
setStatusCommon($user, self::STATUS_VALIDATED, $notrigger,
'DON_REOPEN');
852 $sql =
"SELECT sum(amount) as total";
853 $sql .=
" FROM ".MAIN_DB_PREFIX.
"don";
854 $sql .=
" WHERE fk_statut = ".((int) $param);
855 $sql .=
" AND entity = ".$conf->entity;
857 $resql = $this->db->query(
$sql);
859 $obj = $this->db->fetch_object($resql);
860 $result = $obj->total;
875 $sql =
"SELECT count(d.rowid) as nb";
876 $sql .=
" FROM ".MAIN_DB_PREFIX.
"don as d";
877 $sql .=
" WHERE d.fk_statut > 0";
878 $sql .=
" AND d.entity IN (".getEntity(
'donation').
")";
880 $resql = $this->db->query(
$sql);
882 while ($obj = $this->db->fetch_object($resql)) {
883 $this->nb[
"donations"] = $obj->nb;
885 $this->db->free($resql);
889 $this->error = $this->db->error();
903 public function getNomUrl($withpicto = 0, $notooltip = 0, $moretitle =
'', $save_lastsearch_value = -1)
905 global $conf, $langs, $hookmanager;
907 if (!empty($conf->dol_no_mouse_hover)) {
912 $label =
img_picto(
'', $this->picto).
' <u class="paddingrightonly">'.$langs->trans(
"Donation").
'</u>';
913 if (isset($this->
status)) {
914 $label .=
' '.$this->getLibStatut(5);
916 if (!empty($this->
id)) {
917 $label .=
'<br><b>'.$langs->trans(
'Ref').
':</b> '.$this->id;
918 $label .=
'<br><b>'.$langs->trans(
'Date').
':</b> '.
dol_print_date($this->date,
'day');
921 $label .=
' - '.$moretitle;
924 $url = DOL_URL_ROOT.
'/don/card.php?id='.$this->id;
926 $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
927 if ($save_lastsearch_value == -1 && isset($_SERVER[
"PHP_SELF"]) && preg_match(
'/list\.php/', $_SERVER[
"PHP_SELF"])) {
928 $add_save_lastsearch_values = 1;
930 if ($add_save_lastsearch_values) {
931 $url .=
'&save_lastsearch_values=1';
934 $linkstart =
'<a href="'.$url.
'" title="'.
dol_escape_htmltag($label, 1).
'" class="classfortooltip">';
937 $result .= $linkstart;
939 $result .=
img_object(($notooltip ?
'' : $label), $this->picto, ($notooltip ? (($withpicto != 2) ?
'class="paddingright"' :
'') :
'class="'.(($withpicto != 2) ?
'paddingright ' :
'').
'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
941 if ($withpicto != 2) {
942 $result .= $this->ref;
946 $hookmanager->initHooks(array($this->element .
'dao'));
947 $parameters = array(
'id' => $this->
id,
'getnomurl' => &$result);
948 $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action);
950 $result = $hookmanager->resPrint;
952 $result .= $hookmanager->resPrint;
965 $sql =
'SELECT d.rowid, d.datec, d.fk_user_author, d.fk_user_valid,';
966 $sql .=
' d.tms as datem';
967 $sql .=
' FROM '.MAIN_DB_PREFIX.
'don as d';
968 $sql .=
' WHERE d.rowid = '.((int) $id);
970 dol_syslog(get_class($this).
'::info', LOG_DEBUG);
971 $result = $this->db->query(
$sql);
974 if ($this->db->num_rows($result)) {
975 $obj = $this->db->fetch_object($result);
976 $this->
id = $obj->rowid;
978 $this->user_creation_id = $obj->fk_user_author;
979 $this->user_validation_id = $obj->fk_user_valid;
980 $this->date_creation = $this->db->jdate($obj->datec);
981 $this->date_modification = (!empty($obj->tms) ? $this->db->jdate($obj->tms) :
"");
983 $this->db->free($result);
1000 public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
1002 global $conf, $langs;
1004 $langs->load(
"bills");
1007 $modele =
'html_cerfafr';
1009 if ($this->model_pdf) {
1010 $modele = $this->model_pdf;
1022 $err = error_reporting();
1024 @set_time_limit(120);
1025 error_reporting($err);
1027 $srctemplatepath =
'';
1030 $tmp = explode(
':', $modele, 2);
1031 if (!empty($tmp[1])) {
1033 $srctemplatepath = $tmp[1];
1040 $dirmodels = array(
'/');
1041 if (is_array($conf->modules_parts[
'models'])) {
1042 $dirmodels = array_merge($dirmodels, $conf->modules_parts[
'models']);
1044 foreach ($dirmodels as $reldir) {
1045 foreach (array(
'html',
'doc',
'pdf') as $prefix) {
1046 $file = $prefix.
"_".preg_replace(
'/^html_/',
'', $modele).
".modules.php";
1049 $file =
dol_buildpath($reldir.
"core/modules/dons/".$file, 0);
1050 if (file_exists($file)) {
1052 $classname = $prefix.
'_'.$modele;
1067 $classname = $modele;
1068 $obj =
new $classname($this->db);
1072 $sav_charset_output = $outputlangs->charset_output;
1073 if ($obj->write_file(
$object, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref) > 0) {
1074 $outputlangs->charset_output = $sav_charset_output;
1077 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
1081 $outputlangs->charset_output = $sav_charset_output;
1087 print $langs->trans(
"Error").
" ".$langs->trans(
"ErrorFileDoesNotExists", $file);
1118 if (empty($this->
id)) {
1119 $this->error =
'Missing object id';
1120 $this->errors[] = $this->error;
1121 dol_syslog(__METHOD__.
' : '.$this->error, LOG_ERR);
1125 $sql =
"SELECT SUM(amount) as sum_amount FROM ".MAIN_DB_PREFIX.
"payment_donation WHERE fk_donation = ".((int) $this->
id);
1126 $resql = $this->db->query(
$sql);
1131 $sum_amount = (
float) $this->db->fetch_object($resql)->sum_amount;
1132 return (
float) ($this->
amount - $sum_amount);
1145 global $conf, $langs;
1147 $selected = (empty($arraydata[
'selected']) ? 0 : $arraydata[
'selected']);
1149 $return =
'<div class="box-flex-item box-flex-grow-zero">';
1150 $return .=
'<div class="info-box info-box-sm">';
1151 $return .=
'<span class="info-box-icon bg-infobox-action">';
1153 $return .=
'</span>';
1154 $return .=
'<div class="info-box-content">';
1155 $return .=
'<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.(method_exists($this,
'getNomUrl') ? $this->
getNomUrl(1) : $this->ref).
'</span>';
1156 if ($selected >= 0) {
1157 $return .=
'<input id="cb'.$this->id.
'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->
id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1159 if (property_exists($this,
'date')) {
1160 $return .=
' | <span class="info-box-label">'.dol_print_date($this->date,
'day',
'tzuserrel').
'</span>';
1162 if (property_exists($this,
'societe') && !empty($this->societe)) {
1163 $return .=
'<br><span class="opacitymedium">'.$langs->trans(
"Company").
'</span> : <span class="info-box-label">'.$this->societe.
'</span>';
1165 if (property_exists($this,
'amount')) {
1166 $return .=
'<br><span class="info-box-label amount">'.price($this->
amount, 1, $langs, 1, -1, -1, $conf->currency).
'</span>';
1168 if (method_exists($this,
'LibStatut')) {
1169 $return .=
'<br><div class="info-box-status">'.$this->getLibStatut(3).
'</div>';
1171 $return .=
'</div>';
1172 $return .=
'</div>';
1173 $return .=
'</div>';
if($user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
print $langs trans("AuditedSecurityEvents").'</strong >< span class="opacitymedium"></span >< br > status
Or an array listing all the potential status of the object: array: int of the status => translated la...
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 remaining amount 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.
getKanbanView($option='', $arraydata=null)
Return clicable link of object (with eventually picto)
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.
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.
set_cancel($id)
Set donation to status cancelled.
loadStateBoard()
Load the indicators this->nb for the state board.
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)
trait CommonPeople
Support class for thirdparties, contacts, members, users or resources.
if(isModEnabled('invoice') && $user->hasRight('facture', 'lire')) if((isModEnabled('fournisseur') &&!getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') && $user->hasRight('don', 'lire')) if(isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) if(isModEnabled('invoice') &&isModEnabled('order') && $user->hasRight("commande", "lire") &&!getDolGlobalString('WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER')) $sql
Social contributions to pay.
dol_delete_preview($object)
Delete all preview files linked to object instance.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
dol_now($mode='auto')
Return date for now.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
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_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
div float
Buy price without taxes.