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 'label' => array(
'type' =>
'varchar(255)',
'label' =>
'Label',
'enabled' => 1,
'position' => 12,
'notnull' => 0,
'visible' => 1),
166 'datec' => array(
'type' =>
'datetime',
'label' =>
'DateCreation',
'enabled' => 1,
'visible' => 0,
'position' => 30),
167 'datep' => array(
'type' =>
'date',
'label' =>
'Date',
'enabled' => 1,
'visible' => 0,
'position' => 40,
'comment' =>
'Date'),
168 'datev' => array(
'type' =>
'date',
'label' =>
'Date',
'enabled' => 1,
'visible' => 0,
'position' => 50,
'comment' =>
'Date'),
169 'fk_user' => array(
'type' =>
'integer:User:user/class/user.class.php',
'label' =>
'Employee',
'enabled' => 1,
'position' => 15,
'notnull' => 1,
'visible' => 1,
'picto' =>
'user'),
170 'tms' => array(
'type' =>
'timestamp',
'label' =>
'DateModification',
'enabled' => 1,
'visible' => 0,
'notnull' => 1,
'position' => 20),
171 'salary' => array(
'type' =>
'double(24,8)',
'label' =>
'salary',
'enabled' => 1,
'visible' => 0,
'position' => 70),
172 'amount' => array(
'type' =>
'double(24,8)',
'label' =>
'Amount',
'enabled' => 1,
'visible' => 1,
'notnull' => 1,
'position' => 80),
173 'fk_projet' => array(
'type' =>
'integer:Project:projet/class/project.class.php:1:(fk_statut:=:1)',
'label' =>
'Project',
'enabled' =>
"isModEnabled('project')",
'visible' => 0,
'position' => 90),
174 'fk_typepayment' => array(
'type' =>
'typepayment',
'label' =>
'DefaultPaymentMode',
'enabled' => 1,
'visible' => 1,
'position' => 100,
'comment' =>
'Payment type'),
175 'num_payment' => array(
'type' =>
'string',
'label' =>
'Reference',
'enabled' => 1,
'visible' => 0,
'position' => 110,
'comment' =>
'Reference'),
176 'datesp' => array(
'type' =>
'date',
'label' =>
'DateStart',
'enabled' => 1,
'visible' => 1,
'position' => 130,
'comment' =>
'Date'),
177 'dateep' => array(
'type' =>
'date',
'label' =>
'DateEnd',
'enabled' => 1,
'visible' => 1,
'position' => 140,
'comment' =>
'Date'),
178 'entity' => array(
'type' =>
'integer',
'label' =>
'Entity',
'default' =>
'1',
'enabled' => 1,
'visible' => 0,
'position' => 150,
'index' => 1),
179 'note' => array(
'type' =>
'text',
'label' =>
'Note',
'enabled' => 1,
'position' => 160,
'visible' => 0,),
180 'fk_bank' => array(
'type' =>
'integer',
'label' =>
'BankId',
'enabled' => 1,
'visible' => 0,
'position' => 170),
181 'paye' => array(
'type' =>
'smallint(6)',
'label' =>
'Status',
'enabled' => 1,
'visible' => 1,
'notnull' => 1,
'position' => 180),
182 'fk_user_author' => array(
'type' =>
'integer:User:user/class/user.class.php',
'label' =>
'UserAuthor',
'enabled' => 1,
'visible' => 0,
'position' => 190),
183 'fk_user_modif' => array(
'type' =>
'integer:User:user/class/user.class.php',
'label' =>
'UserModif',
'enabled' => 1,
'position' => 200,
'visible' => 0,),
184 'ref_ext' => array(
'type' =>
'varchar(128)',
'label' =>
'Ref ext',
'enabled' => 1,
'visible' => 0,
'position' => 210),
185 'note_public' => array(
'type' =>
'text',
'label' =>
'NotePublic',
'enabled' => 1,
'visible' => 0,
'position' => 220),
197 $this->element =
'salary';
198 $this->table_element =
'salary';
208 public function update($user =
null, $notrigger = 0)
213 $this->amount = trim($this->amount);
214 $this->label = trim($this->label);
215 $this->note = trim($this->note);
216 $this->note_private = trim($this->note_private);
217 $this->note_public = trim($this->note_public);
220 if (empty($this->fk_user) || $this->fk_user < 0) {
221 $this->error =
'ErrorBadParameter';
228 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"salary SET";
229 $sql .=
" tms='".$this->db->idate(
dol_now()).
"',";
230 $sql .=
" fk_user=".((int) $this->fk_user).
",";
233 $sql .=
" amount=".price2num($this->amount).
",";
234 $sql .=
" fk_projet=".((int) $this->fk_project).
",";
235 $sql .=
" fk_typepayment=".((int) $this->type_payment).
",";
236 $sql .=
" label='".$this->db->escape($this->label).
"',";
237 $sql .=
" datesp='".$this->db->idate($this->datesp).
"',";
238 $sql .=
" dateep='".$this->db->idate($this->dateep).
"',";
239 $sql .=
" note='".$this->db->escape($this->note).
"',";
240 $sql .=
" fk_bank=".($this->fk_bank > 0 ? (int) $this->fk_bank :
"null").
",";
241 $sql .=
" fk_user_author=".((int) $this->fk_user_author).
",";
242 $sql .=
" fk_user_modif=".($this->fk_user_modif > 0 ? (int) $this->fk_user_modif : (int) $user->id);
243 $sql .=
" WHERE rowid=".((int) $this->
id);
245 dol_syslog(get_class($this).
"::update", LOG_DEBUG);
246 $resql = $this->db->query($sql);
248 $this->error =
"Error ".$this->db->lasterror();
273 $this->db->rollback();
286 public function fetch($id, $user =
null)
291 $sql .=
" s.fk_user,";
294 $sql .=
" s.amount,";
295 $sql .=
" s.fk_projet as fk_project,";
296 $sql .=
" s.fk_typepayment,";
298 $sql .=
" s.datesp,";
299 $sql .=
" s.dateep,";
300 $sql .=
" s.note as note_private,";
301 $sql .=
" s.note_public,";
303 $sql .=
" s.fk_bank,";
304 $sql .=
" s.fk_user_author,";
305 $sql .=
" s.fk_user_modif,";
306 $sql .=
" s.fk_account,";
307 $sql .=
" cp.code as type_payment_code";
308 $sql .=
" FROM ".MAIN_DB_PREFIX.
"salary as s";
309 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank as b ON s.fk_bank = b.rowid";
310 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as cp ON s.fk_typepayment = cp.id";
311 $sql .=
" WHERE s.rowid = ".((int) $id);
313 dol_syslog(get_class($this).
"::fetch", LOG_DEBUG);
315 $resql = $this->db->query($sql);
317 if ($this->db->num_rows($resql)) {
318 $obj = $this->db->fetch_object($resql);
320 $this->
id = $obj->rowid;
321 $this->
ref = $obj->rowid;
322 $this->tms = $this->db->jdate($obj->tms);
323 $this->fk_user = $obj->fk_user;
324 $this->datep = $this->db->jdate($obj->datep);
325 $this->datev = $this->db->jdate($obj->datev);
326 $this->amount = $obj->amount;
327 $this->fk_project = $obj->fk_project;
328 $this->type_payment = $obj->fk_typepayment;
329 $this->type_payment_code = $obj->type_payment_code;
330 $this->label = $obj->label;
331 $this->datesp = $this->db->jdate($obj->datesp);
332 $this->dateep = $this->db->jdate($obj->dateep);
333 $this->note = $obj->note_private;
334 $this->note_private = $obj->note_private;
335 $this->note_public = $obj->note_public;
336 $this->paye = $obj->paye;
337 $this->
status = $obj->paye;
338 $this->fk_bank = $obj->fk_bank;
339 $this->fk_user_author = $obj->fk_user_author;
340 $this->fk_user_modif = $obj->fk_user_modif;
341 $this->fk_account = $obj->fk_account;
342 $this->accountid = $obj->fk_account;
348 $this->db->free($resql);
352 $this->error =
"Error ".$this->db->lasterror();
365 public function delete($user, $notrigger = 0)
392 $this->fk_user_author = 0;
393 $this->fk_user_modif = 0;
406 global
$conf, $langs;
412 $this->amount =
price2num(trim($this->amount));
413 $this->label = trim($this->label);
414 $this->note = trim($this->note);
415 $this->fk_bank = (int) $this->fk_bank;
416 $this->fk_user_author = (int) $this->fk_user_author;
417 $this->fk_user_modif = (int) $this->fk_user_modif;
418 $this->accountid = (int) $this->accountid;
419 $this->paye = (int) $this->paye;
423 $this->error = $langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Label"));
426 if ($this->fk_user < 0 || $this->fk_user ==
'') {
427 $this->error = $langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Employee"));
430 if ($this->amount ==
'') {
431 $this->error = $langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Amount"));
438 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.
"salary (fk_user";
442 $sql .=
", fk_projet";
444 $sql .=
", fk_typepayment";
445 $sql .=
", fk_account";
452 $sql .=
", fk_user_author";
458 $sql .=
"'".$this->db->escape($this->fk_user).
"'";
461 $sql .=
", ".((float) $this->amount);
462 $sql .=
", ".($this->fk_project > 0 ? ((int) $this->fk_project) : 0);
463 $sql .=
", ".($this->salary > 0 ? ((float) $this->salary) :
"null");
464 $sql .=
", ".($this->type_payment > 0 ? ((int) $this->type_payment) : 0);
465 $sql .=
", ".($this->accountid > 0 ? ((int) $this->accountid) :
"null");
467 $sql .=
", '".$this->db->escape($this->note).
"'";
469 $sql .=
", '".$this->db->escape($this->label).
"'";
470 $sql .=
", '".$this->db->idate($this->datesp).
"'";
471 $sql .=
", '".$this->db->idate($this->dateep).
"'";
472 $sql .=
", '".$this->db->escape($user->id).
"'";
473 $sql .=
", '".$this->db->idate($now).
"'";
475 $sql .=
", ".((int)
$conf->entity);
478 dol_syslog(get_class($this).
"::create", LOG_DEBUG);
479 $result = $this->db->query($sql);
481 $this->
id = $this->db->last_insert_id(MAIN_DB_PREFIX.
"salary");
506 $this->db->rollback();
510 $this->error = $this->db->error();
511 $this->db->rollback();
526 $sql =
'UPDATE '.MAIN_DB_PREFIX.
'salary SET fk_bank = '.((int) $id_bank);
527 $sql .=
" WHERE rowid = ".((int) $this->
id);
528 $result = $this->db->query($sql);
547 $langs->loadLangs([
'salaries']);
550 if (!empty($params[
'fromajaxtooltip']) && !isset($this->alreadypaid)) {
557 $datas[
'picto'] =
'<u>'.$langs->trans(
"Salary").
'</u>';
558 if (isset($this->
status) && isset($this->alreadypaid)) {
559 $datas[
'picto'] .=
' '.$this->getLibStatut(5, $this->alreadypaid);
561 $datas[
'ref'] =
'<br><b>'.$langs->trans(
'Ref').
':</b> '.$this->ref;
576 public function getNomUrl($withpicto = 0, $option =
'', $notooltip = 0, $morecss =
'', $save_lastsearch_value = -1)
578 global
$conf, $langs, $hookmanager;
580 if (!empty(
$conf->dol_no_mouse_hover)) {
587 'objecttype' => $this->element,
590 $classfortooltip =
'classfortooltip';
593 $classfortooltip =
'classforajaxtooltip';
594 $dataparams =
' data-params="'.dol_escape_htmltag(json_encode($params)).
'"';
600 $url = DOL_URL_ROOT.
'/salaries/card.php?id='.$this->id;
602 if ($option !=
'nolink') {
604 $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
605 if ($save_lastsearch_value == -1 && isset($_SERVER[
"PHP_SELF"]) && preg_match(
'/list\.php/', $_SERVER[
"PHP_SELF"])) {
606 $add_save_lastsearch_values = 1;
608 if ($add_save_lastsearch_values) {
609 $url .=
'&save_lastsearch_values=1';
614 if (empty($notooltip)) {
616 $label = $langs->trans(
"ShowMyObject");
617 $linkclose .=
' alt="'.dol_escape_htmltag($label, 1).
'"';
619 $linkclose .= ($label ?
' title="'.dol_escape_htmltag($label, 1).
'"' :
' title="tocomplete"');
620 $linkclose .= $dataparams.
' class="'.$classfortooltip.($morecss ?
' '.$morecss :
'').
'"';
622 $linkclose = ($morecss ?
' class="'.$morecss.
'"' :
'');
625 $linkstart =
'<a href="'.$url.
'"';
626 $linkstart .= $linkclose.
'>';
629 $result .= $linkstart;
631 $result .=
img_object(($notooltip ?
'' : $label), ($this->picto ? $this->picto :
'generic'), ($notooltip ? (($withpicto != 2) ?
'class="paddingright"' :
'') :
'class="'.(($withpicto != 2) ?
'paddingright ' :
'').
'"'), 0, 0, $notooltip ? 0 : 1);
633 if ($withpicto != 2) {
634 $result .= $this->ref;
639 global $action, $hookmanager;
640 $hookmanager->initHooks(array(
'salarypayment'));
641 $parameters = array(
'id' => $this->
id,
'getnomurl' => &$result);
642 $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action);
644 $result = $hookmanager->resPrint;
646 $result .= $hookmanager->resPrint;
660 $table =
'payment_salary';
661 $field =
'fk_salary';
663 $sql =
"SELECT sum(amount) as amount";
665 $sql .=
" FROM ".MAIN_DB_PREFIX.$table;
666 $sql .=
" WHERE ".$field.
" = ".((int) $this->
id);
668 dol_syslog(get_class($this).
"::getSommePaiement for salary id=".((
int) $this->
id), LOG_DEBUG);
670 $resql = $this->db->query($sql);
673 $obj = $this->db->fetch_object($resql);
675 $this->db->free($resql);
678 if ($multicurrency < 0) {
683 } elseif ($multicurrency) {
689 return (
float) $obj->amount;
695 $this->error = $this->db->lasterror();
708 $sql =
'SELECT ps.rowid, ps.datec, ps.tms as datem, ps.fk_user_author, ps.fk_user_modif';
709 $sql .=
' FROM '.MAIN_DB_PREFIX.
'salary as ps';
710 $sql .=
' WHERE ps.rowid = '.((int) $id);
712 dol_syslog(get_class($this).
'::info', LOG_DEBUG);
713 $result = $this->db->query($sql);
716 if ($this->db->num_rows($result)) {
717 $obj = $this->db->fetch_object($result);
719 $this->
id = $obj->rowid;
721 $this->user_creation_id = $obj->fk_user_author;
722 $this->user_modification_id = $obj->fk_user_modif;
723 $this->date_creation = $this->db->jdate($obj->datec);
724 $this->date_modification = empty($obj->datem) ?
'' : $this->db->jdate($obj->datem);
726 $this->db->free($result);
744 dol_syslog(get_class($this).
"::set_paid is deprecated, use setPaid instead", LOG_NOTICE);
756 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"salary SET";
758 $sql .=
" WHERE rowid = ".((int) $this->
id);
760 $return = $this->db->query($sql);
780 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"salary SET";
782 $sql .=
" WHERE rowid = ".((int) $this->
id);
784 $return = $this->db->query($sql);
804 return $this->
LibStatut($this->paye, $mode, $alreadypaid);
816 public function LibStatut($status, $mode = 0, $alreadypaid = -1)
822 $langs->loadLangs(array(
"customers",
"bills"));
825 $this->labelStatus = array();
826 $this->labelStatusShort = array();
828 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
831 $this->labelStatus[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv(
'BillStatusNotPaid');
832 $this->labelStatus[self::STATUS_PAID] = $langs->transnoentitiesnoconv(
'BillStatusPaid');
833 if ($status == self::STATUS_UNPAID && $alreadypaid != 0) {
834 $this->labelStatus[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv(
"BillStatusStarted");
836 $this->labelStatusShort[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv(
'BillStatusNotPaid');
837 $this->labelStatusShort[self::STATUS_PAID] = $langs->transnoentitiesnoconv(
'BillStatusPaid');
838 if ($status == self::STATUS_UNPAID && $alreadypaid != 0) {
839 $this->labelStatusShort[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv(
"BillStatusStarted");
843 $statusType =
'status1';
844 if ($status == 0 && $alreadypaid != 0) {
845 $statusType =
'status3';
848 $statusType =
'status6';
851 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
865 $selected = (empty($arraydata[
'selected']) ? 0 : $arraydata[
'selected']);
867 $return =
'<div class="box-flex-item box-flex-grow-zero">';
868 $return .=
'<div class="info-box info-box-sm">';
869 $return .=
'<span class="info-box-icon bg-infobox-action">';
871 $return .=
'</span>';
872 $return .=
'<div class="info-box-content">';
873 $return .=
'<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.(method_exists($this,
'getNomUrl') ? $this->
getNomUrl(1) : $this->ref).
'</span>';
874 if ($selected >= 0) {
875 $return .=
'<input id="cb'.$this->id.
'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->
id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
877 if (!empty($arraydata[
'user']) && is_object($arraydata[
'user'])) {
878 $user = $arraydata[
'user'];
879 '@phan-var-force User $user';
880 $return .=
'<br><span class="info-box-label">'.$user->getNomUrl(empty($arraydata[
'user']->photo) ? 1 : -1,
'', 0, 0, 16, 0,
'',
'maxwidth100').
'</span>';
882 if (property_exists($this,
'amount')) {
883 $return .=
'<br><span class="info-box-label amount">'.price($this->amount).
'</span>';
884 if (property_exists($this,
'type_payment') && !empty($this->type_payment)) {
885 $return .=
' <span class="info-box-label opacitymedium small">';
886 if ($langs->trans(
"PaymentTypeShort".$this->type_payment) !=
"PaymentTypeShort".$this->type_payment) {
887 $return .= $langs->trans(
"PaymentTypeShort".$this->type_payment);
888 } elseif ($langs->trans(
"PaymentType".$this->type_payment) !=
"PaymentType".$this->type_payment) {
889 $return .= $langs->trans(
"PaymentType".$this->type_payment);
891 $return .=
'</span>';
894 if (method_exists($this,
'LibStatut')) {
895 $return .=
'<br><div class="info-box-status">'.$this->getLibStatut(3, isset($this->alreadypaid) ? $this->alreadypaid : $this->totalpaid).
'</div>';
915 public function demande_prelevement($fuser, $amount = 0, $type =
'direct-debit', $sourcetype =
'salaire', $checkduplicateamongall = 0)
918 global
$conf, $mysoc;
922 dol_syslog(get_class($this).
"::demande_prelevement", LOG_DEBUG);
923 if ($this->paye == 0) {
924 require_once DOL_DOCUMENT_ROOT.
'/societe/class/companybankaccount.class.php';
927 $bac->fetch(0,
'', $mysoc->id);
929 $sql =
"SELECT count(rowid) as nb";
930 $sql .=
" FROM ".$this->db->prefix().
"prelevement_demande";
931 if ($type ==
'salaire') {
932 $sql .=
" WHERE fk_salary = ".((int) $this->
id);
934 $sql .=
" WHERE fk_facture = ".((int) $this->
id);
936 $sql .=
" AND type = 'ban'";
937 if (empty($checkduplicateamongall)) {
938 $sql .=
" AND traite = 0";
941 dol_syslog(get_class($this).
"::demande_prelevement", LOG_DEBUG);
943 $resql = $this->db->query($sql);
945 $obj = $this->db->fetch_object($resql);
946 if ($obj && $obj->nb == 0) {
962 if (is_numeric($amount) && $amount != 0) {
963 $sql =
'INSERT INTO '.$this->db->prefix().
'prelevement_demande(';
964 if ($type ==
'salaire') {
965 $sql .=
'fk_salary, ';
967 $sql .=
'fk_facture, ';
969 $sql .=
' amount, date_demande, fk_user_demande, code_banque, code_guichet, number, cle_rib, sourcetype, type, entity)';
970 $sql .=
" VALUES (".((int) $this->
id);
971 $sql .=
", ".((float)
price2num($amount));
972 $sql .=
", '".$this->db->idate($now).
"'";
973 $sql .=
", ".((int) $fuser->id);
974 $sql .=
", '".$this->db->escape($bac->code_banque).
"'";
975 $sql .=
", '".$this->db->escape($bac->code_guichet).
"'";
976 $sql .=
", '".$this->db->escape($bac->number).
"'";
977 $sql .=
", '".$this->db->escape($bac->cle_rib).
"'";
978 $sql .=
", '".$this->db->escape($sourcetype).
"'";
980 $sql .=
", ".((int)
$conf->entity);
983 dol_syslog(get_class($this).
"::demande_prelevement", LOG_DEBUG);
984 $resql = $this->db->query($sql);
986 $this->error = $this->db->lasterror();
987 dol_syslog(get_class($this).
'::demandeprelevement Erreur');
991 $this->error =
'WithdrawRequestErrorNilAmount';
992 dol_syslog(get_class($this).
'::demandeprelevement WithdrawRequestErrorNilAmount');
998 $payment_mode_id =
dol_getIdFromCode($this->db, ($type ==
'bank-transfer' ?
'VIR' :
'PRE'),
'c_paiement',
'code',
'id', 1);
999 if ($payment_mode_id > 0) {
1009 $this->error =
"A request already exists";
1010 dol_syslog(get_class($this).
'::demandeprelevement Can t create a request to generate a direct debit, a request already exists.');
1014 $this->error = $this->db->error();
1015 dol_syslog(get_class($this).
'::demandeprelevement Error -2');
1019 $this->error =
"Status of invoice does not allow this";
1020 dol_syslog(get_class($this).
"::demandeprelevement ".$this->error.
" $this->status, $this->paye, $this->mode_reglement_id");
1036 $sql =
'DELETE FROM '.$this->db->prefix().
'prelevement_demande';
1037 $sql .=
' WHERE rowid = '.((int) $did);
1038 $sql .=
' AND traite = 0';
1039 if ($this->db->query($sql)) {
1042 $this->error = $this->db->lasterror();
1043 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...
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_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_getIdFromCode($db, $key, $tablename, $fieldkey='code', $fieldid='id', $entityfilter=0, $filters='')
Return an id or code from a code or id.
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...