diff --git a/ChangeLog b/ChangeLog index 22b1631390f50f6a74b0f0847d607d4ed500f748..c567d47a9bc52b7ab1f1394d21ce17876c4b2182 100644 --- a/ChangeLog +++ b/ChangeLog @@ -174,7 +174,10 @@ Dolibarr better: - Fix: Civility & birthdate wasn't save into adherent module. - Fix: webservice Thirdparty parameter lastname for invidual creation is now lastname and not ref - Fix: Chars - is no more allowed into value for code for extra fields. -( Fix: [ bug #1622 ] Requesting holiday than spans across two years cause high CPU usage by Apache +- Fix: [ bug #1622 ] Requesting holiday than spans across two years cause high CPU usage by Apache +- Fix: [ bug #1595 ] Selected boolean extrafield in intervention creation page, does not save state +- Fix: Show sender Country on PDF docs when sender Country <> receiver Country +- Fix: [ bug #1624 ] Use lowest buying price for margin when selling with POS ***** ChangeLog for 3.6.1 compared to 3.6.* ***** For users: diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index 328866eb9647f20c71e8d5c1a4b2e73b3122f856..aef978ec6ad73e635fc565946d07df5e8d065295 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -163,6 +163,22 @@ if ($action == 'setdefaultduration') } } +if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') +{ + $res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL",$value,'chaine',0,'',$conf->entity); + + if (! $res > 0) $error++; + + if (! $error) + { + setEventMessage($langs->trans("SetupSaved")); + } + else + { + setEventMessage($langs->trans("Error"),'errors'); + } +} + // Define constants for submodules that contains parameters (forms with param1, param2, ... and value1, value2, ...) if ($action == 'setModuleOptions') { @@ -582,6 +598,35 @@ print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">' print "</td></tr>\n"; print '</form>'; +if ($conf->banque->enabled) +{ + $var=!$var; + print '<tr '.$bc[$var].'><td>'; + print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL").'</td><td> </td><td align="center">'; + if (! empty($conf->use_javascript_ajax)) + { + print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL'); + } + else + { + if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL)) + { + print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL&value=1">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>'; + } + else + { + print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL&value=0">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>'; + } + } + print '</td></tr>'; +} +else +{ + $var=!$var; + print '<tr '.$bc[$var].'><td>'; + print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL").'</td><td> </td><td align="center">'.$langs->trans('NotAvailable').'</td></tr>'; +} + print '</table>'; diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 65f88cddbd8b77826b055763e8e25b5fddf752c2..465fe5e2d767bfd301a1bf91de5fc91a7b707377 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1310,9 +1310,11 @@ if ($action == 'create') print '</td></tr>'; // Bank Account - print '<tr><td>' . $langs->trans('BankAccount') . '</td><td colspan="2">'; - $form->select_comptes($fk_account, 'fk_account', 0, '', 1); - print '</td></tr>'; + if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL) && $conf->module->banque->enabled) { + print '<tr><td>' . $langs->trans('BankAccount') . '</td><td colspan="2">'; + $form->select_comptes($fk_account, 'fk_account', 0, '', 1); + print '</td></tr>'; + } // What trigger creation print '<tr><td>' . $langs->trans('Source') . '</td><td>'; @@ -1893,7 +1895,7 @@ if ($action == 'create') print '</tr>'; } - if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL)) + if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL) && $conf->banque->enabled) { // Bank Account print '<tr><td>'; diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 12dbbe7d1c1b25b336df70ddd0a9ff18cc0e6047..fb9d5257d4980dab0b3c2b6ea0fe4d4b7e9edea0 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -416,7 +416,15 @@ class Propal extends CommonObject // infos marge - $this->line->fk_fournprice = $fk_fournprice; + if (!empty($fk_product) && empty($fk_fournprice) && empty($pa_ht)) { + // by external module, take lowest buying price + include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; + $productFournisseur = new ProductFournisseur($this->db); + $productFournisseur->find_min_price_product_fournisseur($fk_product); + $this->line->fk_fournprice = $productFournisseur->product_fourn_price_id; + } else { + $this->line->fk_fournprice = $fk_fournprice; + } $this->line->pa_ht = $pa_ht; // Mise en option de la ligne @@ -567,7 +575,15 @@ class Propal extends CommonObject $this->line->skip_update_total = $skip_update_total; // infos marge - $this->line->fk_fournprice = $fk_fournprice; + if (!empty($fk_product) && empty($fk_fournprice) && empty($pa_ht)) { + // by external module, take lowest buying price + include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; + $productFournisseur = new ProductFournisseur($this->db); + $productFournisseur->find_min_price_product_fournisseur($fk_product); + $this->line->fk_fournprice = $productFournisseur->product_fourn_price_id; + } else { + $this->line->fk_fournprice = $fk_fournprice; + } $this->line->pa_ht = $pa_ht; $this->line->date_start=$date_start; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 7f9cfb102fd3eda0fd2eebc8edae29fcd3578f40..56511f43c97bb8cd9b5d395b291a4657689c5098 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1391,10 +1391,13 @@ if ($action == 'create' && $user->rights->commande->creer) { print '</td></tr>'; // Bank Account - print '<tr><td>' . $langs->trans('BankAccount') . '</td><td colspan="2">'; - $form->select_comptes($fk_account, 'fk_account', 0, '', 1); - print '</td></tr>'; - + if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER) && ! empty($conf->banque->enabled)) + { + print '<tr><td>' . $langs->trans('BankAccount') . '</td><td colspan="2">'; + $form->select_comptes($fk_account, 'fk_account', 0, '', 1); + print '</td></tr>'; + } + // Delivery delay print '<tr><td>' . $langs->trans('AvailabilityPeriod') . '</td><td colspan="2">'; $form->selectAvailabilityDelay($availability_id, 'availability_id', '', 1); @@ -1995,22 +1998,25 @@ if ($action == 'create' && $user->rights->commande->creer) { $rowspan ++; // Bank Account - print '<tr><td class="nowrap">'; - print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">'; - print $langs->trans('BankAccount'); - print '<td>'; - if ($action != 'editbankaccount' && $user->rights->commande->creer) - print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'),1).'</a></td>'; - print '</tr></table>'; - print '</td><td colspan="3">'; - if ($action == 'editbankaccount') { - $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1); - } else { - $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); - } - print '</td>'; - print '</tr>'; - + if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER) && ! empty($conf->banque->enabled)) + { + print '<tr><td class="nowrap">'; + print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">'; + print $langs->trans('BankAccount'); + print '<td>'; + if ($action != 'editbankaccount' && $user->rights->commande->creer) + print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'),1).'</a></td>'; + print '</tr></table>'; + print '</td><td colspan="3">'; + if ($action == 'editbankaccount') { + $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1); + } else { + $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); + } + print '</td>'; + print '</tr>'; + } + // Total HT print '<tr><td>' . $langs->trans('AmountHT') . '</td>'; print '<td align="right">' . price($object->total_ht, 1, '', 1, - 1, - 1, $conf->currency) . '</td>'; diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index ed308394e6cd368e84aacaf5e0dae0ac48a96768..49ba2536bfae232cff9a2d2c3d29a4a633260025 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1224,7 +1224,15 @@ class Commande extends CommonOrder $this->line->date_end=$date_end; // infos marge - $this->line->fk_fournprice = $fk_fournprice; + if (!empty($fk_product) && empty($fk_fournprice) && empty($pa_ht)) { + // by external module, take lowest buying price + include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; + $productFournisseur = new ProductFournisseur($this->db); + $productFournisseur->find_min_price_product_fournisseur($fk_product); + $this->line->fk_fournprice = $productFournisseur->product_fourn_price_id; + } else { + $this->line->fk_fournprice = $fk_fournprice; + } $this->line->pa_ht = $pa_ht; // TODO Ne plus utiliser @@ -2421,7 +2429,15 @@ class Commande extends CommonOrder $this->line->skip_update_total=$skip_update_total; // infos marge - $this->line->fk_fournprice = $fk_fournprice; + if (!empty($fk_product) && empty($fk_fournprice) && empty($pa_ht)) { + //by external module, take lowest buying price + include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; + $productFournisseur = new ProductFournisseur($this->db); + $productFournisseur->find_min_price_product_fournisseur($fk_product); + $this->line->fk_fournprice = $productFournisseur->product_fourn_price_id; + } else { + $this->line->fk_fournprice = $fk_fournprice; + } $this->line->pa_ht = $pa_ht; // TODO deprecated diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 4331d80925f43b7f5e8d934a140446ac929aaa86..a6877ad9ed8252b7a2c3211dddfb47ce060ba781 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -2203,7 +2203,15 @@ class Facture extends CommonInvoice $this->line->skip_update_total = $skip_update_total; // infos marge - $this->line->fk_fournprice = $fk_fournprice; + if (!empty($fk_product) && empty($fk_fournprice) && empty($pa_ht)) { + // POS or external module, take lowest buying price + include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; + $productFournisseur = new ProductFournisseur($this->db); + $productFournisseur->find_min_price_product_fournisseur($fk_product); + $this->line->fk_fournprice = $productFournisseur->product_fourn_price_id; + } else { + $this->line->fk_fournprice = $fk_fournprice; + } $this->line->pa_ht = $pa_ht; if (is_array($array_option) && count($array_option)>0) { @@ -3498,6 +3506,14 @@ class FactureLigne extends CommonInvoiceLine return -1; } } + + // POS or by external module, take lowest buying price + if (!empty($this->fk_product) && empty($this->fk_fournprice) && empty($this->pa_ht)) { + include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; + $productFournisseur = new ProductFournisseur($this->db); + $productFournisseur->find_min_price_product_fournisseur($this->fk_product); + $this->fk_fournprice = $productFournisseur->product_fourn_price_id; + } $this->db->begin(); diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index fc2943f05e0c2be3629fb54c9daffd0502560a89..2359d70d07b16472d053804dffb522cb0889c1bd 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -678,7 +678,7 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us $societestatic->name=$obj->name; $societestatic->client=1; print $societestatic->getNomUrl(1,'customer',44); - print '</a></td>'; + print '</td>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total_ht).'</td>'; print '<td align="right">'.price($obj->total_ttc).'</td>'; print '<td align="right">'.price($obj->total_ttc-$obj->tot_fttc).'</td>'; @@ -777,7 +777,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) $societestatic->name=$obj->name; $societestatic->client=1; print $societestatic->getNomUrl(1,'customer',44); - print '</a></td>'; + print '</td>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total).'</td>'; print '<td align="right">'.price($obj->total_ttc).'</td>'; print '<td align="right">'.price($obj->am).'</td>'; diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 4abfb1f9c86f4fa85ee8e46c3805244704919bf8..1399ae402150025f02c80eddf163cea4e5d644a6 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -2385,39 +2385,4 @@ class ContratLigne extends CommonObject } } - /** - * Create a contract document on disk using template defined into CONTRACT_ADDON_PDF - * - * @param string $modele force le modele a utiliser ('' par defaut) - * @param Translate $outputlangs objet lang a utiliser pour traduction - * @param int $hidedetails Hide details of lines - * @param int $hidedesc Hide description - * @param int $hideref Hide ref - * @return int 0 if KO, 1 if OK - */ - public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0) - { - global $conf,$langs,$user,$hookmanager; - - $langs->load("contracts"); - - // Positionne modele sur le nom du modele de contrat a utiliser - if (! dol_strlen($modele)) - { - if (! empty($conf->global->CONTRACT_ADDON_PDF)) - { - $modele = $conf->global->CONTRACT_ADDON_PDF; - } - else - { - $modele = 'strato'; - } - } - - $modelpath = "core/modules/contract/doc/"; - - return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref); - } } - - diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index b272f35071737909c39db0f1a9679da8286e16ec..9b2a5437b8a71966efcc218cb327d2a3173b6f7f 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -215,9 +215,9 @@ class box_graph_invoices_permonth extends ModeleBoxes $stringtoshow.='<form class="flat formboxfilter" method="POST" action="'.$_SERVER["PHP_SELF"].'">'; $stringtoshow.='<input type="hidden" name="action" value="'.$refreshaction.'">'; $stringtoshow.='<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_box_'.$this->boxcode.':year,shownb,showtot">'; - $stringtoshow.='<input type="checkbox" name="'.$param_shownb.'"'.($shownb?' checked="true"':'').'"> '.$langs->trans("NumberOfBillsByMonth"); + $stringtoshow.='<input type="checkbox" name="'.$param_shownb.'"'.($shownb?' checked="true"':'').'> '.$langs->trans("NumberOfBillsByMonth"); $stringtoshow.=' '; - $stringtoshow.='<input type="checkbox" name="'.$param_showtot.'"'.($showtot?' checked="true"':'').'"> '.$langs->trans("AmountOfBillsByMonthHT"); + $stringtoshow.='<input type="checkbox" name="'.$param_showtot.'"'.($showtot?' checked="true"':'').'> '.$langs->trans("AmountOfBillsByMonthHT"); $stringtoshow.='<br>'; $stringtoshow.=$langs->trans("Year").' <input class="flat" size="4" type="text" name="'.$param_year.'" value="'.$endyear.'">'; $stringtoshow.='<input type="image" alt="'.$langs->trans("Refresh").'" src="'.img_picto($langs->trans("Refresh"),'refresh.png','','',1).'">'; diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php index c882acd40c155ea35b76689f2da8ac63fee2beda..7c2aa53da97887c5a55ab4c432bac82700067fbd 100644 --- a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php @@ -214,9 +214,9 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes $stringtoshow.='<form class="flat formboxfilter" method="POST" action="'.$_SERVER["PHP_SELF"].'">'; $stringtoshow.='<input type="hidden" name="action" value="'.$refreshaction.'">'; $stringtoshow.='<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_box_'.$this->boxcode.':year,shownb,showtot">'; - $stringtoshow.='<input type="checkbox" name="'.$param_shownb.'"'.($shownb?' checked="true"':'').'"> '.$langs->trans("NumberOfBillsByMonth"); + $stringtoshow.='<input type="checkbox" name="'.$param_shownb.'"'.($shownb?' checked="true"':'').'> '.$langs->trans("NumberOfBillsByMonth"); $stringtoshow.=' '; - $stringtoshow.='<input type="checkbox" name="'.$param_showtot.'"'.($showtot?' checked="true"':'').'"> '.$langs->trans("AmountOfBillsByMonthHT"); + $stringtoshow.='<input type="checkbox" name="'.$param_showtot.'"'.($showtot?' checked="true"':'').'> '.$langs->trans("AmountOfBillsByMonthHT"); $stringtoshow.='<br>'; $stringtoshow.=$langs->trans("Year").' <input class="flat" size="4" type="text" name="'.$param_year.'" value="'.$endyear.'">'; $stringtoshow.='<input type="image" alt="'.$langs->trans("Refresh").'" src="'.img_picto($langs->trans("Refresh"),'refresh.png','','',1).'">'; diff --git a/htdocs/core/boxes/box_graph_orders_permonth.php b/htdocs/core/boxes/box_graph_orders_permonth.php index 5084691d321695bc4ea196601ea2b977d9762aa2..75f0f60660fe9adcb9af9538e2044e1655b588b1 100644 --- a/htdocs/core/boxes/box_graph_orders_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_permonth.php @@ -215,9 +215,9 @@ class box_graph_orders_permonth extends ModeleBoxes $stringtoshow.='<form class="flat formboxfilter" method="POST" action="'.$_SERVER["PHP_SELF"].'">'; $stringtoshow.='<input type="hidden" name="action" value="'.$refreshaction.'">'; $stringtoshow.='<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_box_'.$this->boxcode.':year,shownb,showtot">'; - $stringtoshow.='<input type="checkbox" name="'.$param_shownb.'"'.($shownb?' checked="true"':'').'"> '.$langs->trans("NumberOfOrdersByMonth"); + $stringtoshow.='<input type="checkbox" name="'.$param_shownb.'"'.($shownb?' checked="true"':'').'> '.$langs->trans("NumberOfOrdersByMonth"); $stringtoshow.=' '; - $stringtoshow.='<input type="checkbox" name="'.$param_showtot.'"'.($showtot?' checked="true"':'').'"> '.$langs->trans("AmountOfOrdersByMonthHT"); + $stringtoshow.='<input type="checkbox" name="'.$param_showtot.'"'.($showtot?' checked="true"':'').'> '.$langs->trans("AmountOfOrdersByMonthHT"); $stringtoshow.='<br>'; $stringtoshow.=$langs->trans("Year").' <input class="flat" size="4" type="text" name="'.$param_year.'" value="'.$endyear.'">'; $stringtoshow.='<input type="image" alt="'.$langs->trans("Refresh").'" src="'.img_picto($langs->trans("Refresh"),'refresh.png','','',1).'">'; diff --git a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php index f398ae9dcb1f64d324276078f454d243b57fe27a..70d62cac34852fcaf9a3af4e2aff4c00b3db5bba 100644 --- a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php @@ -214,9 +214,9 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes $stringtoshow.='<form class="flat formboxfilter" method="POST" action="'.$_SERVER["PHP_SELF"].'">'; $stringtoshow.='<input type="hidden" name="action" value="'.$refreshaction.'">'; $stringtoshow.='<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_box_'.$this->boxcode.':year,shownb,showtot">'; - $stringtoshow.='<input type="checkbox" name="'.$param_shownb.'"'.($shownb?' checked="true"':'').'"> '.$langs->trans("NumberOfOrdersByMonth"); + $stringtoshow.='<input type="checkbox" name="'.$param_shownb.'"'.($shownb?' checked="true"':'').'> '.$langs->trans("NumberOfOrdersByMonth"); $stringtoshow.=' '; - $stringtoshow.='<input type="checkbox" name="'.$param_showtot.'"'.($showtot?' checked="true"':'').'"> '.$langs->trans("AmountOfOrdersByMonthHT"); + $stringtoshow.='<input type="checkbox" name="'.$param_showtot.'"'.($showtot?' checked="true"':'').'> '.$langs->trans("AmountOfOrdersByMonthHT"); $stringtoshow.='<br>'; $stringtoshow.=$langs->trans("Year").' <input class="flat" size="4" type="text" name="'.$param_year.'" value="'.$endyear.'">'; $stringtoshow.='<input type="image" alt="'.$langs->trans("Refresh").'" src="'.img_picto($langs->trans("Refresh"),'refresh.png','','',1).'">'; diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php index 974ccaed446c21bba6ced530dadc84aa251cee90..fd866f5df89c3475abf9ada2e262a3297b4d3f5a 100644 --- a/htdocs/core/boxes/box_graph_propales_permonth.php +++ b/htdocs/core/boxes/box_graph_propales_permonth.php @@ -218,9 +218,9 @@ class box_graph_propales_permonth extends ModeleBoxes $stringtoshow.='<form class="flat formboxfilter" method="POST" action="'.$_SERVER["PHP_SELF"].'">'; $stringtoshow.='<input type="hidden" name="action" value="'.$refreshaction.'">'; $stringtoshow.='<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_box_'.$this->boxcode.':year,shownb,showtot">'; - $stringtoshow.='<input type="checkbox" name="'.$param_shownb.'"'.($shownb?' checked="true"':'').'"> '.$langs->trans("NumberOfProposalsByMonth"); + $stringtoshow.='<input type="checkbox" name="'.$param_shownb.'"'.($shownb?' checked="true"':'').'> '.$langs->trans("NumberOfProposalsByMonth"); $stringtoshow.=' '; - $stringtoshow.='<input type="checkbox" name="'.$param_showtot.'"'.($showtot?' checked="true"':'').'"> '.$langs->trans("AmountOfProposalsByMonthHT"); + $stringtoshow.='<input type="checkbox" name="'.$param_showtot.'"'.($showtot?' checked="true"':'').'> '.$langs->trans("AmountOfProposalsByMonthHT"); $stringtoshow.='<br>'; $stringtoshow.=$langs->trans("Year").' <input class="flat" size="4" type="text" name="'.$param_year.'" value="'.$endyear.'">'; $stringtoshow.='<input type="image" alt="'.$langs->trans("Refresh").'" src="'.img_picto($langs->trans("Refresh"),'refresh.png','','',1).'">'; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index a4d491683b5172a152ea0c4a2c2265262661430f..b70820463b067d3adb6b7e28e32f8fef82d89b07 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2622,7 +2622,7 @@ class Form $i++; } print "</select>"; - if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); + if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); } else { print $langs->trans("NoShippingMethodDefined"); } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index cc06786e6021896eabb5fb34630e3eb890998225..84bf351e7b958601c89c35e6b1ac5c1641a05225 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -766,11 +766,12 @@ function dol_bc($var,$moreclass='') * @param Object $object A company or contact object * @param int $withcountry 1=Add country into address string * @param string $sep Separator to use to build string + * @param Tranlsate $outputlangs Object lang that contains language for text translation. * @return string Formated string */ -function dol_format_address($object,$withcountry=0,$sep="\n") +function dol_format_address($object,$withcountry=0,$sep="\n",$outputlangs='') { - global $conf; + global $conf,$langs; $ret=''; $countriesusingstate=array('AU','US','IN','GB','ES','UK','TR'); @@ -815,8 +816,8 @@ function dol_format_address($object,$withcountry=0,$sep="\n") $ret.=", ".$object->state; } } - - if ($withcountry) $ret.=($object->country?$sep.$object->country:''); + if (! is_object($outputlangs)) $outputlangs=$langs; + if ($withcountry) $ret.=($object->country_code?$sep.$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$object->country_code)):''); return $ret; } @@ -2905,7 +2906,7 @@ function price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerou * 'MT'=Round to Max for totals with Tax (MAIN_MAX_DECIMALS_TOT) * 'MS'=Round to Max Shown (MAIN_MAX_DECIMALS_SHOWN) * @param int $alreadysqlnb Put 1 if you know that content is already universal format number - * @return string Amount with universal numeric format (Example: '99.99999') + * @return string Amount with universal numeric format (Example: '99.99999') or unchanged text if conversion fails. * * @see price Opposite function of price2num */ diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 3223412dc5f36764fe4e9dfb7492db3503242313..15cb2f87b0b447721070185c3260ed293c02824d 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -312,7 +312,10 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target if ($mode == 'source') { - $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($sourcecompany))."\n"; + $withCountry = 0; + if (!empty($sourcecompany->country_code) && ($targetcompany->country_code != $sourcecompany->country_code)) $withCountry = 1; + + $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($sourcecompany, $withCountry, "\n", $outputlangs))."\n"; if (empty($conf->global->MAIN_PDF_DISABLESOURCEDETAILS)) { diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 3e7803af70afedafa78c7846d4d604e287e40600..510a1bd88a1d620098eb7c9d4e83e7e1361aa914 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -1188,7 +1188,7 @@ class pdf_einstein extends ModelePDFCommandes if ($showaddress) { // Sender properties - $carac_emetteur = pdf_build_address($outputlangs,$this->emetteur); + $carac_emetteur = pdf_build_address($outputlangs, $this->emetteur, $object->client); // Show sender $posy=42; diff --git a/htdocs/core/modules/commande/doc/pdf_proforma.modules.php b/htdocs/core/modules/commande/doc/pdf_proforma.modules.php index 0216bd4163aac9aa16d5c622c92b82c686014d5a..2b8aaa21818228fcae1d3ac28c0cbfeb7c87923d 100644 --- a/htdocs/core/modules/commande/doc/pdf_proforma.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_proforma.modules.php @@ -1145,7 +1145,7 @@ class pdf_proforma extends ModelePDFCommandes if ($showaddress) { // Sender properties - $carac_emetteur = pdf_build_address($outputlangs,$this->emetteur); + $carac_emetteur = pdf_build_address($outputlangs, $this->emetteur, $object->client); // Show sender $posy=42; diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index 4c609bc100c564dc9d7c4bcadede0c4fc82f87d9..be686377ce39e1aa5fe90b674ac18a63316708b2 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -555,7 +555,7 @@ class pdf_strato extends ModelePDFContract $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Name").": ".$outputlangs->convToOutputCharset($object->user->getFullName($outputlangs))."\n"; } - $carac_emetteur .= pdf_build_address($outputlangs,$this->emetteur); + $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->client); // Show sender $posy=42; diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index bdf61e3ea72da8d840cf019a8a35e7fd33a491e9..145eeafcddedb49b046b81914ab71104c0f71676 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -539,7 +539,7 @@ class pdf_merou extends ModelePdfExpedition $pdf->SetTextColor(0,0,0); // Sender properties - $carac_emetteur = pdf_build_address($outputlangs,$this->emetteur); + $carac_emetteur = pdf_build_address($outputlangs, $this->emetteur, $object->client); $pdf->SetFont('','', $default_font_size - 3); $pdf->SetXY($blSocX,$blSocY+4); diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index ccb4f93a611b37ab0844ca936c66b289761c6313..ea6601b839656f345adb7a8d296f712a4aafe2f2 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -587,7 +587,7 @@ class pdf_rouget extends ModelePdfExpedition $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Name").": ".$outputlangs->convToOutputCharset($object->user->getFullName($outputlangs))."\n"; } - $carac_emetteur .= pdf_build_address($outputlangs,$this->emetteur); + $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->client); // Show sender $posx=$this->marge_gauche; diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 35a0ff47aa076419863b97ed3b62eef71aa16694..6d1f5636b851ac0c6a9d9c88b6b3c463be3774df 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1434,7 +1434,7 @@ class pdf_crabe extends ModelePDFFactures if ($showaddress) { // Sender properties - $carac_emetteur = pdf_build_address($outputlangs,$this->emetteur); + $carac_emetteur = pdf_build_address($outputlangs, $this->emetteur, $object->client); // Show sender $posy=42; diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index 0d09aa7ce6cde028e7ebbd190780c2e670867501..626c28309819d57aff3f088436672af4ffef4d3c 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -522,7 +522,7 @@ class pdf_soleil extends ModelePDFFicheinter $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Name").": ".$outputlangs->convToOutputCharset($object->user->getFullName($outputlangs))."\n"; } - $carac_emetteur .= pdf_build_address($outputlangs,$this->emetteur); + $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->client); // Show sender $posy=42; diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 1cafa394e667bda997de96fe5e5008ca1a9cd220..35953b8521f00b2e263f6f9d1afdd76b57ffce31 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1284,7 +1284,7 @@ class pdf_azur extends ModelePDFPropales $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Name").": ".$outputlangs->convToOutputCharset($object->user->getFullName($outputlangs))."\n"; } - $carac_emetteur .= pdf_build_address($outputlangs,$this->emetteur); + $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->client); // Show sender $posy=42; diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index 5865d431132346c4b4af8e151d99ce9693389f1c..6b57b961da45e38d42ffb436c7c3d078f9f28f18 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -970,7 +970,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices if ($showaddress) { // Sender properties - $carac_emetteur = pdf_build_address($outputlangs,$this->emetteur); + $carac_emetteur = pdf_build_address($outputlangs, $this->emetteur, $object->client); // Show sender $posy=42; diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index 5faed78985c244548bc7303304cf3e788a7c349d..29bd483b39b3078c3620306efa40e498caeff419 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -1022,7 +1022,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders if ($showaddress) { // Sender properties - $carac_emetteur = pdf_build_address($outputlangs,$this->emetteur); + $carac_emetteur = pdf_build_address($outputlangs, $this->emetteur, $object->client); // Show sender $posy=42; diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index a69ab60c2547eb0086c8f3f0591141ff8b016b2c..543b0724de22abb554be4f83980e375f13d7bf35 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -50,25 +50,23 @@ if (in_array($object->element,array('propal','facture','invoice','commande','ord <td<?php echo (! empty($conf->global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>> <div id="add"></div><span class="hideonsmartphone"><?php echo $langs->trans('AddNewLine'); ?></span><?php // echo $langs->trans("FreeZone"); ?> </td> - <td align="right"><span id="title_vat"><label for="tva_tx"><?php echo $langs->trans('VAT'); ?></label></span></td> - <td align="right"><span id="title_up_ht"><label for="price_ht"><?php echo $langs->trans('PriceUHT'); ?></label></span></td> + <td align="right"><span id="title_vat"><?php echo $langs->trans('VAT'); ?></span></td> + <td align="right"><span id="title_up_ht"><?php echo $langs->trans('PriceUHT'); ?></span></td> <?php if (! empty($inputalsopricewithtax)) { ?> - <td align="right"><span id="title_up_ttc"><label for="price_ttc"><?php echo $langs->trans('PriceUTTC'); ?></label></span></td> + <td align="right"><span id="title_up_ttc"><?php echo $langs->trans('PriceUTTC'); ?></span></td> <?php } ?> - <td align="right"><label for="qty"><?php echo $langs->trans('Qty'); ?></label></td> - <td align="right"><label for="remise_percent"><?php echo $langs->trans('ReductionShort'); ?></label></td> + <td align="right"><?php echo $langs->trans('Qty'); ?></td> + <td align="right"><?php echo $langs->trans('ReductionShort'); ?></td> <?php if (! empty($usemargins)) { ?> <td align="right" class="margininfos"> <?php - echo '<label for="buying_price">'; if ($conf->global->MARGIN_TYPE == "1") echo $langs->trans('BuyingPrice'); else echo $langs->trans('CostPrice'); - echo '</label>'; ?> </td> <?php @@ -103,20 +101,25 @@ else { // Show radio free line if ($forceall >= 0 && (! empty($conf->product->enabled) || ! empty($conf->service->enabled))) { + echo '<label for="prod_entry_mode_free">'; echo '<input type="radio" name="prod_entry_mode" id="prod_entry_mode_free" value="free"'; //echo (GETPOST('prod_entry_mode')=='free' ? ' checked="true"' : ((empty($forceall) && (empty($conf->product->enabled) || empty($conf->service->enabled)))?' checked="true"':'') ); echo (GETPOST('prod_entry_mode')=='free' ? ' checked="true"' : ''); echo '> '; - } - else echo '<input type="hidden" id="prod_entry_mode_free" name="prod_entry_mode" value="free">'; - - // Show type selector - if ($forceall >= 0) - { - echo '<label for="select_type">'; + // Show type selector echo $langs->trans("FreeLineOfType"); - echo '</label>'; echo ' '; + echo '</label>'; + } + else + { + echo '<input type="hidden" id="prod_entry_mode_free" name="prod_entry_mode" value="free">'; + // Show type selector + if ($forceall >= 0) + { + echo $langs->trans("FreeLineOfType"); + echo ' '; + } } echo $form->select_type_of_lines(isset($_POST["type"])?$_POST["type"]:-1,'type',1,1,$forceall); @@ -128,9 +131,8 @@ else { { if ($forceall >= 0) echo '<br>'; echo '<span>'; - echo '<input type="radio" name="prod_entry_mode" id="prod_entry_mode_predef" value="predef"'.(GETPOST('prod_entry_mode')=='predef'?' checked="true"':'').'> '; - echo '<label for="prod_entry_mode_predef">'; + echo '<input type="radio" name="prod_entry_mode" id="prod_entry_mode_predef" value="predef"'.(GETPOST('prod_entry_mode')=='predef'?' checked="true"':'').'> '; if (empty($senderissupplier)) { if (! empty($conf->product->enabled) && empty($conf->service->enabled)) echo $langs->trans('PredefinedProductsToSell'); diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index ff504976687448f67dbdfde9d9f6404324476c1f..f1e5449cca71dfc04a7ab444a9cf6e82cd2e7c13 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -136,9 +136,10 @@ else if ($action == 'setmode' && $user->rights->fournisseur->commande->creer) } // bank account -else if ($action == 'setbankaccount' && $user->rights->fournisseur->commande->creer) { +else if ($action == 'setbankaccount' && $user->rights->fournisseur->commande->creer) +{ $result=$object->setBankAccount(GETPOST('fk_account', 'int')); - } +} // date de livraison if ($action == 'setdate_livraison' && $user->rights->fournisseur->commande->creer) @@ -1268,10 +1269,14 @@ if ($action=="create") print '</td></tr>'; // Bank Account - print '<tr><td>' . $langs->trans('BankAccount') . '</td><td colspan="2">'; - $form->select_comptes($fk_account, 'fk_account', 0, '', 1); - print '</td></tr>'; - + if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER) && ! empty($conf->banque->enabled)) + { + $langs->load("bank"); + print '<tr><td>' . $langs->trans('BankAccount') . '</td><td colspan="2">'; + $form->select_comptes($fk_account, 'fk_account', 0, '', 1); + print '</td></tr>'; + } + print '<tr><td>'.$langs->trans('NotePublic').'</td>'; print '<td>'; $doleditor = new DolEditor('note_public', GETPOST('note_public'), '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70); @@ -1539,22 +1544,25 @@ elseif (! empty($object->id)) print '</td></tr>'; // Bank Account - print '<tr><td class="nowrap">'; - print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">'; - print $langs->trans('BankAccount'); - print '<td>'; - if ($action != 'editbankaccount' && $user->rights->fournisseur->commande->creer) - print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'),1).'</a></td>'; - print '</tr></table>'; - print '</td><td colspan="3">'; - if ($action == 'editbankaccount') { - $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1); - } else { - $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); - } - print '</td>'; - print '</tr>'; - + if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER) && ! empty($conf->banque->enabled)) + { + print '<tr><td class="nowrap">'; + print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">'; + print $langs->trans('BankAccount'); + print '<td>'; + if ($action != 'editbankaccount' && $user->rights->fournisseur->commande->creer) + print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'),1).'</a></td>'; + print '</tr></table>'; + print '</td><td colspan="3">'; + if ($action == 'editbankaccount') { + $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1); + } else { + $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); + } + print '</td>'; + print '</tr>'; + } + // Delivery date planed print '<tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>'; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index e69168dbc21a198b9423312a8483163b5a6546eb..a524ff8a5fe196410fe512eb224031dd4304ec02 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1139,6 +1139,7 @@ AddDeliveryAddressAbility=Add delivery date ability UseOptionLineIfNoQuantity=A line of product/service with a zero amount is considered as an option FreeLegalTextOnProposal=Free text on commercial proposals WatermarkOnDraftProposal=Watermark on draft commercial proposals (none if empty) +BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL=Ask for bank account destination of proposal ##### Orders ##### OrdersSetup=Order management setup OrdersNumberingModules=Orders numbering models diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 7fe13a97b91e4e63266413a16c347d0ab7005b8a..d248a8c19fff288379a74b28a91be9c4cf25636b 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1632,9 +1632,9 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me print "\n"; print "<!-- Begin Help Block-->\n"; print '<div id="blockvmenuhelp" class="blockvmenuhelp">'."\n"; + //Dolibarr version $doliurl='http://www.dolibarr.org'; - //local communities if (preg_match('/fr/i',$langs->defaultlang)) $doliurl='http://www.dolibarr.fr'; if (preg_match('/es/i',$langs->defaultlang)) $doliurl='http://www.dolibarr.es'; @@ -1653,7 +1653,7 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me else $appli.=" ".DOL_VERSION; } else $appli.=" ".DOL_VERSION; - print '<div class="blockvmenuhelp">'; + print '<div id="blockvmenuhelpapp" class="blockvmenuhelp">'; if ($doliurl) print '<a class="help" target="_blank" href="'.$doliurl.'">'; print $appli; if ($doliurl) print '</a>'; @@ -1677,7 +1677,7 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me // Link to help pages if ($helpbaseurl && $helppage) { - print '<div class="blockvmenuhelp">'; + print '<div id="blockvmenuhelpwiki" class="blockvmenuhelp">'; print '<a class="help" target="_blank" title="'.$langs->trans($mode == 'wiki' ? 'GoToWikiHelpPage': 'GoToHelpPage'); if ($mode == 'wiki') print ' - '.$langs->trans("PageWiki").' "'.dol_escape_htmltag(strtr($helppage,'_',' ')).'"'; print '" href="'; @@ -1705,7 +1705,7 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me $bugbaseurl.=urlencode($langs->trans("Server").": ".$_SERVER["SERVER_SOFTWARE"]."\n"); $bugbaseurl.=urlencode($langs->trans("PHP").": ".version_php()."\n"); $bugbaseurl.=urlencode($langs->trans("Url").": ".$_SERVER["REQUEST_URI"]."\n"); - print '<div class="blockvmenuhelp"><a class="help" target="_blank" href="'.$bugbaseurl.'">'.$langs->trans("FindBug").'</a></div>'; + print '<div id="blockvmenuhelpbugreport" class="blockvmenuhelp"><a class="help" target="_blank" href="'.$bugbaseurl.'">'.$langs->trans("FindBug").'</a></div>'; } print "</div>\n"; diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index e4e85345ec89d7b0cdb22dfa11d42a15c1a43b98..1f6f430fccb2d7d1ae8ca3b02e9635c2d10a00e5 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -434,9 +434,13 @@ if ($action == 'create' && $user->rights->projet->creer) // Customer print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>'; - $text=$form->select_company(GETPOST('socid','int'),'socid','',1,1); - $texthelp=$langs->trans("IfNeedToUseOhterObjectKeepEmpty"); - print $form->textwithtooltip($text.' '.img_help(),$texthelp,1); + $text=$form->select_company(GETPOST('socid','int'),'socid','',1,1); + if (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) && empty($conf->dol_use_jmobile)) + { + $texthelp=$langs->trans("IfNeedToUseOhterObjectKeepEmpty"); + print $form->textwithtooltip($text.' '.img_help(),$texthelp,1); + } + else print $text; print '</td></tr>'; // Public diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index cd3592bd24d2e75899632d075dd267813363f27a..2eff193a5fd1496be4d9655bb5be1a6fe3a2efae 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -782,16 +782,18 @@ else print '<div class="hideonsmartphone float">'; print $langs->trans("ThirdPartyType").': '; print '</div>'; - print '<input type="radio" id="radiocompany" class="flat" name="private" value="0"'.($private?'':' checked="checked"').'>'; print '<label for="radiocompany">'; + print '<input type="radio" id="radiocompany" class="flat" name="private" value="0"'.($private?'':' checked="checked"').'>'; print ' '; print $langs->trans("Company/Fundation"); print '</label>'; print ' '; + print '<label for="radioprivate">'; print '<input type="radio" id="radioprivate" class="flat" name="private" value="1"'.($private?' checked="checked"':'').'>'; print ' '; print $langs->trans("Individual"); - print ' ('.$langs->trans("ToCreateContactWithSameName").')'; + print '<div class="hideonsmartphone">('.$langs->trans("ToCreateContactWithSameName").')</div>'; + print '</label>'; print '</div>'; print "<br>\n"; } diff --git a/test/phpunit/FunctionsLibTest.php b/test/phpunit/FunctionsLibTest.php index f26718f1dd951b30c0ab6b7cfd501b3272c223d3..af5f3393672cf42e1221f058776ccb2e752163fa 100755 --- a/test/phpunit/FunctionsLibTest.php +++ b/test/phpunit/FunctionsLibTest.php @@ -824,4 +824,32 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase $this->assertEquals(dol_nl2br($string, 1, 1), "a<br />a"); } + /** + * testDolPrice2Num + * + * @return boolean + */ + public function testDolPrice2Num() + { + $this->assertEquals(1000, price2num('1 000.0')); + $this->assertEquals(1000, price2num('1 000','MT')); + $this->assertEquals(1000, price2num('1 000','MU')); + + $this->assertEquals(1000.123456, price2num('1 000.123456')); + + // Round down + $this->assertEquals(1000.12, price2num('1 000.123452','MT')); + $this->assertEquals(1000.12345, price2num('1 000.123452','MU'),"Test MU"); + + // Round up + $this->assertEquals(1000.13, price2num('1 000.125456','MT')); + $this->assertEquals(1000.12546, price2num('1 000.125456','MU'),"Test MU"); + + // Text can't be converted + $this->assertEquals('12.4$',price2num('12.4$')); + $this->assertEquals('12r.4$',price2num('12r.4$')); + + return true; + } + }