37require
'../main.inc.php';
47require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.class.php';
48require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
49require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture-rec.class.php';
50require_once DOL_DOCUMENT_ROOT.
'/supplier_proposal/class/supplier_proposal.class.php';
51require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
52require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
53require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
55 require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
58 require_once DOL_DOCUMENT_ROOT.
'/core/lib/accounting.lib.php';
59 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingaccount.class.php';
62 require_once DOL_DOCUMENT_ROOT.
'/contrat/class/contrat.class.php';
66$langs->loadLangs(array(
'accountancy',
'companies',
'suppliers',
'products',
'bills',
'orders',
'commercial',
'contracts'));
68$action =
GETPOST(
'action',
'aZ09');
69$cancel =
GETPOST(
'cancel',
'alpha');
72if ($user->isExternalUser()) {
73 $id = $user->isExternalUser();
77$hookmanager->initHooks(array(
'thirdpartysupplier',
'globalcard'));
79$result =
restrictedArea($user,
'societe&fournisseur', $id,
'&societe',
'',
'rowid');
84$extrafields->fetch_name_optionals_label(
$object->table_element);
86$permissiontoadd = $user->hasRight(
'societe',
'creer');
87$permissiontoeditextra = $permissiontoadd;
88if (
GETPOST(
'attribute',
'aZ09') && isset($extrafields->attributes[
$object->table_element][
'perms'][
GETPOST(
'attribute',
'aZ09')])) {
90 $permissiontoeditextra =
dol_eval((
string) $extrafields->attributes[
$object->table_element][
'perms'][
GETPOST(
'attribute',
'aZ09')]);
94$result =
restrictedArea($user,
'societe', $id,
'&societe',
'',
'fk_soc',
'rowid', 0);
97 if (!(
$object->fournisseur > 0) || !$user->hasRight(
"fournisseur",
"lire")) {
107$parameters = array(
'id' => $id);
108$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
110 setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
113if (empty($reshook)) {
119 if ($action ==
'setsupplieraccountancycodegeneral' && $user->hasRight(
'societe',
'creer')) {
121 $object->accountancy_code_supplier_general =
GETPOST(
"supplieraccountancycodegeneral");
125 $_GET[
'action'] =
'editsupplieraccountancycode';
130 if ($action ==
'setsupplieraccountancycode' && $user->hasRight(
'societe',
'creer')) {
132 $object->code_compta_fournisseur =
GETPOST(
"supplieraccountancycode");
136 $action =
'editsupplieraccountancycode';
140 if ($action ==
'settva_intra' && $user->hasRight(
'societe',
'creer')) {
149 if ($action ==
'setconditions' && $user->hasRight(
'societe',
'creer')) {
151 $result =
$object->setPaymentTerms(
GETPOSTINT(
'cond_reglement_supplier_id'),
GETPOSTINT(
'cond_reglement_supplier_id_deposit_percent'));
153 dol_print_error($db,
$object->error);
157 if ($action ==
'setmode' && $user->hasRight(
'societe',
'creer')) {
161 dol_print_error($db,
$object->error);
166 if ($action ==
'setbankaccount' && $user->hasRight(
'societe',
'creer')) {
175 if ($action ==
'setsupplier_order_min_amount' && $user->hasRight(
'societe',
'creer')) {
184 if ($action ==
'update_extras' && $permissiontoeditextra) {
189 $attribute_name =
GETPOST(
'attribute',
'aZ09');
192 $ret = $extrafields->setOptionalsFromPost(
null, $object, $attribute_name);
198 $result =
$object->updateExtraField($attribute_name,
'COMPANY_MODIFY');
206 $action =
'edit_extras';
216$contactstatic =
new Contact($db);
217$form =
new Form($db);
219if ($id > 0 && empty(
$object->id)) {
224 dol_print_error($db,
$object->error);
230 $langs->load(
"errors");
231 llxHeader(
'', $langs->trans(
"ThirdParty").
' - '.$langs->trans(
'Supplier'));
232 print
'<div class="warning">'.$langs->trans(
"ErrorRecordNotFound").
' ('.$langs->trans(
"Supplier").
')';
233 print
' <a href="'.DOL_URL_ROOT.
'/societe/card.php?socid='.((int) $id).
'">'.$langs->trans(
"ThirdParty").
'</a>';
242 $title = $langs->trans(
"ThirdParty").
" - ".$langs->trans(
'Supplier');
244 $title =
$object->name.
" - ".$langs->trans(
'Supplier');
247 llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-fourn page-card');
254 print
dol_get_fiche_head($head,
'supplier', $langs->trans(
"ThirdParty"), -1,
'company');
256 $linkback =
'<a href="'.DOL_URL_ROOT.
'/societe/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
258 dol_banner_tab($object,
'socid', $linkback, ($user->socid ? 0 : 1),
'rowid',
'nom');
260 print
'<div class="fichecenter"><div class="fichehalfleft">';
262 print
'<div class="underbanner clearboth"></div>';
263 print
'<table class="border centpercent tableforfield">';
266 print
'<tr><td class="titlefield">'.$langs->trans(
'NatureOfThirdParty').
'</td><td>';
271 $langs->load(
'compta');
274 print
'<td class="titlefield">'.$langs->trans(
"SupplierCode").
'</td><td>';
276 $tmpcheck =
$object->check_codefournisseur();
277 if ($tmpcheck != 0 && $tmpcheck != -5) {
278 print
' <span class="paddingleftimp error inline-block valignmiddle" title="'.$object->error.
'">('.$langs->trans(
"WrongSupplierCode").
')</span>';
288 print $form->editfieldkey(
"SupplierAccountancyCodeGeneral",
'supplieraccountancycodegeneral',
length_accountg(
$object->accountancy_code_supplier_general), $object, $user->hasRight(
'societe',
'creer'));
290 if ($action ==
'editsupplieraccountancycodegeneral' && $user->hasRight(
'societe',
'creer')) {
291 print $formaccounting->formAccountingAccount($_SERVER[
'PHP_SELF'].
'?id='.
$object->id,
$object->accountancy_code_supplier_general,
'supplieraccountancycodegeneral', 0, 1,
'', 1);
293 if (
$object->accountancy_code_supplier_general > 0) {
295 $accountingaccount->fetch(0,
$object->accountancy_code_supplier_general, 1);
297 print $accountingaccount->getNomUrl(0, 1, 1,
'', 1);
300 if (
$object->accountancy_code_supplier_general > 0) {
303 $accountingAccountByDefault =
'<span class="opacitymedium">' . $langs->trans(
"AccountingAccountByDefaultShort") .
": " .
length_accountg(
getDolGlobalString(
'ACCOUNTING_ACCOUNT_SUPPLIER')) .
'</span>';
304 print $accountingAccountByDefault;
313 print $form->editfieldkey(
"SupplierAccountancyCode",
'supplieraccountancycode',
$object->code_compta_fournisseur, $object, $user->hasRight(
'societe',
'creer'));
315 print $form->editfieldval(
"SupplierAccountancyCode",
'supplieraccountancycode',
$object->code_compta_fournisseur, $object, $user->hasRight(
'societe',
'creer'));
322 print
'<td class="titlefield">';
323 print $form->textwithpicto($langs->trans(
'VATIsUsed'), $langs->trans(
'VATIsUsedWhenSelling'));
330 if (
$mysoc->useLocalTax(1)) {
331 print
'<tr><td>'.$langs->transcountry(
"LocalTax1IsUsed",
$mysoc->country_code).
'</td><td>';
332 print yn(
$object->localtax1_assuj);
335 if (
$mysoc->useLocalTax(2)) {
336 print
'<tr><td>'.$langs->transcountry(
"LocalTax2IsUsed",
$mysoc->country_code).
'</td><td>';
337 print yn(
$object->localtax2_assuj);
344 print
'<td class="titlefield">';
345 print $form->textwithpicto($langs->trans(
'VATReverseChargeByDefault'), $langs->trans(
'VATReverseChargeByDefaultDesc').
'<br>'.$langs->trans(
'ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE_DESC'));
347 print
'<input type="checkbox" name="vat_reverse_charge" ' . (
$object->vat_reverse_charge ==
'1' ?
' checked' :
'') .
' disabled>';
353 print
'<tr><td class="nowrap">';
356 print $form->editfieldkey(
"VATIntra",
'tva_intra',
$object->tva_intra, $object, $user->hasRight(
'societe',
'creer'));
358 print $form->editfieldval(
"VATIntra",
'tva_intra', $vattoshow, $object, $user->hasRight(
'societe',
'creer'),
'string',
$object->tva_intra,
null,
null,
'', 1,
'',
'id',
'auto', array(
'valuealreadyhtmlescaped' => 1));
362 $langs->load(
'bills');
363 $form =
new Form($db);
365 print
'<table width="100%" class="nobordernopadding"><tr><td>';
366 print $langs->trans(
'PaymentConditions');
368 if (($action !=
'editconditions') && $user->hasRight(
'societe',
'creer')) {
369 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>';
371 print
'</tr></table>';
373 if ($action ==
'editconditions') {
374 $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);
376 $form->form_conditions_reglement($_SERVER[
'PHP_SELF'] .
'?socid=' .
$object->id, (
string)
$object->cond_reglement_supplier_id,
'none', 0,
'', 1,
$object->deposit_percent);
382 print
'<tr><td class="nowrap">';
383 print
'<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
384 print $langs->trans(
'PaymentMode');
386 if (($action !=
'editmode') && $user->hasRight(
'societe',
'creer')) {
387 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>';
389 print
'</tr></table>';
391 if ($action ==
'editmode') {
392 $form->form_modes_reglement($_SERVER[
'PHP_SELF'].
'?socid='.
$object->id, (
string)
$object->mode_reglement_supplier_id,
'mode_reglement_supplier_id',
'DBIT', 1, 1);
394 $form->form_modes_reglement($_SERVER[
'PHP_SELF'].
'?socid='.
$object->id, (
string)
$object->mode_reglement_supplier_id,
'none');
401 print
'<tr><td class="nowrap">';
402 print
'<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
403 print $langs->trans(
'PaymentBankAccount');
405 if (($action !=
'editbankaccount') && $user->hasRight(
'societe',
'creer')) {
406 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>';
408 print
'</tr></table>';
410 if ($action ==
'editbankaccount') {
411 $form->formSelectAccount($_SERVER[
'PHP_SELF'].
'?socid='.
$object->id, (
string)
$object->fk_account,
'fk_account', 1);
413 $form->formSelectAccount($_SERVER[
'PHP_SELF'].
'?socid='.
$object->id, (
string)
$object->fk_account,
'none');
420 print
'<tr><td class="nowrap">';
421 print
'<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
422 print $langs->trans(
"CustomerRelativeDiscountShort");
423 print
'<td><td class="right">';
424 if ($user->hasRight(
'societe',
'creer') && !$user->socid > 0) {
425 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>';
427 print
'</td></tr></table>';
428 print
'</td><td>'.($object->remise_supplier_percent ?
'<a href="'.DOL_URL_ROOT.
'/comm/remise.php?id='.
$object->id.
'">'.
$object->remise_supplier_percent.
'%</a>' :
'').
'</td>';
432 print
'<tr><td class="nowrap">';
433 print
'<table width="100%" class="nobordernopadding">';
434 print
'<tr><td class="nowrap">';
435 print $langs->trans(
"CustomerAbsoluteDiscountShort");
436 print
'<td><td class="right">';
437 if ($user->hasRight(
'societe',
'creer') && !$user->socid > 0) {
438 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>';
440 print
'</td></tr></table>';
443 $amount_discount =
$object->getAvailableDiscounts(
null,
'', 0, 1);
444 if ($amount_discount < 0) {
445 dol_print_error($db,
$object->error);
447 if ($amount_discount > 0) {
448 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>';
455 print
'<tr class="nowrap">';
457 print $form->editfieldkey(
"OrderMinAmount",
'supplier_order_min_amount',
$object->supplier_order_min_amount, $object, $user->hasRight(
"societe",
"creer"));
460 $limit_field_type =
'amount';
461 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) :
''));
468 $langs->load(
"categories");
469 print
'<tr><td>'.$langs->trans(
"SuppliersCategoriesShort").
'</td>';
471 print $form->showCategories(
$object->id, Categorie::TYPE_SUPPLIER, 1);
476 $parameters = array(
'socid' =>
$object->id,
'colspan' =>
' colspan="3"',
'colspanvalue' =>
'3');
477 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
481 $langs->load(
"members");
482 $langs->load(
"users");
483 print
'<tr><td>'.$langs->trans(
"LinkedToDolibarrMember").
'</td>';
486 $result = $adh->fetch(0,
'',
$object->id);
488 $adh->ref = $adh->getFullName($langs);
489 print $adh->getNomUrl(1);
491 print $langs->trans(
"ThirdpartyNotLinkedToMember");
500 print
'</div><div class="fichehalfright">';
507 print
'<div class="underbanner underbanner-before-box clearboth"></div>';
511 $boxstat .=
'<div class="box divboxtable box-halfright">';
512 $boxstat .=
'<table summary="'.dol_escape_htmltag($langs->trans(
"DolibarrStateBoard")).
'" class="border boxtable boxtablenobottom boxtablenotop" width="100%">';
513 $boxstat .=
'<tr class="impair nohover"><td colspan="2" class="tdboxstats nohover">';
517 $tmp =
$object->getOutstandingProposals(
'supplier');
518 $outstandingOpened = $tmp[
'opened'];
519 $outstandingTotal = $tmp[
'total_ht'];
520 $outstandingTotalIncTax = $tmp[
'total_ttc'];
521 $text = $langs->trans(
"OverAllSupplierProposals");
522 $link = DOL_URL_ROOT.
'/supplier_proposal/list.php?socid='.
$object->id;
525 $boxstat .=
'<a href="'.$link.
'" class="boxstatsindicator thumbstat nobold nounderline">';
527 $boxstat .=
'<div class="boxstats" title="'.dol_escape_htmltag($text).
'">';
528 $boxstat .=
'<span class="boxstatstext">'.img_object(
"", $icon).
' <span>'.$text.
'</span></span><br>';
529 $boxstat .=
'<span class="boxstatsindicator">'.price($outstandingTotal, 1, $langs, 1, -1, -1,
$conf->currency).
'</span>';
530 $boxstat .=
'</div>';
538 $tmp =
$object->getOutstandingOrders(
'supplier');
539 $outstandingOpened = $tmp[
'opened'];
540 $outstandingTotal = $tmp[
'total_ht'];
541 $outstandingTotalIncTax = $tmp[
'total_ttc'];
542 $text = $langs->trans(
"OverAllOrders");
543 $link = DOL_URL_ROOT.
'/fourn/commande/list.php?socid='.
$object->id;
546 $boxstat .=
'<a href="'.$link.
'" class="boxstatsindicator thumbstat nobold nounderline">';
548 $boxstat .=
'<div class="boxstats" title="'.dol_escape_htmltag($text).
'">';
549 $boxstat .=
'<span class="boxstatstext">'.img_object(
"", $icon).
' <span>'.$text.
'</span></span><br>';
550 $boxstat .=
'<span class="boxstatsindicator">'.price($outstandingTotal, 1, $langs, 1, -1, -1,
$conf->currency).
'</span>';
551 $boxstat .=
'</div>';
557 if (
isModEnabled(
"supplier_invoice") && ($user->hasRight(
'fournisseur',
'facture',
'lire') || $user->hasRight(
'supplier_invoice',
'read'))) {
559 $tmp =
$object->getOutstandingBills(
'supplier');
560 $outstandingOpened = $tmp[
'opened'];
561 $outstandingTotal = $tmp[
'total_ht'];
562 $outstandingTotalIncTax = $tmp[
'total_ttc'];
564 $text = $langs->trans(
"OverAllInvoices");
565 $link = DOL_URL_ROOT.
'/fourn/facture/list.php?socid='.
$object->id;
568 $boxstat .=
'<a href="'.$link.
'" class="boxstatsindicator thumbstat nobold nounderline">';
570 $boxstat .=
'<div class="boxstats" title="'.dol_escape_htmltag($text).
'">';
571 $boxstat .=
'<span class="boxstatstext">'.img_object(
"", $icon).
' <span>'.$text.
'</span></span><br>';
572 $boxstat .=
'<span class="boxstatsindicator">'.price($outstandingTotal, 1, $langs, 1, -1, -1,
$conf->currency).
'</span>';
573 $boxstat .=
'</div>';
579 $text = $langs->trans(
"CurrentOutstandingBill");
580 $link = DOL_URL_ROOT.
'/fourn/recap-fourn.php?socid='.
$object->id.
'&search_status=unpaid';
582 $boxstattmp =
'<div class="boxstats" title="'.dol_escape_htmltag($text).
'">';
583 $boxstattmp .=
'<span class="boxstatstext">'.img_object(
"", $icon).
' <span>'.$text.
'</span></span><br>';
584 $boxstattmp .=
'<span class="boxstatsindicator'.($outstandingOpened > 0 ?
' amountremaintopay' :
'').
'">'.
price($outstandingOpened, 1, $langs, 1, -1, -1,
$conf->currency).$warn.
'</span>';
585 $boxstattmp .=
'</div>';
587 $boxstat .=
dolButtonToOpenUrlInDialogPopup(
'popupoutstanding', $langs->transnoentitiesnoconv(
"CurrentOutstandingBill"), $boxstattmp,
'/fourn/recap-fourn.php?socid='.$object->id.
'&search_status=unpaid',
'',
'');
589 $boxstat .= $boxstattmp;
592 $tmp =
$object->getOutstandingBills(
'supplier', 1);
593 $outstandingOpenedLate = $tmp[
'opened'];
594 if ($outstandingOpened != $outstandingOpenedLate && !empty($outstandingOpenedLate)) {
595 $text = $langs->trans(
"CurrentOutstandingBillLate");
596 $link = DOL_URL_ROOT.
'/fourn/recap-fourn.php?socid='.
$object->id.
'&search_status=unpaid&search_late=late';
598 $boxstattmp =
'<div class="boxstats" title="'.dol_escape_htmltag($text).
'">';
599 $boxstattmp .=
'<span class="boxstatstext">'.img_object(
"", $icon).
' <span>'.$text.
'</span></span><br>';
600 $boxstattmp .=
'<span class="boxstatsindicator'.($outstandingOpenedLate > 0 ?
' amountremaintopay' :
'').
'">'.
price($outstandingOpenedLate, 1, $langs, 1, -1, -1,
$conf->currency).$warn.
'</span>';
601 $boxstattmp .=
'</div>';
603 $boxstat .=
dolButtonToOpenUrlInDialogPopup(
'popupoutstandinglate', $langs->transnoentitiesnoconv(
"CurrentOutstandingBillLate"), $boxstattmp,
'/fourn/recap-fourn.php?socid='.$object->id.
'&search_status=unpaid&search_late=late',
'',
'');
605 $boxstat .= $boxstattmp;
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(
"AllSupplierOrders").
'</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((
int) $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)) {
1150 $thirdpartyclosedtitle = (
$object->status == 1 ?
'' : $langs->trans(
"ThirdPartyIsClosed"));
1153 $backtopageforcancel = $_SERVER[
'PHP_SELF'].
'?socid='.
$object->id;
1155 $arrayforbutaction = array();
1158 $arrayforbutaction[] = array(
1159 'lang' =>
'supplier_proposal',
1161 'perm' => (
$object->status == 1 && $user->hasRight(
'supplier_proposal',
'creer')),
1162 'label' =>
'AddSupplierProposal',
1163 'url' =>
'/supplier_proposal/card.php?action=create&socid='.$object->id.
'&backtopageforcancel='.urlencode($backtopageforcancel),
1164 'attr' => ($thirdpartyclosedtitle ? array(
'title' => $thirdpartyclosedtitle) : array()),
1165 'params' => ($thirdpartyclosedtitle ? array(
'attr' => array(
'title' => $thirdpartyclosedtitle)) : array())
1169 $arrayforbutaction[] = array(
1172 'perm' => (
$object->status == 1 && ($user->hasRight(
'fournisseur',
'commande',
'creer') || $user->hasRight(
'supplier_order',
'creer'))),
1173 'label' =>
'AddSupplierOrderShort',
1174 'url' =>
'/fourn/commande/card.php?action=create&socid='.$object->id.
'&backtopageforcancel='.urlencode($backtopageforcancel),
1175 'attr' => ($thirdpartyclosedtitle ? array(
'title' => $thirdpartyclosedtitle) : array()),
1176 'params' => ($thirdpartyclosedtitle ? array(
'attr' => array(
'title' => $thirdpartyclosedtitle)) : array())
1180 $arrayforbutaction[] = array(
1181 'lang' =>
'contracts',
1183 'perm' => (
$object->status == 1 && $user->hasRight(
'contrat',
'creer')),
1184 'label' =>
'AddContract',
1185 'url' =>
'/contrat/card.php?action=create&socid='.$object->id.
'&contract_type=1&backtopageforcancel='.urlencode($backtopageforcancel),
1186 'attr' => ($thirdpartyclosedtitle ? array(
'title' => $thirdpartyclosedtitle) : array()),
1187 'params' => ($thirdpartyclosedtitle ? array(
'attr' => array(
'title' => $thirdpartyclosedtitle)) : array())
1191 $arrayforbutaction[] = array(
1194 'perm' => (
$object->status == 1 && ($user->hasRight(
'fournisseur',
'facture',
'creer') || $user->hasRight(
'supplier_invoice',
'creer'))),
1195 'label' =>
'AddBill',
1196 'url' =>
'/fourn/facture/card.php?action=create&socid='.$object->id.
'&backtopageforcancel='.urlencode($backtopageforcancel),
1197 'attr' => ($thirdpartyclosedtitle ? array(
'title' => $thirdpartyclosedtitle) : array()),
1198 'params' => ($thirdpartyclosedtitle ? array(
'attr' => array(
'title' => $thirdpartyclosedtitle)) : array())
1202 $permissiontocreateatleastone = 0;
1203 foreach ($arrayforbutaction as $butaction) {
1204 if (!empty($butaction[
'perm'])) {
1205 $permissiontocreateatleastone = 1;
1211 if (!empty($arrayforbutaction)) {
1212 $createbuttontitle =
'';
1213 $createbuttonright = 1;
1215 $createbuttontitle = $langs->trans(
"ThirdPartyIsClosed");
1216 $createbuttonright = 0;
1217 } elseif (empty($permissiontocreateatleastone)) {
1218 $createbuttontitle = $langs->trans(
"NotAllowed");
1219 $createbuttonright = 0;
1222 print dolGetButtonAction($createbuttontitle, $langs->trans(
"Create"),
'default', $arrayforbutaction,
'', $createbuttonright, array(
'areDropdownButtons' => !
getDolGlobalInt(
"MAIN_REMOVE_DROPDOWN_CREATE_BUTTONS_ON_THIRDPARTY")));
1225 if ($user->hasRight(
'fournisseur',
'facture',
'creer') || $user->hasRight(
'supplier_invoice',
'creer')) {
1226 if (!empty($orders2invoice) && $orders2invoice > 0) {
1229 print dolGetButtonAction(
'', $langs->trans(
'CreateInvoiceForThisSupplier'),
'default', DOL_URL_ROOT.
'/fourn/commande/list.php?socid='.
$object->id.
'&search_billed=0&autoselectall=1',
'');
1231 print dolGetButtonAction(
'', $langs->trans(
'CreateInvoiceForThisCustomer'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1235 print dolGetButtonAction($langs->trans(
"NoSupplierOrdersToInvoice").
' ('.$langs->trans(
"WithReceptionFinished").
')', $langs->trans(
'CreateInvoiceForThisCustomer'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1237 print dolGetButtonAction($langs->trans(
'ThirdPartyIsClosed'), $langs->trans(
'CreateInvoiceForThisCustomer'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1244 if ($user->hasRight(
"agenda",
"myactions",
"create")) {
1245 print dolGetButtonAction(
'', $langs->trans(
'AddAction'),
'default', DOL_URL_ROOT.
'/comm/action/card.php?action=create&socid='.
$object->id,
'');
1247 print dolGetButtonAction($langs->trans(
'NotAllowed'), $langs->trans(
'AddAction'),
'default', $_SERVER[
'PHP_SELF'].
'#',
'',
false);
1271 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.
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
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, $currencycode='')
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.
dolButtonToOpenUrlInDialogPopup($name, $label, $buttonstring, $url, $disabled='', $morecss='classlink button bordertransp', $jsonopen='', $jsonclose='', $accesskey='')
Return HTML code to output a button to open a dialog popup box.
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.