From: <dai...@us...> - 2011-09-19 09:38:27
|
Revision: 4696 http://web-erp.svn.sourceforge.net/web-erp/?rev=4696&view=rev Author: daintree Date: 2011-09-19 09:38:20 +0000 (Mon, 19 Sep 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/BankReconciliation.php trunk/includes/LanguageSetup.php trunk/sql/mysql/upgrade4.05-4.06.sql Modified: trunk/BankReconciliation.php =================================================================== --- trunk/BankReconciliation.php 2011-09-18 01:22:23 UTC (rev 4695) +++ trunk/BankReconciliation.php 2011-09-19 09:38:20 UTC (rev 4696) @@ -17,13 +17,17 @@ $_POST['ShowRec']=true; } +if (isset($_POST['BankStatementBalance'])){ + $_POST['BankStatementBalance'] = filter_number_format($_POST['BankStatementBalance']); +} + if (isset($_POST['PostExchangeDifference']) and is_numeric($_POST['DoExchangeDifference'])){ - if (!is_numeric(filter_number_format($_POST['BankStatementBalance']))){ + if (!is_numeric($_POST['BankStatementBalance'])){ prnMsg(_('The entry in the bank statement balance is not numeric. The balance on the bank statement should be entered. The exchange difference has not been calculated and no general ledger journal has been created'),'warn'); echo '<p>' . $_POST['BankStatementBalance']; } else { - $_POST['BankStatementBalance'] = filter_number_format($_POST['BankStatementBalance']); + /* Now need to get the currency of the account and the current table ex rate */ $SQL = "SELECT rate, bankaccountname, Modified: trunk/includes/LanguageSetup.php =================================================================== --- trunk/includes/LanguageSetup.php 2011-09-18 01:22:23 UTC (rev 4695) +++ trunk/includes/LanguageSetup.php 2011-09-19 09:38:20 UTC (rev 4696) @@ -4,7 +4,7 @@ /* Set internal character encoding to UTF-8 */ mb_internal_encoding('UTF-8'); -include('includes/LanguagesArray.php'); + /* This file is included in session.inc or PDFStarter.php or a report script that does not use PDFStarter.php to check for the existance of gettext function and setup the necessary enviroment to allow for automatic translation @@ -24,40 +24,9 @@ $Language = $_SESSION['Language']; } -if (defined('LC_MESSAGES')){ //it's a unix/linux server - $Locale = setlocale (LC_MESSAGES, $_SESSION['Language']); - $Locale = setlocale (LC_NUMERIC, $_SESSION['Language']); -} else { // it's a windows server - $Locale = setlocale (LC_ALL, $LanguageArray[$_SESSION['Language']]['WindowsLocale']); -} -$Locale = setlocale (LC_NUMERIC, 'fr_FR.utf8'); - -$LocaleInfo = localeconv(); -if ($LocaleInfo['mon_decimal_point']==''){ - $LocaleInfo['mon_decimal_point']= $LocaleInfo['decimal_point']; -} -if ($LocaleInfo['mon_thousands_sep']==''){ - $LocaleInfo['mon_thousands_sep']= $LocaleInfo['thousands_sep']; -} - - - -//Turkish seems to be a special case -if ($_SESSION['Language']=='tr_TR.utf8') { - $Locale = setlocale(LC_CTYPE, 'C'); -} - - -if (function_exists('gettext')){ - - // possibly even if locale fails the language will still switch by using Language instead of locale variable - putenv('LANG=' . $_SESSION['Language']); - putenv('LANGUAGE=' . $_SESSION['Language']); - bindtextdomain ('messages', $PathPrefix . 'locale'); - textdomain ('messages'); - bind_textdomain_codeset('messages', 'UTF-8'); - -} else { +/*Since LanguagesArray requires the function _() to translate the language names - we must provide a substitute if it doesn't exist aready before we include includes/LanguagesArray.php + * */ +if (!function_exists('gettext')) { /* PHPGettext integration by Braian Gomez http://www.vairux.com/ @@ -91,7 +60,40 @@ return $text; } } - $LocaleInfo = localeconv(); } +include('includes/LanguagesArray.php'); + +if (defined('LC_MESSAGES')){ //it's a unix/linux server + $Locale = setlocale (LC_MESSAGES, $_SESSION['Language']); + $Locale = setlocale (LC_NUMERIC, $_SESSION['Language']); +} else { // it's a windows server + $Locale = setlocale (LC_ALL, $LanguageArray[$_SESSION['Language']]['WindowsLocale']); +} + +//for testing number_formats $Locale = setlocale (LC_NUMERIC, 'fr_FR.utf8'); + +$LocaleInfo = localeconv(); +if ($LocaleInfo['mon_decimal_point']==''){ + $LocaleInfo['mon_decimal_point']= $LocaleInfo['decimal_point']; +} +if ($LocaleInfo['mon_thousands_sep']==''){ + $LocaleInfo['mon_thousands_sep']= $LocaleInfo['thousands_sep']; +} + +//Turkish seems to be a special case +if ($_SESSION['Language']=='tr_TR.utf8') { + $Locale = setlocale(LC_CTYPE, 'C'); +} + +if (function_exists('gettext')){ + + // possibly even if locale fails the language will still switch by using Language instead of locale variable + putenv('LANG=' . $_SESSION['Language']); + putenv('LANGUAGE=' . $_SESSION['Language']); + bindtextdomain ('messages', $PathPrefix . 'locale'); + textdomain ('messages'); + bind_textdomain_codeset('messages', 'UTF-8'); +} + ?> Modified: trunk/sql/mysql/upgrade4.05-4.06.sql =================================================================== --- trunk/sql/mysql/upgrade4.05-4.06.sql 2011-09-18 01:22:23 UTC (rev 4695) +++ trunk/sql/mysql/upgrade4.05-4.06.sql 2011-09-19 09:38:20 UTC (rev 4696) @@ -2,4 +2,5 @@ ALTER TABLE stockmaster ADD lastcostupdate DATE NOT NULL; INSERT INTO `config` (`confname` ,`confvalue`) VALUES ('InventoryManagerEmail', ''); +ALTER TABLE `banktrans` ADD INDEX ( `ref` ); UPDATE config SET confvalue='4.05.2' WHERE confname='VersionNumber'; \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |