dolibarr  16.0.5
card.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2003 Eric Seigne <erics@rycks.com>
4  * Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
5  * Copyright (C) 2005-2010 Regis Houssin <regis.houssin@inodbox.com>
6  * Copyright (C) 2010-2015 Juanjo Menent <jmenent@2byte.es>
7  * Copyright (C) 2014 Jean Heimburger <jean@tiaris.info>
8  * Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
9  * Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
10  * Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr>
11  *
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 3 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program. If not, see <https://www.gnu.org/licenses/>.
24  */
25 
32 require '../main.inc.php';
33 require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
34 require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
35 require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php';
36 require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
37 require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
38 require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
39 if (!empty($conf->adherent->enabled)) {
40  require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
41 }
42 if (!empty($conf->categorie->enabled)) {
43  require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
44 }
45 
46 // Load translation files required by page
47 $langs->loadLangs(array(
48  'companies',
49  'suppliers',
50  'products',
51  'bills',
52  'orders',
53  'commercial',
54 ));
55 
56 $action = GETPOST('action', 'aZ09');
57 $cancel = GETPOST('cancel', 'alpha');
58 
59 // Security check
60 $id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int'));
61 if ($user->socid) {
62  $id = $user->socid;
63 }
64 $result = restrictedArea($user, 'societe&fournisseur', $id, '&societe', '', 'rowid');
65 
66 $object = new Fournisseur($db);
67 $extrafields = new ExtraFields($db);
68 
69 // fetch optionals attributes and labels
70 $extrafields->fetch_name_optionals_label($object->table_element);
71 
72 // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
73 $hookmanager->initHooks(array('thirdpartysupplier', 'globalcard'));
74 
75 // Security check
76 $result = restrictedArea($user, 'societe', $id, '&societe', '', 'fk_soc', 'rowid', 0);
77 
78 if ($object->id > 0) {
79  if (!($object->fournisseur > 0) || empty($user->rights->fournisseur->lire)) {
81  }
82 }
83 
84 
85 /*
86  * Action
87  */
88 
89 $parameters = array('id'=>$id);
90 $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
91 if ($reshook < 0) {
92  setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
93 }
94 
95 if (empty($reshook)) {
96  if ($cancel) {
97  $action = "";
98  }
99 
100  if ($action == 'setsupplieraccountancycode') {
101  $result = $object->fetch($id);
102  $object->code_compta_fournisseur = GETPOST("supplieraccountancycode");
103  $result = $object->update($object->id, $user, 1, 0, 1);
104  if ($result < 0) {
105  setEventMessages($object->error, $object->errors, 'errors');
106  }
107  }
108  // terms of the settlement
109  if ($action == 'setconditions' && $user->rights->societe->creer) {
110  $object->fetch($id);
111  $result = $object->setPaymentTerms(GETPOST('cond_reglement_supplier_id', 'int'));
112  if ($result < 0) {
113  dol_print_error($db, $object->error);
114  }
115  }
116  // mode de reglement
117  if ($action == 'setmode' && $user->rights->societe->creer) {
118  $object->fetch($id);
119  $result = $object->setPaymentMethods(GETPOST('mode_reglement_supplier_id', 'int'));
120  if ($result < 0) {
121  dol_print_error($db, $object->error);
122  }
123  }
124 
125  // update supplier order min amount
126  if ($action == 'setsupplier_order_min_amount') {
127  $object->fetch($id);
128  $object->supplier_order_min_amount = price2num(GETPOST('supplier_order_min_amount', 'alpha'));
129  $result = $object->update($object->id, $user);
130  if ($result < 0) {
131  setEventMessages($object->error, $object->errors, 'errors');
132  }
133  }
134 
135  if ($action == 'update_extras') {
136  $object->fetch($id);
137 
138  $object->oldcopy = dol_clone($object);
139 
140  // Fill array 'array_options' with data from update form
141  $ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml'));
142 
143  if ($ret < 0) {
144  $error++;
145  }
146 
147  if (!$error) {
148  $result = $object->insertExtraFields('COMPANY_MODIFY');
149  if ($result < 0) {
150  setEventMessages($object->error, $object->errors, 'errors');
151  $error++;
152  }
153  }
154 
155  if ($error) {
156  $action = 'edit_extras';
157  }
158  }
159 }
160 
161 
162 /*
163  * View
164  */
165 
166 $contactstatic = new Contact($db);
167 $form = new Form($db);
168 
169 if ($id > 0 && empty($object->id)) {
170  // Load data of third party
171  $res = $object->fetch($id);
172  if ($object->id <= 0) {
173  dol_print_error($db, $object->error);
174  exit(-1);
175  }
176 }
177 
178 if ($object->id > 0) {
179  $title = $langs->trans("ThirdParty")." - ".$langs->trans('Supplier');
180  if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) {
181  $title = $object->name." - ".$langs->trans('Supplier');
182  }
183  $help_url = '';
184  llxHeader('', $title, $help_url);
185 
186  /*
187  * Show tabs
188  */
189  $head = societe_prepare_head($object);
190 
191  print dol_get_fiche_head($head, 'supplier', $langs->trans("ThirdParty"), -1, 'company');
192 
193  $linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
194 
195  dol_banner_tab($object, 'socid', $linkback, ($user->socid ? 0 : 1), 'rowid', 'nom');
196 
197  print '<div class="fichecenter"><div class="fichehalfleft">';
198 
199  print '<div class="underbanner clearboth"></div>';
200  print '<table class="border centpercent tableforfield">';
201 
202  // Type Prospect/Customer/Supplier
203  print '<tr><td class="titlefield">'.$langs->trans('NatureOfThirdParty').'</td><td>';
204  print $object->getTypeUrl(1);
205  print '</td></tr>';
206 
207  if (!empty($conf->global->SOCIETE_USEPREFIX)) { // Old not used prefix field
208  print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$object->prefix_comm.'</td></tr>';
209  }
210 
211  if ($object->fournisseur) {
212  print '<tr>';
213  print '<td class="titlefield">'.$langs->trans("SupplierCode").'</td><td>';
214  print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_fournisseur));
215  $tmpcheck = $object->check_codefournisseur();
216  if ($tmpcheck != 0 && $tmpcheck != -5) {
217  print ' <span class="error">('.$langs->trans("WrongSupplierCode").')</span>';
218  }
219  print '</td>';
220  print '</tr>';
221 
222  $langs->load('compta');
223  print '<tr>';
224  print '<td>';
225  print $form->editfieldkey("SupplierAccountancyCode", 'supplieraccountancycode', $object->code_compta_fournisseur, $object, $user->rights->societe->creer);
226  print '</td><td>';
227  print $form->editfieldval("SupplierAccountancyCode", 'supplieraccountancycode', $object->code_compta_fournisseur, $object, $user->rights->societe->creer);
228  print '</td>';
229  print '</tr>';
230  }
231 
232  // Assujetti a TVA ou pas
233  print '<tr>';
234  print '<td class="titlefield">';
235  print $form->textwithpicto($langs->trans('VATIsUsed'), $langs->trans('VATIsUsedWhenSelling'));
236  print '</td><td>';
237  print yn($object->tva_assuj);
238  print '</td>';
239  print '</tr>';
240 
241  // Local Taxes
242  if ($mysoc->useLocalTax(1)) {
243  print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).'</td><td>';
244  print yn($object->localtax1_assuj);
245  print '</td></tr>';
246  }
247  if ($mysoc->useLocalTax(2)) {
248  print '<tr><td>'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).'</td><td>';
249  print yn($object->localtax2_assuj);
250  print '</td></tr>';
251  }
252 
253  // TVA Intra
254  print '<tr><td class="nowrap">'.$langs->trans('VATIntra').'</td><td>';
255  print showValueWithClipboardCPButton(dol_escape_htmltag($object->tva_intra));
256  print '</td></tr>';
257 
258  // Default terms of the settlement
259  $langs->load('bills');
260  $form = new Form($db);
261  print '<tr><td>';
262  print '<table width="100%" class="nobordernopadding"><tr><td>';
263  print $langs->trans('PaymentConditions');
264  print '<td>';
265  if (($action != 'editconditions') && $user->rights->societe->creer) {
266  print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editconditions&token='.newToken().'&socid='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
267  }
268  print '</tr></table>';
269  print '</td><td>';
270  if ($action == 'editconditions') {
271  $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->cond_reglement_supplier_id, 'cond_reglement_supplier_id', 1);
272  } else {
273  $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->cond_reglement_supplier_id, 'none');
274  }
275  print "</td>";
276  print '</tr>';
277 
278  // Mode de reglement par defaut
279  print '<tr><td class="nowrap">';
280  print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
281  print $langs->trans('PaymentMode');
282  print '<td>';
283  if (($action != 'editmode') && $user->rights->societe->creer) {
284  print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&token='.newToken().'&socid='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
285  }
286  print '</tr></table>';
287  print '</td><td>';
288  if ($action == 'editmode') {
289  $form->form_modes_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->mode_reglement_supplier_id, 'mode_reglement_supplier_id', 'DBIT', 1, 1);
290  } else {
291  $form->form_modes_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->mode_reglement_supplier_id, 'none');
292  }
293  print "</td>";
294  print '</tr>';
295 
296  // Relative discounts (Discounts-Drawbacks-Rebates)
297  print '<tr><td class="nowrap">';
298  print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
299  print $langs->trans("CustomerRelativeDiscountShort");
300  print '<td><td class="right">';
301  if ($user->rights->societe->creer && !$user->socid > 0) {
302  print '<a class="editfielda" href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?socid='.$object->id).'&action=create&token='.newToken().'">'.img_edit($langs->trans("Modify")).'</a>';
303  }
304  print '</td></tr></table>';
305  print '</td><td>'.($object->remise_supplier_percent ? '<a href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$object->id.'">'.$object->remise_supplier_percent.'%</a>' : '').'</td>';
306  print '</tr>';
307 
308  // Absolute discounts (Discounts-Drawbacks-Rebates)
309  print '<tr><td class="nowrap">';
310  print '<table width="100%" class="nobordernopadding">';
311  print '<tr><td class="nowrap">';
312  print $langs->trans("CustomerAbsoluteDiscountShort");
313  print '<td><td class="right">';
314  if ($user->rights->societe->creer && !$user->socid > 0) {
315  print '<a class="editfielda" href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?socid='.$object->id).'&action=create&token='.newToken().'">'.img_edit($langs->trans("Modify")).'</a>';
316  }
317  print '</td></tr></table>';
318  print '</td>';
319  print '<td>';
320  $amount_discount = $object->getAvailableDiscounts('', '', 0, 1);
321  if ($amount_discount < 0) {
322  dol_print_error($db, $object->error);
323  }
324  if ($amount_discount > 0) {
325  print '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?socid='.$object->id).'&action=create&token='.newToken().'">'.price($amount_discount, 1, $langs, 1, -1, -1, $conf->currency).'</a>';
326  }
327  //else print $langs->trans("DiscountNone");
328  print '</td>';
329  print '</tr>';
330 
331  if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) && !empty($conf->global->ORDER_MANAGE_MIN_AMOUNT)) {
332  print '<tr class="nowrap">';
333  print '<td>';
334  print $form->editfieldkey("OrderMinAmount", 'supplier_order_min_amount', $object->supplier_order_min_amount, $object, $user->rights->societe->creer);
335  print '</td><td>';
336  $limit_field_type = (!empty($conf->global->MAIN_USE_JQUERY_JEDITABLE)) ? 'numeric' : 'amount';
337  print $form->editfieldval("OrderMinAmount", 'supplier_order_min_amount', $object->supplier_order_min_amount, $object, $user->rights->societe->creer, $limit_field_type, ($object->supplier_order_min_amount != '' ? price($object->supplier_order_min_amount) : ''));
338  print '</td>';
339  print '</tr>';
340  }
341 
342  // Categories
343  if (!empty($conf->categorie->enabled)) {
344  $langs->load("categories");
345  print '<tr><td>'.$langs->trans("SuppliersCategoriesShort").'</td>';
346  print '<td>';
347  print $form->showCategories($object->id, Categorie::TYPE_SUPPLIER, 1);
348  print "</td></tr>";
349  }
350 
351  // Other attributes
352  $parameters = array('socid'=>$object->id, 'colspan' => ' colspan="3"', 'colspanvalue' => '3');
353  include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
354 
355  // Module Adherent
356  if (!empty($conf->adherent->enabled)) {
357  $langs->load("members");
358  $langs->load("users");
359  print '<tr><td>'.$langs->trans("LinkedToDolibarrMember").'</td>';
360  print '<td>';
361  $adh = new Adherent($db);
362  $result = $adh->fetch('', '', $object->id);
363  if ($result > 0) {
364  $adh->ref = $adh->getFullName($langs);
365  print $adh->getNomUrl(1);
366  } else {
367  print $langs->trans("ThirdpartyNotLinkedToMember");
368  }
369  print '</td>';
370  print "</tr>\n";
371  }
372 
373  print '</table>';
374 
375 
376  print '</div><div class="fichehalfright">';
377 
378  $boxstat = '';
379 
380  // Nbre max d'elements des petites listes
381  $MAXLIST = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
382 
383  print '<div class="underbanner underbanner-before-box clearboth"></div>';
384 
385  // Lien recap
386  $boxstat .= '<div class="box box-halfright">';
387  $boxstat .= '<table summary="'.dol_escape_htmltag($langs->trans("DolibarrStateBoard")).'" class="border boxtable boxtablenobottom boxtablenotop" width="100%">';
388  $boxstat .= '<tr class="impair nohover"><td colspan="2" class="tdboxstats nohover">';
389 
390  if (!empty($conf->supplier_proposal->enabled)) {
391  // Box proposals
392  $tmp = $object->getOutstandingProposals('supplier');
393  $outstandingOpened = $tmp['opened'];
394  $outstandingTotal = $tmp['total_ht'];
395  $outstandingTotalIncTax = $tmp['total_ttc'];
396  $text = $langs->trans("OverAllSupplierProposals");
397  $link = DOL_URL_ROOT.'/supplier_proposal/list.php?socid='.$object->id;
398  $icon = 'bill';
399  if ($link) {
400  $boxstat .= '<a href="'.$link.'" class="boxstatsindicator thumbstat nobold nounderline">';
401  }
402  $boxstat .= '<div class="boxstats" title="'.dol_escape_htmltag($text).'">';
403  $boxstat .= '<span class="boxstatstext">'.img_object("", $icon).' <span>'.$text.'</span></span><br>';
404  $boxstat .= '<span class="boxstatsindicator">'.price($outstandingTotal, 1, $langs, 1, -1, -1, $conf->currency).'</span>';
405  $boxstat .= '</div>';
406  if ($link) {
407  $boxstat .= '</a>';
408  }
409  }
410 
411  if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) {
412  // Box proposals
413  $tmp = $object->getOutstandingOrders('supplier');
414  $outstandingOpened = $tmp['opened'];
415  $outstandingTotal = $tmp['total_ht'];
416  $outstandingTotalIncTax = $tmp['total_ttc'];
417  $text = $langs->trans("OverAllOrders");
418  $link = DOL_URL_ROOT.'/fourn/commande/list.php?socid='.$object->id;
419  $icon = 'bill';
420  if ($link) {
421  $boxstat .= '<a href="'.$link.'" class="boxstatsindicator thumbstat nobold nounderline">';
422  }
423  $boxstat .= '<div class="boxstats" title="'.dol_escape_htmltag($text).'">';
424  $boxstat .= '<span class="boxstatstext">'.img_object("", $icon).' <span>'.$text.'</span></span><br>';
425  $boxstat .= '<span class="boxstatsindicator">'.price($outstandingTotal, 1, $langs, 1, -1, -1, $conf->currency).'</span>';
426  $boxstat .= '</div>';
427  if ($link) {
428  $boxstat .= '</a>';
429  }
430  }
431 
432  if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled)) {
433  $warn = '';
434  $tmp = $object->getOutstandingBills('supplier');
435  $outstandingOpened = $tmp['opened'];
436  $outstandingTotal = $tmp['total_ht'];
437  $outstandingTotalIncTax = $tmp['total_ttc'];
438 
439  $text = $langs->trans("OverAllInvoices");
440  $link = DOL_URL_ROOT.'/fourn/facture/list.php?socid='.$object->id;
441  $icon = 'bill';
442  if ($link) {
443  $boxstat .= '<a href="'.$link.'" class="boxstatsindicator thumbstat nobold nounderline">';
444  }
445  $boxstat .= '<div class="boxstats" title="'.dol_escape_htmltag($text).'">';
446  $boxstat .= '<span class="boxstatstext">'.img_object("", $icon).' <span>'.$text.'</span></span><br>';
447  $boxstat .= '<span class="boxstatsindicator">'.price($outstandingTotal, 1, $langs, 1, -1, -1, $conf->currency).'</span>';
448  $boxstat .= '</div>';
449  if ($link) {
450  $boxstat .= '</a>';
451  }
452 
453  // Box outstanding bill
454  $text = $langs->trans("CurrentOutstandingBill");
455  $link = DOL_URL_ROOT.'/fourn/recap-fourn.php?socid='.$object->id;
456  $icon = 'bill';
457  if ($link) {
458  $boxstat .= '<a href="'.$link.'" class="boxstatsindicator thumbstat nobold nounderline">';
459  }
460  $boxstat .= '<div class="boxstats" title="'.dol_escape_htmltag($text).'">';
461  $boxstat .= '<span class="boxstatstext">'.img_object("", $icon).' <span>'.$text.'</span></span><br>';
462  $boxstat .= '<span class="boxstatsindicator'.($outstandingOpened > 0 ? ' amountremaintopay' : '').'">'.price($outstandingOpened, 1, $langs, 1, -1, -1, $conf->currency).$warn.'</span>';
463  $boxstat .= '</div>';
464  if ($link) {
465  $boxstat .= '</a>';
466  }
467 
468  $tmp = $object->getOutstandingBills('supplier', 1);
469  $outstandingOpenedLate = $tmp['opened'];
470  if ($outstandingOpened != $outstandingOpenedLate && !empty($outstandingOpenedLate)) {
471  $text = $langs->trans("CurrentOutstandingBillLate");
472  $link = DOL_URL_ROOT.'/fourn/recap-fourn.php?socid='.$object->id;
473  $icon = 'bill';
474  if ($link) {
475  $boxstat .= '<a href="'.$link.'" class="boxstatsindicator thumbstat nobold nounderline">';
476  }
477  $boxstat .= '<div class="boxstats" title="'.dol_escape_htmltag($text).'">';
478  $boxstat .= '<span class="boxstatstext">'.img_object("", $icon).' <span>'.$text.'</span></span><br>';
479  $boxstat .= '<span class="boxstatsindicator'.($outstandingOpenedLate > 0 ? ' amountremaintopay' : '').'">'.price($outstandingOpenedLate, 1, $langs, 1, -1, -1, $conf->currency).$warn.'</span>';
480  $boxstat .= '</div>';
481  if ($link) {
482  $boxstat .= '</a>';
483  }
484  }
485  }
486 
487 
488  $parameters = array();
489  $reshook = $hookmanager->executeHooks('addMoreBoxStatsSupplier', $parameters, $object, $action);
490  if (empty($reshook)) {
491  $boxstat .= $hookmanager->resPrint;
492  }
493 
494  $boxstat .= '</td></tr>';
495  $boxstat .= '</table>';
496  $boxstat .= '</div>';
497 
498  print $boxstat;
499 
500 
501  $MAXLIST = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
502 
503  // Lien recap
504  /*
505  print '<table class="noborder centpercent">';
506  print '<tr class="liste_titre">';
507  print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("Summary").'</td>';
508  print '<td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/fourn/recap-fourn.php?socid='.$object->id.'">'.$langs->trans("ShowSupplierPreview").'</a></td></tr></table></td>';
509  print '</tr>';
510  print '</table>';
511  print '<br>';
512  */
513 
514  /*
515  * List of products
516  */
517  if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
518  $langs->load("products");
519  //Query from product/liste.php
520  $sql = 'SELECT p.rowid, p.ref, p.label, p.fk_product_type, p.entity, p.tosell as status, p.tobuy as status_buy, p.tobatch as status_batch,';
521  $sql .= ' pfp.tms, pfp.ref_fourn as supplier_ref, pfp.price, pfp.quantity, pfp.unitprice';
522  $sql .= ' FROM '.MAIN_DB_PREFIX.'product_fournisseur_price as pfp';
523  $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = pfp.fk_product";
524  $sql .= ' WHERE p.entity IN ('.getEntity('product').')';
525  $sql .= ' AND pfp.fk_soc = '.((int) $object->id);
526  $sql .= $db->order('pfp.tms', 'desc');
527  $sql .= $db->plimit($MAXLIST);
528 
529  $query = $db->query($sql);
530  if (!$query) {
531  dol_print_error($db);
532  }
533 
534  $num = $db->num_rows($query);
535 
536  print '<div class="div-table-responsive-no-min">';
537  print '<table class="noborder centpercent lastrecordtable">';
538  print '<tr class="liste_titre'.(($num == 0) ? ' nobottom' : '').'">';
539  print '<td colspan="3">'.$langs->trans("ProductsAndServices").'</td><td class="right">';
540  print '<a class="notasortlink" href="'.DOL_URL_ROOT.'/fourn/product/list.php?fourn_id='.$object->id.'"><span class="hideonsmartphone">'.$langs->trans("AllProductReferencesOfSupplier").'</span><span class="badge marginleftonlyshort">'.$object->nbOfProductRefs().'</span>';
541  print '</a></td></tr>';
542 
543  $return = array();
544  if ($num > 0) {
545  $productstatic = new Product($db);
546 
547  while ($objp = $db->fetch_object($query)) {
548  $productstatic->id = $objp->rowid;
549  $productstatic->ref = $objp->ref;
550  $productstatic->label = $objp->label;
551  $productstatic->type = $objp->fk_product_type;
552  $productstatic->entity = $objp->entity;
553  $productstatic->status = $objp->status;
554  $productstatic->status_buy = $objp->status_buy;
555  $productstatic->status_batch = $objp->status_batch;
556 
557  print '<tr class="oddeven">';
558  print '<td class="nowrap">';
559  print $productstatic->getNomUrl(1);
560  print '</td>';
561  print '<td>';
562  print dol_escape_htmltag($objp->supplier_ref);
563  print '</td>';
564  print '<td class="maxwidthonsmartphone">';
565  print dol_trunc(dol_htmlentities($objp->label), 30);
566  print '</td>';
567  //print '<td class="right" class="nowrap">'.dol_print_date($objp->tms, 'day').'</td>';
568  print '<td class="right">';
569  //print (isset($objp->unitprice) ? price($objp->unitprice) : '');
570  if (isset($objp->price)) {
571  print '<span class="amount">'.price($objp->price).'</span>';
572  if ($objp->quantity > 1) {
573  print ' / ';
574  print $objp->quantity;
575  }
576  }
577  print '</td>';
578  print '</tr>';
579  }
580  }
581 
582  print '</table>';
583  print '</div>';
584  }
585 
586 
587  /*
588  * Latest supplier proposal
589  */
590  $proposalstatic = new SupplierProposal($db);
591 
592  if (!empty($user->rights->supplier_proposal->lire)) {
593  $langs->loadLangs(array("supplier_proposal"));
594 
595  $sql = "SELECT p.rowid, p.ref, p.date_valid as dc, p.fk_statut, p.total_ht, p.total_tva, p.total_ttc";
596  $sql .= " FROM ".MAIN_DB_PREFIX."supplier_proposal as p ";
597  $sql .= " WHERE p.fk_soc = ".((int) $object->id);
598  $sql .= " AND p.entity IN (".getEntity('supplier_proposal').")";
599  $sql .= " ORDER BY p.date_valid DESC";
600  $sql .= $db->plimit($MAXLIST);
601 
602  $resql = $db->query($sql);
603  if ($resql) {
604  $i = 0;
605  $num = $db->num_rows($resql);
606 
607  if ($num > 0) {
608  print '<div class="div-table-responsive-no-min">';
609  print '<table class="noborder centpercent lastrecordtable">';
610 
611  print '<tr class="liste_titre">';
612  print '<td colspan="3">';
613  print '<table class="nobordernopadding centpercent"><tr><td>'.$langs->trans("LastSupplierProposals", ($num < $MAXLIST ? "" : $MAXLIST)).'</td>';
614  print '<td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/supplier_proposal/list.php?socid='.$object->id.'"><span class="hideonsmartphone">'.$langs->trans("AllPriceRequests").'</span><span class="badge marginleftonlyshort">'.$num.'</span></td>';
615  print '<td width="20px" class="right"><a href="'.DOL_URL_ROOT.'/supplier_proposal/stats/index.php?mode=supplier&socid='.$object->id.'">'.img_picto($langs->trans("Statistics"), 'stats').'</a></td>';
616  print '</tr></table>';
617  print '</td></tr>';
618  }
619 
620  while ($i < $num && $i <= $MAXLIST) {
621  $obj = $db->fetch_object($resql);
622 
623  print '<tr class="oddeven">';
624  print '<td class="nowrap">';
625  $proposalstatic->id = $obj->rowid;
626  $proposalstatic->ref = $obj->ref;
627  $proposalstatic->total_ht = $obj->total_ht;
628  $proposalstatic->total_tva = $obj->total_tva;
629  $proposalstatic->total_ttc = $obj->total_ttc;
630  print $proposalstatic->getNomUrl(1);
631  print '</td>';
632  print '<td class="center" width="80">';
633  if ($obj->dc) {
634  print dol_print_date($db->jdate($obj->dc), 'day');
635  } else {
636  print "-";
637  }
638  print '</td>';
639  print '<td class="right" class="nowrap">'.$proposalstatic->LibStatut($obj->fk_statut, 5).'</td>';
640  print '</tr>';
641  $i++;
642  }
643  $db->free($resql);
644 
645  if ($num > 0) {
646  print "</table></div>";
647  }
648  } else {
649  dol_print_error($db);
650  }
651  }
652 
653  /*
654  * Latest supplier orders
655  */
656  $orderstatic = new CommandeFournisseur($db);
657 
658  if ($user->rights->fournisseur->commande->lire) {
659  // TODO move to DAO class
660  // Check if there are supplier orders billable
661  $sql2 = 'SELECT s.nom, s.rowid as socid, s.client, c.rowid, c.ref, c.total_ht, c.ref_supplier,';
662  $sql2 .= ' c.date_valid, c.date_commande, c.date_livraison, c.fk_statut';
663  $sql2 .= ' FROM '.MAIN_DB_PREFIX.'societe as s';
664  $sql2 .= ', '.MAIN_DB_PREFIX.'commande_fournisseur as c';
665  $sql2 .= ' WHERE c.fk_soc = s.rowid';
666  $sql2 .= " AND c.entity IN (".getEntity('commande_fournisseur').")";
667  $sql2 .= ' AND s.rowid = '.((int) $object->id);
668  // Show orders we can bill
669  if (empty($conf->global->SUPPLIER_ORDER_TO_INVOICE_STATUS)) {
670  $sql2 .= " AND c.fk_statut IN (".$db->sanitize(CommandeFournisseur::STATUS_RECEIVED_COMPLETELY).")"; // Must match filter in htdocs/fourn/commande/list.php
671  } else {
672  // CommandeFournisseur::STATUS_ORDERSENT.", ".CommandeFournisseur::STATUS_RECEIVED_PARTIALLY.", ".CommandeFournisseur::STATUS_RECEIVED_COMPLETELY
673  $sql2 .= " AND c.fk_statut IN (".$db->sanitize($conf->global->SUPPLIER_ORDER_TO_INVOICE_STATUS).")";
674  }
675  $sql2 .= " AND c.billed = 0";
676  // Find order that are not already invoiced
677  // just need to check received status because we have the billed status now
678  //$sql2 .= " AND c.rowid NOT IN (SELECT fk_source FROM " . MAIN_DB_PREFIX . "element_element WHERE targettype='invoice_supplier')";
679  $resql2 = $db->query($sql2);
680  if ($resql2) {
681  $orders2invoice = $db->num_rows($resql2);
682  $db->free($resql2);
683  } else {
684  setEventMessages($db->lasterror(), null, 'errors');
685  }
686 
687  // TODO move to DAO class
688  $sql = "SELECT count(p.rowid) as total";
689  $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as p";
690  $sql .= " WHERE p.fk_soc = ".((int) $object->id);
691  $sql .= " AND p.entity IN (".getEntity('commande_fournisseur').")";
692  $resql = $db->query($sql);
693  if ($resql) {
694  $object_count = $db->fetch_object($resql);
695  $num = $object_count->total;
696  }
697 
698  $sql = "SELECT p.rowid,p.ref, p.date_commande as date, p.fk_statut, p.total_ht, p.total_tva, p.total_ttc";
699  $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as p";
700  $sql .= " WHERE p.fk_soc = ".((int) $object->id);
701  $sql .= " AND p.entity IN (".getEntity('commande_fournisseur').")";
702  $sql .= " ORDER BY p.date_commande DESC";
703  $sql .= $db->plimit($MAXLIST);
704 
705  $resql = $db->query($sql);
706  if ($resql) {
707  $i = 0;
708 
709  if ($num > 0) {
710  print '<div class="div-table-responsive-no-min">';
711  print '<table class="noborder centpercent lastrecordtable">';
712 
713  print '<tr class="liste_titre">';
714  print '<td colspan="4">';
715  print '<table class="nobordernopadding" width="100%"><tr><td>'.$langs->trans("LastSupplierOrders", ($num < $MAXLIST ? "" : $MAXLIST)).'</td>';
716  print '<td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/fourn/commande/list.php?socid='.$object->id.'"><span class="hideonsmartphone">'.$langs->trans("AllOrders").'</span><span class="badge marginleftonlyshort">'.$num.'</span></td>';
717  print '<td width="20px" class="right"><a href="'.DOL_URL_ROOT.'/commande/stats/index.php?mode=supplier&socid='.$object->id.'">'.img_picto($langs->trans("Statistics"), 'stats').'</a></td>';
718  print '</tr></table>';
719  print '</td></tr>';
720  }
721 
722  while ($i < $num && $i < $MAXLIST) {
723  $obj = $db->fetch_object($resql);
724 
725  $orderstatic->id = $obj->rowid;
726  $orderstatic->ref = $obj->ref;
727  $orderstatic->total_ht = $obj->total_ht;
728  $orderstatic->total_tva = $obj->total_tva;
729  $orderstatic->total_ttc = $obj->total_ttc;
730  $orderstatic->date = $db->jdate($obj->date);
731 
732  print '<tr class="oddeven">';
733  print '<td class="nowraponall">';
734  print $orderstatic->getNomUrl(1);
735  print '</td>';
736  print '<td class="center" width="80">';
737  if ($obj->date) {
738  print dol_print_date($orderstatic->date, 'day');
739  }
740  print '</td>';
741  print '<td class="right nowrap"><span class="amount">'.price($orderstatic->total_ttc).'</span></td>';
742  print '<td class="right" class="nowrap">'.$orderstatic->LibStatut($obj->fk_statut, 5).'</td>';
743  print '</tr>';
744  $i++;
745  }
746  $db->free($resql);
747 
748  if ($num > 0) {
749  print "</table></div>";
750  }
751  } else {
752  dol_print_error($db);
753  }
754  }
755 
756  /*
757  * Latest supplier invoices
758  */
759 
760  $langs->load('bills');
761  $facturestatic = new FactureFournisseur($db);
762 
763  if ($user->rights->fournisseur->facture->lire) {
764  // TODO move to DAO class
765  $sql = 'SELECT f.rowid, f.libelle as label, f.ref, f.ref_supplier, f.fk_statut, f.datef as df, f.total_ht, f.total_tva, f.total_ttc, f.paye,';
766  $sql .= ' SUM(pf.amount) as am';
767  $sql .= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as f';
768  $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON f.rowid=pf.fk_facturefourn';
769  $sql .= ' WHERE f.fk_soc = '.((int) $object->id);
770  $sql .= " AND f.entity IN (".getEntity('facture_fourn').")";
771  $sql .= ' GROUP BY f.rowid,f.libelle,f.ref,f.ref_supplier,f.fk_statut,f.datef,f.total_ht,f.total_tva,f.total_ttc,f.paye';
772  $sql .= ' ORDER BY f.datef DESC';
773  $resql = $db->query($sql);
774  if ($resql) {
775  $i = 0;
776  $num = $db->num_rows($resql);
777  if ($num > 0) {
778  print '<div class="div-table-responsive-no-min">';
779  print '<table class="noborder centpercent lastrecordtable">';
780 
781  print '<tr class="liste_titre">';
782  print '<td colspan="4">';
783  print '<table class="nobordernopadding" width="100%"><tr><td>'.$langs->trans('LastSuppliersBills', ($num <= $MAXLIST ? "" : $MAXLIST)).'</td>';
784  print '<td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/fourn/facture/list.php?socid='.$object->id.'"><span class="hideonsmartphone">'.$langs->trans('AllBills').'</span><span class="badge marginleftonlyshort">'.$num.'</span></td>';
785  print '<td width="20px" class="right"><a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?mode=supplier&socid='.$object->id.'">'.img_picto($langs->trans("Statistics"), 'stats').'</a></td>';
786  print '</tr></table>';
787  print '</td></tr>';
788  }
789 
790  while ($i < min($num, $MAXLIST)) {
791  $obj = $db->fetch_object($resql);
792 
793  $facturestatic->id = $obj->rowid;
794  $facturestatic->ref = ($obj->ref ? $obj->ref : $obj->rowid);
795  $facturestatic->ref_supplier = $obj->ref_supplier;
796  $facturestatic->libelle = $obj->label; // deprecated
797  $facturestatic->label = $obj->label;
798  $facturestatic->total_ht = $obj->total_ht;
799  $facturestatic->total_tva = $obj->total_tva;
800  $facturestatic->total_ttc = $obj->total_ttc;
801  $facturestatic->date = $db->jdate($obj->df);
802 
803  print '<tr class="oddeven">';
804  print '<td class="tdoverflowmax200">';
805  print '<span class="nowraponall">'.$facturestatic->getNomUrl(1).'</span>';
806  print $obj->ref_supplier ? ' - '.$obj->ref_supplier : '';
807  print ($obj->label ? ' - ' : '').dol_trunc($obj->label, 14);
808  print '</td>';
809  print '<td class="center nowrap">'.dol_print_date($facturestatic->date, 'day').'</td>';
810  print '<td class="right nowrap"><span class="amount">'.price($facturestatic->total_ttc).'</span></td>';
811  print '<td class="right nowrap">';
812  print $facturestatic->LibStatut($obj->paye, $obj->fk_statut, 5, $obj->am);
813  print '</td>';
814  print '</tr>';
815  $i++;
816  }
817  $db->free($resql);
818  if ($num > 0) {
819  print '</table></div>';
820  }
821  } else {
822  dol_print_error($db);
823  }
824  }
825 
826  print '</div></div>';
827  print '<div style="clear:both"></div>';
828 
829  print dol_get_fiche_end();
830 
831 
832  /*
833  * Action bar
834  */
835  print '<div class="tabsAction">';
836 
837  $parameters = array();
838  $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
839  // modified by hook
840  if (empty($reshook)) {
841  if ($object->status != 1) {
842  print dolGetButtonAction($langs->trans('ThirdPartyIsClosed'), $langs->trans('ThirdPartyIsClosed'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
843  }
844 
845  if (!empty($conf->supplier_proposal->enabled) && !empty($user->rights->supplier_proposal->creer)) {
846  $langs->load("supplier_proposal");
847  if ($object->status == 1) {
848  print dolGetButtonAction('', $langs->trans('AddSupplierProposal'), 'default', DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&amp;socid='.$object->id, '');
849  } else {
850  print dolGetButtonAction($langs->trans('ThirdPartyIsClosed'), $langs->trans('AddSupplierProposalGR'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
851  }
852  }
853 
854  if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) {
855  $langs->load("orders");
856  if ($object->status == 1) {
857  print dolGetButtonAction('', $langs->trans('AddSupplierOrderShort'), 'default', DOL_URL_ROOT.'/fourn/commande/card.php?action=create&amp;token='.newToken().'&amp;socid='.$object->id, '');
858  } else {
859  print dolGetButtonAction($langs->trans('ThirdPartyIsClosed'), $langs->trans('AddSupplierOrderShort'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
860  }
861  }
862 
863  if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) {
864  if (!empty($orders2invoice) && $orders2invoice > 0) {
865  if ($object->status == 1) {
866  // Company is open
867  print dolGetButtonAction('', $langs->trans('CreateInvoiceForThisSupplierGR'), 'default', DOL_URL_ROOT.'/fourn/commande/list.php?socid='.$object->id.'&amp;search_billed=0&amp;autoselectall=1', '');
868  } else {
869  print dolGetButtonAction('', $langs->trans('CreateInvoiceForThisCustomer'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
870  }
871  } else {
872  print dolGetButtonAction($langs->trans("NoOrdersToInvoice").' ('.$langs->trans("WithReceptionFinished").')', $langs->trans('CreateInvoiceForThisCustomer'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
873  }
874  }
875 
876  if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) {
877  $langs->load("bills");
878  if ($object->status == 1) {
879  print dolGetButtonAction('', $langs->trans('AddBill'), 'default', DOL_URL_ROOT.'/fourn/facture/card.php?action=create&amp;socid='.$object->id, '');
880  } else {
881  print dolGetButtonAction($langs->trans('ThirdPartyIsClosed'), $langs->trans('AddBill'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
882  }
883  }
884 
885  // Add action
886  if (isModEnabled('agenda') && !empty($conf->global->MAIN_REPEATTASKONEACHTAB) && $object->status == 1) {
887  if ($user->rights->agenda->myactions->create) {
888  print dolGetButtonAction('', $langs->trans('AddAction'), 'default', DOL_URL_ROOT.'/comm/action/card.php?action=create&amp;socid='.$object->id, '');
889  } else {
890  print dolGetButtonAction($langs->trans('NotAllowed'), $langs->trans('AddAction'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
891  }
892  }
893  }
894 
895  print '</div>';
896 
897 
898  if (!empty($conf->global->MAIN_DUPLICATE_CONTACTS_TAB_ON_MAIN_CARD)) {
899  print '<br>';
900  // List of contacts
901  show_contacts($conf, $langs, $db, $object, $_SERVER["PHP_SELF"].'?socid='.$object->id);
902  }
903 
904  if (!empty($conf->global->MAIN_REPEATTASKONEACHTAB)) {
905  print load_fiche_titre($langs->trans("ActionsOnCompany"), '', '');
906 
907  // List of todo actions
908  show_actions_todo($conf, $langs, $db, $object);
909 
910  // List of done actions
911  show_actions_done($conf, $langs, $db, $object);
912  }
913 } else {
914  dol_print_error($db);
915 }
916 
917 // End of page
918 llxFooter();
919 $db->close();
yn
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
Definition: functions.lib.php:6491
dol_escape_htmltag
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
Definition: functions.lib.php:1468
dol_trunc
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '…' if string larger than length.
Definition: functions.lib.php:3805
restrictedArea
restrictedArea($user, $features, $objectid=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
Definition: security.lib.php:234
llxFooter
llxFooter()
Empty footer.
Definition: wrapper.php:73
load_fiche_titre
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
Definition: functions.lib.php:5204
GETPOST
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Definition: functions.lib.php:484
FactureFournisseur
Class to manage suppliers invoices.
Definition: fournisseur.facture.class.php:53
dol_print_error
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
Definition: functions.lib.php:4844
show_actions_todo
show_actions_todo($conf, $langs, $db, $filterobj, $objcon='', $noprint=0, $actioncode='')
Show html area with actions to do.
Definition: company.lib.php:1358
$form
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:142
dolGetButtonAction
dolGetButtonAction($label, $html='', $actionType='default', $url='', $id='', $userRight=1, $params=array())
Function dolGetButtonAction.
Definition: functions.lib.php:10450
dol_clone
dol_clone($object, $native=0)
Create a clone of instance of object (new instance with same value for each properties) With native =...
Definition: functions.lib.php:1158
img_edit
img_edit($titlealt='default', $float=0, $other='')
Show logo editer/modifier fiche.
Definition: functions.lib.php:4389
dol_banner_tab
dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
Show tab footer of a card.
Definition: functions.lib.php:2046
$help_url
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
Definition: agenda.php:116
price2num
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
Definition: functions.lib.php:5661
dol_print_date
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
Definition: functions.lib.php:2514
img_picto
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
Definition: functions.lib.php:3880
showValueWithClipboardCPButton
showValueWithClipboardCPButton($valuetocopy, $showonlyonhover=1, $texttoshow='')
Create a button to copy $valuetocopy in the clipboard (for copy and paste feature).
Definition: functions.lib.php:11087
Fournisseur
Class to manage suppliers.
Definition: fournisseur.class.php:34
show_actions_done
show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=0, $actioncode='', $donetodo='done', $filters=array(), $sortfield='a.datep, a.id', $sortorder='DESC', $module='')
Show html area with actions (done or not, ignore the name of function).
Definition: company.lib.php:1389
show_contacts
show_contacts($conf, $langs, $db, $object, $backtopage='', $showuserlogin=0)
Show html area for list of contacts.
Definition: company.lib.php:907
Contact
Class to manage contact/addresses.
Definition: contact.class.php:40
CommandeFournisseur\STATUS_RECEIVED_COMPLETELY
const STATUS_RECEIVED_COMPLETELY
Received completely.
Definition: fournisseur.commande.class.php:293
Adherent
Class to manage members of a foundation.
Definition: adherent.class.php:46
dol_get_fiche_head
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
Definition: functions.lib.php:1822
societe_prepare_head
societe_prepare_head(Societe $object)
Return array of tabs to used on pages for third parties cards.
Definition: company.lib.php:42
newToken
newToken()
Return the value of token currently saved into session with name 'newtoken'.
Definition: functions.lib.php:10878
dol_get_fiche_end
dol_get_fiche_end($notab=0)
Return tab footer of a card.
Definition: functions.lib.php:2018
isModEnabled
isModEnabled($module)
Is Dolibarr module enabled.
Definition: functions.lib.php:105
CommandeFournisseur
Class to manage predefined suppliers products.
Definition: fournisseur.commande.class.php:47
ExtraFields
Class to manage standard extra fields.
Definition: extrafields.class.php:39
Product
Class to manage products or services.
Definition: product.class.php:46
Form
Class to manage generation of HTML components Only common components must be here.
Definition: html.form.class.php:52
$parameters
$parameters
Actions.
Definition: card.php:78
$resql
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire)||(isModEnabled('supplier_invoice') && $user->rights->supplier_invoice->lire)) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
Definition: index.php:742
price
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.
Definition: functions.lib.php:5541
setEventMessages
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
Definition: functions.lib.php:8137
accessforbidden
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
Definition: security.lib.php:933
SupplierProposal
Class to manage price ask supplier.
Definition: supplier_proposal.class.php:50
llxHeader
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Definition: wrapper.php:59
dol_htmlentities
dol_htmlentities($string, $flags=ENT_QUOTES|ENT_SUBSTITUTE, $encoding='UTF-8', $double_encode=false)
Replace htmlentities functions.
Definition: functions.lib.php:7075