diff --git a/ChangeLog b/ChangeLog index ac01ad98197..2e60a9f4f76 100644 --- a/ChangeLog +++ b/ChangeLog @@ -39,7 +39,8 @@ For users: - New: Add Maghreb regions and departments. - New: A more responsive desgin for statistic box of home page. - Qual: Implement same rule for return value of all command line scripts (0 when success, <>0 if error). -- New: [ task #1005 ] Adapting to Spanish legislation bill numbering +- New: [ task #1005 ] Adapting to Spanish legislation bill numbering +- New: [ task #1011 ] Now supplier order and invoice deal with payment terms and mode For translators: @@ -61,17 +62,20 @@ For developers: - New: Make some changes to allow usage of several alternative $dolibarr_main_url_root variables. Fix also several bugs with old code. - Qual: All nowrap properties are now using CSS class nowrap. +- New: Into POST forms, if you can add a parameter DOL_AUTOSET_COOKIE with a vlue that is list name, + separated by a coma, of other POST parameters, Dolibarr will automatically save this parameters + into user cookies. -WARNING: This may create regression for some external modules, but was necessary to make + +WARNING: Following change may create regression for some external modules, but was necessary to make Dolibarr better: 1) We started to clean hooks code. -If your hook want to modify value of $actions, it's role -of your hook to modify it. Dolibarr hook code will not decide this for your module anymore. -If your action class for hook was returning a string or an array, instead your module must -set $actionclassinstance->results (to return array) -or $actionclassinstance->resprints (to return string) -to return same thing. The return value must be replaced by a "return 0"; +If your hook want to modify value of $actions, it's role of your hook to modify it. Dolibarr +hook code will no more decide this for your module. If your action class for hook was returning +a string or an array, instead your module must set $actionclassinstance->results (to return array) +or $actionclassinstance->resprints (to return string) to return same thing. The return value must +be replaced by a "return 0"; Goal is to fix old compatibility code that does not match hook specifications: http://wiki.dolibarr.org/index.php/Hooks_system @@ -80,7 +84,7 @@ All content added must be tagged by a '
' with css class="login_block_elem" 3) Some methods object->addline used a first parameter that was object->id, some not. Of course this was not a good pratice, since object->id is already known so no need to provide it as -parameter. All methods addline in this case were modified to remove this information. +parameter. All methods addline in this case were modified to remove this parameter. ***** ChangeLog for 3.4 compared to 3.3.* ***** diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index de852a3cc15..86e87ac56d4 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -45,10 +45,10 @@ $action = GETPOST('action'); if (! defined("MAIN_MOTD")) define("MAIN_MOTD",""); // List of supported permanent search area -$searchform=array("MAIN_SEARCHFORM_SOCIETE","MAIN_SEARCHFORM_CONTACT", "MAIN_SEARCHFORM_PRODUITSERVICE","MAIN_SEARCHFORM_ADHERENT"); -$searchformconst=array($conf->global->MAIN_SEARCHFORM_SOCIETE,$conf->global->MAIN_SEARCHFORM_CONTACT,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE,$conf->global->MAIN_SEARCHFORM_ADHERENT); -$searchformtitle=array($langs->trans("Companies"),$langs->trans("Contacts"),$langs->trans("ProductsAndServices"),$langs->trans("Members")); -$searchformmodule=array('Module1Name','Module1Name','Module50Name','Module310Name'); +$searchform=array("MAIN_SEARCHFORM_SOCIETE", "MAIN_SEARCHFORM_CONTACT", "MAIN_SEARCHFORM_PRODUITSERVICE", "MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER", "MAIN_SEARCHFORM_ADHERENT"); +$searchformconst=array($conf->global->MAIN_SEARCHFORM_SOCIETE,$conf->global->MAIN_SEARCHFORM_CONTACT,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER,$conf->global->MAIN_SEARCHFORM_ADHERENT); +$searchformtitle=array($langs->trans("Companies"),$langs->trans("Contacts"),$langs->trans("ProductsAndServices"),$langs->trans("ProductsAndServices").' ('.$langs->trans("SupplierRef").')',$langs->trans("Members")); +$searchformmodule=array('Module1Name','Module1Name','Module50Name','Module50Name','Module310Name'); if ($action == 'update') @@ -67,6 +67,7 @@ if ($action == 'update') dolibarr_set_const($db, "MAIN_SEARCHFORM_CONTACT", $_POST["MAIN_SEARCHFORM_CONTACT"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SEARCHFORM_SOCIETE", $_POST["MAIN_SEARCHFORM_SOCIETE"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SEARCHFORM_PRODUITSERVICE",$_POST["MAIN_SEARCHFORM_PRODUITSERVICE"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER",$_POST["MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SEARCHFORM_ADHERENT",$_POST["MAIN_SEARCHFORM_ADHERENT"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", $_POST["MAIN_HELPCENTER_DISABLELINK"],'chaine',0,'',0); // Param for all entities diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 3733973bb2a..f7a45aff8d2 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -73,6 +73,11 @@ if ($action == 'STOCK_CALCULATE_ON_SUPPLIER_BILL' if ($action == 'STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER') $res=dolibarr_set_const($db, "STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER", GETPOST('STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER','alpha'),'chaine',0,'',$conf->entity); } +if($action == 'USE_VIRTUAL_STOCK') { + $db->begin(); + $res = dolibarr_set_const($db, "USE_VIRTUAL_STOCK", GETPOST('USE_VIRTUAL_STOCK','alpha'),'chaine',0,'',$conf->entity); +} + if($action) { if (! $res > 0) $error++; @@ -89,6 +94,7 @@ if($action) } } + /* * View */ @@ -243,6 +249,26 @@ if (! empty($conf->fournisseur->enabled)) print ''; +print '
'; +print ''; +print ''; +print " \n"; +print " \n"; +print ''."\n"; +$var = !$var; +print ""; +print ''; +print '\n"; +print "\n"; +print '
".$langs->trans("RuleForStockReplenishment")." 
'.$langs->trans("UseVirtualStock").''; +print "
"; +print ''; +print ""; +print $form->selectyesno("USE_VIRTUAL_STOCK",$conf->global->USE_VIRTUAL_STOCK,1); +print ''; +print '
'; +print "
'; + dol_htmloutput_mesg($mesg); $db->close(); diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index 026a0b9da80..38ec8204984 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -77,18 +77,23 @@ class box_graph_invoices_permonth extends ModeleBoxes 'sublink'=>'', 'subtext'=>$langs->trans("Filter"), 'subpicto'=>'filter.png', + 'subclass'=>'linkobject', 'target'=>'none' // Set '' to get target="_blank" ); if ($user->rights->facture->lire) { + $param_year='DOLUSERCOOKIE_param'.$this->boxcode.'year'; + $param_shownb='DOLUSERCOOKIE_param'.$this->boxcode.'shownb'; + $param_showtot='DOLUSERCOOKIE_param'.$this->boxcode.'showtot'; + include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php'; - - $shownb=(! empty($conf->global->FACTURE_BOX_GRAPH_SHOW_NB)); - $showtot=(! isset($conf->global->FACTURE_BOX_GRAPH_SHOW_TOT) || ! empty($conf->global->FACTURE_BOX_GRAPH_SHOW_TOT)); + $shownb=GETPOST($param_shownb,'alpha',4); + $showtot=GETPOST($param_showtot,'alpha',4); + if (empty($shownb) && empty($showtot)) $showtot=1; $nowarray=dol_getdate(dol_now(),true); - $endyear=(GETPOST('param'.$this->boxcode.'year')?GETPOST('param'.$this->boxcode.'year','int'):$nowarray['year']); + $endyear=(GETPOST($param_year,'',4)?GETPOST($param_year,'int',4):$nowarray['year']); $startyear=$endyear-1; $mode='customer'; $userid=0; @@ -183,11 +188,17 @@ class box_graph_invoices_permonth extends ModeleBoxes }); }); '; - $stringtoshow.='
'; - $stringtoshow.=$langs->trans("Year").' '; - $stringtoshow.=''; - $stringtoshow.=img_picto($langs->trans("Refresh"),'refresh.png'); - $stringtoshow.=''; + $stringtoshow.='
'; // hideobject is to start hidden + $stringtoshow.='
'; + $stringtoshow.=''; + $stringtoshow.=''; + $stringtoshow.=' '.$langs->trans("NumberOfBillsByMonth"); + $stringtoshow.='   '; + $stringtoshow.=' '.$langs->trans("AmountOfBillsByMonthHT"); + $stringtoshow.='
'; + $stringtoshow.=$langs->trans("Year").' '; + $stringtoshow.=''; + $stringtoshow.='
'; $stringtoshow.='
'; if ($shownb && $showtot) { diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php index a435a9cfdc7..a6e64c10c3e 100644 --- a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php @@ -76,18 +76,23 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes 'sublink'=>'', 'subtext'=>$langs->trans("Filter"), 'subpicto'=>'filter.png', + 'subclass'=>'linkobject', 'target'=>'none' // Set '' to get target="_blank" ); if ($user->rights->fournisseur->facture->lire) { + $param_year='DOLUSERCOOKIE_param'.$this->boxcode.'year'; + $param_shownb='DOLUSERCOOKIE_param'.$this->boxcode.'shownb'; + $param_showtot='DOLUSERCOOKIE_param'.$this->boxcode.'showtot'; + include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php'; - - $shownb=(! empty($conf->global->FACTURE_BOX_GRAPH_SHOW_NB)); - $showtot=(! isset($conf->global->FACTURE_BOX_GRAPH_SHOW_TOT) || ! empty($conf->global->FACTURE_BOX_GRAPH_SHOW_TOT)); + $shownb=GETPOST($param_shownb,'alpha',4); + $showtot=GETPOST($param_showtot,'alpha',4); + if (empty($shownb) && empty($showtot)) $showtot=1; $nowarray=dol_getdate(dol_now(),true); - $endyear=(GETPOST('param'.$this->boxcode.'year')?GETPOST('param'.$this->boxcode.'year','int'):$nowarray['year']); + $endyear=(GETPOST($param_year,'',4)?GETPOST($param_year,'int',4):$nowarray['year']); $startyear=$endyear-1; $mode='supplier'; $userid=0; @@ -182,11 +187,17 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes }); }); '; - $stringtoshow.='
'; - $stringtoshow.=$langs->trans("Year").' '; - $stringtoshow.=''; - $stringtoshow.=img_picto($langs->trans("Refresh"),'refresh.png'); - $stringtoshow.=''; + $stringtoshow.='
'; // hideobject is to start hidden + $stringtoshow.='
'; + $stringtoshow.=''; + $stringtoshow.=''; + $stringtoshow.=' '.$langs->trans("NumberOfBillsByMonth"); + $stringtoshow.='   '; + $stringtoshow.=' '.$langs->trans("AmountOfBillsByMonthHT"); + $stringtoshow.='
'; + $stringtoshow.=$langs->trans("Year").' '; + $stringtoshow.=''; + $stringtoshow.='
'; $stringtoshow.='
'; if ($shownb && $showtot) { diff --git a/htdocs/core/boxes/box_graph_orders_permonth.php b/htdocs/core/boxes/box_graph_orders_permonth.php index cc4310a266e..67463f33637 100644 --- a/htdocs/core/boxes/box_graph_orders_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_permonth.php @@ -77,18 +77,23 @@ class box_graph_orders_permonth extends ModeleBoxes 'sublink'=>'', 'subtext'=>$langs->trans("Filter"), 'subpicto'=>'filter.png', + 'subclass'=>'linkobject', 'target'=>'none' // Set '' to get target="_blank" ); if ($user->rights->commande->lire) { + $param_year='DOLUSERCOOKIE_param'.$this->boxcode.'year'; + $param_shownb='DOLUSERCOOKIE_param'.$this->boxcode.'shownb'; + $param_showtot='DOLUSERCOOKIE_param'.$this->boxcode.'showtot'; + include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; include_once DOL_DOCUMENT_ROOT.'/commande/class/commandestats.class.php'; - - $shownb=(! empty($conf->global->COMMANDE_BOX_GRAPH_SHOW_NB)); - $showtot=(! isset($conf->global->COMMANDE_BOX_GRAPH_SHOW_TOT) || ! empty($conf->global->COMMANDE_BOX_GRAPH_SHOW_TOT)); + $shownb=GETPOST($param_shownb,'alpha',4); + $showtot=GETPOST($param_showtot,'alpha',4); + if (empty($shownb) && empty($showtot)) $showtot=1; $nowarray=dol_getdate(dol_now(),true); - $endyear=(GETPOST('param'.$this->boxcode.'year')?GETPOST('param'.$this->boxcode.'year','int'):$nowarray['year']); + $endyear=(GETPOST($param_year,'',4)?GETPOST($param_year,'int',4):$nowarray['year']); $startyear=$endyear-1; $mode='customer'; $userid=0; @@ -183,11 +188,17 @@ class box_graph_orders_permonth extends ModeleBoxes }); }); '; - $stringtoshow.='
'; - $stringtoshow.=$langs->trans("Year").' '; - $stringtoshow.=''; - $stringtoshow.=img_picto($langs->trans("Refresh"),'refresh.png'); - $stringtoshow.=''; + $stringtoshow.='
'; // hideobject is to start hidden + $stringtoshow.='
'; + $stringtoshow.=''; + $stringtoshow.=''; + $stringtoshow.=' '.$langs->trans("NumberOfOrdersByMonth"); + $stringtoshow.='   '; + $stringtoshow.=' '.$langs->trans("AmountOfOrdersByMonthHT"); + $stringtoshow.='
'; + $stringtoshow.=$langs->trans("Year").' '; + $stringtoshow.=''; + $stringtoshow.='
'; $stringtoshow.='
'; if ($shownb && $showtot) { diff --git a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php index 75b4f26bbc4..52cd0d6832b 100644 --- a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php @@ -76,18 +76,23 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes 'sublink'=>'', 'subtext'=>$langs->trans("Filter"), 'subpicto'=>'filter.png', + 'subclass'=>'linkobject', 'target'=>'none' // Set '' to get target="_blank" ); if ($user->rights->fournisseur->commande->lire) { + $param_year='DOLUSERCOOKIE_param'.$this->boxcode.'year'; + $param_shownb='DOLUSERCOOKIE_param'.$this->boxcode.'shownb'; + $param_showtot='DOLUSERCOOKIE_param'.$this->boxcode.'showtot'; + include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; include_once DOL_DOCUMENT_ROOT.'/commande/class/commandestats.class.php'; - - $shownb=(! empty($conf->global->COMMANDE_BOX_GRAPH_SHOW_NB)); - $showtot=(! isset($conf->global->COMMANDE_BOX_GRAPH_SHOW_TOT) || ! empty($conf->global->COMMANDE_BOX_GRAPH_SHOW_TOT)); + $shownb=GETPOST($param_shownb,'alpha',4); + $showtot=GETPOST($param_showtot,'alpha',4); + if (empty($shownb) && empty($showtot)) $showtot=1; $nowarray=dol_getdate(dol_now(),true); - $endyear=(GETPOST('param'.$this->boxcode.'year')?GETPOST('param'.$this->boxcode.'year','int'):$nowarray['year']); + $endyear=(GETPOST($param_year,'',4)?GETPOST($param_year,'int',4):$nowarray['year']); $startyear=$endyear-1; $mode='supplier'; $userid=0; @@ -182,11 +187,17 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes }); }); '; - $stringtoshow.='
'; - $stringtoshow.=$langs->trans("Year").' '; - $stringtoshow.=''; - $stringtoshow.=img_picto($langs->trans("Refresh"),'refresh.png'); - $stringtoshow.=''; + $stringtoshow.='
'; // hideobject is to start hidden + $stringtoshow.='
'; + $stringtoshow.=''; + $stringtoshow.=''; + $stringtoshow.=' '.$langs->trans("NumberOfOrdersByMonth"); + $stringtoshow.='   '; + $stringtoshow.=' '.$langs->trans("AmountOfOrdersByMonthHT"); + $stringtoshow.='
'; + $stringtoshow.=$langs->trans("Year").' '; + $stringtoshow.=''; + $stringtoshow.='
'; $stringtoshow.='
'; if ($shownb && $showtot) { diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php index d27d4385d8f..fab6b49d835 100644 --- a/htdocs/core/boxes/box_graph_propales_permonth.php +++ b/htdocs/core/boxes/box_graph_propales_permonth.php @@ -73,22 +73,27 @@ class box_graph_propales_permonth extends ModeleBoxes $this->info_box_head = array( 'text' => $text, 'limit'=> dol_strlen($text), - 'graph'=> 1, + 'graph'=> 1, // Set to 1 if it's a box graph 'sublink'=>'', 'subtext'=>$langs->trans("Filter"), 'subpicto'=>'filter.png', + 'subclass'=>'linkobject', 'target'=>'none' // Set '' to get target="_blank" ); if ($user->rights->commande->lire) { + $param_year='DOLUSERCOOKIE_param'.$this->boxcode.'year'; + $param_shownb='DOLUSERCOOKIE_param'.$this->boxcode.'shownb'; + $param_showtot='DOLUSERCOOKIE_param'.$this->boxcode.'showtot'; + include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propalestats.class.php'; - - $shownb=(! empty($conf->global->PROPAL_BOX_GRAPH_SHOW_NB)); - $showtot=(! isset($conf->global->PROPAL_BOX_GRAPH_SHOW_TOT) || ! empty($conf->global->PROPAL_BOX_GRAPH_SHOW_TOT)); + $shownb=GETPOST($param_shownb,'alpha',4); + $showtot=GETPOST($param_showtot,'alpha',4); + if (empty($shownb) && empty($showtot)) $showtot=1; $nowarray=dol_getdate(dol_now(),true); - $endyear=(GETPOST('param'.$this->boxcode.'year')?GETPOST('param'.$this->boxcode.'year','int'):$nowarray['year']); + $endyear=(GETPOST($param_year,'',4)?GETPOST($param_year,'int',4):$nowarray['year']); $startyear=$endyear-1; $mode='customer'; $userid=0; @@ -188,11 +193,17 @@ class box_graph_propales_permonth extends ModeleBoxes }); }); '; - $stringtoshow.='
'; - $stringtoshow.=$langs->trans("Year").' '; - $stringtoshow.=''; - $stringtoshow.=img_picto($langs->trans("Refresh"),'refresh.png'); - $stringtoshow.=''; + $stringtoshow.='
'; // hideobject is to start hidden + $stringtoshow.='
'; + $stringtoshow.=''; + $stringtoshow.=''; + $stringtoshow.=' '.$langs->trans("NumberOfProposalsByMonth"); + $stringtoshow.='   '; + $stringtoshow.=' '.$langs->trans("AmountOfProposalsByMonthHT"); + $stringtoshow.='
'; + $stringtoshow.=$langs->trans("Year").' '; + $stringtoshow.=''; + $stringtoshow.='
'; $stringtoshow.='
'; if ($shownb && $showtot) { diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php index b556e86c871..8413ac37b6b 100644 --- a/htdocs/core/boxes/modules_boxes.php +++ b/htdocs/core/boxes/modules_boxes.php @@ -110,7 +110,7 @@ class ModeleBoxes // Can't be abtract as it is instanciated to build "empty" /** - * Standard method to show a box (usage by boxes not mandatory, a box can still use its own function) + * Standard method to show a box (usage by boxes not mandatory, a box can still use its own showBox function) * * @param array $head Array with properties of box title * @param array $contents Array with properties of box lines @@ -160,7 +160,7 @@ class ModeleBoxes // Can't be abtract as it is instanciated to build "empty" } print ' '; if (! empty($head['sublink'])) print ''; - if (! empty($head['subpicto'])) print img_picto($head['subtext'], $head['subpicto'], 'class="" id="idsubimg'.$this->boxcode.'"'); + if (! empty($head['subpicto'])) print img_picto($head['subtext'], $head['subpicto'], 'class="'.(empty($head['subclass'])?'':$head['subclass']).'" id="idsubimg'.$this->boxcode.'"'); if (! empty($head['sublink'])) ''; if ($conf->use_javascript_ajax) { diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index f4645721185..9fb99f69173 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -916,6 +916,7 @@ abstract class CommonObject // TODO uniformize field name $fieldname = 'fk_mode_reglement'; if ($this->element == 'societe') $fieldname = 'mode_reglement'; + if (get_class($this) == 'Fournisseur') $fieldname = 'mode_reglement_supplier'; $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; $sql .= ' SET '.$fieldname.' = '.$id; @@ -955,6 +956,7 @@ abstract class CommonObject // TODO uniformize field name $fieldname = 'fk_cond_reglement'; if ($this->element == 'societe') $fieldname = 'cond_reglement'; + if (get_class($this) == 'Fournisseur') $fieldname = 'cond_reglement_supplier'; $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; $sql .= ' SET '.$fieldname.' = '.$id; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 2b540f3aabd..fd58b4263b8 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1400,7 +1400,7 @@ class Form $objp->remise = $objp2->remise; $objp->price_by_qty_rowid = $objp2->rowid; - $this->constructProductListOption($objp, $opt, $optJson, 0, $selected); + $this->_construct_product_list_option($objp, $opt, $optJson, 0, $selected); $j++; @@ -1414,7 +1414,7 @@ class Form } else { - $this->constructProductListOption($objp, $opt, $optJson, $price_level, $selected); + $this->_construct_product_list_option($objp, $opt, $optJson, $price_level, $selected); // Add new entry // "key" value of json key array is used by jQuery automatically as selected value // "label" value of json key array is used by jQuery automatically as text for combo box @@ -1870,6 +1870,10 @@ class Form $objp = $this->db->fetch_object($result); $opt = '
', + '', + '
', + '', + '
', + ''; + + if ($num > $conf->liste_limit) { + if ($sref || $snom || $sall || GETPOST('search', 'alpha')) { + $filters = '&sref=' . $sref . '&snom=' . $snom; + $filters .= '&sall=' . $sall; + print_barre_liste('', + $page, + 'replenish.php', + $filters, + $sortfield, + $sortorder, + '', + $num, + 0, + '' + ); + } else { + $filters = '&sref=' . $sref . '&snom=' . $snom; + $filters .= '&fourn_id=' . $fourn_id; + $filters .= (isset($type)? '&type=' . $type : ''); + print_barre_liste('', + $page, + 'replenish.php', + $filters, + $sortfield, + $sortorder, + '', + $num, + 0, + '' + ); + } + } + + $db->free($resql); +echo ' '; +} else { + dol_print_error($db); +} + +llxFooter(); +$db->close(); diff --git a/htdocs/product/stock/replenishorders.php b/htdocs/product/stock/replenishorders.php new file mode 100644 index 00000000000..ed76755cfc0 --- /dev/null +++ b/htdocs/product/stock/replenishorders.php @@ -0,0 +1,318 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/product/stock/replenishorders.php + * \ingroup produit + * \brief Page to list replenishment orders + */ +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; +require_once './lib/replenishment.lib.php'; + +$langs->load("products"); +$langs->load("stocks"); +$langs->load("orders"); + +// Security check +if ($user->societe_id) $socid=$user->societe_id; +$result=restrictedArea($user,'produit|service'); + +$helpurl = 'EN:Module_Stocks_En|FR:Module_Stock|'; +$helpurl .= 'ES:Módulo_Stocks'; +$texte = $langs->trans('ReplenishmentOrders'); +llxHeader('', $texte, $helpurl, $texte); +$head = array(); +$head[0][0] = DOL_URL_ROOT.'/product/stock/replenish.php'; +$head[0][1] = $langs->trans('Status'); +$head[0][2] = 'replenish'; +$head[1][0] = DOL_URL_ROOT.'/product/stock/replenishorders.php'; +$head[1][1] = $texte; +$head[1][2] = 'replenishorders'; +dol_fiche_head($head, + 'replenishorders', + $langs->trans('Replenishment'), + 0, + 'stock'); +$commandestatic = new CommandeFournisseur($db); +$sref = GETPOST('search_ref', 'alpha'); +$snom = GETPOST('search_nom', 'alpha'); +$suser = GETPOST('search_user', 'alpha'); +$sttc = GETPOST('search_ttc', 'int'); +$sall = GETPOST('search_all', 'alpha'); +$sdate = GETPOST('search_date', 'alpha'); +$page = GETPOST('page', 'int'); +$sproduct = GETPOST('sproduct', 'int'); +$sortorder = GETPOST('sortorder', 'alpha'); +$sortfield = GETPOST('sortfield', 'alpha'); + +if (!$sortorder) { + $sortorder = 'DESC'; +} + +if (!$sortfield) { + $sortfield = 'cf.date_creation'; +} + +$offset = $conf->liste_limit * $page ; + +$sql = 'SELECT s.rowid as socid, s.nom, cf.date_creation as dc,'; +$sql .= ' cf.rowid, cf.ref, cf.fk_statut, cf.total_ttc'; +$sql .= ", cf.fk_user_author, u.login"; +$sql .= ' FROM (' . MAIN_DB_PREFIX . 'societe as s,'; +$sql .= ' ' . MAIN_DB_PREFIX . 'commande_fournisseur as cf'; + +if (!$user->rights->societe->client->voir && !$socid) { + $sql.= ', ' . MAIN_DB_PREFIX . 'societe_commerciaux as sc'; + +} + +$sql .= ') LEFT JOIN ' . MAIN_DB_PREFIX . 'user as u '; +$sql .= 'ON cf.fk_user_author = u.rowid'; +$sql .= ' WHERE cf.fk_soc = s.rowid '; +$sql .= ' AND cf.entity = ' . $conf->entity; + +if ($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) { + $sql .= ' AND cf.fk_statut < 3'; +} elseif ($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) { + $sql .= ' AND cf.fk_statut < 6'; +} else { + $sql .= ' AND cf.fk_statut < 5'; +} + +if (!$user->rights->societe->client->voir && !$socid) { + $sql .= ' AND s.rowid = sc.fk_soc AND sc.fk_user = ' . $user->id; +} +if ($sref) { + $sql .= ' AND cf.ref LIKE "%' . $db->escape($sref) . '%"'; +} +if ($snom) { + $sql .= ' AND s.nom LIKE "%' . $db->escape($snom) . '%"'; +} +if ($suser) { + $sql .= ' AND u.login LIKE "%' . $db->escape($suser) . '%"'; +} +if ($sttc) { + $sql .= ' AND cf.total_ttc = ' . price2num($sttc); +} +if ($sdate) { + if(GETPOST('search_datemonth', 'int') && GETPOST('search_dateday', 'int') + && GETPOST('search_dateyear', 'int')) { + $date = date('Y-m-d', + dol_mktime(0, + 0, + 0, + GETPOST('search_datemonth', 'int'), + GETPOST('search_dateday', 'int'), + GETPOST('search_dateyear', 'int') + ) + ); + } else { + $elts = explode('/', $sdate); + $datearray = array(); + if ($elts[2]) { + $datearray[0] = $elts[2]; + } + if ($elts[1]) { + $datearray[1] = $elts[1]; + } + if ($elts[0]) { + $datearray[2] = $elts[0]; + } + $date = implode('-', $datearray); + } + $sql .= ' AND cf.date_creation LIKE "%' . $date . '%"'; +} +if ($sall) { + $sql .= ' AND (cf.ref LIKE "%' . $db->escape($sall) . '%" '; + $sql .= 'OR cf.note LIKE "%' . $db->escape($sall) . '%")'; +} +if ($socid) { + $sql .= ' AND s.rowid = ' . $socid; +} + +if (GETPOST('statut', 'int')) { + $sql .= ' AND fk_statut = ' . GETPOST('statut', 'int'); +} +$sql .= ' GROUP BY cf.rowid, cf.ref, cf.date_creation, cf.fk_statut'; +$sql .= ', cf.total_ttc, cf.fk_user_author, u.login, s.rowid, s.nom'; +$sql .= ' ORDER BY ' . $sortfield . ' ' . $sortorder . ' '; +$sql .= $db->plimit($conf->liste_limit+1, $offset); +$resql = $db->query($sql); +if ($resql) { + $num = $db->num_rows($resql); + $i = 0; + + print_barre_liste($langs->trans('ReplenishmentOrders'), + $page, + 'replenishorders.php', + '', + $sortfield, + $sortorder, + '', + $num + ); + echo '
', + '', + ''; + print_liste_field_titre($langs->trans('Ref'), + $_SERVER['PHP_SELF'], + 'cf.ref', + '', + '', + '', + $sortfield, + $sortorder + ); + print_liste_field_titre($langs->trans('Company'), + $_SERVER['PHP_SELF'], + 's.nom', + '', + '', + '', + $sortfield, + $sortorder + ); + print_liste_field_titre($langs->trans('Author'), + $_SERVER['PHP_SELF'], + 'u.login', + '', + '', + '', + $sortfield, + $sortorder + ); + print_liste_field_titre($langs->trans('AmountTTC'), + $_SERVER['PHP_SELF'], + 'cf.total_ttc', + '', + '', + '', + $sortfield, + $sortorder + ); + print_liste_field_titre($langs->trans('OrderCreation'), + $_SERVER['PHP_SELF'], + 'cf.date_creation', + '', + '', + '', + $sortfield, + $sortorder + ); + print_liste_field_titre($langs->trans('Status'), + $_SERVER['PHP_SELF'], + 'cf.fk_statut', + '', + '', + 'align="right"', + $sortfield, + $sortorder + ); + $form = new Form($db); + echo '', + '', + '', + '', + '', + '', + '', + '', + ''; + + $var = true; + $userstatic = new User($db); + + while ($i < min($num,$conf->liste_limit)) { + $obj = $db->fetch_object($resql); + $var = !$var; + if(!dispatched($obj->rowid) && + (!$sproduct || in_array($sproduct, getProducts($obj->rowid)))) { + $href = DOL_URL_ROOT . '/fourn/commande/fiche.php?id=' . $obj->rowid; + echo '', + // Ref + ''; + + // Company + $href = DOL_URL_ROOT . '/fourn/fiche.php?socid=' . $obj->socid; + echo ''; + + // Author + $userstatic->id = $obj->fk_user_author; + $userstatic->login = $obj->login; + if ($userstatic->id) { + $txt = $userstatic->getLoginUrl(1); + } else { + $txt = ' '; + } + echo '', + // Amount + ''; + // Date + if ($obj->dc) { + $date = dol_print_date($db->jdate($obj->dc), 'day'); + } else { + $date = '-'; + } + echo '', + // Statut + '', + ''; + } + $i++; + } + echo '
', + '', + '', + '', + '', + '', + '', + '', + '', + $form->select_date('', 'search_date', 0, 0, 1, "", 1, 0, 1, 0, ''), + ''; + $src = DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/search.png'; + $value = dol_escape_htmltag($langs->trans('Search')); + echo '', + '
', + '', + img_object($langs->trans('ShowOrder'), 'order') . ' ' . $obj->ref, + '', + '', + img_object($langs->trans('ShowCompany'), 'company'), ' ', + $obj->nom . '', + $txt, + '', + price($obj->total_ttc), + '', + $date, + '', + $commandestatic->LibStatut($obj->fk_statut, 5), + '
', + '
'; + + $db->free($resql); +} + +llxFooter(); +$db->close(); diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 6278b7bd8ab..60e4a1461ad 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -106,6 +106,8 @@ class Societe extends CommonObject var $remise_percent; var $mode_reglement_id; var $cond_reglement_id; + var $mode_reglement_supplier_id; + var $cond_reglement_supplier_id; var $client; // 0=no customer, 1=customer, 2=prospect, 3=customer and prospect var $prospect; // 0=no prospect, 1=prospect @@ -707,7 +709,7 @@ class Societe extends CommonObject $sql .= ', s.fk_forme_juridique as forme_juridique_code'; $sql .= ', s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur, s.parent, s.barcode'; $sql .= ', s.fk_departement, s.fk_pays as country_id, s.fk_stcomm, s.remise_client, s.mode_reglement, s.cond_reglement, s.tva_assuj'; - $sql .= ', s.localtax1_assuj, s.localtax2_assuj, s.fk_prospectlevel, s.default_lang, s.logo'; + $sql .= ', s.mode_reglement_supplier, s.cond_reglement_supplier, s.localtax1_assuj, s.localtax2_assuj, s.fk_prospectlevel, s.default_lang, s.logo'; $sql .= ', s.import_key, s.canvas'; $sql .= ', fj.libelle as forme_juridique'; $sql .= ', e.libelle as effectif'; @@ -826,6 +828,8 @@ class Societe extends CommonObject $this->remise_percent = $obj->remise_client; $this->mode_reglement_id = $obj->mode_reglement; $this->cond_reglement_id = $obj->cond_reglement; + $this->mode_reglement_supplier_id = $obj->mode_reglement_supplier; + $this->cond_reglement_supplier_id = $obj->cond_reglement_supplier; $this->client = $obj->client; $this->fournisseur = $obj->fournisseur; diff --git a/htdocs/theme/amarok/style.css.php b/htdocs/theme/amarok/style.css.php index 8dba7f6241f..f5e900c0eee 100755 --- a/htdocs/theme/amarok/style.css.php +++ b/htdocs/theme/amarok/style.css.php @@ -1354,9 +1354,15 @@ tr.box_pair { font-family:; } -tr.fiche { - font-family:; +.formboxfilter { + vertical-align: middle; } +.formboxfilter input[type=image] +{ + top: 5px; + position: relative; +} + /* * Ok, Warning, Error diff --git a/htdocs/theme/auguria/style.css.php b/htdocs/theme/auguria/style.css.php index 229d26b0c9a..5ae45bc19fb 100644 --- a/htdocs/theme/auguria/style.css.php +++ b/htdocs/theme/auguria/style.css.php @@ -1521,10 +1521,14 @@ tr.box_pair td, tr.box_impair td, td.box_pair, td.box_impair /*border-bottom: 1px solid white;*/ } -tr.fiche { -font-family: ; +.formboxfilter { + vertical-align: middle; +} +.formboxfilter input[type=image] +{ + top: 3px; + position: relative; } - diff --git a/htdocs/theme/bureau2crea/style.css.php b/htdocs/theme/bureau2crea/style.css.php index aa6e7c02e78..f93f38b1a57 100644 --- a/htdocs/theme/bureau2crea/style.css.php +++ b/htdocs/theme/bureau2crea/style.css.php @@ -1648,10 +1648,14 @@ background: #f4f4f4; font-family: ; } -tr.fiche { -font-family: ; +.formboxfilter { + vertical-align: middle; +} +.formboxfilter input[type=image] +{ + top: 3px; + position: relative; } - diff --git a/htdocs/theme/cameleo/style.css.php b/htdocs/theme/cameleo/style.css.php index 2fe5b2311c9..a54115d164b 100644 --- a/htdocs/theme/cameleo/style.css.php +++ b/htdocs/theme/cameleo/style.css.php @@ -745,10 +745,10 @@ a.vsmenu:hover { font-size:11px; text-align:left; font-weight: normal; colo font.vsmenudisabled { font-size:11px; text-align:left; font-weight: normal; color: #202020; } font.vsmenudisabledmargin { margin: 1px 1px 1px 4px; } -a.help:link { font-size: 10px; font-weight: bold; background: #FFFFFF; border: 1px solid #8CACBB; color: #68ACCF; padding: 0em 0.7em; margin: 0em 0.5em; text-decoration: none; white-space: nowrap; } -a.help:visited { font-size: 10px; font-weight: bold; background: #FFFFFF; border: 1px solid #8CACBB; color: #68ACCF; padding: 0em 0.7em; margin: 0em 0.5em; text-decoration: none; white-space: nowrap; } -a.help:active { font-size: 10px; font-weight: bold; background: #FFFFFF; border: 1px solid #8CACBB; color: #6198BA; padding: 0em 0.7em; margin: 0em 0.5em; text-decoration: none; white-space: nowrap; } -a.help:hover { font-size: 10px; font-weight: bold; background: #FFFFFF; border: 1px solid #8CACBB; color: #6198BA; padding: 0em 0.7em; margin: 0em 0.5em; text-decoration: none; white-space: nowrap; } +a.help:link { font-size: 10px; font-weight: bold; background: #FFFFFF; color: #AAACAF; padding: 0em 0.7em; margin: 0em 0.5em; text-decoration: none; white-space: nowrap; } +a.help:visited { font-size: 10px; font-weight: bold; background: #FFFFFF; color: #AAACAF; padding: 0em 0.7em; margin: 0em 0.5em; text-decoration: none; white-space: nowrap; } +a.help:active { font-size: 10px; font-weight: bold; background: #FFFFFF; color: #9998A0; padding: 0em 0.7em; margin: 0em 0.5em; text-decoration: none; white-space: nowrap; } +a.help:hover { font-size: 10px; font-weight: bold; background: #FFFFFF; color: #9998A0; padding: 0em 0.7em; margin: 0em 0.5em; text-decoration: none; white-space: nowrap; } div.blockvmenupair @@ -1654,10 +1654,14 @@ background: #c0c4c7; border: 0px; } -tr.fiche { -font-family: ; +.formboxfilter { + vertical-align: middle; +} +.formboxfilter input[type=image] +{ + top: 4px; + position: relative; } - diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index f3fc2158668..f2a7e6a4607 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -543,14 +543,12 @@ div.tmenudisabled, a.tmenudisabled { opacity: 0.6; } a.tmenudisabled:link, a.tmenudisabled:visited, a.tmenudisabled:hover, a.tmenudisabled:active { - color: #808080; font-weight: normal; padding: 0px 5px 0px 5px; - margin: 0px 1px 2px 1px; - cursor: not-allowed; - font-weight: normal; white-space: nowrap; + color: #; text-decoration: none; + cursor: not-allowed; } a.tmenu:link, a.tmenu:visited, a.tmenu:hover, a.tmenu:active { @@ -561,31 +559,11 @@ a.tmenu:link, a.tmenu:visited, a.tmenu:hover, a.tmenu:active { color: #; text-decoration: none; } -a.tmenu:link, a.tmenu:visited { - color: #; -} -a.tmenu:hover, a.tmenu:active { - margin: 0px 0px 0px 0px; - /* border-: 1px solid #555555; */ - /* border-: 1px solid #D8D8D8; */ - /* border-top: 1px solid #D8D8D8; */ - /* border-bottom: 2px solid #F4F4F4; */ - /* background: #F4F4F4; */ - /* text-shadow: 1px 1px 1px #FFFFFF !important; */ - color: #; -} - a.tmenusel:link, a.tmenusel:visited, a.tmenusel:hover, a.tmenusel:active { font-weight: normal; padding: 0px 5px 0px 5px; margin: 0px 0px 0px 0px; - /* background: #F4F4F4; */ - /* border-: 1px solid #555555; */ - /* border-top: 1px solid #D8D8D8; */ - /* border-: 1px solid #D8D8D8; */ - /* border-bottom: 2px solid #F4F4F4; */ white-space: nowrap; - /* text-shadow: 1px 1px 1px #FFFFFF;*/ color: #; text-decoration: none !important; } @@ -1579,7 +1557,6 @@ span.butAction, span.butActionDelete { } #undertopmenu { - /* background-image: url(""); */ background-repeat: repeat-x; margin-top: px; } @@ -1963,9 +1940,15 @@ tr.box_pair { font-family: ; } -tr.fiche { - font-family: ; +.formboxfilter { + vertical-align: middle; } +.formboxfilter input[type=image] +{ + top: 5px; + position: relative; +} + diff --git a/scripts/contracts/email_expire_services_to_customers.php b/scripts/contracts/email_expire_services_to_customers.php index 9753599115c..611d614393a 100755 --- a/scripts/contracts/email_expire_services_to_customers.php +++ b/scripts/contracts/email_expire_services_to_customers.php @@ -281,4 +281,4 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldcustomer,$dura } } -?> \ No newline at end of file +?> diff --git a/scripts/contracts/email_expire_services_to_representatives.php b/scripts/contracts/email_expire_services_to_representatives.php index a41a59de3cf..7fded53a9f7 100755 --- a/scripts/contracts/email_expire_services_to_representatives.php +++ b/scripts/contracts/email_expire_services_to_representatives.php @@ -279,4 +279,4 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldsalerepresenta } } -?> \ No newline at end of file +?> diff --git a/scripts/user/sync_groups_ldap2dolibarr.php b/scripts/user/sync_groups_ldap2dolibarr.php index 485f0dbf72a..e7bf8773a25 100755 --- a/scripts/user/sync_groups_ldap2dolibarr.php +++ b/scripts/user/sync_groups_ldap2dolibarr.php @@ -256,4 +256,4 @@ function dolValidElement($element) return (trim($element) != ''); } -?> \ No newline at end of file +?> diff --git a/scripts/user/sync_users_ldap2dolibarr.php b/scripts/user/sync_users_ldap2dolibarr.php index 8e831e26e84..60cb1118c37 100755 --- a/scripts/user/sync_users_ldap2dolibarr.php +++ b/scripts/user/sync_users_ldap2dolibarr.php @@ -311,4 +311,4 @@ function dolValidElement($element) return (trim($element) != ''); } -?> \ No newline at end of file +?>