31 require_once DOL_DOCUMENT_ROOT.
'/core/class/commonobject.class.php';
42 public $element =
'don';
47 public $table_element =
'don';
52 public $fk_element =
'fk_donation';
58 public $ismultientitymanaged = 1;
63 public $picto =
'donation';
114 public $fk_typepayment;
122 public $modepaymentid = 0;
132 public $labelStatusShort;
135 const STATUS_DRAFT = 0;
136 const STATUS_VALIDATED = 1;
137 const STATUS_PAID = 2;
138 const STATUS_CANCELED = -1;
174 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) $statusType =
'status9';
190 if ($status == self::STATUS_PAID) $statusType =
'status6';
192 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
205 global $conf, $user, $langs;
212 $sql =
"SELECT rowid";
213 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe";
214 $sql .=
" WHERE client IN (1, 3)";
215 $sql .=
" AND entity = ".$conf->entity;
221 $num_socs = $this->
db->num_rows(
$resql);
223 while ($i < $num_socs)
227 $row = $this->
db->fetch_row(
$resql);
228 $socids[$i] = $row[0];
234 $this->ref =
'SPECIMEN';
236 $this->lastname =
'Doe';
237 $this->firstname =
'John';
240 $this->date_valid = $now;
241 $this->amount = 100.90;
243 $this->societe =
'The Company';
244 $this->address =
'Twist road';
245 $this->zip =
'99999';
246 $this->town =
'Town';
247 $this->note_private =
'Private note';
248 $this->note_public =
'Public note';
249 $this->email =
'email@email.com';
250 $this->phone =
'0123456789';
251 $this->phone_mobile =
'0606060606';
266 $langs->load(
'main');
267 $langs->load(
'companies');
269 $error_string = array();
276 $error_string[] = $langs->trans(
'ErrorFieldRequired', $langs->transnoentitiesnoconv(
'Company').
'/'.$langs->transnoentitiesnoconv(
'Firstname').
'-'.$langs->transnoentitiesnoconv(
'Lastname'));
283 $error_string[] = $langs->trans(
'ErrorFieldRequired', $langs->transnoentitiesnoconv(
'Address'));
289 $error_string[] = $langs->trans(
'ErrorFieldRequired', $langs->transnoentitiesnoconv(
'Zip'));
295 $error_string[] = $langs->trans(
'ErrorFieldRequired', $langs->transnoentitiesnoconv(
'Town'));
301 $error_string[] = $langs->trans(
'ErrorFieldRequired', $langs->transnoentitiesnoconv(
'EMail'));
305 $this->amount = trim($this->amount);
309 for ($i = 0; $i < $len; $i++)
311 if (!isset($map[substr($this->amount, $i, 1)]))
313 $error_string[] = $langs->trans(
'ErrorFieldRequired', $langs->transnoentitiesnoconv(
'Amount'));
320 if (!$amount_invalid)
322 if ($this->amount == 0)
324 $error_string[] = $langs->trans(
'ErrorFieldRequired', $langs->transnoentitiesnoconv(
'Amount'));
327 if ($this->amount < $minimum && $minimum > 0)
329 $error_string[] = $langs->trans(
'MinimumAmount', $langs->transnoentitiesnoconv(
'$minimum'));
337 $this->errors = $error_string;
352 public function create($user, $notrigger = 0)
354 global $conf, $langs;
361 $this->address = ($this->address > 0 ? $this->address : $this->address);
362 $this->zip = ($this->zip > 0 ? $this->zip : $this->zip);
363 $this->town = ($this->town > 0 ? $this->town : $this->town);
364 $this->country_id = ($this->country_id > 0 ? $this->country_id : $this->country_id);
365 $this->country = ($this->country ? $this->country : $this->country);
369 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.
"don (";
373 $sql .=
", fk_payment";
375 $sql .=
", firstname";
376 $sql .=
", lastname";
381 $sql .=
", fk_country";
383 $sql .=
", fk_projet";
384 $sql .=
", note_private";
385 $sql .=
", note_public";
386 $sql .=
", fk_user_author";
387 $sql .=
", fk_user_valid";
391 $sql .=
", phone_mobile";
392 $sql .=
") VALUES (";
393 $sql .=
"'".$this->db->idate($now).
"'";
394 $sql .=
", ".$conf->entity;
395 $sql .=
", ".price2num($this->amount);
396 $sql .=
", ".($this->modepaymentid ? $this->modepaymentid :
"null");
397 $sql .=
", ".($this->socid > 0 ? $this->socid :
"null");
398 $sql .=
", '".$this->db->escape($this->firstname).
"'";
399 $sql .=
", '".$this->db->escape($this->lastname).
"'";
400 $sql .=
", '".$this->db->escape($this->societe).
"'";
401 $sql .=
", '".$this->db->escape($this->address).
"'";
402 $sql .=
", '".$this->db->escape($this->zip).
"'";
403 $sql .=
", '".$this->db->escape($this->town).
"'";
404 $sql .=
", ".(int) ($this->country_id > 0 ? $this->country_id : 0);
405 $sql .=
", ".(int) $this->
public;
406 $sql .=
", ".($this->fk_project > 0 ? (int) $this->fk_project :
"null");
407 $sql .=
", ".(!empty($this->note_private) ? (
"'".$this->db->escape($this->note_private).
"'") :
"NULL");
408 $sql .=
", ".(!empty($this->note_public) ? (
"'".$this->db->escape($this->note_public).
"'") :
"NULL");
409 $sql .=
", ".$user->id;
411 $sql .=
", '".$this->db->idate($this->date).
"'";
412 $sql .=
", '".$this->db->escape(trim($this->email)).
"'";
413 $sql .=
", '".$this->db->escape(trim($this->phone)).
"'";
414 $sql .=
", '".$this->db->escape(trim($this->phone_mobile)).
"'";
420 $this->
id = $this->
db->last_insert_id(MAIN_DB_PREFIX.
"don");
427 if ($result < 0) { $error++; }
431 $this->error = $this->
db->lasterror();
432 $this->errno = $this->
db->lasterrno();
444 if (!$error && !empty($conf->global->MAIN_DISABLEDRAFTSTATUS))
455 $this->
db->rollback();
467 public function update($user, $notrigger = 0)
469 global $langs, $conf;
474 $this->address = ($this->address > 0 ? $this->address : $this->address);
475 $this->zip = ($this->zip > 0 ? $this->zip : $this->zip);
476 $this->town = ($this->town > 0 ? $this->town : $this->town);
477 $this->country_id = ($this->country_id > 0 ? $this->country_id : $this->country_id);
478 $this->country = ($this->country ? $this->country : $this->country);
482 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"don SET ";
483 $sql .=
"amount = ".price2num($this->amount);
484 $sql .=
",fk_payment = ".($this->modepaymentid ? $this->modepaymentid :
"null");
485 $sql .=
",firstname = '".$this->db->escape($this->firstname).
"'";
486 $sql .=
",lastname='".$this->db->escape($this->lastname).
"'";
487 $sql .=
",societe='".$this->db->escape($this->societe).
"'";
488 $sql .=
",address='".$this->db->escape($this->address).
"'";
489 $sql .=
",zip='".$this->db->escape($this->zip).
"'";
490 $sql .=
",town='".$this->db->escape($this->town).
"'";
491 $sql .=
",fk_country = ".($this->country_id > 0 ? $this->country_id :
'0');
492 $sql .=
",public=".$this->public;
493 $sql .=
",fk_projet=".($this->fk_project > 0 ? $this->fk_project :
'null');
494 $sql .=
",note_private=".(!empty($this->note_private) ? (
"'".$this->db->escape($this->note_private).
"'") :
"NULL");
495 $sql .=
",note_public=".(!empty($this->note_public) ? (
"'".$this->db->escape($this->note_public).
"'") :
"NULL");
496 $sql .=
",datedon='".$this->db->idate($this->date).
"'";
497 $sql .=
",date_valid=".($this->date_valid ?
"'".$this->db->idate($this->date).
"'" :
"null");
498 $sql .=
",email='".$this->db->escape(trim($this->email)).
"'";
499 $sql .=
",phone='".$this->db->escape(trim($this->phone)).
"'";
500 $sql .=
",phone_mobile='".$this->db->escape(trim($this->phone_mobile)).
"'";
501 $sql .=
",fk_statut=".$this->statut;
502 $sql .=
" WHERE rowid = ".$this->id;
504 dol_syslog(get_class($this).
"::Update", LOG_DEBUG);
512 if ($result < 0) { $error++; }
531 $this->
db->rollback();
535 $this->error = $this->
db->lasterror();
536 $this->errors[] = $this->error;
537 $this->
db->rollback();
538 dol_syslog(get_class($this).
"::Update error -2 ".$this->error, LOG_ERR);
551 public function delete($user, $notrigger = 0)
553 global $user, $conf, $langs;
554 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
560 if (!$error && !$notrigger) {
573 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.
"don_extrafields";
574 $sql .=
" WHERE fk_object=".$this->id;
579 $this->errors[] = $this->
db->lasterror();
586 $sql =
"DELETE FROM ".MAIN_DB_PREFIX.
"don";
587 $sql .=
" WHERE rowid=".$this->id;
592 $this->errors[] = $this->
db->lasterror();
602 foreach ($this->errors as $errmsg)
604 dol_syslog(get_class($this).
"::delete ".$errmsg, LOG_ERR);
605 $this->error .= ($this->error ?
', '.$errmsg : $errmsg);
607 dol_syslog(get_class($this).
"::delete ".$this->error, LOG_ERR);
608 $this->
db->rollback();
620 public function fetch($id, $ref =
'')
624 $sql =
"SELECT d.rowid, d.datec, d.date_valid, d.tms as datem, d.datedon,";
625 $sql .=
" d.fk_soc as socid,d.firstname, d.lastname, d.societe, d.amount, d.fk_statut, d.address, d.zip, d.town, ";
626 $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, ";
627 $sql .=
" d.phone_mobile, d.fk_projet as fk_project, d.model_pdf,";
628 $sql .=
" p.ref as project_ref,";
629 $sql .=
" cp.libelle as payment_label, cp.code as payment_code,";
630 $sql .=
" c.code as country_code, c.label as country";
631 $sql .=
" FROM ".MAIN_DB_PREFIX.
"don as d";
632 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"projet as p ON p.rowid = d.fk_projet";
633 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as cp ON cp.id = d.fk_payment";
634 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as c ON d.fk_country = c.rowid";
635 $sql .=
" WHERE d.entity IN (".getEntity(
'donation').
")";
638 $sql .=
" AND d.rowid=".$id;
639 } elseif (!empty($ref))
641 $sql .=
" AND d.ref='".$this->db->escape($ref).
"'";
644 dol_syslog(get_class($this).
"::fetch", LOG_DEBUG);
650 $obj = $this->
db->fetch_object(
$resql);
652 $this->
id = $obj->rowid;
653 $this->ref = $obj->rowid;
654 $this->date_creation = $this->
db->jdate($obj->datec);
655 $this->datec = $this->
db->jdate($obj->datec);
656 $this->date_validation = $this->
db->jdate($obj->date_valid);
657 $this->date_valid = $this->
db->jdate($obj->date_valid);
658 $this->date_modification = $this->
db->jdate($obj->datem);
659 $this->datem = $this->
db->jdate($obj->datem);
660 $this->date = $this->
db->jdate($obj->datedon);
661 $this->socid = $obj->socid;
662 $this->firstname = $obj->firstname;
663 $this->lastname = $obj->lastname;
664 $this->societe = $obj->societe;
665 $this->
statut = $obj->fk_statut;
666 $this->address = $obj->address;
667 $this->zip = $obj->zip;
668 $this->town = $obj->town;
669 $this->country_id = $obj->fk_country;
670 $this->country_code = $obj->country_code;
671 $this->country = $obj->country;
672 $this->country_olddata = $obj->country_olddata;
673 $this->email = $obj->email;
674 $this->phone = $obj->phone;
675 $this->phone_mobile = $obj->phone_mobile;
676 $this->project = $obj->project_ref;
677 $this->fk_projet = $obj->fk_project;
678 $this->fk_project = $obj->fk_project;
679 $this->
public = $obj->public;
680 $this->mode_reglement_id = $obj->fk_payment;
681 $this->mode_reglement_code = $obj->payment_code;
682 $this->mode_reglement = $obj->payment_label;
683 $this->paid = $obj->paid;
684 $this->amount = $obj->amount;
685 $this->note_private = $obj->note_private;
686 $this->note_public = $obj->note_public;
687 $this->model_pdf = $obj->model_pdf;
688 $this->modelpdf = $obj->model_pdf;
725 global $langs, $user;
731 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"don SET fk_statut = 1, fk_user_valid = ".$userid.
" WHERE rowid = ".$id.
" AND fk_statut = 0";
736 if ($this->
db->affected_rows(
$resql))
741 if ($result < 0) { $error++; }
747 $this->error = $this->
db->lasterror();
755 $this->
db->rollback();
771 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"don SET fk_statut = 2";
774 $sql .=
", fk_payment=".$modepayment;
776 $sql .=
" WHERE rowid = ".$id.
" AND fk_statut = 1";
780 if ($this->
db->affected_rows(
$resql)) {
802 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"don SET fk_statut = -1 WHERE rowid = ".$id;
806 if ($this->
db->affected_rows(
$resql)) {
825 public function reopen($user, $notrigger = 0)
828 if ($this->
statut != self::STATUS_CANCELED) {
839 return $this->
setStatusCommon($user, self::STATUS_VALIDATED, $notrigger,
'DON_REOPEN');
856 $sql =
"SELECT sum(amount) as total";
857 $sql .=
" FROM ".MAIN_DB_PREFIX.
"don";
858 $sql .=
" WHERE fk_statut = ".$param;
859 $sql .=
" AND entity = ".$conf->entity;
864 $obj = $this->
db->fetch_object(
$resql);
865 $result = $obj->total;
884 $sql =
"SELECT count(d.rowid) as nb";
885 $sql .=
" FROM ".MAIN_DB_PREFIX.
"don as d";
886 $sql .=
" WHERE d.fk_statut > 0";
887 $sql .=
" AND d.entity IN (".getEntity(
'donation').
")";
892 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;
918 if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1;
921 $label =
img_picto(
'', $this->picto).
' <u class="paddingrightonly">'.$langs->trans(
"Donation").
'</u>';
922 if (isset($this->status)) {
923 $label .=
' '.$this->getLibStatut(5);
925 if (!empty($this->
id)) {
926 $label .=
'<br><b>'.$langs->trans(
'Ref').
':</b> '.$this->id;
927 $label .=
'<br><b>'.$langs->trans(
'Date').
':</b> '.
dol_print_date($this->date,
'day');
929 if ($moretitle) $label .=
' - '.$moretitle;
931 $url = DOL_URL_ROOT.
'/don/card.php?id='.$this->id;
933 $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
934 if ($save_lastsearch_value == -1 && preg_match(
'/list\.php/',
$_SERVER[
"PHP_SELF"])) $add_save_lastsearch_values = 1;
935 if ($add_save_lastsearch_values) $url .=
'&save_lastsearch_values=1';
937 $linkstart =
'<a href="'.$url.
'" title="'.
dol_escape_htmltag($label, 1).
'" class="classfortooltip">';
940 $result .= $linkstart;
941 if ($withpicto) $result .=
img_object(($notooltip ?
'' : $label), $this->picto, ($notooltip ? (($withpicto != 2) ?
'class="paddingright"' :
'') :
'class="'.(($withpicto != 2) ?
'paddingright ' :
'').
'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
942 if ($withpicto != 2) $result .= $this->ref;
956 $sql =
'SELECT d.rowid, d.datec, d.fk_user_author, d.fk_user_valid,';
958 $sql .=
' FROM '.MAIN_DB_PREFIX.
'don as d';
959 $sql .=
' WHERE d.rowid = '.$id;
961 dol_syslog(get_class($this).
'::info', LOG_DEBUG);
962 $result = $this->
db->query($sql);
966 if ($this->
db->num_rows($result))
968 $obj = $this->
db->fetch_object($result);
969 $this->
id = $obj->rowid;
970 if ($obj->fk_user_author)
972 $cuser =
new User($this->
db);
973 $cuser->fetch($obj->fk_user_author);
974 $this->user_creation = $cuser;
976 if ($obj->fk_user_valid)
978 $vuser =
new User($this->
db);
979 $vuser->fetch($obj->fk_user_valid);
980 $this->user_modification = $vuser;
982 $this->date_creation = $this->
db->jdate($obj->datec);
983 $this->date_modification = $this->
db->jdate($obj->tms);
985 $this->
db->free($result);
1002 public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
1004 global $conf, $langs;
1006 $langs->load(
"bills");
1009 $modele =
'html_cerfafr';
1011 if ($this->model_pdf) {
1012 $modele = $this->model_pdf;
1013 } elseif (!empty($conf->global->DON_ADDON_MODEL)) {
1014 $modele = $conf->global->DON_ADDON_MODEL;
1018 $modelpath =
"core/modules/dons/";
1024 $err = error_reporting();
1026 @set_time_limit(120);
1027 error_reporting($err);
1029 $srctemplatepath =
'';
1032 $tmp = explode(
':', $modele, 2);
1033 if (!empty($tmp[1]))
1036 $srctemplatepath = $tmp[1];
1040 $file =
''; $classname =
''; $filefound = 0;
1041 $dirmodels = array(
'/');
1042 if (is_array($conf->modules_parts[
'models'])) $dirmodels = array_merge($dirmodels, $conf->modules_parts[
'models']);
1043 foreach ($dirmodels as $reldir)
1045 foreach (array(
'html',
'doc',
'pdf') as $prefix)
1047 $file = $prefix.
"_".preg_replace(
'/^html_/',
'', $modele).
".modules.php";
1050 $file =
dol_buildpath($reldir.
"core/modules/dons/".$file, 0);
1051 if (file_exists($file))
1054 $classname = $prefix.
'_'.$modele;
1058 if ($filefound)
break;
1068 $classname = $modele;
1069 $obj =
new $classname($this->
db);
1073 $sav_charset_output = $outputlangs->charset_output;
1074 if ($obj->write_file($object, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref) > 0)
1076 $outputlangs->charset_output = $sav_charset_output;
1079 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
1083 $outputlangs->charset_output = $sav_charset_output;
1089 print $langs->trans(
"Error").
" ".$langs->trans(
"ErrorFileDoesNotExists", $file);
update($user, $notrigger=0)
Update a donation record.
valid_promesse($id, $userid, $notrigger=0)
Validate a promise of donation.
if(!empty($arrayfields['u.datec']['checked'])) print_liste_field_titre("DateCreationShort"u if(!empty($arrayfields['u.tms']['checked'])) print_liste_field_titre("DateModificationShort"u if(!empty($arrayfields['u.statut']['checked'])) print_liste_field_titre("Status"u statut
getNomUrl($withpicto=0, $notooltip=0, $moretitle= '', $save_lastsearch_value=-1)
Return clicable name (with picto eventually)
set_cancel($id)
Set donation to status cancelled.
set_paid($id, $modepayment=0)
Classify the donation as paid, the donation was received.
dol_now($mode= 'auto')
Return date for now.
dol_delete_preview($object)
Delete all preview files linked to object instance.
Class to manage Dolibarr users.
Class to manage Dolibarr database access.
load_state_board()
Charge indicateurs this->nb pour le tableau de bord.
fetch($id, $ref= '')
Load donation from database.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
$conf db
API class for accounts.
LibStatut($status, $mode=0)
Return the label of a given status.
insertExtraFields($trigger= '', $userused=null)
Add/Update all extra fields values for the current object.
getLibStatut($mode=0)
Returns the donation status label (draft, valid, abandoned, paid)
static replaceThirdparty(DoliDB $db, $origin_id, $dest_id)
Function used to replace a thirdparty id with another one.
info($id)
Information on record.
dol_strlen($string, $stringencoding= 'UTF-8')
Make a strlen call.
generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
Create a document onto disk according to template module.
__construct($db)
Constructor.
initAsSpecimen()
Initialise an instance with random values.
static commonReplaceThirdparty(DoliDB $db, $origin_id, $dest_id, array $tables, $ignoreerrors=0)
Function used to replace a thirdparty id with another one.
create($user, $notrigger=0)
Create donation record into database.
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
setValid($user, $notrigger=0)
Validate a intervention.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
img_object($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
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...
print $_SERVER["PHP_SELF"]
Edit parameters.
print
Draft customers invoices.
Class to manage donations.
dol_print_date($time, $format= '', $tzoutput= 'auto', $outputlangs= '', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
call_trigger($triggerName, $user)
Call trigger based on this instance.
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
setStatusCommon($user, $status, $notrigger=0, $triggercode= '')
Set to a status.
dolGetStatus($statusLabel= '', $statusLabelShort= '', $html= '', $statusType= 'status0', $displayMode=0, $url= '', $params=array())
Output the badge of a status.
reopen($user, $notrigger=0)
Set cancel status.
check($minimum=0)
Check params and init ->errors array.
sum_donations($param)
Sum of donations.
Parent class of all other business classes (invoices, contracts, proposals, orders, ...)
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $keepmoretags= '', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields...