diff --git a/htdocs/admin/multicurrency.php b/htdocs/admin/multicurrency.php index b1ad347d8b71728930dba2e909400bce2d1f02ff..b77606a60ed048475bf128d73a967cbdac5b571b 100644 --- a/htdocs/admin/multicurrency.php +++ b/htdocs/admin/multicurrency.php @@ -136,7 +136,7 @@ if ($resql) * View */ -$page_name = "MultiCurrency"; +$page_name = "MultiCurrencySetup"; llxHeader('', $langs->trans($page_name)); @@ -212,7 +212,7 @@ print '<td align="right" width="400">'; print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="action" value="set_MULTICURRENCY_MODIFY_RATE_APPLICATION">'; -print $form->selectarray('MULTICURRENCY_MODIFY_RATE_APPLICATION', array('PU_DOLIBARR' => 'PU_DOLIBARR', 'PU_CURRENCY' => 'PU_CURRENCY')); +print $form->selectarray('MULTICURRENCY_MODIFY_RATE_APPLICATION', array('PU_DOLIBARR' => 'PU_DOLIBARR', 'PU_CURRENCY' => 'PU_CURRENCY'), $conf->global->MULTICURRENCY_MODIFY_RATE_APPLICATION); print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'; print '</form>'; print '</td></tr>'; @@ -230,6 +230,7 @@ print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">' print '</form>'; print '</td></tr>'; +/* This property seems not used in code, so i comment it $var=!$var; print '<tr '.$bc[$var].'>'; print '<td>'.$langs->transnoentitiesnoconv("multicurrency_currencyFromToRate").'</td>'; @@ -242,6 +243,7 @@ print '<input type="text" name="MULTICURRENCY_FROM_TO_RATE" value="'.$conf->glob print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'; print '</form>'; print '</td></tr>'; +*/ print '</table>'; diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index dea894a025834ec2c596bcb91fafe10c51d44bfe..d05f907882811621b7e55252c416bcc624795ea9 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -911,6 +911,7 @@ if (empty($reshook)) unset($_POST['type']); unset($_POST['remise_percent']); unset($_POST['price_ht']); + unset($_POST['multicurrency_price_ht']); unset($_POST['price_ttc']); unset($_POST['tva_tx']); unset($_POST['product_ref']); @@ -1040,6 +1041,7 @@ if (empty($reshook)) unset($_POST['productid']); unset($_POST['remise_percent']); unset($_POST['price_ht']); + unset($_POST['multicurrency_price_ht']); unset($_POST['price_ttc']); unset($_POST['tva_tx']); unset($_POST['product_ref']); @@ -1325,7 +1327,7 @@ if ($action == 'create') } } else { print '<td colspan="2">'; - print $form->select_company('', 'socid', '(s.client = 1 OR s.client = 2 OR s.client = 3) AND status=1', 1); + print $form->select_company('', 'socid', '(s.client = 1 OR s.client = 2 OR s.client = 3) AND status=1', 'SelectThirdParty'); // reload page to retrieve customer informations if (!empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE)) { @@ -1465,7 +1467,7 @@ if ($action == 'create') print '<td>'.fieldLabel('Currency','multicurrency_code').'</td>'; print '<td colspan="3" class="maxwidthonsmartphone">'; $currency_code = (!empty($soc->multicurrency_code) ? $soc->multicurrency_code : ($object->multicurrency_code ? $object->multicurrency_code : $conf->currency)); - print $form->selectMultiCurrency($currency_code, 'multicurrency_code'); + print $form->selectMultiCurrency($currency_code, 'multicurrency_code', 1); print '</td></tr>'; } @@ -1978,9 +1980,9 @@ if ($action == 'create') print '</tr></table>'; print '</td><td colspan="5">'; if ($action == 'editmulticurrencyrate') { - $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx'); + $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx', $object->multicurrency_code); } else { - $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none'); + $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code); } print '</td></tr>'; } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 9b5c29f55dbc33a547463701cadd86cefbe7974f..db80893f42678bc669f2a7a13a2a49fe60aa9f7b 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -833,6 +833,7 @@ if (empty($reshook)) unset($_POST['type']); unset($_POST['remise_percent']); unset($_POST['price_ht']); + unset($_POST['multicurrency_price_ht']); unset($_POST['price_ttc']); unset($_POST['tva_tx']); unset($_POST['product_ref']); @@ -963,6 +964,7 @@ if (empty($reshook)) unset($_POST['productid']); unset($_POST['remise_percent']); unset($_POST['price_ht']); + unset($_POST['multicurrency_price_ht']); unset($_POST['price_ttc']); unset($_POST['tva_tx']); unset($_POST['product_ref']); @@ -2205,9 +2207,9 @@ if ($action == 'create' && $user->rights->commande->creer) print '</tr></table>'; print '</td><td colspan="5">'; if ($action == 'editmulticurrencyrate') { - $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx'); + $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx', $object->multicurrency_code); } else { - $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none'); + $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code); } print '</td></tr>'; } diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 00498b870a716dcaadbbf5f20e0dda20889df29f..491c4ca041a85c7a1e59b477f6b266c226a9baa4 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1522,6 +1522,7 @@ if (empty($reshook)) unset($_POST['type']); unset($_POST['remise_percent']); unset($_POST['price_ht']); + unset($_POST['multicurrency_price_ht']); unset($_POST['price_ttc']); unset($_POST['tva_tx']); unset($_POST['product_ref']); @@ -1682,6 +1683,7 @@ if (empty($reshook)) unset($_POST['productid']); unset($_POST['remise_percent']); unset($_POST['price_ht']); + unset($_POST['multicurrency_price_ht']); unset($_POST['price_ttc']); unset($_POST['tva_tx']); unset($_POST['product_ref']); @@ -3516,9 +3518,9 @@ else if ($id > 0 || ! empty($ref)) print '</tr></table>'; print '</td><td colspan="3">'; if ($action == 'editmulticurrencyrate') { - $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx'); + $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx', $object->multicurrency_code); } else { - $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none'); + $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code); } print '</td></tr>'; } diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index b38787a4067e6421664c51f05e61b49b9f1f0cd2..36c79c0f7c5c28aa035078ca690c7903e8e7a9e3 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -621,6 +621,7 @@ if (empty($reshook)) unset($_POST['type']); unset($_POST['remise_percent']); unset($_POST['price_ht']); + unset($_POST['multicurrency_price_ht']); unset($_POST['price_ttc']); unset($_POST['tva_tx']); unset($_POST['product_ref']); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 082f362458b6786bc8ec36aa7e5bba8641629fcc..4c32664630ff04ffd330d56bda10b789e0e67991 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -902,7 +902,7 @@ class Form * @param string $selected Preselected type * @param string $htmlname Name of field in form * @param string $filter optional filters criteras (example: 's.rowid <> x', 's.client IN (1,3)') - * @param string $showempty Add an empty field (Can be '1' or text to use on empty line like 'SelectThirdParty') + * @param string $showempty Add an empty field (Can be '1' or text key to use on empty line like 'SelectThirdParty') * @param int $showtype Show third party type in combolist (customer, prospect or supplier) * @param int $forcecombo Force to use combo box * @param array $events Ajax event options to run on change. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) @@ -3779,7 +3779,7 @@ class Form print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">'; print '<tr><td>'; - print $this->selectMultiCurrency($selected,$htmlname); + print $this->selectMultiCurrency($selected, $htmlname, 1); print '</td>'; print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>'; print '</tr></table></form>'; @@ -3797,11 +3797,13 @@ class Form * @param string $page Page * @param double $rate Current rate * @param string $htmlname Name of select html field + * @param string $currency Currency code to explain the rate * @return void */ - function form_multicurrency_rate($page, $rate='', $htmlname='multicurrency_tx') + function form_multicurrency_rate($page, $rate='', $htmlname='multicurrency_tx', $currency='') { - global $langs; + global $langs, $mysoc, $conf; + if ($htmlname != "none") { print '<form method="POST" action="'.$page.'">'; @@ -3816,7 +3818,15 @@ class Form } else { - print !empty($rate) ? price(price2num($rate), 1, $langs) : 1; + if (! empty($rate)) + { + print price($rate, 1, $langs, 1, 0); + if ($currency && $rate != 1) print ' ('.price($rate, 1, $langs, 1, 0).' '.$currency.' = 1 '.$conf->currency.')'; + } + else + { + print 1; + } } } @@ -4030,17 +4040,17 @@ class Form * @param integer $useempty 1=Add empty line * @return string */ - function selectMultiCurrency($selected='',$htmlname='multicurrency_code', $useempty=0) + function selectMultiCurrency($selected='', $htmlname='multicurrency_code', $useempty=0) { global $db,$conf,$langs,$user; - $langs->loadCacheCurrencies(''); + $langs->loadCacheCurrencies(''); // Load ->cache_currencies $TCurrency = array(); $sql = 'SELECT code FROM '.MAIN_DB_PREFIX.'multicurrency'; + $sql.= " WHERE entity IN ('".getEntity('mutlicurrency')."')"; $resql = $db->query($sql); - if ($resql) { while ($obj = $db->fetch_object($resql)) $TCurrency[$obj->code] = $obj->code; @@ -4048,14 +4058,14 @@ class Form $out=''; $out.= '<select class="flat" name="'.$htmlname.'" id="'.$htmlname.'">'; - if ($useempty) $out .= '<option value=""> </option>'; + if ($useempty) $out .= '<option value="'.$conf->currency.'"'.((empty($selected) || $selected == $conf->currency)?' selected="selected"':'').'>'.$langs->cache_currencies[$conf->currency]['label'].'</option>'; if (count($TCurrency) > 0) { foreach ($langs->cache_currencies as $code_iso => $currency) { if (isset($TCurrency[$code_iso])) { - if (!empty($selected) && $selected == $code_iso) $out.= '<option value="'.$code_iso.'" selected>'; + if (!empty($selected) && $selected == $code_iso) $out.= '<option value="'.$code_iso.'" selected="selected">'; else $out.= '<option value="'.$code_iso.'">'; $out.= $currency['label']; @@ -4063,6 +4073,7 @@ class Form $out.= '</option>'; } } + } $out.= '</select>'; diff --git a/htdocs/core/modules/modCategorie.class.php b/htdocs/core/modules/modCategorie.class.php index ad4c2bba16afcbc711d80828a3cec8cbac8add01..17141b6200d0730a0ef1db5372ca4f05289ccf62 100644 --- a/htdocs/core/modules/modCategorie.class.php +++ b/htdocs/core/modules/modCategorie.class.php @@ -45,6 +45,7 @@ class modCategorie extends DolibarrModules $this->numero = 1780; $this->family = "technic"; + $this->module_position = 20; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "Gestion des categories (produits, clients, fournisseurs...)"; @@ -53,7 +54,7 @@ class modCategorie extends DolibarrModules $this->version = 'dolibarr'; $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); - $this->special = 2; + $this->special = 0; $this->picto = 'category'; // Data directories to create when module is enabled diff --git a/htdocs/core/modules/modDocumentGeneration.class.php b/htdocs/core/modules/modDocumentGeneration.class.php index 9111ec11099e2e323c038703e5fa5f15ff2ce52a..0648eb8bf0be310952b5a7066d73068a70ae7e0e 100644 --- a/htdocs/core/modules/modDocumentGeneration.class.php +++ b/htdocs/core/modules/modDocumentGeneration.class.php @@ -45,7 +45,7 @@ class modDocumentGeneration extends DolibarrModules $this->numero = 1520; $this->family = "technic"; - $this->module_position = 10000; + $this->module_position = 80; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "Direct mail document generation"; diff --git a/htdocs/core/modules/modExport.class.php b/htdocs/core/modules/modExport.class.php index cb3d104e096ed4193e63ef39d39d1c2bdee9eb3b..e8a6baa850983e508b20a6709a9e1c98bde79fcf 100644 --- a/htdocs/core/modules/modExport.class.php +++ b/htdocs/core/modules/modExport.class.php @@ -44,7 +44,7 @@ class modExport extends DolibarrModules $this->numero = 240; $this->family = "technic"; - $this->module_position = 520; + $this->module_position = 72; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "Outils d'exports de donnees Dolibarr (via un assistant)"; diff --git a/htdocs/core/modules/modFckeditor.class.php b/htdocs/core/modules/modFckeditor.class.php index 4735b0811a3b051db1346d8e3ea00a7eb00c1a9e..31b3fafff167990db73f86359685d802655572bd 100644 --- a/htdocs/core/modules/modFckeditor.class.php +++ b/htdocs/core/modules/modFckeditor.class.php @@ -45,6 +45,7 @@ class modFckeditor extends DolibarrModules $this->numero = 2000; $this->family = "technic"; + $this->module_position = 20; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "Editeur WYSIWYG"; diff --git a/htdocs/core/modules/modImport.class.php b/htdocs/core/modules/modImport.class.php index 63af9dc90649c5c0fa9b6f9d3613b480ed4f96f7..8f3faad9bd196d6cd1959d70569035caafa90a3d 100644 --- a/htdocs/core/modules/modImport.class.php +++ b/htdocs/core/modules/modImport.class.php @@ -44,7 +44,7 @@ class modImport extends DolibarrModules $this->numero = 250; $this->family = "technic"; - $this->module_position = 510; + $this->module_position = 70; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "Outils d'imports de donnees Dolibarr (via un assistant)"; diff --git a/htdocs/core/modules/modLabel.class.php b/htdocs/core/modules/modLabel.class.php index 0b282584261e5f352e7d9516eeace66c9236d66e..05e98d364545abf007a76f0b003871f1c999783c 100644 --- a/htdocs/core/modules/modLabel.class.php +++ b/htdocs/core/modules/modLabel.class.php @@ -44,6 +44,7 @@ class modLabel extends DolibarrModules $this->numero = 60; $this->family = "technic"; + $this->module_position = 80; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "Gestion des etiquettes"; diff --git a/htdocs/core/modules/modMultiCurrency.class.php b/htdocs/core/modules/modMultiCurrency.class.php index 48ce8bc3bc073b9a2f9b4e1b59a97157eb331a04..7ae613edd49388e80f57031013b77a982bb05b83 100644 --- a/htdocs/core/modules/modMultiCurrency.class.php +++ b/htdocs/core/modules/modMultiCurrency.class.php @@ -52,9 +52,9 @@ class modMultiCurrency extends DolibarrModules // Family can be 'crm','financial','hr','projects','products','ecm','technic','other' // It is used to group modules in module setup page - $this->family = "financial"; + $this->family = "technic"; // Module position in the family - $this->module_position = 555; + $this->module_position = 40; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); diff --git a/htdocs/core/modules/modWebsites.class.php b/htdocs/core/modules/modWebsites.class.php index 8e019fabed82368c13b31c3aa8e5961240041936..e3b500b0e0d25cddeaaff1681f2a0e71b80559a7 100644 --- a/htdocs/core/modules/modWebsites.class.php +++ b/htdocs/core/modules/modWebsites.class.php @@ -46,7 +46,7 @@ class modWebsites extends DolibarrModules // Family can be 'crm','financial','hr','projects','products','ecm','technic','other' // It is used to group modules in module setup page $this->family = "portal"; - $this->module_position = 20; + $this->module_position = 50; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "Enable the public website with CMS features"; diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 8bff36e159e537aac6ee0f5388f31b22f3316eb1..59bc805a120dff9668e6ca6a995ca1c74add3d97 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -472,6 +472,7 @@ if (empty($reshook)) unset($_POST['remise_percent']); unset($_POST['pu']); unset($_POST['price_ht']); + unset($_POST['multicurrency_price_ht']); unset($_POST['price_ttc']); unset($_POST['tva_tx']); unset($_POST['label']); @@ -2027,9 +2028,9 @@ elseif (! empty($object->id)) print '</tr></table>'; print '</td><td colspan="5">'; if ($action == 'editmulticurrencyrate') { - $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx'); + $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx', $object->multicurrency_code); } else { - $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none'); + $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code); } print '</td></tr>'; } diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index d14dd97e6b3f13331141f182a04d688ddd526ee3..08748bef416b4fb843ecf2e63c06a098bfd47b65 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -830,6 +830,7 @@ if (empty($reshook)) unset($_POST['remise_percent']); unset($_POST['pu']); unset($_POST['price_ht']); + unset($_POST['multicurrency_price_ht']); unset($_POST['price_ttc']); unset($_POST['tva_tx']); unset($_POST['label']); @@ -2053,9 +2054,9 @@ else print '</tr></table>'; print '</td><td colspan="3">'; if ($action == 'editmulticurrencyrate') { - $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx'); + $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx', $object->multicurrency_code); } else { - $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none'); + $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code); } print '</td></tr>'; } diff --git a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql index 15de62fb3e873e8f31fb4f2daec47a3801c10ad5..8296aa82e7404a7cefc3b9e4367f53282e83838e 100644 --- a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql +++ b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql @@ -190,8 +190,7 @@ CREATE TABLE llx_multicurrency_rate rowid integer AUTO_INCREMENT PRIMARY KEY, date_sync datetime DEFAULT NULL, rate double NOT NULL DEFAULT 0, - fk_multicurrency integer NOT NULL, - entity integer NOT NULL DEFAULT 1 + fk_multicurrency integer NOT NULL ) ENGINE=innodb; ALTER TABLE llx_societe ADD COLUMN fk_multicurrency integer; diff --git a/htdocs/install/mysql/tables/llx_multicurrency_rate.sql b/htdocs/install/mysql/tables/llx_multicurrency_rate.sql index e6b90382dcdb3a0f6a134ad6a2c24a779078b5f3..333f5deab527953ba989075a67f9221ae98653ec 100644 --- a/htdocs/install/mysql/tables/llx_multicurrency_rate.sql +++ b/htdocs/install/mysql/tables/llx_multicurrency_rate.sql @@ -22,6 +22,5 @@ CREATE TABLE llx_multicurrency_rate rowid integer AUTO_INCREMENT PRIMARY KEY, date_sync datetime DEFAULT NULL, rate double NOT NULL DEFAULT 0, - fk_multicurrency integer NOT NULL, - entity integer DEFAULT 1 + fk_multicurrency integer NOT NULL ) ENGINE=innodb; \ No newline at end of file diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 3468dc43eee613f72f7746eb23aa0f2023debfb5..b37083ca0912a0ad3d8eb9c02805b79cb4017d2b 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -99,6 +99,7 @@ AntiVirusParamExample= Example for ClamWin: --database="C:\Program Files (x86)\C ComptaSetup=Accounting module setup UserSetup=User management setup MenuSetup=Menu management setup +MultiCurrencySetup=Multi-currency setup MenuLimits=Limits and accuracy MenuIdParent=Parent menu ID DetailMenuIdParent=ID of parent menu (empty for a top menu) diff --git a/htdocs/langs/en_US/receiptprinter.lang b/htdocs/langs/en_US/receiptprinter.lang index 7b52f072eaf0b6f398c0f3fb257aa60c64a6894d..189a8f25e3839fe2a22553202d9fc1cfedca5f49 100644 --- a/htdocs/langs/en_US/receiptprinter.lang +++ b/htdocs/langs/en_US/receiptprinter.lang @@ -5,7 +5,7 @@ PrinterUpdated=Printer %s updated PrinterDeleted=Printer %s deleted TestSentToPrinter=Test Sent To Printer %s ReceiptPrinter=Receipt printers -ReceiptPrinterDesc=Setup of printers +ReceiptPrinterDesc=Setup of receipt printers ReceiptPrinterTemplateDesc=Setup of Templates ReceiptPrinterTypeDesc=Description of Receipt Printer's type ReceiptPrinterProfileDesc=Description of Receipt Printer's Profile diff --git a/htdocs/multicurrency/class/multicurrency.class.php b/htdocs/multicurrency/class/multicurrency.class.php index fd6da3816ea55553dfea0ab25bb8ae59871e49a7..834d5b38605d319995fb1dcf42d443d3681877e5 100644 --- a/htdocs/multicurrency/class/multicurrency.class.php +++ b/htdocs/multicurrency/class/multicurrency.class.php @@ -471,7 +471,9 @@ class MultiCurrency extends CommonObject { $sql = 'SELECT m.rowid, mc.rate FROM '.MAIN_DB_PREFIX.'multicurrency m'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'multicurrency_rate mc ON (m.rowid = mc.fk_multicurrency)'; + // FIXME Is this comptible with SQL ? $sql.= ' WHERE m.code = "'.$db->escape($code).'" AND mc.date_sync >= ALL (SELECT date_sync FROM '.MAIN_DB_PREFIX.'multicurrency_rate)'; + $sql.= " AND m.entity IN '".getEntity('multicurrency', 1)."'"; $resql = $db->query($sql); if ($resql && $obj = $db->fetch_object($resql)) return array($obj->rowid, $obj->rate); else return array(0, 1); diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index be07d022fdb68dad512344d174d83ebb13c87113..9101b6efda2eea6d79af1f16bdd29cf36b6565ce 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -717,6 +717,7 @@ if (empty($reshook)) unset($_POST['type']); unset($_POST['remise_percent']); unset($_POST['price_ht']); + unset($_POST['multicurrency_price_ht']); unset($_POST['price_ttc']); unset($_POST['tva_tx']); unset($_POST['product_ref']); @@ -841,6 +842,7 @@ if (empty($reshook)) unset($_POST['productid']); unset($_POST['remise_percent']); unset($_POST['price_ht']); + unset($_POST['multicurrency_price_ht']); unset($_POST['price_ttc']); unset($_POST['tva_tx']); unset($_POST['product_ref']); @@ -1549,9 +1551,9 @@ if ($action == 'create') print '</tr></table>'; print '</td><td colspan="3">'; if ($action == 'editmulticurrencyrate') { - $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx'); + $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx', $object->multicurrency_code); } else { - $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none'); + $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code); } print '</td></tr>'; }