|
From: <dai...@us...> - 2011-07-27 02:43:24
|
Revision: 4639
http://web-erp.svn.sourceforge.net/web-erp/?rev=4639&view=rev
Author: daintree
Date: 2011-07-27 02:43:17 +0000 (Wed, 27 Jul 2011)
Log Message:
-----------
quoting
Modified Paths:
--------------
trunk/PDFSuppTransListing.php
trunk/StockReorderLevel.php
trunk/WhereUsedInquiry.php
trunk/Z_ReverseSuppPaymentRun.php
trunk/includes/LanguageSetup.php
Modified: trunk/PDFSuppTransListing.php
===================================================================
--- trunk/PDFSuppTransListing.php 2011-07-26 09:21:52 UTC (rev 4638)
+++ trunk/PDFSuppTransListing.php 2011-07-27 02:43:17 UTC (rev 4639)
@@ -1,130 +1,130 @@
-<?php
-
-/* $Id$*/
-
-include('includes/SQL_CommonFunctions.inc');
-include ('includes/session.inc');
-
-$InputError=0;
-if (isset($_POST['Date']) AND !Is_Date($_POST['Date'])){
- $msg = _('The date must be specified in the format') . ' ' . $_SESSION['DefaultDateFormat'];
- $InputError=1;
- unset($_POST['Date']);
-}
-
-if (!isset($_POST['Date'])){
-
- $title = _('Supplier Transaction Listing');
- include ('includes/header.inc');
-
- echo '<div class="centre"><p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt="" />' . ' '
- . _('Supplier Transaction Listing').'</p>';
-
- if ($InputError==1){
- prnMsg($msg,'error');
- }
-
- 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 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>';
-
- echo "<select name='TransType'>";
-
- echo '<option value=20>' . _('Invoices') . '</option>';
- echo '<option value=21>' . _('Credit Notes') . '</option>';
- echo '<option value=22>' . _('Payments') . '</option>';
-
- echo '</select></td></tr>';
-
- echo '</select></td></tr>
- </table>
- <br /><div class="centre"><input type="submit" name="Go" value="' . _('Create PDF') . '"></div>';
-
- include('includes/footer.inc');
- exit;
-} else {
-
- include('includes/ConnectDB.inc');
-}
-
-$sql= "SELECT type,
- supplierno,
- suppreference,
- trandate,
- ovamount,
- ovgst,
- transtext
- FROM supptrans
- WHERE type='" . $_POST['TransType'] . "'
- AND date_format(inputdate, '%Y-%m-%d')='".FormatDateForSQL($_POST['Date'])."'";
-
-$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');
- }
- include('includes/footer.inc');
- exit;
-} elseif (DB_num_rows($result) == 0){
- $title = _('Payment Listing');
- include('includes/header.inc');
- echo '<br />';
- prnMsg (_('There were no transactions found in the database for the date') . ' ' . $_POST['Date'] .'. '._('Please try again selecting a different date'), 'info');
- include('includes/footer.inc');
- exit;
-}
-
-include('includes/PDFStarter.php');
-
-/*PDFStarter.php has all the variables for page size and width set up depending on the users default preferences for paper size */
-
-$pdf->addInfo('Title',_('Supplier Transaction Listing'));
-$pdf->addInfo('Subject',_('Supplier transaction listing from') . ' ' . $_POST['Date'] );
-$line_height=12;
-$PageNumber = 1;
-$TotalCheques = 0;
-
-include ('includes/PDFSuppTransListingPageHeader.inc');
-
-while ($myrow=DB_fetch_array($result)){
-
- $sql="SELECT suppname FROM suppliers WHERE supplierid='" . $myrow['supplierno']."'";
- $supplierresult=DB_query($sql, $db);
- $supplierrow=DB_fetch_array($supplierresult);
-
- $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,160,$FontSize,$supplierrow['suppname'], 'left');
- $LeftOvers = $pdf->addTextWrap($Left_Margin+162,$YPos,80,$FontSize,$myrow['suppreference'], 'left');
- $LeftOvers = $pdf->addTextWrap($Left_Margin+242,$YPos,70,$FontSize,ConvertSQLDate($myrow['trandate']), 'left');
- $LeftOvers = $pdf->addTextWrap($Left_Margin+312,$YPos,70,$FontSize,number_format($myrow['ovamount'],2), 'right');
- $LeftOvers = $pdf->addTextWrap($Left_Margin+382,$YPos,70,$FontSize,number_format($myrow['ovgst'],2), 'right');
- $LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,number_format($myrow['ovamount']+$myrow['ovgst'],2), 'right');
-
- $YPos -= ($line_height);
- $TotalCheques = $TotalCheques - $myrow['ovamount'];
-
- if ($YPos - (2 *$line_height) < $Bottom_Margin){
- /*Then set up a new page */
- $PageNumber++;
- include ('includes/PDFChequeListingPageHeader.inc');
- } /*end of new page header */
-} /* end of while there are customer receipts in the batch to print */
-
-
-$YPos-=$line_height;
-$LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,number_format(-$TotalCheques,2), 'right');
-$LeftOvers = $pdf->addTextWrap($Left_Margin+265,$YPos,300,$FontSize,_('Total') . ' ' . _('Transactions'), 'left');
-
-$ReportFileName = $_SESSION['DatabaseName'] . '_SuppTransListing_' . date('Y-m-d').'.pdf';
-$pdf->OutputD($ReportFileName);
-$pdf->__destruct();
+<?php
+
+/* $Id$*/
+
+include('includes/SQL_CommonFunctions.inc');
+include ('includes/session.inc');
+
+$InputError=0;
+if (isset($_POST['Date']) AND !Is_Date($_POST['Date'])){
+ $msg = _('The date must be specified in the format') . ' ' . $_SESSION['DefaultDateFormat'];
+ $InputError=1;
+ unset($_POST['Date']);
+}
+
+if (!isset($_POST['Date'])){
+
+ $title = _('Supplier Transaction Listing');
+ include ('includes/header.inc');
+
+ echo '<div class="centre"><p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt="" />' . ' '
+ . _('Supplier Transaction Listing').'</p>';
+
+ if ($InputError==1){
+ prnMsg($msg,'error');
+ }
+
+ 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 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>';
+
+ echo "<select name='TransType'>";
+
+ echo '<option value=20>' . _('Invoices') . '</option>';
+ echo '<option value=21>' . _('Credit Notes') . '</option>';
+ echo '<option value=22>' . _('Payments') . '</option>';
+
+ echo '</select></td></tr>';
+
+ echo '</select></td></tr>
+ </table>
+ <br /><div class="centre"><input type="submit" name="Go" value="' . _('Create PDF') . '"></div>';
+
+ include('includes/footer.inc');
+ exit;
+} else {
+
+ include('includes/ConnectDB.inc');
+}
+
+$sql= "SELECT type,
+ supplierno,
+ suppreference,
+ trandate,
+ ovamount,
+ ovgst,
+ transtext
+ FROM supptrans
+ WHERE type='" . $_POST['TransType'] . "'
+ AND date_format(inputdate, '%Y-%m-%d')='".FormatDateForSQL($_POST['Date'])."'";
+
+$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');
+ }
+ include('includes/footer.inc');
+ exit;
+} elseif (DB_num_rows($result) == 0){
+ $title = _('Payment Listing');
+ include('includes/header.inc');
+ echo '<br />';
+ prnMsg (_('There were no transactions found in the database for the date') . ' ' . $_POST['Date'] .'. '._('Please try again selecting a different date'), 'info');
+ include('includes/footer.inc');
+ exit;
+}
+
+include('includes/PDFStarter.php');
+
+/*PDFStarter.php has all the variables for page size and width set up depending on the users default preferences for paper size */
+
+$pdf->addInfo('Title',_('Supplier Transaction Listing'));
+$pdf->addInfo('Subject',_('Supplier transaction listing from') . ' ' . $_POST['Date'] );
+$line_height=12;
+$PageNumber = 1;
+$TotalCheques = 0;
+
+include ('includes/PDFSuppTransListingPageHeader.inc');
+
+while ($myrow=DB_fetch_array($result)){
+
+ $sql="SELECT suppname FROM suppliers WHERE supplierid='" . $myrow['supplierno']."'";
+ $supplierresult=DB_query($sql, $db);
+ $supplierrow=DB_fetch_array($supplierresult);
+
+ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,160,$FontSize,$supplierrow['suppname'], 'left');
+ $LeftOvers = $pdf->addTextWrap($Left_Margin+162,$YPos,80,$FontSize,$myrow['suppreference'], 'left');
+ $LeftOvers = $pdf->addTextWrap($Left_Margin+242,$YPos,70,$FontSize,ConvertSQLDate($myrow['trandate']), 'left');
+ $LeftOvers = $pdf->addTextWrap($Left_Margin+312,$YPos,70,$FontSize,number_format($myrow['ovamount'],2), 'right');
+ $LeftOvers = $pdf->addTextWrap($Left_Margin+382,$YPos,70,$FontSize,number_format($myrow['ovgst'],2), 'right');
+ $LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,number_format($myrow['ovamount']+$myrow['ovgst'],2), 'right');
+
+ $YPos -= ($line_height);
+ $TotalCheques = $TotalCheques - $myrow['ovamount'];
+
+ if ($YPos - (2 *$line_height) < $Bottom_Margin){
+ /*Then set up a new page */
+ $PageNumber++;
+ include ('includes/PDFChequeListingPageHeader.inc');
+ } /*end of new page header */
+} /* end of while there are customer receipts in the batch to print */
+
+
+$YPos-=$line_height;
+$LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,number_format(-$TotalCheques,2), 'right');
+$LeftOvers = $pdf->addTextWrap($Left_Margin+265,$YPos,300,$FontSize,_('Total') . ' ' . _('Transactions'), 'left');
+
+$ReportFileName = $_SESSION['DatabaseName'] . '_SuppTransListing_' . date('Y-m-d').'.pdf';
+$pdf->OutputD($ReportFileName);
+$pdf->__destruct();
?>
\ No newline at end of file
Modified: trunk/StockReorderLevel.php
===================================================================
--- trunk/StockReorderLevel.php 2011-07-26 09:21:52 UTC (rev 4638)
+++ trunk/StockReorderLevel.php 2011-07-27 02:43:17 UTC (rev 4639)
@@ -75,9 +75,9 @@
}
- printf("<td>%s</td>
- <td class=number>%s</td>
- <td><input type="text" class='number' name=%s maxlength=10 size=10 VALUE=%s></td>",
+ printf('<td>%s</td>
+ <td class="number">%s</td>
+ <td><input type="text" class="number" name="%s" maxlength="10" size="10" value="%s" /></td>',
$myrow['locationname'],
number_format($myrow['quantity'],$myrow['decimalplaces']),
$myrow['loccode'],
@@ -91,7 +91,8 @@
}
//end of while loop
-echo '</table><br /><div class="centre"><input type="submit" name="UpdateData" value="' . _('Update') . '"><br /><br />';
+echo '</table>
+ <br /><div class="centre"><input type="submit" name="UpdateData" value="' . _('Update') . '" /><br /><br />';
echo '<a href="' . $rootpath . '/StockMovements.php?StockID=' . $StockID . '">' . _('Show Stock Movements') . '</a>';
echo '<br /><a href="' . $rootpath . '/StockUsage.php?StockID=' . $StockID . '">' . _('Show Stock Usage') . '</a>';
echo '<br /><a href="' . $rootpath . '/SelectSalesOrder.php?SelectedStockItem=' . $StockID . '">' . _('Search Outstanding Sales Orders') . '</a>';
Modified: trunk/WhereUsedInquiry.php
===================================================================
--- trunk/WhereUsedInquiry.php 2011-07-26 09:21:52 UTC (rev 4638)
+++ trunk/WhereUsedInquiry.php 2011-07-27 02:43:17 UTC (rev 4639)
@@ -35,9 +35,9 @@
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
if (isset($StockID)) {
- echo _('Enter an Item Code') . ": <input type="text" name='StockID' size=21 maxlength=20 value='$StockID' >";
+ echo _('Enter an Item Code') . ': <input type="text" name="StockID" size="21" maxlength="20" value="' . $StockID . '" />';
} else {
- echo _('Enter an Item Code') . ": <input type="text" name='StockID' size=21 maxlength=20>";
+ echo _('Enter an Item Code') . ': <input type="text" name="StockID" size="21" maxlength="20" />';
}
echo "<input type=submit name='ShowWhereUsed' value='" . _('Show Where Used') . "'>";
@@ -62,12 +62,12 @@
echo '<table width=97% class=selection>';
- $tableheader = "<tr><th>" . _('Used By') . "</th>
- <th>" . _('Work Centre') . "</th>
- <th>" . _('Location') . "</th>
- <th>" . _('Quantity Required') . "</th>
- <th>" . _('Effective After') . "</th>
- <th>" . _('Effective To') . '</th></tr>';
+ $tableheader = '<tr><th>' . _('Used By') . '</th>
+ <th>' . _('Work Centre') . '</th>
+ <th>' . _('Location') . '</th>
+ <th>' . _('Quantity Required') . '</th>
+ <th>' . _('Effective After') . '</th>
+ <th>' . _('Effective To') . '</th></tr>';
echo $tableheader;
$k=0;
while ($myrow=DB_fetch_array($result)) {
@@ -80,7 +80,7 @@
$k=1;
}
- echo "<td><a target='_blank' href='" . $rootpath . "/BOMInquiry.php?" . SID . "&StockID=" . $myrow['parent'] . "' alt='" . _('Show Bill Of Material') . "'>" . $myrow['parent']. ' - ' . $myrow['description']. '</a></td>';
+ echo '<td><a target="_blank" href="' . $rootpath . '/BOMInquiry.php?StockID=' . $myrow['parent'] . '" alt="' . _('Show Bill Of Material') . '">' . $myrow['parent']. ' - ' . $myrow['description']. '</a></td>';
echo '<td>' . $myrow['workcentreadded']. '</td>';
echo '<td>' . $myrow['loccode']. '</td>';
echo '<td>' . $myrow['quantity']. '</td>';
Modified: trunk/Z_ReverseSuppPaymentRun.php
===================================================================
--- trunk/Z_ReverseSuppPaymentRun.php 2011-07-26 09:21:52 UTC (rev 4638)
+++ trunk/Z_ReverseSuppPaymentRun.php 2011-07-27 02:43:17 UTC (rev 4639)
@@ -85,7 +85,7 @@
echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
-echo '<br />' . _('Enter the date of the payment run') . ": <input type="text" name='PaytDate' maxlength=11 size=11 value='" . $_POST['PaytDate'] . "'>";
+echo '<br />' . _('Enter the date of the payment run') . ': <input type="text" name="PaytDate" maxlength="11" size="11" value="' . $_POST['PaytDate'] . '">';
echo '<input type="submit" name="RevPayts" value="' . _('Reverse Supplier Payments on the Date Entered') . '">';
echo '</form>';
Modified: trunk/includes/LanguageSetup.php
===================================================================
--- trunk/includes/LanguageSetup.php 2011-07-26 09:21:52 UTC (rev 4638)
+++ trunk/includes/LanguageSetup.php 2011-07-27 02:43:17 UTC (rev 4639)
@@ -27,22 +27,22 @@
if (function_exists('gettext')){
- //$Locale = setlocale (LC_ALL, $_SESSION['Language']);
+ if (defined('LC_MESSAGES')) {
+ $Locale = setlocale (LC_MESSAGES, $_SESSION['Language']); // Linux
+ } else {
+ $Locale = setlocale (LC_ALL, $_SESSION['Language']); // windows
+ }
- $Locale = setlocale (LC_MESSAGES, $_SESSION['Language']);
-
//Turkish seems to be a special case
if ($_SESSION['Language']=='tr_TR.utf8') {
$Locale = setlocale(LC_CTYPE, 'C');
}
- //$Locale = setlocale (LC_CTYPE, $_SESSION['Language']);
- //$Locale = setlocale (LC_MESSAGES, $_SESSION['Language']);
+
$Locale = setlocale (LC_NUMERIC, 'en_US'); //currently need all decimal points etc to be as expected on webserver
// possibly even if locale fails the language will still switch by using Language instead of locale variable
putenv('LANG=' . $_SESSION['Language']);
putenv('LANGUAGE=' . $_SESSION['Language']);
- //putenv('LANG=$Language_Country');
bindtextdomain ('messages', $PathPrefix . 'locale');
textdomain ('messages');
bind_textdomain_codeset('messages', 'UTF-8');
@@ -92,4 +92,4 @@
}
*/
}
-?>
+?>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|