29require_once DOL_DOCUMENT_ROOT.
'/core/class/commonobject.class.php';
40 public $element =
'salary';
45 public $table_element =
'salary';
50 public $picto =
'salary';
55 protected $childtables = array(
'payment_salary' => array(
'name' =>
'SalaryPayment',
'fk_element' =>
'fk_salary'));
100 public $type_payment_code;
136 public $fk_user_author;
141 public $fk_user_modif;
154 const STATUS_UNPAID = 0;
155 const STATUS_PAID = 1;
162 public $fields = array(
163 'rowid' => array(
'type' =>
'integer',
'label' =>
'TechnicalID',
'enabled' => 1,
'visible' => 0,
'notnull' => 1,
'index' => 1,
'position' => 1,
'comment' =>
'Id'),
164 'ref' => array(
'type' =>
'varchar(128)',
'label' =>
'Ref',
'enabled' => 1,
'position' => 10,
'visible' => 1,
'index' => 1,
'comment' =>
"Reference of object"),
165 'ref_ext' => array(
'type' =>
'varchar(128)',
'label' =>
'RefExt',
'enabled' => 1,
'visible' => 0,
'position' => 11),
166 'label' => array(
'type' =>
'varchar(255)',
'label' =>
'Label',
'enabled' => 1,
'position' => 12,
'notnull' => 0,
'visible' => 1),
167 'datec' => array(
'type' =>
'datetime',
'label' =>
'DateCreation',
'enabled' => 1,
'visible' => 0,
'position' => 30),
168 'datep' => array(
'type' =>
'date',
'label' =>
'Date',
'enabled' => 1,
'visible' => 0,
'position' => 40,
'comment' =>
'Date'),
169 'datev' => array(
'type' =>
'date',
'label' =>
'Date',
'enabled' => 1,
'visible' => 0,
'position' => 50,
'comment' =>
'Date'),
170 'fk_user' => array(
'type' =>
'integer:User:user/class/user.class.php',
'label' =>
'Employee',
'enabled' => 1,
'position' => 15,
'notnull' => 1,
'visible' => 1,
'picto' =>
'user'),
171 'tms' => array(
'type' =>
'timestamp',
'label' =>
'DateModification',
'enabled' => 1,
'visible' => 0,
'notnull' => 1,
'position' => 20),
172 'salary' => array(
'type' =>
'double(24,8)',
'label' =>
'salary',
'enabled' => 1,
'visible' => 0,
'position' => 70),
173 'amount' => array(
'type' =>
'double(24,8)',
'label' =>
'Amount',
'enabled' => 1,
'visible' => 1,
'notnull' => 1,
'position' => 80),
174 'fk_projet' => array(
'type' =>
'integer:Project:projet/class/project.class.php:1:(fk_statut:=:1)',
'label' =>
'Project',
'enabled' =>
"isModEnabled('project')",
'visible' => 0,
'position' => 90),
175 'fk_typepayment' => array(
'type' =>
'typepayment',
'label' =>
'DefaultPaymentMode',
'enabled' => 1,
'visible' => 1,
'position' => 100,
'comment' =>
'Payment type'),
176 'num_payment' => array(
'type' =>
'string',
'label' =>
'Reference',
'enabled' => 1,
'visible' => 0,
'position' => 110,
'comment' =>
'Reference'),
177 'datesp' => array(
'type' =>
'date',
'label' =>
'DateStart',
'enabled' => 1,
'visible' => 1,
'position' => 130,
'comment' =>
'Date'),
178 'dateep' => array(
'type' =>
'date',
'label' =>
'DateEnd',
'enabled' => 1,
'visible' => 1,
'position' => 140,
'comment' =>
'Date'),
179 'entity' => array(
'type' =>
'integer',
'label' =>
'Entity',
'default' =>
'1',
'enabled' => 1,
'visible' => 0,
'position' => 150,
'index' => 1),
180 'note' => array(
'type' =>
'text',
'label' =>
'Note',
'enabled' => 1,
'position' => 160,
'visible' => 0,),
181 'fk_bank' => array(
'type' =>
'integer',
'label' =>
'BankId',
'enabled' => 1,
'visible' => 0,
'position' => 170),
182 'paye' => array(
'type' =>
'smallint(6)',
'label' =>
'Status',
'enabled' => 1,
'visible' => 1,
'notnull' => 1,
'position' => 180),
183 'fk_user_author' => array(
'type' =>
'integer:User:user/class/user.class.php',
'label' =>
'UserAuthor',
'enabled' => 1,
'visible' => 0,
'position' => 190),
184 'fk_user_modif' => array(
'type' =>
'integer:User:user/class/user.class.php',
'label' =>
'UserModif',
'enabled' => 1,
'position' => 200,
'visible' => 0,),
185 'note_public' => array(
'type' =>
'text',
'label' =>
'NotePublic',
'enabled' => 1,
'visible' => 0,
'position' => 220),
197 $this->element =
'salary';
198 $this->table_element =
'salary';
200 $this->fields[
'ref_ext'][
'visible'] =
getDolGlobalInt(
'MAIN_LIST_SHOW_REF_EXT');
210 public function update($user =
null, $notrigger = 0)
215 $this->amount = trim($this->amount);
216 $this->label = trim($this->label);
217 $this->note = trim($this->note);
218 $this->note_private = trim($this->note_private);
219 $this->note_public = trim($this->note_public);
222 if (empty($this->fk_user) || $this->fk_user < 0) {
223 $this->error =
'ErrorBadParameter';
230 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"salary SET";
231 $sql .=
" tms='".$this->db->idate(
dol_now()).
"',";
232 $sql .=
" fk_user=".((int) $this->fk_user).
",";
235 $sql .=
" amount=".price2num($this->amount).
",";
236 $sql .=
" fk_projet=".((int) $this->fk_project).
",";
237 $sql .=
" fk_typepayment=".((int) $this->type_payment).
",";
238 $sql .=
" label='".$this->db->escape($this->label).
"',";
239 $sql .=
" datesp='".$this->db->idate($this->datesp).
"',";
240 $sql .=
" dateep='".$this->db->idate($this->dateep).
"',";
241 $sql .=
" note='".$this->db->escape($this->note).
"',";
242 $sql .=
" fk_bank=".($this->fk_bank > 0 ? (int) $this->fk_bank :
"null").
",";
243 $sql .=
" fk_user_author=".((int) $this->fk_user_author).
",";
244 $sql .=
" fk_user_modif=".($this->fk_user_modif > 0 ? (int) $this->fk_user_modif : (int) $user->id);
245 $sql .=
" WHERE rowid=".((int) $this->
id);
247 dol_syslog(get_class($this).
"::update", LOG_DEBUG);
248 $resql = $this->db->query($sql);
250 $this->error =
"Error ".$this->db->lasterror();
275 $this->db->rollback();
288 public function fetch($id, $user =
null)
293 $sql .=
" s.fk_user,";
296 $sql .=
" s.amount,";
297 $sql .=
" s.fk_projet as fk_project,";
298 $sql .=
" s.fk_typepayment,";
300 $sql .=
" s.datesp,";
301 $sql .=
" s.dateep,";
302 $sql .=
" s.note as note_private,";
303 $sql .=
" s.note_public,";
305 $sql .=
" s.fk_bank,";
306 $sql .=
" s.fk_user_author,";
307 $sql .=
" s.fk_user_modif,";
308 $sql .=
" s.fk_account,";
309 $sql .=
" cp.code as type_payment_code";
310 $sql .=
" FROM ".MAIN_DB_PREFIX.
"salary as s";
311 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank as b ON s.fk_bank = b.rowid";
312 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as cp ON s.fk_typepayment = cp.id";
313 $sql .=
" WHERE s.rowid = ".((int) $id);
315 dol_syslog(get_class($this).
"::fetch", LOG_DEBUG);
317 $resql = $this->db->query($sql);
319 if ($this->db->num_rows($resql)) {
320 $obj = $this->db->fetch_object($resql);
322 $this->
id = $obj->rowid;
323 $this->
ref = $obj->rowid;
324 $this->tms = $this->db->jdate($obj->tms);
325 $this->fk_user = $obj->fk_user;
326 $this->datep = $this->db->jdate($obj->datep);
327 $this->datev = $this->db->jdate($obj->datev);
328 $this->amount = $obj->amount;
329 $this->fk_project = $obj->fk_project;
330 $this->type_payment = $obj->fk_typepayment;
331 $this->type_payment_code = $obj->type_payment_code;
332 $this->label = $obj->label;
333 $this->datesp = $this->db->jdate($obj->datesp);
334 $this->dateep = $this->db->jdate($obj->dateep);
335 $this->note = $obj->note_private;
336 $this->note_private = $obj->note_private;
337 $this->note_public = $obj->note_public;
338 $this->paye = $obj->paye;
339 $this->
status = $obj->paye;
340 $this->fk_bank = $obj->fk_bank;
341 $this->fk_user_author = $obj->fk_user_author;
342 $this->fk_user_modif = $obj->fk_user_modif;
343 $this->fk_account = $obj->fk_account;
344 $this->accountid = $obj->fk_account;
350 $this->db->free($resql);
354 $this->error =
"Error ".$this->db->lasterror();
367 public function delete($user, $notrigger = 0)
394 $this->fk_user_author = 0;
395 $this->fk_user_modif = 0;
408 global
$conf, $langs;
414 $this->amount =
price2num(trim($this->amount));
415 $this->label = trim($this->label);
416 $this->note = trim($this->note);
417 $this->fk_bank = (int) $this->fk_bank;
418 $this->fk_user_author = (int) $this->fk_user_author;
419 $this->fk_user_modif = (int) $this->fk_user_modif;
420 $this->accountid = (int) $this->accountid;
421 $this->paye = (int) $this->paye;
425 $this->error = $langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Label"));
428 if ($this->fk_user < 0 || $this->fk_user ==
'') {
429 $this->error = $langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Employee"));
432 if ($this->amount ==
'') {
433 $this->error = $langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Amount"));
440 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.
"salary (fk_user";
444 $sql .=
", fk_projet";
446 $sql .=
", fk_typepayment";
447 $sql .=
", fk_account";
454 $sql .=
", fk_user_author";
460 $sql .=
"'".$this->db->escape($this->fk_user).
"'";
463 $sql .=
", ".((float) $this->amount);
464 $sql .=
", ".($this->fk_project > 0 ? ((int) $this->fk_project) : 0);
465 $sql .=
", ".($this->salary > 0 ? ((float) $this->salary) :
"null");
466 $sql .=
", ".($this->type_payment > 0 ? ((int) $this->type_payment) : 0);
467 $sql .=
", ".($this->accountid > 0 ? ((int) $this->accountid) :
"null");
469 $sql .=
", '".$this->db->escape($this->note).
"'";
471 $sql .=
", '".$this->db->escape($this->label).
"'";
472 $sql .=
", '".$this->db->idate($this->datesp).
"'";
473 $sql .=
", '".$this->db->idate($this->dateep).
"'";
474 $sql .=
", '".$this->db->escape($user->id).
"'";
475 $sql .=
", '".$this->db->idate($now).
"'";
477 $sql .=
", ".((int)
$conf->entity);
480 dol_syslog(get_class($this).
"::create", LOG_DEBUG);
481 $result = $this->db->query($sql);
483 $this->
id = $this->db->last_insert_id(MAIN_DB_PREFIX.
"salary");
508 $this->db->rollback();
512 $this->error = $this->db->error();
513 $this->db->rollback();
528 $sql =
'UPDATE '.MAIN_DB_PREFIX.
'salary SET fk_bank = '.((int) $id_bank);
529 $sql .=
" WHERE rowid = ".((int) $this->
id);
530 $result = $this->db->query($sql);
549 $langs->loadLangs([
'salaries']);
552 if (!empty($params[
'fromajaxtooltip']) && !isset($this->alreadypaid)) {
559 $datas[
'picto'] =
'<u>'.$langs->trans(
"Salary").
'</u>';
560 if (isset($this->
status) && isset($this->alreadypaid)) {
561 $datas[
'picto'] .=
' '.$this->getLibStatut(5, $this->alreadypaid);
563 $datas[
'ref'] =
'<br><b>'.$langs->trans(
'Ref').
':</b> '.$this->ref;
578 public function getNomUrl($withpicto = 0, $option =
'', $notooltip = 0, $morecss =
'', $save_lastsearch_value = -1)
580 global
$conf, $langs, $hookmanager;
582 if (!empty(
$conf->dol_no_mouse_hover)) {
589 'objecttype' => $this->element,
592 $classfortooltip =
'classfortooltip';
595 $classfortooltip =
'classforajaxtooltip';
596 $dataparams =
' data-params="'.dol_escape_htmltag(json_encode($params)).
'"';
602 $url = DOL_URL_ROOT.
'/salaries/card.php?id='.$this->id;
604 if ($option !=
'nolink') {
606 $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
607 if ($save_lastsearch_value == -1 && isset($_SERVER[
"PHP_SELF"]) && preg_match(
'/list\.php/', $_SERVER[
"PHP_SELF"])) {
608 $add_save_lastsearch_values = 1;
610 if ($add_save_lastsearch_values) {
611 $url .=
'&save_lastsearch_values=1';
616 if (empty($notooltip)) {
618 $label = $langs->trans(
"ShowMyObject");
619 $linkclose .=
' alt="'.dolPrintHTMLForAttribute($label).
'"';
621 $linkclose .= ($label ?
' title="'.dolPrintHTMLForAttribute($label).
'"' :
' title="tocomplete"');
622 $linkclose .= $dataparams.
' class="'.$classfortooltip.($morecss ?
' '.$morecss :
'').
'"';
624 $linkclose = ($morecss ?
' class="'.$morecss.
'"' :
'');
627 $linkstart =
'<a href="'.$url.
'"';
628 $linkstart .= $linkclose.
'>';
631 $result .= $linkstart;
633 $result .=
img_object(($notooltip ?
'' : $label), ($this->picto ? $this->picto :
'generic'), ($notooltip ? (($withpicto != 2) ?
'class="paddingright"' :
'') :
'class="'.(($withpicto != 2) ?
'paddingright ' :
'').
'"'), 0, 0, $notooltip ? 0 : 1);
635 if ($withpicto != 2) {
636 $result .= $this->ref;
641 global $action, $hookmanager;
642 $hookmanager->initHooks(array(
'salarypayment'));
643 $parameters = array(
'id' => $this->
id,
'getnomurl' => &$result);
644 $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action);
646 $result = $hookmanager->resPrint;
648 $result .= $hookmanager->resPrint;
662 $table =
'payment_salary';
663 $field =
'fk_salary';
665 $sql =
"SELECT sum(amount) as amount";
667 $sql .=
" FROM ".MAIN_DB_PREFIX.$table;
668 $sql .=
" WHERE ".$field.
" = ".((int) $this->
id);
670 dol_syslog(get_class($this).
"::getSommePaiement for salary id=".((
int) $this->
id), LOG_DEBUG);
672 $resql = $this->db->query($sql);
675 $obj = $this->db->fetch_object($resql);
677 $this->db->free($resql);
680 if ($multicurrency < 0) {
685 } elseif ($multicurrency) {
691 return (
float) $obj->amount;
697 $this->error = $this->db->lasterror();
710 $sql =
'SELECT ps.rowid, ps.datec, ps.tms as datem, ps.fk_user_author, ps.fk_user_modif';
711 $sql .=
' FROM '.MAIN_DB_PREFIX.
'salary as ps';
712 $sql .=
' WHERE ps.rowid = '.((int) $id);
714 dol_syslog(get_class($this).
'::info', LOG_DEBUG);
715 $result = $this->db->query($sql);
718 if ($this->db->num_rows($result)) {
719 $obj = $this->db->fetch_object($result);
721 $this->
id = $obj->rowid;
723 $this->user_creation_id = $obj->fk_user_author;
724 $this->user_modification_id = $obj->fk_user_modif;
725 $this->date_creation = $this->db->jdate($obj->datec);
726 $this->date_modification = empty($obj->datem) ?
'' : $this->db->jdate($obj->datem);
728 $this->db->free($result);
746 dol_syslog(get_class($this).
"::set_paid is deprecated, use setPaid instead", LOG_NOTICE);
758 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"salary SET";
760 $sql .=
" WHERE rowid = ".((int) $this->
id);
762 $return = $this->db->query($sql);
782 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"salary SET";
784 $sql .=
" WHERE rowid = ".((int) $this->
id);
786 $return = $this->db->query($sql);
806 return $this->
LibStatut($this->paye, $mode, $alreadypaid);
818 public function LibStatut($status, $mode = 0, $alreadypaid = -1)
824 $langs->loadLangs(array(
"customers",
"bills"));
827 $this->labelStatus = array();
828 $this->labelStatusShort = array();
830 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
833 $this->labelStatus[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv(
'BillStatusNotPaid');
834 $this->labelStatus[self::STATUS_PAID] = $langs->transnoentitiesnoconv(
'BillStatusPaid');
835 if ($status == self::STATUS_UNPAID && $alreadypaid != 0) {
836 $this->labelStatus[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv(
"BillStatusStarted");
838 $this->labelStatusShort[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv(
'BillStatusNotPaid');
839 $this->labelStatusShort[self::STATUS_PAID] = $langs->transnoentitiesnoconv(
'BillStatusPaid');
840 if ($status == self::STATUS_UNPAID && $alreadypaid != 0) {
841 $this->labelStatusShort[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv(
"BillStatusStarted");
845 $statusType =
'status1';
846 if ($status == 0 && $alreadypaid != 0) {
847 $statusType =
'status3';
850 $statusType =
'status6';
853 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
867 $selected = (empty($arraydata[
'selected']) ? 0 : $arraydata[
'selected']);
869 $return =
'<div class="box-flex-item box-flex-grow-zero">';
870 $return .=
'<div class="info-box info-box-sm">';
871 $return .=
'<span class="info-box-icon bg-infobox-action">';
873 $return .=
'</span>';
874 $return .=
'<div class="info-box-content">';
875 $return .=
'<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.(method_exists($this,
'getNomUrl') ? $this->
getNomUrl(1) : $this->ref).
'</span>';
876 if ($selected >= 0) {
877 $return .=
'<input id="cb'.$this->id.
'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->
id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
879 if (!empty($arraydata[
'user']) && is_object($arraydata[
'user'])) {
880 $user = $arraydata[
'user'];
881 '@phan-var-force User $user';
882 $return .=
'<br><span class="info-box-label">'.$user->getNomUrl(empty($arraydata[
'user']->photo) ? 1 : -1,
'', 0, 0, 16, 0,
'',
'maxwidth100').
'</span>';
884 if (property_exists($this,
'amount')) {
885 $return .=
'<br><span class="info-box-label amount">'.price($this->amount).
'</span>';
886 if (property_exists($this,
'type_payment') && !empty($this->type_payment)) {
887 $return .=
' <span class="info-box-label opacitymedium small">';
888 if ($langs->trans(
"PaymentTypeShort".$this->type_payment) !=
"PaymentTypeShort".$this->type_payment) {
889 $return .= $langs->trans(
"PaymentTypeShort".$this->type_payment);
890 } elseif ($langs->trans(
"PaymentType".$this->type_payment) !=
"PaymentType".$this->type_payment) {
891 $return .= $langs->trans(
"PaymentType".$this->type_payment);
893 $return .=
'</span>';
896 if (method_exists($this,
'LibStatut')) {
897 $return .=
'<br><div class="info-box-status">'.$this->getLibStatut(3, isset($this->alreadypaid) ? $this->alreadypaid : $this->totalpaid).
'</div>';
917 public function demande_prelevement($fuser, $amount = 0, $type =
'direct-debit', $sourcetype =
'salaire', $checkduplicateamongall = 0)
920 global
$conf, $mysoc;
924 dol_syslog(get_class($this).
"::demande_prelevement", LOG_DEBUG);
925 if ($this->paye == 0) {
926 require_once DOL_DOCUMENT_ROOT.
'/societe/class/companybankaccount.class.php';
929 $bac->fetch(0,
'', $mysoc->id);
931 $sql =
"SELECT count(rowid) as nb";
932 $sql .=
" FROM ".$this->db->prefix().
"prelevement_demande";
933 if ($type ==
'salaire') {
934 $sql .=
" WHERE fk_salary = ".((int) $this->
id);
936 $sql .=
" WHERE fk_facture = ".((int) $this->
id);
938 $sql .=
" AND type = 'ban'";
939 if (empty($checkduplicateamongall)) {
940 $sql .=
" AND traite = 0";
943 dol_syslog(get_class($this).
"::demande_prelevement", LOG_DEBUG);
945 $resql = $this->db->query($sql);
947 $obj = $this->db->fetch_object($resql);
948 if ($obj && $obj->nb == 0) {
964 if (is_numeric($amount) && $amount != 0) {
965 $sql =
'INSERT INTO '.$this->db->prefix().
'prelevement_demande(';
966 if ($type ==
'salaire') {
967 $sql .=
'fk_salary, ';
969 $sql .=
'fk_facture, ';
971 $sql .=
' amount, date_demande, fk_user_demande, code_banque, code_guichet, number, cle_rib, sourcetype, type, entity)';
972 $sql .=
" VALUES (".((int) $this->
id);
973 $sql .=
", ".((float)
price2num($amount));
974 $sql .=
", '".$this->db->idate($now).
"'";
975 $sql .=
", ".((int) $fuser->id);
976 $sql .=
", '".$this->db->escape($bac->code_banque).
"'";
977 $sql .=
", '".$this->db->escape($bac->code_guichet).
"'";
978 $sql .=
", '".$this->db->escape($bac->number).
"'";
979 $sql .=
", '".$this->db->escape($bac->cle_rib).
"'";
980 $sql .=
", '".$this->db->escape($sourcetype).
"'";
982 $sql .=
", ".((int)
$conf->entity);
985 dol_syslog(get_class($this).
"::demande_prelevement", LOG_DEBUG);
986 $resql = $this->db->query($sql);
988 $this->error = $this->db->lasterror();
989 dol_syslog(get_class($this).
'::demandeprelevement Erreur');
993 $this->error =
'WithdrawRequestErrorNilAmount';
994 dol_syslog(get_class($this).
'::demandeprelevement WithdrawRequestErrorNilAmount');
1000 $payment_mode_id =
dol_getIdFromCode($this->db, (($type ==
'bank-transfer' || $type ==
'salaire') ?
'VIR' :
'PRE'),
'c_paiement',
'code',
'id', 1);
1001 if ($payment_mode_id > 0) {
1011 $this->error =
"A request already exists";
1012 dol_syslog(get_class($this).
'::demandeprelevement Can t create a request to generate a direct debit, a request already exists.');
1016 $this->error = $this->db->error();
1017 dol_syslog(get_class($this).
'::demandeprelevement Error -2');
1021 $this->error =
"Status of invoice does not allow this";
1022 dol_syslog(get_class($this).
"::demandeprelevement ".$this->error.
" $this->status, $this->paye, $this->mode_reglement_id");
1038 $sql =
'DELETE FROM '.$this->db->prefix().
'prelevement_demande';
1039 $sql .=
' WHERE rowid = '.((int) $did);
1040 $sql .=
' AND traite = 0';
1041 if ($this->db->query($sql)) {
1044 $this->error = $this->db->lasterror();
1045 dol_syslog(get_class($this).
'::demande_prelevement_delete Error '.$this->error);
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...
insertExtraFields($trigger='', $userused=null)
Add/Update all extra fields values for the current object.
setPaymentMethods($id)
Change the payments methods.
deleteCommon(User $user, $notrigger=0, $forcechilddeletion=0)
Delete object in database.
call_trigger($triggerName, $user)
Call trigger based on this instance.
Class to manage bank accounts description of third parties.
Class to manage salary payments.
fetch($id, $user=null)
Load object in memory from database.
initAsSpecimen()
Initialise an instance with random values.
update($user=null, $notrigger=0)
Update database.
getTooltipContentArray($params)
getTooltipContentArray
getKanbanView($option='', $arraydata=null)
Return clickable link of object (with eventually picto)
update_fk_bank($id_bank)
Update link between payment salary and line generate into llx_bank.
LibStatut($status, $mode=0, $alreadypaid=-1)
Return label of a given status.
set_paid($user)
Tag social contribution as paid completely.
demande_prelevement_delete($fuser, $did)
Remove a direct debit request or a credit transfer request.
getNomUrl($withpicto=0, $option='', $notooltip=0, $morecss='', $save_lastsearch_value=-1)
Send name clickable (with possibly the picto)
set_unpaid($user)
Remove tag paid on social contribution.
create($user)
Create in database.
getSommePaiement($multicurrency=0)
Return amount of payments already done.
getLibStatut($mode=0, $alreadypaid=-1)
Return label of current status.
info($id)
Information on record.
__construct($db)
Constructor.
setPaid($user)
Tag social contribution as paid completely.
demande_prelevement($fuser, $amount=0, $type='direct-debit', $sourcetype='salaire', $checkduplicateamongall=0)
Create a withdrawal request for a direct debit order or a credit transfer order.
print $langs trans("Ref").' m titre as m m statut as status
Or an array listing all the potential status of the object: array: int of the status => translated la...
dol_getIdFromCode($db, $key, $tablename, $fieldkey='code', $fieldid='id', $entityfilter=0, $filters='', $useCache=true)
Return an id or code from a code or id.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
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 '.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $allowothertags=array())
Show a picto called object_picto (generic function)
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dolGetStatus($statusLabel='', $statusLabelShort='', $html='', $statusType='status0', $displayMode=0, $url='', $params=array())
Output the badge of a status.
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 a Dolibarr global constant string value.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...