// Libelle print '<tr><td>'.$langs->trans("Label").'</td><td colspan="3">'.$product->libelle.'</td>'; print '</tr>'; // Status (to sell) print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')'.'</td><td colspan="3">'; print $product->getLibStatut(2,0); print '</td></tr>'; // Status (to buy) print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')'.'</td><td colspan="3">'; print $product->getLibStatut(2,1); print '</td></tr>'; show_stats_for_company($product,$socid); print "</table>"; print '</div>'; $now=dol_now(); $sql = "SELECT"; $sql.= ' sum('.$db->ifsql("cd.statut=0",1,0).') as nb_initial,'; $sql.= ' sum('.$db->ifsql("cd.statut=4 AND cd.date_fin_validite > '".$db->idate($now)."'",1,0).") as nb_running,"; $sql.= ' sum('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NULL OR cd.date_fin_validite <= '".$db->idate($now)."')",1,0).') as nb_late,'; $sql.= ' sum('.$db->ifsql("cd.statut=5",1,0).') as nb_closed,'; $sql.= " c.rowid as rowid, c.date_contrat, c.statut as statut,"; $sql.= " s.nom, s.rowid as socid, s.code_client"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
llxHeader("", "", $langs->trans("CardProduct" . $product->type)); if ($result > 0) { $head = product_prepare_head($product); $titre = $langs->trans("CardProduct" . $product->type); $picto = $product->type == Product::TYPE_SERVICE ? 'service' : 'product'; dol_fiche_head($head, 'referers', $titre, 0, $picto); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $product, $action); // Note that $action and $object may have been modified by hook if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } dol_banner_tab($object, 'ref', '', $user->societe_id ? 0 : 1, 'ref'); print '<div class="fichecenter">'; print '<div class="underbanner clearboth"></div>'; print '<table class="border tableforfield" width="100%">'; $nboflines = show_stats_for_company($product, $socid); print "</table>"; print '</div>'; print '<div style="clear:both"></div>'; dol_fiche_end(); if ($showmessage && $nboflines > 1) { print $langs->trans("ClinkOnALinkOfColumn", $langs->transnoentitiesnoconv("Referers")); } elseif ($user->rights->facture->lire) { $sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, s.code_client,"; $sql .= " f.facnumber, f.datef, f.paye, f.fk_statut as statut, f.rowid as facid,"; $sql .= " d.rowid, d.total_ht as total_ht, d.qty"; // We must keep the d.rowid here to not loose record because of the distinct used to ignore duplicate line when link on societe_commerciaux is used if (!$user->rights->societe->client->voir && !$socid) { $sql .= ", sc.fk_soc, sc.fk_user "; } $sql .= " FROM " . MAIN_DB_PREFIX . "societe as s";