dolibarr 19.0.3
paymentvarious.class.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2017-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
3 * Copyright (C) 2018-2023 Frédéric France <frederic.france@netlogic.fr>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 */
18
25// Put here all includes required by your class file
26require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
27
28
33{
37 public $element = 'payment_various';
38
42 public $table_element = 'payment_various';
43
47 public $picto = 'payment';
48
52 public $id;
53
57 public $ref;
58
62 public $tms;
63 public $datep;
64 public $datev;
65
69 public $sens;
70 public $amount;
71 public $type_payment;
72 public $num_payment;
73 public $chqemetteur;
74 public $chqbank;
75 public $category_transaction;
76
80 public $label;
81
85 public $accountancy_code;
86
90 public $subledger_account;
91
95 public $fk_project;
96
100 public $fk_account;
101
106 public $accountid;
107
111 public $fk_bank;
112
116 public $categorie_transaction;
117
121 public $fk_user_author;
122
126 public $fk_user_modif;
127
128
132 public $fk_type;
133
137 public $rappro;
138
142 public $bank_num_releve;
143
144
170 // BEGIN MODULEBUILDER PROPERTIES
174 public $fields = array(
175 // TODO: fill this array
176 );
177 // END MODULEBUILDER PROPERTIES
178
182 const STATUS_DRAFT = 0;
183
184
190 public function __construct(DoliDB $db)
191 {
192 $this->db = $db;
193 }
194
202 public function update($user = null, $notrigger = 0)
203 {
204 global $conf, $langs;
205
206 $error = 0;
207
208 // Clean parameters
209 $this->amount = trim($this->amount);
210 $this->label = trim($this->label);
211 $this->note = trim($this->note);
212 $this->fk_bank = (int) $this->fk_bank;
213 $this->fk_user_author = (int) $this->fk_user_author;
214 $this->fk_user_modif = (int) $this->fk_user_modif;
215
216 $this->db->begin();
217
218 // Update request
219 $sql = "UPDATE ".MAIN_DB_PREFIX."payment_various SET";
220 if ($this->tms) {
221 $sql .= " tms='".$this->db->idate($this->tms)."',";
222 }
223 $sql .= " datep='".$this->db->idate($this->datep)."',";
224 $sql .= " datev='".$this->db->idate($this->datev)."',";
225 $sql .= " sens=".(int) $this->sens.",";
226 $sql .= " amount=".price2num($this->amount).",";
227 $sql .= " fk_typepayment=".(int) $this->type_payment.",";
228 $sql .= " num_payment='".$this->db->escape($this->num_payment)."',";
229 $sql .= " label='".$this->db->escape($this->label)."',";
230 $sql .= " note='".$this->db->escape($this->note)."',";
231 $sql .= " accountancy_code='".$this->db->escape($this->accountancy_code)."',";
232 $sql .= " subledger_account='".$this->db->escape($this->subledger_account)."',";
233 $sql .= " fk_projet='".$this->db->escape($this->fk_project)."',";
234 $sql .= " fk_bank=".($this->fk_bank > 0 ? $this->fk_bank : "null").",";
235 $sql .= " fk_user_author=".(int) $this->fk_user_author.",";
236 $sql .= " fk_user_modif=".(int) $this->fk_user_modif;
237 $sql .= " WHERE rowid=".((int) $this->id);
238
239 dol_syslog(get_class($this)."::update", LOG_DEBUG);
240 $resql = $this->db->query($sql);
241 if (!$resql) {
242 $this->error = "Error ".$this->db->lasterror();
243 return -1;
244 }
245
246 if (!$notrigger) {
247 // Call trigger
248 $result = $this->call_trigger('PAYMENT_VARIOUS_MODIFY', $user);
249 if ($result < 0) {
250 $error++;
251 }
252 // End call triggers
253 }
254
255 if (!$error) {
256 $this->db->commit();
257 return 1;
258 } else {
259 $this->db->rollback();
260 return -1;
261 }
262 }
263
264
272 public function fetch($id, $user = null)
273 {
274 $sql = "SELECT";
275 $sql .= " v.rowid,";
276 $sql .= " v.tms,";
277 $sql .= " v.datep,";
278 $sql .= " v.datev,";
279 $sql .= " v.sens,";
280 $sql .= " v.amount,";
281 $sql .= " v.fk_typepayment,";
282 $sql .= " v.num_payment,";
283 $sql .= " v.label,";
284 $sql .= " v.note as note_private,";
285 $sql .= " v.accountancy_code,";
286 $sql .= " v.subledger_account,";
287 $sql .= " v.fk_projet as fk_project,";
288 $sql .= " v.fk_bank,";
289 $sql .= " v.fk_user_author,";
290 $sql .= " v.fk_user_modif,";
291 $sql .= " b.fk_account,";
292 $sql .= " b.fk_type,";
293 $sql .= " b.rappro,";
294 $sql .= " b.num_releve as bank_num_releve";
295 $sql .= " FROM ".MAIN_DB_PREFIX."payment_various as v";
296 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON v.fk_bank = b.rowid";
297 $sql .= " WHERE v.rowid = ".((int) $id);
298
299 dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
300 $resql = $this->db->query($sql);
301 if ($resql) {
302 if ($this->db->num_rows($resql)) {
303 $obj = $this->db->fetch_object($resql);
304
305 $this->id = $obj->rowid;
306 $this->ref = $obj->rowid;
307 $this->tms = $this->db->jdate($obj->tms);
308 $this->datep = $this->db->jdate($obj->datep);
309 $this->datev = $this->db->jdate($obj->datev);
310 $this->sens = $obj->sens;
311 $this->amount = $obj->amount;
312 $this->type_payment = $obj->fk_typepayment;
313 $this->num_payment = $obj->num_payment;
314 $this->label = $obj->label;
315 $this->note = $obj->note_private; // For backward compatibility
316 $this->note_private = $obj->note_private;
317 $this->subledger_account = $obj->subledger_account;
318 $this->accountancy_code = $obj->accountancy_code;
319 $this->fk_project = $obj->fk_project;
320 $this->fk_bank = $obj->fk_bank;
321 $this->fk_user_author = $obj->fk_user_author;
322 $this->fk_user_modif = $obj->fk_user_modif;
323 $this->fk_account = $obj->fk_account;
324 $this->fk_type = $obj->fk_type;
325 $this->rappro = $obj->rappro;
326 $this->bank_num_releve = $obj->bank_num_releve;
327 }
328 $this->db->free($resql);
329
330 return 1;
331 } else {
332 $this->error = "Error ".$this->db->lasterror();
333 return -1;
334 }
335 }
336
337
344 public function delete($user)
345 {
346 global $conf, $langs;
347
348 $error = 0;
349
350 // Call trigger
351 $result = $this->call_trigger('PAYMENT_VARIOUS_DELETE', $user);
352 if ($result < 0) {
353 return -1;
354 }
355 // End call triggers
356
357
358 $sql = "DELETE FROM ".MAIN_DB_PREFIX."payment_various";
359 $sql .= " WHERE rowid=".((int) $this->id);
360
361 dol_syslog(get_class($this)."::delete", LOG_DEBUG);
362 $resql = $this->db->query($sql);
363 if (!$resql) {
364 $this->error = "Error ".$this->db->lasterror();
365 return -1;
366 }
367
368 return 1;
369 }
370
371
379 public function initAsSpecimen()
380 {
381 $this->id = 0;
382
383 $this->tms = '';
384 $this->datep = '';
385 $this->datev = '';
386 $this->sens = '';
387 $this->amount = '';
388 $this->label = '';
389 $this->accountancy_code = '';
390 $this->subledger_account = '';
391 $this->note = '';
392 $this->fk_bank = '';
393 $this->fk_user_author = '';
394 $this->fk_user_modif = '';
395 }
396
402 public function check()
403 {
404 $newamount = price2num($this->amount, 'MT');
405
406 // Validation of parameters
407 if (!($newamount) > 0 || empty($this->datep)) {
408 return false;
409 }
410
411 return true;
412 }
413
420 public function create($user)
421 {
422 global $conf, $langs;
423
424 $error = 0;
425 $now = dol_now();
426
427 // Clean parameters
428 $this->amount = price2num(trim($this->amount));
429 $this->label = trim($this->label);
430 $this->note = trim($this->note);
431 $this->fk_bank = (int) $this->fk_bank;
432 $this->fk_user_author = (int) $this->fk_user_author;
433 $this->fk_user_modif = (int) $this->fk_user_modif;
434 $this->fk_account = (int) $this->fk_account;
435 if (empty($this->fk_account) && isset($this->accountid)) { // For compatibility
436 $this->fk_account = $this->accountid;
437 }
438
439 // Check parameters
440 if (!$this->label) {
441 $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Label"));
442 return -3;
443 }
444 if ($this->amount < 0 || $this->amount == '') {
445 $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount"));
446 return -5;
447 }
448 if (isModEnabled("banque") && (empty($this->fk_account) || $this->fk_account <= 0)) {
449 $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("BankAccount"));
450 return -6;
451 }
452 if (isModEnabled("banque") && (empty($this->type_payment) || $this->type_payment <= 0)) {
453 $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode"));
454 return -7;
455 }
456
457 $this->db->begin();
458
459 // Insert into llx_payment_various
460 $sql = "INSERT INTO ".MAIN_DB_PREFIX."payment_various (";
461 $sql .= " datep";
462 $sql .= ", datev";
463 $sql .= ", sens";
464 $sql .= ", amount";
465 $sql .= ", fk_typepayment";
466 $sql .= ", num_payment";
467 if ($this->note) {
468 $sql .= ", note";
469 }
470 $sql .= ", label";
471 $sql .= ", accountancy_code";
472 $sql .= ", subledger_account";
473 $sql .= ", fk_projet";
474 $sql .= ", fk_user_author";
475 $sql .= ", datec";
476 $sql .= ", fk_bank";
477 $sql .= ", entity";
478 $sql .= ")";
479 $sql .= " VALUES (";
480 $sql .= "'".$this->db->idate($this->datep)."'";
481 $sql .= ", '".$this->db->idate($this->datev)."'";
482 $sql .= ", '".$this->db->escape($this->sens)."'";
483 $sql .= ", ".price2num($this->amount);
484 $sql .= ", '".$this->db->escape($this->type_payment)."'";
485 $sql .= ", '".$this->db->escape($this->num_payment)."'";
486 if ($this->note) {
487 $sql .= ", '".$this->db->escape($this->note)."'";
488 }
489 $sql .= ", '".$this->db->escape($this->label)."'";
490 $sql .= ", '".$this->db->escape($this->accountancy_code)."'";
491 $sql .= ", '".$this->db->escape($this->subledger_account)."'";
492 $sql .= ", ".($this->fk_project > 0 ? ((int) $this->fk_project) : 0);
493 $sql .= ", ".((int) $user->id);
494 $sql .= ", '".$this->db->idate($now)."'";
495 $sql .= ", NULL"; // Filled later
496 $sql .= ", ".((int) $conf->entity);
497 $sql .= ")";
498
499 dol_syslog(get_class($this)."::create", LOG_DEBUG);
500 $result = $this->db->query($sql);
501 if ($result) {
502 $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."payment_various");
503 $this->ref = $this->id;
504
505 if ($this->id > 0) {
506 if (isModEnabled("banque") && !empty($this->amount)) {
507 // Insert into llx_bank
508 require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
509
510 $acc = new Account($this->db);
511 $result = $acc->fetch($this->fk_account);
512 if ($result <= 0) {
513 dol_print_error($this->db);
514 }
515
516 // Insert payment into llx_bank
517 // Add link 'payment_various' in bank_url between payment and bank transaction
518 $sign = 1;
519 if ($this->sens == '0') {
520 $sign = -1;
521 }
522
523 $bank_line_id = $acc->addline(
524 $this->datep,
525 $this->type_payment,
526 $this->label,
527 $sign * abs($this->amount),
528 $this->num_payment,
529 ($this->category_transaction > 0 ? $this->category_transaction : 0),
530 $user,
531 $this->chqemetteur,
532 $this->chqbank,
533 '',
534 $this->datev
535 );
536
537 // Update fk_bank into llx_payment_various
538 // So we know the payment which has generate the banking ecriture
539 if ($bank_line_id > 0) {
540 $this->update_fk_bank($bank_line_id);
541 } else {
542 $this->error = $acc->error;
543 $error++;
544 }
545
546 if (!$error) {
547 // Add link 'payment_various' in bank_url between payment and bank transaction
548 $url = DOL_URL_ROOT.'/compta/bank/various_payment/card.php?id=';
549
550 $result = $acc->add_url_line($bank_line_id, $this->id, $url, "(VariousPayment)", "payment_various");
551 if ($result <= 0) {
552 $this->error = $acc->error;
553 $error++;
554 }
555 }
556
557 if ($result <= 0) {
558 $this->error = $acc->error;
559 $error++;
560 }
561 }
562
563 // Call trigger
564 $result = $this->call_trigger('PAYMENT_VARIOUS_CREATE', $user);
565 if ($result < 0) {
566 $error++;
567 }
568 // End call triggers
569 } else {
570 $error++;
571 }
572
573 if (!$error) {
574 $this->db->commit();
575 return $this->id;
576 } else {
577 $this->db->rollback();
578 return -2;
579 }
580 } else {
581 $this->error = $this->db->error();
582 $this->db->rollback();
583 return -1;
584 }
585 }
586
587 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
594 public function update_fk_bank($id_bank)
595 {
596 // phpcs:enable
597 $sql = 'UPDATE '.MAIN_DB_PREFIX.'payment_various SET fk_bank = '.((int) $id_bank);
598 $sql .= " WHERE rowid = ".((int) $this->id);
599 $result = $this->db->query($sql);
600 if ($result) {
601 return 1;
602 } else {
603 dol_print_error($this->db);
604 return -1;
605 }
606 }
607
608
615 public function getLibStatut($mode = 0)
616 {
617 return $this->LibStatut($this->statut, $mode);
618 }
619
620 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
628 public function LibStatut($status, $mode = 0)
629 {
630 // phpcs:enable
631 global $langs;
632
633 /*
634 if (empty($status)) {
635 $status = 0;
636 }
637
638 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
639 $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft');
640 //$this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled');
641 //$this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled');
642 $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft');
643 //$this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled');
644 //$this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled');
645 }
646
647 $statusType = 'status'.$status;
648
649 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode);
650 */
651 return '';
652 }
653
654
665 public function getNomUrl($withpicto = 0, $option = '', $save_lastsearch_value = -1, $notooltip = 0, $morecss = '')
666 {
667 global $db, $conf, $langs, $hookmanager;
668 global $langs;
669
670 if (!empty($conf->dol_no_mouse_hover)) {
671 $notooltip = 1; // Force disable tooltips
672 }
673
674 $result = '';
675
676 $label = '<u>'.$langs->trans("ShowVariousPayment").'</u>';
677 $label .= '<br>';
678 $label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref;
679
680 $url = DOL_URL_ROOT.'/compta/bank/various_payment/card.php?id='.$this->id;
681
682 if ($option != 'nolink') {
683 // Add param to save lastsearch_values or not
684 $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
685 if ($save_lastsearch_value == -1 && isset($_SERVER["PHP_SELF"]) && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) {
686 $add_save_lastsearch_values = 1;
687 }
688 if ($add_save_lastsearch_values) {
689 $url .= '&save_lastsearch_values=1';
690 }
691 }
692
693 $linkclose = '';
694 if (empty($notooltip)) {
695 if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
696 $label = $langs->trans("ShowMyObject");
697 $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
698 }
699 $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
700 $linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
701 } else {
702 $linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
703 }
704
705 $linkstart = '<a href="'.$url.'"';
706 $linkstart .= $linkclose.'>';
707 $linkend = '</a>';
708
709 $result .= $linkstart;
710 if ($withpicto) {
711 $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
712 }
713 if ($withpicto != 2) {
714 $result .= $this->ref;
715 }
716 $result .= $linkend;
717 //if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : '');
718
719 global $action;
720 $hookmanager->initHooks(array('variouspayment'));
721 $parameters = array('id'=>$this->id, 'getnomurl' => &$result);
722 $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
723 if ($reshook > 0) {
724 $result = $hookmanager->resPrint;
725 } else {
726 $result .= $hookmanager->resPrint;
727 }
728
729 return $result;
730 }
731
738 public function info($id)
739 {
740 $sql = 'SELECT v.rowid, v.datec, v.fk_user_author';
741 $sql .= ' FROM '.MAIN_DB_PREFIX.'payment_various as v';
742 $sql .= ' WHERE v.rowid = '.((int) $id);
743
744 dol_syslog(get_class($this).'::info', LOG_DEBUG);
745 $result = $this->db->query($sql);
746
747 if ($result) {
748 if ($this->db->num_rows($result)) {
749 $obj = $this->db->fetch_object($result);
750
751 $this->id = $obj->rowid;
752 $this->user_creation = $obj->fk_user_author;
753 $this->user_modification_id = $obj->fk_user_modif;
754 $this->date_creation = $this->db->jdate($obj->datec);
755 $this->date_modification = $this->db->jdate($obj->tms);
756 }
757 $this->db->free($result);
758 } else {
759 dol_print_error($this->db);
760 }
761 }
762
768 public function getVentilExportCompta()
769 {
770 $banklineid = $this->fk_bank;
771
772 $alreadydispatched = 0;
773
774 $type = 'bank';
775
776 $sql = " SELECT COUNT(ab.rowid) as nb FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as ab WHERE ab.doc_type='".$this->db->escape($type)."' AND ab.fk_doc = ".((int) $banklineid);
777 $resql = $this->db->query($sql);
778 if ($resql) {
779 $obj = $this->db->fetch_object($resql);
780 if ($obj) {
781 $alreadydispatched = $obj->nb;
782 }
783 } else {
784 $this->error = $this->db->lasterror();
785 return -1;
786 }
787
788 if ($alreadydispatched) {
789 return 1;
790 }
791 return 0;
792 }
793
801 public function getKanbanView($option = '', $arraydata = null)
802 {
803 global $langs;
804
805 $selected = (empty($arraydata['selected']) ? 0 : $arraydata['selected']);
806
807 $return = '<div class="box-flex-item box-flex-grow-zero">';
808 $return .= '<div class="info-box info-box-sm">';
809 $return .= '<span class="info-box-icon bg-infobox-action">';
810 $return .= img_picto('', $this->picto);
811 $return .= '</span>';
812 $return .= '<div class="info-box-content">';
813 $return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.(method_exists($this, 'getNomUrl') ? $this->getNomUrl(1) : $this->ref).'</span>';
814 if ($selected >= 0) {
815 $return .= '<input id="cb'.$this->id.'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->id.'"'.($selected ? ' checked="checked"' : '').'>';
816 }
817 if (property_exists($this, 'fk_bank')) {
818 $return .= ' | <span class="info-box-status ">'.$this->fk_bank.'</span>';
819 }
820 if (property_exists($this, 'datep')) {
821 $return .= '<br><span class="opacitymedium">'.$langs->trans("Date").'</span> : <span class="info-box-label">'.dol_print_date($this->db->jdate($this->datep), 'day').'</span>';
822 }
823 if (property_exists($this, 'type_payment') && !empty($this->type_payment)) {
824 $return .= '<br><span class="opacitymedium">'.$langs->trans("Payment", $this->type_payment).'</span> : <span class="info-box-label">'.$this->type_payment.'</span>';
825 }
826 if (property_exists($this, 'accountancy_code')) {
827 $return .= '<br><span class="opacitymedium">'.$langs->trans("Account").'</span> : <span class="info-box-label" title="'.$this->accountancy_code.'">'.$this->accountancy_code.'</span>';
828 }
829 if (property_exists($this, 'amount')) {
830 $return .= '<br><span class="opacitymedium">'.$langs->trans("Debit").'</span> : <span class="info-box-label amount">'.price($this->amount).'</span>';
831 }
832 $return .= '</div>';
833 $return .= '</div>';
834 $return .= '</div>';
835 return $return;
836 }
837
844 public function lengthAccountg($account)
845 {
846 include_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
847
848 /*
849 if (isModEnabled('accounting')) {
850 $accountingaccount = new AccountingAccount($db);
851 $accountingaccount->fetch('', $valuetoshow, 1);
852 }*/
853
854 return length_accountg($account);
855 }
856
863 public function lengthAccounta($account)
864 {
865 include_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
866
867 return length_accounta($account);
868 }
869}
length_accountg($account)
Return General accounting account with defined length (used for product and miscellaneous)
length_accounta($accounta)
Return Auxiliary accounting account of thirdparties with defined length.
$object ref
Definition info.php:79
Class to manage bank accounts.
Parent class of all other business classes (invoices, contracts, proposals, orders,...
call_trigger($triggerName, $user)
Call trigger based on this instance.
Class to manage Dolibarr database access.
Class to manage various payments.
update_fk_bank($id_bank)
Update link between payment various and line generate into llx_bank.
getNomUrl($withpicto=0, $option='', $save_lastsearch_value=-1, $notooltip=0, $morecss='')
Send name clicable (with possibly the picto)
initAsSpecimen()
Initialise an instance with random values.
const STATUS_DRAFT
Draft status.
create($user)
Create in database.
lengthAccountg($account)
Return General accounting account with defined length (used for product and miscellaneous)
LibStatut($status, $mode=0)
Return the label of a given status.
fetch($id, $user=null)
Load object in memory from database.
info($id)
Information on record.
lengthAccounta($account)
Return Auxiliary accounting account of thirdparties with defined length.
check()
Check if a miscellaneous payment can be created into database.
__construct(DoliDB $db)
Constructor.
getVentilExportCompta()
Return if a various payment linked to a bank line id was dispatched into bookkeeping.
getLibStatut($mode=0)
Return the label of the status.
update($user=null, $notrigger=0)
Update database.
getKanbanView($option='', $arraydata=null)
Return clicable link of object (with eventually picto)
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_now($mode='auto')
Return date for now.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
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.
publicphonebutton2 phonegreen basiclayout basiclayout TotalHT VATCode TotalVAT TotalLT1 TotalLT2 TotalTTC TotalHT clearboth nowraponall right right takeposterminal SELECT e e e e e statut
Definition invoice.php:1907