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;
135 public $fk_user_author;
140 public $fk_user_modif;
153 const STATUS_UNPAID = 0;
154 const STATUS_PAID = 1;
161 public $fields = array(
162 'rowid' => array(
'type' =>
'integer',
'label' =>
'TechnicalID',
'enabled' => 1,
'visible' => 0,
'notnull' => 1,
'index' => 1,
'position' => 1,
'comment' =>
'Id'),
163 'ref' => array(
'type' =>
'varchar(128)',
'label' =>
'Ref',
'enabled' => 1,
'position' => 10,
'visible' => 1,
'index' => 1,
'comment' =>
"Reference of object"),
164 'label' => array(
'type' =>
'varchar(255)',
'label' =>
'Label',
'enabled' => 1,
'position' => 12,
'notnull' => 0,
'visible' => 1),
165 'datec' => array(
'type' =>
'datetime',
'label' =>
'DateCreation',
'enabled' => 1,
'visible' => 0,
'position' => 30),
166 'datep' => array(
'type' =>
'date',
'label' =>
'Date',
'enabled' => 1,
'visible' => 0,
'position' => 40,
'comment' =>
'Date'),
167 'datev' => array(
'type' =>
'date',
'label' =>
'Date',
'enabled' => 1,
'visible' => 0,
'position' => 50,
'comment' =>
'Date'),
168 'fk_user' => array(
'type' =>
'integer:User:user/class/user.class.php',
'label' =>
'Employee',
'enabled' => 1,
'position' => 15,
'notnull' => 1,
'visible' => 1,
'picto' =>
'user'),
169 'tms' => array(
'type' =>
'timestamp',
'label' =>
'DateModification',
'enabled' => 1,
'visible' => 0,
'notnull' => 1,
'position' => 20),
170 'salary' => array(
'type' =>
'double(24,8)',
'label' =>
'salary',
'enabled' => 1,
'visible' => 0,
'position' => 70),
171 'amount' => array(
'type' =>
'double(24,8)',
'label' =>
'Amount',
'enabled' => 1,
'visible' => 1,
'notnull' => 1,
'position' => 80),
172 'fk_projet' => array(
'type' =>
'integer:Project:projet/class/project.class.php:1:(fk_statut:=:1)',
'label' =>
'Project',
'enabled' =>
"isModEnabled('project')",
'visible' => 0,
'position' => 90),
173 'fk_typepayment' => array(
'type' =>
'typepayment',
'label' =>
'DefaultPaymentMode',
'enabled' => 1,
'visible' => 1,
'position' => 100,
'comment' =>
'Payment type'),
174 'num_payment' => array(
'type' =>
'string',
'label' =>
'Reference',
'enabled' => 1,
'visible' => 0,
'position' => 110,
'comment' =>
'Reference'),
175 'datesp' => array(
'type' =>
'date',
'label' =>
'DateStart',
'enabled' => 1,
'visible' => 1,
'position' => 130,
'comment' =>
'Date'),
176 'dateep' => array(
'type' =>
'date',
'label' =>
'DateEnd',
'enabled' => 1,
'visible' => 1,
'position' => 140,
'comment' =>
'Date'),
177 'entity' => array(
'type' =>
'integer',
'label' =>
'Entity',
'default' =>
'1',
'enabled' => 1,
'visible' => 0,
'position' => 150,
'index' => 1),
178 'note' => array(
'type' =>
'text',
'label' =>
'Note',
'enabled' => 1,
'position' => 160,
'visible' => 0,),
179 'fk_bank' => array(
'type' =>
'integer',
'label' =>
'BankId',
'enabled' => 1,
'visible' => 0,
'position' => 170),
180 'paye' => array(
'type' =>
'smallint(6)',
'label' =>
'Status',
'enabled' => 1,
'visible' => 1,
'notnull' => 1,
'position' => 180),
181 'fk_user_author' => array(
'type' =>
'integer:User:user/class/user.class.php',
'label' =>
'UserAuthor',
'enabled' => 1,
'visible' => 0,
'position' => 190),
182 'fk_user_modif' => array(
'type' =>
'integer:User:user/class/user.class.php',
'label' =>
'UserModif',
'enabled' => 1,
'position' => 200,
'visible' => 0,),
183 'ref_ext' => array(
'type' =>
'varchar(128)',
'label' =>
'Ref ext',
'enabled' => 1,
'visible' => 0,
'position' => 210),
184 'note_public' => array(
'type' =>
'text',
'label' =>
'NotePublic',
'enabled' => 1,
'visible' => 0,
'position' => 220),
196 $this->element =
'salary';
197 $this->table_element =
'salary';
207 public function update($user =
null, $notrigger = 0)
212 $this->amount = trim($this->amount);
213 $this->label = trim($this->label);
214 $this->note = trim($this->note);
215 $this->note_private = trim($this->note_private);
216 $this->note_public = trim($this->note_public);
219 if (empty($this->fk_user) || $this->fk_user < 0) {
220 $this->error =
'ErrorBadParameter';
227 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"salary SET";
228 $sql .=
" tms='".$this->db->idate(
dol_now()).
"',";
229 $sql .=
" fk_user=".((int) $this->fk_user).
",";
232 $sql .=
" amount=".price2num($this->amount).
",";
233 $sql .=
" fk_projet=".((int) $this->fk_project).
",";
234 $sql .=
" fk_typepayment=".((int) $this->type_payment).
",";
235 $sql .=
" label='".$this->db->escape($this->label).
"',";
236 $sql .=
" datesp='".$this->db->idate($this->datesp).
"',";
237 $sql .=
" dateep='".$this->db->idate($this->dateep).
"',";
238 $sql .=
" note='".$this->db->escape($this->note).
"',";
239 $sql .=
" fk_bank=".($this->fk_bank > 0 ? (int) $this->fk_bank :
"null").
",";
240 $sql .=
" fk_user_author=".((int) $this->fk_user_author).
",";
241 $sql .=
" fk_user_modif=".($this->fk_user_modif > 0 ? (int) $this->fk_user_modif : (int) $user->id);
242 $sql .=
" WHERE rowid=".((int) $this->
id);
244 dol_syslog(get_class($this).
"::update", LOG_DEBUG);
245 $resql = $this->db->query($sql);
247 $this->error =
"Error ".$this->db->lasterror();
272 $this->db->rollback();
285 public function fetch($id, $user =
null)
290 $sql .=
" s.fk_user,";
293 $sql .=
" s.amount,";
294 $sql .=
" s.fk_projet as fk_project,";
295 $sql .=
" s.fk_typepayment,";
297 $sql .=
" s.datesp,";
298 $sql .=
" s.dateep,";
299 $sql .=
" s.note as note_private,";
300 $sql .=
" s.note_public,";
302 $sql .=
" s.fk_bank,";
303 $sql .=
" s.fk_user_author,";
304 $sql .=
" s.fk_user_modif,";
305 $sql .=
" s.fk_account,";
306 $sql .=
" cp.code as type_payment_code";
307 $sql .=
" FROM ".MAIN_DB_PREFIX.
"salary as s";
308 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"bank as b ON s.fk_bank = b.rowid";
309 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as cp ON s.fk_typepayment = cp.id";
310 $sql .=
" WHERE s.rowid = ".((int) $id);
312 dol_syslog(get_class($this).
"::fetch", LOG_DEBUG);
314 $resql = $this->db->query($sql);
316 if ($this->db->num_rows($resql)) {
317 $obj = $this->db->fetch_object($resql);
319 $this->
id = $obj->rowid;
320 $this->
ref = $obj->rowid;
321 $this->tms = $this->db->jdate($obj->tms);
322 $this->fk_user = $obj->fk_user;
323 $this->datep = $this->db->jdate($obj->datep);
324 $this->datev = $this->db->jdate($obj->datev);
325 $this->amount = $obj->amount;
326 $this->fk_project = $obj->fk_project;
327 $this->type_payment = $obj->fk_typepayment;
328 $this->type_payment_code = $obj->type_payment_code;
329 $this->label = $obj->label;
330 $this->datesp = $this->db->jdate($obj->datesp);
331 $this->dateep = $this->db->jdate($obj->dateep);
332 $this->note = $obj->note_private;
333 $this->note_private = $obj->note_private;
334 $this->note_public = $obj->note_public;
335 $this->paye = $obj->paye;
336 $this->
status = $obj->paye;
337 $this->fk_bank = $obj->fk_bank;
338 $this->fk_user_author = $obj->fk_user_author;
339 $this->fk_user_modif = $obj->fk_user_modif;
340 $this->fk_account = $obj->fk_account;
341 $this->accountid = $obj->fk_account;
347 $this->db->free($resql);
351 $this->error =
"Error ".$this->db->lasterror();
364 public function delete($user, $notrigger = 0)
391 $this->fk_user_author = 0;
392 $this->fk_user_modif = 0;
405 global $conf, $langs;
411 $this->amount =
price2num(trim($this->amount));
412 $this->label = trim($this->label);
413 $this->note = trim($this->note);
414 $this->fk_bank = (int) $this->fk_bank;
415 $this->fk_user_author = (int) $this->fk_user_author;
416 $this->fk_user_modif = (int) $this->fk_user_modif;
417 $this->accountid = (int) $this->accountid;
418 $this->paye = (int) $this->paye;
422 $this->error = $langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Label"));
425 if ($this->fk_user < 0 || $this->fk_user ==
'') {
426 $this->error = $langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Employee"));
429 if ($this->amount ==
'') {
430 $this->error = $langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Amount"));
437 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.
"salary (fk_user";
441 $sql .=
", fk_projet";
443 $sql .=
", fk_typepayment";
444 $sql .=
", fk_account";
451 $sql .=
", fk_user_author";
457 $sql .=
"'".$this->db->escape($this->fk_user).
"'";
460 $sql .=
", ".((float) $this->amount);
461 $sql .=
", ".($this->fk_project > 0 ? ((int) $this->fk_project) : 0);
462 $sql .=
", ".($this->salary > 0 ? ((float) $this->salary) :
"null");
463 $sql .=
", ".($this->type_payment > 0 ? ((int) $this->type_payment) : 0);
464 $sql .=
", ".($this->accountid > 0 ? ((int) $this->accountid) :
"null");
466 $sql .=
", '".$this->db->escape($this->note).
"'";
468 $sql .=
", '".$this->db->escape($this->label).
"'";
469 $sql .=
", '".$this->db->idate($this->datesp).
"'";
470 $sql .=
", '".$this->db->idate($this->dateep).
"'";
471 $sql .=
", '".$this->db->escape($user->id).
"'";
472 $sql .=
", '".$this->db->idate($now).
"'";
474 $sql .=
", ".((int) $conf->entity);
477 dol_syslog(get_class($this).
"::create", LOG_DEBUG);
478 $result = $this->db->query($sql);
480 $this->
id = $this->db->last_insert_id(MAIN_DB_PREFIX.
"salary");
505 $this->db->rollback();
509 $this->error = $this->db->error();
510 $this->db->rollback();
525 $sql =
'UPDATE '.MAIN_DB_PREFIX.
'salary SET fk_bank = '.((int) $id_bank);
526 $sql .=
" WHERE rowid = ".((int) $this->
id);
527 $result = $this->db->query($sql);
546 $langs->loadLangs([
'salaries']);
549 if (!empty($params[
'fromajaxtooltip']) && !isset($this->alreadypaid)) {
556 $datas[
'picto'] =
'<u>'.$langs->trans(
"Salary").
'</u>';
557 if (isset($this->
status) && isset($this->alreadypaid)) {
558 $datas[
'picto'] .=
' '.$this->getLibStatut(5, $this->alreadypaid);
560 $datas[
'ref'] =
'<br><b>'.$langs->trans(
'Ref').
':</b> '.$this->ref;
575 public function getNomUrl($withpicto = 0, $option =
'', $notooltip = 0, $morecss =
'', $save_lastsearch_value = -1)
577 global $conf, $langs, $hookmanager;
579 if (!empty($conf->dol_no_mouse_hover)) {
586 'objecttype' => $this->element,
589 $classfortooltip =
'classfortooltip';
592 $classfortooltip =
'classforajaxtooltip';
593 $dataparams =
' data-params="'.dol_escape_htmltag(json_encode($params)).
'"';
599 $url = DOL_URL_ROOT.
'/salaries/card.php?id='.$this->id;
601 if ($option !=
'nolink') {
603 $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
604 if ($save_lastsearch_value == -1 && isset($_SERVER[
"PHP_SELF"]) && preg_match(
'/list\.php/', $_SERVER[
"PHP_SELF"])) {
605 $add_save_lastsearch_values = 1;
607 if ($add_save_lastsearch_values) {
608 $url .=
'&save_lastsearch_values=1';
613 if (empty($notooltip)) {
615 $label = $langs->trans(
"ShowMyObject");
616 $linkclose .=
' alt="'.dol_escape_htmltag($label, 1).
'"';
618 $linkclose .= ($label ?
' title="'.dol_escape_htmltag($label, 1).
'"' :
' title="tocomplete"');
619 $linkclose .= $dataparams.
' class="'.$classfortooltip.($morecss ?
' '.$morecss :
'').
'"';
621 $linkclose = ($morecss ?
' class="'.$morecss.
'"' :
'');
624 $linkstart =
'<a href="'.$url.
'"';
625 $linkstart .= $linkclose.
'>';
628 $result .= $linkstart;
630 $result .=
img_object(($notooltip ?
'' : $label), ($this->picto ? $this->picto :
'generic'), ($notooltip ? (($withpicto != 2) ?
'class="paddingright"' :
'') :
'class="'.(($withpicto != 2) ?
'paddingright ' :
'').
'"'), 0, 0, $notooltip ? 0 : 1);
632 if ($withpicto != 2) {
633 $result .= $this->ref;
638 global $action, $hookmanager;
639 $hookmanager->initHooks(array(
'salarypayment'));
640 $parameters = array(
'id' => $this->
id,
'getnomurl' => &$result);
641 $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action);
643 $result = $hookmanager->resPrint;
645 $result .= $hookmanager->resPrint;
659 $table =
'payment_salary';
660 $field =
'fk_salary';
662 $sql =
"SELECT sum(amount) as amount";
664 $sql .=
" FROM ".MAIN_DB_PREFIX.$table;
665 $sql .=
" WHERE ".$field.
" = ".((int) $this->
id);
667 dol_syslog(get_class($this).
"::getSommePaiement for salary id=".((
int) $this->
id), LOG_DEBUG);
669 $resql = $this->db->query($sql);
672 $obj = $this->db->fetch_object($resql);
674 $this->db->free($resql);
677 if ($multicurrency < 0) {
682 } elseif ($multicurrency) {
688 return (
float) $obj->amount;
694 $this->error = $this->db->lasterror();
707 $sql =
'SELECT ps.rowid, ps.datec, ps.tms as datem, ps.fk_user_author, ps.fk_user_modif';
708 $sql .=
' FROM '.MAIN_DB_PREFIX.
'salary as ps';
709 $sql .=
' WHERE ps.rowid = '.((int) $id);
711 dol_syslog(get_class($this).
'::info', LOG_DEBUG);
712 $result = $this->db->query($sql);
715 if ($this->db->num_rows($result)) {
716 $obj = $this->db->fetch_object($result);
718 $this->
id = $obj->rowid;
720 $this->user_creation_id = $obj->fk_user_author;
721 $this->user_modification_id = $obj->fk_user_modif;
722 $this->date_creation = $this->db->jdate($obj->datec);
723 $this->date_modification = empty($obj->datem) ?
'' : $this->db->jdate($obj->datem);
725 $this->db->free($result);
743 dol_syslog(get_class($this).
"::set_paid is deprecated, use setPaid instead", LOG_NOTICE);
755 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"salary SET";
757 $sql .=
" WHERE rowid = ".((int) $this->
id);
759 $return = $this->db->query($sql);
779 $sql =
"UPDATE ".MAIN_DB_PREFIX.
"salary SET";
781 $sql .=
" WHERE rowid = ".((int) $this->
id);
783 $return = $this->db->query($sql);
803 return $this->
LibStatut($this->paye, $mode, $alreadypaid);
815 public function LibStatut($status, $mode = 0, $alreadypaid = -1)
821 $langs->loadLangs(array(
"customers",
"bills"));
824 $this->labelStatus = array();
825 $this->labelStatusShort = array();
827 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
830 $this->labelStatus[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv(
'BillStatusNotPaid');
831 $this->labelStatus[self::STATUS_PAID] = $langs->transnoentitiesnoconv(
'BillStatusPaid');
832 if ($status == self::STATUS_UNPAID && $alreadypaid != 0) {
833 $this->labelStatus[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv(
"BillStatusStarted");
835 $this->labelStatusShort[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv(
'BillStatusNotPaid');
836 $this->labelStatusShort[self::STATUS_PAID] = $langs->transnoentitiesnoconv(
'BillStatusPaid');
837 if ($status == self::STATUS_UNPAID && $alreadypaid != 0) {
838 $this->labelStatusShort[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv(
"BillStatusStarted");
842 $statusType =
'status1';
843 if ($status == 0 && $alreadypaid != 0) {
844 $statusType =
'status3';
847 $statusType =
'status6';
850 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
864 $selected = (empty($arraydata[
'selected']) ? 0 : $arraydata[
'selected']);
866 $return =
'<div class="box-flex-item box-flex-grow-zero">';
867 $return .=
'<div class="info-box info-box-sm">';
868 $return .=
'<span class="info-box-icon bg-infobox-action">';
870 $return .=
'</span>';
871 $return .=
'<div class="info-box-content">';
872 $return .=
'<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.(method_exists($this,
'getNomUrl') ? $this->
getNomUrl(1) : $this->ref).
'</span>';
873 if ($selected >= 0) {
874 $return .=
'<input id="cb'.$this->id.
'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->
id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
876 if (!empty($arraydata[
'user']) && is_object($arraydata[
'user'])) {
877 $user = $arraydata[
'user'];
878 '@phan-var-force User $user';
879 $return .=
'<br><span class="info-box-label">'.$user->getNomUrl(empty($arraydata[
'user']->photo) ? 1 : -1,
'', 0, 0, 16, 0,
'',
'maxwidth100').
'</span>';
881 if (property_exists($this,
'amount')) {
882 $return .=
'<br><span class="info-box-label amount">'.price($this->amount).
'</span>';
883 if (property_exists($this,
'type_payment') && !empty($this->type_payment)) {
884 $return .=
' <span class="info-box-label opacitymedium small">';
885 if ($langs->trans(
"PaymentTypeShort".$this->type_payment) !=
"PaymentTypeShort".$this->type_payment) {
886 $return .= $langs->trans(
"PaymentTypeShort".$this->type_payment);
887 } elseif ($langs->trans(
"PaymentType".$this->type_payment) !=
"PaymentType".$this->type_payment) {
888 $return .= $langs->trans(
"PaymentType".$this->type_payment);
890 $return .=
'</span>';
893 if (method_exists($this,
'LibStatut')) {
894 $return .=
'<br><div class="info-box-status">'.$this->getLibStatut(3, isset($this->alreadypaid) ? $this->alreadypaid : $this->totalpaid).
'</div>';
914 public function demande_prelevement($fuser, $amount = 0, $type =
'direct-debit', $sourcetype =
'salaire', $checkduplicateamongall = 0)
917 global $conf, $mysoc;
921 dol_syslog(get_class($this).
"::demande_prelevement", LOG_DEBUG);
922 if ($this->paye == 0) {
923 require_once DOL_DOCUMENT_ROOT.
'/societe/class/companybankaccount.class.php';
926 $bac->fetch(0,
'', $mysoc->id);
928 $sql =
"SELECT count(rowid) as nb";
929 $sql .=
" FROM ".$this->db->prefix().
"prelevement_demande";
930 if ($type ==
'salaire') {
931 $sql .=
" WHERE fk_salary = ".((int) $this->
id);
933 $sql .=
" WHERE fk_facture = ".((int) $this->
id);
935 $sql .=
" AND type = 'ban'";
936 if (empty($checkduplicateamongall)) {
937 $sql .=
" AND traite = 0";
940 dol_syslog(get_class($this).
"::demande_prelevement", LOG_DEBUG);
942 $resql = $this->db->query($sql);
944 $obj = $this->db->fetch_object($resql);
945 if ($obj && $obj->nb == 0) {
961 if (is_numeric($amount) && $amount != 0) {
962 $sql =
'INSERT INTO '.$this->db->prefix().
'prelevement_demande(';
963 if ($type ==
'salaire') {
964 $sql .=
'fk_salary, ';
966 $sql .=
'fk_facture, ';
968 $sql .=
' amount, date_demande, fk_user_demande, code_banque, code_guichet, number, cle_rib, sourcetype, type, entity)';
969 $sql .=
" VALUES (".((int) $this->
id);
970 $sql .=
", ".((float)
price2num($amount));
971 $sql .=
", '".$this->db->idate($now).
"'";
972 $sql .=
", ".((int) $fuser->id);
973 $sql .=
", '".$this->db->escape($bac->code_banque).
"'";
974 $sql .=
", '".$this->db->escape($bac->code_guichet).
"'";
975 $sql .=
", '".$this->db->escape($bac->number).
"'";
976 $sql .=
", '".$this->db->escape($bac->cle_rib).
"'";
977 $sql .=
", '".$this->db->escape($sourcetype).
"'";
979 $sql .=
", ".((int) $conf->entity);
982 dol_syslog(get_class($this).
"::demande_prelevement", LOG_DEBUG);
983 $resql = $this->db->query($sql);
985 $this->error = $this->db->lasterror();
986 dol_syslog(get_class($this).
'::demandeprelevement Erreur');
990 $this->error =
'WithdrawRequestErrorNilAmount';
991 dol_syslog(get_class($this).
'::demandeprelevement WithdrawRequestErrorNilAmount');
997 $payment_mode_id =
dol_getIdFromCode($this->db, ($type ==
'bank-transfer' ?
'VIR' :
'PRE'),
'c_paiement',
'code',
'id', 1);
998 if ($payment_mode_id > 0) {
1008 $this->error =
"A request already exists";
1009 dol_syslog(get_class($this).
'::demandeprelevement Can t create a request to generate a direct debit, a request already exists.');
1013 $this->error = $this->db->error();
1014 dol_syslog(get_class($this).
'::demandeprelevement Error -2');
1018 $this->error =
"Status of invoice does not allow this";
1019 dol_syslog(get_class($this).
"::demandeprelevement ".$this->error.
" $this->status, $this->paye, $this->mode_reglement_id");
1035 $sql =
'DELETE FROM '.$this->db->prefix().
'prelevement_demande';
1036 $sql .=
' WHERE rowid = '.((int) $did);
1037 $sql .=
' AND traite = 0';
1038 if ($this->db->query($sql)) {
1041 $this->error = $this->db->lasterror();
1042 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.
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.