From c2f0cdc0f6eb51cdb651b3ab29b8676d6a8cbaa9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 23 Mar 2020 19:35:14 +0100 Subject: [PATCH] Look and feel v12. Several minor fixes --- htdocs/expedition/index.php | 216 +++++++++++--------------- htdocs/expedition/stats/index.php | 2 +- htdocs/langs/en_US/admin.lang | 2 +- htdocs/product/stock/index.php | 6 +- htdocs/projet/class/project.class.php | 4 +- htdocs/reception/index.php | 199 +++++++++--------------- htdocs/reception/stats/index.php | 2 +- 7 files changed, 173 insertions(+), 258 deletions(-) diff --git a/htdocs/expedition/index.php b/htdocs/expedition/index.php index 8c60c194c8b..af093829250 100644 --- a/htdocs/expedition/index.php +++ b/htdocs/expedition/index.php @@ -68,6 +68,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele /* * Shipments to validate */ + $clause = " WHERE "; $sql = "SELECT e.rowid, e.ref, e.ref_customer,"; @@ -91,12 +92,14 @@ $resql=$db->query($sql); if ($resql) { $num = $db->num_rows($resql); + + print '
'; + print ''; + print ''; + print ''; + if ($num) { - print '
'; - print '
'.$langs->trans("SendingsToValidate").'
'; - print ''; - print ''; $i = 0; while ($i < $num) { @@ -117,132 +120,23 @@ if ($resql) print ''; $i++; } - print "
'.$langs->trans("SendingsToValidate").'

"; - } -} - - -/* - * Commandes a traiter - */ -$sql = "SELECT c.rowid, c.ref, c.ref_client as ref_customer, c.fk_statut, s.nom as name, s.rowid as socid"; -$sql.= " FROM ".MAIN_DB_PREFIX."commande as c,"; -$sql.= " ".MAIN_DB_PREFIX."societe as s"; -if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; -$sql.= " WHERE c.fk_soc = s.rowid"; -$sql.= " AND c.entity = ".$conf->entity; -$sql.= " AND c.fk_statut = 1"; -if ($socid) $sql.= " AND c.fk_soc = ".$socid; -if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; -$sql.= " ORDER BY c.rowid ASC"; - -$resql=$db->query($sql); -if ($resql) -{ - $num = $db->num_rows($resql); - if ($num) + } else { - $langs->load("orders"); - - $i = 0; - print '
'; - print ''; - print ''; - print ''; - while ($i < $num) - { - $obj = $db->fetch_object($resql); - - $orderstatic->id=$obj->rowid; - $orderstatic->ref=$obj->ref; - $orderstatic->ref_customer=$obj->ref_customer; - $orderstatic->statut=$obj->fk_statut; - $orderstatic->billed=0; - - $companystatic->name=$obj->name; - $companystatic->id=$obj->socid; - - print ''; - print ''; - print ''; - print ''; - print ''; - $i++; - } - print "
'.$langs->trans("OrdersToProcess").'
'; - print $orderstatic->getNomUrl(1); - print ''; - print $companystatic->getNomUrl(1, 'customer', 32); - print ''; - print $orderstatic->getLibStatut(3); - print '

"; + print ''.$langs->trans("None").''; } + + print "
"; } + //print ''; print '
'; +$max = 5; /* - * Commandes en traitement - */ -$sql = "SELECT c.rowid, c.ref, c.ref_client as ref_customer, c.fk_statut as status, c.facture as billed, s.nom as name, s.rowid as socid"; -$sql.= " FROM ".MAIN_DB_PREFIX."commande as c,"; -$sql.= " ".MAIN_DB_PREFIX."societe as s"; -if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; -$sql.= " WHERE c.fk_soc = s.rowid"; -$sql.= " AND c.entity = ".$conf->entity; -$sql.= " AND c.fk_statut = 2"; -if ($socid) $sql.= " AND c.fk_soc = ".$socid; -if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; - -$resql = $db->query($sql); -if ( $resql ) -{ - $langs->load("orders"); - - $num = $db->num_rows($resql); - if ($num) - { - $i = 0; - print '
'; - print ''; - print ''; - print ''; - while ($i < $num) - { - $obj = $db->fetch_object($resql); - - $orderstatic->id=$obj->rowid; - $orderstatic->ref=$obj->ref; - $orderstatic->ref_customer=$obj->ref_customer; - $orderstatic->statut=$obj->status; - $orderstatic->billed=$obj->billed; - - $companystatic->name=$obj->name; - $companystatic->id=$obj->socid; - - print ''; - print ''; - print ''; - print ''; - $i++; - } - print "
'.$langs->trans("OrdersInProcess").'
'; - print $orderstatic->getNomUrl(1); - print ''; - print $companystatic->getNomUrl(1, 'customer'); - print ''; - print $orderstatic->getLibStatut(3); - print '

"; - } -} -else dol_print_error($db); - - -/* - * Last shipments + * Latest shipments */ $sql = "SELECT e.rowid, e.ref, e.ref_customer,"; $sql.= " s.nom as name, s.rowid as socid,"; @@ -254,10 +148,10 @@ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = e.fk_soc"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON e.fk_soc = sc.fk_soc"; $sql.= " WHERE e.entity IN (".getEntity('expedition').")"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND sc.fk_user = " .$user->id; -$sql.= " AND e.fk_statut = 1"; +$sql.= " AND e.fk_statut = ".Expedition::STATUS_VALIDATED; if ($socid) $sql.= " AND c.fk_soc = ".$socid; $sql.= " ORDER BY e.date_delivery DESC"; -$sql.= $db->plimit(5, 0); +$sql.= $db->plimit($max, 0); $resql = $db->query($sql); if ($resql) @@ -266,10 +160,10 @@ if ($resql) if ($num) { $i = 0; - print '
'; + print '
'; print ''; print ''; - print ''; + print ''; while ($i < $num) { $obj = $db->fetch_object($resql); @@ -289,8 +183,11 @@ if ($resql) $orderstatic->ref=$obj->commande_ref; print $orderstatic->getNomUrl(1); } - else print ' '; - print ''; + print ''; + print ''; + print ''; $i++; } print "
'.$langs->trans("LastSendings", $num).'
'.$langs->trans("LastSendings", $num).'
'; + + print '

"; @@ -299,6 +196,73 @@ if ($resql) } else dol_print_error($db); +/* + * Open orders + */ +$sql = "SELECT c.rowid, c.ref, c.ref_client as ref_customer, c.fk_statut as status, c.facture as billed, s.nom as name, s.rowid as socid"; +$sql.= " FROM ".MAIN_DB_PREFIX."commande as c,"; +$sql.= " ".MAIN_DB_PREFIX."societe as s"; +if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; +$sql.= " WHERE c.fk_soc = s.rowid"; +$sql.= " AND c.entity IN (".getEntity('order').")"; +$sql.= " AND c.fk_statut IN (".Commande::STATUS_VALIDATED.", ".Commande::STATUS_ACCEPTED.")"; +if ($socid > 0) $sql.= " AND c.fk_soc = ".$socid; +if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; +$sql.= " ORDER BY c.rowid ASC"; + +$resql = $db->query($sql); +if ( $resql ) +{ + $langs->load("orders"); + + $num = $db->num_rows($resql); + if ($num) + { + $i = 0; + print '
'; + print ''; + print ''; + print ''; + while ($i < $num && $i < 10) + { + $obj = $db->fetch_object($resql); + + $orderstatic->id=$obj->rowid; + $orderstatic->ref=$obj->ref; + $orderstatic->ref_customer=$obj->ref_customer; + $orderstatic->statut=$obj->status; + $orderstatic->billed=$obj->billed; + + $companystatic->name=$obj->name; + $companystatic->id=$obj->socid; + + print ''; + print ''; + print ''; + print ''; + $i++; + } + + if ($i < $num) { + print ''; + print ''; + print ''; + print ''; + print ''; + + } + + print "
'.$langs->trans("OrdersToProcess").' '.$num.'
'; + print $orderstatic->getNomUrl(1); + print ''; + print $companystatic->getNomUrl(1, 'customer', 32); + print ''; + print $orderstatic->getLibStatut(3); + print '
'.$langs->trans("More").'...

"; + } +} +else dol_print_error($db); + print '
'; diff --git a/htdocs/expedition/stats/index.php b/htdocs/expedition/stats/index.php index f6642de917f..3204e5361ec 100644 --- a/htdocs/expedition/stats/index.php +++ b/htdocs/expedition/stats/index.php @@ -341,7 +341,7 @@ print ''; */ print '
'; -print ''.$langs->trans("StatsOnShipmentsOnlyValidated").''; +print ''.$langs->trans("StatsOnShipmentsOnlyValidated").''; // End of page llxFooter(); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 0bf5244f8bb..51ff5f4e2f7 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1128,7 +1128,7 @@ LogEventDesc=Enable logging for specific security events. Administrators the log AreaForAdminOnly=Setup parameters can be set by administrator users only. SystemInfoDesc=System information is miscellaneous technical information you get in read only mode and visible for administrators only. SystemAreaForAdminOnly=This area is available to administrator users only. Dolibarr user permissions cannot change this restriction. -CompanyFundationDesc=Edit the information of the company/entity. Click on "%s" button at the bottom of the page. +CompanyFundationDesc=Edit the information of your company/organization. Click on "%s" button at the bottom of the page when done. AccountantDesc=If you have an external accountant/bookkeeper, you can edit here its information. AccountantFileNumber=Accountant code DisplayDesc=Parameters affecting the look and behaviour of Dolibarr can be modified here. diff --git a/htdocs/product/stock/index.php b/htdocs/product/stock/index.php index 35e16e5c840..58997d4384d 100644 --- a/htdocs/product/stock/index.php +++ b/htdocs/product/stock/index.php @@ -65,7 +65,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele print ''; print ""; print ''; - print "'; print "
'.$langs->trans("Search").'
"; + print '
'; print $langs->trans("Warehouse").':

"; } @@ -119,7 +119,7 @@ else print '
'; -// Last movements +// Latest movements $max=10; $sql = "SELECT p.rowid, p.label as produit, p.tobatch, p.tosell, p.tobuy,"; $sql.= " e.ref as stock, e.rowid as entrepot_id,"; @@ -167,7 +167,7 @@ if ($resql) $producttmp->status_buy = $objp->tobuy; print ''; - print ''.dol_print_date($db->jdate($objp->datem), 'dayhour').''; + print ''.dol_print_date($db->jdate($objp->datem), 'dayhour').''; print ''; print $producttmp->getNomUrl(1); print "\n"; diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 54075318246..d8f020708df 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005-2016 Laurent Destailleur + * Copyright (C) 2005-2020 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2013 Florian Henry * Copyright (C) 2014-2017 Marcos GarcĂ­a @@ -701,7 +701,7 @@ class Project extends CommonObject 'propal'=>'fk_projet', 'commande'=>'fk_projet', 'facture'=>'fk_projet', 'supplier_proposal'=>'fk_projet', 'commande_fournisseur'=>'fk_projet', 'facture_fourn'=>'fk_projet', 'expensereport_det'=>'fk_projet', 'contrat'=>'fk_projet', 'fichinter'=>'fk_projet', 'don'=>'fk_projet', - 'actioncomm'=>'fk_project', 'mo'=>'fk_project' + 'actioncomm'=>'fk_project', 'mrp_mo'=>'fk_project' ); foreach ($listoftables as $key => $value) { diff --git a/htdocs/reception/index.php b/htdocs/reception/index.php index a9ed8667474..769f67db44b 100644 --- a/htdocs/reception/index.php +++ b/htdocs/reception/index.php @@ -34,8 +34,7 @@ $hookmanager = new HookManager($db); // Initialize technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('receptionindex')); -$langs->load("orders"); -$langs->load("receptions"); +$langs->loadLangs(array("orders", "receptions")); /* * View @@ -66,9 +65,11 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele print "

\n"; } + /* - * Receptions to validate + * Draft receptions */ + $clause = " WHERE "; $sql = "SELECT e.rowid, e.ref, e.ref_supplier,"; @@ -91,13 +92,14 @@ if ($socid) $sql.= " AND c.fk_soc = ".$socid; $resql=$db->query($sql); if ($resql) { + print '
'; + print ''; + print ''; + print ''; + $num = $db->num_rows($resql); if ($num) { - print '
'; - print '
'.$langs->trans("ReceptionsToValidate").'
'; - print ''; - print ''; $i = 0; while ($i < $num) { @@ -118,132 +120,24 @@ if ($resql) print ''; $i++; } - print "
'.$langs->trans("ReceptionsToValidate").'

"; } -} - - -/* - * CommandeFournisseurs a traiter - */ -$sql = "SELECT c.rowid, c.ref, c.ref_supplier as ref_supplier, c.fk_statut, s.nom as name, s.rowid as socid"; -$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c,"; -$sql.= " ".MAIN_DB_PREFIX."societe as s"; -if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; -$sql.= " WHERE c.fk_soc = s.rowid"; -$sql.= " AND c.entity = ".$conf->entity; -$sql.= " AND c.fk_statut = 3";//Commandé -if ($socid) $sql.= " AND c.fk_soc = ".$socid; -if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; -$sql.= " ORDER BY c.rowid ASC"; -$resql=$db->query($sql); -if ($resql) -{ - $num = $db->num_rows($resql); - if ($num) - { - $langs->load("orders"); - - $i = 0; - print '
'; - print ''; - print ''; - print ''; - while ($i < $num) - { - $obj = $db->fetch_object($resql); - - $orderstatic->id=$obj->rowid; - $orderstatic->ref=$obj->ref; - $orderstatic->ref_supplier=$obj->ref_supplier; - $orderstatic->statut=$obj->fk_statut; - $orderstatic->facturee=0; - - $companystatic->name=$obj->name; - $companystatic->id=$obj->socid; - - print ''; - print ''; - print ''; - print ''; - print ''; - $i++; - } - print "
'.$langs->trans("SuppliersOrdersToProcess").'
'; - print $orderstatic->getNomUrl(1); - print ''; - print $companystatic->getNomUrl(1, 'customer', 32); - print ''; - print $orderstatic->getLibStatut(3); - print '

"; + else { + print ''.$langs->trans("None").''; } + + print "

"; } //print ''; print '
'; +$max = 5; /* - * CommandeFournisseurs en traitement + * Latest receptions */ -$sql = "SELECT c.rowid, c.ref, c.ref_supplier as ref_supplier, c.fk_statut as status, c.billed as billed, s.nom as name, s.rowid as socid"; -$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c,"; -$sql.= " ".MAIN_DB_PREFIX."societe as s"; -if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; -$sql.= " WHERE c.fk_soc = s.rowid"; -$sql.= " AND c.entity = ".$conf->entity; -$sql.= " AND c.fk_statut IN (4)"; -if ($socid) $sql.= " AND c.fk_soc = ".$socid; -if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; -$resql = $db->query($sql); -if ( $resql ) -{ - $langs->load("orders"); - - $num = $db->num_rows($resql); - if ($num) - { - $i = 0; - print '
'; - print ''; - print ''; - print ''; - while ($i < $num) - { - $obj = $db->fetch_object($resql); - - $orderstatic->id=$obj->rowid; - $orderstatic->ref=$obj->ref; - $orderstatic->ref_supplier=$obj->ref_supplier; - $orderstatic->statut=$obj->status; - $orderstatic->facturee=$obj->billed; - - $companystatic->name=$obj->name; - $companystatic->id=$obj->socid; - - print ''; - print ''; - print ''; - print ''; - $i++; - } - print "
'.$langs->trans("SuppliersOrdersInProcess").'
'; - print $orderstatic->getNomUrl(1); - print ''; - print $companystatic->getNomUrl(1, 'customer'); - print ''; - print $orderstatic->getLibStatut(3); - print '

"; - } -} -else dol_print_error($db); - - -/* - * Last receptions - */ $sql = "SELECT e.rowid, e.ref, e.ref_supplier,"; $sql.= " s.nom as name, s.rowid as socid,"; $sql.= " c.ref as commande_fournisseur_ref, c.rowid as commande_fournisseur_id"; @@ -257,8 +151,7 @@ if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND sc.fk_user $sql.= " AND e.fk_statut = 1"; if ($socid) $sql.= " AND c.fk_soc = ".$socid; $sql.= " ORDER BY e.date_delivery DESC"; - -$sql.= $db->plimit(5, 0); +$sql.= $db->plimit($max, 0); $resql = $db->query($sql); if ($resql) @@ -267,7 +160,7 @@ if ($resql) if ($num) { $i = 0; - print '
'; + print '
'; print ''; print ''; print ''; @@ -301,6 +194,64 @@ if ($resql) else dol_print_error($db); + +/* + * Supplier orders to process + */ + +$sql = "SELECT c.rowid, c.ref, c.ref_supplier as ref_supplier, c.fk_statut as status, c.billed as billed, s.nom as name, s.rowid as socid"; +$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c,"; +$sql.= " ".MAIN_DB_PREFIX."societe as s"; +if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; +$sql.= " WHERE c.fk_soc = s.rowid"; +$sql.= " AND c.entity IN (".getEntity('supplier_order').")"; +$sql.= " AND c.fk_statut IN (".CommandeFournisseur::STATUS_ORDERSENT.", ".CommandeFournisseur::STATUS_RECEIVED_PARTIALLY.")"; +if ($socid > 0) $sql.= " AND c.fk_soc = ".$socid; +if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; +$sql.= " ORDER BY c.rowid ASC"; +$resql=$db->query($sql); +if ($resql) +{ + $num = $db->num_rows($resql); + if ($num) + { + $langs->load("orders"); + + $i = 0; + print '
'; + print '
'.$langs->trans("LastReceptions", $num).'
'; + print ''; + print ''; + while ($i < $num) + { + $obj = $db->fetch_object($resql); + + $orderstatic->id=$obj->rowid; + $orderstatic->ref=$obj->ref; + $orderstatic->ref_supplier=$obj->ref_supplier; + $orderstatic->statut=$obj->status; + $orderstatic->facturee=$obj->billed; + + $companystatic->name=$obj->name; + $companystatic->id=$obj->socid; + + print ''; + print ''; + print ''; + print ''; + print ''; + $i++; + } + print "
'.$langs->trans("SuppliersOrdersToProcess").'
'; + print $orderstatic->getNomUrl(1); + print ''; + print $companystatic->getNomUrl(1, 'customer', 32); + print ''; + print $orderstatic->getLibStatut(3); + print '

"; + } +} + print '
'; $parameters = array('user' => $user); diff --git a/htdocs/reception/stats/index.php b/htdocs/reception/stats/index.php index f36c8cf4a86..251247a252b 100644 --- a/htdocs/reception/stats/index.php +++ b/htdocs/reception/stats/index.php @@ -341,7 +341,7 @@ print ''; */ print '
'; -print ''.$langs->trans("StatsOnReceptionsOnlyValidated").''; +print ''.$langs->trans("StatsOnReceptionsOnlyValidated").''; llxFooter();