From: <te...@us...> - 2013-05-09 04:33:38
|
Revision: 5895 http://sourceforge.net/p/web-erp/reponame/5895 Author: tehonu Date: 2013-05-09 04:33:34 +0000 (Thu, 09 May 2013) Log Message: ----------- Pak Ricard: Flag to indicate the weberp CART (Mo's or any other) to show or hide the currency at the web cart. Internal webERP functionality does not change. Modified Paths: -------------- trunk/Currencies.php trunk/sql/mysql/upgrade4.10-4.11.sql Modified: trunk/Currencies.php =================================================================== --- trunk/Currencies.php 2013-05-08 02:04:32 UTC (rev 5894) +++ trunk/Currencies.php 2013-05-09 04:33:34 UTC (rev 5895) @@ -117,7 +117,8 @@ country='". $_POST['Country']. "', hundredsname='" . $_POST['HundredsName'] . "', decimalplaces='" . filter_number_format($_POST['DecimalPlaces']) . "', - rate='" .filter_number_format($_POST['ExchangeRate']) . "' + rate='" .filter_number_format($_POST['ExchangeRate']) . "', + webcart='" .$_POST['webcart'] . "' WHERE currabrev = '" . $SelectedCurrency . "'"; $msg = _('The currency definition record has been updated'); @@ -129,13 +130,15 @@ country, hundredsname, decimalplaces, - rate) + rate, + webcart) VALUES ('" . $_POST['CurrencyName'] . "', '" . $_POST['Abbreviation'] . "', '" . $_POST['Country'] . "', '" . $_POST['HundredsName'] . "', '" . filter_number_format($_POST['DecimalPlaces']) . "', - '" . filter_number_format($_POST['ExchangeRate']) . "')"; + '" . filter_number_format($_POST['ExchangeRate']) . "', + '" . $_POST['webcart'] . "')"; $msg = _('The currency definition record has been added'); } @@ -151,6 +154,7 @@ unset($_POST['DecimalPlaces']); unset($_POST['ExchangeRate']); unset($_POST['Abbreviation']); + unset($_POST['webcart']); } elseif (isset($_GET['delete'])) { //the link to delete a selected record was clicked instead of the submit button @@ -206,7 +210,8 @@ country, hundredsname, rate, - decimalplaces + decimalplaces, + webcart FROM currencies"; $result = DB_query($sql, $db); @@ -218,6 +223,7 @@ <th>' . _('Country') . '</th> <th>' . _('Hundredths Name') . '</th> <th>' . _('Decimal Places') . '</th> + <th>' . _('Use in webCART') .'</th> <th>' . _('Exchange Rate') . '</th> <th>' . _('1 / Ex Rate') . '</th> <th>' . _('Ex Rate - ECB') .'</th> @@ -247,6 +253,11 @@ if(!file_exists($ImageFile)){ $ImageFile = 'flags/blank.gif'; } + if ($myrow['webcart'] == 1) { + $ShowInWebText = _('Yes'); + } else { + $ShowInWebText = _('No'); + } if ($myrow[1]!=$FunctionalCurrency){ printf('<td><img src="%s" alt="" /></td> @@ -255,6 +266,7 @@ <td>%s</td> <td>%s</td> <td class="number">%s</td> + <td>%s</td> <td class="number">%s</td> <td class="number">%s</td> <td class="number">%s</td> @@ -268,6 +280,7 @@ $myrow['country'], $myrow['hundredsname'], locale_number_format($myrow['decimalplaces'],0), + $ShowInWebText, locale_number_format($myrow['rate'],8), locale_number_format(1/$myrow['rate'],2), locale_number_format(GetCurrencyRate($myrow['currabrev'],$CurrencyRatesArray),8), @@ -286,7 +299,7 @@ <td>%s</td> <td>%s</td> <td class="number">%s</td> - <td class="number">%s</td> + <td>%s</td> <td colspan="5">%s</td> </tr>', $ImageFile, @@ -295,6 +308,7 @@ $myrow['country'], $myrow['hundredsname'], locale_number_format($myrow['decimalplaces'],0), + $ShowInWebText, 1, _('Functional Currency')); } @@ -325,7 +339,8 @@ country, hundredsname, decimalplaces, - rate + rate, + webcart FROM currencies WHERE currabrev='" . $SelectedCurrency . "'"; @@ -340,9 +355,8 @@ $_POST['HundredsName'] = $myrow['hundredsname']; $_POST['ExchangeRate'] = locale_number_format($myrow['rate'],8); $_POST['DecimalPlaces'] = locale_number_format($myrow['decimalplaces'],0); + $_POST['webcart'] = $myrow['webcart']; - - echo '<input type="hidden" name="SelectedCurrency" value="' . $SelectedCurrency . '" />'; echo '<input type="hidden" name="Abbreviation" value="' . $_POST['Abbreviation'] . '" />'; echo '<table class="selection"> @@ -399,9 +413,30 @@ $_POST['ExchangeRate']=''; } echo '<input ' . (in_array('ExchangeRate',$Errors) ? 'class="inputerror"' : '' ) .' type="text" class="number" name="ExchangeRate" size="10" maxlength="10" value="' . $_POST['ExchangeRate'] . '" /></td> - </tr> - </table>'; + </tr>'; + if (!isset($_POST['webcart'])) { + $_POST['webcart']=1; + } + + echo '<tr> + <td>' . _('Show in webERP Cart?') . ':</td> + <td><select name="webcart">'; + + if ($_POST['webcart']==1){ + echo '<option selected="selected" value="1">' . _('Yes') . '</option>'; + } else { + echo '<option value="1">' . _('Yes') . '</option>'; + } + if ($_POST['webcart']==0){ + echo '<option selected="selected" value="0">' . _('No') . '</option>'; + } else { + echo '<option value="0">' . _('No') . '</option>'; + } + + + echo '</table>'; + echo '<br /> <div class="centre"> <input type="submit" name="submit" value="' . _('Enter Information') . '" /> Modified: trunk/sql/mysql/upgrade4.10-4.11.sql =================================================================== --- trunk/sql/mysql/upgrade4.10-4.11.sql 2013-05-08 02:04:32 UTC (rev 5894) +++ trunk/sql/mysql/upgrade4.10-4.11.sql 2013-05-09 04:33:34 UTC (rev 5895) @@ -14,3 +14,6 @@ INSERT INTO `scripts` (`script` , `pagesecurity` , `description`) VALUES ('Z_ChangeGLAccountCode.php', '15', 'Script to change a GL account code accross all tables necessary'); + +ALTER TABLE `currencies` ADD `webcart` TINYINT( 1 ) NOT NULL DEFAULT '1' COMMENT 'If 1 shown in weberp cart. if 0 no show'; + |