|
From: <dai...@us...> - 2011-04-16 06:21:05
|
Revision: 4551
http://web-erp.svn.sourceforge.net/web-erp/?rev=4551&view=rev
Author: daintree
Date: 2011-04-16 06:20:56 +0000 (Sat, 16 Apr 2011)
Log Message:
-----------
various
Modified Paths:
--------------
trunk/InventoryQuantities.php
trunk/Locations.php
trunk/MRPReschedules.php
trunk/OutstandingGRNs.php
trunk/PDFChequeListing.php
trunk/PDFCustTransListing.php
trunk/PDFLowGP.php
trunk/PDFOrderStatus.php
trunk/PDFPrintLabel.php
trunk/PDFStockCheckComparison.php
trunk/POReport.php
trunk/PO_Header.php
trunk/PaymentMethods.php
trunk/PcAssignCashToTab.php
trunk/PcAuthorizeExpenses.php
trunk/PcClaimExpensesFromTab.php
trunk/PcReportTab.php
trunk/PcTypeTabs.php
trunk/Prices.php
trunk/PricesBasedOnMarkUp.php
trunk/Prices_Customer.php
trunk/PrintCustOrder.php
trunk/PrintCustTrans.php
trunk/RecurringSalesOrders.php
trunk/ReorderLevel.php
trunk/ReorderLevelLocation.php
trunk/SalesAnalReptCols.php
trunk/SalesAnalRepts.php
trunk/SalesInquiry.php
trunk/SalesPeople.php
trunk/SalesTypes.php
trunk/SelectCompletedOrder.php
trunk/SelectCustomer.php
trunk/SelectOrderItems.php
trunk/SelectProduct.php
trunk/SelectSupplier.php
trunk/ShipmentCosting.php
trunk/Shipments.php
trunk/Shipt_Select.php
trunk/StockCategories.php
trunk/StockCheck.php
trunk/StockCostUpdate.php
trunk/StockQties_csv.php
trunk/StockSerialItems.php
trunk/StockTransferControlled.php
trunk/StockUsage.php
trunk/Stocks.php
trunk/SuppInvGRNs.php
trunk/SupplierAllocations.php
trunk/SupplierBalsAtPeriodEnd.php
trunk/SupplierCredit.php
trunk/SupplierInvoice.php
trunk/SupplierTypes.php
trunk/Suppliers.php
trunk/WOSerialNos.php
trunk/WorkOrderEntry.php
trunk/WorkOrderIssue.php
trunk/doc/Change.log.html
trunk/report_runner.php
Modified: trunk/InventoryQuantities.php
===================================================================
--- trunk/InventoryQuantities.php 2011-04-14 10:28:52 UTC (rev 4550)
+++ trunk/InventoryQuantities.php 2011-04-16 06:20:56 UTC (rev 4551)
@@ -1,12 +1,11 @@
<?php
-/* $Revision: 1.4 $ */
/* $Id$ */
// InventoryQuantities.php - Report of parts with quantity. Sorts by part and shows
// all locations where there are quantities of the part
-//$PageSecurity = 2;
+
include('includes/session.inc');
If (isset($_POST['PrintPDF'])) {
@@ -83,9 +82,9 @@
$title = _('Inventory Quantities') . ' - ' . _('Problem Report');
include('includes/header.inc');
prnMsg( _('The Inventory Quantity report could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error');
- echo "<br><a href='" .$rootpath .'/index.php?' . SID . "'>" . _('Back to the menu') . '</a>';
+ echo '<br><a href="' .$rootpath .'/index.php?' . SID . '">' . _('Back to the menu') . '</a>';
if ($debug==1){
- echo "<br>$sql";
+ echo '<br>' . $sql;
}
include('includes/footer.inc');
exit;
@@ -94,7 +93,7 @@
$title = _('Print Inventory Quantities Report');
include('includes/header.inc');
prnMsg(_('There were no items with inventory quantities'),'error');
- echo "<br><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>';
+ echo '<br><a href="'.$rootpath.'/index.php?">' . _('Back to the menu') . '</a>';
include('includes/footer.inc');
exit;
}
@@ -148,12 +147,12 @@
echo '<div class="page_help_text">' . _('Use this report to display the quantity of Inventory items in different categories.') . '</div><br>';
- echo '</br></br><form action=' . $_SERVER['PHP_SELF'] . " method='post'><table>";
+ echo '</br></br><form action=' . $_SERVER['PHP_SELF'] . ' method="post"><table>';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
echo '<table class=selection><tr><td>';
- echo '<tr><td>' . _('Selection') . ":</td><td><select name='Selection'>";
- echo "<option selected value='All'>" . _('All');
- echo "<option value='Multiple'>" . _('Only Parts With Multiple Locations');
+ echo '<tr><td>' . _('Selection') . ':</td><td><select name="Selection">';
+ echo '<option selected value="All">' . _('All') . '</option>';
+ echo '<option value="Multiple">' . _('Only Parts With Multiple Locations') . '</option>';
echo '</select></td></tr>';
$SQL="SELECT categoryid, categorydescription FROM stockcategory where stocktype<>'A' ORDER BY categorydescription";
@@ -185,7 +184,7 @@
}
}
echo '</select></td></tr>';
- echo "</table><p><div class='centre'><input type=submit name='PrintPDF' value='" . _('Print PDF') . "'></div>";
+ echo '</table><p><div class="centre"><input type=submit name="PrintPDF" value="' . _('Print PDF') . '"></div>';
include('includes/footer.inc');
Modified: trunk/Locations.php
===================================================================
--- trunk/Locations.php 2011-04-14 10:28:52 UTC (rev 4550)
+++ trunk/Locations.php 2011-04-16 06:20:56 UTC (rev 4551)
@@ -1,10 +1,7 @@
<?php
/* $Id$*/
-/* $Revision: 1.25 $ */
-//$PageSecurity = 11;
-
include('includes/session.inc');
$title = _('Location Maintenance');
@@ -374,18 +371,19 @@
$myrow['managed'] = _('No');
}
*/
- printf("<td>%s</td>
+ printf('<td>%s</td>
<td>%s</td>
<td>%s</td>
- <td><a href='%sSelectedLocation=%s'>" . _('Edit') . "</td>
- <td><a href='%sSelectedLocation=%s&delete=1'>" . _('Delete') . '</td>
+ <td>%s</td>
+ <td><a href="%sSelectedLocation=%s">' . _('Edit') . '</td>
+ <td><a href="%sSelectedLocation=%s&delete=1">' . _('Delete') . '</td>
</tr>',
$myrow['loccode'],
$myrow['locationname'],
$myrow['description'],
- $_SERVER['PHP_SELF'] . '?' . SID . '&',
+ $_SERVER['PHP_SELF'] . '?',
$myrow['loccode'],
- $_SERVER['PHP_SELF'] . '?' . SID . '&',
+ $_SERVER['PHP_SELF'] . '?',
$myrow['loccode']);
}
@@ -399,11 +397,11 @@
if (isset($SelectedLocation)) {
echo '<a href="' . $_SERVER['PHP_SELF'] . '">' . _('Review Records') . '</a>';
}
-echo "<p>";
+echo '<br />';
if (!isset($_GET['delete'])) {
- echo "<form method='post' action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>";
+ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
if (isset($SelectedLocation)) {
@@ -451,8 +449,8 @@
$_POST['Managed'] = $myrow['managed'];
- echo "<input type=hidden name=SelectedLocation VALUE=" . $SelectedLocation . '>';
- echo "<input type=hidden name=LocCode VALUE=" . $_POST['LocCode'] . '>';
+ echo '<input type=hidden name=SelectedLocation VALUE="' . $SelectedLocation . '>';
+ echo '<input type=hidden name=LocCode VALUE="' . $_POST['LocCode'] . '>';
echo '<table class=selection>';
echo '<tr><th colspan=2><font size=3 color=blue>'._('Amend Location details').'</font></th></tr>';
echo '<tr><td>' . _('Location Code') . ':</td><td>';
Modified: trunk/MRPReschedules.php
===================================================================
--- trunk/MRPReschedules.php 2011-04-14 10:28:52 UTC (rev 4550)
+++ trunk/MRPReschedules.php 2011-04-16 06:20:56 UTC (rev 4551)
@@ -46,9 +46,9 @@
$title = _('MRP Reschedules') . ' - ' . _('Problem Report');
include('includes/header.inc');
prnMsg( _('The MRP reschedules could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error');
- echo "<br><a href='" .$rootpath .'/index.php?' . SID . "'>" . _('Back to the menu') . '</a>';
+ echo '<br><a href="' .$rootpath .'/index.php?' . SID . '">' . _('Back to the menu') . '</a>';
if ($debug==1){
- echo "<br>$sql";
+ echo '<br>' . $sql;
}
include('includes/footer.inc');
exit;
@@ -58,9 +58,9 @@
$title = _('MRP Reschedules') . ' - ' . _('Problem Report');
include('includes/header.inc');
prnMsg( _('No MRP reschedule retrieved'), 'warn');
- echo "<br><a href='" .$rootpath .'/index.php?' . SID . "'>" . _('Back to the menu') . '</a>';
+ echo '<br><a href="' .$rootpath .'/index.php?' . SID . '">' . _('Back to the menu') . '</a>';
if ($debug==1){
- echo "<br>$sql";
+ echo '<br>' . $sql;
}
include('includes/footer.inc');
exit;
@@ -114,32 +114,7 @@
PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width,
$Right_Margin);
}
-/*Print out the grand totals */
- //$pdf->addTextWrap(80,$YPos,260-$Left_Margin,$FontSize,_('Grand Total Value'), 'right');
- //$DisplayTotalVal = number_format($Tot_Val,2);
- //$pdf->addTextWrap(500,$YPos,60,$FontSize,$DisplayTotalVal, 'right');
-/* UldisN
- $pdfcode = $pdf->output();
- $len = strlen($pdfcode);
- if ($len<=20){
- $title = _('Print MRP Reschedules Error');
- include('includes/header.inc');
- prnMsg(_('There were no items with due dates different from MRP dates'),'error');
- echo "<br><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>';
- include('includes/footer.inc');
- exit;
- } else {
- header('Content-type: application/pdf');
- header("Content-Length: " . $len);
- header('Content-Disposition: inline; filename=MRPReschedules.pdf');
- header('Expires: 0');
- header('Cache-Control: private, post-check=0, pre-check=0');
- header('Pragma: public');
-
- $pdf->Output('MRPRescedules.pdf', 'I');
- }
-*/
$pdf->OutputD($_SESSION['DatabaseName'] . '_MRPReschedules_' . date('Y-m-d').'.pdf');//UldisN
$pdf->__destruct(); //UldisN
@@ -151,19 +126,19 @@
echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="'
. _('Stock') . '" alt="" />' . ' ' . $title . '</p>';
- echo '</br></br><form action=' . $_SERVER['PHP_SELF'] . " method='post'><table class=selection>";
+ echo '</br></br><form action=' . $_SERVER['PHP_SELF'] . ' method="post"><table class=selection>';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
- echo '<tr><td>' . _('Print Option') . ":</td><td><select name='Fill'>";
- echo "<option selected value='yes'>" . _('Print With Alternating Highlighted Lines');
- echo "<option value='no'>" . _('Plain Print');
+ echo '<tr><td>' . _('Print Option') . ':</td><td><select name="Fill">';
+ echo '<option selected value="yes">' . _('Print With Alternating Highlighted Lines');
+ echo '<option value="no">' . _('Plain Print');
echo '</select></td></tr>';
- echo '<tr><td>' . _('Selection') . ":</td><td><select name='Selection'>";
- echo "<option selected value='All'>" . _('All')."</option>";
- echo "<option value='WO'>" . _('Work Orders Only')."</option>";
- echo "<option value='PO'>" . _('Purchase Orders Only')."</option>";
+ echo '<tr><td>' . _('Selection') . ':</td><td><select name="Selection">';
+ echo '<option selected value="All">' . _('All').'</option>';
+ echo '<option value="WO">' . _('Work Orders Only').'</option>';
+ echo '<option value="PO">' . _('Purchase Orders Only').'</option>';
echo '</select></td></tr>';
- echo "</table><br>";
- echo "<div class='centre'><input type=submit name='PrintPDF' value='" . _('Print PDF') . "'></div>";
+ echo '</table><br>';
+ echo '<div class="centre"><input type=submit name="PrintPDF" value="' . _('Print PDF') . '"></div>';
include('includes/footer.inc');
Modified: trunk/OutstandingGRNs.php
===================================================================
--- trunk/OutstandingGRNs.php 2011-04-14 10:28:52 UTC (rev 4550)
+++ trunk/OutstandingGRNs.php 2011-04-16 06:20:56 UTC (rev 4551)
@@ -51,9 +51,9 @@
$title = _('Outstanding GRN Valuation') . ' - ' . _('Problem Report');
include('includes/header.inc');
prnMsg(_('The outstanding GRNs valuation details could not be retrieved by the SQL because') . ' - ' . DB_error_msg($db),'error');
- echo "<br><a href='" .$rootpath ."/index.php?" . SID . "'>" . _('Back to the menu') . '</a>';
+ echo '<br><a href="' .$rootpath .'/index.php">' . _('Back to the menu') . '</a>';
if ($debug==1){
- echo "<br>".$SQL;
+ echo '<br>'.$SQL;
}
include('includes/footer.inc');
exit;
@@ -63,9 +63,9 @@
$title = _('Outstanding GRN Valuation') . ' - ' . _('Problem Report');
include('includes/header.inc');
prnMsg(_('No outstanding GRNs valuation details retrieved'), 'warn');
- echo "<br><a href='" .$rootpath ."/index.php?" . SID . "'>" . _('Back to the menu') . '</a>';
+ echo '<br><a href="' .$rootpath .'/index.php">' . _('Back to the menu') . '</a>';
if ($debug==1){
- echo "<br>$SQL";
+ echo '<br>'.$SQL;
}
include('includes/footer.inc');
exit;
@@ -142,28 +142,7 @@
$LeftOvers = $pdf->addTextWrap(500,$YPos,60,$FontSize,$DisplayTotalVal, 'right');
$pdf->line($Left_Margin, $YPos+$line_height-2,$Page_Width-$Right_Margin, $YPos+$line_height-2);
$YPos -=(2*$line_height);
-/* UldisN
- $pdfcode = $pdf->output();
- $len = strlen($pdfcode);
- if ($len<=20){
- $title = _('Outstanding GRNs Valuation Error');
- include('includes/header.inc');
- prnMsg(_('There were no GRNs with any value to print out for the specified supplier range'),'info');
- echo "<br><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>';
- include('includes/footer.inc');
- exit;
- } else {
- header('Content-type: application/pdf');
- header('Content-Length: ' . $len);
- header('Content-Disposition: inline; filename=OSGRNsValuation.pdf');
- header('Expires: 0');
- header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
- header('Pragma: public');
-
- $pdf->Output('OutstandingGRNs.pdf','I');
- }
-*/
$pdf->OutputD($_SESSION['DatabaseName'] . '_OSGRNsValuation_' . date('Y-m-d').'.pdf');//UldisN
$pdf->__destruct(); //UldisN
} else { /*The option to print PDF was not hit */
@@ -174,15 +153,15 @@
echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') .
'" alt="" />' . ' ' . $title . '</p>';
- echo '<form action=' . $_SERVER['PHP_SELF'] . " method='POST'><table class=selection>";
+ echo '<form action=' . $_SERVER['PHP_SELF'] . ' method="POST"><table class=selection>';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
- echo '<tr><td>' . _('From Supplier Code') . ":</td>
- <td><input type=text name='FromCriteria' value='0'></td></tr>";
- echo '<tr><td>' . _('To Supplier Code'). ":</td>
- <td><input type=text name='ToCriteria' value='zzzzzzz'></td></tr>";
+ echo '<tr><td>' . _('From Supplier Code') . ':</td>
+ <td><input type=text name="FromCriteria" value="0"></td></tr>';
+ echo '<tr><td>' . _('To Supplier Code'). ':</td>
+ <td><input type=text name="ToCriteria" value="zzzzzzz"></td></tr>';
- echo "</table><br><div class='centre'><input type=Submit Name='PrintPDF' Value='" . _('Print PDF') . "'></div>";
+ echo '</table><br><div class="centre"><input type=Submit Name="PrintPDF" Value="' . _('Print PDF') . '"></div>';
include('includes/footer.inc');
Modified: trunk/PDFChequeListing.php
===================================================================
--- trunk/PDFChequeListing.php 2011-04-14 10:28:52 UTC (rev 4550)
+++ trunk/PDFChequeListing.php 2011-04-16 06:20:56 UTC (rev 4551)
@@ -2,9 +2,6 @@
/* $Id$*/
-/* $Revision: 1.13 $ */
-
-//$PageSecurity = 3;
include('includes/SQL_CommonFunctions.inc');
include ('includes/session.inc');
@@ -33,37 +30,40 @@
prnMsg($msg,'error');
}
- echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '>';
+ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
echo '<table class=selection>
<tr>
- <td>' . _('Enter the date from which cheques are to be listed') . ":</td>
- <td><input type=text name='FromDate' maxlength=10 size=10 class=date alt='".$_SESSION['DefaultDateFormat']."' VALUE='" . Date($_SESSION['DefaultDateFormat']) . "'></td>
- </tr>";
- echo '<tr><td>' . _('Enter the date to which cheques are to be listed') . ":</td>
- <td><input type=text name='ToDate' maxlength=10 size=10 class=date alt='".$_SESSION['DefaultDateFormat']."' VALUE='" . Date($_SESSION['DefaultDateFormat']) . "'></td>
- </tr>";
+ <td>' . _('Enter the date from which cheques are to be listed') . ':</td>
+ <td><input type="text" name="FromDate" maxlength="10" size="10" class=date alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td>
+ </tr>';
+ echo '<tr><td>' . _('Enter the date to which cheques are to be listed') . ':</td>
+ <td><input type=text name="ToDate" maxlength="10" size="10" class=date alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td>
+ </tr>';
echo '<tr><td>' . _('Bank Account') . '</td><td>';
- $sql = 'SELECT bankaccountname, accountcode FROM bankaccounts';
+ $sql = "SELECT bankaccountname, accountcode FROM bankaccounts";
$result = DB_query($sql,$db);
- echo "<select name='BankAccount'>";
+ echo '<select name="BankAccount">';
while ($myrow=DB_fetch_array($result)){
- echo '<option VALUE=' . $myrow['accountcode'] . '>' . $myrow['bankaccountname'];
+ echo '<option VALUE=' . $myrow['accountcode'] . '>' . $myrow['bankaccountname'] . '</option>';
}
echo '</select></td></tr>';
- echo '<tr><td>' . _('Email the report off') . ":</td><td><select name='Email'>";
- echo "<option selected VALUE='No'>" . _('No');
- echo "<option VALUE='Yes'>" . _('Yes');
- echo "</select></td></tr></table><br><div class='centre'><input type=submit name='Go' VALUE='" . _('Create PDF') . "'></div>";
+ echo '<tr><td>' . _('Email the report off') . ':</td>
+ <td><select name="Email">';
+ echo '<option selected value="No">' . _('No') . '</option>';
+ echo '<option value="Yes">' . _('Yes') . '</option>';
+ echo '</select></td>
+ </tr>
+ </table>
+ <br /><div class="centre"><input type=submit name="Go" value="' . _('Create PDF') . '"></div>';
-
include('includes/footer.inc');
exit;
} else {
@@ -71,7 +71,6 @@
include('includes/ConnectDB.inc');
}
-
$SQL = "SELECT bankaccountname
FROM bankaccounts
WHERE accountcode = '" .$_POST['BankAccount'] . "'";
@@ -91,14 +90,13 @@
AND transdate >='" . FormatDateForSQL($_POST['FromDate']) . "'
AND transdate <='" . FormatDateForSQL($_POST['ToDate']) . "'";
-
$Result=DB_query($SQL,$db,'','',false,false);
if (DB_error_no($db)!=0){
$title = _('Payment Listing');
include('includes/header.inc');
prnMsg(_('An error occurred getting the payments'),'error');
if ($Debug==1){
- prnMsg(_('The SQL used to get the receipt header information that failed was') . ':<br>' . $SQL,'error');
+ prnMsg(_('The SQL used to get the receipt header information that failed was') . ':<br />' . $SQL,'error');
}
include('includes/footer.inc');
exit;
@@ -124,7 +122,7 @@
while ($myrow=DB_fetch_array($Result)){
- $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,number_format(-$myrow['amount'],2), 'right');
+ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,number_format(-$myrow['amount'],2), 'right');
$LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,90,$FontSize,$myrow['ref'], 'left');
$sql = "SELECT accountname,
@@ -160,12 +158,12 @@
}
DB_free_result($GLTransResult);
- $YPos -= ($line_height);
- $TotalCheques = $TotalCheques - $myrow['amount'];
+ $YPos -= ($line_height);
+ $TotalCheques = $TotalCheques - $myrow['amount'];
- if ($YPos - (2 *$line_height) < $Bottom_Margin){
+ if ($YPos - (2 *$line_height) < $Bottom_Margin){
/*Then set up a new page */
- $PageNumber++;
+ $PageNumber++;
include ('includes/PDFChequeListingPageHeader.inc');
} /*end of new page header */
} /* end of while there are customer receipts in the batch to print */
@@ -175,21 +173,9 @@
$LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,number_format($TotalCheques,2), 'right');
$LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,300,$FontSize,_('TOTAL') . ' ' . $Currency . ' ' . _('CHEQUES'), 'left');
-/* UldisN
-$pdfcode = $pdf->output();
-$len = strlen($pdfcode);
-header('Content-type: application/pdf');
-header('Content-Length: ' . $len);
-header('Content-Disposition: inline; filename=ChequeListing.pdf');
-header('Expires: 0');
-header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
-header('Pragma: public');
-
-$pdf->stream();
-*/
$ReportFileName = $_SESSION['DatabaseName'] . '_ChequeListing_' . date('Y-m-d').'.pdf';
-$pdf->OutputD($ReportFileName);//UldisN
-$pdf->__destruct(); //UldisN
+$pdf->OutputD($ReportFileName);
+$pdf->__destruct();
if ($_POST['Email']=='Yes'){
if (file_exists($_SESSION['reports_dir'] . '/'.$ReportFileName)){
unlink($_SESSION['reports_dir'] . '/'.$ReportFileName);
Modified: trunk/PDFCustTransListing.php
===================================================================
--- trunk/PDFCustTransListing.php 2011-04-14 10:28:52 UTC (rev 4550)
+++ trunk/PDFCustTransListing.php 2011-04-16 06:20:56 UTC (rev 4551)
@@ -28,9 +28,9 @@
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
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>
- </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>
+ </tr>';
echo '<tr><td>' . _('Transaction type') . '</td><td>';
Modified: trunk/PDFLowGP.php
===================================================================
--- trunk/PDFLowGP.php 2011-04-14 10:28:52 UTC (rev 4550)
+++ trunk/PDFLowGP.php 2011-04-16 06:20:56 UTC (rev 4551)
@@ -2,9 +2,6 @@
/* $Id$*/
-/* $Revision: 1.15 $ */
-
-//$PageSecurity = 2;
include('includes/session.inc');
if (!isset($_POST['FromCat']) OR $_POST['FromCat']=='') {
@@ -60,9 +57,9 @@
include('includes/header.inc');
prnMsg(_('The low GP items could not be retrieved by the SQL because') . ' - ' . DB_error_msg($db),'error');
- echo "<br><a href='" .$rootpath ."/index.php?" . SID . "'>" . _('Back to the menu') . '</a>';
+ echo '<br /><a href="' .$rootpath .'/index.php">' . _('Back to the menu') . '</a>';
if ($debug==1){
- echo "<br>$SQL";
+ echo '<br />' . $SQL;
}
include('includes/footer.inc');
exit;
@@ -72,9 +69,9 @@
include('includes/header.inc');
prnMsg(_('No low GP items retrieved'), 'warn');
- echo "<br><a href='" . $rootpath . "/index.php?" . SID . "'>" . _('Back to the menu') . '</a>';
+ echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>';
if ($debug==1){
- echo "<br>$SQL";
+ echo '<br />' . $SQL;
}
include('includes/footer.inc');
exit;
@@ -112,31 +109,9 @@
$FontSize =10;
$YPos -= (2*$line_height);
-/* UldisN
- $pdfcode = $pdf->output();
- $len = strlen($pdfcode);
+ $pdf->OutputD($_SESSION['DatabaseName'] . '_LowGPSales_' . date('Y-m-d') . '.pdf');
+ $pdf->__destruct();
- if ($len<=20){
- $title = _('Print Low GP Items Error');
- include('includes/header.inc');
- prnMsg (_('There were no items below print out for the location specified'),'error');
- echo "<br><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>';
- include('includes/footer.inc');
- exit;
- } else {
- header('Content-type: application/pdf');
- header('Content-Length: ' . $len);
- header('Content-Disposition: inline; filename=LowGPSales.pdf');
- header('Expires: 0');
- header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
- header('Pragma: public');
-
- $pdf->Output('PDFLowGP.pdf', 'I');
- }
-*/
- $pdf->OutputD($_SESSION['DatabaseName'] . '_LowGPSales_' . date('Y-m-d') . '.pdf');//UldisN
- $pdf->__destruct(); //UldisN
-
} else { /*The option to print PDF was not hit */
include('includes/header.inc');
@@ -150,22 +125,24 @@
$_POST['FromDate']=Date($_SESSION['DefaultDateFormat']);
$_POST['ToDate']=Date($_SESSION['DefaultDateFormat']);
$_POST['GPMin']=0;
- echo '<form action=' . $_SERVER['PHP_SELF'] . " method='POST'><table class=selection>";
+ echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">
+ <table class="selection">';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
- echo '<tr><td>' . _('Sales Made From') . ' (' . _('in the format') . ' ' . $_SESSION['DefaultDateFormat'] . "):</td>
- <td><input type=text class='date' alt='".$_SESSION['DefaultDateFormat']."' name='FromDate' size=10 maxlength=10 VALUE='" . $_POST['FromDate'] . "'></td>
- </tr>";
+ echo '<tr><td>' . _('Sales Made From') . ' (' . _('in the format') . ' ' . $_SESSION['DefaultDateFormat'] . '):</td>
+ <td><input type=text class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="FromDate" size=10 maxlength="10" value="' . $_POST['FromDate'] . '"></td>
+ </tr>';
- echo '<tr><td>' . _('Sales Made To') . ' (' . _('in the format') . ' ' . $_SESSION['DefaultDateFormat'] . "):</td>
- <td><input type=text class='date' alt='".$_SESSION['DefaultDateFormat']."' name='ToDate' size=10 maxlength=10 VALUE='" . $_POST['ToDate'] . "'></td>
- </tr>";
+ echo '<tr><td>' . _('Sales Made To') . ' (' . _('in the format') . ' ' . $_SESSION['DefaultDateFormat'] . '):</td>
+ <td><input type=text class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="ToDate" size="10" maxlength="10" value="' . $_POST['ToDate'] . '"></td>
+ </tr>';
- echo '<tr><td>' . _('Show sales with GP') . '%' . _('below') . ":</td>
- <td><input type=text class='number' name='GPMin' maxlength=3 size=3 value=" . $_POST['GPMin'] . "></td>
- </tr>";
+ echo '<tr><td>' . _('Show sales with GP') . '%' . _('below') . ':</td>
+ <td><input type=text class="number" name="GPMin" maxlength="3" size="3" value="' . $_POST['GPMin'] . '"></td>
+ </tr>';
- echo "</table><br><div class='centre'><input type=Submit Name='PrintPDF' Value='" . _('Print PDF') . "'></div>";
+ echo '</table>
+ <br /><div class="centre"><input type="submit" name="PrintPDF" value="' . _('Print PDF') . '"></div>';
}
include('includes/footer.inc');
Modified: trunk/PDFOrderStatus.php
===================================================================
--- trunk/PDFOrderStatus.php 2011-04-14 10:28:52 UTC (rev 4550)
+++ trunk/PDFOrderStatus.php 2011-04-16 06:20:56 UTC (rev 4551)
@@ -2,9 +2,6 @@
/* $Id$*/
-/* $Revision: 1.10 $ */
-
-//$PageSecurity = 3;
include ('includes/session.inc');
include('includes/SQL_CommonFunctions.inc');
@@ -33,38 +30,45 @@
echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt="" />' . ' '
. _('Order Status Report') . '</p>';
- echo "<form method='post' action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>";
+ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
- echo '<table class=selection><tr><td>' . _('Enter the date from which orders are to be listed') . ":</td><td><input type=text class='date' alt='".$_SESSION['DefaultDateFormat']."' name='FromDate' maxlength=10 size=10 VALUE='" . Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m'),Date('d')-1,Date('y'))) . "'></td></tr>";
- echo '<tr><td>' . _('Enter the date to which orders are to be listed') . ":</td><td>";
- echo "<input type=text class='date' alt='".$_SESSION['DefaultDateFormat']."' name='ToDate' maxlength=10 size=10 VALUE='" . Date($_SESSION['DefaultDateFormat']) . "'></td></tr>";
+ echo '<table class=selection>
+ <tr>
+ <td>' . _('Enter the date from which orders are to be listed') . ':</td>
+ <td><input type=text class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="FromDate" maxlength=10 size=10 value="' . Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m'),Date('d')-1,Date('y'))) . '"></td>
+ </tr>';
+ echo '<tr><td>' . _('Enter the date to which orders are to be listed') . ':</td><td>';
+ echo '<input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="ToDate" maxlength=10 size=10 value="' . Date($_SESSION['DefaultDateFormat']) . '"></td></tr>';
echo '<tr><td>' . _('Inventory Category') . '</td><td>';
$sql = "SELECT categorydescription, categoryid FROM stockcategory WHERE stocktype<>'D' AND stocktype<>'L'";
$result = DB_query($sql,$db);
- echo "<select name='CategoryID'>";
- echo "<option selected VALUE='All'>" . _('Over All Categories');
+ echo '<select name="CategoryID">';
+ echo '<option selected value="All">' . _('Over All Categories') . '</option>';
while ($myrow=DB_fetch_array($result)){
- echo '<option value=' . $myrow['categoryid'] . '>' . $myrow['categorydescription'];
+ echo '<option value=' . $myrow['categoryid'] . '>' . $myrow['categorydescription'] . '</option>';
}
echo '</select></td></tr>';
echo '<tr><td>' . _('Inventory Location') . ':</td><td><select name="Location">';
echo '<option selected value="All">' . _('All Locations');
- $result= DB_query('SELECT loccode, locationname FROM locations',$db);
+ $result= DB_query("SELECT loccode, locationname FROM locations",$db);
while ($myrow=DB_fetch_array($result)){
- echo "<option VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname'];
+ echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>';
}
echo '</select></td></tr>';
- echo '<tr><td>' . _('Back Order Only') . ":</td><td><select name='BackOrders'>";
- echo "<option selected VALUE='Yes'>" . _('Only Show Back Orders');
- echo "<option VALUE='No'>" . _('Show All Orders');
- echo "</select></td></tr></table><br><div class='centre'><input type=submit name='Go' value='" . _('Create PDF') . "'></div>";
+ echo '<tr><td>' . _('Back Order Only') . ':</td><td><select name="BackOrders">';
+ echo '<option selected value="Yes">' . _('Only Show Back Orders') . '</option>';
+ echo '<option value="No">' . _('Show All Orders') . '</option>';
+ echo '</select></td>
+ </tr>
+ </table>
+ <br /><div class="centre"><input type=submit name="Go" value="' . _('Create PDF') . '"></div>';
include('includes/footer.inc');
exit;
@@ -229,10 +233,10 @@
}
if ($_POST['BackOrders']=='Yes'){
- $sql .= ' AND salesorderdetails.quantity-salesorderdetails.qtyinvoiced >0';
+ $sql .= " AND salesorderdetails.quantity-salesorderdetails.qtyinvoiced >0";
}
-$sql .= ' ORDER BY salesorders.orderno';
+$sql .= " ORDER BY salesorders.orderno";
$Result=DB_query($sql,$db,'','',false,false); //dont trap errors here
@@ -332,23 +336,11 @@
$YPos -= ($line_height);
if ($YPos - (2 *$line_height) < $Bottom_Margin){
/*Then set up a new page */
- $PageNumber++;
- include ('includes/PDFOrderStatusPageHeader.inc');
+ $PageNumber++;
+ include ('includes/PDFOrderStatusPageHeader.inc');
$OrderNo=0;
} /*end of new page header */
} /* end of while there are delivery differences to print */
-/* UldisN
-$pdfcode = $pdf->output();
-$len = strlen($pdfcode);
-header('Content-type: application/pdf');
-header('Content-Length: ' . $len);
-header('Content-Disposition: inline; filename=OrderStatus.pdf');
-header('Expires: 0');
-header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
-header('Pragma: public');
-
-$pdf->stream();
-*/
$pdf->OutputD($_SESSION['DatabaseName'] . '_OrderStatus_' . date('Y-m-d') . '.pdf');//UldisN
$pdf->__destruct(); //UldisN
?>
\ No newline at end of file
Modified: trunk/PDFPrintLabel.php
===================================================================
--- trunk/PDFPrintLabel.php 2011-04-14 10:28:52 UTC (rev 4550)
+++ trunk/PDFPrintLabel.php 2011-04-16 06:20:56 UTC (rev 4551)
@@ -17,7 +17,7 @@
// If there is no label templates, the user could select to set up a new one
if ($AllLabels==null) {
- echo '<br/><br/>';
+
abortMsg( _('There isn\'t any label template to select for printing. Click') .
' <a href="Labels.php"><b>' . _('HERE'). '</b></a> '. _('to set up a new one') );
}
@@ -49,9 +49,9 @@
$DocumentPaper='LETTER';
$DocumentOrientation='P'; // Correccion para la version trunk :(
include('includes/PDFStarter.php');
- if ($Version>="3.12")
+ if ($Version>='3.12')
$pdf->setPageFormat($formatPage);
- $ok = printLabels(
+ $ok = printLabels(
$dimensions,
$lines,
intval($_POST['QtyByItem']),
Modified: trunk/PDFStockCheckComparison.php
===================================================================
--- trunk/PDFStockCheckComparison.php 2011-04-14 10:28:52 UTC (rev 4550)
+++ trunk/PDFStockCheckComparison.php 2011-04-16 06:20:56 UTC (rev 4551)
@@ -168,7 +168,7 @@
'" . $SQLAdjustmentDate . "',
'" . $PeriodNo . "',
'" . $StockGLCodes['stockact'] . "',
- '" . $myrow['standardcost'] * $StockQtyDifference . ", '" . $myrow['stockid'] . " x " . $StockQtyDifference . " @ " . $myrow['standardcost'] . " - " . _('Inventory Check') . "')";
+ '" . $myrow['standardcost'] * $StockQtyDifference . "', '" . $myrow['stockid'] . " x " . $StockQtyDifference . " @ " . $myrow['standardcost'] . " - " . _('Inventory Check') . "')";
$Result = DB_query($SQL,$db, $ErrMsg, $DbgMsg, true);
} //END INSERT GL TRANS
@@ -222,7 +222,7 @@
if ($Location!=$CheckItemRow['loccode']){
$FontSize=14;
- if ($Location!=''){ /*Then it's NOT the first time round */
+ if ($Location!=''){ /*Then it is NOT the first time round */
/*draw a line under the Location*/
$pdf->line($Left_Margin, $YPos-2,$Page_Width-$Right_Margin, $YPos-2);
$YPos -=$line_height;
@@ -236,7 +236,7 @@
if ($Category!=$CheckItemRow['categoryid']){
$FontSize=12;
- if ($Category!=''){ /*Then it's NOT the first time round */
+ if ($Category!=''){ /*Then it is NOT the first time round */
/*draw a line under the CATEGORY TOTAL*/
$pdf->line($Left_Margin, $YPos-2,$Page_Width-$Right_Margin, $YPos-2);
$YPos -=$line_height;
@@ -335,10 +335,10 @@
if ($_POST['ReportOrClose']=='ReportAndClose'){
//need to print the report first before this but don't risk re-adjusting all the stock!!
- $sql = 'TRUNCATE TABLE stockcheckfreeze';
+ $sql = "TRUNCATE TABLE stockcheckfreeze";
$result = DB_query($sql,$db);
- $sql = 'TRUNCATE TABLE stockcounts';
+ $sql = "TRUNCATE TABLE stockcounts";
$result = DB_query($sql,$db);
}
@@ -356,11 +356,11 @@
echo '<tr><td>' . _('Choose Option'). ':</font></td><td><select name="ReportOrClose">';
if ($_POST['ReportOrClose']=='ReportAndClose'){
- echo '<option selected VALUE="ReportAndClose">'. _('Report and Close the Inventory Comparison Processing Adjustments As Necessary');
- echo '<option VALUE="ReportOnly">'. _('Report The Inventory Comparison Differences Only - No Adjustments');
+ echo '<option selected VALUE="ReportAndClose">'. _('Report and Close the Inventory Comparison Processing Adjustments As Necessary') . '</option>';
+ echo '<option VALUE="ReportOnly">'. _('Report The Inventory Comparison Differences Only - No Adjustments') . '</option>';
} else {
- echo '<option selected VALUE="ReportOnly">' . _('Report The Inventory Comparison Differences Only - No Adjustments');
- echo '<option VALUE="ReportAndClose">' . _('Report and Close the Inventory Comparison Processing Adjustments As Necessary');
+ echo '<option selected VALUE="ReportOnly">' . _('Report The Inventory Comparison Differences Only - No Adjustments') . '</option>';
+ echo '<option VALUE="ReportAndClose">' . _('Report and Close the Inventory Comparison Processing Adjustments As Necessary') . '</option>';
}
echo '</select></td></tr>';
@@ -369,11 +369,11 @@
echo '<tr><td>'. _('Action for Zero Counts') . ':</td><td><select name="ZeroCounts">';
if ($_POST['ZeroCounts'] =='Adjust'){
- echo '<option selected VALUE="Adjust">'. _('Adjust System stock to Nil');
- echo '<option VALUE="Leave">' . _("Don't Adjust System stock to Nil");
+ echo '<option selected VALUE="Adjust">'. _('Adjust System stock to Nil') . '</option>';
+ echo '<option VALUE="Leave">' . _('Do not Adjust System stock to Nil') . '</option>';
} else {
- echo '<option VALUE="Adjust">'. _('Adjust System stock to Nil');
- echo '<option selected VALUE="Leave">' . _("Don't Adjust System stock to Nil");
+ echo '<option VALUE="Adjust">'. _('Adjust System stock to Nil') . '</option>';
+ echo '<option selected VALUE="Leave">' . _('Do not Adjust System stock to Nil') . '</option>';
}
echo '</table><br><div class="centre"><input type=Submit Name="PrintPDF" Value="' . _('Print PDF'). '"></div>';
Modified: trunk/POReport.php
===================================================================
--- trunk/POReport.php 2011-04-14 10:28:52 UTC (rev 4550)
+++ trunk/POReport.php 2011-04-16 06:20:56 UTC (rev 4551)
@@ -6,7 +6,6 @@
// Inquiry on Purchase Orders
// If Date Type is Order, the main file is purchorderdetails
// If Date Type is Delivery, the main file is grns
-//$PageSecurity=2;
include('includes/session.inc');
$title = _('Purchase Order Report');
@@ -1421,49 +1420,48 @@
echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
- echo '<table class=selection>';
+ echo '<table class="selection">';
echo '<tr><td>' . _('Report Type') . ':</td>';
- echo "<td><select name='ReportType'>";
- echo "<option selected value='Detail'>" . _('Detail');
- echo "<option value='Summary'>" . _('Summary');
+ echo '<td><select name="ReportType">';
+ echo '<option selected value="Detail">' . _('Detail') . '</option>';
+ echo '<option value="Summary">' . _('Summary') . '</option>';
echo '</select></td><td> </td></tr>';
echo '<tr><td>' . _('Date Type') . ':</td>';
- echo "<td><select name='DateType'>";
- echo "<option selected value='Order'>" . _('Order Date');
- echo "<option value='Delivery'>" . _('Delivery Date');
+ echo '<td><select name="DateType">';
+ echo '<option selected value="Order">' . _('Order Date') . '</option>';
+ echo '<option value="Delivery">' . _('Delivery Date') . '</option>';
echo '</select></td><td> </td></tr>';
echo '<tr>
- <td>' . _('Date Range') . ":</td>
- <td><input type='Text' class=date alt='".$_SESSION['DefaultDateFormat']."' name='FromDate' size=10 maxlength=10 value=" . $_POST['FromDate'] .
- '> ' . _('To') . ":  
- <input type='Text' class=date alt='".$_SESSION['DefaultDateFormat']."' name='ToDate' size=10 maxlength=10 value=" . $_POST['ToDate'] . "></td>
- </tr>";
+ <td>' . _('Date Range') . ':</td>
+ <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="FromDate" size="10" maxlength="10" value="' . $_POST['FromDate'] .'"> ' . _('To') . ':  
+ <input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="ToDate" size="10" maxlength="10" value="' . $_POST['ToDate'] . '"></td>
+ </tr>';
echo '<tr><td>' . _('Part Number') . ':</td>';
- echo "<td><select name='PartNumberOp'>";
- echo "<option selected value='Equals'>" . _('Equals');
- echo "<option value='LIKE'>" . _('Begins With');
+ echo '<td><select name="PartNumberOp">';
+ echo '<option selected value="Equals">' . _('Equals') . '</option>';
+ echo '<option value="LIKE">' . _('Begins With') . '</option>';
echo '</select>';
- echo "  <input type='Text' name='PartNumber' size=20 maxlength=20 value=";
+ echo '  <input type="text" name="PartNumber" size="20" maxlength="20" value="';
if (isset($_POST['PartNumber'])) {
- echo $_POST['PartNumber'] . "></td></tr>";
+ echo $_POST['PartNumber'] . '"></td></tr>';
} else {
- echo "></td></tr>";
+ echo '"></td></tr>';
}
echo '<tr><td>' . _('Supplier Number') . ':</td>';
- echo "<td><select name='SupplierIdOp'>";
- echo "<option selected value='Equals'>" . _('Equals');
- echo "<option value='LIKE'>" . _('Begins With');
+ echo '<td><select name="SupplierIdOp">';
+ echo '<option selected value="Equals">' . _('Equals') . '</option>';
+ echo '<option value="LIKE">' . _('Begins With') . '</option>';
echo '</select>';
- echo "  <input type='Text' name='SupplierId' size=10 maxlength=10 value=";
+ echo '  <input type="text" name="SupplierId" size=10 maxlength=10 value="';
if (isset($_POST['SupplierId'])) {
- echo $_POST['SupplierId'] . "></td></tr>";
+ echo $_POST['SupplierId'] . '"></td></tr>';
} else {
- echo "></td></tr>";
+ echo '"></td></tr>';
}
echo '<tr><td>' . _('Supplier Name') . ':</td>';
@@ -1480,11 +1478,11 @@
echo '<tr><td>' . _('Order Number') . ':</td>';
echo '<td>'._('Equals').':  ';
- echo "<input type='Text' name='OrderNo' size=10 maxlength=10 value=";
+ echo '<input type="text" name="OrderNo" size="10" maxlength="10" value="';
if (isset($_POST['OrderNo'])) {
- echo $_POST['OrderNo'] . "></td></tr>";
+ echo $_POST['OrderNo'] . '"></td></tr>';
} else {
- echo "></td></tr>";
+ echo '"></td></tr>';
}
echo '<tr><td>' . _('Line Item Status') . ':</td>';
Modified: trunk/PO_Header.php
===================================================================
--- trunk/PO_Header.php 2011-04-14 10:28:52 UTC (rev 4550)
+++ trunk/PO_Header.php 2011-04-16 06:20:56 UTC (rev 4551)
@@ -331,7 +331,7 @@
$ErrMsg = _('The searched supplier records requested cannot be retrieved because');
$result_SuppSelect = DB_query($SQL,$db,$ErrMsg);
-
+ $SuppliersReturned=DB_num_rows($result_SuppSelect);
if (DB_num_rows($result_SuppSelect)==1){
$myrow=DB_fetch_array($result_SuppSelect);
$_POST['Select'] = $myrow['supplierid'];
@@ -508,6 +508,7 @@
_('Purchase Order') . '" alt="">' . ' ' . _('Purchase Order: Select Supplier') . '';
echo '<form action="' . $_SERVER['PHP_SELF'] . '?identifier=' . $identifier . '" method="post" name="choosesupplier">';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
+ echo '<input type="hidden" name="SuppliersReturned" value="' . $SuppliersReturned .'" />';
echo '<table cellpadding=3 colspan=4 class=selection>
<tr>
Modified: trunk/PaymentMethods.php
===================================================================
--- trunk/PaymentMethods.php 2011-04-14 10:28:52 UTC (rev 4550)
+++ trunk/PaymentMethods.php 2011-04-16 06:20:56 UTC (rev 4551)
@@ -34,9 +34,9 @@
//first off validate inputs sensible
- if (strpos($_POST['MethodName'],'&')>0 OR strpos($_POST['MethodName'],"'")>0) {
+ if (ContainsIllegalCharacters($_POST['MethodName'])) {
$InputError = 1;
- prnMsg( _('The payment method cannot contain the character') . " '&' " . _('or the character') ." '",'error');
+ prnMsg( _('The payment method cannot contain illegal characters'),'error');
$Errors[$i] = 'MethodName';
$i++;
}
Modified: trunk/PcAssignCashToTab.php
===================================================================
--- trunk/PcAssignCashToTab.php 2011-04-14 10:28:52 UTC (rev 4550)
+++ trunk/PcAssignCashToTab.php 2011-04-16 06:20:56 UTC (rev 4551)
@@ -1,8 +1,6 @@
<?php
-/* $Revision: 1.0 $ */
+/* $Id$*/
-//$PageSecurity = 6;
-
include('includes/session.inc');
$title = _('Assignment of Cash to Petty Cash Tab');
include('includes/header.inc');
@@ -45,7 +43,7 @@
if ($_POST['Amount']==0) {
$InputError = 1;
- prnMsg('<br>' . _('The Amount must be inputed'),'error');
+ prnMsg('<br />' . _('The Amount must be inputed'),'error');
$Errors[$i] = 'TabCode';
$i++;
}
@@ -58,18 +56,18 @@
$Limit=DB_fetch_array($ResultLimit);
if (($_POST['CurrentAmount']+$_POST['Amount'])>$Limit['tablimit']){
- prnMsg('<br>' . _('The balance after this assignment would be greater than the specified limit for this PC tab'),'warning');
+ prnMsg('<br />' . _('The balance after this assignment would be greater than the specified limit for this PC tab'),'warning');
}
if ($InputError !=1 AND isset($SelectedIndex) ) {
$sql = "UPDATE pcashdetails
- SET date = '".FormatDateForSQL($_POST['Date'])."',
- amount = '" . $_POST['Amount'] . "',
- authorized = '0000-00-00',
- notes = '" . $_POST['Notes'] . "',
- receipt = '" . $_POST['Receipt'] . "'
- WHERE counterindex = '" . $SelectedIndex . "'";
+ SET date = '".FormatDateForSQL($_POST['Date'])."',
+ amount = '" . $_POST['Amount'] . "',
+ authorized = '0000-00-00',
+ notes = '" . $_POST['Notes'] . "',
+ receipt = '" . $_POST['Receipt'] . "'
+ WHERE counterindex = '" . $SelectedIndex . "'";
$msg = _('Assignment of cash to PC Tab ') . ' ' . $SelectedTabs . ' ' . _('has been updated');
} elseif ($InputError !=1 ) {
@@ -128,11 +126,12 @@
echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' .
_('Search') . '" alt="" />' . ' ' . $title. '</p>';
- echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>';
+ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
echo '<p><table class=selection>'; //Main table
- echo '<tr><td>' . _('Petty Cash Tab To Assign Cash') . ":</td><td><select name='SelectedTabs'>";
+ echo '<tr><td>' . _('Petty Cash Tab To Assign Cash') . ':</td>
+ <td><select name="SelectedTabs">';
DB_free_result($result);
$SQL = "SELECT tabcode
@@ -144,16 +143,16 @@
while ($myrow = DB_fetch_array($result)) {
if (isset($_POST['SelectTabs']) and $myrow['tabcode']==$_POST['SelectTabs']) {
- echo "<option selected value='";
+ echo '<option selected value="';
} else {
- echo "<option value='";
+ echo '<option value="';
}
- echo $myrow['tabcode'] . "'>" . $myrow['tabcode'];
+ echo $myrow['tabcode'] . '">' . $myrow['tabcode'] . '</option>';
}
echo '</select></td></tr>';
echo '</td></tr></table>'; // close main table
- echo '<p><div class="centre"><input type=submit name=process VALUE="' . _('Accept') . '"><input type=submit name=Cancel value="' . _('Cancel') . '"></div>';
+ echo '<p><div class="centre"><input type=submit name="process" value="' . _('Accept') . '"><input type=submit name="Cancel" value="' . _('Cancel') . '"></div>';
echo '</form>';
}
@@ -175,20 +174,6 @@
unset($_POST['Receipt']);
}
-/* $sql = "SELECT pcashdetails.date,
- pcashdetails.codeexpense,
- pcexpenses.description
- pcashdetails.amount,
- pcashdetails.authorized,
- pcashdetails.posted,
- pcashdetails.notes,
- pcashdetails.receipt
- FROM pcashdetails, pcexpenses
- WHERE pcashdetails.tabcode='$SelectedTabs'
- AND pcashdetails.codeexpense = pcexpenses.codeexpense
- AND pcashdetails.date >=DATE_SUB(CURDATE(), INTERVAL ".$Days." DAY)
- ORDER BY pcashdetails.counterindex Asc";
-*/
if(!isset ($Days)){
$Days=30;
}
@@ -201,21 +186,21 @@
$result = DB_query($sql,$db);
echo '<table class=selection>';
- echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>';
+ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
- echo "<tr><th colspan=8>" . _('Detail Of PC Tab Movements For Last ') .': ';
- echo "<input type=hidden name='SelectedTabs' value=" . $SelectedTabs . ">";
- echo "<input type=text class=number name='Days' value=" . $Days . " maxlength =3 size=4> Days ";
+ echo '<tr><th colspan="8">' . _('Detail Of PC Tab Movements For Last ') .': ';
+ echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '">';
+ echo '<input type="text" class="number" name="Days" value="' . $Days . '" maxlength="3" size="4" /> ' . _('Days');
echo '<input type=submit name="Go" value="' . _('Go') . '">';
echo '</th></tr></form>';
- echo "<tr>
- <th>" . _('Date') . "</th>
- <th>" . _('Expense Code') . "</th>
- <th>" . _('Amount') . "</th>
- <th>" . _('Authorised') . "</th>
- <th>" . _('Notes') . "</th>
- <th>" . _('Receipt') . "</th>
- </tr>";
+ echo '<tr>
+ <th>' . _('Date') . '</th>
+ <th>' . _('Expense Code') . '</th>
+ <th>' . _('Amount') . '</th>
+ <th>' . _('Authorised') . '</th>
+ <th>' . _('Notes') . '</th>
+ <th>' . _('Receipt') . '</th>
+ </tr>';
$k=0; //row colour counter
@@ -239,29 +224,29 @@
$Description['0']='ASSIGNCASH';
}
- if (($myrow['authorized'] == "0000-00-00") and ($Description['0'] == 'ASSIGNCASH')){
+ if (($myrow['authorized'] == '0000-00-00') and ($Description['0'] == 'ASSIGNCASH')){
// only cash assignations NOT authorized can be modified or deleted
- echo "<td>".ConvertSQLDate($myrow['date'])."</td>
- <td>".$Description['0']."</td>
- <td class=number>".number_format($myrow['amount'],2)."</td>
- <td>".ConvertSQLDate($myrow['authorized'])."</td>
- <td>".$myrow['notes']."</td>
- <td>".$myrow['receipt']."</td>
- <td><a href='".$_SERVER['PHP_SELF'] . '?' . SID ."SelectedIndex=".$myrow['counterindex']."&SelectedTabs=" .
- $SelectedTabs . "&Days=" . $Days . "&edit=yes'>" . _('Edit') . "</td>
- <td><a href='".$_SERVER['PHP_SELF'] . '?' . SID ."SelectedIndex=".$myrow['counterindex']."&SelectedTabs=" .
- $SelectedTabs . "&Days=" . $Days . "&delete=yes' onclick=\"return confirm('" .
- _('Are you sure you wish to delete this code and the expense it may have set up?') . "');\">" .
- _('Delete') . "</td>
- </tr>";
+ echo '<td>' . ConvertSQLDate($myrow['date']) . '</td>
+ <td>' . $Description['0'] . '</td>
+ <td class=number>' . number_format($myrow['amount'],2) . '</td>
+ <td>' . ConvertSQLDate($myrow['authorized']) . '</td>
+ <td>' . $myrow['notes'] . '</td>
+ <td>' . $myrow['receipt'] . '</td>
+ <td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedIndex=' . $myrow['counterindex'] . '&SelectedTabs=' .
+ $SelectedTabs . '&Days=' . $Days . '&edit=yes">' . _('Edit') . '</td>
+ <td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedIndex=' . $myrow['counterindex'] . '&SelectedTabs=' .
+ $SelectedTabs . '&Days=' . $Days . '&delete=yes" onclick="return confirm("' .
+ _('Are you sure you wish to delete this code and the expense it may have set up?') . '");">' .
+ _('Delete') . '</td>
+ </tr>';
}else{
- echo "<td>".ConvertSQLDate($myrow['date'])."</td>
- <td>".$Description['0']."</td>
- <td class=number>".number_format($myrow['amount'],2)."</td>
- <td>".ConvertSQLDate($myrow['authorized'])."</td>
- <td>".$myrow['notes']."</td>
- <td>".$myrow['receipt']."</td>
- </tr>";
+ echo '<td>' . ConvertSQLDate($myrow['date']) . '</td>
+ <td>' . $Description['0'] . '</td>
+ <td class=number>' . number_format($myrow['amount'],2).'</td>
+ <td>' . ConvertSQLDate($myrow['authorized']) . '</td>
+ <td>' . $myrow['notes'] . '</td>
+ <td>' . $myrow['receipt'] . '</td>
+ </tr>';
}
}
//END WHILE LIST LOOP
@@ -277,8 +262,8 @@
$Amount['0']=0;
}
- echo "<tr><td colspan=2 style=text-align:right ><b>" . _('Current balance') . ":</b></td>
- <td>".number_format($Amount['0'],2)."</td></tr>";
+ echo '<tr><td colspan="2" style="text-align:right"><b>' . _('Current balance') . ':</b></td>
+ <td>' . number_format($Amount['0'],2) . '</td></tr>';
echo '</table>';
@@ -290,13 +275,13 @@
$Amount['0']=0;
}
- echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>';
+ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] .'">';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
echo '<p><table class=selection>'; //Main table
if (isset($_GET['SelectedIndex'])) {
- echo "<tr><th colspan=2><font color=blue size=3>"._('Update Cash Assignment')."</font></th></tr>";
+ echo '<tr><th colspan="2"><font color=blue size=3>'._('Update Cash Assignment').'</font></th></tr>';
} else {
- echo "<tr><th colspan=2><font color=blue size=3>"._('New Cash Assignment')."</font></th></tr>";
+ echo '<tr><th colspan="2"><font color=blue size=3>'._('New Cash Assignment').'</font></th></tr>';
}
if ( isset($_GET['edit'])) {
@@ -312,18 +297,18 @@
$_POST['Notes'] = $myrow['notes'];
$_POST['Receipt'] = $myrow['receipt'];
- 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="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. '">';
}
/* Ricard: needs revision of this date initialization */
if (!isset($_POST['Date'])) {
- $_POST['Date']=Date("d/m/Y");
+ $_POST['Date']=Date('d/m/Y');
}
- echo '<tr><td>' . _('Cash Assignation Date') . ":</td>";
+ echo '<tr><td>' . _('Cash Assignation Date') . ':</td>';
echo '<td><input type=text class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="Date" size=10 maxlength=10 value=' . $_POST['Date'] . '></td></tr>';
@@ -332,23 +317,26 @@
$_POST['Amount']=0;
}
- echo "<tr><td>" . _('Amount') . ":</td><td><input type='Text' class='number' name='Amount' size='12' maxlength='11' value='" . $_POST['Amount'] . "'></td></tr>";
+ echo '<tr><td>' . _('Amount') . ':</td>
+ <td><input type="text" class="number" name="Amount" size="12" maxlength="11" value="' . $_POST['Amount'] . '"></td></tr>';
if (!isset($_POST['Notes'])) {
$_POST['Notes']='';
}
- echo "<tr><td>" . _('Notes') . ":</td><td><input type='Text' name='Notes' size=50 maxlength=49 value='" . $_POST['Notes'] . "'></td></tr>";
+ echo '<tr><td>' . _('Notes') . ':</td>
+ <td><input type="text" name="Notes" size=50 maxlength=49 value="' . $_POST['Notes'] . '"></td></tr>';
if (!isset($_POST['Receipt'])) {
$_POST['Receipt']='';
}
- echo "<tr><td>" . _('Receipt') . ":</td><td><input type='Text' name='Receipt' size=50 maxlength=49 value='" . $_POST['Receipt'] . "'></td></tr>";
+ echo '<tr><td>' . _('Receipt') . ':</td>
+ <td><input type="text" name="Receipt" size="50" maxlength="49" value="' . $_POST['Receipt'] . '"></td></tr>';
- echo "<input type=hidden name='CurrentAmount' value=" . $Amount['0']. ">";
- echo "<input type=hidden name='SelectedTabs' value=" . $SelectedTabs . ">";
- echo "<input type=hidden name='Days' value=" .$Days. ">";
+ echo '<input type=hidden name="CurrentAmount" value="' . $Amount['0']. '">';
+ echo '<input type=hidden name="SelectedTabs" value="' . $SelectedTabs . '">';
+ echo '<input type=hidden name="Days" value="' .$Days. '">';
echo '</td></tr></table>'; // close main table
Modified: trunk/PcAuthorizeExpenses.php
===================================================================
--- trunk/PcAuthorizeExpenses.php 2011-04-14 10:28:52 UTC (rev 4550)
+++ trunk/PcAuthorizeExpenses.php 2011-04-16 06:20:56 UTC (rev 4551)
@@ -1,7 +1,6 @@
<?php
+/* $Id$*/
-/* $Id$ */
-
include('includes/session.inc');
$title = _('Authorization of Petty Cash Expenses');
include('includes/header.inc');
@@ -47,9 +46,9 @@
$Days=30;
}
echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '">';
- echo '<br><table class=selection>';
- echo '<tr><th colspan="7">' . _('Detail Of Movement For Last ') .': ';
- echo '<input type="text" class="number" name="Days" value="' . $Days . '" maxlength ="3" size="4"> ' ._('Days');
+ echo '<br /><table class=selection>';
+ echo '<tr><th colspan=7>' . _('Detail Of Movement For Last ') .': ';
+ echo '<input type="text" class="number" name="Days" value="' . $Days . '" maxlength="3" size="4" />' . _('Days');
echo '<input type=submit name="Go" value="' . _('Go') . '"></tr></th>';
echo '</form>';
@@ -77,14 +76,14 @@
$result = DB_query($sql,$db);
echo '<tr>
- <th>' . _('Date') . '</th>
- <th>' . _('Expense Code') . '</th>
- <th>' . _('Amount') . '</th>
- <th>' . _('Posted') . '</th>
- <th>' . _('Notes') . '</th>
- <th>' . _('Receipt') . '</th>
- <th>' . _('Authorized') . '</th>
- </tr>';
+ <th>' . _('Date') . '</th>
+ <th>' . _('Expense Code') . '</th>
+ <th>' . _('Amount') . '</th>
+ <th>' . _('Posted') . '</th>
+ <th>' . _('Notes') . '</th>
+ <th>' . _('Receipt') . '</th>
+ <th>' . _('Authorized') . '</th>
+ </tr>';
$k=0; //row colour counter
echo'<form action="PcAuthorizeExpenses.php" method="POST" name="'._('update').'">';
@@ -93,7 +92,7 @@
while ($myrow=DB_fetch_array($result)) {
//update database if update pressed
- if ((isset($_POST['submit']) AND $_POST['submit']==_('Update')) AND isset($_POST[$myrow['counterindex']])){
+ if ((isset($_POST['submit']) and $_POST['submit']=='Update') AND isset($_POST[$myrow['counterindex']])){
$PeriodNo = GetPeriod(ConvertSQLDate($myrow['date']), $db);
@@ -123,90 +122,88 @@
$typeno = GetNextTransNo($type,$db);
//build narrative
- $narrative= _('PettyCash') . ' - ' . $myrow['tabcode'] . ' - ' . $myrow['codeexpense'] . ' - ' . DB_escape_string($myrow['notes']) . ' - '.$myrow['receipt'];
+ $narrative= _('PettyCash') . ' - '.$myrow['tabcode'] . ' - ' . $myrow['codeexpense'] . ' - ' . $myrow['notes'] . ' - ' . $myrow['receipt'];
//insert to gltrans
DB_Txn_Begin($db);
- $sqlFrom="INSERT INTO `gltrans`
- (`counterindex`,
- `type`,
- `typeno`,
- `chequeno`,
- `trandate`,
- `periodno`,
- `account`,
- `narrative`,
- `amount`,
- `posted`,
- `jobref`,
- `tag`)
- VALUES (NULL,
- '".$type."',
- '".$typeno."',
- 0,
- '".$myrow['date']."',
- '".$PeriodNo."',
- '".$AccountFrom."',
- '".$narrative."',
- '".-$Amount."',
- 0,
- '',
- 0)";
-
+ $sqlFrom="INSERT INTO `gltrans` (`counterindex`,
+ `type`,
+ `typeno`,
+ `chequeno`,
+ `trandate`,
+ `periodno`,
+ `account`,
+ `narrative`,
+ `amount`,
+ `posted`,
+ `jobref`,
+ `tag`)
+ VALUES (NULL,
+ '".$type."',
+ '".$typeno."',
+ 0,
+ '".$myrow['date']."',
+ '".$PeriodNo."',
+ '".$AccountFrom."',
+ '". DB_escape_string($narrative) ."',
+ '".-$Amount."',
+ 0,
+ '',
+ 0)";
+
$ResultFrom = DB_Query($sqlFrom, $db, '', '', true);
- $sqlTo="INSERT INTO `gltrans`
- (`counterindex`,
- `type`,
- `typeno`,
- `chequeno`,
- `trandate`,
- `periodno`,
- `account`,
- `narrative`,
- `amount`,
- `posted`,
- `jobref`,
- `tag`)
- VALUES (NULL,
- '".$type."',
- '".$typeno."',
- 0,
- '".$myrow['date']."',
- '".$PeriodNo."',
- '".$AccountTo."',
- '".$narrative."',
- '".$Amount."',
- 0,
- '',
- 0)";
-
+ $sqlTo="INSERT INTO `gltrans` (`counterindex`,
+ `type`,
+ `typeno`,
+ `chequeno`,
+ `trandate`,
+ `periodno`,
+ `account`,
+ `narrative`,
+ `amount`,
+ `posted`,
+ `jobref`,
+ `tag`)
+ VALUES (NULL,
+ '".$type."',
+ '".$typeno."',
+ 0,
+ '".$myrow['date']."',
+ '".$PeriodNo."',
+ '".$AccountTo."',
+ '" . DB_escape_string($narrative) . "',
+ '".$Amount."',
+ 0,
+ '',
+ 0)";
+
$ResultTo = DB_Query($sqlTo, $db, '', '', true);
if ($myrow['codeexpense'] == 'ASSIGNCASH'){
// if it's a cash assignation we need to updated banktrans table as well.
$ReceiptTransNo = GetNextTransNo( 2, $db);
$SQLBank= "INSERT INTO banktrans (transno,
- type,
- bankact,
- ref,
- exrate,
- functionalexrate,
- transdate,
- banktranstype,
- amount,
- currcode)
- VALUES ('". $ReceiptTransNo . "',
- 1,
- '" . $AccountFrom . "',
- '" . $narrative . "',
- 1,
- '" . $myrow['rate'] . "',
- '" . $myrow['date'] . "'...
[truncated message content] |