28 require
"../main.inc.php";
29 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
32 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.class.php';
34 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'thirdpartylist';
37 $socid =
GETPOST(
'socid',
'int');
38 if ($user->socid) $socid = $user->socid;
41 if ($socid > 0) $object->fetch($socid);
44 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
45 $sortfield =
GETPOST(
"sortfield",
'alpha');
46 $sortorder =
GETPOST(
"sortorder",
'alpha');
48 if (empty($page) || $page == -1) { $page = 0; }
49 $offset = $limit * $page;
50 $pageprev = $page - 1;
51 $pagenext = $page + 1;
52 if (!$sortorder) $sortorder =
'DESC';
53 if (!$sortfield) $sortfield =
'dateprint';
57 $sprod_fulldescr =
GETPOST(
"sprod_fulldescr");
58 $month =
GETPOST(
'month',
'int');
62 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha'))
65 $sprod_fulldescr =
'';
70 $thirdTypeSelect =
GETPOST(
"third_select_id");
71 $type_element =
GETPOST(
'type_element') ?
GETPOST(
'type_element') :
'';
74 $langs->loadLangs(array(
"companies",
"bills",
"orders",
"suppliers",
"propal",
"interventions",
"contracts",
"products"));
77 $hookmanager->initHooks(array(
'consumptionthirdparty'));
84 $parameters = array(
'id'=>$socid);
85 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
86 if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
94 $form =
new Form($db);
96 $productstatic =
new Product($db);
98 $title = $langs->trans(
"Referers", $object->name);
99 if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match(
'/thirdpartynameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) $title = $object->name.
" - ".$title;
100 $help_url =
'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
112 $linkback =
'<a href="'.DOL_URL_ROOT.
'/societe/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
114 dol_banner_tab($object,
'socid', $linkback, ($user->socid ? 0 : 1),
'rowid',
'nom');
116 print '<div class="fichecenter">';
118 print '<div class="underbanner clearboth"></div>';
119 print '<table class="border centpercent tableforfield">';
121 if (!empty($conf->global->SOCIETE_USEPREFIX))
123 print '<tr><td class="titlefield">'.$langs->trans(
'Prefix').
'</td><td colspan="3">'.$object->prefix_comm.
'</td></tr>';
130 print '<tr><td class="titlefield">';
131 print $langs->trans(
'CustomerCode').
'</td><td colspan="3">';
132 print $object->code_client;
133 $tmpcheck = $object->check_codeclient();
134 if ($tmpcheck != 0 && $tmpcheck != -5) {
135 print ' <font class="error">('.$langs->trans(
"WrongCustomerCode").
')</font>';
138 $sql =
"SELECT count(*) as nb from ".MAIN_DB_PREFIX.
"facture where fk_soc = ".$socid;
139 $resql = $db->query($sql);
142 $obj = $db->fetch_object(
$resql);
143 $nbFactsClient = $obj->nb;
144 $thirdTypeArray[
'customer'] = $langs->trans(
"customer");
145 if ($conf->propal->enabled && $user->rights->propal->lire) $elementTypeArray[
'propal'] = $langs->transnoentitiesnoconv(
'Proposals');
146 if ($conf->commande->enabled && $user->rights->commande->lire) $elementTypeArray[
'order'] = $langs->transnoentitiesnoconv(
'Orders');
147 if ($conf->facture->enabled && $user->rights->facture->lire) $elementTypeArray[
'invoice'] = $langs->transnoentitiesnoconv(
'Invoices');
148 if ($conf->contrat->enabled && $user->rights->contrat->lire) $elementTypeArray[
'contract'] = $langs->transnoentitiesnoconv(
'Contracts');
151 if ($conf->ficheinter->enabled && $user->rights->ficheinter->lire) $elementTypeArray[
'fichinter'] = $langs->transnoentitiesnoconv(
'Interventions');
153 if ($object->fournisseur)
155 $langs->load(
"supplier_proposal");
156 print '<tr><td class="titlefield">';
157 print $langs->trans(
'SupplierCode').
'</td><td colspan="3">';
158 print $object->code_fournisseur;
159 $tmpcheck = $object->check_codefournisseur();
160 if ($tmpcheck != 0 && $tmpcheck != -5) {
161 print ' <font class="error">('.$langs->trans(
"WrongSupplierCode").
')</font>';
164 $sql =
"SELECT count(*) as nb from ".MAIN_DB_PREFIX.
"commande_fournisseur where fk_soc = ".$socid;
165 $resql = $db->query($sql);
168 $obj = $db->fetch_object(
$resql);
169 $nbCmdsFourn = $obj->nb;
170 $thirdTypeArray[
'supplier'] = $langs->trans(
"supplier");
171 if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire) $elementTypeArray[
'supplier_invoice'] = $langs->transnoentitiesnoconv(
'SuppliersInvoices');
172 if ($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire) $elementTypeArray[
'supplier_order'] = $langs->transnoentitiesnoconv(
'SuppliersOrders');
173 if ($conf->fournisseur->enabled && $user->rights->supplier_proposal->lire) $elementTypeArray[
'supplier_proposal'] = $langs->transnoentitiesnoconv(
'SupplierProposals');
183 print '<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'?socid='.$socid.
'">';
184 print '<input type="hidden" name="token" value="'.newToken().
'">';
197 if ($type_element ==
'fichinter')
199 require_once DOL_DOCUMENT_ROOT.
'/fichinter/class/fichinter.class.php';
201 $sql_select =
'SELECT f.rowid as doc_id, f.ref as doc_number, \'1\' as doc_type, f.datec as dateprint, f.fk_statut as status, ';
202 $tables_from = MAIN_DB_PREFIX.
"fichinter as f LEFT JOIN ".MAIN_DB_PREFIX.
"fichinterdet as d ON d.fk_fichinter = f.rowid";
203 $where =
" WHERE f.fk_soc = s.rowid AND s.rowid = ".$socid;
204 $where .=
" AND f.entity = ".$conf->entity;
205 $dateprint =
'f.datec';
206 $doc_number =
'f.ref';
208 if ($type_element ==
'invoice')
210 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
211 $documentstatic =
new Facture($db);
212 $sql_select =
'SELECT f.rowid as doc_id, f.ref as doc_number, f.type as doc_type, f.datef as dateprint, f.fk_statut as status, f.paye as paid, ';
213 $tables_from = MAIN_DB_PREFIX.
"facture as f,".MAIN_DB_PREFIX.
"facturedet as d";
214 $where =
" WHERE f.fk_soc = s.rowid AND s.rowid = ".$socid;
215 $where .=
" AND d.fk_facture = f.rowid";
216 $where .=
" AND f.entity IN (".getEntity(
'invoice').
")";
217 $dateprint =
'f.datef';
218 $doc_number =
'f.ref';
219 $thirdTypeSelect =
'customer';
221 if ($type_element ==
'propal')
223 require_once DOL_DOCUMENT_ROOT.
'/comm/propal/class/propal.class.php';
224 $documentstatic =
new Propal($db);
225 $sql_select =
'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.datep as dateprint, c.fk_statut as status, ';
226 $tables_from = MAIN_DB_PREFIX.
"propal as c,".MAIN_DB_PREFIX.
"propaldet as d";
227 $where =
" WHERE c.fk_soc = s.rowid AND s.rowid = ".$socid;
228 $where .=
" AND d.fk_propal = c.rowid";
229 $where .=
" AND c.entity = ".$conf->entity;
230 $datePrint =
'c.datep';
231 $doc_number =
'c.ref';
232 $thirdTypeSelect =
'customer';
234 if ($type_element ==
'order')
236 require_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
237 $documentstatic =
new Commande($db);
238 $sql_select =
'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_commande as dateprint, c.fk_statut as status, ';
239 $tables_from = MAIN_DB_PREFIX.
"commande as c,".MAIN_DB_PREFIX.
"commandedet as d";
240 $where =
" WHERE c.fk_soc = s.rowid AND s.rowid = ".$socid;
241 $where .=
" AND d.fk_commande = c.rowid";
242 $where .=
" AND c.entity = ".$conf->entity;
243 $dateprint =
'c.date_commande';
244 $doc_number =
'c.ref';
245 $thirdTypeSelect =
'customer';
247 if ($type_element ==
'supplier_invoice')
249 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
251 $sql_select =
'SELECT f.rowid as doc_id, f.ref as doc_number, \'1\' as doc_type, f.datef as dateprint, f.fk_statut as status, f.paye as paid, ';
252 $tables_from = MAIN_DB_PREFIX.
"facture_fourn as f,".MAIN_DB_PREFIX.
"facture_fourn_det as d";
253 $where =
" WHERE f.fk_soc = s.rowid AND s.rowid = ".$socid;
254 $where .=
" AND d.fk_facture_fourn = f.rowid";
255 $where .=
" AND f.entity = ".$conf->entity;
256 $dateprint =
'f.datef';
257 $doc_number =
'f.ref';
258 $thirdTypeSelect =
'supplier';
260 if ($type_element ==
'supplier_proposal')
262 require_once DOL_DOCUMENT_ROOT.
'/supplier_proposal/class/supplier_proposal.class.php';
264 $sql_select =
'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_valid as dateprint, c.fk_statut as status, ';
265 $tables_from = MAIN_DB_PREFIX.
"supplier_proposal as c,".MAIN_DB_PREFIX.
"supplier_proposaldet as d";
266 $where =
" WHERE c.fk_soc = s.rowid AND s.rowid = ".$socid;
267 $where .=
" AND d.fk_supplier_proposal = c.rowid";
268 $where .=
" AND c.entity = ".$conf->entity;
269 $dateprint =
'c.date_valid';
270 $doc_number =
'c.ref';
271 $thirdTypeSelect =
'supplier';
273 if ($type_element ==
'supplier_order')
275 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
277 $sql_select =
'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_valid as dateprint, c.fk_statut as status, ';
278 $tables_from = MAIN_DB_PREFIX.
"commande_fournisseur as c,".MAIN_DB_PREFIX.
"commande_fournisseurdet as d";
279 $where =
" WHERE c.fk_soc = s.rowid AND s.rowid = ".$socid;
280 $where .=
" AND d.fk_commande = c.rowid";
281 $where .=
" AND c.entity = ".$conf->entity;
282 $dateprint =
'c.date_valid';
283 $doc_number =
'c.ref';
284 $thirdTypeSelect =
'supplier';
286 if ($type_element ==
'contract')
288 require_once DOL_DOCUMENT_ROOT.
'/contrat/class/contrat.class.php';
289 $documentstatic =
new Contrat($db);
291 $sql_select =
'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_contrat as dateprint, d.statut as status, ';
292 $tables_from = MAIN_DB_PREFIX.
"contrat as c,".MAIN_DB_PREFIX.
"contratdet as d";
293 $where =
" WHERE c.fk_soc = s.rowid AND s.rowid = ".$socid;
294 $where .=
" AND d.fk_contrat = c.rowid";
295 $where .=
" AND c.entity = ".$conf->entity;
296 $dateprint =
'c.date_valid';
297 $doc_number =
'c.ref';
298 $thirdTypeSelect =
'customer';
301 $parameters = array();
302 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters);
304 if (!empty($sql_select))
307 $sql .=
' d.description as description,';
308 if ($type_element !=
'fichinter' && $type_element !=
'contract' && $type_element !=
'supplier_proposal') $sql .=
' d.label, d.fk_product as product_id, d.fk_product as fk_product, d.info_bits, d.date_start, d.date_end, d.qty, d.qty as prod_qty, d.total_ht as total_ht, ';
309 if ($type_element ==
'supplier_proposal') $sql .=
' d.label, d.fk_product as product_id, d.fk_product as fk_product, d.info_bits, d.qty, d.qty as prod_qty, d.total_ht as total_ht, ';
310 if ($type_element ==
'contract') $sql .=
' d.label, d.fk_product as product_id, d.fk_product as fk_product, d.info_bits, d.date_ouverture as date_start, d.date_cloture as date_end, d.qty, d.qty as prod_qty, d.total_ht as total_ht, ';
311 if ($type_element !=
'fichinter') $sql .=
' p.ref as ref, p.rowid as prod_id, p.rowid as fk_product, p.fk_product_type as prod_type, p.fk_product_type as fk_product_type, p.entity as pentity,';
312 $sql .=
" s.rowid as socid ";
313 if ($type_element !=
'fichinter') $sql .=
", p.ref as prod_ref, p.label as product_label";
314 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s, ".$tables_from;
315 if ($type_element !=
'fichinter') $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'product as p ON d.fk_product = p.rowid ';
318 if ($sref) $sql .=
" AND ".$doc_number.
" LIKE '%".$db->escape($sref).
"%'";
319 if ($sprod_fulldescr)
321 $sql .=
" AND (d.description LIKE '%".$db->escape($sprod_fulldescr).
"%'";
322 if (
GETPOST(
'type_element') !=
'fichinter') $sql .=
" OR p.ref LIKE '%".$db->escape($sprod_fulldescr).
"%'";
323 if (
GETPOST(
'type_element') !=
'fichinter') $sql .=
" OR p.label LIKE '%".$db->escape($sprod_fulldescr).
"%'";
326 $sql .= $db->order($sortfield, $sortorder);
328 $resql = $db->query($sql);
329 $totalnboflines = $db->num_rows(
$resql);
331 $sql .= $db->plimit($limit + 1, $offset);
337 if (empty($elementTypeArray) && !$object->client && !$object->fournisseur)
339 $showempty = $langs->trans(
"ThirdpartyNotCustomerNotSupplierSoNoRef");
344 $typeElementString = $form->selectarray(
"type_element", $elementTypeArray,
GETPOST(
'type_element'), $showempty, 0, 0,
'', 0, 0, $disabled,
'',
'maxwidth150onsmartphone');
345 $button =
'<input type="submit" class="button" name="button_third" value="'.dol_escape_htmltag($langs->trans(
"Search")).
'" title="'.
dol_escape_htmltag($langs->trans(
"Search")).
'">';
348 $param .=
"&sref=".urlencode($sref);
349 $param .=
"&month=".urlencode($month);
350 $param .=
"&year=".urlencode($year);
351 $param .=
"&sprod_fulldescr=".urlencode($sprod_fulldescr);
352 $param .=
"&socid=".urlencode($socid);
353 $param .=
"&type_element=".urlencode($type_element);
359 $resql = $db->query($sql);
362 $num = $db->num_rows(
$resql);
364 $param =
"&socid=".urlencode($socid).
"&type_element=".urlencode($type_element);
365 if (!empty($contextpage) && $contextpage !=
$_SERVER[
"PHP_SELF"]) $param .=
'&contextpage='.urlencode($contextpage);
366 if ($limit > 0 && $limit != $conf->liste_limit) $param .=
'&limit='.urlencode($limit);
367 if ($sprod_fulldescr) $param .=
"&sprod_fulldescr=".urlencode($sprod_fulldescr);
368 if ($sref) $param .=
"&sref=".urlencode($sref);
369 if ($month) $param .=
"&month=".urlencode($month);
370 if ($year) $param .=
"&year=".urlencode($year);
371 if ($optioncss !=
'') $param .=
'&optioncss='.urlencode($optioncss);
373 print_barre_liste($langs->trans(
'ProductsIntoElements').
' '.$typeElementString.
' '.$button, $page,
$_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num, $totalnboflines,
'', 0,
'',
'', $limit);
375 print '<div class="div-table-responsive-no-min">';
376 print
'<table class="liste centpercent">'.
"\n";
379 print
'<tr class="liste_titre">';
380 print
'<td class="liste_titre left">';
381 print
'<input class="flat" type="text" name="sref" size="8" value="'.$sref.
'">';
383 print
'<td class="liste_titre nowrap center">';
384 print $formother->select_month($month ? $month : -1,
'month', 1, 0,
'valignmiddle');
385 $formother->select_year($year ? $year : -1,
'year', 1, 20, 1);
387 print
'<td class="liste_titre center">';
389 print
'<td class="liste_titre left">';
390 print
'<input class="flat" type="text" name="sprod_fulldescr" size="15" value="'.dol_escape_htmltag($sprod_fulldescr).
'">';
392 print
'<td class="liste_titre center">';
394 print
'<td class="liste_titre center">';
396 print
'<td class="liste_titre maxwidthsearch">';
397 $searchpicto = $form->showFilterAndCheckAddButtons(0);
403 print
'<tr class="liste_titre">';
404 print_liste_field_titre(
'Ref', $_SERVER[
'PHP_SELF'],
'doc_number',
'', $param,
'', $sortfield, $sortorder,
'left ');
405 print_liste_field_titre(
'Date', $_SERVER[
'PHP_SELF'],
'dateprint',
'', $param,
'width="150"', $sortfield, $sortorder,
'center ');
406 print_liste_field_titre(
'Status', $_SERVER[
'PHP_SELF'],
'fk_statut',
'', $param,
'', $sortfield, $sortorder,
'center ');
408 print_liste_field_titre(
'Quantity', $_SERVER[
'PHP_SELF'],
'prod_qty',
'', $param,
'', $sortfield, $sortorder,
'right ');
409 print_liste_field_titre(
'TotalHT', $_SERVER[
'PHP_SELF'],
'total_ht',
'', $param,
'', $sortfield, $sortorder,
'right ');
410 print_liste_field_titre(
'UnitPrice', $_SERVER[
'PHP_SELF'],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
415 while (($objp = $db->fetch_object(
$resql)) && $i < min($num, $limit))
417 $documentstatic->id = $objp->doc_id;
418 $documentstatic->ref = $objp->doc_number;
419 $documentstatic->type = $objp->doc_type;
420 $documentstatic->fk_statut = $objp->status;
421 $documentstatic->fk_status = $objp->status;
422 $documentstatic->statut = $objp->status;
423 $documentstatic->status = $objp->status;
424 $documentstatic->paye = $objp->paid;
425 $documentstatic->alreadypaid = $objp->paid;
427 if (is_object($documentstaticline)) $documentstaticline->statut = $objp->status;
429 print
'<tr class="oddeven">';
430 print
'<td class="nobordernopadding nowrap" width="100">';
431 print $documentstatic->getNomUrl(1);
433 print
'<td class="center" width="80">'.dol_print_date($db->jdate($objp->dateprint),
'day').
'</td>';
436 print
'<td class="center">';
437 if ($type_element ==
'contract') {
438 print $documentstaticline->getLibStatut(5);
439 } elseif ($type_element ==
'invoice') {
440 print $documentstatic->getLibStatut(5, $objp->paid);
442 print $documentstatic->getLibStatut(5);
447 print
'<td class="tdoverflowmax300">';
450 $text =
''; $description =
''; $type = 0;
453 if ($objp->fk_product > 0)
455 $product_static =
new Product($db);
457 $product_static->type = $objp->fk_product_type;
458 $product_static->id = $objp->fk_product;
459 $product_static->ref = $objp->ref;
460 $product_static->entity = $objp->pentity;
461 $text = $product_static->getNomUrl(1);
465 if ($objp->fk_product > 0)
468 if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE))
471 $prod->fetch($objp->fk_product);
473 $outputlangs = $langs;
475 if (empty($newlang) &&
GETPOST(
'lang_id',
'aZ09')) $newlang =
GETPOST(
'lang_id',
'aZ09');
476 if (empty($newlang)) $newlang = $object->default_lang;
477 if (!empty($newlang))
480 $outputlangs->setDefaultLang($newlang);
483 $label = (!empty($prod->multilangs[$outputlangs->defaultlang][
"label"])) ? $prod->multilangs[$outputlangs->defaultlang][
"label"] : $objp->product_label;
485 $label = $objp->product_label;
488 $text .=
' - '.(!empty($objp->label) ? $objp->label : $label);
489 $description = (!empty($conf->global->PRODUIT_DESC_IN_FORM) ?
'' :
dol_htmlentitiesbr($objp->description));
492 if (($objp->info_bits & 2) == 2) { ?>
493 <a href=
"<?php echo DOL_URL_ROOT.'/comm/remx.php?id='.$object->id; ?>">
496 print
img_object($langs->trans(
"ShowReduc"),
'reduc').
' ';
497 if ($objp->description ==
'(DEPOSIT)') $txt = $langs->trans(
"Deposit");
498 elseif ($objp->description ==
'(EXCESS RECEIVED)') $txt = $langs->trans("ExcessReceived");
499 elseif ($objp->
description == '(EXCESS PAID)') $txt = $langs->trans("ExcessPaid");
507 if ($objp->description ==
'(CREDIT_NOTE)' && $objp->fk_remise_except > 0)
510 $discount->fetch($objp->fk_remise_except);
511 echo ($txt ?
' - ' :
'').$langs->transnoentities(
"DiscountFromCreditNote", $discount->getNomUrl(0));
513 if ($objp->description ==
'(EXCESS RECEIVED)' && $objp->fk_remise_except > 0)
516 $discount->fetch($objp->fk_remise_except);
517 echo ($txt ?
' - ' :
'').$langs->transnoentities(
"DiscountFromExcessReceived", $discount->getNomUrl(0));
518 } elseif ($objp->description ==
'(EXCESS PAID)' && $objp->fk_remise_except > 0)
521 $discount->fetch($objp->fk_remise_except);
522 echo ($txt ?
' - ' :
'').$langs->transnoentities(
"DiscountFromExcessPaid", $discount->getNomUrl(0));
523 } elseif ($objp->description ==
'(DEPOSIT)' && $objp->fk_remise_except > 0)
526 $discount->fetch($objp->fk_remise_except);
527 echo ($txt ?
' - ' :
'').$langs->transnoentities(
"DiscountFromDeposit", $discount->getNomUrl(0));
529 if (!empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) echo
' ('.
dol_print_date($discount->datec).
')';
531 echo ($txt ?
' - ' :
'').dol_htmlentitiesbr($objp->description);
535 if ($objp->fk_product > 0) {
536 echo $form->textwithtooltip($text, $description, 3,
'',
'', $i, 0,
'');
542 if (!empty($conf->global->PRODUIT_DESC_IN_FORM))
544 print (!empty($objp->description) && $objp->description != $objp->product_label) ?
'<br>'.dol_htmlentitiesbr($objp->description) :
'';
547 if (!empty($objp->label) || !empty($objp->description))
549 if ($type == 1) $text =
img_object($langs->trans(
'Service'),
'service');
550 else $text =
img_object($langs->trans(
'Product'),
'product');
552 if (!empty($objp->label)) {
553 $text .=
' <strong>'.$objp->label.
'</strong>';
554 echo $form->textwithtooltip($text,
dol_htmlentitiesbr($objp->description), 3,
'',
'', $i, 0,
'');
587 print
'<td class="right">'.$objp->prod_qty.
'</td>';
588 $total_qty += $objp->prod_qty;
590 print
'<td class="right">'.price($objp->total_ht).
'</td>';
591 $total_ht += $objp->total_ht;
593 print
'<td class="right">'.price($objp->total_ht / (empty($objp->prod_qty) ? 1 : $objp->prod_qty)).
'</td>';
599 print
'<tr class="liste_total">';
600 print
'<td>'.$langs->trans(
'Total').
'</td>';
601 print
'<td colspan="3"></td>';
602 print
'<td class="right">'.$total_qty.
'</td>';
603 print
'<td class="right">'.price($total_ht).
'</td>';
604 print
'<td class="right">'.price($total_ht / (empty($total_qty) ? 1 : $total_qty)).
'</td>';
609 print_barre_liste(
'', $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num);
612 } elseif (empty($type_element) || $type_element == -1)
614 print_barre_liste($langs->trans(
'ProductsIntoElements').
' '.$typeElementString.
' '.$button, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num,
'',
'');
616 print
'<table class="liste centpercent">'.
"\n";
618 print
'<tr class="liste_titre">';
619 print_liste_field_titre(
'Ref', $_SERVER[
'PHP_SELF'],
'doc_number',
'', $param,
'', $sortfield, $sortorder,
'left ');
620 print_liste_field_titre(
'Date', $_SERVER[
'PHP_SELF'],
'dateprint',
'', $param,
'width="150"', $sortfield, $sortorder,
'center ');
621 print_liste_field_titre(
'Status', $_SERVER[
'PHP_SELF'],
'fk_status',
'', $param,
'', $sortfield, $sortorder,
'center ');
623 print_liste_field_titre(
'Quantity', $_SERVER[
'PHP_SELF'],
'prod_qty',
'', $param,
'', $sortfield, $sortorder,
'right ');
626 print
'<tr class="oddeven"><td class="opacitymedium" colspan="5">'.$langs->trans(
"SelectElementAndClick", $langs->transnoentitiesnoconv(
"Search")).
'</td></tr>';
630 print_barre_liste($langs->trans(
'ProductsIntoElements').
' '.$typeElementString.
' '.$button, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder,
'', $num,
'',
'');
632 print
'<table class="liste centpercent">'.
"\n";
634 print
'<tr class="oddeven"><td class="opacitymedium" colspan="5">'.$langs->trans(
"FeatureNotYetAvailable").
'</td></tr>';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
</td > param sortfield sortorder printFieldListOption< tdclass="liste_titremaxwidthsearchright"></td ></tr >< trclass="liste_titre">< inputtype="checkbox"onClick="toggle(this)"/> Ref p ref Label p label Duration p duration center DesiredStock p desiredstock right StockLimitShort p seuil_stock_alerte right stock_physique right stock_real_warehouse right Ordered right StockToBuy right SupplierRef right param sortfield sortorder printFieldListTitle warehouseinternal SELECT description FROM product_lang WHERE qty< br > qty qty qty StockTooLow StockTooLow help help help< trclass="oddeven">< td >< inputtype="checkbox"class="check"name="choose'.$i.'"></td >< tdclass="nowrap"> stock</td >< td >< inputtype="hidden"name="desc'.$i.'"value="'.dol_escape_htmltag($objp-> description
Only used if Module[ID]Desc translation string is not found.
Class to manage products or services.
Class to manage interventions.
get_date_range($date_start, $date_end, $format= '', $outputlangs= '', $withparenthesis=1)
Format output for start and end date.
Class to manage contracts.
dol_htmlentitiesbr($stringtoencode, $nl2brmode=0, $pagecodefrom= 'UTF-8', $removelasteolbr=1)
This function is called to encode a string into a HTML string but differs from htmlentities because a...
Class to manage lines of contracts.
Class to manage suppliers invoices.
const TYPE_CREDIT_NOTE
Credit note invoice.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
print_barre_liste($titre, $page, $file, $options= '', $sortfield= '', $sortorder= '', $morehtmlcenter= '', $num=-1, $totalnboflines= '', $picto= 'generic', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow= '')
Print a title with navigation controls for pagination.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname.
Class to manage third parties objects (customers, suppliers, prospects...)
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
Class to manage customers orders.
img_object($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
restrictedArea($user, $features, $objectid=0, $tableandshare= '', $feature2= '', $dbt_keyfield= 'fk_soc', $dbt_select= 'rowid', $isdraft=0)
Check permissions of a user to show a page and an object.
Class to manage translations.
dolSqlDateFilter($datefield, $day_date, $month_date, $year_date, $excludefirstand=0)
Generate a SQL string to make a filter into a range (for second of date until last second of date) ...
societe_prepare_head(Societe $object)
Return array of tabs to used on pages for third parties cards.
Class to manage predefined suppliers products.
print $_SERVER["PHP_SELF"]
Edit parameters.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
dol_print_date($time, $format= '', $tzoutput= 'auto', $outputlangs= '', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
Class to manage price ask supplier.
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
Class to manage absolute discounts.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
Class to manage invoices.
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.
if(!defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN'
Draft customers invoices.
Class to manage proposals.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $keepmoretags= '', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields...