30 require
'../main.inc.php';
31 require_once DOL_DOCUMENT_ROOT.
'/bom/class/bom.class.php';
32 require_once DOL_DOCUMENT_ROOT.
'/mrp/class/mo.class.php';
37 $hookmanager->initHooks(array(
'mrpindex'));
40 $langs->loadLangs(array(
"companies",
"mrp"));
52 $staticbom =
new BOM($db);
53 $staticmo =
new Mo($db);
60 print
'<div class="fichecenter"><div class="fichethirdleft">';
67 if ($conf->use_javascript_ajax) {
68 $sql =
"SELECT COUNT(t.rowid) as nb, status";
69 $sql .=
" FROM ".MAIN_DB_PREFIX.
"mrp_mo as t";
70 $sql .=
" GROUP BY t.status";
71 $sql .=
" ORDER BY t.status ASC";
72 $resql = $db->query(
$sql);
75 $num = $db->num_rows($resql);
79 $dataseries = array();
80 $colorseries = array();
83 include DOL_DOCUMENT_ROOT.
'/theme/'.$conf->theme.
'/theme_vars.inc.php';
86 $obj = $db->fetch_object($resql);
88 $vals[$obj->status] = $obj->nb;
96 print
'<div class="div-table-responsive-no-min">';
97 print
'<table class="noborder nohover centpercent">';
98 print
'<tr class="liste_titre"><th colspan="2">'.$langs->trans(
"Statistics").
' - '.$langs->trans(
"ManufacturingOrder").
'</th>';
100 $listofstatus = array(0, 1, 2, 3, 9);
101 foreach ($listofstatus as $status) {
102 $dataseries[] = array($staticmo->LibStatut($status, 1), (isset($vals[$status]) ? (
int) $vals[$status] : 0));
103 if ($status == Mo::STATUS_DRAFT) {
104 $colorseries[$status] =
'-'.$badgeStatus0;
106 if ($status == Mo::STATUS_VALIDATED) {
107 $colorseries[$status] = $badgeStatus1;
109 if ($status == Mo::STATUS_INPROGRESS) {
110 $colorseries[$status] = $badgeStatus4;
112 if ($status == Mo::STATUS_PRODUCED) {
113 $colorseries[$status] = $badgeStatus6;
115 if ($status == Mo::STATUS_CANCELED) {
116 $colorseries[$status] = $badgeStatus9;
119 if (empty($conf->use_javascript_ajax)) {
120 print
'<tr class="oddeven">';
121 print
'<td>'.$staticmo->LibStatut($status, 0).
'</td>';
122 print
'<td class="right"><a href="list.php?statut='.$status.
'">'.(isset($vals[$status]) ? $vals[$status] : 0).
'</a></td>';
126 if ($conf->use_javascript_ajax) {
127 print
'<tr><td class="center" colspan="2">';
129 include_once DOL_DOCUMENT_ROOT.
'/core/class/dolgraph.class.php';
131 $dolgraph->SetData($dataseries);
132 $dolgraph->SetDataColor(array_values($colorseries));
133 $dolgraph->setShowLegend(2);
134 $dolgraph->setShowPercent(1);
135 $dolgraph->SetType(array(
'pie'));
136 $dolgraph->SetHeight(
'200');
137 $dolgraph->draw(
'idgraphstatus');
138 print $dolgraph->show($totalnb ? 0 : 1);
154 print
'</div><div class="fichetwothirdright">';
161 $sql =
"SELECT a.rowid, a.status, a.ref, a.tms as datem, a.status, a.fk_product";
162 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bom_bom as a";
163 $sql .=
" WHERE a.entity IN (".getEntity(
'bom').
")";
164 $sql .= $db->order(
"a.tms",
"DESC");
165 $sql .= $db->plimit($max, 0);
167 $resql = $db->query(
$sql);
169 print
'<div class="div-table-responsive-no-min">';
170 print
'<table class="noborder centpercent">';
171 print
'<tr class="liste_titre">';
172 print
'<th colspan="2">'.$langs->trans(
"LatestBOMModified", $max);
173 $lastmodified =
'<a href="'.DOL_URL_ROOT.
'/bom/bom_list.php?sortfield=t.tms&sortorder=DESC" title="'.$langs->trans(
"FullList").
'">';
174 $lastmodified .=
'<span class="badge marginleftonlyshort">...</span>';
175 $lastmodified .=
'</a>';
178 print
'<th class="right">';
183 $num = $db->num_rows($resql);
187 $obj = $db->fetch_object($resql);
189 $staticbom->id = $obj->rowid;
190 $staticbom->ref = $obj->ref;
191 $staticbom->fk_product = $obj->fk_product;
192 $staticbom->date_modification = $obj->datem;
193 $staticbom->status = $obj->status;
195 print
'<tr class="oddeven">';
196 print
'<td>'.$staticbom->getNomUrl(1, 32).
'</td>';
197 print
'<td>'.dol_print_date($db->jdate($obj->datem),
'dayhour').
'</td>';
198 print
'<td class="right">'.$staticbom->getLibStatut(3).
'</td>';
203 print
'<tr class="oddeven">';
204 print
'<td colspan="3"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td>';
207 print
"</table></div>";
218 $sql =
"SELECT a.rowid, a.status, a.ref, a.tms as datem, a.status";
219 $sql .=
" FROM ".MAIN_DB_PREFIX.
"mrp_mo as a";
220 $sql .=
" WHERE a.entity IN (".getEntity(
'mo').
")";
221 $sql .= $db->order(
"a.tms",
"DESC");
222 $sql .= $db->plimit($max, 0);
224 $resql = $db->query(
$sql);
226 print
'<div class="div-table-responsive-no-min">';
227 print
'<table class="noborder centpercent">';
228 print
'<tr class="liste_titre">';
229 print
'<th colspan="2">'.$langs->trans(
"LatestMOModified", $max);
230 $lastmodified =
'<a href="'.DOL_URL_ROOT.
'/mrp/mo_list.php?sortfield=t.tms&sortorder=DESC" title="'.$langs->trans(
"FullList").
'">';
231 $lastmodified .=
'<span class="badge marginleftonlyshort">...</span>';
232 $lastmodified .=
'</a>';
235 print
'<th class="right">';
240 $num = $db->num_rows($resql);
244 $obj = $db->fetch_object($resql);
246 $staticmo->id = $obj->rowid;
247 $staticmo->ref = $obj->ref;
248 $staticmo->date_modification = $obj->datem;
249 $staticmo->status = $obj->status;
251 print
'<tr class="oddeven">';
252 print
'<td>'.$staticmo->getNomUrl(1, 32).
'</td>';
253 print
'<td>'.dol_print_date($db->jdate($obj->datem),
'dayhour').
'</td>';
254 print
'<td class="right">'.$staticmo->getLibStatut(3).
'</td>';
259 print
'<tr class="oddeven">';
260 print
'<td colspan="3"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td>';
263 print
"</table></div>";
269 print
'</div></div>';
276 $reshook = $hookmanager->executeHooks(
'dashboardMRP', $parameters,
$object);
if($user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
if(isModEnabled('invoice') && $user->hasRight('facture', 'lire')) if((isModEnabled('fournisseur') &&!getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') && $user->hasRight('don', 'lire')) if(isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) if(isModEnabled('invoice') &&isModEnabled('order') && $user->hasRight("commande", "lire") &&!getDolGlobalString('WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER')) $sql
Social contributions to pay.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
if(!defined('NOTOKENRENEWAL')) if(!defined('NOLOGIN')) if(!defined('NOCSRFCHECK')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) if(!defined('NOIPCHECK')) if(!defined('NOBROWSERNOTIF')) llxHeader()
Header empty.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.