35require
'../main.inc.php';
45require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.class.php';
46require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
47require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture-rec.class.php';
48require_once DOL_DOCUMENT_ROOT.
'/supplier_proposal/class/supplier_proposal.class.php';
49require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
50require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
51require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
53 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
56 require_once DOL_DOCUMENT_ROOT.
'/core/lib/accounting.lib.php';
57 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingaccount.class.php';
60 require_once DOL_DOCUMENT_ROOT.
'/contrat/class/contrat.class.php';
64$langs->loadLangs(array(
'accountancy',
'companies',
'suppliers',
'products',
'bills',
'orders',
'commercial',
'contracts'));
66$action =
GETPOST(
'action',
'aZ09');
67$cancel =
GETPOST(
'cancel',
'alpha');
70if ($user->isExternalUser()) {
71 $id = $user->isExternalUser();
75$hookmanager->initHooks(array(
'thirdpartysupplier',
'globalcard'));
77$result =
restrictedArea($user,
'societe&fournisseur', $id,
'&societe',
'',
'rowid');
82$extrafields->fetch_name_optionals_label(
$object->table_element);
84$permissiontoadd = $user->hasRight(
'societe',
'creer');
85$permissiontoeditextra = $permissiontoadd;
86if (
GETPOST(
'attribute',
'aZ09') && isset($extrafields->attributes[
$object->table_element][
'perms'][
GETPOST(
'attribute',
'aZ09')])) {
88 $permissiontoeditextra =
dol_eval((
string) $extrafields->attributes[
$object->table_element][
'perms'][
GETPOST(
'attribute',
'aZ09')]);
92$result =
restrictedArea($user,
'societe', $id,
'&societe',
'',
'fk_soc',
'rowid', 0);
95 if (!(
$object->fournisseur > 0) || !$user->hasRight(
"fournisseur",
"lire")) {
105$parameters = array(
'id' => $id);
106$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
108 setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
111if (empty($reshook)) {
117 if ($action ==
'setsupplieraccountancycodegeneral' && $user->hasRight(
'societe',
'creer')) {
119 $object->accountancy_code_supplier_general =
GETPOST(
"supplieraccountancycodegeneral");
123 $_GET[
'action'] =
'editsupplieraccountancycode';
128 if ($action ==
'setsupplieraccountancycode' && $user->hasRight(
'societe',
'creer')) {
130 $object->code_compta_fournisseur =
GETPOST(
"supplieraccountancycode");
134 $action =
'editsupplieraccountancycode';
138 if ($action ==
'settva_intra' && $user->hasRight(
'societe',
'creer')) {
147 if ($action ==
'setconditions' && $user->hasRight(
'societe',
'creer')) {
149 $result =
$object->setPaymentTerms(
GETPOSTINT(
'cond_reglement_supplier_id'),
GETPOSTINT(
'cond_reglement_supplier_id_deposit_percent'));
151 dol_print_error($db,
$object->error);
155 if ($action ==
'setmode' && $user->hasRight(
'societe',
'creer')) {
159 dol_print_error($db,
$object->error);
164 if ($action ==
'setbankaccount' && $user->hasRight(
'societe',
'creer')) {
173 if ($action ==
'setsupplier_order_min_amount' && $user->hasRight(
'societe',
'creer')) {
182 if ($action ==
'update_extras' && $permissiontoeditextra) {
187 $attribute_name =
GETPOST(
'attribute',
'aZ09');
190 $ret = $extrafields->setOptionalsFromPost(
null, $object, $attribute_name);
196 $result =
$object->updateExtraField($attribute_name,
'COMPANY_MODIFY');
204 $action =
'edit_extras';
214$contactstatic =
new Contact($db);
215$form =
new Form($db);
217if ($id > 0 && empty(
$object->id)) {
222 dol_print_error($db,
$object->error);
228 $langs->load(
"errors");
229 llxHeader(
'', $langs->trans(
"ThirdParty").
' - '.$langs->trans(
'Supplier'));
230 print
'<div class="warning">'.$langs->trans(
"ErrorRecordNotFound").
' ('.$langs->trans(
"Supplier").
')';
231 print
' <a href="'.DOL_URL_ROOT.
'/societe/card.php?socid='.((int) $id).
'">'.$langs->trans(
"ThirdParty").
'</a>';
240 $title = $langs->trans(
"ThirdParty").
" - ".$langs->trans(
'Supplier');
242 $title =
$object->name.
" - ".$langs->trans(
'Supplier');
245 llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-fourn page-card');
252 print
dol_get_fiche_head($head,
'supplier', $langs->trans(
"ThirdParty"), -1,
'company');
254 $linkback =
'<a href="'.DOL_URL_ROOT.
'/societe/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
256 dol_banner_tab($object,
'socid', $linkback, ($user->socid ? 0 : 1),
'rowid',
'nom');
258 print
'<div class="fichecenter"><div class="fichehalfleft">';
260 print
'<div class="underbanner clearboth"></div>';
261 print
'<table class="border centpercent tableforfield">';
264 print
'<tr><td class="titlefield">'.$langs->trans(
'NatureOfThirdParty').
'</td><td>';
269 $langs->load(
'compta');
272 print
'<td class="titlefield">'.$langs->trans(
"SupplierCode").
'</td><td>';
274 $tmpcheck =
$object->check_codefournisseur();
275 if ($tmpcheck != 0 && $tmpcheck != -5) {
276 print
' <span class="paddingleftimp error inline-block valignmiddle" title="'.$object->error.
'">('.$langs->trans(
"WrongSupplierCode").
')</span>';
286 print $form->editfieldkey(
"SupplierAccountancyCodeGeneral",
'supplieraccountancycodegeneral',
length_accountg(
$object->accountancy_code_supplier_general), $object, $user->hasRight(
'societe',
'creer'));
288 if ($action ==
'editsupplieraccountancycodegeneral' && $user->hasRight(
'societe',
'creer')) {
289 print $formaccounting->formAccountingAccount($_SERVER[
'PHP_SELF'].
'?id='.
$object->id,
$object->accountancy_code_supplier_general,
'supplieraccountancycodegeneral', 0, 1,
'', 1);
291 if (
$object->accountancy_code_supplier_general > 0) {
293 $accountingaccount->fetch(0,
$object->accountancy_code_supplier_general, 1);
295 print $accountingaccount->getNomUrl(0, 1, 1,
'', 1);
298 if (
$object->accountancy_code_supplier_general > 0) {
301 $accountingAccountByDefault =
'<span class="opacitymedium">' . $langs->trans(
"AccountingAccountByDefaultShort") .
": " .
length_accountg(
getDolGlobalString(
'ACCOUNTING_ACCOUNT_SUPPLIER')) .
'</span>';
302 print $accountingAccountByDefault;
311 print $form->editfieldkey(
"SupplierAccountancyCode",
'supplieraccountancycode',
$object->code_compta_fournisseur, $object, $user->hasRight(
'societe',
'creer'));
313 print $form->editfieldval(
"SupplierAccountancyCode",
'supplieraccountancycode',
$object->code_compta_fournisseur, $object, $user->hasRight(
'societe',
'creer'));
320 print
'<td class="titlefield">';
321 print $form->textwithpicto($langs->trans(
'VATIsUsed'), $langs->trans(
'VATIsUsedWhenSelling'));
328 if (
$mysoc->useLocalTax(1)) {
329 print
'<tr><td>'.$langs->transcountry(
"LocalTax1IsUsed",
$mysoc->country_code).
'</td><td>';
330 print yn(
$object->localtax1_assuj);
333 if (
$mysoc->useLocalTax(2)) {
334 print
'<tr><td>'.$langs->transcountry(
"LocalTax2IsUsed",
$mysoc->country_code).
'</td><td>';
335 print yn(
$object->localtax2_assuj);
342 print
'<td class="titlefield">';
343 print $form->textwithpicto($langs->trans(
'VATReverseChargeByDefault'), $langs->trans(
'VATReverseChargeByDefaultDesc').
'<br>'.$langs->trans(
'ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE_DESC'));
345 print
'<input type="checkbox" name="vat_reverse_charge" ' . (
$object->vat_reverse_charge ==
'1' ?
' checked' :
'') .
' disabled>';
351 print
'<tr><td class="nowrap">';
354 print $form->editfieldkey(
"VATIntra",
'tva_intra',
$object->tva_intra, $object, $user->hasRight(
'societe',
'creer'));
356 print $form->editfieldval(
"VATIntra",
'tva_intra', $vattoshow, $object, $user->hasRight(
'societe',
'creer'),
'string',
$object->tva_intra,
null,
null,
'', 1,
'',
'id',
'auto', array(
'valuealreadyhtmlescaped' => 1));
360 $langs->load(
'bills');
361 $form =
new Form($db);
363 print
'<table width="100%" class="nobordernopadding"><tr><td>';
364 print $langs->trans(
'PaymentConditions');
366 if (($action !=
'editconditions') && $user->hasRight(
'societe',
'creer')) {
367 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>';
369 print
'</tr></table>';
371 if ($action ==
'editconditions') {
372 $form->form_conditions_reglement($_SERVER[
'PHP_SELF'] .
'?socid=' .
$object->id, (
string)
$object->cond_reglement_supplier_id,
'cond_reglement_supplier_id', 1,
'', 1,
$object->deposit_percent);
374 $form->form_conditions_reglement($_SERVER[
'PHP_SELF'] .
'?socid=' .
$object->id, (
string)
$object->cond_reglement_supplier_id,
'none', 0,
'', 1,
$object->deposit_percent);
380 print
'<tr><td class="nowrap">';
381 print
'<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
382 print $langs->trans(
'PaymentMode');
384 if (($action !=
'editmode') && $user->hasRight(
'societe',
'creer')) {
385 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>';
387 print
'</tr></table>';
389 if ($action ==
'editmode') {
390 $form->form_modes_reglement($_SERVER[
'PHP_SELF'].
'?socid='.
$object->id, (
string)
$object->mode_reglement_supplier_id,
'mode_reglement_supplier_id',
'DBIT', 1, 1);
392 $form->form_modes_reglement($_SERVER[
'PHP_SELF'].
'?socid='.
$object->id, (
string)
$object->mode_reglement_supplier_id,
'none');
399 print
'<tr><td class="nowrap">';
400 print
'<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
401 print $langs->trans(
'PaymentBankAccount');
403 if (($action !=
'editbankaccount') && $user->hasRight(
'societe',
'creer')) {
404 print
'<td class="right"><a class="editfielda" href="'.$_SERVER[
"PHP_SELF"].
'?action=editbankaccount&token='.
newToken().
'&socid='.
$object->id.
'">'.img_edit($langs->trans(
'SetBankAccount'), 1).
'</a></td>';
406 print
'</tr></table>';
408 if ($action ==
'editbankaccount') {
409 $form->formSelectAccount($_SERVER[
'PHP_SELF'].
'?socid='.
$object->id, (
string)
$object->fk_account,
'fk_account', 1);
411 $form->formSelectAccount($_SERVER[
'PHP_SELF'].
'?socid='.
$object->id, (
string)
$object->fk_account,
'none');
418 print
'<tr><td class="nowrap">';
419 print
'<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
420 print $langs->trans(
"CustomerRelativeDiscountShort");
421 print
'<td><td class="right">';
422 if ($user->hasRight(
'societe',
'creer') && !$user->socid > 0) {
423 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>';
425 print
'</td></tr></table>';
426 print
'</td><td>'.($object->remise_supplier_percent ?
'<a href="'.DOL_URL_ROOT.
'/comm/remise.php?id='.
$object->id.
'">'.
$object->remise_supplier_percent.
'%</a>' :
'').
'</td>';
430 print
'<tr><td class="nowrap">';
431 print
'<table width="100%" class="nobordernopadding">';
432 print
'<tr><td class="nowrap">';
433 print $langs->trans(
"CustomerAbsoluteDiscountShort");
434 print
'<td><td class="right">';
435 if ($user->hasRight(
'societe',
'creer') && !$user->socid > 0) {
436 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>';
438 print
'</td></tr></table>';
441 $amount_discount =
$object->getAvailableDiscounts(
null,
'', 0, 1);
442 if ($amount_discount < 0) {
443 dol_print_error($db,
$object->error);
445 if ($amount_discount > 0) {
446 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>';
453 print
'<tr class="nowrap">';
455 print $form->editfieldkey(
"OrderMinAmount",
'supplier_order_min_amount',
$object->supplier_order_min_amount, $object, $user->hasRight(
"societe",
"creer"));
458 $limit_field_type =
'amount';
459 print $form->editfieldval(
"OrderMinAmount",
'supplier_order_min_amount',
$object->supplier_order_min_amount, $object, $user->hasRight(
"societe",
"creer"), $limit_field_type, (
$object->supplier_order_min_amount !=
'' ?
price(
$object->supplier_order_min_amount) :
''));
466 $langs->load(
"categories");
467 print
'<tr><td>'.$langs->trans(
"SuppliersCategoriesShort").
'</td>';
469 print $form->showCategories(
$object->id, Categorie::TYPE_SUPPLIER, 1);
474 $parameters = array(
'socid' =>
$object->id,
'colspan' =>
' colspan="3"',
'colspanvalue' =>
'3');
475 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
479 $langs->load(
"members");
480 $langs->load(
"users");
481 print
'<tr><td>'.$langs->trans(
"LinkedToDolibarrMember").
'</td>';
484 $result = $adh->fetch(0,
'',
$object->id);
486 $adh->ref = $adh->getFullName($langs);
487 print $adh->getNomUrl(1);
489 print $langs->trans(
"ThirdpartyNotLinkedToMember");
498 print
'</div><div class="fichehalfright">';
505 print
'<div class="underbanner underbanner-before-box clearboth"></div>';
509 $boxstat .=
'<div class="box divboxtable box-halfright">';
510 $boxstat .=
'<table summary="'.dol_escape_htmltag($langs->trans(
"DolibarrStateBoard")).
'" class="border boxtable boxtablenobottom boxtablenotop" width="100%">';
511 $boxstat .=
'<tr class="impair nohover"><td colspan="2" class="tdboxstats nohover">';
515 $tmp =
$object->getOutstandingProposals(
'supplier');
516 $outstandingOpened = $tmp[
'opened'];
517 $outstandingTotal = $tmp[
'total_ht'];
518 $outstandingTotalIncTax = $tmp[
'total_ttc'];
519 $text = $langs->trans(
"OverAllSupplierProposals");
520 $link = DOL_URL_ROOT.
'/supplier_proposal/list.php?socid='.
$object->id;
523 $boxstat .=
'<a href="'.$link.
'" class="boxstatsindicator thumbstat nobold nounderline">';
525 $boxstat .=
'<div class="boxstats" title="'.dol_escape_htmltag($text).
'">';
526 $boxstat .=
'<span class="boxstatstext">'.img_object(
"", $icon).
' <span>'.$text.
'</span></span><br>';
527 $boxstat .=
'<span class="boxstatsindicator">'.price($outstandingTotal, 1, $langs, 1, -1, -1,
$conf->currency).
'</span>';
528 $boxstat .=
'</div>';
536 $tmp =
$object->getOutstandingOrders(
'supplier');
537 $outstandingOpened = $tmp[
'opened'];
538 $outstandingTotal = $tmp[
'total_ht'];
539 $outstandingTotalIncTax = $tmp[
'total_ttc'];
540 $text = $langs->trans(
"OverAllOrders");
541 $link = DOL_URL_ROOT.
'/fourn/commande/list.php?socid='.
$object->id;
544 $boxstat .=
'<a href="'.$link.
'" class="boxstatsindicator thumbstat nobold nounderline">';
546 $boxstat .=
'<div class="boxstats" title="'.dol_escape_htmltag($text).
'">';
547 $boxstat .=
'<span class="boxstatstext">'.img_object(
"", $icon).
' <span>'.$text.
'</span></span><br>';
548 $boxstat .=
'<span class="boxstatsindicator">'.price($outstandingTotal, 1, $langs, 1, -1, -1,
$conf->currency).
'</span>';
549 $boxstat .=
'</div>';
555 if (
isModEnabled(
"supplier_invoice") && ($user->hasRight(
'fournisseur',
'facture',
'lire') || $user->hasRight(
'supplier_invoice',
'read'))) {
557 $tmp =
$object->getOutstandingBills(
'supplier');
558 $outstandingOpened = $tmp[
'opened'];
559 $outstandingTotal = $tmp[
'total_ht'];
560 $outstandingTotalIncTax = $tmp[
'total_ttc'];
562 $text = $langs->trans(
"OverAllInvoices");
563 $link = DOL_URL_ROOT.
'/fourn/facture/list.php?socid='.
$object->id;
566 $boxstat .=
'<a href="'.$link.
'" class="boxstatsindicator thumbstat nobold nounderline">';
568 $boxstat .=
'<div class="boxstats" title="'.dol_escape_htmltag($text).
'">';
569 $boxstat .=
'<span class="boxstatstext">'.img_object(
"", $icon).
' <span>'.$text.
'</span></span><br>';
570 $boxstat .=
'<span class="boxstatsindicator">'.price($outstandingTotal, 1, $langs, 1, -1, -1,
$conf->currency).
'</span>';
571 $boxstat .=
'</div>';
577 $text = $langs->trans(
"CurrentOutstandingBill");
578 $link = DOL_URL_ROOT.
'/fourn/recap-fourn.php?socid='.
$object->id;
581 $boxstat .=
'<a href="'.$link.
'" class="boxstatsindicator thumbstat nobold nounderline">';
583 $boxstat .=
'<div class="boxstats" title="'.dol_escape_htmltag($text).
'">';
584 $boxstat .=
'<span class="boxstatstext">'.img_object(
"", $icon).
' <span>'.$text.
'</span></span><br>';
585 $boxstat .=
'<span class="boxstatsindicator'.($outstandingOpened > 0 ?
' amountremaintopay' :
'').
'">'.
price($outstandingOpened, 1, $langs, 1, -1, -1,
$conf->currency).$warn.
'</span>';
586 $boxstat .=
'</div>';
591 $tmp =
$object->getOutstandingBills(
'supplier', 1);
592 $outstandingOpenedLate = $tmp[
'opened'];
593 if ($outstandingOpened != $outstandingOpenedLate && !empty($outstandingOpenedLate)) {
594 $text = $langs->trans(
"CurrentOutstandingBillLate");
595 $link = DOL_URL_ROOT.
'/fourn/recap-fourn.php?socid='.
$object->id;
598 $boxstat .=
'<a href="'.$link.
'" class="boxstatsindicator thumbstat nobold nounderline">';
600 $boxstat .=
'<div class="boxstats" title="'.dol_escape_htmltag($text).
'">';
601 $boxstat .=
'<span class="boxstatstext">'.img_object(
"", $icon).
' <span>'.$text.
'</span></span><br>';
602 $boxstat .=
'<span class="boxstatsindicator'.($outstandingOpenedLate > 0 ?
' amountremaintopay' :
'').
'">'.
price($outstandingOpenedLate, 1, $langs, 1, -1, -1,
$conf->currency).$warn.
'</span>';
603 $boxstat .=
'</div>';
611 $parameters = array();
612 $reshook = $hookmanager->executeHooks(
'addMoreBoxStatsSupplier', $parameters, $object, $action);
613 if (empty($reshook)) {
614 $boxstat .= $hookmanager->resPrint;
617 $boxstat .=
'</td></tr>';
618 $boxstat .=
'</table>';
619 $boxstat .=
'</div>';
631 $langs->load(
"products");
633 $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,';
634 $sql .=
' pfp.tms, pfp.ref_fourn as supplier_ref, pfp.price, pfp.quantity, pfp.unitprice';
635 $sql .=
' FROM '.MAIN_DB_PREFIX.
'product_fournisseur_price as pfp';
636 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"product as p ON p.rowid = pfp.fk_product";
637 $sql .=
' WHERE p.entity IN ('.getEntity(
'product').
')';
638 $sql .=
' AND pfp.fk_soc = '.((int)
$object->id);
639 $sql .= $db->order(
'pfp.tms',
'desc');
640 $sql .= $db->plimit($MAXLIST);
642 $query = $db->query($sql);
644 dol_print_error($db);
647 $num = $db->num_rows($query);
649 print
'<div class="div-table-responsive-no-min">';
650 print
'<table class="noborder centpercent lastrecordtable">';
651 print
'<tr class="liste_titre'.(($num == 0) ?
' nobottom' :
'').
'">';
652 print
'<td colspan="2">'.$langs->trans(
"ProductsAndServices").
'</td><td class="right" colspan="2">';
653 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>';
654 print
'</a></td></tr>';
658 $productstatic =
new Product($db);
660 while ($objp = $db->fetch_object($query)) {
661 $productstatic->id = $objp->rowid;
662 $productstatic->ref = $objp->ref;
663 $productstatic->label = $objp->label;
664 $productstatic->type = $objp->fk_product_type;
665 $productstatic->entity = $objp->entity;
666 $productstatic->status = $objp->status;
667 $productstatic->status_buy = $objp->status_buy;
668 $productstatic->status_batch = $objp->status_batch;
670 print
'<tr class="oddeven">';
671 print
'<td class="nowrap">';
672 print $productstatic->getNomUrl(1);
677 print
'<td class="tdoverflowmax200">';
681 print
'<td class="right">';
683 if (isset($objp->price)) {
684 print
'<span class="amount">'.price($objp->price).
'</span>';
685 if ($objp->quantity > 1) {
687 print $objp->quantity;
694 print
'<tr><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"NoProductPriceDefinedForThisSupplier").
'</span></td></tr>';
707 if ($user->hasRight(
"supplier_proposal",
"lire")) {
708 $langs->loadLangs(array(
"supplier_proposal"));
710 $sql =
"SELECT p.rowid, p.ref, p.date_valid as dc, p.fk_statut, p.total_ht, p.total_tva, p.total_ttc";
711 $sql .=
" FROM ".MAIN_DB_PREFIX.
"supplier_proposal as p ";
712 $sql .=
" WHERE p.fk_soc = ".((int)
$object->id);
713 $sql .=
" AND p.entity IN (".getEntity(
'supplier_proposal').
")";
714 $sql .=
" ORDER BY p.date_valid DESC";
715 $sql .= $db->plimit($MAXLIST);
717 $resql = $db->query($sql);
720 $num = $db->num_rows($resql);
723 print
'<div class="div-table-responsive-no-min">';
724 print
'<table class="noborder centpercent lastrecordtable">';
726 print
'<tr class="liste_titre">';
727 print
'<td colspan="3">';
728 print
'<table class="nobordernopadding centpercent"><tr><td>'.$langs->trans(
"LastSupplierProposals", ($num < $MAXLIST ?
"" : $MAXLIST)).
'</td>';
729 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>';
731 print
'</tr></table>';
735 while ($i < $num && $i <= $MAXLIST) {
736 $obj = $db->fetch_object($resql);
738 print
'<tr class="oddeven">';
739 print
'<td class="nowrap">';
740 $proposalstatic->id = $obj->rowid;
741 $proposalstatic->ref = $obj->ref;
742 $proposalstatic->total_ht = $obj->total_ht;
743 $proposalstatic->total_tva = $obj->total_tva;
744 $proposalstatic->total_ttc = $obj->total_ttc;
745 print $proposalstatic->getNomUrl(1);
747 print
'<td class="center" width="80">';
754 print
'<td class="right" class="nowrap">'.$proposalstatic->LibStatut($obj->fk_statut, 5).
'</td>';
761 print
"</table></div>";
764 dol_print_error($db);
774 if ($user->hasRight(
"fournisseur",
"commande",
"lire")) {
777 $sql2 =
'SELECT s.nom, s.rowid as socid, s.client, c.rowid, c.ref, c.total_ht, c.ref_supplier,';
778 $sql2 .=
' c.date_valid, c.date_commande, c.date_livraison, c.fk_statut';
779 $sql2 .=
' FROM '.MAIN_DB_PREFIX.
'societe as s';
780 $sql2 .=
', '.MAIN_DB_PREFIX.
'commande_fournisseur as c';
781 $sql2 .=
' WHERE c.fk_soc = s.rowid';
782 $sql2 .=
" AND c.entity IN (".getEntity(
'commande_fournisseur').
")";
783 $sql2 .=
' AND s.rowid = '.((int)
$object->id);
789 $sql2 .=
" AND c.fk_statut IN (".$db->sanitize(
getDolGlobalString(
'SUPPLIER_ORDER_TO_INVOICE_STATUS')).
")";
791 $sql2 .=
" AND c.billed = 0";
795 $resql2 = $db->query($sql2);
797 $orders2invoice = $db->num_rows($resql2);
800 setEventMessages($db->lasterror(),
null,
'errors');
804 $sql =
"SELECT count(p.rowid) as total";
805 $sql .=
" FROM ".MAIN_DB_PREFIX.
"commande_fournisseur as p";
806 $sql .=
" WHERE p.fk_soc = ".((int)
$object->id);
807 $sql .=
" AND p.entity IN (".getEntity(
'commande_fournisseur').
")";
809 $resql = $db->query($sql);
811 $object_count = $db->fetch_object($resql);
812 $num = $object_count->total;
815 $sql =
"SELECT p.rowid,p.ref, p.date_commande as date, p.fk_statut, p.total_ht, p.total_tva, p.total_ttc";
816 $sql .=
" FROM ".MAIN_DB_PREFIX.
"commande_fournisseur as p";
817 $sql .=
" WHERE p.fk_soc = ".((int)
$object->id);
818 $sql .=
" AND p.entity IN (".getEntity(
'commande_fournisseur').
")";
819 $sql .=
" ORDER BY p.date_commande DESC";
820 $sql .= $db->plimit($MAXLIST);
822 $resql = $db->query($sql);
827 print
'<div class="div-table-responsive-no-min">';
828 print
'<table class="noborder centpercent lastrecordtable">';
830 print
'<tr class="liste_titre">';
831 print
'<td colspan="4">';
832 print
'<table class="nobordernopadding" width="100%"><tr><td>'.$langs->trans(
"LastSupplierOrders", ($num < $MAXLIST ?
"" : $MAXLIST)).
'</td>';
833 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>';
834 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>';
835 print
'</tr></table>';
839 while ($i < $num && $i < $MAXLIST) {
840 $obj = $db->fetch_object($resql);
842 $orderstatic->id = $obj->rowid;
843 $orderstatic->ref = $obj->ref;
844 $orderstatic->total_ht = $obj->total_ht;
845 $orderstatic->total_tva = $obj->total_tva;
846 $orderstatic->total_ttc = $obj->total_ttc;
847 $orderstatic->date = $db->jdate($obj->date);
849 print
'<tr class="oddeven">';
850 print
'<td class="nowraponall">';
851 print $orderstatic->getNomUrl(1);
853 print
'<td class="center" width="80">';
858 print
'<td class="right nowrap"><span class="amount">'.price($orderstatic->total_ttc).
'</span></td>';
859 print
'<td class="right" class="nowrap">'.$orderstatic->LibStatut($obj->fk_statut, 5).
'</td>';
866 print
"</table></div>";
869 dol_print_error($db);
877 if (
isModEnabled(
"supplier_invoice") && ($user->hasRight(
'fournisseur',
'facture',
'lire') || $user->hasRight(
'supplier_invoice',
'read'))) {
878 $sql =
'SELECT f.rowid as id, f.titre as ref';
879 $sql .=
', f.total_ht';
880 $sql .=
', f.total_tva';
881 $sql .=
', f.total_ttc';
882 $sql .=
', f.datec as dc';
883 $sql .=
', f.date_last_gen, f.date_when';
884 $sql .=
', f.frequency';
885 $sql .=
', f.unit_frequency';
886 $sql .=
', f.suspended as suspended';
887 $sql .=
', s.nom, s.rowid as socid';
888 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s,".MAIN_DB_PREFIX.
"facture_fourn_rec as f";
889 $sql .=
" WHERE f.fk_soc = s.rowid AND s.rowid = ".((int)
$object->id);
890 $sql .=
" AND f.entity IN (".getEntity(
'invoice').
")";
891 $sql .=
' GROUP BY f.rowid, f.titre, f.total_ht, f.total_tva, f.total_ttc,';
892 $sql .=
' f.date_last_gen, f.datec, f.frequency, f.unit_frequency,';
893 $sql .=
' f.suspended, f.date_when,';
894 $sql .=
' s.nom, s.rowid';
895 $sql .= $db->order(
"f.date_last_gen, f.datec",
"DESC");
897 $resql = $db->query($sql);
901 $num = $db->num_rows($resql);
903 print
'<div class="div-table-responsive-no-min">';
904 print
'<table class="noborder centpercent lastrecordtable">';
905 print
'<tr class="liste_titre">';
910 print
'<td colspan="'.$colspan.
'">';
911 print
'<table class="centpercent nobordernopadding"><tr>';
912 print
'<td>'.$langs->trans(
"LatestSupplierTemplateInvoices", ($num <= $MAXLIST ?
"" : $MAXLIST)).
'</td>';
913 print
'<td class="right">';
914 print
'<a class="notasortlink" href="'.DOL_URL_ROOT.
'/fourn/facture/list-rec.php?socid='.
$object->id.
'">';
915 print
'<span class="hideonsmartphone">'.$langs->trans(
"AllSupplierTemplateInvoices").
'</span><span class="badge marginleftonlyshort">'.$num.
'</span></a></td>';
916 print
'</tr></table>';
922 while ($i < $num && $i < $MAXLIST) {
923 $objp = $db->fetch_object($resql);
925 $invoicetemplate->id = $objp->id;
926 $invoicetemplate->ref = $objp->ref;
927 $invoicetemplate->suspended = $objp->suspended;
928 $invoicetemplate->frequency = $objp->frequency;
929 $invoicetemplate->unit_frequency = $objp->unit_frequency;
930 $invoicetemplate->total_ht = $objp->total_ht;
931 $invoicetemplate->total_tva = $objp->total_tva;
932 $invoicetemplate->total_ttc = $objp->total_ttc;
933 $invoicetemplate->date_last_gen = $db->jdate($objp->date_last_gen);
934 $invoicetemplate->date_when = $db->jdate($objp->date_when);
936 print
'<tr class="oddeven">';
937 print
'<td class="tdoverflowmax250">';
938 print $invoicetemplate->getNomUrl(1);
941 if ($objp->frequency && $objp->date_last_gen > 0) {
942 print
'<td class="right" width="80px">'.dol_print_date($db->jdate($objp->date_last_gen),
'day').
'</td>';
945 print
'<td class="right" width="80px">'.dol_print_date($db->jdate($objp->dc),
'day').
'</td>';
947 print
'<td class="right"><b>!!!</b></td>';
950 print
'<td class="right nowraponall">';
951 print
price($objp->total_ht);
955 print
'<td class="right nowraponall">';
956 print
price($objp->total_ttc);
960 print
'<td class="nowrap right" style="min-width: 60px">';
961 print $langs->trans(
'FrequencyPer_'.$invoicetemplate->unit_frequency, $invoicetemplate->frequency).
' - ';
962 print($invoicetemplate->LibStatut($invoicetemplate->frequency, $invoicetemplate->suspended, 5, 0));
974 dol_print_error($db);
983 $langs->load(
'bills');
986 if ($user->hasRight(
'fournisseur',
'facture',
'lire')) {
988 $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,';
989 $sql .=
' SUM(pf.amount) as am';
990 $sql .=
' FROM '.MAIN_DB_PREFIX.
'facture_fourn as f';
991 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'paiementfourn_facturefourn as pf ON f.rowid=pf.fk_facturefourn';
992 $sql .=
' WHERE f.fk_soc = '.((int)
$object->id);
993 $sql .=
" AND f.entity IN (".getEntity(
'facture_fourn').
")";
994 $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';
995 $sql .=
' ORDER BY f.datef DESC';
996 $resql = $db->query($sql);
999 $num = $db->num_rows($resql);
1001 print
'<div class="div-table-responsive-no-min">';
1002 print
'<table class="noborder centpercent lastrecordtable">';
1004 print
'<tr class="liste_titre">';
1005 print
'<td colspan="4">';
1006 print
'<table class="nobordernopadding" width="100%"><tr><td>'.$langs->trans(
'LastSuppliersBills', ($num <= $MAXLIST ?
"" : $MAXLIST)).
'</td>';
1007 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>';
1008 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>';
1009 print
'</tr></table>';
1013 while ($i < min($num, $MAXLIST)) {
1014 $obj = $db->fetch_object($resql);
1016 $facturestatic->id = $obj->rowid;
1017 $facturestatic->ref = ($obj->ref ? $obj->ref : $obj->rowid);
1018 $facturestatic->ref_supplier = $obj->ref_supplier;
1019 $facturestatic->libelle = $obj->label;
1020 $facturestatic->label = $obj->label;
1021 $facturestatic->total_ht = $obj->total_ht;
1022 $facturestatic->total_tva = $obj->total_tva;
1023 $facturestatic->total_ttc = $obj->total_ttc;
1024 $facturestatic->date = $db->jdate($obj->df);
1026 print
'<tr class="oddeven">';
1027 print
'<td class="tdoverflowmax200">';
1028 print
'<span class="nowraponall">'.$facturestatic->getNomUrl(1).
'</span>';
1029 print $obj->ref_supplier ?
' - '.$obj->ref_supplier :
'';
1030 print($obj->label ?
' - ' :
'').
dol_trunc($obj->label, 14);
1032 print
'<td class="center nowrap">'.dol_print_date($facturestatic->date,
'day').
'</td>';
1033 print
'<td class="right nowrap"><span class="amount">'.price($facturestatic->total_ttc).
'</span></td>';
1034 print
'<td class="right nowrap">';
1035 print $facturestatic->LibStatut($obj->paye, $obj->fk_statut, 5, $obj->am);
1042 print
'</table></div>';
1045 dol_print_error($db);
1052 if (
isModEnabled(
'contract') && $user->hasRight(
'contrat',
'lire')) {
1053 $sql =
"SELECT s.nom, s.rowid, c.rowid as id, c.ref as ref, c.fk_projet, c.statut as contract_status, c.datec as dc, c.date_contrat as dcon, c.ref_customer as refcus, c.ref_supplier as refsup, c.entity,";
1054 $sql .=
" c.last_main_doc, c.model_pdf";
1055 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s, ".MAIN_DB_PREFIX.
"contrat as c";
1056 $sql .=
" WHERE c.fk_soc = s.rowid";
1057 $sql .=
" AND s.rowid = ".((int)
$object->id);
1058 $sql .=
" AND c.fk_contract_type = 1";
1059 $sql .=
" AND c.entity IN (".getEntity(
'contract').
")";
1060 $sql .=
" ORDER BY c.datec DESC";
1062 $resql = $db->query($sql);
1066 $num = $db->num_rows($resql);
1068 print
'<div class="div-table-responsive-no-min">';
1069 print
'<table class="noborder centpercent lastrecordtable">';
1071 print
'<tr class="liste_titre">';
1072 print
'<td colspan="5"><table class="centpercent nobordernopadding"><tr><td>'.$langs->trans(
"LastSupplierContracts", ($num <= $MAXLIST ?
"" : $MAXLIST)).
'</td>';
1073 print
'<td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.
'/contrat/list.php?socid='.
$object->id.
'&search_type=1">'.$langs->trans(
"AllContracts").
'<span class="badge marginleftonlyshort">'.$num.
'</span></a></td>';
1074 print
'</tr></table></td>';
1079 while ($i < $num && $i < $MAXLIST) {
1080 $objp = $db->fetch_object($resql);
1082 $contrat->id = $objp->id;
1083 $contrat->ref = $objp->ref ? $objp->ref : $objp->id;
1084 $contrat->ref_customer = $objp->refcus;
1085 $contrat->ref_supplier = $objp->refsup;
1086 $contrat->fk_project = $objp->fk_projet;
1087 $contrat->statut = $objp->contract_status;
1088 $contrat->status = $objp->contract_status;
1089 $contrat->last_main_doc = $objp->last_main_doc;
1090 $contrat->model_pdf = $objp->model_pdf;
1092 print
'<tr class="oddeven">';
1093 print
'<td class="nowraponall">';
1094 print $contrat->getNomUrl(1, 12);
1096 print
'<td class="tdoverflowmax125">';
1097 if ($contrat->fk_project > 0) {
1098 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
1100 $project->fetch($contrat->fk_project);
1101 print $project->getNomUrl(1);
1104 print
'<td class="nowrap">';
1107 print
'<td class="right" width="80px"><span title="'.$langs->trans(
"DateContract").
'">'.
dol_print_date($db->jdate($objp->dcon),
'day').
"</span></td>\n";
1108 print
'<td class="nowraponall right">';
1109 print $contrat->getLibStatut(4);
1121 dol_print_error($db);
1126 $parameters = array();
1127 $reshook = $hookmanager->executeHooks(
'addMoreRecentObjects', $parameters, $object, $action);
1129 setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
1131 print $hookmanager->resPrint;
1134 print
'</div></div>';
1135 print
'<div class="clearboth"></div>';
1143 print
'<div class="tabsAction">';
1145 $parameters = array();
1146 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
1148 if (empty($reshook)) {
1149 if (
isModEnabled(
'supplier_proposal') && $user->hasRight(
"supplier_proposal",
"creer")) {
1150 $langs->load(
"supplier_proposal");
1152 print dolGetButtonAction(
'', $langs->trans(
'AddSupplierProposal'),
'default', DOL_URL_ROOT.
'/supplier_proposal/card.php?action=create&socid='.
$object->id,
'');
1154 print dolGetButtonAction($langs->trans(
'ThirdPartyIsClosed'), $langs->trans(
'AddSupplierProposal'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1158 if ($user->hasRight(
'fournisseur',
'commande',
'creer') || $user->hasRight(
'supplier_order',
'creer')) {
1159 $langs->load(
"orders");
1161 print dolGetButtonAction(
'', $langs->trans(
'AddSupplierOrderShort'),
'default', DOL_URL_ROOT.
'/fourn/commande/card.php?action=create&socid='.
$object->id,
'');
1163 print dolGetButtonAction($langs->trans(
'ThirdPartyIsClosed'), $langs->trans(
'AddSupplierOrderShort'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1167 if (
isModEnabled(
'contract') && $user->hasRight(
'contrat',
'creer') &&
$object->status == 1) {
1168 print dolGetButtonAction(
'', $langs->trans(
'AddContract'),
'default', DOL_URL_ROOT.
'/contrat/card.php?action=create&socid='.
$object->id.
'&contract_type=1',
'');
1169 } elseif (
isModEnabled(
'contract') && $user->hasRight(
'contrat',
'creer')) {
1170 print dolGetButtonAction($langs->trans(
'ThirdPartyIsClosed'), $langs->trans(
'AddContract'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1173 if ($user->hasRight(
'fournisseur',
'facture',
'creer') || $user->hasRight(
'supplier_invoice',
'creer')) {
1174 if (!empty($orders2invoice) && $orders2invoice > 0) {
1177 print dolGetButtonAction(
'', $langs->trans(
'CreateInvoiceForThisSupplier'),
'default', DOL_URL_ROOT.
'/fourn/commande/list.php?socid='.
$object->id.
'&search_billed=0&autoselectall=1',
'');
1179 print dolGetButtonAction(
'', $langs->trans(
'CreateInvoiceForThisCustomer'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1183 print dolGetButtonAction($langs->trans(
"NoOrdersToInvoice").
' ('.$langs->trans(
"WithReceptionFinished").
')', $langs->trans(
'CreateInvoiceForThisCustomer'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1185 print dolGetButtonAction($langs->trans(
'ThirdPartyIsClosed'), $langs->trans(
'CreateInvoiceForThisCustomer'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1190 if ($user->hasRight(
'fournisseur',
'facture',
'creer') || $user->hasRight(
'supplier_invoice',
'creer')) {
1191 $langs->load(
"bills");
1193 print dolGetButtonAction(
'', $langs->trans(
'AddBill'),
'default', DOL_URL_ROOT.
'/fourn/facture/card.php?action=create&socid='.
$object->id,
'');
1195 print dolGetButtonAction($langs->trans(
'ThirdPartyIsClosed'), $langs->trans(
'AddBill'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1201 if ($user->hasRight(
"agenda",
"myactions",
"create")) {
1202 print dolGetButtonAction(
'', $langs->trans(
'AddAction'),
'default', DOL_URL_ROOT.
'/comm/action/card.php?action=create&socid='.
$object->id,
'');
1204 print dolGetButtonAction($langs->trans(
'NotAllowed'), $langs->trans(
'AddAction'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1228 dol_print_error($db);
$id
Support class for third parties, contacts, members, users or resources.
if(! $sortfield) if(! $sortorder) $object
length_accountg($account)
Return General accounting account with defined length (used for product and miscellaneous)
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage accounting accounts.
Class to manage members of a foundation.
Class to manage predefined suppliers products.
const STATUS_RECEIVED_COMPLETELY
Received completely.
Class to manage suppliers invoices.
Class to manage invoice templates.
Class to manage suppliers.
Class to manage products or services.
Class to manage projects.
Class to manage price ask supplier.
show_contacts($conf, $langs, $db, $object, $backtopage='', $showuserlogin=0)
Show html area for list of contacts.
show_actions_done($conf, $langs, $db, $filterobj, $objcon=null, $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).
societe_prepare_head(Societe $object, $subtabs='')
Return array of tabs to used on pages for third parties cards.
show_actions_todo($conf, $langs, $db, $filterobj, $objcon=null, $noprint=0, $actioncode='')
Show html area with actions to do.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dol_eval($s, $returnvalue=1, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
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.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
dol_htmlentities($string, $flags=ENT_QUOTES|ENT_SUBSTITUTE, $encoding='UTF-8', $double_encode=false)
Replace htmlentities functions.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_clone($srcobject, $native=2)
Create a clone of instance of object (new instance with same value for each properties) With native =...
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
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.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
showValueWithClipboardCPButton($valuetocopy, $showonlyonhover=1, $texttoshow='')
Create a button to copy $valuetocopy in the clipboard (for copy and paste feature).
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $nodie=0, $mode='')
Check permissions of a user to show a page and an object.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.