From: <dai...@us...> - 2011-09-10 04:52:27
|
Revision: 4684 http://web-erp.svn.sourceforge.net/web-erp/?rev=4684&view=rev Author: daintree Date: 2011-09-10 04:52:21 +0000 (Sat, 10 Sep 2011) Log Message: ----------- number formatting Modified Paths: -------------- trunk/PcAssignCashToTab.php Modified: trunk/PcAssignCashToTab.php =================================================================== --- trunk/PcAssignCashToTab.php 2011-09-10 04:39:18 UTC (rev 4683) +++ trunk/PcAssignCashToTab.php 2011-09-10 04:52:21 UTC (rev 4684) @@ -18,9 +18,9 @@ } if (isset($_POST['Days'])){ - $Days = $_POST['Days']; + $Days = filter_number_format($_POST['Days']); } elseif (isset($_GET['Days'])){ - $Days = $_GET['Days']; + $Days = filter_number_format($_GET['Days']); } if (isset($_POST['Cancel'])) { @@ -80,10 +80,10 @@ $sql = "UPDATE pcashdetails SET date = '".FormatDateForSQL($_POST['Date'])."', - amount = '" . $_POST['Amount'] . "', + amount = '" . filter_number_format($_POST['Amount']) . "', authorized = '0000-00-00', - notes = '" . $_POST['Notes'] . "', - receipt = '" . $_POST['Receipt'] . "' + notes = '" . DB_escape_string($_POST['Notes']) . "', + receipt = '" . DB_escape_string($_POST['Receipt']) . "' WHERE counterindex = '" . $SelectedIndex . "'"; $msg = _('Assignment of cash to PC Tab ') . ' ' . $SelectedTabs . ' ' . _('has been updated'); @@ -103,11 +103,11 @@ '" . $_POST['SelectedTabs'] . "', '".FormatDateForSQL($_POST['Date'])."', 'ASSIGNCASH', - '" .$_POST['Amount'] . "', + '" . filter_number_format($_POST['Amount']) . "', authorized = '0000-00-00', '0', - '" . $_POST['Notes'] . "', - '" . $_POST['Receipt'] . "' + '" . DB_escape_string($_POST['Notes']) . "', + '" . DB_escape_string($_POST['Receipt']) . "' )"; $msg = _('Assignment of cash to PC Tab ') . ' ' . $_POST['SelectedTabs'] . ' ' . _('has been created'); } @@ -247,7 +247,7 @@ // only cash assignations NOT authorized can be modified or deleted echo '<td>' . ConvertSQLDate($myrow['date']) . '</td> <td>' . $Description['0'] . '</td> - <td class=number>' . locale_number_format($myrow['amount'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class=number>' . locale_money_format($myrow['amount'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td>' . ConvertSQLDate($myrow['authorized']) . '</td> <td>' . $myrow['notes'] . '</td> <td>' . $myrow['receipt'] . '</td> @@ -261,7 +261,7 @@ }else{ echo '<td>' . ConvertSQLDate($myrow['date']) . '</td> <td>' . $Description['0'] . '</td> - <td class=number>' . locale_number_format($myrow['amount'],$_SESSION['CompanyRecord']['decimalplaces']).'</td> + <td class=number>' . locale_money_format($myrow['amount'],$_SESSION['CompanyRecord']['decimalplaces']).'</td> <td>' . ConvertSQLDate($myrow['authorized']) . '</td> <td>' . $myrow['notes'] . '</td> <td>' . $myrow['receipt'] . '</td> @@ -282,7 +282,7 @@ } echo '<tr><td colspan="2" style="text-align:right"><b>' . _('Current balance') . ':</b></td> - <td>' . locale_number_format($Amount['0'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; + <td>' . locale_money_format($Amount['0'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; echo '</table>'; @@ -319,7 +319,7 @@ echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '">'; echo '<input type=hidden name="SelectedIndex" value="' . $SelectedIndex. '">'; echo '<input type=hidden name="CurrentAmount" value="' . $Amount[0]. '">'; - echo '<input type=hidden name="Days" value="' .$Days. '">'; + echo '<input type=hidden name="Days" value="' . $Days . '">'; } /* Ricard: needs revision of this date initialization */ @@ -359,8 +359,8 @@ echo '</td></tr></table>'; // close main table - echo '<p><div class="centre"><input type=submit name=submit value="' . _('Accept') . '"> - <input type=submit name=Cancel value="' . _('Cancel') . '"></div>'; + echo '<p><div class="centre"><input type="submit" name="submit" value="' . _('Accept') . '"> + <input type="submit" name="Cancel" value="' . _('Cancel') . '"></div>'; echo '</form>'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-09-10 04:52:27
|
Revision: 4684 http://web-erp.svn.sourceforge.net/web-erp/?rev=4684&view=rev Author: daintree Date: 2011-09-10 04:52:21 +0000 (Sat, 10 Sep 2011) Log Message: ----------- number formatting Modified Paths: -------------- trunk/PcAssignCashToTab.php Modified: trunk/PcAssignCashToTab.php =================================================================== --- trunk/PcAssignCashToTab.php 2011-09-10 04:39:18 UTC (rev 4683) +++ trunk/PcAssignCashToTab.php 2011-09-10 04:52:21 UTC (rev 4684) @@ -18,9 +18,9 @@ } if (isset($_POST['Days'])){ - $Days = $_POST['Days']; + $Days = filter_number_format($_POST['Days']); } elseif (isset($_GET['Days'])){ - $Days = $_GET['Days']; + $Days = filter_number_format($_GET['Days']); } if (isset($_POST['Cancel'])) { @@ -80,10 +80,10 @@ $sql = "UPDATE pcashdetails SET date = '".FormatDateForSQL($_POST['Date'])."', - amount = '" . $_POST['Amount'] . "', + amount = '" . filter_number_format($_POST['Amount']) . "', authorized = '0000-00-00', - notes = '" . $_POST['Notes'] . "', - receipt = '" . $_POST['Receipt'] . "' + notes = '" . DB_escape_string($_POST['Notes']) . "', + receipt = '" . DB_escape_string($_POST['Receipt']) . "' WHERE counterindex = '" . $SelectedIndex . "'"; $msg = _('Assignment of cash to PC Tab ') . ' ' . $SelectedTabs . ' ' . _('has been updated'); @@ -103,11 +103,11 @@ '" . $_POST['SelectedTabs'] . "', '".FormatDateForSQL($_POST['Date'])."', 'ASSIGNCASH', - '" .$_POST['Amount'] . "', + '" . filter_number_format($_POST['Amount']) . "', authorized = '0000-00-00', '0', - '" . $_POST['Notes'] . "', - '" . $_POST['Receipt'] . "' + '" . DB_escape_string($_POST['Notes']) . "', + '" . DB_escape_string($_POST['Receipt']) . "' )"; $msg = _('Assignment of cash to PC Tab ') . ' ' . $_POST['SelectedTabs'] . ' ' . _('has been created'); } @@ -247,7 +247,7 @@ // only cash assignations NOT authorized can be modified or deleted echo '<td>' . ConvertSQLDate($myrow['date']) . '</td> <td>' . $Description['0'] . '</td> - <td class=number>' . locale_number_format($myrow['amount'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class=number>' . locale_money_format($myrow['amount'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td>' . ConvertSQLDate($myrow['authorized']) . '</td> <td>' . $myrow['notes'] . '</td> <td>' . $myrow['receipt'] . '</td> @@ -261,7 +261,7 @@ }else{ echo '<td>' . ConvertSQLDate($myrow['date']) . '</td> <td>' . $Description['0'] . '</td> - <td class=number>' . locale_number_format($myrow['amount'],$_SESSION['CompanyRecord']['decimalplaces']).'</td> + <td class=number>' . locale_money_format($myrow['amount'],$_SESSION['CompanyRecord']['decimalplaces']).'</td> <td>' . ConvertSQLDate($myrow['authorized']) . '</td> <td>' . $myrow['notes'] . '</td> <td>' . $myrow['receipt'] . '</td> @@ -282,7 +282,7 @@ } echo '<tr><td colspan="2" style="text-align:right"><b>' . _('Current balance') . ':</b></td> - <td>' . locale_number_format($Amount['0'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; + <td>' . locale_money_format($Amount['0'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; echo '</table>'; @@ -319,7 +319,7 @@ echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '">'; echo '<input type=hidden name="SelectedIndex" value="' . $SelectedIndex. '">'; echo '<input type=hidden name="CurrentAmount" value="' . $Amount[0]. '">'; - echo '<input type=hidden name="Days" value="' .$Days. '">'; + echo '<input type=hidden name="Days" value="' . $Days . '">'; } /* Ricard: needs revision of this date initialization */ @@ -359,8 +359,8 @@ echo '</td></tr></table>'; // close main table - echo '<p><div class="centre"><input type=submit name=submit value="' . _('Accept') . '"> - <input type=submit name=Cancel value="' . _('Cancel') . '"></div>'; + echo '<p><div class="centre"><input type="submit" name="submit" value="' . _('Accept') . '"> + <input type="submit" name="Cancel" value="' . _('Cancel') . '"></div>'; echo '</form>'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ex...@us...> - 2013-05-09 09:47:29
|
Revision: 5896 http://sourceforge.net/p/web-erp/reponame/5896 Author: exsonqu Date: 2013-05-09 09:47:22 +0000 (Thu, 09 May 2013) Log Message: ----------- 9/05/2013 Exson Fixed the hard coded date format in PcAssignCashToTab.php which leads to malfunction for other date format, reported by Thump. Modified Paths: -------------- trunk/PcAssignCashToTab.php Modified: trunk/PcAssignCashToTab.php =================================================================== --- trunk/PcAssignCashToTab.php 2013-05-09 04:33:34 UTC (rev 5895) +++ trunk/PcAssignCashToTab.php 2013-05-09 09:47:22 UTC (rev 5896) @@ -342,7 +342,7 @@ /* Ricard: needs revision of this date initialization */ if (!isset($_POST['Date'])) { - $_POST['Date']=Date('d/m/Y'); + $_POST['Date']=Date($_SESSION['DefaultDateFormat']); } echo '<br /><table class="selection">'; //Main table @@ -398,4 +398,4 @@ } include('includes/footer.inc'); -?> \ No newline at end of file +?> |
From: <te...@us...> - 2015-11-26 01:03:51
|
Revision: 7399 http://sourceforge.net/p/web-erp/reponame/7399 Author: tehonu Date: 2015-11-26 01:03:48 +0000 (Thu, 26 Nov 2015) Log Message: ----------- Enforce the Petty cash tab cash limit when assigning new cash Modified Paths: -------------- trunk/PcAssignCashToTab.php Modified: trunk/PcAssignCashToTab.php =================================================================== --- trunk/PcAssignCashToTab.php 2015-11-24 08:50:28 UTC (rev 7398) +++ trunk/PcAssignCashToTab.php 2015-11-26 01:03:48 UTC (rev 7399) @@ -68,17 +68,28 @@ prnMsg('<br />' . _('The Amount must be input'),'error'); } - $sqlLimit = "SELECT tablimit - FROM pctabs - WHERE tabcode='" . $SelectedTabs . "'"; + $sqlLimit = "SELECT pctabs.tablimit, + pctabs.currency, + currencies.decimalplaces + FROM pctabs, + currencies + WHERE pctabs.currency = currencies.currabrev + AND pctabs.tabcode='" . $SelectedTabs . "'"; $ResultLimit = DB_query($sqlLimit); $Limit=DB_fetch_array($ResultLimit); - if (($_POST['CurrentAmount']+$_POST['Amount'])>$Limit['tablimit']){ - prnMsg(_('The balance after this assignment would be greater than the specified limit for this PC tab'),'warning'); + if (($_POST['CurrentAmount'])>$Limit['tablimit']){ + $InputError = 1; + prnMsg(_('Cash NOT assigned because PC tab current balance is over its cash limit of') . ' ' . locale_number_format($Limit['tablimit'],$Limit['decimalplaces']) . ' ' . $Limit['currency'],'error'); + prnMsg(_('Report expenses before being allowed to assign more cash or ask the administrator to increase the limit'),'error'); } + if ($InputError !=1 AND (($_POST['CurrentAmount']+$_POST['Amount'])>$Limit['tablimit'])){ + prnMsg(_('Cash assigned but PC tab current balance is over its cash limit of') . ' ' . locale_number_format($Limit['tablimit'],$Limit['decimalplaces']) . ' ' . $Limit['currency'],'warning'); + prnMsg(_('Report expenses before being allowed to assign more cash or ask the administrator to increase the limit'),'warning'); + } + if ($InputError !=1 AND isset($SelectedIndex) ) { $sql = "UPDATE pcashdetails |