From: <dai...@us...> - 2011-09-16 10:29:32
|
Revision: 4691 http://web-erp.svn.sourceforge.net/web-erp/?rev=4691&view=rev Author: daintree Date: 2011-09-16 10:29:26 +0000 (Fri, 16 Sep 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/PDFSuppTransListing.php trunk/PDFTopItems.php trunk/PO_AuthorisationLevels.php Modified: trunk/PDFSuppTransListing.php =================================================================== --- trunk/PDFSuppTransListing.php 2011-09-14 09:57:45 UTC (rev 4690) +++ trunk/PDFSuppTransListing.php 2011-09-16 10:29:26 UTC (rev 4691) @@ -26,7 +26,7 @@ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class=selection> + echo '<table class="selection"> <tr> <td>' . _('Enter the date for which the transactions are to be listed') . ':</td> <td><input type="text" name="Date" maxlength="10" size="10" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> @@ -59,8 +59,14 @@ trandate, ovamount, ovgst, - transtext - FROM supptrans + transtext, + currcode, + decimalplaces AS currdecimalplaces, + suppname + FROM supptrans INNER JOIN suppliers + ON supptrans.supplierno = suppliers.supplierno + INNER JOIN currencies + ON suppliers.currcode=currencies.currabrev WHERE type='" . $_POST['TransType'] . "' AND date_format(inputdate, '%Y-%m-%d')='".FormatDateForSQL($_POST['Date'])."'"; @@ -97,17 +103,13 @@ include ('includes/PDFSuppTransListingPageHeader.inc'); while ($myrow=DB_fetch_array($result)){ - - $sql="SELECT suppname FROM suppliers WHERE supplierid='" . $myrow['supplierno']."'"; - $supplierresult=DB_query($sql, $db); - $supplierrow=DB_fetch_array($supplierresult); - - $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,160,$FontSize,$supplierrow['suppname'], 'left'); + $CurrDecimalPlaces = $myrow['currdecimalplaces']; + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,160,$FontSize,$myrow['suppname'], 'left'); $LeftOvers = $pdf->addTextWrap($Left_Margin+162,$YPos,80,$FontSize,$myrow['suppreference'], 'left'); $LeftOvers = $pdf->addTextWrap($Left_Margin+242,$YPos,70,$FontSize,ConvertSQLDate($myrow['trandate']), 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+312,$YPos,70,$FontSize,locale_number_format($myrow['ovamount'],2), 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+382,$YPos,70,$FontSize,locale_number_format($myrow['ovgst'],2), 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,locale_number_format($myrow['ovamount']+$myrow['ovgst'],2), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+312,$YPos,70,$FontSize,locale_money_format($myrow['ovamount'],$CurrDecimalPlaces), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+382,$YPos,70,$FontSize,locale_money_format($myrow['ovgst'],$CurrDecimalPlaces), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,locale_money_format($myrow['ovamount']+$myrow['ovgst'],$CurrDecimalPlaces), 'right'); $YPos -= ($line_height); $TotalCheques = $TotalCheques - $myrow['ovamount']; @@ -121,10 +123,10 @@ $YPos-=$line_height; -$LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,locale_number_format(-$TotalCheques,2), 'right'); +$LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,locale_money_format(-$TotalCheques,$CurrDecimalPlaces), 'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin+265,$YPos,300,$FontSize,_('Total') . ' ' . _('Transactions'), 'left'); $ReportFileName = $_SESSION['DatabaseName'] . '_SuppTransListing_' . date('Y-m-d').'.pdf'; $pdf->OutputD($ReportFileName); -$pdf->__destruct(); +$pdf->__destruct(); ?> \ No newline at end of file Modified: trunk/PDFTopItems.php =================================================================== --- trunk/PDFTopItems.php 2011-09-14 09:57:45 UTC (rev 4690) +++ trunk/PDFTopItems.php 2011-09-16 10:29:26 UTC (rev 4691) @@ -40,10 +40,10 @@ AND salesorderdetails.stkcode = stockmaster.stockid AND salesorders.debtorno = debtorsmaster.debtorno AND debtorsmaster.typeid = '" . $_GET['Customers'] . "' - AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' + AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' GROUP BY salesorderdetails.stkcode ORDER BY " . $_GET['Sequence'] . " DESC - LIMIT " . $_GET['NumberOfTopItems']; + LIMIT " . filter_number_format($_GET['NumberOfTopItems']); } else { //the situation if the customer type selected "All" if ($_GET['Customers'] == 'All') { @@ -58,10 +58,10 @@ AND salesorderdetails.stkcode = stockmaster.stockid AND salesorders.debtorno = debtorsmaster.debtorno AND salesorders.fromstkloc = '" . $_GET['Location'] . "' - AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' + AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' GROUP BY salesorderdetails.stkcode ORDER BY " . $_GET['Sequence'] . " DESC - LIMIT 0," . $_GET['NumberOfTopItems']; + LIMIT 0," . filter_number_format($_GET['NumberOfTopItems']); } else { //the situation if the location and customer type not selected "All" $SQL = "SELECT salesorderdetails.stkcode, @@ -76,10 +76,10 @@ AND salesorders.debtorno = debtorsmaster.debtorno AND salesorders.fromstkloc = '" . $_GET['Location'] . "' AND debtorsmaster.typeid = '" . $_GET['Customers'] . "' - AND salesorderdetails.actualdispatchdate >= '" . $FromDate . "' + AND salesorderdetails.actualdispatchdate >= '" . $FromDate . "' GROUP BY salesorderdetails.stkcode ORDER BY " . $_GET['Sequence'] . " DESC - LIMIT " . $_GET['NumberOfTopItems']; + LIMIT " . filter_number_format($_GET['NumberOfTopItems']); } } } @@ -97,7 +97,7 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin + 100, $YPos, 100, $FontSize, $myrow['description']); $LeftOvers = $pdf->addTextWrap($Left_Margin + 330, $YPos, 30, $FontSize, locale_number_format($myrow['totalinvoiced'],$myrow['decimalplaces']), 'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin + 370, $YPos, 300 - $Left_Margin, $FontSize, $myrow['units'], 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin + 400, $YPos, 70, $FontSize, locale_number_format($myrow['valuesales'], $_SESSION['CompanyRecord']['decimalplaces']), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin + 400, $YPos, 70, $FontSize, locale_money_format($myrow['valuesales'], $_SESSION['CompanyRecord']['decimalplaces']), 'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin + 490, $YPos, 30, $FontSize, locale_number_format($ohRow[0],$myrow['decimalplaces']), 'right'); if (mb_strlen($LeftOvers) > 1) { $LeftOvers = $pdf->addTextWrap($Left_Margin + 1 + 94, $YPos - $line_height, 270, $FontSize, $LeftOvers, 'left'); @@ -112,9 +112,9 @@ /*increment a line down for the next line item */ $YPos-= $line_height; } - + $pdf->OutputD($_SESSION['DatabaseName'] . '_TopItemsListing_' . date('Y-m-d').'.pdf'); - $pdf->__destruct(); + $pdf->__destruct(); } /*end of else not PrintPDF */ -?> +?> \ No newline at end of file Modified: trunk/PO_AuthorisationLevels.php =================================================================== --- trunk/PO_AuthorisationLevels.php 2011-09-14 09:57:45 UTC (rev 4690) +++ trunk/PO_AuthorisationLevels.php 2011-09-16 10:29:26 UTC (rev 4691) @@ -46,7 +46,7 @@ '".$_POST['CurrCode']."', '".$CanCreate."', '".$OffHold."', - '".$_POST['AuthLevel']."')"; + '" . filter_number_format($_POST['AuthLevel'])."')"; $ErrMsg = _('The authentication details cannot be inserted because'); $Result=DB_query($sql,$db,$ErrMsg); } else { @@ -69,10 +69,10 @@ $sql="UPDATE purchorderauth SET cancreate='".$CanCreate."', offhold='".$OffHold."', - authlevel='".$_POST['AuthLevel']."' + authlevel='".filter_number_format($_POST['AuthLevel'])."' WHERE userid='".$_POST['UserID']."' AND currabrev='".$_POST['CurrCode']."'"; - + $ErrMsg = _('The authentication details cannot be updated because'); $Result=DB_query($sql,$db,$ErrMsg); } @@ -111,9 +111,9 @@ purchorderauth.cancreate, purchorderauth.offhold, purchorderauth.authlevel - FROM purchorderauth INNER JOIN www_users + FROM purchorderauth INNER JOIN www_users ON purchorderauth.userid=www_users.userid - INNER JOIN currencies + INNER JOIN currencies ON purchorderauth.currabrev=currencies.currabrev"; $ErrMsg = _('The authentication details cannot be retrieved because'); @@ -187,7 +187,8 @@ $sql="SELECT cancreate, offhold, authlevel, - currency + currency, + decimalplaces FROM purchorderauth INNER JOIN currencies ON purchorderauth.currabrev=currencies.currabrev WHERE userid='".$_GET['UserID']."' @@ -200,7 +201,8 @@ $CanCreate=$myrow['cancreate']; $OffHold=$myrow['offhold']; $AuthLevel=$myrow['authlevel']; - + $CurrDecimalPlaces=$myrow['decimalplaces']; + echo '<tr> <td>'._('Currency').'</td> <td>' . $myrow['currency'] . '</td> @@ -235,7 +237,7 @@ } echo '<tr><td>'._('User can authorise orders up to :').'</td>'; -echo '<td><input type=input name="AuthLevel" size=11 class="number" value="' . $AuthLevel . '"></td</tr>'; +echo '<td><input type=input name="AuthLevel" size=11 class="number" value="' . locale_money_format($AuthLevel,$CurrDecimalPlaces) . '"></td</tr>'; echo '</table>'; if (isset($_GET['Edit'])) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |