From: <Ex...@us...> - 2012-05-14 02:05:32
|
Revision: 5351 http://web-erp.svn.sourceforge.net/web-erp/?rev=5351&view=rev Author: ExsonQu Date: 2012-05-14 02:05:25 +0000 (Mon, 14 May 2012) Log Message: ----------- 14/5/2012 Exson: Fixed when user change the currency, the suggested rate can not changed accordingly in CustomerReceipt.php. Reported by Ahmed.Fawzy. 14/5/2012 Ahmed.Fawzy: Fixed bugs that ExchangRateText be applied with locale_number_format() function in CustomerReceipt.php Modified Paths: -------------- trunk/CustomerReceipt.php Modified: trunk/CustomerReceipt.php =================================================================== --- trunk/CustomerReceipt.php 2012-05-14 01:42:49 UTC (rev 5350) +++ trunk/CustomerReceipt.php 2012-05-14 02:05:25 UTC (rev 5351) @@ -824,17 +824,19 @@ } if ($_SESSION['ReceiptBatch']->AccountCurrency!=$_SESSION['ReceiptBatch']->Currency AND isset($_SESSION['ReceiptBatch']->AccountCurrency)){ if (isset($SuggestedExRate)){ - $SuggestedExRateText = '<b>' . _('Suggested rate:') . ' ' . locale_number_format($SuggestedExRate,4) . '</b>'; + $SuggestedExRateText = '<b>' . _('Suggested rate:') . ' ' . locale_number_format($SuggestedExRate,6) . '</b>'; } else { $SuggestedExRateText =''; } if ($_SESSION['ReceiptBatch']->ExRate==1 AND isset($SuggestedExRate)){ $_SESSION['ReceiptBatch']->ExRate = $SuggestedExRate; + }elseif($_POST['Currency'] != $_POST['PreviousCurrency'] and isset($SuggestedExRate)){//the user has changed the currency, then we should revise suggested rate + $_SESSION['ReceiptBatch']->ExRate = $SuggestedExRate; } echo '<tr> <td>' . _('Receipt Exchange Rate') . ':</td> <td><input tabindex="4" type="text" name="ExRate" maxlength="10" size="12" class="number" value="' . locale_number_format($_SESSION['ReceiptBatch']->ExRate,6) . '" /></td> - <td>' . locale_number_format($SuggestedExRateText,6) . ' <i>' . _('The exchange rate between the currency of the bank account currency and the currency of the receipt') . '. 1 ' . $_SESSION['ReceiptBatch']->AccountCurrency . ' = ? ' . $_SESSION['ReceiptBatch']->Currency . '</i></td> + <td>' . $SuggestedExRateText . ' <i>' . _('The exchange rate between the currency of the bank account currency and the currency of the receipt') . '. 1 ' . $_SESSION['ReceiptBatch']->AccountCurrency . ' = ? ' . $_SESSION['ReceiptBatch']->Currency . '</i></td> </tr>'; } @@ -878,6 +880,7 @@ <td>' . _('Narrative') . ':</td> <td><input tabindex="7" type="text" name="BatchNarrative" maxlength="50" size="52" value="' . $_SESSION['ReceiptBatch']->Narrative . '" /></td> </tr> + <input type="hidden" name="PreviousCurrency" value="' . $_POST['Currency'] . '" /> <tr> <td colspan="3"> <div class="centre"> @@ -1174,4 +1177,4 @@ echo '</div>'; echo '</form>'; include('includes/footer.inc'); -?> \ No newline at end of file +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |