|
From: <dai...@us...> - 2011-09-25 03:05:34
|
Revision: 4705
http://web-erp.svn.sourceforge.net/web-erp/?rev=4705&view=rev
Author: daintree
Date: 2011-09-25 03:05:27 +0000 (Sun, 25 Sep 2011)
Log Message:
-----------
number_formats
Modified Paths:
--------------
trunk/ReprintGRN.php
trunk/ReverseGRN.php
trunk/SalesByTypePeriodInquiry.php
trunk/SalesCategories.php
trunk/SalesCategoryPeriodInquiry.php
Modified: trunk/ReprintGRN.php
===================================================================
--- trunk/ReprintGRN.php 2011-09-24 07:39:35 UTC (rev 4704)
+++ trunk/ReprintGRN.php 2011-09-25 03:05:27 UTC (rev 4705)
@@ -5,20 +5,19 @@
$title=_('Reprint a GRN');
include('includes/header.inc');
-echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' .
- $title . '" alt="" />' . ' ' . $title . '</p>';
+echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . $title . '" alt="" />' . ' ' . $title . '</p>';
if (!isset($_POST['PONumber'])) {
$_POST['PONumber']='';
}
-echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>';
+echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
echo '<table class="selection">';
echo '<tr><th colspan="2"><font size="2" color="navy">' . _('Select a purchase order') . '</th></tr>';
echo '<tr><td>' . _('Enter a Purchase Order Number') . '</td>';
echo '<td>' . '<input type="text" name="PONumber" class="number" size="7" value="'.$_POST['PONumber'].'" /></td></tr>';
-echo '<tr><td colspan=2 style="text-align: center">' . '<input type="submit" name="Show" value="Show GRNs" /></td></tr>';
+echo '<tr><td colspan=2 style="text-align: center"><input type="submit" name="Show" value="Show GRNs" /></td></tr>';
echo '</table>';
echo '</form>';
@@ -42,21 +41,21 @@
exit;
}
$sql="SELECT grnbatch,
- grnno,
- grns.podetailitem,
- grns.itemcode,
- grns.itemdescription,
- grns.deliverydate,
- grns.qtyrecd,
- suppliers.suppname,
- stockmaster.decimalplaces
- FROM grns INNER JOIN suppliers
- ON grns.supplierid=suppliers.supplierid
- INNER JOIN purchorderdetails
- ON grns.podetailitem=purchorderdetails.podetailitem
- LEFT JOIN stockmaster
- ON grns.itemcode=stockmaster.stockid
- WHERE orderno='" . $_POST['PONumber'] ."'";
+ grnno,
+ grns.podetailitem,
+ grns.itemcode,
+ grns.itemdescription,
+ grns.deliverydate,
+ grns.qtyrecd,
+ suppliers.suppname,
+ stockmaster.decimalplaces
+ FROM grns INNER JOIN suppliers
+ ON grns.supplierid=suppliers.supplierid
+ INNER JOIN purchorderdetails
+ ON grns.podetailitem=purchorderdetails.podetailitem
+ LEFT JOIN stockmaster
+ ON grns.itemcode=stockmaster.stockid
+ WHERE orderno='" . $_POST['PONumber'] ."'";
$result=DB_query($sql, $db);
if (DB_num_rows($result)==0) {
echo '<br />';
Modified: trunk/ReverseGRN.php
===================================================================
--- trunk/ReverseGRN.php 2011-09-24 07:39:35 UTC (rev 4704)
+++ trunk/ReverseGRN.php 2011-09-25 03:05:27 UTC (rev 4705)
@@ -44,11 +44,11 @@
purchorderdetails.stdcostunit,
purchorders.intostocklocation,
purchorders.orderno
- FROM grns INNER JOIN purchorderdetails
- ON grns.podetailitem=purchorderdetails.podetailitem
- INNER JOIN purchorders
- ON purchorderdetails.orderno = purchorders.orderno
- WHERE AND grnno='" . filter_number_format($_GET['GRNNo']) . "'";
+ FROM grns INNER JOIN purchorderdetails
+ ON grns.podetailitem=purchorderdetails.podetailitem
+ INNER JOIN purchorders
+ ON purchorderdetails.orderno = purchorders.orderno
+ WHERE AND grnno='" . filter_number_format($_GET['GRNNo']) . "'";
$ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Could not get the details of the GRN selected for reversal because') . ' ';
$DbgMsg = _('The following SQL to retrieve the GRN details was used') . ':';
@@ -81,18 +81,18 @@
stockserialmoves.moveqty
FROM stockmoves INNER JOIN stockserialmoves
ON stockmoves.stkmoveno= stockserialmoves.stockmoveno
- WHERE stockmoves.stockid='" . $GRN['itemcode'] . "'
- AND stockmoves.type =25
- AND stockmoves.transno='" . $GRN['grnbatch'] . "'";
+ WHERE stockmoves.stockid='" . $GRN['itemcode'] . "'
+ AND stockmoves.type =25
+ AND stockmoves.transno='" . $GRN['grnbatch'] . "'";
$GetStockMoveResult = DB_query($SQL,$db,_('Could not retrieve the stock movement reference number which is required in order to retrieve details of the serial items that came in with this GRN'));
while ($SerialStockMoves = DB_fetch_array($GetStockMoveResult)){
$SQL = "SELECT stockserialitems.quantity
FROM stockserialitems
- WHERE stockserialitems.stockid='" . $GRN['itemcode'] . "'
- AND stockserialitems.loccode ='" . $GRN['intostocklocation'] . "'
- AND stockserialitems.serialno ='" . $SerialStockMoves['serialno'] . "'";
+ WHERE stockserialitems.stockid='" . $GRN['itemcode'] . "'
+ AND stockserialitems.loccode ='" . $GRN['intostocklocation'] . "'
+ AND stockserialitems.serialno ='" . $SerialStockMoves['serialno'] . "'";
$GetQOHResult = DB_query($SQL,$db,_('Unable to retrieve the quantity on hand of') . ' ' . $GRN['itemcode'] . ' ' . _('for Serial No') . ' ' . $SerialStockMoves['serialno']);
$GetQOH = DB_fetch_row($GetQOHResult);
if ($GetQOH[0] < $SerialStockMoves['moveqty']){
@@ -175,7 +175,7 @@
/*now reverse the cost put to fixedassets */
$SQL = "UPDATE fixedassets SET cost = cost - " . filter_number_format($GRN['stdcostunit'] * $QtyToReverse) . "
- WHERE assetid = '" . $GRN['assetid'] . "'";
+ WHERE assetid = '" . $GRN['assetid'] . "'";
$ErrMsg = _('CRITICAL ERROR! NOTE DOWN THIS ERROR AND SEEK ASSISTANCE. The fixed asset cost addition could not be reversed:');
$DbgMsg = _('The following SQL was used to attempt the reduce the cost of the asset was:');
$Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true);
@@ -183,8 +183,8 @@
} //end of if it is an asset
$SQL = "SELECT stockmaster.controlled
- FROM stockmaster
- WHERE stockmaster.stockid = '" . $GRN['itemcode'] . "'";
+ FROM stockmaster
+ WHERE stockmaster.stockid = '" . $GRN['itemcode'] . "'";
$Result = DB_query($SQL, $db, _('Could not determine if the item exists because'),'<br />' . _('The SQL that failed was') . ' ',true);
if (DB_num_rows($Result)==1){ /* if the GRN is in fact a stock item being reversed */
@@ -195,9 +195,9 @@
/* Update location stock records - NB a PO cannot be entered for a dummy/assembly/kit parts */
/*Need to get the current location quantity will need it later for the stock movement */
$SQL="SELECT quantity
- FROM locstock
- WHERE stockid='" . $GRN['itemcode'] . "'
- AND loccode= '" . $GRN['intostocklocation'] . "'";
+ FROM locstock
+ WHERE stockid='" . $GRN['itemcode'] . "'
+ AND loccode= '" . $GRN['intostocklocation'] . "'";
$Result = DB_query($SQL, $db, _('Could not get the quantity on hand of the item before the reversal was processed'),_('The SQL that failed was'),true);
if (DB_num_rows($Result)==1){
@@ -209,9 +209,9 @@
}
$SQL = "UPDATE locstock
- SET quantity = quantity - " . $QtyToReverse . "
- WHERE stockid = '" . $GRN['itemcode'] . "'
- AND loccode = '" . $GRN['intostocklocation'] . "'";
+ SET quantity = quantity - " . $QtyToReverse . "
+ WHERE stockid = '" . $GRN['itemcode'] . "'
+ AND loccode = '" . $GRN['intostocklocation'] . "'";
$ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The location stock record could not be updated because');
$DbgMsg = _('The following SQL to update the location stock record was used');
@@ -366,7 +366,7 @@
prnMsg(_('There are no outstanding goods received yet to be invoiced for') . ' ' . $_POST['SuppName'] . '.<br />' . _('To reverse a GRN that has been invoiced first it must be credited'),'warn');
} else { //there are GRNs to show
- echo '<br /><table cellpadding=2 colspan=7 class=selection>';
+ echo '<br /><table cellpadding=2 colspan=7 class="selection">';
$TableHeader = '<tr>
<th>' . _('GRN') . ' #</th>
<th>' . _('Item Code') . '</th>
@@ -395,17 +395,17 @@
$DisplayQtyInv = locale_number_format($myrow['quantityinv'],2);
$DisplayQtyRev = locale_number_format($myrow['qtytoreverse'],2);
$DisplayDateDel = ConvertSQLDate($myrow['deliverydate']);
- $LinkToRevGRN = '<a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&GRNNo=' . $myrow['grnno'] . '">' . _('Reverse') . '</a>';
+ $LinkToRevGRN = '<a href="' . $_SERVER['PHP_SELF'] . '?GRNNo=' . $myrow['grnno'] . '">' . _('Reverse') . '</a>';
- printf("<td>%s</td>
+ printf('<td>%s</td>
<td>%s</td>
<td>%s</td>
<td>%s</td>
- <td class=number>%s</td>
- <td class=number>%s</td>
- <td class=number>%s</td>
+ <td class="number">%s</td>
+ <td class="number">%s</td>
+ <td class="number">%s</td>
<td>%s</td>
- </tr>",
+ </tr>',
$myrow['grnno'],
$myrow['itemcode'],
$myrow['itemdescription'],
Modified: trunk/SalesByTypePeriodInquiry.php
===================================================================
--- trunk/SalesByTypePeriodInquiry.php 2011-09-24 07:39:35 UTC (rev 4704)
+++ trunk/SalesByTypePeriodInquiry.php 2011-09-25 03:05:27 UTC (rev 4705)
@@ -71,7 +71,7 @@
</tr>';
}
echo '</table>
- </td><td valign=top>
+ </td><td valign="top">
<table>';
echo '<tr><th colspan="2" class="centre">' . _('Display Data') . '</th>
@@ -365,11 +365,11 @@
if ($LastPeriodHeading != 'First Run Through'){ //print the footer for the period
echo '<td colspan="2" class="number">' . _('Total') . '-' . $LastPeriodHeading . '</td>
<td class="number">' . $PrdTotalOrders . '</td>
- <td class="number">' . locale_number_format($PrdTotalSales,2) . '</td>
- <td class="number">' . locale_number_format($PrdTotalRefunds,2) . '</td>
- <td class="number">' . locale_number_format($PrdTotalNetSales,2) . '</td>
- <td class="number">' . locale_number_format($PrdTotalCost,2) . '</td>
- <td class="number">' . locale_number_format($PrdTotalGP,2) . '</td>
+ <td class="number">' . locale_money_format($PrdTotalSales,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ <td class="number">' . locale_money_format($PrdTotalRefunds,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ <td class="number">' . locale_money_format($PrdTotalNetSales,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ <td class="number">' . locale_money_format($PrdTotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ <td class="number">' . locale_money_format($PrdTotalGP,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
</tr>';
if ($k==1){
echo '<tr class="EvenTableRows"><td colspan="8"><hr></td></tr>';
@@ -400,11 +400,11 @@
if ($LastPeriodHeading != 'First Run Through'){
echo '<td colspan="2" class="number">' . _('Total') . '-' . $LastPeriodHeading . '</td>
<td class="number">' . $PrdTotalOrders . '</td>
- <td class="number">' . locale_number_format($PrdTotalSales,2) . '</td>
- <td class="number">' . locale_number_format($PrdTotalRefunds,2) . '</td>
- <td class="number">' . locale_number_format($PrdTotalNetSales,2) . '</td>
- <td class="number">' . locale_number_format($PrdTotalCost,2) . '</td>
- <td class="number">' . locale_number_format($PrdTotalGP,2) . '</td>
+ <td class="number">' . locale_money_format($PrdTotalSales,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ <td class="number">' . locale_money_format($PrdTotalRefunds,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ <td class="number">' . locale_money_format($PrdTotalNetSales,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ <td class="number">' . locale_money_format($PrdTotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ <td class="number">' . locale_money_format($PrdTotalGP,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
</tr>';
if ($k==1){
echo '<tr class="EvenTableRows"><td colspan="8"><hr></td></tr>';
@@ -435,11 +435,11 @@
if ($LastPeriodHeading != 'First Run Through'){
echo '<td colspan="2" class="number">' . _('Total') . '-' . $LastPeriodHeading . '</td>
<td class="number">' . $PrdTotalOrders . '</td>
- <td class="number">' . locale_number_format($PrdTotalSales,2) . '</td>
- <td class="number">' . locale_number_format($PrdTotalRefunds,2) . '</td>
- <td class="number">' . locale_number_format($PrdTotalNetSales,2) . '</td>
- <td class="number">' . locale_number_format($PrdTotalCost,2) . '</td>
- <td class="number">' . locale_number_format($PrdTotalGP,2) . '</td>
+ <td class="number">' . locale_money_format($PrdTotalSales,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ <td class="number">' . locale_money_format($PrdTotalRefunds,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ <td class="number">' . locale_money_format($PrdTotalNetSales,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ <td class="number">' . locale_money_format($PrdTotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ <td class="number">' . locale_money_format($PrdTotalGP,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
</tr>';
if ($k==1){
echo '<tr class="EvenTableRows"><td colspan="8"><hr></td></tr>';
@@ -470,11 +470,11 @@
if ($LastPeriodHeading != 'First Run Through'){
echo '<td colspan="2" class="number">' . _('Total') . '-'. $LastPeriodHeading . '</td>
<td class="number">' . $PrdTotalOrders . '</td>
- <td class="number">' . locale_number_format($PrdTotalSales,2) . '</td>
- <td class="number">' . locale_number_format($PrdTotalRefunds,2) . '</td>
- <td class="number">' . locale_number_format($PrdTotalNetSales,2) . '</td>
- <td class="number">' . locale_number_format($PrdTotalCost,2) . '</td>
- <td class="number">' . locale_number_format($PrdTotalGP,2) . '</td>
+ <td class="number">' . locale_money_format($PrdTotalSales,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ <td class="number">' . locale_money_format($PrdTotalRefunds,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ <td class="number">' . locale_money_format($PrdTotalNetSales,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ <td class="number">' . locale_money_format($PrdTotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ <td class="number">' . locale_money_format($PrdTotalGP,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
</tr>';
if ($k==1){
echo '<tr class="EvenTableRows"><td colspan="8"><hr></td></tr>';
@@ -502,11 +502,11 @@
}
echo '<td>' . $SalesRow['tpe'] . '</td>
<td class="number">' . $SalesRow['nooforders'] . '</td>
- <td class="number">' . locale_number_format($SalesRow['salesvalue'],2) . '</td>
- <td class="number">' . locale_number_format($SalesRow['returnvalue'],2) . '</td>
- <td class="number">' . locale_number_format($SalesRow['salesvalue']+$SalesRow['returnvalue'],2) . '</td>
- <td class="number">' . locale_number_format($SalesRow['cost'],2) . '</td>
- <td class="number">' . locale_number_format(($SalesRow['salesvalue']+$SalesRow['returnvalue']-$SalesRow['cost']),2) . '</td>
+ <td class="number">' . locale_money_format($SalesRow['salesvalue'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ <td class="number">' . locale_money_format($SalesRow['returnvalue'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ <td class="number">' . locale_money_format($SalesRow['salesvalue']+$SalesRow['returnvalue'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ <td class="number">' . locale_money_format($SalesRow['cost'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ <td class="number">' . locale_money_format(($SalesRow['salesvalue']+$SalesRow['returnvalue']-$SalesRow['cost']),$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
</tr>';
$PrdTotalOrders +=$SalesRow['nooforders'];
$PrdTotalSales += $SalesRow['salesvalue'];
@@ -531,11 +531,11 @@
}
echo '<td colspan="2" class="number">' . _('Total') . ' ' . $LastPeriodHeading . '</td>
<td class="number">' . $PrdTotalOrders . '</td>
- <td class="number">' . locale_number_format($PrdTotalSales,2) . '</td>
- <td class="number">' . locale_number_format($PrdTotalRefunds,2) . '</td>
- <td class="number">' . locale_number_format($PrdTotalNetSales,2) . '</td>
- <td class="number">' . locale_number_format($PrdTotalCost,2) . '</td>
- <td class="number">' . locale_number_format($PrdTotalGP,2) . '</td>
+ <td class="number">' . locale_money_format($PrdTotalSales,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ <td class="number">' . locale_money_format($PrdTotalRefunds,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ <td class="number">' . locale_money_format($PrdTotalNetSales,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ <td class="number">' . locale_money_format($PrdTotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ <td class="number">' . locale_money_format($PrdTotalGP,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
</tr>';
if ($k==1){
echo '<tr class="EvenTableRows"><td colspan="8"><hr></td></tr>';
@@ -546,11 +546,11 @@
}
echo '<td colspan="2" class="number">' . _('GRAND Total') . '</td>
<td class="number">' . $CumulativeTotalOrders . '</td>
- <td class="number">' . locale_number_format($CumulativeTotalSales,2) . '</td>
- <td class="number">' . locale_number_format($CumulativeTotalRefunds,2) . '</td>
- <td class="number">' . locale_number_format($CumulativeTotalNetSales,2) . '</td>
- <td class="number">' . locale_number_format($CumulativeTotalCost,2) . '</td>
- <td class="number">' . locale_number_format($CumulativeTotalGP,2) . '</td>
+ <td class="number">' . locale_money_format($CumulativeTotalSales,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ <td class="number">' . locale_money_format($CumulativeTotalRefunds,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ <td class="number">' . locale_money_format($CumulativeTotalNetSales,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ <td class="number">' . locale_money_format($CumulativeTotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ <td class="number">' . locale_money_format($CumulativeTotalGP,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
</tr>';
echo '</table>';
Modified: trunk/SalesCategories.php
===================================================================
--- trunk/SalesCategories.php 2011-09-24 07:39:35 UTC (rev 4704)
+++ trunk/SalesCategories.php 2011-09-25 03:05:27 UTC (rev 4705)
@@ -164,9 +164,10 @@
$CategoryPath = '<a href="'.$_SERVER['PHP_SELF'] . '?ParentCategory=0">' . _('Main') . '</a>' . " \\ ";
$TempPath = '';
-if ($ParentCategory == null){
- $ParentCategory =0;
+if (isset($ParentCategory)){
+ $ParentCategory=0;
}
+
if (isset($ParentCategory)) {
$TmpParentID = $ParentCategory;
}
@@ -300,8 +301,7 @@
$_POST['SalesCatName'] = $myrow['salescatname'];
echo '<input type=hidden name="SelectedCategory" value="' . $SelectedCategory . '">';
- echo '<input type=hidden name="ParentCategory" value="' .
- (isset($_POST['ParentCatId'])?($_POST['ParentCategory']):('0')) . '">';
+ echo '<input type=hidden name="ParentCategory" value="' . (isset($_POST['ParentCatId'])?($_POST['ParentCategory']):('0')) . '">';
$FormCaps = _('Edit Sub Category');
} else { //end of if $SelectedCategory only do the else when a new record is being entered
@@ -313,12 +313,11 @@
(isset($_POST['ParentCategory'])?($_POST['ParentCategory']):('0')) . '">';
$FormCaps = _('New Sub Category');
}
-echo '<input type=hidden name="EditName" value="1">';
-echo '<table class=selection>';
+echo '<input type="hidden" name="EditName" value="1">';
+echo '<table class="selection">';
echo '<tr><th colspan="2">' . $FormCaps . '</th></tr>';
echo '<tr><td>' . _('Category Name') . ':</td>
- <td><input type="Text" name="SalesCatName" size=20 maxlength=20 value="' .
- $_POST['SalesCatName'] . '"></td></tr>';
+ <td><input type="text" name="SalesCatName" size="20" maxlength="20" value="' . $_POST['SalesCatName'] . '"></td></tr>';
// Image upload only if we have a selected category
if (isset($SelectedCategory)) {
echo '<tr><td>'. _('Image File (.jpg)') . ':</td>
@@ -326,7 +325,7 @@
}
echo '</table>';
-echo '<br /><div class="centre"><input type="Submit" name="submit" value="' . _('Submit Information') . '"></div>';
+echo '<br /><div class="centre"><input type="submit" name="submit" value="' . _('Submit Information') . '" /></div>';
echo '</form></p>';
@@ -369,16 +368,17 @@
echo '<p><form enctype="multipart/form-data" method="post" action="' . $_SERVER['PHP_SELF'] .'">';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
if( isset($SelectedCategory) ) { // If we selected a category we need to keep it selected
- echo '<input type=hidden name="SelectedCategory" value="' . $SelectedCategory . '">';
+ echo '<input type=hidden name="SelectedCategory" value="' . $SelectedCategory . '" />';
}
echo '<input type=hidden name="ParentCategory" value="' .
- (isset($_POST['ParentCategory'])?($_POST['ParentCategory']):('0')) . '">';
+ (isset($_POST['ParentCategory'])?($_POST['ParentCategory']):('0')) . '" /> ';
- echo '';
- echo '<table class=selection>';
- echo '<tr><th colspan="2">'._('Add Inventory to this category.').'</th></tr>';
- echo '<tr><td>' . _('Select Inv. Item') . ':</td><td>';
- echo '<select name="AddStockID">';
+
+ echo '<table class="selection">
+ <tr><th colspan="2">'._('Add Inventory to this category.').'</th></tr>
+ <tr><td>' . _('Select Inv. Item') . ':</td>
+ <td><select name="AddStockID">';
+
while( $myrow = DB_fetch_array($result) ) {
if ( !array_keys( $stockids, $myrow['stockid'] ) ) {
// Only if the StockID is not already selected
@@ -415,10 +415,10 @@
$result = DB_query($sql,$db);
if($result ) {
if( DB_num_rows($result)) {
- echo '<table class=selection>';
- echo '<tr><th colspan="3">'._('Inventory items in this category.').'</th></tr>';
- echo '<tr><th>' . _('Stock Code') . '</th>';
- echo '<th>' . _('Description') . '</th></tr>';
+ echo '<table class="selection">';
+ echo '<tr><th colspan="3">'._('Inventory items in this category.').'</th></tr>
+ <tr><th>' . _('Stock Code') . '</th>
+ <th>' . _('Description') . '</th></tr>';
$k=0; //row colour counter
Modified: trunk/SalesCategoryPeriodInquiry.php
===================================================================
--- trunk/SalesCategoryPeriodInquiry.php 2011-09-24 07:39:35 UTC (rev 4704)
+++ trunk/SalesCategoryPeriodInquiry.php 2011-09-25 03:05:27 UTC (rev 4705)
@@ -22,37 +22,37 @@
echo '<tr><th colspan="2" class="centre">' . _('Date Selection') . '</th>
</tr>
- <tr>
+ <tr>
<td>' . _('Custom Range') . ':</td>
<td><input type="radio" name="DateRange" value="Custom" ';
if ($_POST['DateRange']=='Custom'){
echo 'checked';
}
-echo '></td>
+echo ' /></td>
</tr>
- <tr>
+ <tr>
<td>' . _('This Week') . ':</td>
<td><input type="radio" name="DateRange" value="ThisWeek" ';
if ($_POST['DateRange']=='ThisWeek'){
echo 'checked';
}
-echo '></td>
+echo ' /></td>
</tr>
- <tr>
+ <tr>
<td>' . _('This Month') . ':</td>
<td><input type="radio" name="DateRange" value="ThisMonth" ';
if ($_POST['DateRange']=='ThisMonth'){
echo 'checked';
}
-echo '></td>
+echo ' /></td>
</tr>
- <tr>
+ <tr>
<td>' . _('This Quarter') . ':</td>
<td><input type="radio" name="DateRange" value="ThisQuarter" ';
if ($_POST['DateRange']=='ThisQuarter'){
echo 'checked';
}
-echo '></td>
+echo ' /></td>
</tr>';
if ($_POST['DateRange']=='Custom'){
echo '<tr>
@@ -67,7 +67,7 @@
echo '</table>';
-echo '<br /><div class="centre"><input tabindex=4 type=submit name="ShowSales" value="' . _('Show Sales') . '">';
+echo '<br /><div class="centre"><input tabindex=4 type=submit name="ShowSales" value="' . _('Show Sales') . '" />';
echo '</form></div>';
echo '<br />';
@@ -184,11 +184,11 @@
}
echo '<td>' . $SalesRow['categoryid'] . ' - ' . $SalesRow['categorydescription'] . '</td>
- <td class="number">' . locale_number_format($SalesRow['salesvalue'],2) . '</td>
- <td class="number">' . locale_number_format($SalesRow['returnvalue'],2) . '</td>
- <td class="number">' . locale_number_format($SalesRow['salesvalue']+$SalesRow['returnvalue'],2) . '</td>
- <td class="number">' . locale_number_format($SalesRow['cost'],2) . '</td>
- <td class="number">' . locale_number_format(($SalesRow['salesvalue']+$SalesRow['returnvalue']-$SalesRow['cost']),2) . '</td>
+ <td class="number">' . locale_money_format($SalesRow['salesvalue'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ <td class="number">' . locale_money_format($SalesRow['returnvalue'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ <td class="number">' . locale_money_format($SalesRow['salesvalue']+$SalesRow['returnvalue'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ <td class="number">' . locale_money_format($SalesRow['cost'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ <td class="number">' . locale_money_format(($SalesRow['salesvalue']+$SalesRow['returnvalue']-$SalesRow['cost']),$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
</tr>';
$CumulativeTotalSales += $SalesRow['salesvalue'];
@@ -206,11 +206,11 @@
echo '<tr class="EvenTableRows">';
}
echo '<td class="number">' . _('GRAND Total') . '</td>
- <td class="number">' . locale_number_format($CumulativeTotalSales,2) . '</td>
- <td class="number">' . locale_number_format($CumulativeTotalRefunds,2) . '</td>
- <td class="number">' . locale_number_format($CumulativeTotalNetSales,2) . '</td>
- <td class="number">' . locale_number_format($CumulativeTotalCost,2) . '</td>
- <td class="number">' . locale_number_format($CumulativeTotalGP,2) . '</td>
+ <td class="number">' . locale_money_format($CumulativeTotalSales,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ <td class="number">' . locale_money_format($CumulativeTotalRefunds,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ <td class="number">' . locale_money_format($CumulativeTotalNetSales,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ <td class="number">' . locale_money_format($CumulativeTotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ <td class="number">' . locale_money_format($CumulativeTotalGP,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
</tr>';
echo '</table>';
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|