From 4ca634b41c93f2cfed9795e839249457a843301f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 11 Mar 2017 12:04:28 +0100 Subject: [PATCH] Better look and feel --- htdocs/product/stock/product.php | 95 +++++++------- .../product/stock/tpl/stockcorrection.tpl.php | 11 +- .../product/stock/tpl/stocktransfer.tpl.php | 5 + htdocs/societe/soc.php | 4 +- htdocs/theme/eldy/style.css.php | 52 ++++---- htdocs/theme/md/style.css.php | 1 - htdocs/variants/combinations.php | 120 +++++++++++------- 7 files changed, 160 insertions(+), 128 deletions(-) diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 14cd07ec817..f12316591d0 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -110,7 +110,7 @@ $parameters=array('id'=>$id, 'ref'=>$ref, 'objcanvas'=>$objcanvas); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); -if($action == 'addlimitstockwarehouse') { +if ($action == 'addlimitstockwarehouse') { $seuil_stock_alerte = GETPOST('seuil_stock_alerte'); $desiredstock = GETPOST('desiredstock'); @@ -625,7 +625,8 @@ if ($id > 0 || $ref) print ''; // Real stock - $text_stock_options = ''; + $text_stock_options = $langs->trans("RealStockDesc").'
'; + $text_stock_options.= $langs->trans("RealStockWillAutomaticallyWhen").'
'; $text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || ! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)?$langs->trans("DeStockOnShipment").'
':''); $text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER)?$langs->trans("DeStockOnValidateOrder").'
':''); $text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_BILL)?$langs->trans("DeStockOnBill").'
':''); @@ -642,57 +643,55 @@ if ($id > 0 || $ref) $stocktheo = price2num($object->stock_theorique, 'MS'); + $found=0; + $helpondiff=''.$langs->trans("StockDiffPhysicTeoric").':
'; + // Number of customer orders running + if (! empty($conf->commande->enabled)) + { + if ($found) $helpondiff.='
'; else $found=1; + $helpondiff.=$langs->trans("ProductQtyInCustomersOrdersRunning").': '.$object->stats_commande['qty']; + $result=$object->load_stats_commande(0,'0'); + if ($result < 0) dol_print_error($db,$object->error); + $helpondiff.=' ('.$langs->trans("ProductQtyInDraft").': '.$object->stats_commande['qty'].')'; + } + + // Number of product from customer order already sent (partial shipping) + if (! empty($conf->expedition->enabled)) + { + if ($found) $helpondiff.='
'; else $found=1; + $result=$object->load_stats_sending(0,'2'); + $helpondiff.=$langs->trans("ProductQtyInShipmentAlreadySent").': '.$object->stats_expedition['qty']; + } + + // Number of supplier order running + if (! empty($conf->fournisseur->enabled)) + { + if ($found) $helpondiff.='
'; else $found=1; + $result=$object->load_stats_commande_fournisseur(0,'3,4'); + $helpondiff.=$langs->trans("ProductQtyInSuppliersOrdersRunning").': '.$object->stats_commande_fournisseur['qty']; + $result=$object->load_stats_commande_fournisseur(0,'0,1,2'); + if ($result < 0) dol_print_error($db,$object->error); + $helpondiff.=' ('.$langs->trans("ProductQtyInDraftOrWaitingApproved").': '.$object->stats_commande_fournisseur['qty'].')'; + } + + // Number of product from supplier order already received (partial receipt) + if (! empty($conf->fournisseur->enabled)) + { + if ($found) $helpondiff.='
'; else $found=1; + $helpondiff.=$langs->trans("ProductQtyInSuppliersShipmentAlreadyRecevied").': '.$object->stats_reception['qty']; + } + // Calculating a theorical value - print ''.$langs->trans("VirtualStock").''; - print "".(empty($stocktheo)?0:$stocktheo); + print ''; + print $form->textwithpicto($langs->trans("VirtualStock"), $langs->trans("VirtualStockDesc")); + print ''; + print ""; + //print (empty($stocktheo)?0:$stocktheo); + print $form->textwithpicto((empty($stocktheo)?0:$stocktheo), $helpondiff); if ($object->seuil_stock_alerte != '' && ($object->stock_theorique < $object->seuil_stock_alerte)) print ' '.img_warning($langs->trans("StockLowerThanLimit")); print ''; print ''; - print ''; - print $langs->trans("StockDiffPhysicTeoric"); - print ''; - print ''; - - $found=0; - // Number of customer orders running - if (! empty($conf->commande->enabled)) - { - if ($found) print '
'; else $found=1; - print $langs->trans("ProductQtyInCustomersOrdersRunning").': '.$object->stats_commande['qty']; - $result=$object->load_stats_commande(0,'0'); - if ($result < 0) dol_print_error($db,$object->error); - print ' ('.$langs->trans("ProductQtyInDraft").': '.$object->stats_commande['qty'].')'; - } - - // Number of product from customer order already sent (partial shipping) - if (! empty($conf->expedition->enabled)) - { - if ($found) print '
'; else $found=1; - $result=$object->load_stats_sending(0,'2'); - print $langs->trans("ProductQtyInShipmentAlreadySent").': '.$object->stats_expedition['qty']; - } - - // Number of supplier order running - if (! empty($conf->fournisseur->enabled)) - { - if ($found) print '
'; else $found=1; - $result=$object->load_stats_commande_fournisseur(0,'3,4'); - print $langs->trans("ProductQtyInSuppliersOrdersRunning").': '.$object->stats_commande_fournisseur['qty']; - $result=$object->load_stats_commande_fournisseur(0,'0,1,2'); - if ($result < 0) dol_print_error($db,$object->error); - print ' ('.$langs->trans("ProductQtyInDraftOrWaitingApproved").': '.$object->stats_commande_fournisseur['qty'].')'; - } - - // Number of product from supplier order already received (partial receipt) - if (! empty($conf->fournisseur->enabled)) - { - if ($found) print '
'; else $found=1; - print $langs->trans("ProductQtyInSuppliersShipmentAlreadyRecevied").': '.$object->stats_reception['qty']; - } - - print ''; - // Last movement $sql = "SELECT max(m.datem) as datem"; $sql.= " FROM ".MAIN_DB_PREFIX."stock_mouvement as m"; diff --git a/htdocs/product/stock/tpl/stockcorrection.tpl.php b/htdocs/product/stock/tpl/stockcorrection.tpl.php index 757407a6692..28fd3dfadea 100644 --- a/htdocs/product/stock/tpl/stockcorrection.tpl.php +++ b/htdocs/product/stock/tpl/stockcorrection.tpl.php @@ -21,12 +21,14 @@ element == 'product') $productref = $object->ref; $langs->load("productbatch"); - if (empty($id)) $id = $object->id; + + if (empty($id)) $id = $object->id; print ' - - -
+ '; + print dol_fiche_head(); + + ?> + - + - - + - + - + - + - + - +
- +
>
-
-
- + + +
+ +
+ + - -
+ '; + } + else + { if ($action === 'delete') { if ($prodcomb->fetch($valueid) > 0) { @@ -565,7 +583,22 @@ if (! empty($id) || ! empty($ref)) { " class="button">

- + '; + print '
'; + if ($productCombinations) { + print ''.$langs->trans('Copy').''; + } + print ''.$langs->trans('NewProductCombination').''; + print ''.$langs->trans('ProductCombinationGenerator').''; + print '
'; + print ''; + + + + ?> @@ -618,17 +651,6 @@ if (! empty($id) || ! empty($ref)) { '; - print '
'; - if ($productCombinations) { - print ' '.$langs->trans('Copy').''; - } - print ' '.$langs->trans('ProductCombinationGenerator').' - '.$langs->trans('NewProductCombination').''; - print '
'; - print ''; - } }