29 require
'../main.inc.php';
30 require_once DOL_DOCUMENT_ROOT.
'/bom/class/bom.class.php';
31 require_once DOL_DOCUMENT_ROOT.
'/mrp/class/mo.class.php';
36 $hookmanager->initHooks(array(
'mrpindex'));
39 $langs->loadLangs(array(
"companies",
"mrp"));
49 $staticbom =
new BOM($db);
50 $staticmo =
new Mo($db);
57 print '<div class="fichecenter"><div class="fichethirdleft">';
64 if ($conf->use_javascript_ajax)
66 $sql =
"SELECT COUNT(t.rowid) as nb, status";
67 $sql .=
" FROM ".MAIN_DB_PREFIX.
"mrp_mo as t";
68 $sql .=
" GROUP BY t.status";
69 $sql .=
" ORDER BY t.status ASC";
74 $num = $db->num_rows(
$resql);
78 $dataseries = array();
79 $colorseries = array();
82 include_once DOL_DOCUMENT_ROOT.
'/theme/'.$conf->theme.
'/theme_vars.inc.php';
86 $obj = $db->fetch_object(
$resql);
89 $vals[$obj->status] = $obj->nb;
97 print
'<div class="div-table-responsive-no-min">';
98 print
'<table class="noborder nohover centpercent">';
99 print
'<tr class="liste_titre"><th colspan="2">'.$langs->trans(
"Statistics").
' - '.$langs->trans(
"ManufacturingOrder").
'</th></tr>'.
"\n";
100 $listofstatus = array(0, 1, 2, 3, 9);
101 foreach ($listofstatus as $status)
103 $dataseries[] = array($staticmo->LibStatut($status, 1), (isset($vals[$status]) ? (int) $vals[$status] : 0));
104 if ($status == Mo::STATUS_DRAFT) $colorseries[$status] =
'-'.$badgeStatus0;
105 if ($status == Mo::STATUS_VALIDATED) $colorseries[$status] = $badgeStatus1;
106 if ($status == Mo::STATUS_INPROGRESS) $colorseries[$status] = $badgeStatus4;
107 if ($status == Mo::STATUS_PRODUCED) $colorseries[$status] = $badgeStatus6;
108 if ($status == Mo::STATUS_CANCELED) $colorseries[$status] = $badgeStatus9;
110 if (empty($conf->use_javascript_ajax))
112 print
'<tr class="oddeven">';
113 print
'<td>'.$staticmo->LibStatut($status, 0).
'</td>';
114 print
'<td class="right"><a href="list.php?statut='.$status.
'">'.(isset($vals[$status]) ? $vals[$status] : 0).
'</a></td>';
118 if ($conf->use_javascript_ajax)
120 print
'<tr><td class="center" colspan="2">';
122 include_once DOL_DOCUMENT_ROOT.
'/core/class/dolgraph.class.php';
124 $dolgraph->SetData($dataseries);
125 $dolgraph->SetDataColor(array_values($colorseries));
126 $dolgraph->setShowLegend(2);
127 $dolgraph->setShowPercent(1);
128 $dolgraph->SetType(array(
'pie'));
129 $dolgraph->SetHeight(
'200');
130 $dolgraph->draw(
'idgraphstatus');
131 print $dolgraph->show($totalnb ? 0 : 1);
147 print
'</div><div class="fichetwothirdright"><div class="ficheaddleft">';
155 $sql =
"SELECT a.rowid, a.status, a.ref, a.tms as datem, a.status";
156 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bom_bom as a";
157 $sql .=
" WHERE a.entity IN (".getEntity(
'bom').
")";
158 $sql .= $db->order(
"a.tms",
"DESC");
159 $sql .= $db->plimit($max, 0);
161 $resql = $db->query($sql);
164 print
'<div class="div-table-responsive-no-min">';
165 print
'<table class="noborder centpercent">';
166 print
'<tr class="liste_titre">';
167 print
'<th colspan="4">'.$langs->trans(
"LatestBOMModified", $max).
'</th></tr>';
169 $num = $db->num_rows(
$resql);
175 $obj = $db->fetch_object(
$resql);
177 $staticbom->id = $obj->rowid;
178 $staticbom->ref = $obj->ref;
179 $staticbom->date_modification = $obj->datem;
180 $staticbom->status = $obj->status;
182 print
'<tr class="oddeven">';
183 print
'<td>'.$staticbom->getNomUrl(1, 32).
'</td>';
184 print
'<td>'.dol_print_date($db->jdate($obj->datem),
'dayhour').
'</td>';
185 print
'<td class="right">'.$staticbom->getLibStatut(3).
'</td>';
190 print
'<tr class="oddeven">';
191 print
'<td><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td>';
194 print
"</table></div>";
206 $sql =
"SELECT a.rowid, a.status, a.ref, a.tms as datem, a.status";
207 $sql .=
" FROM ".MAIN_DB_PREFIX.
"mrp_mo as a";
208 $sql .=
" WHERE a.entity IN (".getEntity(
'mo').
")";
209 $sql .= $db->order(
"a.tms",
"DESC");
210 $sql .= $db->plimit($max, 0);
212 $resql = $db->query($sql);
215 print
'<div class="div-table-responsive-no-min">';
216 print
'<table class="noborder centpercent">';
217 print
'<tr class="liste_titre">';
218 print
'<th colspan="4">'.$langs->trans(
"LatestMOModified", $max).
'</th></tr>';
220 $num = $db->num_rows(
$resql);
226 $obj = $db->fetch_object(
$resql);
228 $staticmo->id = $obj->rowid;
229 $staticmo->ref = $obj->ref;
230 $staticmo->date_modification = $obj->datem;
231 $staticmo->status = $obj->status;
233 print
'<tr class="oddeven">';
234 print
'<td>'.$staticmo->getNomUrl(1, 32).
'</td>';
235 print
'<td>'.dol_print_date($db->jdate($obj->datem),
'dayhour').
'</td>';
236 print
'<td class="right">'.$staticmo->getLibStatut(3).
'</td>';
241 print
'<tr class="oddeven">';
242 print
'<td><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td>';
245 print
"</table></div>";
251 print
'</div></div></div>';
257 $reshook = $hookmanager->executeHooks(
'dashboardMRP', $parameters);
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
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.
print
Draft customers invoices.
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...