dolibarr  13.0.2
tva.class.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2011-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
5  * Copyright (C) 2018 Philippe Grand <philippe.grand@atoo-net.com>
6  * Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <https://www.gnu.org/licenses/>.
20  */
21 
27 // Put here all includes required by your class file
28 require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
29 
30 
34 class Tva extends CommonObject
35 {
39  public $element = 'tva';
40 
44  public $table_element = 'tva';
45 
49  public $picto = 'payment';
50 
51  public $tms;
52  public $datep;
53  public $datev;
54  public $amount;
55  public $type_payment;
56  public $num_payment;
57 
61  public $label;
62 
66  public $fk_bank;
67 
71  public $accountid;
72 
76  public $fk_user_creat;
77 
81  public $fk_user_modif;
82 
88  public function __construct($db)
89  {
90  $this->db = $db;
91  }
92 
93 
100  public function create($user)
101  {
102  global $conf, $langs;
103 
104  $error = 0;
105  $now = dol_now();
106 
107  // Clean parameters
108  $this->amount = trim($this->amount);
109  $this->label = trim($this->label);
110  $this->note = trim($this->note);
111  $this->fk_bank = (int) $this->fk_bank;
112  $this->fk_user_creat = (int) $this->fk_user_creat;
113  $this->fk_user_modif = (int) $this->fk_user_modif;
114 
115  // Check parameters
116  // Put here code to add control on parameters values
117 
118  $this->db->begin();
119 
120  // Insert request
121  $sql = "INSERT INTO ".MAIN_DB_PREFIX."tva(";
122  $sql .= "datec,";
123  $sql .= "datep,";
124  $sql .= "datev,";
125  $sql .= "amount,";
126  $sql .= "label,";
127  $sql .= "note,";
128  $sql .= "fk_bank,";
129  $sql .= "fk_user_creat,";
130  $sql .= "fk_user_modif";
131  $sql .= ") VALUES (";
132  $sql .= " '".$this->db->idate($now)."',";
133  $sql .= " '".$this->db->idate($this->datep)."',";
134  $sql .= " '".$this->db->idate($this->datev)."',";
135  $sql .= " '".$this->db->escape($this->amount)."',";
136  $sql .= " '".$this->db->escape($this->label)."',";
137  $sql .= " '".$this->db->escape($this->note)."',";
138  $sql .= " ".($this->fk_bank <= 0 ? "NULL" : "'".$this->db->escape($this->fk_bank)."'").",";
139  $sql .= " '".$this->db->escape($this->fk_user_creat)."',";
140  $sql .= " '".$this->db->escape($this->fk_user_modif)."'";
141  $sql .= ")";
142 
143  dol_syslog(get_class($this)."::create", LOG_DEBUG);
144  $resql = $this->db->query($sql);
145  if ($resql)
146  {
147  $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."tva");
148 
149  // Call trigger
150  $result = $this->call_trigger('TVA_CREATE', $user);
151  if ($result < 0) $error++;
152  // End call triggers
153 
154  if (!$error)
155  {
156  $this->db->commit();
157  return $this->id;
158  } else {
159  $this->db->rollback();
160  return -1;
161  }
162  } else {
163  $this->error = "Error ".$this->db->lasterror();
164  $this->db->rollback();
165  return -1;
166  }
167  }
168 
176  public function update($user, $notrigger = 0)
177  {
178  global $conf, $langs;
179 
180  $error = 0;
181 
182  // Clean parameters
183  $this->amount = trim($this->amount);
184  $this->label = trim($this->label);
185  $this->note = trim($this->note);
186  $this->fk_bank = (int) $this->fk_bank;
187  $this->fk_user_creat = (int) $this->fk_user_creat;
188  $this->fk_user_modif = (int) $this->fk_user_modif;
189 
190  // Check parameters
191  // Put here code to add control on parameters values
192 
193  $this->db->begin();
194 
195  // Update request
196  $sql = "UPDATE ".MAIN_DB_PREFIX."tva SET";
197  $sql .= " tms='".$this->db->idate($this->tms)."',";
198  $sql .= " datep='".$this->db->idate($this->datep)."',";
199  $sql .= " datev='".$this->db->idate($this->datev)."',";
200  $sql .= " amount=".price2num($this->amount).",";
201  $sql .= " label='".$this->db->escape($this->label)."',";
202  $sql .= " note='".$this->db->escape($this->note)."',";
203  $sql .= " fk_bank=".$this->fk_bank.",";
204  $sql .= " fk_user_creat=".$this->fk_user_creat.",";
205  $sql .= " fk_user_modif=".($this->fk_user_modif > 0 ? $this->fk_user_modif : $user->id)."";
206  $sql .= " WHERE rowid=".$this->id;
207 
208  dol_syslog(get_class($this)."::update", LOG_DEBUG);
209  $resql = $this->db->query($sql);
210  if (!$resql)
211  {
212  $this->error = "Error ".$this->db->lasterror();
213  $error++;
214  }
215 
216  if (!$error && !$notrigger)
217  {
218  // Call trigger
219  $result = $this->call_trigger('TVA_MODIFY', $user);
220  if ($result < 0) $error++;
221  // End call triggers
222  }
223 
224  if (!$error)
225  {
226  $this->db->commit();
227  return 1;
228  } else {
229  $this->db->rollback();
230  return -1;
231  }
232  }
233 
234 
242  public function fetch($id, $user = null)
243  {
244  global $langs;
245  $sql = "SELECT";
246  $sql .= " t.rowid,";
247 
248  $sql .= " t.tms,";
249  $sql .= " t.datep,";
250  $sql .= " t.datev,";
251  $sql .= " t.amount,";
252  $sql .= " t.fk_typepayment,";
253  $sql .= " t.num_payment,";
254  $sql .= " t.label,";
255  $sql .= " t.note,";
256  $sql .= " t.fk_bank,";
257  $sql .= " t.fk_user_creat,";
258  $sql .= " t.fk_user_modif,";
259  $sql .= " b.fk_account,";
260  $sql .= " b.fk_type,";
261  $sql .= " b.rappro";
262 
263  $sql .= " FROM ".MAIN_DB_PREFIX."tva as t";
264  $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON t.fk_bank = b.rowid";
265  $sql .= " WHERE t.rowid = ".$id;
266 
267  dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
268  $resql = $this->db->query($sql);
269  if ($resql)
270  {
271  if ($this->db->num_rows($resql))
272  {
273  $obj = $this->db->fetch_object($resql);
274 
275  $this->id = $obj->rowid;
276  $this->ref = $obj->rowid;
277  $this->tms = $this->db->jdate($obj->tms);
278  $this->datep = $this->db->jdate($obj->datep);
279  $this->datev = $this->db->jdate($obj->datev);
280  $this->amount = $obj->amount;
281  $this->type_payment = $obj->fk_typepayment;
282  $this->num_payment = $obj->num_payment;
283  $this->label = $obj->label;
284  $this->note = $obj->note;
285  $this->fk_bank = $obj->fk_bank;
286  $this->fk_user_creat = $obj->fk_user_creat;
287  $this->fk_user_modif = $obj->fk_user_modif;
288  $this->fk_account = $obj->fk_account;
289  $this->fk_type = $obj->fk_type;
290  $this->rappro = $obj->rappro;
291  }
292  $this->db->free($resql);
293 
294  return 1;
295  } else {
296  $this->error = "Error ".$this->db->lasterror();
297  return -1;
298  }
299  }
300 
301 
308  public function delete($user)
309  {
310  global $conf, $langs;
311 
312  $error = 0;
313 
314  // Call trigger
315  $result = $this->call_trigger('TVA_DELETE', $user);
316  if ($result < 0) return -1;
317  // End call triggers
318 
319  $sql = "DELETE FROM ".MAIN_DB_PREFIX."tva";
320  $sql .= " WHERE rowid=".$this->id;
321 
322  dol_syslog(get_class($this)."::delete", LOG_DEBUG);
323  $resql = $this->db->query($sql);
324  if (!$resql)
325  {
326  $this->error = "Error ".$this->db->lasterror();
327  return -1;
328  }
329 
330 
331  return 1;
332  }
333 
334 
342  public function initAsSpecimen()
343  {
344  $this->id = 0;
345 
346  $this->tms = '';
347  $this->datep = '';
348  $this->datev = '';
349  $this->amount = '';
350  $this->label = '';
351  $this->note = '';
352  $this->fk_bank = '';
353  $this->fk_user_creat = '';
354  $this->fk_user_modif = '';
355  }
356 
357 
364  public function solde($year = 0)
365  {
366 
367  $reglee = $this->tva_sum_reglee($year);
368 
369  $payee = $this->tva_sum_payee($year);
370  $collectee = $this->tva_sum_collectee($year);
371 
372  $solde = $reglee - ($collectee - $payee);
373 
374  return $solde;
375  }
376 
377  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
384  public function tva_sum_collectee($year = 0)
385  {
386  // phpcs:enable
387 
388  $sql = "SELECT sum(f.tva) as amount";
389  $sql .= " FROM ".MAIN_DB_PREFIX."facture as f WHERE f.paye = 1";
390  if ($year)
391  {
392  $sql .= " AND f.datef >= '".$this->db->escape($year)."-01-01' AND f.datef <= '".$this->db->escape($year)."-12-31' ";
393  }
394 
395  $result = $this->db->query($sql);
396  if ($result)
397  {
398  if ($this->db->num_rows($result))
399  {
400  $obj = $this->db->fetch_object($result);
401  $ret = $obj->amount;
402  $this->db->free($result);
403  return $ret;
404  } else {
405  $this->db->free($result);
406  return 0;
407  }
408  } else {
409  print $this->db->lasterror();
410  return -1;
411  }
412  }
413 
414  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
421  public function tva_sum_payee($year = 0)
422  {
423  // phpcs:enable
424 
425  $sql = "SELECT sum(f.total_tva) as total_tva";
426  $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
427  if ($year)
428  {
429  $sql .= " WHERE f.datef >= '".$this->db->escape($year)."-01-01' AND f.datef <= '".$this->db->escape($year)."-12-31' ";
430  }
431 
432  $result = $this->db->query($sql);
433  if ($result)
434  {
435  if ($this->db->num_rows($result))
436  {
437  $obj = $this->db->fetch_object($result);
438  $ret = $obj->total_tva;
439  $this->db->free($result);
440  return $ret;
441  } else {
442  $this->db->free($result);
443  return 0;
444  }
445  } else {
446  print $this->db->lasterror();
447  return -1;
448  }
449  }
450 
451 
452  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
459  public function tva_sum_reglee($year = 0)
460  {
461  // phpcs:enable
462 
463  $sql = "SELECT sum(f.amount) as amount";
464  $sql .= " FROM ".MAIN_DB_PREFIX."tva as f";
465 
466  if ($year)
467  {
468  $sql .= " WHERE f.datev >= '".$this->db->escape($year)."-01-01' AND f.datev <= '".$this->db->escape($year)."-12-31' ";
469  }
470 
471  $result = $this->db->query($sql);
472  if ($result)
473  {
474  if ($this->db->num_rows($result))
475  {
476  $obj = $this->db->fetch_object($result);
477  $ret = $obj->amount;
478  $this->db->free($result);
479  return $ret;
480  } else {
481  $this->db->free($result);
482  return 0;
483  }
484  } else {
485  print $this->db->lasterror();
486  return -1;
487  }
488  }
489 
490 
497  public function addPayment($user)
498  {
499  global $conf, $langs;
500 
501  $this->db->begin();
502 
503  // Clean parameters
504  $this->amount = price2num(trim($this->amount));
505  $this->label = trim($this->label);
506  $this->note = trim($this->note);
507  $this->num_payment = trim($this->num_payment);
508  $this->fk_bank = (int) $this->fk_bank;
509  $this->fk_user_creat = (int) $this->fk_user_creat;
510  $this->fk_user_modif = (int) $this->fk_user_modif;
511  if (empty($this->datec)) $this->datec = dol_now();
512 
513  // Check parameters
514  if (!$this->label)
515  {
516  $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Label"));
517  return -3;
518  }
519  if ($this->amount == '')
520  {
521  $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount"));
522  return -4;
523  }
524  if (!empty($conf->banque->enabled) && (empty($this->accountid) || $this->accountid <= 0))
525  {
526  $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Account"));
527  return -5;
528  }
529  if (!empty($conf->banque->enabled) && (empty($this->type_payment) || $this->type_payment <= 0))
530  {
531  $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode"));
532  return -5;
533  }
534 
535  // Insert into llx_tva
536  $sql = "INSERT INTO ".MAIN_DB_PREFIX."tva (";
537  $sql .= "datec";
538  $sql .= ", datep";
539  $sql .= ", datev";
540  $sql .= ", amount";
541  $sql .= ", fk_typepayment";
542  $sql .= ", num_payment";
543  if ($this->note) $sql .= ", note";
544  if ($this->label) $sql .= ", label";
545  $sql .= ", fk_user_creat";
546  $sql .= ", fk_bank";
547  $sql .= ", entity";
548  $sql .= ") ";
549  $sql .= " VALUES (";
550  $sql .= " '".$this->db->idate($this->datec)."'";
551  $sql .= ", '".$this->db->idate($this->datep)."'";
552  $sql .= ", '".$this->db->idate($this->datev)."'";
553  $sql .= ", ".$this->amount;
554  $sql .= ", '".$this->db->escape($this->type_payment)."'";
555  $sql .= ", '".$this->db->escape($this->num_payment)."'";
556  if ($this->note) $sql .= ", '".$this->db->escape($this->note)."'";
557  if ($this->label) $sql .= ", '".$this->db->escape($this->label)."'";
558  $sql .= ", '".$this->db->escape($user->id)."'";
559  $sql .= ", NULL";
560  $sql .= ", ".$conf->entity;
561  $sql .= ")";
562 
563  dol_syslog(get_class($this)."::addPayment", LOG_DEBUG);
564  $result = $this->db->query($sql);
565  if ($result)
566  {
567  $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."tva"); // TODO should be called 'payment_vat'
568 
569  // Call trigger
570  //XXX: Should be done just befor commit no ?
571  $result = $this->call_trigger('TVA_ADDPAYMENT', $user);
572  if ($result < 0)
573  {
574  $this->id = 0;
575  $ok = 0;
576  }
577  // End call triggers
578 
579  if ($this->id > 0)
580  {
581  $ok = 1;
582  if (!empty($conf->banque->enabled) && !empty($this->amount))
583  {
584  // Insert into llx_bank
585  require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
586 
587  $acc = new Account($this->db);
588  $result = $acc->fetch($this->accountid);
589  if ($result <= 0) dol_print_error($this->db);
590 
591  if ($this->amount > 0) {
592  $bank_line_id = $acc->addline($this->datep, $this->type_payment, $this->label, -abs($this->amount), $this->num_payment, '', $user);
593  } else {
594  $bank_line_id = $acc->addline($this->datep, $this->type_payment, $this->label, abs($this->amount), $this->num_payment, '', $user);
595  }
596 
597  // Update fk_bank into llx_tva. So we know vat line used to generate bank transaction
598  if ($bank_line_id > 0)
599  {
600  $this->update_fk_bank($bank_line_id);
601  } else {
602  $this->error = $acc->error;
603  $ok = 0;
604  }
605 
606  // Update links
607  $result = $acc->add_url_line($bank_line_id, $this->id, DOL_URL_ROOT.'/compta/tva/card.php?id=', "(VATPayment)", "payment_vat");
608  if ($result < 0)
609  {
610  $this->error = $acc->error;
611  $ok = 0;
612  }
613  }
614 
615  if ($ok)
616  {
617  $this->db->commit();
618  return $this->id;
619  } else {
620  $this->db->rollback();
621  return -3;
622  }
623  } else {
624  $this->db->rollback();
625  return -2;
626  }
627  } else {
628  $this->error = $this->db->error();
629  $this->db->rollback();
630  return -1;
631  }
632  }
633 
634  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
641  public function update_fk_bank($id_bank)
642  {
643  // phpcs:enable
644  $sql = 'UPDATE '.MAIN_DB_PREFIX.'tva SET fk_bank = '.(int) $id_bank;
645  $sql .= ' WHERE rowid = '.(int) $this->id;
646  $result = $this->db->query($sql);
647  if ($result)
648  {
649  return 1;
650  } else {
651  dol_print_error($this->db);
652  return -1;
653  }
654  }
655 
665  public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '')
666  {
667  global $langs, $conf;
668 
669  if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips
670 
671  $result = '';
672 
673  $label = '<u>'.$langs->trans("ShowVatPayment").'</u>';
674  $label .= '<br>';
675  $label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref;
676 
677  $url = DOL_URL_ROOT.'/compta/tva/card.php?id='.$this->id;
678 
679  $linkclose = '';
680  if (empty($notooltip))
681  {
682  if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
683  {
684  $label = $langs->trans("ShowMyObject");
685  $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
686  }
687  $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
688  $linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
689  } else $linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
690 
691  $linkstart = '<a href="'.$url.'"';
692  $linkstart .= $linkclose.'>';
693  $linkend = '</a>';
694 
695  $picto = 'payment';
696 
697  $result .= $linkstart;
698  if ($withpicto) $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);
699  if ($withpicto != 2) $result .= $this->ref;
700  $result .= $linkend;
701 
702  return $result;
703  }
704 
710  public function getSommePaiement()
711  {
712  $table = 'paiementcharge';
713  $field = 'fk_charge';
714 
715  $sql = 'SELECT sum(amount) as amount';
716  $sql .= ' FROM '.MAIN_DB_PREFIX.$table;
717  $sql .= ' WHERE '.$field.' = '.$this->id;
718 
719  dol_syslog(get_class($this)."::getSommePaiement", LOG_DEBUG);
720  $resql = $this->db->query($sql);
721  if ($resql)
722  {
723  $amount = 0;
724 
725  $obj = $this->db->fetch_object($resql);
726  if ($obj) $amount = $obj->amount ? $obj->amount : 0;
727 
728  $this->db->free($resql);
729  return $amount;
730  } else {
731  return -1;
732  }
733  }
734 
741  public function info($id)
742  {
743  $sql = "SELECT t.rowid, t.tms, t.fk_user_modif, t.datec, t.fk_user_creat";
744  $sql .= " FROM ".MAIN_DB_PREFIX."tva as t";
745  $sql .= " WHERE t.rowid = ".(int) $id;
746 
747  dol_syslog(get_class($this)."::info", LOG_DEBUG);
748  $result = $this->db->query($sql);
749  if ($result)
750  {
751  if ($this->db->num_rows($result))
752  {
753  $obj = $this->db->fetch_object($result);
754 
755  $this->id = $obj->rowid;
756 
757  if ($obj->fk_user_creat) {
758  $cuser = new User($this->db);
759  $cuser->fetch($obj->fk_user_creat);
760  $this->user_creation = $cuser;
761  }
762 
763  if ($obj->fk_user_modif) {
764  $muser = new User($this->db);
765  $muser->fetch($obj->fk_user_modif);
766  $this->user_modification = $muser;
767  }
768 
769  $this->date_creation = $this->db->jdate($obj->datec);
770  $this->date_modification = $this->db->jdate($obj->tms);
771  $this->import_key = $obj->import_key;
772  }
773 
774  $this->db->free($result);
775  } else {
776  dol_print_error($this->db);
777  }
778  }
779 
786  public function getLibStatut($mode = 0)
787  {
788  return $this->LibStatut($this->statut, $mode);
789  }
790 
791  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
799  public function LibStatut($status, $mode = 0)
800  {
801  // phpcs:enable
802  global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage
803 
804  return '';
805  }
806 }
addPayment($user)
Create in database.
Definition: tva.class.php:497
__construct($db)
Constructor.
Definition: tva.class.php:88
if(!empty($arrayfields['u.datec']['checked'])) print_liste_field_titre("DateCreationShort"u if(!empty($arrayfields['u.tms']['checked'])) print_liste_field_titre("DateModificationShort"u if(!empty($arrayfields['u.statut']['checked'])) print_liste_field_titre("Status"u statut
Definition: list.php:632
update($user, $notrigger=0)
Update database.
Definition: tva.class.php:176
tva_sum_payee($year=0)
Total of VAT paid into invoice.
Definition: tva.class.php:421
LibStatut($status, $mode=0)
Renvoi le libelle d&#39;un statut donne.
Definition: tva.class.php:799
dol_now($mode= 'auto')
Return date for now.
Class to manage Dolibarr users.
Definition: user.class.php:44
info($id)
Informations of vat payment object.
Definition: tva.class.php:741
initAsSpecimen()
Initialise an instance with random values.
Definition: tva.class.php:342
tva_sum_collectee($year=0)
Total of the VAT from invoices emitted by the thirdparty.
Definition: tva.class.php:384
$conf db
API class for accounts.
Definition: inc.php:54
Class to manage bank accounts.
Put here description of your class.
Definition: tva.class.php:34
solde($year=0)
Balance of VAT.
Definition: tva.class.php:364
getLibStatut($mode=0)
Retourne le libelle du statut d&#39;une facture (brouillon, validee, abandonnee, payee) ...
Definition: tva.class.php:786
price2num($amount, $rounding= '', $option=0)
Function that return a number with universal decimal format (decimal separator is &#39;...
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
img_object($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
fetch($id, $user=null)
Load object in memory from database.
Definition: tva.class.php:242
create($user)
Create in database.
Definition: tva.class.php:100
print
Draft customers invoices.
Definition: index.php:89
call_trigger($triggerName, $user)
Call trigger based on this instance.
getSommePaiement()
Return amount of payments already done.
Definition: tva.class.php:710
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
Definition: index.php:1232
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
tva_sum_reglee($year=0)
Total of the VAT paid.
Definition: tva.class.php:459
update_fk_bank($id_bank)
Update link between payment tva and line generate into llx_bank.
Definition: tva.class.php:641
Parent class of all other business classes (invoices, contracts, proposals, orders, ...)
if(!empty($search_group)) natural_search(array("g.nom"g note
Definition: list.php:122
getNomUrl($withpicto=0, $option= '', $notooltip=0, $morecss= '')
Send name clicable (with possibly the picto)
Definition: tva.class.php:665