From: <dai...@us...> - 2011-10-09 00:16:22
|
Revision: 4716 http://web-erp.svn.sourceforge.net/web-erp/?rev=4716&view=rev Author: daintree Date: 2011-10-09 00:16:14 +0000 (Sun, 09 Oct 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/PrintCustTrans.php trunk/SalesByTypePeriodInquiry.php trunk/SalesGraph.php trunk/SalesPeople.php trunk/SalesTopItemsInquiry.php trunk/SelectCompletedOrder.php trunk/SelectContract.php trunk/SelectCreditItems.php trunk/SelectCustomer.php trunk/includes/MiscFunctions.php Modified: trunk/PrintCustTrans.php =================================================================== --- trunk/PrintCustTrans.php 2011-10-08 09:44:56 UTC (rev 4715) +++ trunk/PrintCustTrans.php 2011-10-09 00:16:14 UTC (rev 4716) @@ -832,6 +832,7 @@ stockmoves.qty as quantity, stockmoves.discountpercent, ((1 - stockmoves.discountpercent) * stockmoves.price * " . $ExchRate . " * stockmoves.qty) AS fxnet, (stockmoves.price * " . $ExchRate . ") AS fxprice, + stockmoves.narrative, stockmaster.units, stockmaster.decimalplaces FROM stockmoves, Modified: trunk/SalesByTypePeriodInquiry.php =================================================================== --- trunk/SalesByTypePeriodInquiry.php 2011-10-08 09:44:56 UTC (rev 4715) +++ trunk/SalesByTypePeriodInquiry.php 2011-10-09 00:16:14 UTC (rev 4716) @@ -19,7 +19,7 @@ $_POST['DateRange']='ThisMonth'; } -echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; +echo '<form name="Form1" action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table cellpadding=2 class="selection"> @@ -34,7 +34,7 @@ if ($_POST['DateRange']=='Custom'){ echo 'checked'; } -echo '></td> +echo ' onChange="ReloadForm(Form1.ShowSales)"/></td> </tr> <tr> <td>' . _('This Week') . ':</td> @@ -42,7 +42,7 @@ if ($_POST['DateRange']=='ThisWeek'){ echo 'checked'; } -echo '></td> +echo ' onChange="ReloadForm(Form1.ShowSales)" /></td> </tr> <tr> <td>' . _('This Month') . ':</td> @@ -50,7 +50,7 @@ if ($_POST['DateRange']=='ThisMonth'){ echo 'checked'; } -echo '></td> +echo ' onChange="ReloadForm(Form1.ShowSales)" /></td> </tr> <tr> <td>' . _('This Quarter') . ':</td> @@ -58,9 +58,13 @@ if ($_POST['DateRange']=='ThisQuarter'){ echo 'checked'; } -echo '></td> +echo ' onChange="ReloadForm(Form1.ShowSales)" /></td> </tr>'; if ($_POST['DateRange']=='Custom'){ + if (!isset($_POST['ToDate'])){ + $_POST['FromDate'] = Date($_SESSION['DefaultDateFormat'],mktime(1,1,1,Date('m')-12,Date('d')+1,Date('Y'))); + $_POST['ToDate'] = Date($_SESSION['DefaultDateFormat']); + } echo '<tr> <td>' . _('Date From') . ':</td> <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="FromDate" maxlength="10" size="11" value="' . $_POST['FromDate'] . '" /></td> @@ -82,7 +86,7 @@ if ($_POST['DisplayData']=='Daily'){ echo 'checked'; } -echo '></td> +echo ' onChange="ReloadForm(Form1.ShowSales)" /></td> </tr> <tr> <td>' . _('Weekly') . ':</td> @@ -90,7 +94,7 @@ if ($_POST['DisplayData']=='Weekly'){ echo 'checked'; } -echo '></td> +echo ' onChange="ReloadForm(Form1.ShowSales)" /></td> </tr> <tr> <td>' . _('Monthly') . ':</td> @@ -98,24 +102,27 @@ if ($_POST['DisplayData']=='Monthly'){ echo 'checked'; } -echo '></td> +echo ' onChange="ReloadForm(Form1.ShowSales)" /></td> </tr> <tr> <td>' . _('Quarterly') . ':</td> <td><input type="radio" name="DisplayData" value="Quarterly" '; -if ($_POST['DisplayData']=='Monthly'){ +if ($_POST['DisplayData']=='Quarterly'){ echo 'checked'; } -echo '></td> +echo ' onChange="ReloadForm(Form1.ShowSales)" /></td> </tr>'; echo '</table> </td></tr> </table>'; -echo '<br /><div class="centre"><input tabindex=4 type=submit name="ShowSales" value="' . _('Show Sales') . '">'; -echo '</form></div>'; -echo '<br />'; +echo '<br /> + <div class="centre"> + <input tabindex="4" type="submit" name="ShowSales" value="' . _('Show Sales') . '" /> + </div> + </form> + <br />'; if ($_POST['DateRange']=='Custom' AND !isset($_POST['FromDate']) AND !isset($_POST['ToDate'])){ //Don't run the report until custom dates entered Modified: trunk/SalesGraph.php =================================================================== --- trunk/SalesGraph.php 2011-10-08 09:44:56 UTC (rev 4715) +++ trunk/SalesGraph.php 2011-10-09 00:16:14 UTC (rev 4716) @@ -176,20 +176,20 @@ $_POST['ValueTo']=''; } echo '<tr><td>' . _('Graph On:') . '</td><td> - <input type="RADIO" name="GraphOn" value="All" CHECKED>' . _('All') . '<br /> - <input type="RADIO" name="GraphOn" value="Customer">' . _('Customer') . '<br /> - <input type="RADIO" name="GraphOn" value="StockID">' . _('Item Code') . '</td></tr>'; + <input type="radio"" name="GraphOn" value="All" CHECKED>' . _('All') . '<br /> + <input type="radio"" name="GraphOn" value="Customer">' . _('Customer') . '<br /> + <input type="radio"" name="GraphOn" value="StockID">' . _('Item Code') . '</td></tr>'; echo '<tr><td>' . _('From:') . ' <input type=TEXT name="ValueFrom" value=' . $_POST['ValueFrom'] . '></td> <td>' . _('To:') . ' <input type=TEXT name="ValueTo" value=' . $_POST['ValueTo'] . '></td></tr>'; echo '<tr><td>' . _('Graph Value:') . '</td><td> - <input type="RADIO" name="GraphValue" value="Net" CHECKED>' . _('Net Sales Value') . '<br /> - <input type="RADIO" name="GraphValue" value="GP">' . _('Gross Profit') . '<br /> - <input type="RADIO" name="GraphValue" value="Quantity">' . _('Quantity') . '</td></tr>'; + <input type="radio"" name="GraphValue" value="Net" CHECKED>' . _('Net Sales Value') . '<br /> + <input type="radio"" name="GraphValue" value="GP">' . _('Gross Profit') . '<br /> + <input type="radio"" name="GraphValue" value="Quantity">' . _('Quantity') . '</td></tr>'; echo '</table>'; - echo '<br /><div class="centre"><input type="submit" Name="ShowGraph" Value="' . _('Show Sales Graph') .'"></div>'; + echo '<br /><div class="centre"><input type="submit" Name="ShowGraph" Value="' . _('Show Sales Graph') .'" /></div>'; include('includes/footer.inc'); } else { Modified: trunk/SalesPeople.php =================================================================== --- trunk/SalesPeople.php 2011-10-08 09:44:56 UTC (rev 4715) +++ trunk/SalesPeople.php 2011-10-09 00:16:14 UTC (rev 4716) @@ -57,9 +57,6 @@ OR !is_numeric(filter_number_format($_POST['CommissionRate2']))) { $InputError = 1; prnMsg(_('The commission rates must be a floating point number'),'error'); - echo '<br/>Commission Rate 1 = ' . filter_number_format($_POST['CommissionRate1']); - echo '<br/>Commission Rate 2 = ' . filter_number_format($_POST['CommissionRate2']); - echo '<br/>The locale decimal point is ' . $LocaleInfo['decimal_point']; } elseif (!is_numeric(filter_number_format($_POST['Breakpoint']))) { $InputError = 1; prnMsg(_('The breakpoint should be a floating point number'),'error'); @@ -88,10 +85,10 @@ /*SelectedSalesPerson could also exist if submit had not been clicked this code would not run in this case cos submit is false of course see the delete code below*/ - $sql = "UPDATE salesman SET salesmanname='" . $_POST['SalesmanName'] . "', + $sql = "UPDATE salesman SET salesmanname='" . DB_escape_string($_POST['SalesmanName']) . "', commissionrate1='" . filter_number_format($_POST['CommissionRate1']) . "', - smantel='" . $_POST['SManTel'] . "', - smanfax='" . $_POST['SManFax'] . "', + smantel='" . DB_escape_string($_POST['SManTel']) . "', + smanfax='" . DB_escape_string($_POST['SManFax']) . "', breakpoint='" . filter_number_format($_POST['Breakpoint']) . "', commissionrate2='" . filter_number_format($_POST['CommissionRate2']) . "', current='" . $_POST['Current'] . "' @@ -110,7 +107,7 @@ smantel, smanfax, current) - VALUES ('" . $_POST['SalesmanCode'] . "', + VALUES ('" . DB_escape_string($_POST['SalesmanCode']) . "', '" . DB_escape_string($_POST['SalesmanName']) . "', '" . filter_number_format($_POST['CommissionRate1']) . "', '" . filter_number_format($_POST['CommissionRate2']) . "', @@ -275,9 +272,9 @@ $_POST['SalesmanName'] = $myrow['salesmanname']; $_POST['SManTel'] = $myrow['smantel']; $_POST['SManFax'] = $myrow['smanfax']; - $_POST['CommissionRate1'] = $myrow['commissionrate1']; - $_POST['Breakpoint'] = $myrow['breakpoint']; - $_POST['CommissionRate2'] = $myrow['commissionrate2']; + $_POST['CommissionRate1'] = locale_number_format($myrow['commissionrate1'],'Variable'); + $_POST['Breakpoint'] = locale_number_format($myrow['breakpoint'],'Variable'); + $_POST['CommissionRate2'] = locale_number_format($myrow['commissionrate2'],'Variable'); $_POST['Current'] = $myrow['current']; @@ -347,24 +344,24 @@ <td>' . _('Current?') . ':</td> <td><select name="Current">'; if ($_POST['Current']==1){ - echo '<option selected value=1>' . _('Yes') . '</option>'; + echo '<option selected value="1">' . _('Yes') . '</option>'; } else { - echo '<option value=1>' . _('Yes') . '</option>'; + echo '<option value="1">' . _('Yes') . '</option>'; } if ($_POST['Current']==0){ - echo '<option selected value=0>' . _('No') . '</option>'; + echo '<option selected value="0">' . _('No') . '</option>'; } else { - echo '<option value=0>' . _('No') . '</option>'; + echo '<option value="0">' . _('No') . '</option>'; } echo '</select></td> - </tr>'; + </tr> + </table> + <br /> + <div class="centre"> + <input type="submit" name="submit" value="' . _('Enter Information') . '" /> + </div> + </form>'; - echo '</table>'; - - echo '<br /><div class="centre"><input type="Submit" name="submit" value="' . _('Enter Information') . '"></div>'; - - echo '</form>'; - } //end if record deleted no point displaying form to add record include('includes/footer.inc'); Modified: trunk/SalesTopItemsInquiry.php =================================================================== --- trunk/SalesTopItemsInquiry.php 2011-10-08 09:44:56 UTC (rev 4715) +++ trunk/SalesTopItemsInquiry.php 2011-10-09 00:16:14 UTC (rev 4716) @@ -3,11 +3,11 @@ /* $Id: SalesTopItemsInquiry.php 4261 2010-12-22 15:56:50Z $*/ include('includes/session.inc'); -$title = _('Sales Category Report'); +$title = _('Top Sales Inquiry'); include('includes/header.inc'); include('includes/DefineCartClass.php'); -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Sales Report') . '" alt="" />' . ' ' . _('Sales Category Report') . '</p>'; +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Sales Inquiry') . '" alt="" />' . ' ' . _('Top Sales Items Inquiry') . '</p>'; echo '<div class="page_help_text">' . _('Select the parameters for the report') . '</div><br />'; if (!isset($_POST['DateRange'])){ @@ -244,7 +244,7 @@ <td class="number">' . locale_number_format($SalesRow['salesvalue'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number">' . locale_number_format($SalesRow['returnvalue'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number">' . locale_number_format($SalesRow['netsalesvalue'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td class="number">' . $SalesRow['salesquantity'] . '</td> + <td class="number">' . locale_number_format($SalesRow['salesquantity'],'Variable') . '</td> </tr>'; $i++; @@ -266,7 +266,7 @@ <td class="number">' . locale_number_format($CumulativeTotalSales,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number">' . locale_number_format($CumulativeTotalRefunds,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number">' . locale_number_format($CumulativeTotalNetSales,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td class="number">' . $CumulativeTotalQuantity . '</td> + <td class="number">' . locale_number_format($CumulativeTotalQuantity,'Variable') . '</td> </tr>'; echo '</table>'; Modified: trunk/SelectCompletedOrder.php =================================================================== --- trunk/SelectCompletedOrder.php 2011-10-08 09:44:56 UTC (rev 4715) +++ trunk/SelectCompletedOrder.php 2011-10-09 00:16:14 UTC (rev 4716) @@ -519,7 +519,7 @@ $_POST['OrderNumber']=''; } echo '<td>' . _('Order Number') . ':</td> - <td><input type="text" name="OrderNumber" maxlength =8 size=9 value ="' . $_POST['OrderNumber'] . '"></td> + <td><input type="text" name="OrderNumber" maxlength="8" size="9" value ="' . $_POST['OrderNumber'] . '" /></td> <td>' . _('for all orders placed after') . ': </td> <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] .'" name="OrdersAfterDate" maxlength="10" size="11" value="' . $_POST['OrdersAfterDate'] . '" /></td> <td><input type="submit" name="SearchOrders" value="' . _('Search Orders') . '" /></td> @@ -542,7 +542,7 @@ echo '<div class="page_help_text"><font size=1>' . _('To search for sales orders for a specific part use the part selection facilities below') . ' </font></div>'; echo '<br /> <table class="selection">'; - echo '<tr><td><font size=1>' . _('Select a stock category') . ':</font>'; + echo '<tr><td><font size="1">' . _('Select a stock category') . ':</font>'; echo '<select name="StockCat">'; while ($myrow1 = DB_fetch_array($result1)) { @@ -553,19 +553,23 @@ } } - echo '</select>'; - echo '<td><font size=1>' . _('Enter text extracts in the description') . ':</font></td>'; - echo '<td><input type="text" name="Keywords" size="20" maxlength="25"></td></tr>'; - echo '<tr><td></td>'; - echo '<td><font size=3><b> ' ._('OR') . ' </b></font><font size=1>' . _('Enter extract of the Stock Code') . ':</font></td>'; - echo '<td><input type="text" name="StockCode" size="15" maxlength="18"></td>'; - echo '</tr>'; - echo '<tr><td colspan=4><div class="centre"><input type="submit" name="SearchParts" value="' . _('Search Parts Now') . '" />'; + echo '</select> + <td><font size="1">' . _('Enter text extracts in the description') . ':</font></td> + <td><input type="text" name="Keywords" size="20" maxlength="25" /></td> + </tr> + <tr> + <td></td> + <td><font size=3><b> ' ._('OR') . ' </b></font><font size=1>' . _('Enter extract of the Stock Code') . ':</font></td> + <td><input type="text" name="StockCode" size="15" maxlength="18" /></td> + </tr> + <tr><td colspan=4><div class="centre"><input type="submit" name="SearchParts" value="' . _('Search Parts Now') . '" />'; if (count($_SESSION['AllowedPageSecurityTokens'])>1){ echo '<input type="submit" name="ResetPart" value="' . _('Show All') . '" /></div>'; } - echo '</td></tr></table>'; + echo '</td> + </tr> + </table>'; } @@ -574,12 +578,14 @@ echo '<br /> <table cellpadding="2" colspan="7" class="selection">'; - $TableHeadings = '<tr><th>' . _('Code') . '</th> + $TableHeadings = '<tr> + <th>' . _('Code') . '</th> <th>' . _('Description') . '</th> <th>' . _('On Hand') . '</th> <th>' . _('Purchase Orders') . '</th> <th>' . _('Sales Orders') . '</th> - <th>' . _('Units') . '</th></tr>'; + <th>' . _('Units') . '</th> + </tr>'; echo $TableHeadings; @@ -597,17 +603,17 @@ } printf('<td><font size=1><input type="submit" name="SelectedStockItem" value="%s" /></font></td> - <td><font size=1>%s</font></td> - <td class="number"><font size=1>%s</font></td> - <td class="number"><font size=1>%s</font></td> - <td class="number"><font size=1>%s</font></td> - <td><font size=1>%s</font></td></tr>', - $myrow['stockid'], - $myrow['description'], - locale_number_format($myrow['qoh'],$myrow['decimalplaces']), - locale_number_format($myrow['qoo'],$myrow['decimalplaces']), - locale_number_format($myrow['qdem'],$myrow['decimalplaces']), - $myrow['units']); + <td><font size=1>%s</font></td> + <td class="number"><font size=1>%s</font></td> + <td class="number"><font size=1>%s</font></td> + <td class="number"><font size=1>%s</font></td> + <td><font size=1>%s</font></td></tr>', + $myrow['stockid'], + $myrow['description'], + locale_number_format($myrow['qoh'],$myrow['decimalplaces']), + locale_number_format($myrow['qoo'],$myrow['decimalplaces']), + locale_number_format($myrow['qdem'],$myrow['decimalplaces']), + $myrow['units']); //end of page full new headings if } @@ -631,7 +637,8 @@ <th>' . _('Order Date') . '</th> <th>' . _('Req Del Date') . '</th> <th>' . _('Delivery To') . '</th> - <th>' . _('Order Total') . '</th></tr>'; + <th>' . _('Order Total') . '</th> + </tr>'; echo $tableheader; @@ -654,23 +661,23 @@ $FormatedOrderValue = locale_number_format($myrow['ordervalue'],$myrow['currdecimalplaces']); printf('<td><a href="%s">%s</a></td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td class="number">%s</td> - </tr>', - $ViewPage, - $myrow['orderno'], - $myrow['name'], - $myrow['brname'], - $myrow['customerref'], - $FormatedOrderDate, - $FormatedDelDate, - $myrow['deliverto'], - $FormatedOrderValue); + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td class="number">%s</td> + </tr>', + $ViewPage, + $myrow['orderno'], + $myrow['name'], + $myrow['brname'], + $myrow['customerref'], + $FormatedOrderDate, + $FormatedDelDate, + $myrow['deliverto'], + $FormatedOrderValue); //end of page full new headings if } Modified: trunk/SelectContract.php =================================================================== --- trunk/SelectContract.php 2011-10-08 09:44:56 UTC (rev 4715) +++ trunk/SelectContract.php 2011-10-09 00:16:14 UTC (rev 4716) @@ -27,7 +27,7 @@ } else { if (isset($_POST['SelectedCustomer'])) { echo _('For customer') . ': ' . $_POST['SelectedCustomer'] . ' ' . _('and') . ' '; - echo '<input type="hidden" name="SelectedCustomer" value="' . $_POST['SelectedCustomer'] . '">'; + echo '<input type="hidden" name="SelectedCustomer" value="' . $_POST['SelectedCustomer'] . '" />'; } } @@ -145,14 +145,14 @@ echo '<table cellpadding="2" colspan="7" width="98%" class="selection">'; $TableHeader = '<tr> - <th>' . _('Modify') . '</th> - <th>' . _('Order') . '</th> - <th>' . _('Issue To WO') . '</th> - <th>' . _('Costing') . '</th> - <th>' . _('Contract Ref') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Customer') . '</th> - <th>' . _('Required Date') . '</th> + <th>' . _('Modify') . '</th> + <th>' . _('Order') . '</th> + <th>' . _('Issue To WO') . '</th> + <th>' . _('Costing') . '</th> + <th>' . _('Contract Ref') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Customer') . '</th> + <th>' . _('Required Date') . '</th> </tr>'; echo $TableHeader; Modified: trunk/SelectCreditItems.php =================================================================== --- trunk/SelectCreditItems.php 2011-10-08 09:44:56 UTC (rev 4715) +++ trunk/SelectCreditItems.php 2011-10-09 00:16:14 UTC (rev 4716) @@ -541,7 +541,7 @@ $Narrative = $_POST['Narrative_' . $LineItem->LineNumber]; if (isset($_POST['Price_' . $LineItem->LineNumber])){ - if (isset($_POST['Gross']) AND $_POST['Gross']==True){ + if (isset($_POST['Gross']) AND $_POST['Gross']==true){ $TaxTotalPercent =0; foreach ($LineItem->Taxes AS $Tax) { if ($Tax->TaxOnTax ==1){ @@ -550,7 +550,7 @@ $TaxTotalPercent += $Tax->TaxRate; } } - $Price = round($_POST['Price_' . $LineItem->LineNumber]/($TaxTotalPercent + 1),$_SESSION['CreditItems'.$identifier]->CurrDecimalPlaces); + $Price = round(filter_number_format($_POST['Price_' . $LineItem->LineNumber])/($TaxTotalPercent + 1),$_SESSION['CreditItems'.$identifier]->CurrDecimalPlaces); } else { $Price = filter_number_format($_POST['Price_' . $LineItem->LineNumber]); } @@ -708,16 +708,16 @@ <td>' . $LineItem->ItemDescription . '</td>'; if ($LineItem->Controlled==0){ - echo '<td><input type="text" class="number" name="Quantity_' . $LineItem->LineNumber . '" maxlength="6" size="6" value=' . locale_number_format($LineItem->Quantity,$LineItem->DecimalPlaces) . '></td>'; + echo '<td><input type="text" class="number" name="Quantity_' . $LineItem->LineNumber . '" maxlength="6" size="6" value=' . locale_number_format(round($LineItem->Quantity,$LineItem->DecimalPlaces),$LineItem->DecimalPlaces) . '></td>'; } else { echo '<td class="number"><a href="' . $rootpath . '/CreditItemsControlled.php?LineNo=' . $LineItem->LineNumber . '">' . locale_number_format($LineItem->Quantity,$LineItem->DecimalPlaces) . '</a> - <input type=hidden name="Quantity_' . $LineItem->LineNumber . '" value=' . round($LineItem->Quantity,$LineItem->DecimalPlaces) . '></td>'; + <input type=hidden name="Quantity_' . $LineItem->LineNumber . '" value=' . locale_number_format(round($LineItem->Quantity,$LineItem->DecimalPlaces),$LineItem->DecimalPlaces) . '></td>'; } echo '<td>' . $LineItem->Units . '</td> <td><input type="text" class="number" name="Price_' . $LineItem->LineNumber . '" size=10 maxlength=12 value=' . locale_number_format($LineItem->Price,$_SESSION['CreditItems'.$identifier]->CurrDecimalPlaces) . '></td> <td><input type="CheckBox" name="Gross" value=False></td> - <td><input type="text" class="number" name="Discount_' . $LineItem->LineNumber . '" size=3 maxlength=3 value=' . ($LineItem->DiscountPercent * 100) . '>%</td> + <td><input type="text" class="number" name="Discount_' . $LineItem->LineNumber . '" size=3 maxlength=3 value=' . locale_number_format(($LineItem->DiscountPercent * 100),'Variable') . '>%</td> <td class="number">' . $DisplayLineTotal . '</td>'; @@ -741,7 +741,7 @@ if ($i>0){ echo '<br />'; } - echo '<input type="text" class="number" name="' . $LineItem->LineNumber . $Tax->TaxCalculationOrder . '_TaxRate" maxlength=4 size=4 value="' . locale_number_format($Tax->TaxRate*100,$_SESSION['CreditItems'.$identifier]->CurrDecimalPlaces) . '">'; + echo '<input type="text" class="number" name="' . $LineItem->LineNumber . $Tax->TaxCalculationOrder . '_TaxRate" maxlength=4 size="4" value="' . locale_number_format($Tax->TaxRate*100,'Variable') . '">'; $i++; if ($Tax->TaxOnTax ==1){ $TaxTotals[$Tax->TaxAuthID] += ($Tax->TaxRate * ($LineTotal + $TaxLineTotal)); @@ -765,7 +765,7 @@ </tr>'; echo $RowStarter; - echo '<td colspan=11><textarea name="Narrative_' . $LineItem->LineNumber . '" cols=100% rows=1>' . $LineItem->Narrative . '</textarea><br /></td></tr>'; + echo '<td colspan=11><textarea name="Narrative_' . $LineItem->LineNumber . '" cols="100%" rows="1">' . $LineItem->Narrative . '</textarea><br /></td></tr>'; $_SESSION['CreditItems'.$identifier]->total += $LineTotal; @@ -780,7 +780,6 @@ echo '<tr> <td colspan="5"></td>'; - echo '<td colspan="2" class="number">'. _('Credit Freight').'</td> <td><input type="text" class="number" size=6 maxlength=6 name="ChargeFreightCost" value="' . locale_number_format($_SESSION['CreditItems'.$identifier]->FreightCost,$_SESSION['CreditItems'.$identifier]->CurrDecimalPlaces) . '" /></td>'; @@ -805,7 +804,7 @@ echo '<br />'; } - echo '<input type="text" class="number" name=FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder . ' maxlength="4" size="4" value="' . locale_number_format(($FreightTaxLine->TaxRate * 100),$_SESSION['CreditItems'.$identifier]->CurrDecimalPlaces) . '" />'; + echo '<input type="text" class="number" name=FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder . ' maxlength="4" size="4" value="' . locale_number_format(($FreightTaxLine->TaxRate * 100),'Variable') . '" />'; if ($FreightTaxLine->TaxOnTax ==1){ $TaxTotals[$FreightTaxLine->TaxAuthID] += ($FreightTaxLine->TaxRate * ($_SESSION['CreditItems'.$identifier]->FreightCost + $FreightTaxTotal)); @@ -933,7 +932,7 @@ /* Now show the stock item selection search stuff below */ - if (isset($_POST['PartSearch']) AND $_POST['PartSearch']!="" AND !isset($_POST['ProcessCredit'])){ + if (isset($_POST['PartSearch']) AND $_POST['PartSearch']!='' AND !isset($_POST['ProcessCredit'])){ echo '<input type="hidden" name="PartSearch" value="' . _('Yes Please') . '" />'; @@ -950,7 +949,7 @@ <tr> <td>' . _('Select a stock category') . ': <select name="StockCat">'; - echo '<option selected value="All">' . _('All'); + echo '<option selected value="All">' . _('All') . '</option>'; while ($myrow1 = DB_fetch_array($result1)) { if (isset($_POST['StockCat']) and $_POST['StockCat']==$myrow1['categoryid']){ echo '<option selected value=' . $myrow1['categoryid'] . '>' . $myrow1['categorydescription'] . '</option>'; @@ -970,7 +969,7 @@ echo '<td><input type="text" name="Keywords" size="20" maxlength="25" value="' . $_POST['Keywords'] . '" /></td></tr>'; echo '<tr><td></td>'; echo '<td><font size="3"><b>' ._('OR') . '</b></font> ' . _('Enter extract of the Stock Code') . ': </td>'; - echo '<td><input type="text" name="StockCode" size="15" maxlength="18" value="' . $_POST['StockCode'] . '"></td>'; + echo '<td><input type="text" name="StockCode" size="15" maxlength="18" value="' . $_POST['StockCode'] . '" /></td>'; echo '</tr>'; echo '</table> <br /> @@ -1121,7 +1120,7 @@ '" . -$TaxTotal . "', '" . -$_SESSION['CreditItems'.$identifier]->FreightCost . "', '" . $_SESSION['CurrencyRate'] . "', - '" . $_POST['CreditText'] . "' + '" . DB_escape_string($_POST['CreditText']) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The customer credit note transaction could not be added to the database because'); @@ -1139,7 +1138,7 @@ taxamount) VALUES ('" . $CreditTransID . "', '" . $TaxAuthID . "', - '" . -($TaxAmount)/$_SESSION['CurrencyRate'] . "')"; + '" . -$TaxAmount/$_SESSION['CurrencyRate'] . "')"; $ErrMsg =_('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The debtor transaction taxes records could not be inserted because'); $DbgMsg = _('The following SQL to insert the debtor transaction taxes record was used'); @@ -1316,10 +1315,10 @@ /*1st off check if StockSerialItems already exists */ $SQL = "SELECT COUNT(*) - FROM stockserialitems - WHERE stockid='" . $CreditLine->StockID . "' - AND loccode='" . $_SESSION['CreditItems'.$identifier]->Location . "' - AND serialno='" . $Item->BundleRef . "'"; + FROM stockserialitems + WHERE stockid='" . $CreditLine->StockID . "' + AND loccode='" . $_SESSION['CreditItems'.$identifier]->Location . "' + AND serialno='" . $Item->BundleRef . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The existence of the serial stock item record could not be determined because'); $DbgMsg = _('The following SQL to find out if the serial stock item record existed already was used'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); @@ -1362,8 +1361,7 @@ '" . $StkMoveNo . "', '" . $CreditLine->StockID . "', '" . $Item->BundleRef . "', - '" . $Item->BundleQty . "' - )"; + '" . $Item->BundleQty . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock movement record could not be inserted because'); $DbgMsg = _('The following SQL to insert the serial stock movement record was used'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); @@ -1381,7 +1379,7 @@ if ($CreditLine->MBflag=='B' OR $CreditLine->MBflag=='M') { $SQL = "UPDATE locstock - SET locstock.quantity = locstock.quantity + " . filter_number_format($CreditLine->Quantity) . " + SET locstock.quantity = locstock.quantity + " . $CreditLine->Quantity . " WHERE locstock.stockid = '" . $CreditLine->StockID . "' AND locstock.loccode = '" . $_SESSION['CreditItems'.$identifier]->Location . "'"; @@ -1400,11 +1398,11 @@ $SQL = "SELECT bom.component, bom.quantity, stockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost AS standard - FROM bom INNER JOIN stockmaster - ON bom.component=stockmaster.stockid - WHERE bom.parent='" . $CreditLine->StockID . "' - AND bom.effectiveto > '" . Date('Y-m-d') . "' - AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; + FROM bom INNER JOIN stockmaster + ON bom.component=stockmaster.stockid + WHERE bom.parent='" . $CreditLine->StockID . "' + AND bom.effectiveto > '" . Date('Y-m-d') . "' + AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; $ErrMsg = _('Could not retrieve assembly components from the database for') . ' ' . $CreditLine->StockID . ' ' . _('because'); $DbgMsg = _('The SQL that failed was'); @@ -1453,10 +1451,10 @@ '" . $_SESSION['CreditItems'.$identifier]->Branch . "', '" . $PeriodNo . "', '" . _('Assembly') .': ' . $CreditLine->StockID . "', - '" . filter_number_format($AssParts['quantity'] * $CreditLine->Quantity) . "', + '" . $AssParts['quantity'] * $CreditLine->Quantity . "', '" . $AssParts['standard'] . "', 0, - '" . filter_number_format($QtyOnHandPrior + ($AssParts['quantity'] * $CreditLine->Quantity)) . "' + '" . $QtyOnHandPrior + ($AssParts['quantity'] * $CreditLine->Quantity) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Stock movement records for the assembly components of') . ' ' . $CreditLine->StockID . ' ' . _('could not be inserted because'); @@ -1510,11 +1508,11 @@ '" . $SQLCreditDate . "', '" . $_SESSION['CreditItems'.$identifier]->DebtorNo . "', '" . $_SESSION['CreditItems'.$identifier]->Branch . "', - '" . filter_number_format($LocalCurrencyPrice) . "', + '" . $LocalCurrencyPrice . "', '" . $PeriodNo . "', - '" . -filter_number_format($CreditLine->Quantity) . "', - '" . filter_number_format($CreditLine->DiscountPercent) . "', - '" . filter_number_format($CreditLine->StandardCost) . "', + '" . -$CreditLine->Quantity . "', + '" . $CreditLine->DiscountPercent . "', + '" . $CreditLine->StandardCost . "', '" . DB_escape_string($_POST['CreditText']) . "', 0, '" . $QtyOnHandPrior . "', @@ -1545,11 +1543,11 @@ '" . $SQLCreditDate . "', '" . $_SESSION['CreditItems'.$identifier]->DebtorNo . "', '" . $_SESSION['CreditItems'.$identifier]->Branch . "', - '" . filter_number_format($LocalCurrencyPrice) . "', + '" . $LocalCurrencyPrice . "', '" . $PeriodNo . "', - '" . -filter_number_format($CreditLine->Quantity) . "', - '" . filter_number_format($CreditLine->DiscountPercent) . "', - '" . filter_number_format($CreditLine->StandardCost) . "', + '" . -$CreditLine->Quantity . "', + '" . $CreditLine->DiscountPercent . "', + '" . $CreditLine->StandardCost . "', '" . DB_escape_string($_POST['CreditText']) . "', 0)"; @@ -1639,8 +1637,8 @@ /*No updates to qty or cost data */ - $SQL = "UPDATE salesanalysis SET amt=amt-" . filter_number_format($CreditLine->Price * $CreditLine->Quantity / $_SESSION['CurrencyRate']) . ", - disc=disc-" . filter_number_format($CreditLine->DiscountPercent * $CreditLine->Price * $CreditLine->Quantity / $_SESSION['CurrencyRate']) . " + $SQL = "UPDATE salesanalysis SET amt=amt-" . $CreditLine->Price * $CreditLine->Quantity / $_SESSION['CurrencyRate'] . ", + disc=disc-" . $CreditLine->DiscountPercent * $CreditLine->Price * $CreditLine->Quantity / $_SESSION['CurrencyRate'] . " WHERE salesanalysis.area='" . $myrow[2] . "' AND salesanalysis.salesperson='" . $myrow[3] . "' AND salesanalysis.typeabbrev ='" . $_SESSION['CreditItems'.$identifier]->DefaultSalesType . "' @@ -1653,10 +1651,10 @@ } else { - $SQL = "UPDATE salesanalysis SET Amt=Amt-" . filter_number_format($CreditLine->Price * $CreditLine->Quantity / $_SESSION['CurrencyRate']) . ", - Cost=Cost-" . filter_number_format($CreditLine->StandardCost * $CreditLine->Quantity) . ", - Qty=Qty-" . filter_number_format($CreditLine->Quantity) . ", - Disc=Disc-" . filter_number_format($CreditLine->DiscountPercent * $CreditLine->Price * $CreditLine->Quantity / $_SESSION['CurrencyRate']) . " + $SQL = "UPDATE salesanalysis SET Amt=Amt-" . $CreditLine->Price * $CreditLine->Quantity / $_SESSION['CurrencyRate'] . ", + Cost=Cost-" . $CreditLine->StandardCost * $CreditLine->Quantity . ", + Qty=Qty-" . $CreditLine->Quantity . ", + Disc=Disc-" . $CreditLine->DiscountPercent * $CreditLine->Price * $CreditLine->Quantity / $_SESSION['CurrencyRate'] . " WHERE salesanalysis.area='" . $myrow[2] . "' AND salesanalysis.salesperson='" . $myrow[3] . "' AND salesanalysis.typeabbrev ='" . $_SESSION['CreditItems'.$identifier]->DefaultSalesType . "' @@ -1686,11 +1684,11 @@ stkcategory) SELECT '" . $_SESSION['CreditItems'.$identifier]->DefaultSalesType . "', '" . $PeriodNo . "', - '" . -filter_number_format($CreditLine->Price * $CreditLine->Quantity / $_SESSION['CurrencyRate']) . "', + '" . -$CreditLine->Price * $CreditLine->Quantity / $_SESSION['CurrencyRate'] . "', '" . $_SESSION['CreditItems'.$identifier]->DebtorNo . "', '" . $_SESSION['CreditItems'.$identifier]->Branch . "', 0, - '" . -filter_number_format($CreditLine->DiscountPercent * $CreditLine->Price * $CreditLine->Quantity / $_SESSION['CurrencyRate']) . "', + '" . -$CreditLine->DiscountPercent * $CreditLine->Price * $CreditLine->Quantity / $_SESSION['CurrencyRate'] . "', '" . $CreditLine->StockID . "', custbranch.area, 1, @@ -1718,12 +1716,12 @@ stkcategory) SELECT '" . $_SESSION['CreditItems'.$identifier]->DefaultSalesType . "', '" . $PeriodNo . "', - '" . -filter_number_format($CreditLine->Price * $CreditLine->Quantity / $_SESSION['CurrencyRate']) . "', - '" . -filter_number_format($CreditLine->StandardCost * $CreditLine->Quantity) . "', + '" . -$CreditLine->Price * $CreditLine->Quantity / $_SESSION['CurrencyRate'] . "', + '" . -$CreditLine->StandardCost * $CreditLine->Quantity . "', '" . $_SESSION['CreditItems'.$identifier]->DebtorNo . "', '" . $_SESSION['CreditItems'.$identifier]->Branch . "', - '" . -filter_number_format($CreditLine->Quantity) . "', - '" . -filter_number_format($CreditLine->DiscountPercent * $CreditLine->Price * $CreditLine->Quantity / $_SESSION['CurrencyRate']) . "', + '" . -$CreditLine->Quantity . "', + '" . -$CreditLine->DiscountPercent * $CreditLine->Price * $CreditLine->Quantity / $_SESSION['CurrencyRate'] . "', '" . $CreditLine->StockID . "', custbranch.area, 1, @@ -1769,7 +1767,7 @@ '" . $PeriodNo . "', '" . $COGSAccount . "', '" . $_SESSION['CreditItems'.$identifier]->DebtorNo . " - " . $CreditLine->StockID . " x " . $CreditLine->Quantity . " @ " . $CreditLine->StandardCost . "', - '" . filter_number_format($CreditLine->StandardCost * -$CreditLine->Quantity) . "')"; + '" . ($CreditLine->StandardCost * -$CreditLine->Quantity) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The cost of the stock credited GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); @@ -1794,7 +1792,7 @@ '" . $PeriodNo . "', '" . $_POST['WriteOffGLCode'] . "', '" . $_SESSION['CreditItems'.$identifier]->DebtorNo . " - " . $CreditLine->StockID . " x " . $CreditLine->Quantity . " @ " . $CreditLine->StandardCost . "', - '" . filter_number_format($CreditLine->StandardCost * $CreditLine->Quantity) . "' + '" . ($CreditLine->StandardCost * $CreditLine->Quantity) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The cost of the stock credited GL posting could not be inserted because'); @@ -1817,7 +1815,7 @@ '" . $PeriodNo . "', '" . $StockGLCode['stockact'] . "', '" . $_SESSION['CreditItems'.$identifier]->DebtorNo . " - " . $CreditLine->StockID . " x " . $CreditLine->Quantity . " @ " . $CreditLine->StandardCost . "', - '" . filter_number_format($CreditLine->StandardCost * $CreditLine->Quantity) . "' + '" . ($CreditLine->StandardCost * $CreditLine->Quantity) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The stock side (or write off) of the cost of sales GL posting could not be inserted because'); @@ -1848,7 +1846,7 @@ '" . $PeriodNo . "', '" . $SalesGLAccounts['salesglcode'] . "', '" . $_SESSION['CreditItems'.$identifier]->DebtorNo . " - " . $CreditLine->StockID . " x " . $CreditLine->Quantity . " @ " . $CreditLine->Price . "', - '" . filter_number_format(($CreditLine->Price * $CreditLine->Quantity)/$_SESSION['CurrencyRate']) . "' + '" . (($CreditLine->Price * $CreditLine->Quantity)/$_SESSION['CurrencyRate']) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The credit note GL posting could not be inserted because'); @@ -1870,7 +1868,7 @@ '" . $PeriodNo . "', '" . $SalesGLAccounts['discountglcode'] . "', '" . $_SESSION['CreditItems'.$identifier]->DebtorNo . " - " . $CreditLine->StockID . " @ " . ($CreditLine->DiscountPercent * 100) . "%', - '" . -filter_number_format(($CreditLine->Price * $CreditLine->Quantity * $CreditLine->DiscountPercent)/$_SESSION['CurrencyRate']) . "' + '" . -(($CreditLine->Price * $CreditLine->Quantity * $CreditLine->DiscountPercent)/$_SESSION['CurrencyRate']) . "' )"; @@ -1900,7 +1898,7 @@ '" . $PeriodNo . "', '" . $_SESSION['CompanyRecord']['debtorsact'] . "', '" . $_SESSION['CreditItems'.$identifier]->DebtorNo . "', - '" . -filter_number_format(($_SESSION['CreditItems'.$identifier]->total + $_SESSION['CreditItems'.$identifier]->FreightCost + $TaxTotal)/$_SESSION['CurrencyRate']) . "')"; + '" . -(($_SESSION['CreditItems'.$identifier]->total + $_SESSION['CreditItems'.$identifier]->FreightCost + $TaxTotal)/$_SESSION['CurrencyRate']) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The total debtor GL posting for the credit note could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); @@ -1920,7 +1918,7 @@ '" . $PeriodNo . "', '" . $_SESSION['CompanyRecord']['freightact'] . "', '" . $_SESSION['CreditItems'.$identifier]->DebtorNo . "', - '" . filter_number_format($_SESSION['CreditItems'.$identifier]->FreightCost/$_SESSION['CurrencyRate']) . "')"; + '" . ($_SESSION['CreditItems'.$identifier]->FreightCost/$_SESSION['CurrencyRate']) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The freight GL posting for this credit note could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); @@ -1941,7 +1939,7 @@ '" . $PeriodNo . "', '" . $TaxGLCodes[$TaxAuthID] . "', '" . $_SESSION['CreditItems'.$identifier]->DebtorNo . "', - '" . filter_number_format($TaxAmount/$_SESSION['CurrencyRate']) . "')"; + '" . ($TaxAmount/$_SESSION['CurrencyRate']) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The tax GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); Modified: trunk/SelectCustomer.php =================================================================== --- trunk/SelectCustomer.php 2011-10-08 09:44:56 UTC (rev 4715) +++ trunk/SelectCustomer.php 2011-10-09 00:16:14 UTC (rev 4716) @@ -23,7 +23,7 @@ } echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/customer.png" title="' . _('Customer') . '" alt="" />' . ' ' . _('Customers') . '</p>'; if (!isset($_SESSION['CustomerType'])) { //initialise if not already done - $_SESSION['CustomerType'] = ""; + $_SESSION['CustomerType'] = ''; } // only run geocode if integration is turned on and customer has been selected if ($_SESSION['geocode_integration'] == 1 AND $_SESSION['CustomerID'] != "") { @@ -38,7 +38,7 @@ custbranch.lat, custbranch.lng FROM debtorsmaster LEFT JOIN custbranch - ON debtorsmaster.debtorno = custbranch.debtorno + ON debtorsmaster.debtorno = custbranch.debtorno WHERE debtorsmaster.debtorno = '" . $_SESSION['CustomerID'] . "' ORDER BY debtorsmaster.debtorno"; $ErrMsg = _('An error occurred in retrieving the information'); @@ -85,13 +85,24 @@ $_POST['PageOffset'] = 1; } } -if (isset($_POST['Search']) OR isset($_POST['CSV']) OR isset($_POST['Go']) OR isset($_POST['Next']) OR isset($_POST['Previous'])) { +if (isset($_POST['Search']) + OR isset($_POST['CSV']) + OR isset($_POST['Go']) + OR isset($_POST['Next']) + OR isset($_POST['Previous'])) { + unset($_POST['JustSelectedACustomer']); if (isset($_POST['Search'])) { $_POST['PageOffset'] = 1; } - if (($_POST['Keywords'] == '') AND ($_POST['CustCode'] == '') AND ($_POST['CustPhone'] == '') AND ( $_POST['CustType'] == 'ALL') AND ($_POST['Area'] == 'ALL') AND ($_POST['CustAdd'] == '')) { + if (($_POST['Keywords'] == '') + AND ($_POST['CustCode'] == '') + AND ($_POST['CustPhone'] == '') + AND ($_POST['CustType'] == 'ALL') + AND ($_POST['Area'] == 'ALL') + AND ($_POST['CustAdd'] == '')) { + //no criteria set then default to all customers $SQL = "SELECT debtorsmaster.debtorno, debtorsmaster.name, @@ -200,7 +211,8 @@ echo '<div class="page_help_text">' . _('Select a menu option to operate using this customer') . '.</div><br />'; echo '<table cellpadding=4 width=90% class="selection"> - <tr><th width=33%>' . _('Customer Inquiries') . '</th> + <tr> + <th width=33%>' . _('Customer Inquiries') . '</th> <th width=33%>' . _('Customer Transactions') . '</th> <th width=33%>' . _('Customer Maintenance') . '</th> </tr>'; @@ -231,9 +243,10 @@ <th width=33%>' . _('Customer Transactions') . '</th> <th width=33%>' . _('Customer Maintenance') . '</th> </tr>'; - echo '<tr><td class="select">'; - echo '</td><td class="select">'; - echo '</td><td class="select">'; + echo '<tr> + <td class="select"></td> + <td class="select"></td> + <td class="select">'; if (!isset($_SESSION['SalesmanLogin']) or $_SESSION['SalesmanLogin'] == '') { echo '<a href="' . $rootpath . '/Customers.php?">' . _('Add a New Customer') . '</a><br />'; } @@ -248,18 +261,24 @@ echo '<table cellpadding="3" colspan="4" class="selection">'; echo '<tr><td colspan="2">' . _('Enter a partial Name') . ':</td><td>'; if (isset($_POST['Keywords'])) { - echo '<input type="text" name="Keywords" value="' . $_POST['Keywords'] . '" size="20" maxlength="25">'; + echo '<input type="text" name="Keywords" value="' . $_POST['Keywords'] . '" size="20" maxlength="25" />'; } else { - echo '<input type="text" name="Keywords" size="20" maxlength="25">'; + echo '<input type="text" name="Keywords" size="20" maxlength="25" />'; } -echo '</td><td><font size=3><b>' . _('OR') . '</b></font></td><td>' . _('Enter a partial Code') . ':</td><td>'; +echo '</td> + <td><font size=3><b>' . _('OR') . '</b></font></td><td>' . _('Enter a partial Code') . ':</td> + <td>'; if (isset($_POST['CustCode'])) { echo '<input type="text" name="CustCode" value="' . $_POST['CustCode'] . '" size="15" maxlength="18" />'; } else { echo '<input type="text" name="CustCode" size="15" maxlength="18" />'; } -echo '</td></tr><tr><td><font size=3><b>' . _('OR') . '</b></font></td> - <td>' . _('Enter a partial Phone Number') . ':</td><td>'; +echo '</td> + </tr> + <tr> + <td><font size=3><b>' . _('OR') . '</b></font></td> + <td>' . _('Enter a partial Phone Number') . ':</td> + <td>'; if (isset($_POST['CustPhone'])) { echo '<input type="text" name="CustPhone" value="' . $_POST['CustPhone'] . '" size="15" maxlength="18" />'; } else { @@ -267,15 +286,18 @@ } echo '</td>'; echo '<td><font size=3><b>' . _('OR') . '</b></font></td> - <td>' . _('Enter part of the Address') . ':</td><td>'; + <td>' . _('Enter part of the Address') . ':</td> + <td>'; if (isset($_POST['CustAdd'])) { - echo '<input type="text" name="CustAdd" value="' . $_POST['CustAdd'] . '" size="20" maxlength="25">'; + echo '<input type="text" name="CustAdd" value="' . $_POST['CustAdd'] . '" size="20" maxlength="25" />'; } else { - echo '<input type="text" name="CustAdd" size="20" maxlength="25">'; + echo '<input type="text" name="CustAdd" size="20" maxlength="25" />'; } echo '</td></tr>'; -echo '<tr><td><font size=3><b>' . _('OR') . '</b></font></td> - <td>' . _('Choose a Type') . ':</td><td>'; +echo '<tr> + <td><font size=3><b>' . _('OR') . '</b></font></td> + <td>' . _('Choose a Type') . ':</td> + <td>'; if (isset($_POST['CustType'])) { // Show Customer Type drop down list $result2 = DB_query("SELECT typeid, typename FROM debtortype", $db); @@ -286,8 +308,8 @@ echo '<tr><td colspan="2">' . prnMsg(_('No Customer types defined'), 'error') . '</td></tr>'; } else { // If OK show select box with option selected - echo '<select name="CustType">'; - echo '<option value="ALL">' . _('Any') . '</option>'; + echo '<select name="CustType"> + <option value="ALL">' . _('Any') . '</option>'; while ($myrow = DB_fetch_array($result2)) { if ($_POST['CustType'] == $myrow['typename']) { echo '<option selected value="' . $myrow['typename'] . '">' . $myrow['typename'] . '</option>'; @@ -308,8 +330,8 @@ echo '<tr><td colspan=2>' . prnMsg(_('No Customer types defined'), 'error') . '</td></tr>'; } else { // if OK show select box with available options to choose - echo '<select name="CustType">'; - echo '<option value="ALL">' . _('Any'). '</option>'; + echo '<select name="CustType"> + <option value="ALL">' . _('Any'). '</option>'; while ($myrow = DB_fetch_array($result2)) { echo '<option value="' . $myrow['typename'] . '">' . $myrow['typename'] . '</option>'; } //end while loop @@ -344,8 +366,8 @@ echo '</td></tr></table><br />'; echo '<div class="centre"> - <input type=submit name="Search" value="' . _('Search Now') . '" /> - <input type=submit name="CSV" value="' . _('CSV Format') . '" /> + <input type="submit" name="Search" value="' . _('Search Now') . '" /> + <input type="submit" name="CSV" value="' . _('CSV Format') . '" /> </div>'; if (isset($_SESSION['SalesmanLogin']) and $_SESSION['SalesmanLogin'] != '') { prnMsg(_('Your account enables you to see only customers allocated to you'), 'warn', _('Note: Sales-person Login')); @@ -379,9 +401,9 @@ $ListPage++; } echo '</select> - <input type=submit name="Go1" value="' . _('Go') . '" /> - <input type=submit name="Previous" value="' . _('Previous') . '" /> - <input type=submit name="Next" value="' . _('Next') . '" />'; + <input type="submit" name="Go1" value="' . _('Go') . '" /> + <input type="submit" name="Previous" value="' . _('Previous') . '" /> + <input type="submit" name="Next" value="' . _('Next') . '" />'; echo '</div>'; } echo '<br /> @@ -460,9 +482,9 @@ $ListPage++; } echo '</select> - <input type=submit name="Go2" value="' . _('Go') . '" /> - <input type=submit name="Previous" value="' . _('Previous') . '" /> - <input type=submit name="Next" value="' . _('Next') . '" />'; + <input type="submit" name="Go2" value="' . _('Go') . '" /> + <input type="submit" name="Previous" value="' . _('Previous') . '" /> + <input type="submit" name="Next" value="' . _('Next') . '" />'; } //end if results to show echo '</div></form>'; @@ -474,13 +496,22 @@ if ($lat == 0) { echo '<div class="centre">' . _('Mapping is enabled, but no Mapping data to display for this Customer.') . '</div>'; } else { - echo '<tr><td colspan=2>'; - echo '<table width=45% colspan=2 cellpadding=4>'; - echo '<tr><th width=33%>' . _('Customer Mapping') . '</th></tr>'; - echo '</td><td valign="top">'; /* Mapping */ - echo '<div class="centre">' . _('Mapping is enabled, Map will display below.') . '</div>'; - echo '<div align="center" id="map" style="width: ' . $map_width . 'px; height: ' . $map_height . 'px"></div><br />'; - echo '</th></tr></table>'; + echo '<tr> + <td colspan=2> + <table width="45%" colspan="2" cellpadding="4"> + <tr> + <th width=33%>' . _('Customer Mapping') . '</th> + </tr> + </td> + <th valign="top"> + <div class="centre">' . _('Mapping is enabled, Map will display below.') . ' + </div> + <div align="center" id="map" style="width: ' . $map_width . 'px; height: ' . $map_height . 'px"> + </div> + <br /> + </th> + </tr> + </table>'; } } // Extended Customer Info only if selected in Configuration Modified: trunk/includes/MiscFunctions.php =================================================================== --- trunk/includes/MiscFunctions.php 2011-10-08 09:44:56 UTC (rev 4715) +++ trunk/includes/MiscFunctions.php 2011-10-09 00:16:14 UTC (rev 4716) @@ -317,7 +317,8 @@ function locale_number_format($Number, $DecimalPlaces=0) { global $DecimalPoint; global $ThousandsSeparator; - if ($DecimalPlaces=='Variable'){ + + if (!is_numeric($DecimalPlaces) AND $DecimalPlaces == 'Variable'){ $DecimalPlaces = mb_strlen($Number) - mb_strlen(intval($Number)); if ($DecimalPlaces > 0){ $DecimalPlaces--; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |