From 7ba6754a5525523956cb11381a4757cc324c7e40 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 18 Feb 2016 00:27:35 +0100 Subject: [PATCH 1/8] Fix the missing button to record reception --- htdocs/fourn/commande/card.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index a8ea9f1201d5a..50df02b1bff38 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2761,6 +2761,18 @@ } } + // Ship + if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) + { + if (in_array($object->statut, array(3,4))) { + if ($conf->fournisseur->enabled && $user->rights->fournisseur->commande->receptionner) { + print '
' . $langs->trans('OrderDispatch') . '
'; + } else { + print '
' . $langs->trans('OrderDispatch') . '
'; + } + } + } + // Create bill if (! empty($conf->facture->enabled)) { From 6f6f2a0574725e233e79abc72ac5bf7a8751a6ac Mon Sep 17 00:00:00 2001 From: philippe grand Date: Sat, 20 Feb 2016 11:18:02 +0100 Subject: [PATCH 2/8] enhance code help translation --- .../fourn/class/fournisseur.commande.class.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 2edbcb0f24979..4017e1f3f56b9 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -141,7 +141,7 @@ function __construct($db) $this->statuts[5] = 'StatusOrderReceivedAll'; $this->statuts[6] = 'StatusOrderCanceled'; // Approved->Canceled $this->statuts[7] = 'StatusOrderCanceled'; // Process running->canceled - //$this->statuts[8] = 'StatusOrderBilled'; // Everything is finish, order received totally and bill received + //$this->statuts[8] = 'StatusOrderBilled'; // Everything is finished, order received totally and bill received $this->statuts[9] = 'StatusOrderRefused'; } @@ -585,8 +585,8 @@ function LibStatut($statut,$mode=0,$billed=0) * Return clicable name (with picto eventually) * * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto - * @param string $option Sur quoi pointe le lien - * @return string Chaine avec URL + * @param string $option On what the link points + * @return string Chain with URL */ function getNomUrl($withpicto=0,$option='') { @@ -621,8 +621,8 @@ function getNomUrl($withpicto=0,$option='') * Returns the following order reference not used depending on the numbering model activated * defined within COMMANDE_SUPPLIER_ADDON_NUMBER * - * @param Societe $soc objet societe - * @return string reference libre pour la facture + * @param Company $soc company object + * @return string free reference for the invoice */ function getNextNumRef($soc) { @@ -716,7 +716,7 @@ function approve($user, $idwarehouse=0, $secondlevel=0) $this->db->begin(); - // Definition du nom de modele de numerotation de commande + // Definition of order numbering model name $soc = new Societe($this->db); $soc->fetch($this->fourn_id); @@ -904,7 +904,7 @@ function refuse($user) /** * Cancel an approved order. - * L'annulation se fait apres l'approbation + * The cancellation is done after approval * * @param User $user User making action * @param int $idwarehouse Id warehouse to use for stock change (not used for supplier orders). @@ -1028,7 +1028,7 @@ function create($user, $notrigger=0) // Clean parameters if (empty($this->source)) $this->source = 0; - /* On positionne en mode brouillon la commande */ + /* One positions in draft mode the order */ $this->brouillon = 1; $sql = "INSERT INTO ".MAIN_DB_PREFIX."commande_fournisseur ("; @@ -1078,7 +1078,7 @@ function create($user, $notrigger=0) $num=count($this->lines); /* - * Insertion du detail des produits dans la base + * integration of products detail in the database */ for ($i=0;$i<$num;$i++) { From c1d7f5a7ed983a846919d6feb44e84ae0bc66e0a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 21 Feb 2016 20:00:40 +0100 Subject: [PATCH 3/8] FIX #4633 --- htdocs/product/stats/card.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php index 79d33b1d88452..49b700b46caa9 100644 --- a/htdocs/product/stats/card.php +++ b/htdocs/product/stats/card.php @@ -193,16 +193,19 @@ //print ''; // Generation des graphs - $dir = (! empty($conf->product->multidir_temp[$object->entity])?$conf->product->multidir_temp[$object->entity]:$conf->service->multidir_temp[$object->entity]); - if (! file_exists($dir.'/'.$object->id)) + if ($object->id > 0) // We are on statistics for a dedicated product { - if (dol_mkdir($dir.'/'.$object->id) < 0) - { - $mesg = $langs->trans("ErrorCanNotCreateDir",$dir); - $error++; - } + $dir = (! empty($conf->product->multidir_temp[$object->entity])?$conf->product->multidir_temp[$object->entity]:$conf->service->multidir_temp[$object->entity]); + if (! file_exists($dir.'/'.$object->id)) + { + if (dol_mkdir($dir.'/'.$object->id) < 0) + { + $mesg = $langs->trans("ErrorCanNotCreateDir",$dir); + $error++; + } + } } - + $graphfiles=array( 'propal' =>array('modulepart'=>'productstats_proposals', 'file' => $object->id.'/propal12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.'.png', From 54a4570b5f9f94bbfa04b4f7daf1141c22444b08 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 21 Feb 2016 20:57:15 +0100 Subject: [PATCH 4/8] FIX #4580 --- htdocs/societe/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 4a9efd40585db..087195e2905a8 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -747,7 +747,7 @@ $arraystcomm=array(); foreach($prospectstatic->cacheprospectstatus as $key => $val) { - $arraystcomm[$val['id']]=$val['label']; + $arraystcomm[$val['id']]=($langs->trans("StatusProspect".$val['id']) != "StatusProspect".$val['id'] ? $langs->trans("StatusProspect".$val['id']) : $val['label']); } print $form->selectarray('search_stcomm', $arraystcomm, $search_stcomm, -2); print ''; From a4f189eea75ce3cd94b103d00b066ca5ba3f7aee Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Feb 2016 09:27:18 +0100 Subject: [PATCH 5/8] Fix do not show warning if account defined --- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 796e225b268ee..8637f02bebce8 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -881,8 +881,8 @@ function _tableau_info(&$pdf, $object, $posy, $outputlangs) $this->error = $outputlangs->transnoentities("ErrorNoPaiementModeConfigured"); } // Avoid having any valid PDF with setup that is not complete - elseif (($object->mode_reglement_code == 'CHQ' && empty($conf->global->FACTURE_CHQ_NUMBER)) - || ($object->mode_reglement_code == 'VIR' && empty($conf->global->FACTURE_RIB_NUMBER))) + elseif (($object->mode_reglement_code == 'CHQ' && empty($conf->global->FACTURE_CHQ_NUMBER) && empty($object->fk_account) && empty($object->fk_bank)) + || ($object->mode_reglement_code == 'VIR' && empty($conf->global->FACTURE_RIB_NUMBER) && empty($object->fk_account) && empty($object->fk_bank))) { $outputlangs->load("errors"); From 6181ab41490de8ec04450f571516b4449379ee8a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Feb 2016 09:32:42 +0100 Subject: [PATCH 6/8] FIX Avoid to return an error due to mysql warning --- htdocs/admin/tools/export.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/admin/tools/export.php b/htdocs/admin/tools/export.php index c9e4211842d3d..81708e53e31d0 100644 --- a/htdocs/admin/tools/export.php +++ b/htdocs/admin/tools/export.php @@ -201,6 +201,7 @@ while (!feof($handlein)) { $read = fgets($handlein); + if (preg_match('/'.preg_quote('Warning: Using a password').'/i', $read)) continue; fwrite($handle,$read); if (preg_match('/'.preg_quote('-- Dump completed').'/i',$read)) $ok=1; elseif (preg_match('/'.preg_quote('SET SQL_NOTES=@OLD_SQL_NOTES').'/i',$read)) $ok=1; From 355f091246225fd337c3dadb0a56b1224605c585 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Feb 2016 13:28:08 +0100 Subject: [PATCH 7/8] FIX Option MAIN_FORCE_STATE_INTO_ADDRESS and SOCIETE_DISABLE_STATE --- htdocs/core/class/commonobject.class.php | 10 +++++----- htdocs/core/lib/functions.lib.php | 9 ++++----- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 278a9cbb626db..743b26ecc6785 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -447,7 +447,7 @@ function getBannerAddress($htmlkey, $object) { global $conf, $langs; - $countriesusingstate=array('AU','US','IN','GB','ES','UK','TR'); + $countriesusingstate=array('AU','US','IN','GB','ES','UK','TR'); // See also option MAIN_FORCE_STATE_INTO_ADDRESS $contactid=0; $thirdpartyid=0; @@ -483,11 +483,11 @@ function getBannerAddress($htmlkey, $object) $out.=dol_print_address($coords, 'address_'.$htmlkey.'_'.$this->id, $this->element, $this->id, 1); $outdone++; $outdone++; } - - if (! in_array($this->country_code,$countriesusingstate) && empty($conf->global->MAIN_FORCE_STATE_INTO_ADDRESS) - && ! empty($conf->global->SOCIETE_DISABLE_STATE) && $this->state) + + if (! in_array($this->country_code,$countriesusingstate) && empty($conf->global->MAIN_FORCE_STATE_INTO_ADDRESS) // If MAIN_FORCE_STATE_INTO_ADDRESS is on, state is already returned previously with getFullAddress + && empty($conf->global->SOCIETE_DISABLE_STATE) && $this->state) { - $out.=($outdone?'
':'').$this->state; + $out.=($outdone?' - ':'').$this->state; $outdone++; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 138a305433343..c9917e5852dee 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1001,7 +1001,7 @@ function dol_format_address($object,$withcountry=0,$sep="\n",$outputlangs='') global $conf,$langs; $ret=''; - $countriesusingstate=array('AU','US','IN','GB','ES','UK','TR'); + $countriesusingstate=array('AU','US','IN','GB','ES','UK','TR'); // See also MAIN_FORCE_STATE_INTO_ADDRESS // Address $ret .= $object->address; @@ -1009,7 +1009,7 @@ function dol_format_address($object,$withcountry=0,$sep="\n",$outputlangs='') if (in_array($object->country_code,array('US','AU')) || ! empty($conf->global->MAIN_FORCE_STATE_INTO_ADDRESS)) // US: title firstname name \n address lines \n town, state, zip \n country { $ret .= ($ret ? $sep : '' ).$object->town; - if ($object->state && in_array($object->country_code,$countriesusingstate)) + if ($object->state) { $ret.=", ".$object->state; } @@ -1018,7 +1018,7 @@ function dol_format_address($object,$withcountry=0,$sep="\n",$outputlangs='') else if (in_array($object->country_code,array('GB','UK'))) // UK: title firstname name \n address lines \n town state \n zip \n country { $ret .= ($ret ? $sep : '' ).$object->town; - if ($object->state && in_array($object->country_code,$countriesusingstate)) + if ($object->state) { $ret.=", ".$object->state; } @@ -1028,12 +1028,11 @@ function dol_format_address($object,$withcountry=0,$sep="\n",$outputlangs='') { $ret .= ($ret ? $sep : '' ).$object->zip; $ret .= ($object->town?(($object->zip?' ':'').$object->town):''); - if ($object->state && in_array($object->country_code,$countriesusingstate)) + if ($object->state) { $ret.="\n".$object->state; } } - else // Other: title firstname name \n address lines \n zip town \n country { $ret .= $object->zip ? (($ret ? $sep : '' ).$object->zip) : ''; From a08fa814ec0123432102a059a598c3b8be552886 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Feb 2016 13:32:01 +0100 Subject: [PATCH 8/8] Better filter to exclude mysqldump warning --- htdocs/admin/tools/export.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/tools/export.php b/htdocs/admin/tools/export.php index 81708e53e31d0..3a25ceadfe639 100644 --- a/htdocs/admin/tools/export.php +++ b/htdocs/admin/tools/export.php @@ -198,10 +198,12 @@ $ok=0; dol_syslog("Run command ".$fullcommandcrypted); $handlein = popen($fullcommandclear, 'r'); + $i=0; while (!feof($handlein)) { + $i++; // output line number $read = fgets($handlein); - if (preg_match('/'.preg_quote('Warning: Using a password').'/i', $read)) continue; + if ($i == 1 && preg_match('/'.preg_quote('Warning: Using a password').'/i', $read)) continue; fwrite($handle,$read); if (preg_match('/'.preg_quote('-- Dump completed').'/i',$read)) $ok=1; elseif (preg_match('/'.preg_quote('SET SQL_NOTES=@OLD_SQL_NOTES').'/i',$read)) $ok=1;