From: <dai...@us...> - 2011-04-07 10:24:02
|
Revision: 4541 http://web-erp.svn.sourceforge.net/web-erp/?rev=4541&view=rev Author: daintree Date: 2011-04-07 10:23:55 +0000 (Thu, 07 Apr 2011) Log Message: ----------- various Modified Paths: -------------- trunk/Tax.php trunk/TaxAuthorities.php trunk/TaxGroups.php trunk/TopItems.php Modified: trunk/Tax.php =================================================================== --- trunk/Tax.php 2011-04-06 10:01:30 UTC (rev 4540) +++ trunk/Tax.php 2011-04-07 10:23:55 UTC (rev 4541) @@ -2,7 +2,6 @@ /* $Id$*/ -//$PageSecurity = 2; include('includes/session.inc'); if (isset($_POST['TaxAuthority']) AND @@ -12,15 +11,15 @@ include('includes/PDFStarter.php'); - $sql = 'SELECT lastdate_in_period - FROM periods - WHERE periodno=' . $_POST['ToPeriod']; + $sql = "SELECT lastdate_in_period + FROM periods + WHERE periodno='" . $_POST['ToPeriod'] . "'"; $ErrMsg = _('Could not determine the last date of the period selected') . '. ' . _('The sql returned the following error'); $PeriodEndResult = DB_query($sql,$db,$ErrMsg); $PeriodEndRow = DB_fetch_row($PeriodEndResult); $PeriodEnd = ConvertSQLDate($PeriodEndRow[0]); - $result = DB_query('SELECT description FROM taxauthorities WHERE taxid=' . $_POST['TaxAuthority'],$db); + $result = DB_query("SELECT description FROM taxauthorities WHERE taxid='" . $_POST['TaxAuthority'] . "'",$db); $TaxAuthDescription = DB_fetch_row($result); $TaxAuthorityName = $TaxAuthDescription[0]; @@ -61,22 +60,14 @@ $title = _('Taxation Reporting Error'); include('includes/header.inc'); prnMsg(_('The accounts receivable transaction details could not be retrieved 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; } -// if (DB_num_rows($DebtorTransResult)==0){ -// $title = _('Taxation Reporting Error'); -// include('includes/header.inc'); -// prnMsg (_('There are no tax entries to list'),'info'); -// echo "<br><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; -// include('includes/footer.inc'); -// exit; -// } -// + if ($_POST['DetailOrSummary']=='Detail'){ include ('includes/PDFTaxPageHeader.inc'); $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,120,$FontSize+2, _('Tax On Sales'),'left'); @@ -174,9 +165,9 @@ $title = _('Taxation Reporting Error'); include('includes/header.inc'); echo _('The accounts payable transaction details could not be retrieved because') . ' ' . DB_error_msg($db); - 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; @@ -283,7 +274,7 @@ $title = _('Taxation Reporting Error'); include('includes/header.inc'); prnMsg (_('There are no tax entries to list'),'info'); - 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; } else { @@ -298,60 +289,61 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Supplier Types') . '" 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>' . _('Tax Authority To Report On:') . ':</font></td> - <td><select name=TaxAuthority>'; + <td><select name="TaxAuthority">'; - $result = DB_query('SELECT taxid, description FROM taxauthorities',$db); + $result = DB_query("SELECT taxid, description FROM taxauthorities",$db); while ($myrow = DB_fetch_array($result)){ - echo '<option Value=' . $myrow['taxid'] . '>' . $myrow['description']; + echo '<option Value=' . $myrow['taxid'] . '>' . $myrow['description'] . '</option>'; } echo '</select></td></tr>'; echo '<tr><td>' . _('Return Covering') . ':</font></td> - <td><select name=NoOfPeriods> - <option Value=1>' . _('One Month') . - '<option selected Value=2>' ._('Two Months') . - '<option VALUE=3>' . _('Quarter') . - '<option VALUE=6>' . _('Six Months') . + <td><select name="NoOfPeriods"> + <option value=1>' . _('One Month') . '</option>' . + '<option selected value=2>' ._('Two Months') . '</option>' . + '<option value=3>' . _('Quarter') . '</option>' . + '<option value=6>' . _('Six Months') . '</option>' . '</select></td></tr>'; - echo '<tr><td>' . _('Return To') . ":</td> - <td><select Name='ToPeriod'>"; + echo '<tr><td>' . _('Return To') . ':</td> + <td><select name="ToPeriod">'; $DefaultPeriod = GetPeriod(Date($_SESSION['DefaultDateFormat'],Mktime(0,0,0,Date('m'),0,Date('Y'))),$db); - $sql = 'SELECT periodno, + $sql = "SELECT periodno, lastdate_in_period - FROM periods'; + FROM periods"; $ErrMsg = _('Could not retrieve the period data because'); $Periods = DB_query($sql,$db,$ErrMsg); while ($myrow = DB_fetch_array($Periods,$db)){ if ($myrow['periodno']==$DefaultPeriod){ - echo '<option selected VALUE=' . $myrow['periodno'] . '>' . ConvertSQLDate($myrow['lastdate_in_period']); + echo '<option selected VALUE=' . $myrow['periodno'] . '>' . ConvertSQLDate($myrow['lastdate_in_period']) . '</option>'; } else { - echo '<option VALUE=' . $myrow['periodno'] . '>' . ConvertSQLDate($myrow['lastdate_in_period']); + echo '<option VALUE=' . $myrow['periodno'] . '>' . ConvertSQLDate($myrow['lastdate_in_period']) . '</option>'; } } echo '</select></td></tr>'; - echo '<tr><td>' . _('Detail Or Summary Only') . ":</font></td> - <td><select name='DetailOrSummary'> - <option Value='Detail'>" . _('Detail and Summary') . - "<option selected Value='Summary'>" . _('Summary Only') . - "</select></td></tr>"; + echo '<tr><td>' . _('Detail Or Summary Only') . ':</font></td> + <td><select name="DetailOrSummary"> + <option Value="Detail">' . _('Detail and Summary') . '</option> + <option selected value="Summary">' . _('Summary Only') . '</option> + </select></td></tr>'; - echo "</table> - <br /><div class='centre'><input type=Submit Name='PrintPDF' Value='" . _('Print PDF') . "'> + echo '</table> + <br /><div class="centre"><input type="submit" name="PrintPDF" value="' . _('Print PDF') . '"> </div> - </form>"; + </form>'; include('includes/footer.inc'); } /*end of else not PrintPDF */ Modified: trunk/TaxAuthorities.php =================================================================== --- trunk/TaxAuthorities.php 2011-04-06 10:01:30 UTC (rev 4540) +++ trunk/TaxAuthorities.php 2011-04-07 10:23:55 UTC (rev 4541) @@ -2,7 +2,6 @@ /* $Id$*/ -//$PageSecurity=15; include('includes/session.inc'); $title = _('Tax Authorities'); include('includes/header.inc'); @@ -126,7 +125,7 @@ /* It could still be the second time the page has been run and a record has been selected for modification - SelectedTaxAuthID will exist because it was sent with the new call. If its the first time the page has been displayed with no parameters then none of the above are true and the list of tax authorities will be displayed with links to delete or edit each. These will call the same page again and allow update/input or deletion of the records*/ - $sql = 'SELECT taxid, + $sql = "SELECT taxid, description, taxglcode, purchtaxglaccount, @@ -134,23 +133,23 @@ bankacc, bankacctype, bankswift - FROM taxauthorities'; + FROM taxauthorities"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The defined tax authorities could not be retrieved because'); $DbgMsg = _('The following SQL to retrieve the tax authorities was used'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); echo '<table class=selection>'; - echo "<tr> - <th>" . _('ID') . "</th> - <th>" . _('Description') . "</th> - <th>" . _('Input Tax') . '<br>' . _('GL Account') . "</th> - <th>" . _('Output Tax') . '<br>' . _('GL Account') . "</th> - <th>" . _('Bank') . "</th> - <th>" . _('Bank Account') . "</th> - <th>" . _('Bank Act Type') . "</th> - <th>" . _('Bank Swift') . "</th> - </tr></font>"; + echo '<tr> + <th>' . _('ID') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Input Tax') . '<br>' . _('GL Account') . '</th> + <th>' . _('Output Tax') . '<br>' . _('GL Account') . '</th> + <th>' . _('Bank') . '</th> + <th>' . _('Bank Account') . '</th> + <th>' . _('Bank Act Type') . '</th> + <th>' . _('Bank Swift') . '</th> + </tr></font>'; $k=0; while ($myrow = DB_fetch_row($result)) { @@ -182,11 +181,11 @@ $myrow[5], $myrow[6], $myrow[7], - $_SERVER['PHP_SELF'] . '?' . SID, + $_SERVER['PHP_SELF'] . '?', $myrow[0], - $_SERVER['PHP_SELF'] . '?' . SID, + $_SERVER['PHP_SELF'] . '?', $myrow[0], - $rootpath . '/TaxAuthorityRates.php?' . SID, + $rootpath . '/TaxAuthorityRates.php?', $myrow[0]); } @@ -200,11 +199,11 @@ if (isset($SelectedTaxAuthID)) { - echo "<div class='centre'><a href='" . $_SERVER['PHP_SELF'] . '?' . SID ."'>" . _('Review all defined tax authority records') . '</a></div>'; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] .'">' . _('Review all defined tax authority records') . '</a></div>'; } -echo "<p><form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID .'>'; +echo '<p><form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedTaxAuthID)) { @@ -237,13 +236,13 @@ } //end of if $SelectedTaxAuthID only do the else when a new record is being entered -$SQL = 'SELECT accountcode, +$SQL = "SELECT accountcode, accountname FROM chartmaster, accountgroups WHERE chartmaster.group_=accountgroups.groupname AND accountgroups.pandl=0 - ORDER BY accountcode'; + ORDER BY accountcode"; $result = DB_query($SQL,$db); if (!isset($_POST['Description'])) { @@ -255,7 +254,7 @@ echo '<tr><td>' . _('Input tax GL Account') . ':</td> - <td><select name=PurchTaxGLCode>'; + <td><select name="PurchTaxGLCode">'; while ($myrow = DB_fetch_array($result)) { if (isset($_POST['PurchTaxGLCode']) and $myrow['accountcode']==$_POST['PurchTaxGLCode']) { @@ -263,7 +262,7 @@ } else { echo '<option VALUE='; } - echo $myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')'; + echo $myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } //end while loop @@ -272,7 +271,7 @@ DB_data_seek($result,0); echo '<tr><td>' . _('Output tax GL Account') . ':</td> - <td><select name=TaxGLCode>'; + <td><select name="TaxGLCode">'; while ($myrow = DB_fetch_array($result)) { @@ -281,7 +280,7 @@ } else { echo "<option VALUE='"; } - echo $myrow['accountcode'] . "'>" . $myrow['accountname'] . ' ('.$myrow['accountcode'].')'; + echo $myrow['accountcode'] . "'>" . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } //end while loop Modified: trunk/TaxGroups.php =================================================================== --- trunk/TaxGroups.php 2011-04-06 10:01:30 UTC (rev 4540) +++ trunk/TaxGroups.php 2011-04-07 10:23:55 UTC (rev 4541) @@ -1,6 +1,5 @@ <?php /* $Id$*/ -//PageSecurity=15; include('includes/session.inc'); @@ -125,14 +124,14 @@ $myrow = DB_fetch_row($result); if ($myrow[0]>0) { prnMsg( _('Cannot delete this tax group because some customer branches are setup using it'),'warn'); - echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('customer branches referring to this tax group'); + echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('customer branches referring to this tax group'); } else { $sql= "SELECT COUNT(*) FROM suppliers WHERE taxgroupid='" . $_GET['SelectedGroup'] . "'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { prnMsg( _('Cannot delete this tax group because some suppliers are setup using it'),'warn'); - echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('suppliers referring to this tax group'); + echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('suppliers referring to this tax group'); } else { $sql="DELETE FROM taxgrouptaxes WHERE taxgroupid='" . $_GET['SelectedGroup'] . "'"; @@ -161,8 +160,8 @@ echo '</div>'; } else { echo '<table class=selection>'; - echo "<tr><th>" . _('Group No') . "</th> - <th>" . _('Tax Group') . "</th></tr>"; + echo '<tr><th>' . _('Group No') . '</th> + <th>' . _('Tax Group') . '</th></tr>'; $k=0; //row colour counter while ($myrow = DB_fetch_array($result)) { @@ -181,9 +180,9 @@ </tr>", $myrow['taxgroupid'], $myrow['taxgroupdescription'], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $myrow['taxgroupid'], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $myrow['taxgroupid'], urlencode($myrow['taxgroupdescription'])); @@ -194,7 +193,7 @@ if (isset($SelectedGroup)) { - echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] ."?" . SID . '">' . _('Review Existing Groups') . '</a></div>'; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Review Existing Groups') . '</a></div>'; } if (isset($SelectedGroup)) { @@ -213,7 +212,7 @@ $_POST['GroupName'] = $myrow['taxgroupdescription']; } } -echo '<br>'; +echo '<br />'; echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . "?" . SID . ">"; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if( isset($_POST['SelectedGroup'])) { @@ -230,7 +229,7 @@ if (isset($SelectedGroup)) { - echo '</table><br>'; + echo '</table><br />'; $sql = 'SELECT taxid, description as taxname @@ -299,31 +298,31 @@ } echo '</table>'; - echo '<br><div class="centre"><input type="submit" name="UpdateOrder" value="' . _('Update Order') . '"></div>'; + echo '<br /><div class="centre"><input type="submit" name="UpdateOrder" value="' . _('Update Order') . '"></div>'; } echo '</form>'; if (DB_num_rows($Result)>0 ) { - echo '<br>'; - echo '<table class=selection><tr>'; - echo "<th colspan=4>"._('Assigned Taxes')."</th>"; - echo '<th></th>'; - echo "<th colspan=2>"._('Available Taxes')."</th>"; - echo '</tr>'; + echo '<br />'; + echo '<table class=selection> + <tr> + <th colspan=4>'._('Assigned Taxes') . '</th> + <th></th> + <th colspan=2>' . _('Available Taxes') . '</th> + </tr>'; + echo '<tr> + <th>' . _('Tax Auth ID') . '</th> + <th>' . _('Tax Authority Name') . '</th> + <th>' . _('Calculation Order') . '</th> + <th>' . _('Tax on Prior Tax(es)') . '</th> + <th></th> + <th>' . _('Tax Auth ID') . '</th> + <th>' . _('Tax Authority Name') . '</th> + </tr>'; - echo '<tr>'; - echo "<th>" . _('Tax Auth ID') . '</th>'; - echo "<th>" . _('Tax Authority Name') . '</th>'; - echo "<th>" . _('Calculation Order') . '</th>'; - echo "<th>" . _('Tax on Prior Tax(es)') . '</th>'; - echo '<th></th>'; - echo "<th>" . _('Tax Auth ID') . '</th>'; - echo "<th>" . _('Tax Authority Name') . '</th>'; - echo '</tr>'; - } else { - echo '<br><div class="centre">' . _('There are no tax authorities defined to allocate to this tax group').'</div>'; + echo '<br /><div class="centre">' . _('There are no tax authorities defined to allocate to this tax group').'</div>'; } $k=0; //row colour counter @@ -357,7 +356,7 @@ $AvailRow['taxname'], $TaxAuthRow[$TaxAuthUsedPointer]['calculationorder'], $TaxOnTax, - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $SelectedGroup, $AvailRow['taxid'] ); @@ -373,7 +372,7 @@ <td><a href=\"%s&SelectedGroup=%s&add=1&TaxAuthority=%s\">" . _('Add') . "</a></td>", $AvailRow['taxid'], $AvailRow['taxname'], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $SelectedGroup, $AvailRow['taxid'] ); Modified: trunk/TopItems.php =================================================================== --- trunk/TopItems.php 2011-04-06 10:01:30 UTC (rev 4540) +++ trunk/TopItems.php 2011-04-07 10:23:55 UTC (rev 4541) @@ -1,6 +1,7 @@ <?php -/* $Revision: 1.3 $ */ -//$PageSecurity = 2; Now from db + +/* $Id$*/ + /* Session started in session.inc for password checking and authorisation level check config.php is in turn included in session.inc*/ include ('includes/session.inc'); @@ -15,24 +16,26 @@ echo '<table cellpadding=3 colspan=4 class=selection>'; //to view store location echo '<tr><td width="150">' . _('Select Location') . ' </td><td>:</td><td><select name=Location>'; - $sql = 'SELECT loccode, + $sql = "SELECT loccode, locationname - FROM `locations`'; + FROM `locations`"; $result = DB_query($sql, $db); echo '<option value="All">' . _('All') . '</option>'; while ($myrow = DB_fetch_array($result)) { - echo "<option VALUE='" . $myrow['loccode'] . "'>" . $myrow['loccode'] . " - " . $myrow['locationname'] . '</option>'; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['loccode'] . ' - ' . $myrow['locationname'] . '</option>'; } echo '</select></td></tr>'; //to view list of customer - echo '<tr><td width="150">' . _('Select Customer Type') . ' </td><td>:</td><td><select name=Customers>'; - $sql = 'SELECT typename, + echo '<tr><td width="150">' . _('Select Customer Type') . '</td> + <td>:</td> + <td><select name="Customers">'; + $sql = "SELECT typename, typeid - FROM debtortype'; + FROM debtortype"; $result = DB_query($sql, $db); - echo "<option value='All'>" . _('All') . '</option>'; + echo '<option value="All">' . _('All') . '</option>'; while ($myrow = DB_fetch_array($result)) { - echo "<option VALUE='" . $myrow['typeid'] . "'>" . $myrow['typename'] . '</option>'; + echo '<option value="' . $myrow['typeid'] . '">' . $myrow['typename'] . '</option>'; } echo '</select></td> </tr>'; @@ -40,18 +43,18 @@ echo '<tr> <td width="150">' . _('Select Order By ') . ' </td> <td>:</td> <td><select name="Sequence">'; - echo ' <option value="TotalInvoiced">' . _('Total Pieces') . ''; - echo ' <option value="ValueSales">' . _('Value of Sales') . ''; + echo ' <option value="TotalInvoiced">' . _('Total Pieces') . '</option>'; + echo ' <option value="ValueSales">' . _('Value of Sales') . '</option>'; echo ' </select></td> </tr>'; //View number of days echo '<tr><td>' . _('Number Of Days') . ' </td><td>:</td> - <td><input class="number" tabindex="3" type="Text" name=NumberOfDays size="8" maxlength="8" value=0></td> + <td><input class="number" tabindex="3" type="Text" name="NumberOfDays" size="8" maxlength="8" value=0></td> </tr>'; //view number of NumberOfTopItems items echo '<tr> <td>' . _('Number Of Top Items') . ' </td><td>:</td> - <td><input class="number" tabindex="4" type="Text" name=NumberOfTopItems size="8" maxlength="8" value=1></td> + <td><input class="number" tabindex="4" type="Text" name="NumberOfTopItems" size="8" maxlength="8" value=1></td> </tr> <tr> <td></td> @@ -82,7 +85,7 @@ AND debtorsmaster.currcode = currencies.currabrev AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' GROUP BY salesorderdetails.stkcode - ORDER BY " . $_POST['Sequence'] . " DESC + ORDER BY '" . $_POST['Sequence'] . "' DESC LIMIT " . $_POST['NumberOfTopItems'] . ""; } else { //the situation if only location type selected "All" if ($_POST['Location'] == 'All') { @@ -103,11 +106,11 @@ AND debtorsmaster.typeid = '" . $_POST['Customers'] . "' AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' GROUP BY salesorderdetails.stkcode - ORDER BY " . $_POST['Sequence'] . " DESC + ORDER BY '" . $_POST['Sequence'] . "' DESC LIMIT " . $_POST[NumberOfTopItems] . ""; } else { //the situation if the customer type selected "All" - if ($_POST['Customers'] == "All") { + if ($_POST['Customers'] == 'All') { $SQL = "SELECT salesorderdetails.stkcode, SUM(salesorderdetails.qtyinvoiced) TotalInvoiced, SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS ValueSales, @@ -145,7 +148,7 @@ AND debtorsmaster.typeid = '" . $_POST['Customers'] . "' AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' GROUP BY salesorderdetails.stkcode - ORDER BY " . $_POST['Sequence'] . " DESC + ORDER BY '" . $_POST['Sequence'] . "' DESC LIMIT " . $_POST['NumberOfTopItems'] . ""; } } @@ -163,13 +166,11 @@ <th>' . _('Value Sales') . '</th> <th>' . _('On Hand') . '</th>'; echo $TableHeader; - echo ' - <input type="hidden" value=' . $_POST['Location'] . ' name="Location" /> + echo '<input type="hidden" value=' . $_POST['Location'] . ' name="Location" /> <input type="hidden" value=' . $_POST['Sequence'] . ' name="Sequence" /> <input type="hidden" value=' . $_POST['NumberOfDays'] . ' name="NumberOfDays" /> <input type="hidden" value=' . $_POST['Customers'] . ' name="Customers" /> - <input type="hidden" value=' . $_POST['NumberOfTopItems'] . ' name="NumberOfTopItems" /> - '; + <input type="hidden" value=' . $_POST['NumberOfTopItems'] . ' name="NumberOfTopItems" />'; $k = 0; //row colour counter $i = 1; while ($myrow = DB_fetch_array($result)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-04-07 10:24:02
|
Revision: 4541 http://web-erp.svn.sourceforge.net/web-erp/?rev=4541&view=rev Author: daintree Date: 2011-04-07 10:23:55 +0000 (Thu, 07 Apr 2011) Log Message: ----------- various Modified Paths: -------------- trunk/Tax.php trunk/TaxAuthorities.php trunk/TaxGroups.php trunk/TopItems.php Modified: trunk/Tax.php =================================================================== --- trunk/Tax.php 2011-04-06 10:01:30 UTC (rev 4540) +++ trunk/Tax.php 2011-04-07 10:23:55 UTC (rev 4541) @@ -2,7 +2,6 @@ /* $Id$*/ -//$PageSecurity = 2; include('includes/session.inc'); if (isset($_POST['TaxAuthority']) AND @@ -12,15 +11,15 @@ include('includes/PDFStarter.php'); - $sql = 'SELECT lastdate_in_period - FROM periods - WHERE periodno=' . $_POST['ToPeriod']; + $sql = "SELECT lastdate_in_period + FROM periods + WHERE periodno='" . $_POST['ToPeriod'] . "'"; $ErrMsg = _('Could not determine the last date of the period selected') . '. ' . _('The sql returned the following error'); $PeriodEndResult = DB_query($sql,$db,$ErrMsg); $PeriodEndRow = DB_fetch_row($PeriodEndResult); $PeriodEnd = ConvertSQLDate($PeriodEndRow[0]); - $result = DB_query('SELECT description FROM taxauthorities WHERE taxid=' . $_POST['TaxAuthority'],$db); + $result = DB_query("SELECT description FROM taxauthorities WHERE taxid='" . $_POST['TaxAuthority'] . "'",$db); $TaxAuthDescription = DB_fetch_row($result); $TaxAuthorityName = $TaxAuthDescription[0]; @@ -61,22 +60,14 @@ $title = _('Taxation Reporting Error'); include('includes/header.inc'); prnMsg(_('The accounts receivable transaction details could not be retrieved 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; } -// if (DB_num_rows($DebtorTransResult)==0){ -// $title = _('Taxation Reporting Error'); -// include('includes/header.inc'); -// prnMsg (_('There are no tax entries to list'),'info'); -// echo "<br><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; -// include('includes/footer.inc'); -// exit; -// } -// + if ($_POST['DetailOrSummary']=='Detail'){ include ('includes/PDFTaxPageHeader.inc'); $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,120,$FontSize+2, _('Tax On Sales'),'left'); @@ -174,9 +165,9 @@ $title = _('Taxation Reporting Error'); include('includes/header.inc'); echo _('The accounts payable transaction details could not be retrieved because') . ' ' . DB_error_msg($db); - 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; @@ -283,7 +274,7 @@ $title = _('Taxation Reporting Error'); include('includes/header.inc'); prnMsg (_('There are no tax entries to list'),'info'); - 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; } else { @@ -298,60 +289,61 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Supplier Types') . '" 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>' . _('Tax Authority To Report On:') . ':</font></td> - <td><select name=TaxAuthority>'; + <td><select name="TaxAuthority">'; - $result = DB_query('SELECT taxid, description FROM taxauthorities',$db); + $result = DB_query("SELECT taxid, description FROM taxauthorities",$db); while ($myrow = DB_fetch_array($result)){ - echo '<option Value=' . $myrow['taxid'] . '>' . $myrow['description']; + echo '<option Value=' . $myrow['taxid'] . '>' . $myrow['description'] . '</option>'; } echo '</select></td></tr>'; echo '<tr><td>' . _('Return Covering') . ':</font></td> - <td><select name=NoOfPeriods> - <option Value=1>' . _('One Month') . - '<option selected Value=2>' ._('Two Months') . - '<option VALUE=3>' . _('Quarter') . - '<option VALUE=6>' . _('Six Months') . + <td><select name="NoOfPeriods"> + <option value=1>' . _('One Month') . '</option>' . + '<option selected value=2>' ._('Two Months') . '</option>' . + '<option value=3>' . _('Quarter') . '</option>' . + '<option value=6>' . _('Six Months') . '</option>' . '</select></td></tr>'; - echo '<tr><td>' . _('Return To') . ":</td> - <td><select Name='ToPeriod'>"; + echo '<tr><td>' . _('Return To') . ':</td> + <td><select name="ToPeriod">'; $DefaultPeriod = GetPeriod(Date($_SESSION['DefaultDateFormat'],Mktime(0,0,0,Date('m'),0,Date('Y'))),$db); - $sql = 'SELECT periodno, + $sql = "SELECT periodno, lastdate_in_period - FROM periods'; + FROM periods"; $ErrMsg = _('Could not retrieve the period data because'); $Periods = DB_query($sql,$db,$ErrMsg); while ($myrow = DB_fetch_array($Periods,$db)){ if ($myrow['periodno']==$DefaultPeriod){ - echo '<option selected VALUE=' . $myrow['periodno'] . '>' . ConvertSQLDate($myrow['lastdate_in_period']); + echo '<option selected VALUE=' . $myrow['periodno'] . '>' . ConvertSQLDate($myrow['lastdate_in_period']) . '</option>'; } else { - echo '<option VALUE=' . $myrow['periodno'] . '>' . ConvertSQLDate($myrow['lastdate_in_period']); + echo '<option VALUE=' . $myrow['periodno'] . '>' . ConvertSQLDate($myrow['lastdate_in_period']) . '</option>'; } } echo '</select></td></tr>'; - echo '<tr><td>' . _('Detail Or Summary Only') . ":</font></td> - <td><select name='DetailOrSummary'> - <option Value='Detail'>" . _('Detail and Summary') . - "<option selected Value='Summary'>" . _('Summary Only') . - "</select></td></tr>"; + echo '<tr><td>' . _('Detail Or Summary Only') . ':</font></td> + <td><select name="DetailOrSummary"> + <option Value="Detail">' . _('Detail and Summary') . '</option> + <option selected value="Summary">' . _('Summary Only') . '</option> + </select></td></tr>'; - echo "</table> - <br /><div class='centre'><input type=Submit Name='PrintPDF' Value='" . _('Print PDF') . "'> + echo '</table> + <br /><div class="centre"><input type="submit" name="PrintPDF" value="' . _('Print PDF') . '"> </div> - </form>"; + </form>'; include('includes/footer.inc'); } /*end of else not PrintPDF */ Modified: trunk/TaxAuthorities.php =================================================================== --- trunk/TaxAuthorities.php 2011-04-06 10:01:30 UTC (rev 4540) +++ trunk/TaxAuthorities.php 2011-04-07 10:23:55 UTC (rev 4541) @@ -2,7 +2,6 @@ /* $Id$*/ -//$PageSecurity=15; include('includes/session.inc'); $title = _('Tax Authorities'); include('includes/header.inc'); @@ -126,7 +125,7 @@ /* It could still be the second time the page has been run and a record has been selected for modification - SelectedTaxAuthID will exist because it was sent with the new call. If its the first time the page has been displayed with no parameters then none of the above are true and the list of tax authorities will be displayed with links to delete or edit each. These will call the same page again and allow update/input or deletion of the records*/ - $sql = 'SELECT taxid, + $sql = "SELECT taxid, description, taxglcode, purchtaxglaccount, @@ -134,23 +133,23 @@ bankacc, bankacctype, bankswift - FROM taxauthorities'; + FROM taxauthorities"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The defined tax authorities could not be retrieved because'); $DbgMsg = _('The following SQL to retrieve the tax authorities was used'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); echo '<table class=selection>'; - echo "<tr> - <th>" . _('ID') . "</th> - <th>" . _('Description') . "</th> - <th>" . _('Input Tax') . '<br>' . _('GL Account') . "</th> - <th>" . _('Output Tax') . '<br>' . _('GL Account') . "</th> - <th>" . _('Bank') . "</th> - <th>" . _('Bank Account') . "</th> - <th>" . _('Bank Act Type') . "</th> - <th>" . _('Bank Swift') . "</th> - </tr></font>"; + echo '<tr> + <th>' . _('ID') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Input Tax') . '<br>' . _('GL Account') . '</th> + <th>' . _('Output Tax') . '<br>' . _('GL Account') . '</th> + <th>' . _('Bank') . '</th> + <th>' . _('Bank Account') . '</th> + <th>' . _('Bank Act Type') . '</th> + <th>' . _('Bank Swift') . '</th> + </tr></font>'; $k=0; while ($myrow = DB_fetch_row($result)) { @@ -182,11 +181,11 @@ $myrow[5], $myrow[6], $myrow[7], - $_SERVER['PHP_SELF'] . '?' . SID, + $_SERVER['PHP_SELF'] . '?', $myrow[0], - $_SERVER['PHP_SELF'] . '?' . SID, + $_SERVER['PHP_SELF'] . '?', $myrow[0], - $rootpath . '/TaxAuthorityRates.php?' . SID, + $rootpath . '/TaxAuthorityRates.php?', $myrow[0]); } @@ -200,11 +199,11 @@ if (isset($SelectedTaxAuthID)) { - echo "<div class='centre'><a href='" . $_SERVER['PHP_SELF'] . '?' . SID ."'>" . _('Review all defined tax authority records') . '</a></div>'; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] .'">' . _('Review all defined tax authority records') . '</a></div>'; } -echo "<p><form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID .'>'; +echo '<p><form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedTaxAuthID)) { @@ -237,13 +236,13 @@ } //end of if $SelectedTaxAuthID only do the else when a new record is being entered -$SQL = 'SELECT accountcode, +$SQL = "SELECT accountcode, accountname FROM chartmaster, accountgroups WHERE chartmaster.group_=accountgroups.groupname AND accountgroups.pandl=0 - ORDER BY accountcode'; + ORDER BY accountcode"; $result = DB_query($SQL,$db); if (!isset($_POST['Description'])) { @@ -255,7 +254,7 @@ echo '<tr><td>' . _('Input tax GL Account') . ':</td> - <td><select name=PurchTaxGLCode>'; + <td><select name="PurchTaxGLCode">'; while ($myrow = DB_fetch_array($result)) { if (isset($_POST['PurchTaxGLCode']) and $myrow['accountcode']==$_POST['PurchTaxGLCode']) { @@ -263,7 +262,7 @@ } else { echo '<option VALUE='; } - echo $myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')'; + echo $myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } //end while loop @@ -272,7 +271,7 @@ DB_data_seek($result,0); echo '<tr><td>' . _('Output tax GL Account') . ':</td> - <td><select name=TaxGLCode>'; + <td><select name="TaxGLCode">'; while ($myrow = DB_fetch_array($result)) { @@ -281,7 +280,7 @@ } else { echo "<option VALUE='"; } - echo $myrow['accountcode'] . "'>" . $myrow['accountname'] . ' ('.$myrow['accountcode'].')'; + echo $myrow['accountcode'] . "'>" . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } //end while loop Modified: trunk/TaxGroups.php =================================================================== --- trunk/TaxGroups.php 2011-04-06 10:01:30 UTC (rev 4540) +++ trunk/TaxGroups.php 2011-04-07 10:23:55 UTC (rev 4541) @@ -1,6 +1,5 @@ <?php /* $Id$*/ -//PageSecurity=15; include('includes/session.inc'); @@ -125,14 +124,14 @@ $myrow = DB_fetch_row($result); if ($myrow[0]>0) { prnMsg( _('Cannot delete this tax group because some customer branches are setup using it'),'warn'); - echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('customer branches referring to this tax group'); + echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('customer branches referring to this tax group'); } else { $sql= "SELECT COUNT(*) FROM suppliers WHERE taxgroupid='" . $_GET['SelectedGroup'] . "'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { prnMsg( _('Cannot delete this tax group because some suppliers are setup using it'),'warn'); - echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('suppliers referring to this tax group'); + echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('suppliers referring to this tax group'); } else { $sql="DELETE FROM taxgrouptaxes WHERE taxgroupid='" . $_GET['SelectedGroup'] . "'"; @@ -161,8 +160,8 @@ echo '</div>'; } else { echo '<table class=selection>'; - echo "<tr><th>" . _('Group No') . "</th> - <th>" . _('Tax Group') . "</th></tr>"; + echo '<tr><th>' . _('Group No') . '</th> + <th>' . _('Tax Group') . '</th></tr>'; $k=0; //row colour counter while ($myrow = DB_fetch_array($result)) { @@ -181,9 +180,9 @@ </tr>", $myrow['taxgroupid'], $myrow['taxgroupdescription'], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $myrow['taxgroupid'], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $myrow['taxgroupid'], urlencode($myrow['taxgroupdescription'])); @@ -194,7 +193,7 @@ if (isset($SelectedGroup)) { - echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] ."?" . SID . '">' . _('Review Existing Groups') . '</a></div>'; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Review Existing Groups') . '</a></div>'; } if (isset($SelectedGroup)) { @@ -213,7 +212,7 @@ $_POST['GroupName'] = $myrow['taxgroupdescription']; } } -echo '<br>'; +echo '<br />'; echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . "?" . SID . ">"; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if( isset($_POST['SelectedGroup'])) { @@ -230,7 +229,7 @@ if (isset($SelectedGroup)) { - echo '</table><br>'; + echo '</table><br />'; $sql = 'SELECT taxid, description as taxname @@ -299,31 +298,31 @@ } echo '</table>'; - echo '<br><div class="centre"><input type="submit" name="UpdateOrder" value="' . _('Update Order') . '"></div>'; + echo '<br /><div class="centre"><input type="submit" name="UpdateOrder" value="' . _('Update Order') . '"></div>'; } echo '</form>'; if (DB_num_rows($Result)>0 ) { - echo '<br>'; - echo '<table class=selection><tr>'; - echo "<th colspan=4>"._('Assigned Taxes')."</th>"; - echo '<th></th>'; - echo "<th colspan=2>"._('Available Taxes')."</th>"; - echo '</tr>'; + echo '<br />'; + echo '<table class=selection> + <tr> + <th colspan=4>'._('Assigned Taxes') . '</th> + <th></th> + <th colspan=2>' . _('Available Taxes') . '</th> + </tr>'; + echo '<tr> + <th>' . _('Tax Auth ID') . '</th> + <th>' . _('Tax Authority Name') . '</th> + <th>' . _('Calculation Order') . '</th> + <th>' . _('Tax on Prior Tax(es)') . '</th> + <th></th> + <th>' . _('Tax Auth ID') . '</th> + <th>' . _('Tax Authority Name') . '</th> + </tr>'; - echo '<tr>'; - echo "<th>" . _('Tax Auth ID') . '</th>'; - echo "<th>" . _('Tax Authority Name') . '</th>'; - echo "<th>" . _('Calculation Order') . '</th>'; - echo "<th>" . _('Tax on Prior Tax(es)') . '</th>'; - echo '<th></th>'; - echo "<th>" . _('Tax Auth ID') . '</th>'; - echo "<th>" . _('Tax Authority Name') . '</th>'; - echo '</tr>'; - } else { - echo '<br><div class="centre">' . _('There are no tax authorities defined to allocate to this tax group').'</div>'; + echo '<br /><div class="centre">' . _('There are no tax authorities defined to allocate to this tax group').'</div>'; } $k=0; //row colour counter @@ -357,7 +356,7 @@ $AvailRow['taxname'], $TaxAuthRow[$TaxAuthUsedPointer]['calculationorder'], $TaxOnTax, - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $SelectedGroup, $AvailRow['taxid'] ); @@ -373,7 +372,7 @@ <td><a href=\"%s&SelectedGroup=%s&add=1&TaxAuthority=%s\">" . _('Add') . "</a></td>", $AvailRow['taxid'], $AvailRow['taxname'], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $SelectedGroup, $AvailRow['taxid'] ); Modified: trunk/TopItems.php =================================================================== --- trunk/TopItems.php 2011-04-06 10:01:30 UTC (rev 4540) +++ trunk/TopItems.php 2011-04-07 10:23:55 UTC (rev 4541) @@ -1,6 +1,7 @@ <?php -/* $Revision: 1.3 $ */ -//$PageSecurity = 2; Now from db + +/* $Id$*/ + /* Session started in session.inc for password checking and authorisation level check config.php is in turn included in session.inc*/ include ('includes/session.inc'); @@ -15,24 +16,26 @@ echo '<table cellpadding=3 colspan=4 class=selection>'; //to view store location echo '<tr><td width="150">' . _('Select Location') . ' </td><td>:</td><td><select name=Location>'; - $sql = 'SELECT loccode, + $sql = "SELECT loccode, locationname - FROM `locations`'; + FROM `locations`"; $result = DB_query($sql, $db); echo '<option value="All">' . _('All') . '</option>'; while ($myrow = DB_fetch_array($result)) { - echo "<option VALUE='" . $myrow['loccode'] . "'>" . $myrow['loccode'] . " - " . $myrow['locationname'] . '</option>'; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['loccode'] . ' - ' . $myrow['locationname'] . '</option>'; } echo '</select></td></tr>'; //to view list of customer - echo '<tr><td width="150">' . _('Select Customer Type') . ' </td><td>:</td><td><select name=Customers>'; - $sql = 'SELECT typename, + echo '<tr><td width="150">' . _('Select Customer Type') . '</td> + <td>:</td> + <td><select name="Customers">'; + $sql = "SELECT typename, typeid - FROM debtortype'; + FROM debtortype"; $result = DB_query($sql, $db); - echo "<option value='All'>" . _('All') . '</option>'; + echo '<option value="All">' . _('All') . '</option>'; while ($myrow = DB_fetch_array($result)) { - echo "<option VALUE='" . $myrow['typeid'] . "'>" . $myrow['typename'] . '</option>'; + echo '<option value="' . $myrow['typeid'] . '">' . $myrow['typename'] . '</option>'; } echo '</select></td> </tr>'; @@ -40,18 +43,18 @@ echo '<tr> <td width="150">' . _('Select Order By ') . ' </td> <td>:</td> <td><select name="Sequence">'; - echo ' <option value="TotalInvoiced">' . _('Total Pieces') . ''; - echo ' <option value="ValueSales">' . _('Value of Sales') . ''; + echo ' <option value="TotalInvoiced">' . _('Total Pieces') . '</option>'; + echo ' <option value="ValueSales">' . _('Value of Sales') . '</option>'; echo ' </select></td> </tr>'; //View number of days echo '<tr><td>' . _('Number Of Days') . ' </td><td>:</td> - <td><input class="number" tabindex="3" type="Text" name=NumberOfDays size="8" maxlength="8" value=0></td> + <td><input class="number" tabindex="3" type="Text" name="NumberOfDays" size="8" maxlength="8" value=0></td> </tr>'; //view number of NumberOfTopItems items echo '<tr> <td>' . _('Number Of Top Items') . ' </td><td>:</td> - <td><input class="number" tabindex="4" type="Text" name=NumberOfTopItems size="8" maxlength="8" value=1></td> + <td><input class="number" tabindex="4" type="Text" name="NumberOfTopItems" size="8" maxlength="8" value=1></td> </tr> <tr> <td></td> @@ -82,7 +85,7 @@ AND debtorsmaster.currcode = currencies.currabrev AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' GROUP BY salesorderdetails.stkcode - ORDER BY " . $_POST['Sequence'] . " DESC + ORDER BY '" . $_POST['Sequence'] . "' DESC LIMIT " . $_POST['NumberOfTopItems'] . ""; } else { //the situation if only location type selected "All" if ($_POST['Location'] == 'All') { @@ -103,11 +106,11 @@ AND debtorsmaster.typeid = '" . $_POST['Customers'] . "' AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' GROUP BY salesorderdetails.stkcode - ORDER BY " . $_POST['Sequence'] . " DESC + ORDER BY '" . $_POST['Sequence'] . "' DESC LIMIT " . $_POST[NumberOfTopItems] . ""; } else { //the situation if the customer type selected "All" - if ($_POST['Customers'] == "All") { + if ($_POST['Customers'] == 'All') { $SQL = "SELECT salesorderdetails.stkcode, SUM(salesorderdetails.qtyinvoiced) TotalInvoiced, SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS ValueSales, @@ -145,7 +148,7 @@ AND debtorsmaster.typeid = '" . $_POST['Customers'] . "' AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' GROUP BY salesorderdetails.stkcode - ORDER BY " . $_POST['Sequence'] . " DESC + ORDER BY '" . $_POST['Sequence'] . "' DESC LIMIT " . $_POST['NumberOfTopItems'] . ""; } } @@ -163,13 +166,11 @@ <th>' . _('Value Sales') . '</th> <th>' . _('On Hand') . '</th>'; echo $TableHeader; - echo ' - <input type="hidden" value=' . $_POST['Location'] . ' name="Location" /> + echo '<input type="hidden" value=' . $_POST['Location'] . ' name="Location" /> <input type="hidden" value=' . $_POST['Sequence'] . ' name="Sequence" /> <input type="hidden" value=' . $_POST['NumberOfDays'] . ' name="NumberOfDays" /> <input type="hidden" value=' . $_POST['Customers'] . ' name="Customers" /> - <input type="hidden" value=' . $_POST['NumberOfTopItems'] . ' name="NumberOfTopItems" /> - '; + <input type="hidden" value=' . $_POST['NumberOfTopItems'] . ' name="NumberOfTopItems" />'; $k = 0; //row colour counter $i = 1; while ($myrow = DB_fetch_array($result)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-04-08 23:37:09
|
Revision: 4542 http://web-erp.svn.sourceforge.net/web-erp/?rev=4542&view=rev Author: daintree Date: 2011-04-08 23:37:01 +0000 (Fri, 08 Apr 2011) Log Message: ----------- SQL xhtml quoting Modified Paths: -------------- trunk/ReverseGRN.php trunk/WWW_Access.php trunk/WWW_Users.php trunk/WorkCentres.php trunk/WorkOrderEntry.php trunk/WorkOrderIssue.php trunk/WorkOrderReceive.php trunk/Z_CheckAllocationsFrom.php trunk/Z_CheckAllocs.php trunk/Z_CheckDebtorsControl.php trunk/Z_CheckGLTransBalance.php trunk/Z_CreateChartDetails.php Modified: trunk/ReverseGRN.php =================================================================== --- trunk/ReverseGRN.php 2011-04-07 10:23:55 UTC (rev 4541) +++ trunk/ReverseGRN.php 2011-04-08 23:37:01 UTC (rev 4542) @@ -18,7 +18,7 @@ $_POST['SupplierID']=$_SESSION['SupplierID']; } if (!isset($_POST['SupplierID']) OR $_POST['SupplierID']==""){ - echo '<br>' . _('This page is expected to be called after a supplier has been selected'); + echo '<br />' . _('This page is expected to be called after a supplier has been selected'); echo "<meta http-equiv='Refresh' content='0; url=" . $rootpath . '/SelectSupplier.php?' . SID . "'>"; exit; } elseif (!isset($_POST['SuppName']) or $_POST['SuppName']=="") { @@ -61,7 +61,7 @@ $QtyToReverse = $GRN['qtyrecd'] - $GRN['quantityinv']; if ($QtyToReverse ==0){ - echo '<br><br>' . _('The GRN') . ' ' . $_GET['GRNNo'] . ' ' . _('has already been reversed or fully invoiced by the supplier - it cannot be reversed - stock quantities must be corrected by stock adjustments - the stock is paid for'); + echo '<br /><br />' . _('The GRN') . ' ' . $_GET['GRNNo'] . ' ' . _('has already been reversed or fully invoiced by the supplier - it cannot be reversed - stock quantities must be corrected by stock adjustments - the stock is paid for'); include ('includes/footer.inc'); exit; } @@ -73,7 +73,7 @@ $SQL = "SELECT stockmaster.controlled FROM stockmaster WHERE stockid ='" . $GRN['itemcode'] . "'"; - $CheckControlledResult = DB_query($SQL,$db,'<br>' . _('Could not determine if the item was controlled or not because') . ' '); + $CheckControlledResult = DB_query($SQL,$db,'<br />' . _('Could not determine if the item was controlled or not because') . ' '); $ControlledRow = DB_fetch_row($CheckControlledResult); if ($ControlledRow[0]==1) { /*Then its a controlled item */ $Controlled = true; @@ -132,7 +132,7 @@ /*Now the purchorder header status in case it was completed - now incomplete - just printed */ $SQL = "UPDATE purchorders SET status = 'Printed', - stat_comment = CONCAT('" . Date($_SESSION['DefaultDateFormat']) . ' ' . _('GRN Reversed for') . ' ' . $GRN['itemdescription'] . ' ' . _('by') . ' ' . $_SESSION['UsersRealName'] . "<br>', stat_comment ) + stat_comment = CONCAT('" . Date($_SESSION['DefaultDateFormat']) . ' ' . _('GRN Reversed for') . ' ' . $GRN['itemdescription'] . ' ' . _('by') . ' ' . $_SESSION['UsersRealName'] . "<br />', stat_comment ) WHERE orderno = '" . $GRN['orderno'] . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The purchase order statusand status comment could not be changed because'); @@ -146,7 +146,7 @@ $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GRN record could not be deleted because'); $DbgMsg = _('The following SQL to delete the GRN record was used'); - $result = DB_query('DELETE FROM grns WHERE grnno="' . $_GET['GRNNo'] . '"',$db,$ErrMsg,$DbgMsg,true); + $result = DB_query("DELETE FROM grns WHERE grnno='" . $_GET['GRNNo'] . "'",$db,$ErrMsg,$DbgMsg,true); } else { $SQL = "UPDATE grns SET qtyrecd = qtyrecd - $QtyToReverse @@ -159,26 +159,26 @@ /*If the GRN being reversed is an asset - reverse the fixedassettrans record */ if ($GRN['assetid']!='0'){ $SQL = "INSERT INTO fixedassettrans (assetid, - transtype, - transno, - transdate, - periodno, - inputdate, - cost) - VALUES ('" . $GRN['assetid'] . "', - 25, - '" . $_GET['GRNNo'] . "', - '" . $GRN['deliverydate'] . "', - '" . $PeriodNo . "', - '" . Date('Y-m-d') . "', - '" . -$GRN['stdcostunit'] * $QtyToReverse . "')"; + transtype, + transno, + transdate, + periodno, + inputdate, + cost) + VALUES ('" . $GRN['assetid'] . "', + 25, + '" . $_GET['GRNNo'] . "', + '" . $GRN['deliverydate'] . "', + '" . $PeriodNo . "', + '" . Date('Y-m-d') . "', + '" . -$GRN['stdcostunit'] * $QtyToReverse . "')"; $ErrMsg = _('CRITICAL ERROR! NOTE DOWN THIS ERROR AND SEEK ASSISTANCE The fixed asset transaction could not be inserted because'); $DbgMsg = _('The following SQL to insert the fixed asset transaction record was used'); $Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true); /*now reverse the cost put to fixedassets */ $SQL = "UPDATE fixedassets SET cost = cost - " . ($GRN['stdcostunit'] * $QtyToReverse) . " - WHERE assetid = '" . $GRN['assetid'] . "'"; + WHERE assetid = '" . $GRN['assetid'] . "'"; $ErrMsg = _('CRITICAL ERROR! NOTE DOWN THIS ERROR AND SEEK ASSISTANCE. The fixed asset cost addition could not be reversed:'); $DbgMsg = _('The following SQL was used to attempt the reduce the cost of the asset was:'); $Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true); @@ -186,9 +186,9 @@ } //end of if it is an asset $SQL = "SELECT stockmaster.controlled - FROM stockmaster - WHERE stockmaster.stockid = '" . $GRN['itemcode'] . "'"; - $Result = DB_query($SQL, $db, _('Could not determine if the item exists because'),'<br>' . _('The SQL that failed was') . ' ',true); + FROM stockmaster + WHERE stockmaster.stockid = '" . $GRN['itemcode'] . "'"; + $Result = DB_query($SQL, $db, _('Could not determine if the item exists because'),'<br />' . _('The SQL that failed was') . ' ',true); if (DB_num_rows($Result)==1){ /* if the GRN is in fact a stock item being reversed */ @@ -222,28 +222,28 @@ /* If its a stock item .... Insert stock movements - with unit cost */ - $SQL = "INSERT INTO stockmoves ( stockid, - type, - transno, - loccode, - trandate, - prd, - reference, - qty, - standardcost, - newqoh) - VALUES ( - '" . $GRN['itemcode'] . "', - 25, - '" . $_GET['GRNNo'] . "', - '" . $GRN['intostocklocation'] . "', - '" . $GRN['deliverydate'] . "', - '" . $PeriodNo . "', - '" . _('Reversal') . ' - ' . $_POST['SupplierID'] . ' - ' . $GRN['orderno'] . "', - '" . -$QtyToReverse . "', - '" . $GRN['stdcostunit'] . "', - '" . ($QtyOnHandPrior - $QtyToReverse) . "' - )"; + $SQL = "INSERT INTO stockmoves ( stockid, + type, + transno, + loccode, + trandate, + prd, + reference, + qty, + standardcost, + newqoh) + VALUES ( + '" . $GRN['itemcode'] . "', + 25, + '" . $_GET['GRNNo'] . "', + '" . $GRN['intostocklocation'] . "', + '" . $GRN['deliverydate'] . "', + '" . $PeriodNo . "', + '" . _('Reversal') . ' - ' . $_POST['SupplierID'] . ' - ' . $GRN['orderno'] . "', + '" . -$QtyToReverse . "', + '" . $GRN['stdcostunit'] . "', + '" . ($QtyOnHandPrior - $QtyToReverse) . "' + )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Stock movement records could not be inserted because'); $DbgMsg = _('The following SQL to insert the stock movement records was used'); @@ -305,21 +305,21 @@ /*now the GRN suspense entry*/ $SQL = "INSERT INTO gltrans ( type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES ( - 25, - '" . $_GET['GRNNo'] . "', - '" . $GRN['deliverydate'] . "', - '" . $PeriodNo . "', - '" . $_SESSION['CompanyRecord']['grnact'] . "', '" - . _('GRN Reversal PO') . ': ' . $GRN['orderno'] . " " . $_POST['SupplierID'] . " - " . $GRN['itemcode'] . "-" . $GRN['itemdescription'] . " x " . $QtyToReverse . " @ " . number_format($GRN['stdcostunit'],2) . "', - '" . $GRN['stdcostunit'] * $QtyToReverse . "' - )"; + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES ( + 25, + '" . $_GET['GRNNo'] . "', + '" . $GRN['deliverydate'] . "', + '" . $PeriodNo . "', + '" . $_SESSION['CompanyRecord']['grnact'] . "', '" + . _('GRN Reversal PO') . ': ' . $GRN['orderno'] . " " . $_POST['SupplierID'] . " - " . $GRN['itemcode'] . "-" . $GRN['itemdescription'] . " x " . $QtyToReverse . " @ " . number_format($GRN['stdcostunit'],2) . "', + '" . $GRN['stdcostunit'] * $QtyToReverse . "' + )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GRN suspense side of the GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GRN Suspense GLTrans record was used'); @@ -329,7 +329,7 @@ $Result = DB_Txn_Commit($db); - echo '<br>' . _('GRN number') . ' ' . $_GET['GRNNo'] . ' ' . _('for') . ' ' . $QtyToReverse . ' x ' . $GRN['itemcode'] . ' - ' . $GRN['itemdescription'] . ' ' . _('has been reversed') . '<br>'; + echo '<br />' . _('GRN number') . ' ' . $_GET['GRNNo'] . ' ' . _('for') . ' ' . $QtyToReverse . ' x ' . $GRN['itemcode'] . ' - ' . $GRN['itemdescription'] . ' ' . _('has been reversed') . '<br />'; unset($_GET['GRNNo']); // to ensure it cant be done again!! echo '<a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Select another GRN to Reverse') . '</a>'; /*end of Process Goods Received Reversal entry */ @@ -367,7 +367,7 @@ $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); if (DB_num_rows($result) ==0){ - prnMsg(_('There are no outstanding goods received yet to be invoiced for') . ' ' . $_POST['SuppName'] . '.<br>' . _('To reverse a GRN that has been invoiced first it must be credited'),'warn'); + prnMsg(_('There are no outstanding goods received yet to be invoiced for') . ' ' . $_POST['SuppName'] . '.<br />' . _('To reverse a GRN that has been invoiced first it must be credited'),'warn'); } else { //there are GRNs to show echo '<br /><table cellpadding=2 colspan=7 class=selection>'; @@ -375,10 +375,10 @@ <th>' . _('GRN') . ' #</th> <th>' . _('Item Code') . '</th> <th>' . _('Description') . '</th> - <th>' . _('Date') . '<br>' . _('Received') . '</th> - <th>' . _('Quantity') . '<br>' . _('Received') . '</th> - <th>' . _('Quantity') . '<br>' . _('Invoiced') . '</th> - <th>' . _('Quantity To') . '<br>' . _('Reverse') . '</th> + <th>' . _('Date') . '<br />' . _('Received') . '</th> + <th>' . _('Quantity') . '<br />' . _('Received') . '</th> + <th>' . _('Quantity') . '<br />' . _('Invoiced') . '</th> + <th>' . _('Quantity To') . '<br />' . _('Reverse') . '</th> </tr>'; echo $TableHeader; Modified: trunk/WWW_Access.php =================================================================== --- trunk/WWW_Access.php 2011-04-07 10:23:55 UTC (rev 4541) +++ trunk/WWW_Access.php 2011-04-08 23:37:01 UTC (rev 4542) @@ -2,8 +2,6 @@ /* $Id$*/ -//$PageSecurity=15; - include('includes/session.inc'); $title = _('Access Permission Maintenance'); @@ -41,7 +39,7 @@ $ErrMsg = _('The update of the security role description failed because'); $ResMsg = _('The Security role description was updated.'); } else { // Add Security Heading - $sql = "INSERT INTO securityroles (secrolename) VALUES ('".$_POST['SecRoleName']."')"; + $sql = "INSERT INTO securityroles (secrolename) valueS ('".$_POST['SecRoleName']."')"; $ErrMsg = _('The update of the security role failed because'); $ResMsg = _('The Security role was created.'); } @@ -52,7 +50,7 @@ if( isset($_GET['add']) ) { // updating Security Groups add a page token $sql = "INSERT INTO securitygroups ( secroleid, tokenid - ) VALUES ( + ) valueS ( '".$SelectedRole."', '".$PageTokenId."' )"; @@ -70,7 +68,7 @@ unset($_GET['PageToken']); } // Need to exec the query - if (isset($sql) && $InputError != 1 ) { + if (isset($sql) AND $InputError != 1 ) { $result = DB_query($sql,$db,$ErrMsg); if( $result ) { prnMsg( $ResMsg,'success'); @@ -84,7 +82,7 @@ $myrow = DB_fetch_row($result); if ($myrow[0]>0) { prnMsg( _('Cannot delete this role because user accounts are setup using it'),'warn'); - echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('user accounts that have this security role setting') . '</font>'; + echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('user accounts that have this security role setting') . '</font>'; } else { $sql="DELETE FROM securitygroups WHERE secroleid='" . $_GET['SelectedRole'] . "'"; $result = DB_query($sql,$db); @@ -108,7 +106,7 @@ $result = DB_query($sql,$db); echo '<table class=selection>'; - echo "<tr><th>" . _('Role') . "</th></tr>"; + echo '<tr><th>' . _('Role') . '</th></tr>'; $k=0; //row colour counter @@ -128,9 +126,9 @@ <td><a href=\"%s&SelectedRole=%s&delete=1&SecRoleName=%s\">" . _('Delete') . "</a></td> </tr>", $myrow['secrolename'], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $myrow['secroleid'], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $myrow['secroleid'], urlencode($myrow['secrolename'])); @@ -140,7 +138,7 @@ if (isset($SelectedRole)) { - echo "<br /><div class='centre'><a href='" . $_SERVER['PHP_SELF'] ."?" . SID . "'>" . _('Review Existing Roles') . '</a></div>'; + echo '<br /><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Review Existing Roles') . '</a></div>'; } if (isset($SelectedRole)) { @@ -159,24 +157,24 @@ $_POST['SecRoleName'] = $myrow['secrolename']; } } -echo '<br>'; -echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . "?" . SID . ">"; +echo '<br />'; +echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if( isset($_POST['SelectedRole'])) { - echo "<input type=hidden name='SelectedRole' VALUE='" . $_POST['SelectedRole'] . "'>"; + echo '<input type="hidden" name="SelectedRole" value="' . $_POST['SelectedRole'] . '">'; } -echo '<table class=selection>'; +echo '<table class="selection">'; if (!isset($_POST['SecRoleName'])) { $_POST['SecRoleName']=''; } echo '<tr><td>' . _('Role') . ":</td> - <td><input type='text' name='SecRoleName' size=40 maxlength=40 VALUE='" . $_POST['SecRoleName'] . "'></tr>"; + <td><input type='text' name='SecRoleName' size=40 maxlength=40 value='" . $_POST['SecRoleName'] . "'></tr>"; echo "</table><br /> <div class='centre'><input type='Submit' name='submit' value='" . _('Enter Role') . "'></div></form>"; if (isset($SelectedRole)) { - $sql = 'SELECT tokenid, tokenname - FROM securitytokens'; + $sql = "SELECT tokenid, tokenname + FROM securitytokens"; $sqlUsed = "SELECT tokenid FROM securitygroups WHERE secroleid='". $SelectedRole . "'"; @@ -194,8 +192,8 @@ echo '<br /><table class=selection><tr>'; if (DB_num_rows($Result)>0 ) { - echo "<th colspan=3><div class='centre'>"._('Assigned Security Tokens')."</div></th>"; - echo "<th colspan=3><div class='centre'>"._('Available Security Tokens')."</div></th>"; + echo '<th colspan="3"><div class="centre">'._('Assigned Security Tokens').'</div></th>'; + echo '<th colspan=3><div class="centre">'._('Available Security Tokens').'</div></th>'; } echo '</tr>'; @@ -215,7 +213,7 @@ <td><a href=\"%s&SelectedRole=%s&remove=1&PageToken=%s\">" . _('Remove') . "</a></td><td> </td><td> </td><td> </td>", $AvailRow['tokenid'], $AvailRow['tokenname'], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $SelectedRole, $AvailRow['tokenid'] ); @@ -228,7 +226,7 @@ <td><a href=\"%s&SelectedRole=%s&add=1&PageToken=%s\">" . _('Add') . "</a></td>", $AvailRow['tokenid'], $AvailRow['tokenname'], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $SelectedRole, $AvailRow['tokenid'] ); Modified: trunk/WWW_Users.php =================================================================== --- trunk/WWW_Users.php 2011-04-07 10:23:55 UTC (rev 4541) +++ trunk/WWW_Users.php 2011-04-08 23:37:01 UTC (rev 4542) @@ -2,8 +2,6 @@ /* $Id$*/ -//$PageSecurity=15; - if (isset($_POST['UserID']) AND isset($_POST['ID'])){ if ($_POST['UserID'] == $_POST['ID']) { $_POST['Language'] = $_POST['UserLanguage']; @@ -33,9 +31,9 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/group_add.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; // Make an array of the security roles -$sql = 'SELECT secroleid, +$sql = "SELECT secroleid, secrolename - FROM securityroles ORDER BY secroleid'; + FROM securityroles ORDER BY secroleid"; $Sec_Result = DB_query($sql, $db); $SecurityRoles = array(); // Now load it into an a ray using Key/Value pairs @@ -106,7 +104,7 @@ $i=0; $ModulesAllowed = ''; while ($i < count($ModuleList)){ - $FormVbl = "Module_" . $i; + $FormVbl = 'Module_' . $i; $ModulesAllowed .= $_POST[($FormVbl)] . ','; $i++; } @@ -219,7 +217,7 @@ prnMsg(_('The demonstration user called demo cannot be deleted'),'error'); } else { */ - $sql='SELECT userid FROM audittrail where userid="'. $SelectedUser .'"'; + $sql="SELECT userid FROM audittrail where userid='" . $SelectedUser ."'"; $result=DB_query($sql, $db); if (DB_num_rows($result)!=0) { prnMsg(_('Cannot delete user as entries already exist in the audit trail'), 'warn'); @@ -239,7 +237,7 @@ /* If its the first time the page has been displayed with no parameters then none of the above are true and the list of Users will be displayed with links to delete or edit each. These will call the same page again and allow update/input or deletion of the records*/ - $sql = 'SELECT + $sql = "SELECT userid, realname, phone, @@ -253,24 +251,24 @@ pagesize, theme, language - FROM www_users'; + FROM www_users"; $result = DB_query($sql,$db); echo '<table class=selection>'; - echo "<tr><th>" . _('User Login') . "</th> - <th>" . _('Full Name') . "</th> - <th>" . _('Telephone') . "</th> - <th>" . _('Email') . "</th> - <th>" . _('Customer Code') . "</th> - <th>" . _('Branch Code') . "</th> - <th>" . _('Supplier Code') . "</th> - <th>" . _('Salesperson') . "</th> - <th>" . _('Last Visit') . "</th> - <th>" . _('Security Role') ."</th> - <th>" . _('Report Size') ."</th> - <th>" . _('Theme') ."</th> - <th>" . _('Language') ."</th> - </tr>"; + echo '<tr><th>' . _('User Login') . '</th> + <th>' . _('Full Name') . '</th> + <th>' . _('Telephone') . '</th> + <th>' . _('Email') . '</th> + <th>' . _('Customer Code') . '</th> + <th>' . _('Branch Code') . '</th> + <th>' . _('Supplier Code') . '</th> + <th>' . _('Salesperson') . '</th> + <th>' . _('Last Visit') . '</th> + <th>' . _('Security Role') .'</th> + <th>' . _('Report Size') .'</th> + <th>' . _('Theme') .'</th> + <th>' . _('Language') .'</th> + </tr>'; $k=0; //row colour counter @@ -320,21 +318,21 @@ $myrow[10], $myrow[11], $myrow[12], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $myrow[0], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $myrow[0]); } //END WHILE LIST LOOP - echo '</table><br>'; + echo '</table><br />'; } //end of ifs and buts! if (isset($SelectedUser)) { - echo "<div class='centre'><a href='" . $_SERVER['PHP_SELF'] ."?" . SID . "'>" . _('Review Existing Users') . '</a></div><br>'; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Review Existing Users') . '</a></div><br />'; } -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($SelectedUser)) { @@ -380,16 +378,19 @@ $_POST['Blocked'] = $myrow['blocked']; $_POST['PDFLanguage'] = $myrow['pdflanguage']; - echo "<input type='hidden' name='SelectedUser' value='" . $SelectedUser . "'>"; - echo "<input type='hidden' name='UserID' value='" . $_POST['UserID'] . "'>"; - echo "<input type='hidden' name='ModulesAllowed' value='" . $_POST['ModulesAllowed'] . "'>"; + echo '<input type="hidden" name="SelectedUser" value="' . $SelectedUser . '">'; + echo '<input type="hidden" name="UserID" value="' . $_POST['UserID'] . '">'; + echo '<input type="hidden" name="ModulesAllowed" value="' . $_POST['ModulesAllowed'] . '">'; echo '<table class=selection> <tr><td>' . _('User code') . ':</td><td>'; echo $_POST['UserID'] . '</td></tr>'; } else { //end of if $SelectedUser only do the else when a new record is being entered - echo '<table class=selection><tr><td>' . _('User Login') . ":</td><td><input type='text' name='UserID' size=22 maxlength=20 ></td></tr>"; + echo '<table class=selection> + <tr> + <td>' . _('User Login') . ':</td> + <td><input type="text" name="UserID" size="22" maxlength="20"></td></tr>'; /*set the default modules to show to all this had trapped a few people previously*/ @@ -418,21 +419,21 @@ if (!isset($_POST['Email'])) { $_POST['Email']=''; } -echo '<tr><td>' . _('Password') . ":</td> - <td><input type='password' name='Password' size=22 maxlength=20 value='" . $_POST['Password'] . "'></tr>"; -echo '<tr><td>' . _('Full Name') . ":</td> - <td><input type='text' name='RealName' value='" . $_POST['RealName'] . "' size=36 maxlength=35></td></tr>"; -echo '<tr><td>' . _('Telephone No') . ":</td> - <td><input type='text' name='Phone' value='" . $_POST['Phone'] . "' size=32 maxlength=30></td></tr>"; -echo '<tr><td>' . _('Email Address') .":</td> - <td><input type='text' name='Email' value='" . $_POST['Email'] ."' size=32 maxlength=55></td></tr>"; -echo '<tr><td>' . _('Security Role') . ":</td><td><select name='Access'>"; +echo '<tr><td>' . _('Password') . ':</td> + <td><input type="password" name="Password" size="22" maxlength="20" value="' . $_POST['Password'] . '"></tr>'; +echo '<tr><td>' . _('Full Name') . ':</td> + <td><input type="text" name="RealName" value="' . $_POST['RealName'] . '" size="36" maxlength="35"></td></tr>'; +echo '<tr><td>' . _('Telephone No') . ':</td> + <td><input type="text" name="Phone" value="' . $_POST['Phone'] . '" size="32" maxlength="30"></td></tr>'; +echo '<tr><td>' . _('Email Address') .':</td> + <td><input type="text" name="Email" value="' . $_POST['Email'] .'" size="32" maxlength="55"></td></tr>'; +echo '<tr><td>' . _('Security Role') . ':</td><td><select name="Access">'; foreach ($SecurityRoles as $SecKey => $SecVal) { if (isset($_POST['Access']) and $SecKey == $_POST['Access']){ - echo "<option selected value=" . $SecKey . ">" . $SecVal; + echo '<option selected value="' . $SecKey . '">' . $SecVal .'</option>'; } else { - echo "<option value=" . $SecKey . ">" . $SecVal; + echo '<option value="' . $SecKey . '">' . $SecVal .'</option>'; } } echo '</select></td></tr>'; @@ -441,17 +442,17 @@ echo '<tr><td>' . _('Default Location') . ':</td> <td><select name="DefaultLocation">'; -$sql = 'SELECT loccode, locationname FROM locations'; +$sql = "SELECT loccode, locationname FROM locations"; $result = DB_query($sql,$db); while ($myrow=DB_fetch_array($result)){ if (isset($_POST['DefaultLocation']) and $myrow['loccode'] == $_POST['DefaultLocation']){ - echo "<option selected value='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] .'</option>'; } else { - echo "<option Value='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] .'</option>'; } @@ -479,7 +480,7 @@ echo '<tr><td>' . _('Restrict to Sales Person') . ':</td> <td><select name="Salesman">'; -$sql = 'SELECT salesmancode, salesmanname FROM salesman'; +$sql = "SELECT salesmancode, salesmanname FROM salesman"; $result = DB_query($sql,$db); if ((isset($_POST['Salesman']) and $_POST['Salesman']=='') OR !isset($_POST['Salesman'])){ echo '<option selected value="">' . _('Not a salesperson only login') . '</option>'; @@ -499,69 +500,69 @@ echo '</select></td></tr>'; -echo '<tr><td>' . _('Reports Page Size') .":</td> - <td><select name='PageSize'>"; +echo '<tr><td>' . _('Reports Page Size') .':</td> + <td><select name="PageSize">'; if(isset($_POST['PageSize']) and $_POST['PageSize']=='A4'){ - echo "<option selected value='A4'>" . _('A4'); + echo '<option selected value="A4">' . _('A4') .'</option>'; } else { - echo "<option value='A4'>A4"; + echo '<option value="A4">' . _('A4') . '</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='A3'){ - echo "<option selected Value='A3'>" . _('A3'); + echo '<option selected value="A3">' . _('A3') .'</option>'; } else { - echo "<option value='A3'>A3"; + echo '<option value="A3">' . _('A3') .'</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='A3_landscape'){ - echo "<option selected Value='A3_landscape'>" . _('A3') . ' ' . _('landscape'); + echo '<option selected value="A3_landscape">' . _('A3') . ' ' . _('landscape') .'</option>'; } else { - echo "<option value='A3_landscape'>" . _('A3') . ' ' . _('landscape'); + echo '<option value="A3_landscape">' . _('A3') . ' ' . _('landscape') .'</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='letter'){ - echo "<option selected Value='letter'>" . _('Letter'); + echo '<option selected value="letter">' . _('Letter') .'</option>'; } else { - echo "<option value='letter'>" . _('Letter'); + echo '<option value="letter">' . _('Letter') .'</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='letter_landscape'){ - echo "<option selected Value='letter_landscape'>" . _('Letter') . ' ' . _('landscape'); + echo '<option selected value="letter_landscape">' . _('Letter') . ' ' . _('landscape') .'</option>'; } else { - echo "<option value='letter_landscape'>" . _('Letter') . ' ' . _('landscape'); + echo '<option value="letter_landscape">' . _('Letter') . ' ' . _('landscape') .'</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='legal'){ - echo "<option selected value='legal'>" . _('Legal'); + echo '<option selected value="legal">' . _('Legal') .'</option>'; } else { - echo "<option Value='legal'>" . _('Legal'); + echo '<option value="legal">' . _('Legal') .'</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='legal_landscape'){ - echo "<option selected value='legal_landscape'>" . _('Legal') . ' ' . _('landscape'); + echo '<option selected value="legal_landscape">' . _('Legal') . ' ' . _('landscape') .'</option>'; } else { - echo "<option value='legal_landscape'>" . _('Legal') . ' ' . _('landscape'); + echo '<option value="legal_landscape">' . _('Legal') . ' ' . _('landscape') .'</option>'; } echo '</select></td></tr>'; echo '<tr> - <td>' . _('Theme') . ":</td> - <td><select name='Theme'>"; + <td>' . _('Theme') . ':</td> + <td><select name="Theme">'; $ThemeDirectory = dir('css/'); while (false != ($ThemeName = $ThemeDirectory->read())){ - if (is_dir("css/$ThemeName") AND $ThemeName != '.' AND $ThemeName != '..' AND $ThemeName != '.svn'){ + if (is_dir('css/' . $ThemeName) AND $ThemeName != '.' AND $ThemeName != '..' AND $ThemeName != '.svn'){ if (isset($_POST['Theme']) and $_POST['Theme'] == $ThemeName){ - echo "<option selected value='$ThemeName'>$ThemeName"; + echo '<option selected value="' . $ThemeName . '">' . $ThemeName .'</option>'; } else if (!isset($_POST['Theme']) and ($_SESSION['DefaultTheme']==$ThemeName)) { - echo "<option selected value='$ThemeName'>$ThemeName"; + echo '<option selected value="' . $ThemeName . '">' . $ThemeName .'</option>'; } else { - echo "<option value='$ThemeName'>$ThemeName"; + echo '<option value="' . $ThemeName . '">' . $ThemeName .'</option>'; } } } @@ -570,8 +571,8 @@ echo '<tr> - <td>' . _('Language') . ":</td> - <td><select name='UserLanguage'>"; + <td>' . _('Language') . ':</td> + <td><select name="UserLanguage">'; $LangDirHandle = dir('locale/'); @@ -581,11 +582,11 @@ if (is_dir('locale/' . $LanguageEntry) AND $LanguageEntry != '..' AND $LanguageEntry != 'CVS' AND $LanguageEntry!='.'){ if (isset($_POST['UserLanguage']) and $_POST['UserLanguage'] == $LanguageEntry){ - echo "<option selected value='$LanguageEntry'>$LanguageEntry"; + echo '<option selected value="' . $LanguageEntry . '">' . $LanguageEntry .'</option>'; } elseif (!isset($_POST['UserLanguage']) and $LanguageEntry == $DefaultLanguage) { - echo "<option selected value='$LanguageEntry'>$LanguageEntry"; + echo '<option selected value="' . $LanguageEntry . '">' . $LanguageEntry .'</option>'; } else { - echo "<option value='$LanguageEntry'>$LanguageEntry"; + echo '<option value="' . $LanguageEntry . '">' . $LanguageEntry .'</option>'; } } } @@ -599,7 +600,7 @@ $i=0; foreach($ModuleList as $ModuleName){ - echo '<tr><td>' . _('Display') . ' ' . $ModuleName . ' ' . _('options') . ": </td><td><select name='Module_" . $i . "'>"; + echo '<tr><td>' . _('Display') . ' ' . $ModuleName . ' ' . _('options') . ': </td><td><select name="Module_' . $i . '">'; if ($ModulesAllowed[$i]==0){ echo '<option selected value=0>' . _('No') . '</option>'; echo '<option value=1>' . _('Yes') . '</option>'; @@ -624,7 +625,7 @@ } echo '</select></td></tr>'; -echo '<tr><td>' . _('Account Status') . ":</td><td><select name='Blocked'>"; +echo '<tr><td>' . _('Account Status') . ':</td><td><select name="Blocked">'; if ($_POST['Blocked']==0){ echo '<option selected value=0>' . _('Open'); echo '<option value=1>' . _('Blocked'); @@ -634,7 +635,7 @@ } echo '</select></td></tr>'; -echo '</table><br> +echo '</table><br /> <div class="centre"><input type="submit" name="submit" value="' . _('Enter Information') . '"></div> </form>'; Modified: trunk/WorkCentres.php =================================================================== --- trunk/WorkCentres.php 2011-04-07 10:23:55 UTC (rev 4541) +++ trunk/WorkCentres.php 2011-04-08 23:37:01 UTC (rev 4542) @@ -1,7 +1,6 @@ <?php /* $Id$*/ -//$PageSecurity=9; include('includes/session.inc'); $title = _('Work Centres'); @@ -31,7 +30,7 @@ $InputError = 1; prnMsg(_('The Work Centre description must be at least 3 characters long'),'error'); } - if (strstr($_POST['Code'],' ') OR strstr($_POST['Code'],"'") OR strstr($_POST['Code'],'+') OR strstr($_POST['Code'],"\\") OR strstr($_POST['Code'],"\"") OR strstr($_POST['Code'],'&') OR strstr($_POST['Code'],'.') OR strstr($_POST['Code'],'"')) { + if (strstr($_POST['Code'],' ') OR ContainsIllegalCharacters($_POST['Code']) ) { $InputError = 1; prnMsg(_('The work centre code cannot contain any of the following characters') . " - ' & + \" \\ " . _('or a space'),'error'); } @@ -110,23 +109,23 @@ or deletion of the records*/ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . '</p>'; - $sql = 'SELECT workcentres.code, - workcentres.description, - locations.locationname, - workcentres.overheadrecoveryact, - workcentres.overheadperhour - FROM workcentres, - locations - WHERE workcentres.location = locations.loccode'; + $sql = "SELECT workcentres.code, + workcentres.description, + locations.locationname, + workcentres.overheadrecoveryact, + workcentres.overheadperhour + FROM workcentres, + locations + WHERE workcentres.location = locations.loccode"; $result = DB_query($sql,$db); - echo "<table class=selection> - <tr bgcolor =#800000><th>" . _('WC Code') . "</th> - <th>" . _('Description') . "</th> - <th>" . _('Location') . "</th> - <th>" . _('Overhead GL Account') . "</th> - <th>" . _('Overhead Per Hour') . "</th> - </tr></font>"; + echo '<table class="selection"> + <tr bgcolor ="#800000"><th>' . _('WC Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Location') . '</th> + <th>' . _('Overhead GL Account') . '</th> + <th>' . _('Overhead Per Hour') . '</th> + </tr>'; while ($myrow = DB_fetch_row($result)) { @@ -143,8 +142,8 @@ $myrow[2], $myrow[3], $myrow[4], - $_SERVER['PHP_SELF'] . '?' . SID, - $myrow[0], $_SERVER['PHP_SELF'] . '?' . SID, + $_SERVER['PHP_SELF'] . '?', + $myrow[0], $_SERVER['PHP_SELF'] . '?', $myrow[0]); } @@ -156,10 +155,10 @@ if (isset($SelectedWC)) { echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . '</p>'; - echo "<div class='centre'><a href='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>" . _('Show all Work Centres') . '</a></div>'; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Show all Work Centres') . '</a></div>'; } -echo "<p><form method='post' action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>"; +echo '<p><form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedWC)) { @@ -182,41 +181,42 @@ $_POST['OverheadRecoveryAct'] = $myrow['overheadrecoveryact']; $_POST['OverheadPerHour'] = $myrow['overheadperhour']; - echo '<input type=hidden name="SelectedWC" value=' . $SelectedWC . '>'; - echo '<input type=hidden name="Code" value="' . $_POST['Code'] . '">'; - echo '<table class=selection><tr><td>' ._('Work Centre Code') . ':</td><td>' . $_POST['Code'] . '</td></tr>'; + echo '<input type="hidden" name="SelectedWC" value=' . $SelectedWC . '>'; + echo '<input type="hidden" name="Code" value="' . $_POST['Code'] . '">'; + echo '<table class="selection"><tr><td>' ._('Work Centre Code') . ':</td> + <td>' . $_POST['Code'] . '</td></tr>'; } else { //end of if $SelectedWC only do the else when a new record is being entered if (!isset($_POST['Code'])) { $_POST['Code'] = ''; } - echo '<table class=selection><tr> - <td>' . _('Work Centre Code') . ":</td> - <td><input type='Text' name='Code' size=6 maxlength=5 value='" . $_POST['Code'] . "'></td> - </tr>"; + echo '<table class="selection"><tr> + <td>' . _('Work Centre Code') . ':</td> + <td><input type="Text" name="Code" size="6" maxlength="5" value="' . $_POST['Code'] . '"></td> + </tr>'; } -$SQL = 'SELECT locationname, +$SQL = "SELECT locationname, loccode - FROM locations'; + FROM locations"; $result = DB_query($SQL,$db); if (!isset($_POST['Description'])) { $_POST['Description'] = ''; } -echo '<tr><td>' . _('Work Centre Description') . ":</td> - <td><input type='Text' name='Description' size=21 maxlength=20 value='" . $_POST['Description'] . "'></td> +echo '<tr><td>' . _('Work Centre Description') . ':</td> + <td><input type="Text" name="Description" size="21" maxlength="20" value="' . $_POST['Description'] . '"></td> </tr> - <tr><td>" . _('Location') . ":</td> - <td><select name='Location'>"; + <tr><td>' . _('Location') . ':</td> + <td><select name="Location">'; while ($myrow = DB_fetch_array($result)) { if (isset($_POST['Location']) and $myrow['loccode']==$_POST['Location']) { - echo "<option selected VALUE='"; + echo '<option selected value="'; } else { - echo "<option VALUE='"; + echo '<option VALUE="'; } - echo $myrow['loccode'] . "'>" . $myrow['locationname']; + echo $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } //end while loop @@ -224,26 +224,26 @@ echo '</select></td></tr> - <tr><td>' . _('Overhead Recovery GL Account') . ":</td> - <td><select name='OverheadRecoveryAct'>"; + <tr><td>' . _('Overhead Recovery GL Account') . ':</td> + <td><select name="OverheadRecoveryAct">'; //SQL to poulate account selection boxes -$SQL = 'SELECT accountcode, - accountname - FROM chartmaster INNER JOIN accountgroups - ON chartmaster.group_=accountgroups.groupname - WHERE accountgroups.pandl!=0 - ORDER BY accountcode'; +$SQL = "SELECT accountcode, + accountname + FROM chartmaster INNER JOIN accountgroups + ON chartmaster.group_=accountgroups.groupname + WHERE accountgroups.pandl!=0 + ORDER BY accountcode"; $result = DB_query($SQL,$db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['OverheadRecoveryAct']) and $myrow['accountcode']==$_POST['OverheadRecoveryAct']) { - echo '<option selected VALUE='; + echo '<option selected value='; } else { - echo '<option VALUE='; + echo '<option value='; } - echo $myrow['accountcode'] . '>' . $myrow['accountname']; + echo $myrow['accountcode'] . '>' . $myrow['accountname'] . '</option>'; } //end while loop DB_free_result($result); Modified: trunk/WorkOrderEntry.php =================================================================== --- trunk/WorkOrderEntry.php 2011-04-07 10:23:55 UTC (rev 4541) +++ trunk/WorkOrderEntry.php 2011-04-08 23:37:01 UTC (rev 4542) @@ -207,10 +207,10 @@ if ($InputError==false){ $CostResult = DB_query("SELECT SUM((materialcost+labourcost+overheadcost)*bom.quantity) AS cost - FROM stockmaster INNER JOIN bom - ON stockmaster.stockid=bom.component - WHERE bom.parent='" . $NewItem . "' - AND bom.loccode='" . $_POST['StockLocation'] . "'", + FROM stockmaster INNER JOIN bom + ON stockmaster.stockid=bom.component + WHERE bom.parent='" . $NewItem . "' + AND bom.loccode='" . $_POST['StockLocation'] . "'", $db); $CostRow = DB_fetch_row($CostResult); if (is_null($CostRow[0]) OR $CostRow[0]==0){ @@ -299,10 +299,10 @@ if ($_POST['RecdQty'.$i]==0 AND (!isset($_POST['HasWOSerialNos'.$i]) or $_POST['HasWOSerialNos'.$i]==false)){ /* can only change location cost if QtyRecd=0 */ $CostResult = DB_query("SELECT SUM((materialcost+labourcost+overheadcost)*bom.quantity) AS cost - FROM stockmaster INNER JOIN bom - ON stockmaster.stockid=bom.component - WHERE bom.parent='" . $_POST['OutputItem'.$i] . "' - AND bom.loccode='" . $_POST['StockLocation'] . "'", + FROM stockmaster INNER JOIN bom + ON stockmaster.stockid=bom.component + WHERE bom.parent='" . $_POST['OutputItem'.$i] . "' + AND bom.loccode='" . $_POST['StockLocation'] . "'", $db); $CostRow = DB_fetch_row($CostResult); if (is_null($CostRow[0])){ @@ -350,7 +350,7 @@ // can't delete it there are open work issues $HasTransResult = DB_query("SELECT * FROM stockmoves WHERE (stockmoves.type= 26 OR stockmoves.type=28) - AND reference LIKE '%" . $_POST['WO'] . "%'",$db); + AND reference " . LIKE . " '%" . $_POST['WO'] . "%'",$db); if (DB_num_rows($HasTransResult)>0){ prnMsg(_('This work order cannot be deleted because it has issues or receipts related to it'),'error'); $CancelDelete=true; @@ -377,7 +377,7 @@ prnMsg(_('The work order has been deleted'),'success'); - echo "<p><a href='" . $rootpath . "/SelectWorkOrder.php?" . SID . "'>" . _('Select an existing outstanding work order') . "</a>"; + echo '<p><a href="' . $rootpath . '/SelectWorkOrder.php">' . _('Select an existing outstanding work order') . '</a>'; unset($_POST['WO']); for ($i=1;$i<=$_POST['NumberOfOutputs'];$i++){ unset($_POST['OutputItem'.$i]); @@ -394,7 +394,7 @@ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '" name="form">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<br><table class=selection>'; +echo '<br /><table class="selection">'; $sql="SELECT workorders.loccode, requiredby, @@ -441,7 +441,7 @@ } $_POST['Controlled'.$i] =$WOItem['controlled']; $_POST['Serialised'.$i] =$WOItem['serialised']; - $HasWOSerialNosResult = DB_query('SELECT * FROM woserialnos WHERE wo=' . $_POST['WO'],$db); + $HasWOSerialNosResult = DB_query("SELECT * FROM woserialnos WHERE wo='" . $_POST['WO'] . "'",$db); if (DB_num_rows($HasWOSerialNosResult)>0){ $_POST['HasWOSerialNos']=true; } else { @@ -455,7 +455,7 @@ echo '<tr><td class="label">' . _('Work Order Reference') . ':</td><td>' . $_POST['WO'] . '</td></tr>'; echo '<tr><td class="label">' . _('Factory Location') .':</td> <td><select name="StockLocation">'; -$LocResult = DB_query('SELECT loccode,locationname FROM locations',$db); +$LocResult = DB_query("SELECT loccode,locationname FROM locations",$db); while ($LocRow = DB_fetch_array($LocResult)){ if ($_POST['StockLocation']==$LocRow['loccode']){ echo '<option selected value="' . $LocRow['loccode'] .'">' . $LocRow['locationname'] . '</option>'; @@ -521,7 +521,7 @@ } else { $LotOrSN = _('Batches'); } - echo '<td><a href="' . $rootpath . '/WOSerialNos.php?' . SID . '&WO=' . $_POST['WO'] . '&StockID=' . $_POST['OutputItem' .$i] . '&Description=' . $_POST['OutputItemDesc' .$i] . '&Serialised=' . $_POST['Serialised' .$i] . '&NextSerialNo=' . $_POST['NextLotSNRef' .$i] . '">' . $LotOrSN . '</a></td>'; + echo '<td><a href="' . $rootpath . '/WOSerialNos.php?WO=' . $_POST['WO'] . '&StockID=' . $_POST['OutputItem' .$i] . '&Description=' . $_POST['OutputItemDesc' .$i] . '&Serialised=' . $_POST['Serialised' .$i] . '&NextSerialNo=' . $_POST['NextLotSNRef' .$i] . '">' . $LotOrSN . '</a></td>'; } } echo '<td>'; @@ -558,31 +558,31 @@ echo '<table class=selection><tr><td>' . _('Select a stock category') . ':<select name="StockCat">'; if (!isset($_POST['StockCat'])){ - echo '<option selected VALUE="All">' . _('All'); + echo '<option selected VALUE="All">' . _('All') . '</option>'; $_POST['StockCat'] ='All'; } else { - echo '<option VALUE="All">' . _('All'); + echo '<option VALUE="All">' . _('All') . '</option>'; } while ($myrow1 = DB_fetch_array($result1)) { if ($_POST['StockCat']==$myrow1['categoryid']){ - echo '<option selected VALUE=' . $myrow1['categoryid'] . '>' . $myrow1['categorydescription']; + echo '<option selected value=' . $myrow1['categoryid'] . '>' . $myrow1['categorydescription'] . '</option>'; } else { - echo '<option VALUE='. $myrow1['categoryid'] . '>' . $myrow1['categorydescription']; + echo '<option value='. $myrow1['categoryid'] . '>' . $myrow1['categorydescription'] . '</option>'; } } ?> </select> <td><?php echo _('Enter text extracts in the'); ?> <b><?php echo _('description'); ?></b>:</td> -<td><input type="Text" name="Keywords" size=20 maxlength=25 VALUE="<?php if (isset($_POST['Keywords'])) echo $_POST['Keywords']; ?>"></td></tr> +<td><input type="Text" name="Keywords" size=20 maxlength=25 value="<?php if (isset($_POST['Keywords'])) echo $_POST['Keywords']; ?>"></td></tr> <tr><td></td> <td><font SIZE 3><b><?php echo _('OR'); ?> </b></font><?php echo _('Enter extract of the'); ?> <b><?php echo _('Stock Code'); ?></b>:</td> - <td><input type="Text" name="StockCode" size=15 maxlength=18 VALUE="<?php if (isset($_POST['StockCode'])) echo $_POST['StockCode']; ?>"></td> + <td><input type="Text" name="StockCode" size=15 maxlength=18 value="<?php if (isset($_POST['StockCode'])) echo $_POST['StockCode']; ?>"></td> </tr> </table> - <br /><div class="centre"><input type=submit name="Search" VALUE="<?php echo _('Search Now'); ?>"> + <br /><div class="centre"><input type=submit name="Search" value="<?php echo _('Search Now'); ?>"> <?php @@ -636,7 +636,7 @@ $myrow['description'], $myrow['units'], $ImageSource, - $_SERVER['PHP_SELF'] . '?' . SID . 'WO=' . $_POST['WO'] . '&NewItem=' . $myrow['stockid'].'&Line='.$i); + $_SERVER['PHP_SELF'] . '?WO=' . $_POST['WO'] . '&NewItem=' . $myrow['stockid'].'&Line='.$i); $j++; If ($j == 25){ Modified: trunk/WorkOrderIssue.php =================================================================== --- trunk/WorkOrderIssue.php 2011-04-07 10:23:55 UTC (rev 4541) +++ trunk/WorkOrderIssue.php 2011-04-08 23:37:01 UTC (rev 4542) @@ -1,8 +1,6 @@ <?php /* $Id$*/ -//$PageSecurity = 11; - include('includes/session.inc'); $title = _('Issue Materials To Work Order'); include('includes/header.inc'); @@ -15,19 +13,19 @@ $_POST['StockID']=$_GET['StockID']; } -echo '<a href="'. $rootpath . '/SelectWorkOrder.php?' . SID . '">' . _('Back to Work Orders'). '</a><br>'; -echo '<a href="'. $rootpath . '/WorkOrderCosting.php?' . SID . '&WO=' . $_POST['WO'] . '">' . _('Back to Costing'). '</a><br>'; +echo '<a href="'. $rootpath . '/SelectWorkOrder.php">' . _('Back to Work Orders'). '</a><br />'; +echo '<a href="'. $rootpath . '/WorkOrderCosting.php?WO=' . $_POST['WO'] . '">' . _('Back to Costing'). '</a><br />'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/group_add.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p'; -echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (!isset($_POST['WO']) OR !isset($_POST['StockID'])) { /* This page can only be called with a work order number for issuing stock to*/ - echo '<div class="centre"><a href="' . $rootpath . '/SelectWorkOrder.php?' . SID . '">'. + echo '<div class="centre"><a href="' . $rootpath . '/SelectWorkOrder.php">'. _('Select a work order to issue materials to').'</a></div>'; prnMsg(_('This page can only be opened if a work order has been selected. Please select a work order to issue materials to first'),'info'); include ('includes/footer.inc'); @@ -344,16 +342,16 @@ $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' ._('Could not update the work order cost issued to the work order because'); $DbgMsg = _('The following SQL was used to update the work order'); $UpdateWOResult =DB_query("UPDATE workorders - SET costissued=costissued+" . ($QuantityIssued*$IssueItemRow['cost']) . " - WHERE wo='" . $_POST['WO'] . "'", - $db,$ErrMsg,$DbgMsg,true); + SET costissued=costissued+" . ($QuantityIssued*$IssueItemRow['cost']) . " + WHERE wo='" . $_POST['WO'] . "'", + $db,$ErrMsg,$DbgMsg,true); $Result = DB_Txn_Commit($db); prnMsg(_('The issue of') . ' ' . $QuantityIssued . ' ' . _('of') . ' ' . $_POST['IssueItem'] . ' ' . _('against work order') . ' '. $_POST['WO'] . ' ' . _('has been processed'),'info'); - echo '<p><ul><li><a href="' . $rootpath . '/WorkOrderIssue.php?' . SID . '&WO=' . $_POST['WO'] . '&StockID=' . $_POST['StockID'] . '">' . _('Issue more components to this work order') . '</a></li>'; - echo '<li><a href="' . $rootpath . '/SelectWorkOrder.php?' . SID . '">' . _('Select a different work order for issuing materials and components against'). '</a></li></ul>'; + echo '<p><ul><li><a href="' . $rootpath . '/WorkOrderIssue.php?WO=' . $_POST['WO'] . '&StockID=' . $_POST['StockID'] . '">' . _('Issue more components to this work order') . '</a></li>'; + echo '<li><a href="' . $rootpath . '/SelectWorkOrder.php">' . _('Select a different work order for issuing materials and components against'). '</a></li></ul>'; unset($_POST['WO']); unset($_POST['StockID']); unset($_POST['IssueItem']); @@ -474,7 +472,7 @@ prnMsg (_('There are no products available meeting the criteria specified'),'info'); if ($debug==1){ - prnMsg(_('The SQL statement used was') . ':<br>' . $SQL,'info'); + prnMsg(_('The SQL statement used was') . ':<br />' . $SQL,'info'); } } if (DB_num_rows($SearchResult)==1){ @@ -490,25 +488,25 @@ $ErrMsg = _('Could not retrieve the details of the selected work order item'); $WOResult = DB_query("SELECT workorders.loccode, - locations.locationname, - workorders.requiredby, - workorders.startdate, - workorders.closed, - stockmaster.description, - stockmaster.decimalplaces, - stockmaster.units, - woitems.qtyreqd, - woitems.qtyrecd - FROM workorders INNER JOIN locations - ON workorders.loccode=locations.loccode - INNER JOIN woitems - ON workorders.wo=woitems.wo - INNER JOIN stockmaster - ON woitems.stockid=stockmaster.stockid - WHERE woitems.stockid='" . $_POST['StockID'] . "' - AND woitems.wo ='" . $_POST['WO'] . "'", - $db, - $ErrMsg); + locations.locationname, + workorders.requiredby, + workorders.startdate, + workorders.closed, + stockmaster.description, + stockmaster.decimalplaces, + stockmaster.units, + woitems.qtyreqd, + woitems.qtyrecd + FROM workorders INNER JOIN locations + ON workorders.loccode=locations.loccode + INNER JOIN woitems + ON workorders.wo=woitems.wo + INNER JOIN stockmaster + ON woitems.stockid=stockmaster.stockid + WHERE woitems.stockid='" . $_POST['StockID'] . "' + AND woitems.wo ='" . $_POST['WO'] . "'", + $db, + $ErrMsg); if (DB_num_rows($WOResult)==0){ prnMsg(_('The selected work order item cannot be retrieved from the database'),'info'); @@ -527,30 +525,40 @@ $_POST['IssuedDate'] = Date($_SESSION['DefaultDateFormat']); } echo '<table cellpadding=2 class=selection> - <tr><td class="label">' . _('Issue to work order') . ':</td><td>' . $_POST['WO'] .'</td><td class="label">' . _('Item') . ':</td><td>' . $_POST['StockID'] . ' - ' . $WORow['description'] . '</td></tr> - <tr><td class="label">' . _('Manufactured at') . ':</td><td>' . $WORow['locationname'] . '</td><td class="label">' . _('Required By') . ':</td><td>' . ConvertSQLDate($WORow['requiredby']) . '</td></tr> - <tr><td class="label">' . _('Quantity Ordered') . ':</td><td class=number>' . number_format($WORow['qtyreqd'],$WORow['decimalplaces']) . '</td><td colspan=2>' . $WORow['units'] . '</td></tr> - <tr><td class="label">' . _('Already Received') . ':</td><td class=number>' . number_format($WORow['qtyrecd'],$WORow['decimalplaces']) . '</td><td colspan=2>' . $WORow['units'] . '</td></tr> + <tr><td class="label">' . _('Issue to work order') . ':</td> + <td>' . $_POST['WO'] .'</td><td class="label">' . _('Item') . ':</td> + <td>' . $_POST['StockID'] . ' - ' . $WORow['description'] . '</td> + </tr> + <tr><td class="label">' . _('Manufactured at') . ':</td> + <td>' . $WORow['locationname'] . '</td><td class="label">' . _('Required By') . ':</td> + <td>' . ConvertSQLDate($WORow['requiredby']) . '</td> + </tr> + <tr><td class="label">' . _('Quantity Ordered') . ':</td> + <td class="number">' . number_format($WORow['qtyreqd'],$WORow['decimalplaces']) . '</td> + <td colspan="2">' . $WORow['units'] . '</td> + </tr> + <tr><td class="label">' . _('Already Received') . ':</td> + <td class="number">' . number_format($WORow['qtyrecd'],$WORow['decimalplaces']) . '</td> + <td colspan="2">' . $WORow['units'] . '</td></tr> <tr><td colspan=4></td></tr> - <tr><td class="label">' . _('Date Material Issued') . ':</td><td><input type=text name=issuedate value=' - . Date($_SESSION['DefaultDateFormat']) . ' class=date size=10 alt="'.$_SESSION['DefaultDateFormat'].'" ></td> - <td class="label">' . _('Issued From') . ':</td><td>'; + <tr><td class="label">' . _('Date Material Issued') . ':</td> + <td><input type=text name=issuedate value=' . Date($_SESSION['DefaultDateFormat']) . ' class=date size=10 alt="'.$_SESSION['DefaultDateFormat'].'" ></td> + <td class="label">' . _('Issued From') . ':</td><td>'; if (!isset($_POST['IssueItem'])){ - $LocResult = DB_query('SELECT loccode, locationname FROM locations',$db); + $LocResult = DB_query("SELECT loccode, locationname FROM locations",$db); echo '<select name="FromLocation">'; - if (!isset($_POST['FromLocation'])){ $_POST['FromLocation']=$WORow['loccode']; } while ($LocRow = DB_fetch_array($LocResult)){ if ($_POST['FromLocation'] ==$LocRow['loccode']){ - echo '<option selected value="' . $LocRow['loccode'] .'">' . $LocRow['locationname']; + echo '<option selected value="' . $LocRow['loccode'] .'">' . $LocRow['locationname'] . '</option>'; } else { - echo '<option value="' . $LocRow['loccode'] .'">' . $LocRow['locationname']; + echo '<option value="' . $LocRow['loccode'] .'">' . $LocRow['locationname'] . '</option>'; } } echo '</select>'; @@ -576,27 +584,27 @@ <th>' . _('Qty Issued') . '</th></tr>'; $RequirmentsResult = DB_query("SELECT worequirements.stockid, - stockmaster.description, - stockmaster.decimalplaces, - autoissue, - qtypu - FROM worequirements INNER JOIN stockmaster - ON worequirements.stockid=stockmaster.stockid - WHERE wo='" . $_POST['WO'] . "'", - $db); + stockmaster.description, + stockmaster.decimalplaces, + autoissue, + qtypu + FROM worequirements INNER JOIN stockmaster + ON worequirements.stockid=stockmaster.stockid + WHERE wo='" . $_POST['WO'] . "'", + $db); while ($RequirementsRow = DB_fetch_array($RequirmentsResult)){ if ($RequirementsRow['autoissue']==0){ echo '<tr><td><input type="submit" name="IssueItem" value="' .$RequirementsRow['stockid'] . '"></td> - <td>' . $RequirementsRow['stockid'] . ' - ' . $RequirementsRow['description'] . '</td>'; + <td>' . $RequirementsRow['stockid'] . ' - ' . $RequirementsRow['description'] . '</td>'; } else { echo '<tr><td class="notavailable">' . _('Auto Issue') . '<td class="notavailable">' .$RequirementsRow['stockid'] . ' - ' . $RequirementsRow['description'] .'</td>'; } $IssuedAlreadyResult = DB_query("SELECT SUM(-qty) FROM stockmoves - WHERE stockmoves.type=28 - AND stockid='" . $RequirementsRow['stockid'] . "' - AND reference='" . $_POST['WO'] . "'", - $db); + WHERE stockmoves.type=28 + AND stockid='" . $RequirementsRow['stockid'] . "' + AND reference='" . $_POST['WO'] . "'", + $db); $IssuedAlreadyRow = DB_fetch_row($IssuedAlreadyResult); echo '<td class=number>' . number_format($WORow['qtyreqd']*$RequirementsRow['qtypu'],$RequirementsRow['decimalplaces']) . '</td> @@ -615,31 +623,31 @@ echo '<table class=selection><tr><td>' . _('Select a stock category') . ':<select name="StockCat">'; if (!isset($_POST['StockCat'])){ - echo "<option selected VALUE='All'>" . _('All') . '</option>'; + echo '<option selected value="All">' . _('All') . '</option>'; $_POST['StockCat'] ='All'; } else { - echo "<option VALUE='All'>" . _('All') . '</option>'; + echo '<option value="All">' . _('All') . '</option>'; } while ($myrow1 = DB_fetch_array($result1)) { if ($_POST['StockCat']==$myrow1['categoryid']){ - echo '<option selected VALUE=' . $myrow1['categoryid'] . '>' . $myrow1['categorydescription']; + echo '<option selected value=' . $myrow1['categoryid'] . '>' . $myrow1['categorydescription'] . '</option>'; } else { - echo '<option VALUE='. $myrow1['categoryid'] . '>' . $myrow1['categorydescription']; + echo '<option value='. $myrow1['categoryid'] . '>' . $myrow1['categorydescription'] . '</option>'; } } ?> </select> <td><?php echo _('Enter text extracts in the'); ?> <b><?php echo _('description'); ?></b>:</td> - <td><input type="Text" name="Keywords" size=20 maxlength=25 VALUE="<?php if (isset($_POST['Keywords'])) echo $_POST['Keywords']; ?>"></td></tr> + <td><input type="Text" name="Keywords" size=20 maxlength=25 value="<?php if (isset($_POST['Keywords'])) echo $_POST['Keywords']; ?>"></td></tr> <tr><td></td> <td><font SIZE 3><b><?php echo _('OR'); ?> </b></font><?php echo _('Enter extract of the'); ?> <b><?php echo _('Stock Code'); ?></b>:</td> - <td><input type="Text" name="StockCode" size="15" maxlength="18" VALUE="<?php if (isset($_POST['StockCode'])) echo $_POST['StockCode']; ?>"></td> + <td><input type="Text" name="StockCode" size="15" maxlength="18" value="<?php if (isset($_POST['StockCode'])) echo $_POST['StockCode']; ?>"></td> </tr> </table> - <br /><div class="centre"><input type=submit name="Search" VALUE="<?php echo _('Search Now'); ?>"> + <br /><div class="centre"><input type=submit name="Search" value="<?php echo _('Search Now'); ?>"> <script language='JavaScript' type='text/javascript'> @@ -668,7 +676,7 @@ if (!in_array($myrow['stockid'],$ItemCodes)){ if (function_exists('imagecreatefrompng') ){ - $ImageSource = '<IMG SRC="GetStockImage.php?SID&automake=1&textcolor=FFFFFF&bgcolor=CCCCCC&StockID=' . urlencode($myrow['stockid']). '&text=&width=64&height=64">'; + $ImageSource = '<IMG SRC="GetStockImage.php?automake=1&textcolor=FFFFFF&bgcolor=CCCCCC&StockID=' . urlencode($myrow['stockid']). '&text=&width=64&height=64">'; } else { if(file_exists($_SERVER['DOCUMENT_ROOT'] . $rootpath. '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg')) { $ImageSource = '<IMG SRC="' .$_SERVER['DOCUMENT_ROOT'] . $rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg">'; @@ -685,7 +693,7 @@ $k=1; } - $IssueLink = $_SERVER['PHP_SELF'] . '?' . SID . '&WO=' . $_POST['WO'] . '&StockID=' . $_POST['StockID'] . '&IssueItem=' . $myrow['stockid'] . '&FromLocation=' . $_POST['FromLocation']; + $IssueLink = $_SERVER['PHP_SELF'] . '?WO=' . $_POST['WO'] . '&StockID=' . $_POST['StockID'] . '&IssueItem=' . $myrow['stockid'] . '&FromLocation=' . $_POST['FromLocation']; printf("<td><font size=1>%s</font></td> <td><font size=1>%s</font></td> <td><font size=1>%s</font></td> @@ -739,9 +747,9 @@ $SerialNoResult = DB_query("SELECT serialno - FROM stockserialitems - WHERE stockid='" . $_POST['IssueItem'] . "' - AND loccode='" . $_POST['FromLocation'] . "'", + FROM stockserialitems + WHERE stockid='" . $_POST['IssueItem'] . "' + AND loccode='" . $_POST['FromLocation'] . "'", $db,_('Could not retrieve the serial numbers available at the location specified because')); if (DB_num_rows($SerialNoResult)==0){ echo '<tr><td>' . _('There are no serial numbers at this location to issue') . '</td></tr>'; Modified: trunk/WorkOrderReceive.php =================================================================== --- trunk/WorkOrderReceive.php 2011-04-07 10:23:55 UTC (rev 4541) +++ trunk/WorkOrderReceive.php 2011-04-08 23:37:01 UTC (rev 4542) @@ -1,25 +1,23 @@ <?php /* $Id$*/ -//$PageSecurity = 11; - include('includes/session.inc'); $title = _('Receive Work Order'); include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); -echo '<a href="'. $rootpath . '/SelectWorkOrder.php?' . SID . '">' . _('Back to Work Orders'). '</a><br>'; -echo '<a href="'. $rootpath . '/WorkOrderCosting.php?' . SID . '&WO=' . $_REQUEST['WO'] . '">' . _('Back to Costing'). '</a><br>'; +echo '<a href="'. $rootpath . '/SelectWorkOrder.php">' . _('Back to Work Orders'). '</a><br>'; +echo '<a href="'. $rootpath . '/WorkOrderCosting.php?WO=' . $_REQUEST['WO'] . '">' . _('Back to Costing'). '</a><br>'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/group_add.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p'; -echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" n... [truncated message content] |
From: <dai...@us...> - 2011-04-08 23:37:09
|
Revision: 4542 http://web-erp.svn.sourceforge.net/web-erp/?rev=4542&view=rev Author: daintree Date: 2011-04-08 23:37:01 +0000 (Fri, 08 Apr 2011) Log Message: ----------- SQL xhtml quoting Modified Paths: -------------- trunk/ReverseGRN.php trunk/WWW_Access.php trunk/WWW_Users.php trunk/WorkCentres.php trunk/WorkOrderEntry.php trunk/WorkOrderIssue.php trunk/WorkOrderReceive.php trunk/Z_CheckAllocationsFrom.php trunk/Z_CheckAllocs.php trunk/Z_CheckDebtorsControl.php trunk/Z_CheckGLTransBalance.php trunk/Z_CreateChartDetails.php Modified: trunk/ReverseGRN.php =================================================================== --- trunk/ReverseGRN.php 2011-04-07 10:23:55 UTC (rev 4541) +++ trunk/ReverseGRN.php 2011-04-08 23:37:01 UTC (rev 4542) @@ -18,7 +18,7 @@ $_POST['SupplierID']=$_SESSION['SupplierID']; } if (!isset($_POST['SupplierID']) OR $_POST['SupplierID']==""){ - echo '<br>' . _('This page is expected to be called after a supplier has been selected'); + echo '<br />' . _('This page is expected to be called after a supplier has been selected'); echo "<meta http-equiv='Refresh' content='0; url=" . $rootpath . '/SelectSupplier.php?' . SID . "'>"; exit; } elseif (!isset($_POST['SuppName']) or $_POST['SuppName']=="") { @@ -61,7 +61,7 @@ $QtyToReverse = $GRN['qtyrecd'] - $GRN['quantityinv']; if ($QtyToReverse ==0){ - echo '<br><br>' . _('The GRN') . ' ' . $_GET['GRNNo'] . ' ' . _('has already been reversed or fully invoiced by the supplier - it cannot be reversed - stock quantities must be corrected by stock adjustments - the stock is paid for'); + echo '<br /><br />' . _('The GRN') . ' ' . $_GET['GRNNo'] . ' ' . _('has already been reversed or fully invoiced by the supplier - it cannot be reversed - stock quantities must be corrected by stock adjustments - the stock is paid for'); include ('includes/footer.inc'); exit; } @@ -73,7 +73,7 @@ $SQL = "SELECT stockmaster.controlled FROM stockmaster WHERE stockid ='" . $GRN['itemcode'] . "'"; - $CheckControlledResult = DB_query($SQL,$db,'<br>' . _('Could not determine if the item was controlled or not because') . ' '); + $CheckControlledResult = DB_query($SQL,$db,'<br />' . _('Could not determine if the item was controlled or not because') . ' '); $ControlledRow = DB_fetch_row($CheckControlledResult); if ($ControlledRow[0]==1) { /*Then its a controlled item */ $Controlled = true; @@ -132,7 +132,7 @@ /*Now the purchorder header status in case it was completed - now incomplete - just printed */ $SQL = "UPDATE purchorders SET status = 'Printed', - stat_comment = CONCAT('" . Date($_SESSION['DefaultDateFormat']) . ' ' . _('GRN Reversed for') . ' ' . $GRN['itemdescription'] . ' ' . _('by') . ' ' . $_SESSION['UsersRealName'] . "<br>', stat_comment ) + stat_comment = CONCAT('" . Date($_SESSION['DefaultDateFormat']) . ' ' . _('GRN Reversed for') . ' ' . $GRN['itemdescription'] . ' ' . _('by') . ' ' . $_SESSION['UsersRealName'] . "<br />', stat_comment ) WHERE orderno = '" . $GRN['orderno'] . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The purchase order statusand status comment could not be changed because'); @@ -146,7 +146,7 @@ $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GRN record could not be deleted because'); $DbgMsg = _('The following SQL to delete the GRN record was used'); - $result = DB_query('DELETE FROM grns WHERE grnno="' . $_GET['GRNNo'] . '"',$db,$ErrMsg,$DbgMsg,true); + $result = DB_query("DELETE FROM grns WHERE grnno='" . $_GET['GRNNo'] . "'",$db,$ErrMsg,$DbgMsg,true); } else { $SQL = "UPDATE grns SET qtyrecd = qtyrecd - $QtyToReverse @@ -159,26 +159,26 @@ /*If the GRN being reversed is an asset - reverse the fixedassettrans record */ if ($GRN['assetid']!='0'){ $SQL = "INSERT INTO fixedassettrans (assetid, - transtype, - transno, - transdate, - periodno, - inputdate, - cost) - VALUES ('" . $GRN['assetid'] . "', - 25, - '" . $_GET['GRNNo'] . "', - '" . $GRN['deliverydate'] . "', - '" . $PeriodNo . "', - '" . Date('Y-m-d') . "', - '" . -$GRN['stdcostunit'] * $QtyToReverse . "')"; + transtype, + transno, + transdate, + periodno, + inputdate, + cost) + VALUES ('" . $GRN['assetid'] . "', + 25, + '" . $_GET['GRNNo'] . "', + '" . $GRN['deliverydate'] . "', + '" . $PeriodNo . "', + '" . Date('Y-m-d') . "', + '" . -$GRN['stdcostunit'] * $QtyToReverse . "')"; $ErrMsg = _('CRITICAL ERROR! NOTE DOWN THIS ERROR AND SEEK ASSISTANCE The fixed asset transaction could not be inserted because'); $DbgMsg = _('The following SQL to insert the fixed asset transaction record was used'); $Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true); /*now reverse the cost put to fixedassets */ $SQL = "UPDATE fixedassets SET cost = cost - " . ($GRN['stdcostunit'] * $QtyToReverse) . " - WHERE assetid = '" . $GRN['assetid'] . "'"; + WHERE assetid = '" . $GRN['assetid'] . "'"; $ErrMsg = _('CRITICAL ERROR! NOTE DOWN THIS ERROR AND SEEK ASSISTANCE. The fixed asset cost addition could not be reversed:'); $DbgMsg = _('The following SQL was used to attempt the reduce the cost of the asset was:'); $Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true); @@ -186,9 +186,9 @@ } //end of if it is an asset $SQL = "SELECT stockmaster.controlled - FROM stockmaster - WHERE stockmaster.stockid = '" . $GRN['itemcode'] . "'"; - $Result = DB_query($SQL, $db, _('Could not determine if the item exists because'),'<br>' . _('The SQL that failed was') . ' ',true); + FROM stockmaster + WHERE stockmaster.stockid = '" . $GRN['itemcode'] . "'"; + $Result = DB_query($SQL, $db, _('Could not determine if the item exists because'),'<br />' . _('The SQL that failed was') . ' ',true); if (DB_num_rows($Result)==1){ /* if the GRN is in fact a stock item being reversed */ @@ -222,28 +222,28 @@ /* If its a stock item .... Insert stock movements - with unit cost */ - $SQL = "INSERT INTO stockmoves ( stockid, - type, - transno, - loccode, - trandate, - prd, - reference, - qty, - standardcost, - newqoh) - VALUES ( - '" . $GRN['itemcode'] . "', - 25, - '" . $_GET['GRNNo'] . "', - '" . $GRN['intostocklocation'] . "', - '" . $GRN['deliverydate'] . "', - '" . $PeriodNo . "', - '" . _('Reversal') . ' - ' . $_POST['SupplierID'] . ' - ' . $GRN['orderno'] . "', - '" . -$QtyToReverse . "', - '" . $GRN['stdcostunit'] . "', - '" . ($QtyOnHandPrior - $QtyToReverse) . "' - )"; + $SQL = "INSERT INTO stockmoves ( stockid, + type, + transno, + loccode, + trandate, + prd, + reference, + qty, + standardcost, + newqoh) + VALUES ( + '" . $GRN['itemcode'] . "', + 25, + '" . $_GET['GRNNo'] . "', + '" . $GRN['intostocklocation'] . "', + '" . $GRN['deliverydate'] . "', + '" . $PeriodNo . "', + '" . _('Reversal') . ' - ' . $_POST['SupplierID'] . ' - ' . $GRN['orderno'] . "', + '" . -$QtyToReverse . "', + '" . $GRN['stdcostunit'] . "', + '" . ($QtyOnHandPrior - $QtyToReverse) . "' + )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Stock movement records could not be inserted because'); $DbgMsg = _('The following SQL to insert the stock movement records was used'); @@ -305,21 +305,21 @@ /*now the GRN suspense entry*/ $SQL = "INSERT INTO gltrans ( type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES ( - 25, - '" . $_GET['GRNNo'] . "', - '" . $GRN['deliverydate'] . "', - '" . $PeriodNo . "', - '" . $_SESSION['CompanyRecord']['grnact'] . "', '" - . _('GRN Reversal PO') . ': ' . $GRN['orderno'] . " " . $_POST['SupplierID'] . " - " . $GRN['itemcode'] . "-" . $GRN['itemdescription'] . " x " . $QtyToReverse . " @ " . number_format($GRN['stdcostunit'],2) . "', - '" . $GRN['stdcostunit'] * $QtyToReverse . "' - )"; + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES ( + 25, + '" . $_GET['GRNNo'] . "', + '" . $GRN['deliverydate'] . "', + '" . $PeriodNo . "', + '" . $_SESSION['CompanyRecord']['grnact'] . "', '" + . _('GRN Reversal PO') . ': ' . $GRN['orderno'] . " " . $_POST['SupplierID'] . " - " . $GRN['itemcode'] . "-" . $GRN['itemdescription'] . " x " . $QtyToReverse . " @ " . number_format($GRN['stdcostunit'],2) . "', + '" . $GRN['stdcostunit'] * $QtyToReverse . "' + )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GRN suspense side of the GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GRN Suspense GLTrans record was used'); @@ -329,7 +329,7 @@ $Result = DB_Txn_Commit($db); - echo '<br>' . _('GRN number') . ' ' . $_GET['GRNNo'] . ' ' . _('for') . ' ' . $QtyToReverse . ' x ' . $GRN['itemcode'] . ' - ' . $GRN['itemdescription'] . ' ' . _('has been reversed') . '<br>'; + echo '<br />' . _('GRN number') . ' ' . $_GET['GRNNo'] . ' ' . _('for') . ' ' . $QtyToReverse . ' x ' . $GRN['itemcode'] . ' - ' . $GRN['itemdescription'] . ' ' . _('has been reversed') . '<br />'; unset($_GET['GRNNo']); // to ensure it cant be done again!! echo '<a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Select another GRN to Reverse') . '</a>'; /*end of Process Goods Received Reversal entry */ @@ -367,7 +367,7 @@ $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); if (DB_num_rows($result) ==0){ - prnMsg(_('There are no outstanding goods received yet to be invoiced for') . ' ' . $_POST['SuppName'] . '.<br>' . _('To reverse a GRN that has been invoiced first it must be credited'),'warn'); + prnMsg(_('There are no outstanding goods received yet to be invoiced for') . ' ' . $_POST['SuppName'] . '.<br />' . _('To reverse a GRN that has been invoiced first it must be credited'),'warn'); } else { //there are GRNs to show echo '<br /><table cellpadding=2 colspan=7 class=selection>'; @@ -375,10 +375,10 @@ <th>' . _('GRN') . ' #</th> <th>' . _('Item Code') . '</th> <th>' . _('Description') . '</th> - <th>' . _('Date') . '<br>' . _('Received') . '</th> - <th>' . _('Quantity') . '<br>' . _('Received') . '</th> - <th>' . _('Quantity') . '<br>' . _('Invoiced') . '</th> - <th>' . _('Quantity To') . '<br>' . _('Reverse') . '</th> + <th>' . _('Date') . '<br />' . _('Received') . '</th> + <th>' . _('Quantity') . '<br />' . _('Received') . '</th> + <th>' . _('Quantity') . '<br />' . _('Invoiced') . '</th> + <th>' . _('Quantity To') . '<br />' . _('Reverse') . '</th> </tr>'; echo $TableHeader; Modified: trunk/WWW_Access.php =================================================================== --- trunk/WWW_Access.php 2011-04-07 10:23:55 UTC (rev 4541) +++ trunk/WWW_Access.php 2011-04-08 23:37:01 UTC (rev 4542) @@ -2,8 +2,6 @@ /* $Id$*/ -//$PageSecurity=15; - include('includes/session.inc'); $title = _('Access Permission Maintenance'); @@ -41,7 +39,7 @@ $ErrMsg = _('The update of the security role description failed because'); $ResMsg = _('The Security role description was updated.'); } else { // Add Security Heading - $sql = "INSERT INTO securityroles (secrolename) VALUES ('".$_POST['SecRoleName']."')"; + $sql = "INSERT INTO securityroles (secrolename) valueS ('".$_POST['SecRoleName']."')"; $ErrMsg = _('The update of the security role failed because'); $ResMsg = _('The Security role was created.'); } @@ -52,7 +50,7 @@ if( isset($_GET['add']) ) { // updating Security Groups add a page token $sql = "INSERT INTO securitygroups ( secroleid, tokenid - ) VALUES ( + ) valueS ( '".$SelectedRole."', '".$PageTokenId."' )"; @@ -70,7 +68,7 @@ unset($_GET['PageToken']); } // Need to exec the query - if (isset($sql) && $InputError != 1 ) { + if (isset($sql) AND $InputError != 1 ) { $result = DB_query($sql,$db,$ErrMsg); if( $result ) { prnMsg( $ResMsg,'success'); @@ -84,7 +82,7 @@ $myrow = DB_fetch_row($result); if ($myrow[0]>0) { prnMsg( _('Cannot delete this role because user accounts are setup using it'),'warn'); - echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('user accounts that have this security role setting') . '</font>'; + echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('user accounts that have this security role setting') . '</font>'; } else { $sql="DELETE FROM securitygroups WHERE secroleid='" . $_GET['SelectedRole'] . "'"; $result = DB_query($sql,$db); @@ -108,7 +106,7 @@ $result = DB_query($sql,$db); echo '<table class=selection>'; - echo "<tr><th>" . _('Role') . "</th></tr>"; + echo '<tr><th>' . _('Role') . '</th></tr>'; $k=0; //row colour counter @@ -128,9 +126,9 @@ <td><a href=\"%s&SelectedRole=%s&delete=1&SecRoleName=%s\">" . _('Delete') . "</a></td> </tr>", $myrow['secrolename'], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $myrow['secroleid'], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $myrow['secroleid'], urlencode($myrow['secrolename'])); @@ -140,7 +138,7 @@ if (isset($SelectedRole)) { - echo "<br /><div class='centre'><a href='" . $_SERVER['PHP_SELF'] ."?" . SID . "'>" . _('Review Existing Roles') . '</a></div>'; + echo '<br /><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Review Existing Roles') . '</a></div>'; } if (isset($SelectedRole)) { @@ -159,24 +157,24 @@ $_POST['SecRoleName'] = $myrow['secrolename']; } } -echo '<br>'; -echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . "?" . SID . ">"; +echo '<br />'; +echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if( isset($_POST['SelectedRole'])) { - echo "<input type=hidden name='SelectedRole' VALUE='" . $_POST['SelectedRole'] . "'>"; + echo '<input type="hidden" name="SelectedRole" value="' . $_POST['SelectedRole'] . '">'; } -echo '<table class=selection>'; +echo '<table class="selection">'; if (!isset($_POST['SecRoleName'])) { $_POST['SecRoleName']=''; } echo '<tr><td>' . _('Role') . ":</td> - <td><input type='text' name='SecRoleName' size=40 maxlength=40 VALUE='" . $_POST['SecRoleName'] . "'></tr>"; + <td><input type='text' name='SecRoleName' size=40 maxlength=40 value='" . $_POST['SecRoleName'] . "'></tr>"; echo "</table><br /> <div class='centre'><input type='Submit' name='submit' value='" . _('Enter Role') . "'></div></form>"; if (isset($SelectedRole)) { - $sql = 'SELECT tokenid, tokenname - FROM securitytokens'; + $sql = "SELECT tokenid, tokenname + FROM securitytokens"; $sqlUsed = "SELECT tokenid FROM securitygroups WHERE secroleid='". $SelectedRole . "'"; @@ -194,8 +192,8 @@ echo '<br /><table class=selection><tr>'; if (DB_num_rows($Result)>0 ) { - echo "<th colspan=3><div class='centre'>"._('Assigned Security Tokens')."</div></th>"; - echo "<th colspan=3><div class='centre'>"._('Available Security Tokens')."</div></th>"; + echo '<th colspan="3"><div class="centre">'._('Assigned Security Tokens').'</div></th>'; + echo '<th colspan=3><div class="centre">'._('Available Security Tokens').'</div></th>'; } echo '</tr>'; @@ -215,7 +213,7 @@ <td><a href=\"%s&SelectedRole=%s&remove=1&PageToken=%s\">" . _('Remove') . "</a></td><td> </td><td> </td><td> </td>", $AvailRow['tokenid'], $AvailRow['tokenname'], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $SelectedRole, $AvailRow['tokenid'] ); @@ -228,7 +226,7 @@ <td><a href=\"%s&SelectedRole=%s&add=1&PageToken=%s\">" . _('Add') . "</a></td>", $AvailRow['tokenid'], $AvailRow['tokenname'], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $SelectedRole, $AvailRow['tokenid'] ); Modified: trunk/WWW_Users.php =================================================================== --- trunk/WWW_Users.php 2011-04-07 10:23:55 UTC (rev 4541) +++ trunk/WWW_Users.php 2011-04-08 23:37:01 UTC (rev 4542) @@ -2,8 +2,6 @@ /* $Id$*/ -//$PageSecurity=15; - if (isset($_POST['UserID']) AND isset($_POST['ID'])){ if ($_POST['UserID'] == $_POST['ID']) { $_POST['Language'] = $_POST['UserLanguage']; @@ -33,9 +31,9 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/group_add.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; // Make an array of the security roles -$sql = 'SELECT secroleid, +$sql = "SELECT secroleid, secrolename - FROM securityroles ORDER BY secroleid'; + FROM securityroles ORDER BY secroleid"; $Sec_Result = DB_query($sql, $db); $SecurityRoles = array(); // Now load it into an a ray using Key/Value pairs @@ -106,7 +104,7 @@ $i=0; $ModulesAllowed = ''; while ($i < count($ModuleList)){ - $FormVbl = "Module_" . $i; + $FormVbl = 'Module_' . $i; $ModulesAllowed .= $_POST[($FormVbl)] . ','; $i++; } @@ -219,7 +217,7 @@ prnMsg(_('The demonstration user called demo cannot be deleted'),'error'); } else { */ - $sql='SELECT userid FROM audittrail where userid="'. $SelectedUser .'"'; + $sql="SELECT userid FROM audittrail where userid='" . $SelectedUser ."'"; $result=DB_query($sql, $db); if (DB_num_rows($result)!=0) { prnMsg(_('Cannot delete user as entries already exist in the audit trail'), 'warn'); @@ -239,7 +237,7 @@ /* If its the first time the page has been displayed with no parameters then none of the above are true and the list of Users will be displayed with links to delete or edit each. These will call the same page again and allow update/input or deletion of the records*/ - $sql = 'SELECT + $sql = "SELECT userid, realname, phone, @@ -253,24 +251,24 @@ pagesize, theme, language - FROM www_users'; + FROM www_users"; $result = DB_query($sql,$db); echo '<table class=selection>'; - echo "<tr><th>" . _('User Login') . "</th> - <th>" . _('Full Name') . "</th> - <th>" . _('Telephone') . "</th> - <th>" . _('Email') . "</th> - <th>" . _('Customer Code') . "</th> - <th>" . _('Branch Code') . "</th> - <th>" . _('Supplier Code') . "</th> - <th>" . _('Salesperson') . "</th> - <th>" . _('Last Visit') . "</th> - <th>" . _('Security Role') ."</th> - <th>" . _('Report Size') ."</th> - <th>" . _('Theme') ."</th> - <th>" . _('Language') ."</th> - </tr>"; + echo '<tr><th>' . _('User Login') . '</th> + <th>' . _('Full Name') . '</th> + <th>' . _('Telephone') . '</th> + <th>' . _('Email') . '</th> + <th>' . _('Customer Code') . '</th> + <th>' . _('Branch Code') . '</th> + <th>' . _('Supplier Code') . '</th> + <th>' . _('Salesperson') . '</th> + <th>' . _('Last Visit') . '</th> + <th>' . _('Security Role') .'</th> + <th>' . _('Report Size') .'</th> + <th>' . _('Theme') .'</th> + <th>' . _('Language') .'</th> + </tr>'; $k=0; //row colour counter @@ -320,21 +318,21 @@ $myrow[10], $myrow[11], $myrow[12], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $myrow[0], - $_SERVER['PHP_SELF'] . "?" . SID, + $_SERVER['PHP_SELF'] . '?', $myrow[0]); } //END WHILE LIST LOOP - echo '</table><br>'; + echo '</table><br />'; } //end of ifs and buts! if (isset($SelectedUser)) { - echo "<div class='centre'><a href='" . $_SERVER['PHP_SELF'] ."?" . SID . "'>" . _('Review Existing Users') . '</a></div><br>'; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Review Existing Users') . '</a></div><br />'; } -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($SelectedUser)) { @@ -380,16 +378,19 @@ $_POST['Blocked'] = $myrow['blocked']; $_POST['PDFLanguage'] = $myrow['pdflanguage']; - echo "<input type='hidden' name='SelectedUser' value='" . $SelectedUser . "'>"; - echo "<input type='hidden' name='UserID' value='" . $_POST['UserID'] . "'>"; - echo "<input type='hidden' name='ModulesAllowed' value='" . $_POST['ModulesAllowed'] . "'>"; + echo '<input type="hidden" name="SelectedUser" value="' . $SelectedUser . '">'; + echo '<input type="hidden" name="UserID" value="' . $_POST['UserID'] . '">'; + echo '<input type="hidden" name="ModulesAllowed" value="' . $_POST['ModulesAllowed'] . '">'; echo '<table class=selection> <tr><td>' . _('User code') . ':</td><td>'; echo $_POST['UserID'] . '</td></tr>'; } else { //end of if $SelectedUser only do the else when a new record is being entered - echo '<table class=selection><tr><td>' . _('User Login') . ":</td><td><input type='text' name='UserID' size=22 maxlength=20 ></td></tr>"; + echo '<table class=selection> + <tr> + <td>' . _('User Login') . ':</td> + <td><input type="text" name="UserID" size="22" maxlength="20"></td></tr>'; /*set the default modules to show to all this had trapped a few people previously*/ @@ -418,21 +419,21 @@ if (!isset($_POST['Email'])) { $_POST['Email']=''; } -echo '<tr><td>' . _('Password') . ":</td> - <td><input type='password' name='Password' size=22 maxlength=20 value='" . $_POST['Password'] . "'></tr>"; -echo '<tr><td>' . _('Full Name') . ":</td> - <td><input type='text' name='RealName' value='" . $_POST['RealName'] . "' size=36 maxlength=35></td></tr>"; -echo '<tr><td>' . _('Telephone No') . ":</td> - <td><input type='text' name='Phone' value='" . $_POST['Phone'] . "' size=32 maxlength=30></td></tr>"; -echo '<tr><td>' . _('Email Address') .":</td> - <td><input type='text' name='Email' value='" . $_POST['Email'] ."' size=32 maxlength=55></td></tr>"; -echo '<tr><td>' . _('Security Role') . ":</td><td><select name='Access'>"; +echo '<tr><td>' . _('Password') . ':</td> + <td><input type="password" name="Password" size="22" maxlength="20" value="' . $_POST['Password'] . '"></tr>'; +echo '<tr><td>' . _('Full Name') . ':</td> + <td><input type="text" name="RealName" value="' . $_POST['RealName'] . '" size="36" maxlength="35"></td></tr>'; +echo '<tr><td>' . _('Telephone No') . ':</td> + <td><input type="text" name="Phone" value="' . $_POST['Phone'] . '" size="32" maxlength="30"></td></tr>'; +echo '<tr><td>' . _('Email Address') .':</td> + <td><input type="text" name="Email" value="' . $_POST['Email'] .'" size="32" maxlength="55"></td></tr>'; +echo '<tr><td>' . _('Security Role') . ':</td><td><select name="Access">'; foreach ($SecurityRoles as $SecKey => $SecVal) { if (isset($_POST['Access']) and $SecKey == $_POST['Access']){ - echo "<option selected value=" . $SecKey . ">" . $SecVal; + echo '<option selected value="' . $SecKey . '">' . $SecVal .'</option>'; } else { - echo "<option value=" . $SecKey . ">" . $SecVal; + echo '<option value="' . $SecKey . '">' . $SecVal .'</option>'; } } echo '</select></td></tr>'; @@ -441,17 +442,17 @@ echo '<tr><td>' . _('Default Location') . ':</td> <td><select name="DefaultLocation">'; -$sql = 'SELECT loccode, locationname FROM locations'; +$sql = "SELECT loccode, locationname FROM locations"; $result = DB_query($sql,$db); while ($myrow=DB_fetch_array($result)){ if (isset($_POST['DefaultLocation']) and $myrow['loccode'] == $_POST['DefaultLocation']){ - echo "<option selected value='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] .'</option>'; } else { - echo "<option Value='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] .'</option>'; } @@ -479,7 +480,7 @@ echo '<tr><td>' . _('Restrict to Sales Person') . ':</td> <td><select name="Salesman">'; -$sql = 'SELECT salesmancode, salesmanname FROM salesman'; +$sql = "SELECT salesmancode, salesmanname FROM salesman"; $result = DB_query($sql,$db); if ((isset($_POST['Salesman']) and $_POST['Salesman']=='') OR !isset($_POST['Salesman'])){ echo '<option selected value="">' . _('Not a salesperson only login') . '</option>'; @@ -499,69 +500,69 @@ echo '</select></td></tr>'; -echo '<tr><td>' . _('Reports Page Size') .":</td> - <td><select name='PageSize'>"; +echo '<tr><td>' . _('Reports Page Size') .':</td> + <td><select name="PageSize">'; if(isset($_POST['PageSize']) and $_POST['PageSize']=='A4'){ - echo "<option selected value='A4'>" . _('A4'); + echo '<option selected value="A4">' . _('A4') .'</option>'; } else { - echo "<option value='A4'>A4"; + echo '<option value="A4">' . _('A4') . '</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='A3'){ - echo "<option selected Value='A3'>" . _('A3'); + echo '<option selected value="A3">' . _('A3') .'</option>'; } else { - echo "<option value='A3'>A3"; + echo '<option value="A3">' . _('A3') .'</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='A3_landscape'){ - echo "<option selected Value='A3_landscape'>" . _('A3') . ' ' . _('landscape'); + echo '<option selected value="A3_landscape">' . _('A3') . ' ' . _('landscape') .'</option>'; } else { - echo "<option value='A3_landscape'>" . _('A3') . ' ' . _('landscape'); + echo '<option value="A3_landscape">' . _('A3') . ' ' . _('landscape') .'</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='letter'){ - echo "<option selected Value='letter'>" . _('Letter'); + echo '<option selected value="letter">' . _('Letter') .'</option>'; } else { - echo "<option value='letter'>" . _('Letter'); + echo '<option value="letter">' . _('Letter') .'</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='letter_landscape'){ - echo "<option selected Value='letter_landscape'>" . _('Letter') . ' ' . _('landscape'); + echo '<option selected value="letter_landscape">' . _('Letter') . ' ' . _('landscape') .'</option>'; } else { - echo "<option value='letter_landscape'>" . _('Letter') . ' ' . _('landscape'); + echo '<option value="letter_landscape">' . _('Letter') . ' ' . _('landscape') .'</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='legal'){ - echo "<option selected value='legal'>" . _('Legal'); + echo '<option selected value="legal">' . _('Legal') .'</option>'; } else { - echo "<option Value='legal'>" . _('Legal'); + echo '<option value="legal">' . _('Legal') .'</option>'; } if(isset($_POST['PageSize']) and $_POST['PageSize']=='legal_landscape'){ - echo "<option selected value='legal_landscape'>" . _('Legal') . ' ' . _('landscape'); + echo '<option selected value="legal_landscape">' . _('Legal') . ' ' . _('landscape') .'</option>'; } else { - echo "<option value='legal_landscape'>" . _('Legal') . ' ' . _('landscape'); + echo '<option value="legal_landscape">' . _('Legal') . ' ' . _('landscape') .'</option>'; } echo '</select></td></tr>'; echo '<tr> - <td>' . _('Theme') . ":</td> - <td><select name='Theme'>"; + <td>' . _('Theme') . ':</td> + <td><select name="Theme">'; $ThemeDirectory = dir('css/'); while (false != ($ThemeName = $ThemeDirectory->read())){ - if (is_dir("css/$ThemeName") AND $ThemeName != '.' AND $ThemeName != '..' AND $ThemeName != '.svn'){ + if (is_dir('css/' . $ThemeName) AND $ThemeName != '.' AND $ThemeName != '..' AND $ThemeName != '.svn'){ if (isset($_POST['Theme']) and $_POST['Theme'] == $ThemeName){ - echo "<option selected value='$ThemeName'>$ThemeName"; + echo '<option selected value="' . $ThemeName . '">' . $ThemeName .'</option>'; } else if (!isset($_POST['Theme']) and ($_SESSION['DefaultTheme']==$ThemeName)) { - echo "<option selected value='$ThemeName'>$ThemeName"; + echo '<option selected value="' . $ThemeName . '">' . $ThemeName .'</option>'; } else { - echo "<option value='$ThemeName'>$ThemeName"; + echo '<option value="' . $ThemeName . '">' . $ThemeName .'</option>'; } } } @@ -570,8 +571,8 @@ echo '<tr> - <td>' . _('Language') . ":</td> - <td><select name='UserLanguage'>"; + <td>' . _('Language') . ':</td> + <td><select name="UserLanguage">'; $LangDirHandle = dir('locale/'); @@ -581,11 +582,11 @@ if (is_dir('locale/' . $LanguageEntry) AND $LanguageEntry != '..' AND $LanguageEntry != 'CVS' AND $LanguageEntry!='.'){ if (isset($_POST['UserLanguage']) and $_POST['UserLanguage'] == $LanguageEntry){ - echo "<option selected value='$LanguageEntry'>$LanguageEntry"; + echo '<option selected value="' . $LanguageEntry . '">' . $LanguageEntry .'</option>'; } elseif (!isset($_POST['UserLanguage']) and $LanguageEntry == $DefaultLanguage) { - echo "<option selected value='$LanguageEntry'>$LanguageEntry"; + echo '<option selected value="' . $LanguageEntry . '">' . $LanguageEntry .'</option>'; } else { - echo "<option value='$LanguageEntry'>$LanguageEntry"; + echo '<option value="' . $LanguageEntry . '">' . $LanguageEntry .'</option>'; } } } @@ -599,7 +600,7 @@ $i=0; foreach($ModuleList as $ModuleName){ - echo '<tr><td>' . _('Display') . ' ' . $ModuleName . ' ' . _('options') . ": </td><td><select name='Module_" . $i . "'>"; + echo '<tr><td>' . _('Display') . ' ' . $ModuleName . ' ' . _('options') . ': </td><td><select name="Module_' . $i . '">'; if ($ModulesAllowed[$i]==0){ echo '<option selected value=0>' . _('No') . '</option>'; echo '<option value=1>' . _('Yes') . '</option>'; @@ -624,7 +625,7 @@ } echo '</select></td></tr>'; -echo '<tr><td>' . _('Account Status') . ":</td><td><select name='Blocked'>"; +echo '<tr><td>' . _('Account Status') . ':</td><td><select name="Blocked">'; if ($_POST['Blocked']==0){ echo '<option selected value=0>' . _('Open'); echo '<option value=1>' . _('Blocked'); @@ -634,7 +635,7 @@ } echo '</select></td></tr>'; -echo '</table><br> +echo '</table><br /> <div class="centre"><input type="submit" name="submit" value="' . _('Enter Information') . '"></div> </form>'; Modified: trunk/WorkCentres.php =================================================================== --- trunk/WorkCentres.php 2011-04-07 10:23:55 UTC (rev 4541) +++ trunk/WorkCentres.php 2011-04-08 23:37:01 UTC (rev 4542) @@ -1,7 +1,6 @@ <?php /* $Id$*/ -//$PageSecurity=9; include('includes/session.inc'); $title = _('Work Centres'); @@ -31,7 +30,7 @@ $InputError = 1; prnMsg(_('The Work Centre description must be at least 3 characters long'),'error'); } - if (strstr($_POST['Code'],' ') OR strstr($_POST['Code'],"'") OR strstr($_POST['Code'],'+') OR strstr($_POST['Code'],"\\") OR strstr($_POST['Code'],"\"") OR strstr($_POST['Code'],'&') OR strstr($_POST['Code'],'.') OR strstr($_POST['Code'],'"')) { + if (strstr($_POST['Code'],' ') OR ContainsIllegalCharacters($_POST['Code']) ) { $InputError = 1; prnMsg(_('The work centre code cannot contain any of the following characters') . " - ' & + \" \\ " . _('or a space'),'error'); } @@ -110,23 +109,23 @@ or deletion of the records*/ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . '</p>'; - $sql = 'SELECT workcentres.code, - workcentres.description, - locations.locationname, - workcentres.overheadrecoveryact, - workcentres.overheadperhour - FROM workcentres, - locations - WHERE workcentres.location = locations.loccode'; + $sql = "SELECT workcentres.code, + workcentres.description, + locations.locationname, + workcentres.overheadrecoveryact, + workcentres.overheadperhour + FROM workcentres, + locations + WHERE workcentres.location = locations.loccode"; $result = DB_query($sql,$db); - echo "<table class=selection> - <tr bgcolor =#800000><th>" . _('WC Code') . "</th> - <th>" . _('Description') . "</th> - <th>" . _('Location') . "</th> - <th>" . _('Overhead GL Account') . "</th> - <th>" . _('Overhead Per Hour') . "</th> - </tr></font>"; + echo '<table class="selection"> + <tr bgcolor ="#800000"><th>' . _('WC Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Location') . '</th> + <th>' . _('Overhead GL Account') . '</th> + <th>' . _('Overhead Per Hour') . '</th> + </tr>'; while ($myrow = DB_fetch_row($result)) { @@ -143,8 +142,8 @@ $myrow[2], $myrow[3], $myrow[4], - $_SERVER['PHP_SELF'] . '?' . SID, - $myrow[0], $_SERVER['PHP_SELF'] . '?' . SID, + $_SERVER['PHP_SELF'] . '?', + $myrow[0], $_SERVER['PHP_SELF'] . '?', $myrow[0]); } @@ -156,10 +155,10 @@ if (isset($SelectedWC)) { echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . '</p>'; - echo "<div class='centre'><a href='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>" . _('Show all Work Centres') . '</a></div>'; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Show all Work Centres') . '</a></div>'; } -echo "<p><form method='post' action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>"; +echo '<p><form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedWC)) { @@ -182,41 +181,42 @@ $_POST['OverheadRecoveryAct'] = $myrow['overheadrecoveryact']; $_POST['OverheadPerHour'] = $myrow['overheadperhour']; - echo '<input type=hidden name="SelectedWC" value=' . $SelectedWC . '>'; - echo '<input type=hidden name="Code" value="' . $_POST['Code'] . '">'; - echo '<table class=selection><tr><td>' ._('Work Centre Code') . ':</td><td>' . $_POST['Code'] . '</td></tr>'; + echo '<input type="hidden" name="SelectedWC" value=' . $SelectedWC . '>'; + echo '<input type="hidden" name="Code" value="' . $_POST['Code'] . '">'; + echo '<table class="selection"><tr><td>' ._('Work Centre Code') . ':</td> + <td>' . $_POST['Code'] . '</td></tr>'; } else { //end of if $SelectedWC only do the else when a new record is being entered if (!isset($_POST['Code'])) { $_POST['Code'] = ''; } - echo '<table class=selection><tr> - <td>' . _('Work Centre Code') . ":</td> - <td><input type='Text' name='Code' size=6 maxlength=5 value='" . $_POST['Code'] . "'></td> - </tr>"; + echo '<table class="selection"><tr> + <td>' . _('Work Centre Code') . ':</td> + <td><input type="Text" name="Code" size="6" maxlength="5" value="' . $_POST['Code'] . '"></td> + </tr>'; } -$SQL = 'SELECT locationname, +$SQL = "SELECT locationname, loccode - FROM locations'; + FROM locations"; $result = DB_query($SQL,$db); if (!isset($_POST['Description'])) { $_POST['Description'] = ''; } -echo '<tr><td>' . _('Work Centre Description') . ":</td> - <td><input type='Text' name='Description' size=21 maxlength=20 value='" . $_POST['Description'] . "'></td> +echo '<tr><td>' . _('Work Centre Description') . ':</td> + <td><input type="Text" name="Description" size="21" maxlength="20" value="' . $_POST['Description'] . '"></td> </tr> - <tr><td>" . _('Location') . ":</td> - <td><select name='Location'>"; + <tr><td>' . _('Location') . ':</td> + <td><select name="Location">'; while ($myrow = DB_fetch_array($result)) { if (isset($_POST['Location']) and $myrow['loccode']==$_POST['Location']) { - echo "<option selected VALUE='"; + echo '<option selected value="'; } else { - echo "<option VALUE='"; + echo '<option VALUE="'; } - echo $myrow['loccode'] . "'>" . $myrow['locationname']; + echo $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } //end while loop @@ -224,26 +224,26 @@ echo '</select></td></tr> - <tr><td>' . _('Overhead Recovery GL Account') . ":</td> - <td><select name='OverheadRecoveryAct'>"; + <tr><td>' . _('Overhead Recovery GL Account') . ':</td> + <td><select name="OverheadRecoveryAct">'; //SQL to poulate account selection boxes -$SQL = 'SELECT accountcode, - accountname - FROM chartmaster INNER JOIN accountgroups - ON chartmaster.group_=accountgroups.groupname - WHERE accountgroups.pandl!=0 - ORDER BY accountcode'; +$SQL = "SELECT accountcode, + accountname + FROM chartmaster INNER JOIN accountgroups + ON chartmaster.group_=accountgroups.groupname + WHERE accountgroups.pandl!=0 + ORDER BY accountcode"; $result = DB_query($SQL,$db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['OverheadRecoveryAct']) and $myrow['accountcode']==$_POST['OverheadRecoveryAct']) { - echo '<option selected VALUE='; + echo '<option selected value='; } else { - echo '<option VALUE='; + echo '<option value='; } - echo $myrow['accountcode'] . '>' . $myrow['accountname']; + echo $myrow['accountcode'] . '>' . $myrow['accountname'] . '</option>'; } //end while loop DB_free_result($result); Modified: trunk/WorkOrderEntry.php =================================================================== --- trunk/WorkOrderEntry.php 2011-04-07 10:23:55 UTC (rev 4541) +++ trunk/WorkOrderEntry.php 2011-04-08 23:37:01 UTC (rev 4542) @@ -207,10 +207,10 @@ if ($InputError==false){ $CostResult = DB_query("SELECT SUM((materialcost+labourcost+overheadcost)*bom.quantity) AS cost - FROM stockmaster INNER JOIN bom - ON stockmaster.stockid=bom.component - WHERE bom.parent='" . $NewItem . "' - AND bom.loccode='" . $_POST['StockLocation'] . "'", + FROM stockmaster INNER JOIN bom + ON stockmaster.stockid=bom.component + WHERE bom.parent='" . $NewItem . "' + AND bom.loccode='" . $_POST['StockLocation'] . "'", $db); $CostRow = DB_fetch_row($CostResult); if (is_null($CostRow[0]) OR $CostRow[0]==0){ @@ -299,10 +299,10 @@ if ($_POST['RecdQty'.$i]==0 AND (!isset($_POST['HasWOSerialNos'.$i]) or $_POST['HasWOSerialNos'.$i]==false)){ /* can only change location cost if QtyRecd=0 */ $CostResult = DB_query("SELECT SUM((materialcost+labourcost+overheadcost)*bom.quantity) AS cost - FROM stockmaster INNER JOIN bom - ON stockmaster.stockid=bom.component - WHERE bom.parent='" . $_POST['OutputItem'.$i] . "' - AND bom.loccode='" . $_POST['StockLocation'] . "'", + FROM stockmaster INNER JOIN bom + ON stockmaster.stockid=bom.component + WHERE bom.parent='" . $_POST['OutputItem'.$i] . "' + AND bom.loccode='" . $_POST['StockLocation'] . "'", $db); $CostRow = DB_fetch_row($CostResult); if (is_null($CostRow[0])){ @@ -350,7 +350,7 @@ // can't delete it there are open work issues $HasTransResult = DB_query("SELECT * FROM stockmoves WHERE (stockmoves.type= 26 OR stockmoves.type=28) - AND reference LIKE '%" . $_POST['WO'] . "%'",$db); + AND reference " . LIKE . " '%" . $_POST['WO'] . "%'",$db); if (DB_num_rows($HasTransResult)>0){ prnMsg(_('This work order cannot be deleted because it has issues or receipts related to it'),'error'); $CancelDelete=true; @@ -377,7 +377,7 @@ prnMsg(_('The work order has been deleted'),'success'); - echo "<p><a href='" . $rootpath . "/SelectWorkOrder.php?" . SID . "'>" . _('Select an existing outstanding work order') . "</a>"; + echo '<p><a href="' . $rootpath . '/SelectWorkOrder.php">' . _('Select an existing outstanding work order') . '</a>'; unset($_POST['WO']); for ($i=1;$i<=$_POST['NumberOfOutputs'];$i++){ unset($_POST['OutputItem'.$i]); @@ -394,7 +394,7 @@ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '" name="form">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<br><table class=selection>'; +echo '<br /><table class="selection">'; $sql="SELECT workorders.loccode, requiredby, @@ -441,7 +441,7 @@ } $_POST['Controlled'.$i] =$WOItem['controlled']; $_POST['Serialised'.$i] =$WOItem['serialised']; - $HasWOSerialNosResult = DB_query('SELECT * FROM woserialnos WHERE wo=' . $_POST['WO'],$db); + $HasWOSerialNosResult = DB_query("SELECT * FROM woserialnos WHERE wo='" . $_POST['WO'] . "'",$db); if (DB_num_rows($HasWOSerialNosResult)>0){ $_POST['HasWOSerialNos']=true; } else { @@ -455,7 +455,7 @@ echo '<tr><td class="label">' . _('Work Order Reference') . ':</td><td>' . $_POST['WO'] . '</td></tr>'; echo '<tr><td class="label">' . _('Factory Location') .':</td> <td><select name="StockLocation">'; -$LocResult = DB_query('SELECT loccode,locationname FROM locations',$db); +$LocResult = DB_query("SELECT loccode,locationname FROM locations",$db); while ($LocRow = DB_fetch_array($LocResult)){ if ($_POST['StockLocation']==$LocRow['loccode']){ echo '<option selected value="' . $LocRow['loccode'] .'">' . $LocRow['locationname'] . '</option>'; @@ -521,7 +521,7 @@ } else { $LotOrSN = _('Batches'); } - echo '<td><a href="' . $rootpath . '/WOSerialNos.php?' . SID . '&WO=' . $_POST['WO'] . '&StockID=' . $_POST['OutputItem' .$i] . '&Description=' . $_POST['OutputItemDesc' .$i] . '&Serialised=' . $_POST['Serialised' .$i] . '&NextSerialNo=' . $_POST['NextLotSNRef' .$i] . '">' . $LotOrSN . '</a></td>'; + echo '<td><a href="' . $rootpath . '/WOSerialNos.php?WO=' . $_POST['WO'] . '&StockID=' . $_POST['OutputItem' .$i] . '&Description=' . $_POST['OutputItemDesc' .$i] . '&Serialised=' . $_POST['Serialised' .$i] . '&NextSerialNo=' . $_POST['NextLotSNRef' .$i] . '">' . $LotOrSN . '</a></td>'; } } echo '<td>'; @@ -558,31 +558,31 @@ echo '<table class=selection><tr><td>' . _('Select a stock category') . ':<select name="StockCat">'; if (!isset($_POST['StockCat'])){ - echo '<option selected VALUE="All">' . _('All'); + echo '<option selected VALUE="All">' . _('All') . '</option>'; $_POST['StockCat'] ='All'; } else { - echo '<option VALUE="All">' . _('All'); + echo '<option VALUE="All">' . _('All') . '</option>'; } while ($myrow1 = DB_fetch_array($result1)) { if ($_POST['StockCat']==$myrow1['categoryid']){ - echo '<option selected VALUE=' . $myrow1['categoryid'] . '>' . $myrow1['categorydescription']; + echo '<option selected value=' . $myrow1['categoryid'] . '>' . $myrow1['categorydescription'] . '</option>'; } else { - echo '<option VALUE='. $myrow1['categoryid'] . '>' . $myrow1['categorydescription']; + echo '<option value='. $myrow1['categoryid'] . '>' . $myrow1['categorydescription'] . '</option>'; } } ?> </select> <td><?php echo _('Enter text extracts in the'); ?> <b><?php echo _('description'); ?></b>:</td> -<td><input type="Text" name="Keywords" size=20 maxlength=25 VALUE="<?php if (isset($_POST['Keywords'])) echo $_POST['Keywords']; ?>"></td></tr> +<td><input type="Text" name="Keywords" size=20 maxlength=25 value="<?php if (isset($_POST['Keywords'])) echo $_POST['Keywords']; ?>"></td></tr> <tr><td></td> <td><font SIZE 3><b><?php echo _('OR'); ?> </b></font><?php echo _('Enter extract of the'); ?> <b><?php echo _('Stock Code'); ?></b>:</td> - <td><input type="Text" name="StockCode" size=15 maxlength=18 VALUE="<?php if (isset($_POST['StockCode'])) echo $_POST['StockCode']; ?>"></td> + <td><input type="Text" name="StockCode" size=15 maxlength=18 value="<?php if (isset($_POST['StockCode'])) echo $_POST['StockCode']; ?>"></td> </tr> </table> - <br /><div class="centre"><input type=submit name="Search" VALUE="<?php echo _('Search Now'); ?>"> + <br /><div class="centre"><input type=submit name="Search" value="<?php echo _('Search Now'); ?>"> <?php @@ -636,7 +636,7 @@ $myrow['description'], $myrow['units'], $ImageSource, - $_SERVER['PHP_SELF'] . '?' . SID . 'WO=' . $_POST['WO'] . '&NewItem=' . $myrow['stockid'].'&Line='.$i); + $_SERVER['PHP_SELF'] . '?WO=' . $_POST['WO'] . '&NewItem=' . $myrow['stockid'].'&Line='.$i); $j++; If ($j == 25){ Modified: trunk/WorkOrderIssue.php =================================================================== --- trunk/WorkOrderIssue.php 2011-04-07 10:23:55 UTC (rev 4541) +++ trunk/WorkOrderIssue.php 2011-04-08 23:37:01 UTC (rev 4542) @@ -1,8 +1,6 @@ <?php /* $Id$*/ -//$PageSecurity = 11; - include('includes/session.inc'); $title = _('Issue Materials To Work Order'); include('includes/header.inc'); @@ -15,19 +13,19 @@ $_POST['StockID']=$_GET['StockID']; } -echo '<a href="'. $rootpath . '/SelectWorkOrder.php?' . SID . '">' . _('Back to Work Orders'). '</a><br>'; -echo '<a href="'. $rootpath . '/WorkOrderCosting.php?' . SID . '&WO=' . $_POST['WO'] . '">' . _('Back to Costing'). '</a><br>'; +echo '<a href="'. $rootpath . '/SelectWorkOrder.php">' . _('Back to Work Orders'). '</a><br />'; +echo '<a href="'. $rootpath . '/WorkOrderCosting.php?WO=' . $_POST['WO'] . '">' . _('Back to Costing'). '</a><br />'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/group_add.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p'; -echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (!isset($_POST['WO']) OR !isset($_POST['StockID'])) { /* This page can only be called with a work order number for issuing stock to*/ - echo '<div class="centre"><a href="' . $rootpath . '/SelectWorkOrder.php?' . SID . '">'. + echo '<div class="centre"><a href="' . $rootpath . '/SelectWorkOrder.php">'. _('Select a work order to issue materials to').'</a></div>'; prnMsg(_('This page can only be opened if a work order has been selected. Please select a work order to issue materials to first'),'info'); include ('includes/footer.inc'); @@ -344,16 +342,16 @@ $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' ._('Could not update the work order cost issued to the work order because'); $DbgMsg = _('The following SQL was used to update the work order'); $UpdateWOResult =DB_query("UPDATE workorders - SET costissued=costissued+" . ($QuantityIssued*$IssueItemRow['cost']) . " - WHERE wo='" . $_POST['WO'] . "'", - $db,$ErrMsg,$DbgMsg,true); + SET costissued=costissued+" . ($QuantityIssued*$IssueItemRow['cost']) . " + WHERE wo='" . $_POST['WO'] . "'", + $db,$ErrMsg,$DbgMsg,true); $Result = DB_Txn_Commit($db); prnMsg(_('The issue of') . ' ' . $QuantityIssued . ' ' . _('of') . ' ' . $_POST['IssueItem'] . ' ' . _('against work order') . ' '. $_POST['WO'] . ' ' . _('has been processed'),'info'); - echo '<p><ul><li><a href="' . $rootpath . '/WorkOrderIssue.php?' . SID . '&WO=' . $_POST['WO'] . '&StockID=' . $_POST['StockID'] . '">' . _('Issue more components to this work order') . '</a></li>'; - echo '<li><a href="' . $rootpath . '/SelectWorkOrder.php?' . SID . '">' . _('Select a different work order for issuing materials and components against'). '</a></li></ul>'; + echo '<p><ul><li><a href="' . $rootpath . '/WorkOrderIssue.php?WO=' . $_POST['WO'] . '&StockID=' . $_POST['StockID'] . '">' . _('Issue more components to this work order') . '</a></li>'; + echo '<li><a href="' . $rootpath . '/SelectWorkOrder.php">' . _('Select a different work order for issuing materials and components against'). '</a></li></ul>'; unset($_POST['WO']); unset($_POST['StockID']); unset($_POST['IssueItem']); @@ -474,7 +472,7 @@ prnMsg (_('There are no products available meeting the criteria specified'),'info'); if ($debug==1){ - prnMsg(_('The SQL statement used was') . ':<br>' . $SQL,'info'); + prnMsg(_('The SQL statement used was') . ':<br />' . $SQL,'info'); } } if (DB_num_rows($SearchResult)==1){ @@ -490,25 +488,25 @@ $ErrMsg = _('Could not retrieve the details of the selected work order item'); $WOResult = DB_query("SELECT workorders.loccode, - locations.locationname, - workorders.requiredby, - workorders.startdate, - workorders.closed, - stockmaster.description, - stockmaster.decimalplaces, - stockmaster.units, - woitems.qtyreqd, - woitems.qtyrecd - FROM workorders INNER JOIN locations - ON workorders.loccode=locations.loccode - INNER JOIN woitems - ON workorders.wo=woitems.wo - INNER JOIN stockmaster - ON woitems.stockid=stockmaster.stockid - WHERE woitems.stockid='" . $_POST['StockID'] . "' - AND woitems.wo ='" . $_POST['WO'] . "'", - $db, - $ErrMsg); + locations.locationname, + workorders.requiredby, + workorders.startdate, + workorders.closed, + stockmaster.description, + stockmaster.decimalplaces, + stockmaster.units, + woitems.qtyreqd, + woitems.qtyrecd + FROM workorders INNER JOIN locations + ON workorders.loccode=locations.loccode + INNER JOIN woitems + ON workorders.wo=woitems.wo + INNER JOIN stockmaster + ON woitems.stockid=stockmaster.stockid + WHERE woitems.stockid='" . $_POST['StockID'] . "' + AND woitems.wo ='" . $_POST['WO'] . "'", + $db, + $ErrMsg); if (DB_num_rows($WOResult)==0){ prnMsg(_('The selected work order item cannot be retrieved from the database'),'info'); @@ -527,30 +525,40 @@ $_POST['IssuedDate'] = Date($_SESSION['DefaultDateFormat']); } echo '<table cellpadding=2 class=selection> - <tr><td class="label">' . _('Issue to work order') . ':</td><td>' . $_POST['WO'] .'</td><td class="label">' . _('Item') . ':</td><td>' . $_POST['StockID'] . ' - ' . $WORow['description'] . '</td></tr> - <tr><td class="label">' . _('Manufactured at') . ':</td><td>' . $WORow['locationname'] . '</td><td class="label">' . _('Required By') . ':</td><td>' . ConvertSQLDate($WORow['requiredby']) . '</td></tr> - <tr><td class="label">' . _('Quantity Ordered') . ':</td><td class=number>' . number_format($WORow['qtyreqd'],$WORow['decimalplaces']) . '</td><td colspan=2>' . $WORow['units'] . '</td></tr> - <tr><td class="label">' . _('Already Received') . ':</td><td class=number>' . number_format($WORow['qtyrecd'],$WORow['decimalplaces']) . '</td><td colspan=2>' . $WORow['units'] . '</td></tr> + <tr><td class="label">' . _('Issue to work order') . ':</td> + <td>' . $_POST['WO'] .'</td><td class="label">' . _('Item') . ':</td> + <td>' . $_POST['StockID'] . ' - ' . $WORow['description'] . '</td> + </tr> + <tr><td class="label">' . _('Manufactured at') . ':</td> + <td>' . $WORow['locationname'] . '</td><td class="label">' . _('Required By') . ':</td> + <td>' . ConvertSQLDate($WORow['requiredby']) . '</td> + </tr> + <tr><td class="label">' . _('Quantity Ordered') . ':</td> + <td class="number">' . number_format($WORow['qtyreqd'],$WORow['decimalplaces']) . '</td> + <td colspan="2">' . $WORow['units'] . '</td> + </tr> + <tr><td class="label">' . _('Already Received') . ':</td> + <td class="number">' . number_format($WORow['qtyrecd'],$WORow['decimalplaces']) . '</td> + <td colspan="2">' . $WORow['units'] . '</td></tr> <tr><td colspan=4></td></tr> - <tr><td class="label">' . _('Date Material Issued') . ':</td><td><input type=text name=issuedate value=' - . Date($_SESSION['DefaultDateFormat']) . ' class=date size=10 alt="'.$_SESSION['DefaultDateFormat'].'" ></td> - <td class="label">' . _('Issued From') . ':</td><td>'; + <tr><td class="label">' . _('Date Material Issued') . ':</td> + <td><input type=text name=issuedate value=' . Date($_SESSION['DefaultDateFormat']) . ' class=date size=10 alt="'.$_SESSION['DefaultDateFormat'].'" ></td> + <td class="label">' . _('Issued From') . ':</td><td>'; if (!isset($_POST['IssueItem'])){ - $LocResult = DB_query('SELECT loccode, locationname FROM locations',$db); + $LocResult = DB_query("SELECT loccode, locationname FROM locations",$db); echo '<select name="FromLocation">'; - if (!isset($_POST['FromLocation'])){ $_POST['FromLocation']=$WORow['loccode']; } while ($LocRow = DB_fetch_array($LocResult)){ if ($_POST['FromLocation'] ==$LocRow['loccode']){ - echo '<option selected value="' . $LocRow['loccode'] .'">' . $LocRow['locationname']; + echo '<option selected value="' . $LocRow['loccode'] .'">' . $LocRow['locationname'] . '</option>'; } else { - echo '<option value="' . $LocRow['loccode'] .'">' . $LocRow['locationname']; + echo '<option value="' . $LocRow['loccode'] .'">' . $LocRow['locationname'] . '</option>'; } } echo '</select>'; @@ -576,27 +584,27 @@ <th>' . _('Qty Issued') . '</th></tr>'; $RequirmentsResult = DB_query("SELECT worequirements.stockid, - stockmaster.description, - stockmaster.decimalplaces, - autoissue, - qtypu - FROM worequirements INNER JOIN stockmaster - ON worequirements.stockid=stockmaster.stockid - WHERE wo='" . $_POST['WO'] . "'", - $db); + stockmaster.description, + stockmaster.decimalplaces, + autoissue, + qtypu + FROM worequirements INNER JOIN stockmaster + ON worequirements.stockid=stockmaster.stockid + WHERE wo='" . $_POST['WO'] . "'", + $db); while ($RequirementsRow = DB_fetch_array($RequirmentsResult)){ if ($RequirementsRow['autoissue']==0){ echo '<tr><td><input type="submit" name="IssueItem" value="' .$RequirementsRow['stockid'] . '"></td> - <td>' . $RequirementsRow['stockid'] . ' - ' . $RequirementsRow['description'] . '</td>'; + <td>' . $RequirementsRow['stockid'] . ' - ' . $RequirementsRow['description'] . '</td>'; } else { echo '<tr><td class="notavailable">' . _('Auto Issue') . '<td class="notavailable">' .$RequirementsRow['stockid'] . ' - ' . $RequirementsRow['description'] .'</td>'; } $IssuedAlreadyResult = DB_query("SELECT SUM(-qty) FROM stockmoves - WHERE stockmoves.type=28 - AND stockid='" . $RequirementsRow['stockid'] . "' - AND reference='" . $_POST['WO'] . "'", - $db); + WHERE stockmoves.type=28 + AND stockid='" . $RequirementsRow['stockid'] . "' + AND reference='" . $_POST['WO'] . "'", + $db); $IssuedAlreadyRow = DB_fetch_row($IssuedAlreadyResult); echo '<td class=number>' . number_format($WORow['qtyreqd']*$RequirementsRow['qtypu'],$RequirementsRow['decimalplaces']) . '</td> @@ -615,31 +623,31 @@ echo '<table class=selection><tr><td>' . _('Select a stock category') . ':<select name="StockCat">'; if (!isset($_POST['StockCat'])){ - echo "<option selected VALUE='All'>" . _('All') . '</option>'; + echo '<option selected value="All">' . _('All') . '</option>'; $_POST['StockCat'] ='All'; } else { - echo "<option VALUE='All'>" . _('All') . '</option>'; + echo '<option value="All">' . _('All') . '</option>'; } while ($myrow1 = DB_fetch_array($result1)) { if ($_POST['StockCat']==$myrow1['categoryid']){ - echo '<option selected VALUE=' . $myrow1['categoryid'] . '>' . $myrow1['categorydescription']; + echo '<option selected value=' . $myrow1['categoryid'] . '>' . $myrow1['categorydescription'] . '</option>'; } else { - echo '<option VALUE='. $myrow1['categoryid'] . '>' . $myrow1['categorydescription']; + echo '<option value='. $myrow1['categoryid'] . '>' . $myrow1['categorydescription'] . '</option>'; } } ?> </select> <td><?php echo _('Enter text extracts in the'); ?> <b><?php echo _('description'); ?></b>:</td> - <td><input type="Text" name="Keywords" size=20 maxlength=25 VALUE="<?php if (isset($_POST['Keywords'])) echo $_POST['Keywords']; ?>"></td></tr> + <td><input type="Text" name="Keywords" size=20 maxlength=25 value="<?php if (isset($_POST['Keywords'])) echo $_POST['Keywords']; ?>"></td></tr> <tr><td></td> <td><font SIZE 3><b><?php echo _('OR'); ?> </b></font><?php echo _('Enter extract of the'); ?> <b><?php echo _('Stock Code'); ?></b>:</td> - <td><input type="Text" name="StockCode" size="15" maxlength="18" VALUE="<?php if (isset($_POST['StockCode'])) echo $_POST['StockCode']; ?>"></td> + <td><input type="Text" name="StockCode" size="15" maxlength="18" value="<?php if (isset($_POST['StockCode'])) echo $_POST['StockCode']; ?>"></td> </tr> </table> - <br /><div class="centre"><input type=submit name="Search" VALUE="<?php echo _('Search Now'); ?>"> + <br /><div class="centre"><input type=submit name="Search" value="<?php echo _('Search Now'); ?>"> <script language='JavaScript' type='text/javascript'> @@ -668,7 +676,7 @@ if (!in_array($myrow['stockid'],$ItemCodes)){ if (function_exists('imagecreatefrompng') ){ - $ImageSource = '<IMG SRC="GetStockImage.php?SID&automake=1&textcolor=FFFFFF&bgcolor=CCCCCC&StockID=' . urlencode($myrow['stockid']). '&text=&width=64&height=64">'; + $ImageSource = '<IMG SRC="GetStockImage.php?automake=1&textcolor=FFFFFF&bgcolor=CCCCCC&StockID=' . urlencode($myrow['stockid']). '&text=&width=64&height=64">'; } else { if(file_exists($_SERVER['DOCUMENT_ROOT'] . $rootpath. '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg')) { $ImageSource = '<IMG SRC="' .$_SERVER['DOCUMENT_ROOT'] . $rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg">'; @@ -685,7 +693,7 @@ $k=1; } - $IssueLink = $_SERVER['PHP_SELF'] . '?' . SID . '&WO=' . $_POST['WO'] . '&StockID=' . $_POST['StockID'] . '&IssueItem=' . $myrow['stockid'] . '&FromLocation=' . $_POST['FromLocation']; + $IssueLink = $_SERVER['PHP_SELF'] . '?WO=' . $_POST['WO'] . '&StockID=' . $_POST['StockID'] . '&IssueItem=' . $myrow['stockid'] . '&FromLocation=' . $_POST['FromLocation']; printf("<td><font size=1>%s</font></td> <td><font size=1>%s</font></td> <td><font size=1>%s</font></td> @@ -739,9 +747,9 @@ $SerialNoResult = DB_query("SELECT serialno - FROM stockserialitems - WHERE stockid='" . $_POST['IssueItem'] . "' - AND loccode='" . $_POST['FromLocation'] . "'", + FROM stockserialitems + WHERE stockid='" . $_POST['IssueItem'] . "' + AND loccode='" . $_POST['FromLocation'] . "'", $db,_('Could not retrieve the serial numbers available at the location specified because')); if (DB_num_rows($SerialNoResult)==0){ echo '<tr><td>' . _('There are no serial numbers at this location to issue') . '</td></tr>'; Modified: trunk/WorkOrderReceive.php =================================================================== --- trunk/WorkOrderReceive.php 2011-04-07 10:23:55 UTC (rev 4541) +++ trunk/WorkOrderReceive.php 2011-04-08 23:37:01 UTC (rev 4542) @@ -1,25 +1,23 @@ <?php /* $Id$*/ -//$PageSecurity = 11; - include('includes/session.inc'); $title = _('Receive Work Order'); include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); -echo '<a href="'. $rootpath . '/SelectWorkOrder.php?' . SID . '">' . _('Back to Work Orders'). '</a><br>'; -echo '<a href="'. $rootpath . '/WorkOrderCosting.php?' . SID . '&WO=' . $_REQUEST['WO'] . '">' . _('Back to Costing'). '</a><br>'; +echo '<a href="'. $rootpath . '/SelectWorkOrder.php">' . _('Back to Work Orders'). '</a><br>'; +echo '<a href="'. $rootpath . '/WorkOrderCosting.php?WO=' . $_REQUEST['WO'] . '">' . _('Back to Costing'). '</a><br>'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/group_add.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p'; -echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" n... [truncated message content] |
From: <dai...@us...> - 2011-04-09 06:12:14
|
Revision: 4543 http://web-erp.svn.sourceforge.net/web-erp/?rev=4543&view=rev Author: daintree Date: 2011-04-09 06:12:05 +0000 (Sat, 09 Apr 2011) Log Message: ----------- SQL and xhtml quoting Modified Paths: -------------- trunk/ShipmentCosting.php trunk/Z_CreateCompanyTemplateFile.php trunk/Z_CurrencyDebtorsBalances.php trunk/Z_CurrencySuppliersBalances.php trunk/Z_DataExport.php trunk/Z_DeleteCreditNote.php trunk/Z_DeleteInvoice.php trunk/Z_ImportFixedAssets.php trunk/Z_ImportGLAccountGroups.php trunk/Z_ImportGLAccountSections.php trunk/Z_ImportPartCodes.php trunk/Z_MakeStockLocns.php trunk/Z_PriceChanges.php trunk/Z_ReApplyCostToSA.php trunk/Z_RePostGLFromPeriod.php trunk/Z_ReverseSuppPaymentRun.php trunk/Z_SalesIntegrityCheck.php trunk/Z_UpdateChartDetailsBFwd.php trunk/api/api_debtortransactions.php trunk/api/api_glgroups.php trunk/api/api_glsections.php trunk/api/api_locations.php trunk/api/api_login.php trunk/api/api_purchdata.php trunk/api/api_salestypes.php trunk/api/api_stockcategories.php trunk/includes/SQL_CommonFunctions.inc Modified: trunk/ShipmentCosting.php =================================================================== --- trunk/ShipmentCosting.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/ShipmentCosting.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -321,8 +321,9 @@ if ($TotalQuantityOnHand>0) { $CostIncrement = ($myrow['totqtyinvoiced'] *($ItemShipmentCost - $StdCostUnit) - $WriteOffToVariances) / $TotalQuantityOnHand; - $sql = 'UPDATE stockmaster SET lastcost=materialcost+overheadcost+labourcost, - materialcost=materialcost+' . $CostIncrement . " WHERE stockid='" . $myrow['itemcode'] . "'"; + $sql = "UPDATE stockmaster SET lastcost=materialcost+overheadcost+labourcost, + materialcost=materialcost+" . $CostIncrement . " + WHERE stockid='" . $myrow['itemcode'] . "'"; $Result = DB_query($sql, $db, $ErrMsg, $DbgMsg,'',TRUE); } else { $sql = "UPDATE stockmaster SET lastcost=materialcost+overheadcost+labourcost, @@ -385,7 +386,7 @@ if ($_SESSION['CompanyRecord']['gllink_stock']==1){ $CostUpdateNo = GetNextTransNo(35, $db); - $PeriodNo = GetPeriod(Date("d/m/Y"), $db); + $PeriodNo = GetPeriod(Date('d/m/Y'), $db); $ValueOfChange = $QOH * ($ItemShipmentCost - $StdCostUnit); Modified: trunk/Z_CreateCompanyTemplateFile.php =================================================================== --- trunk/Z_CreateCompanyTemplateFile.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_CreateCompanyTemplateFile.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -1,8 +1,6 @@ <?php /* $Id$*/ -//$PageSecurity =15; - include ('includes/session.inc'); $title = _('Create Database Template File'); include ('includes/header.inc'); @@ -15,20 +13,20 @@ } if ($InputError==false){ - $CurrResult = DB_query( 'SELECT currabrev, - currency, - country, - debtorsact, - creditorsact, - payrollact, - grnact, - exchangediffact, - purchasesexchangediffact, - retainedearnings, - freightact - FROM currencies INNER JOIN companies - ON companies.currencydefault=currencies.currabrev - WHERE coycode=1',$db); + $CurrResult = DB_query( "SELECT currabrev, + currency, + country, + debtorsact, + creditorsact, + payrollact, + grnact, + exchangediffact, + purchasesexchangediffact, + retainedearnings, + freightact + FROM currencies INNER JOIN companies + ON companies.currencydefault=currencies.currabrev + WHERE coycode='1'",$db); $CurrRow = DB_fetch_array($CurrResult); @@ -46,7 +44,7 @@ purchasesexchangediffact=" . $CurrRow['purchasesexchangediffact'] . ", retainedearnings=" . $CurrRow['retainedearnings'] . ", freightact=" . $CurrRow['freightact'] . " - WHERE coycode=1;\n"; + WHERE coycode='1';\n"; /*empty out any existing records in chartmaster, @@ -67,12 +65,12 @@ $SQLScript .= "TRUNCATE TABLE taxcategories;\n"; $SQLScript .= "TRUNCATE TABLE taxprovinces;\n"; - $GroupsResult = DB_query('SELECT groupname, - sectioninaccounts, - pandl, - sequenceintb, - parentgroupname - FROM accountgroups',$db); + $GroupsResult = DB_query("SELECT groupname, + sectioninaccounts, + pandl, + sequenceintb, + parentgroupname + FROM accountgroups",$db); while ($GroupRow = DB_fetch_array($GroupsResult)){ $SQLScript .= "INSERT INTO accountgroups (groupname,sectioninaccounts,pandl, sequenceintb, parentgroupname) @@ -83,13 +81,15 @@ '" . $GroupRow['parentgroupname'] . "');\n"; } - $ChartResult = DB_query('SELECT accountcode, accountname, group_ FROM chartmaster',$db); + $ChartResult = DB_query("SELECT accountcode, accountname, group_ FROM chartmaster",$db); $i=0; while ($ChartRow = DB_fetch_array($ChartResult)){ if ($_POST['IncludeAccount_' .$i]=='on'){ $SQLScript .= "INSERT INTO chartmaster (accountcode,accountname,group_) - VALUES (" . $ChartRow['accountcode'] . ", '" . $ChartRow['accountname'] . "', '" . $ChartRow['group_'] . "');\n"; + VALUES ('" . $ChartRow['accountcode'] . "', + '" . $ChartRow['accountname'] . "', + '" . $ChartRow['group_'] . "');\n"; } $i++; } @@ -98,14 +98,14 @@ /*Tax Authorities table */ $TaxAuthoritiesResult = DB_query("SELECT taxid, - description, - taxglcode, - purchtaxglaccount, - bank, - bankacctype, - bankacc, - bankswift - FROM taxauthorities",$db); + description, + taxglcode, + purchtaxglaccount, + bank, + bankacctype, + bankacc, + bankswift + FROM taxauthorities",$db); while ($TaxAuthoritiesRow = DB_fetch_array($TaxAuthoritiesResult)){ $SQLScript .= "INSERT INTO taxauthorities (taxid, @@ -127,11 +127,11 @@ } /*taxauthrates table */ - $TaxAuthRatesResult = DB_query('SELECT taxauthority, - dispatchtaxprovince, - taxcatid, - taxrate - FROM taxauthrates',$db); + $TaxAuthRatesResult = DB_query("SELECT taxauthority, + dispatchtaxprovince, + taxcatid, + taxrate + FROM taxauthrates",$db); while ($TaxAuthRatesRow = DB_fetch_array($TaxAuthRatesResult)){ $SQLScript .= "INSERT INTO taxauthrates (taxauthority, @@ -145,20 +145,20 @@ } /*taxgroups table */ - $TaxGroupsResult = DB_query('SELECT taxgroupid, - taxgroupdescription - FROM taxgroups',$db); + $TaxGroupsResult = DB_query("SELECT taxgroupid, + taxgroupdescription + FROM taxgroups",$db); while ($TaxGroupsRow = DB_fetch_array($TaxGroupsResult)){ $SQLScript .= "INSERT INTO taxgroups (taxgroupid, taxgroupdescription) - VALUES (" . $TaxGroupsRow['taxgroupid'] . ", + VALUES ('" . $TaxGroupsRow['taxgroupid'] . "', '" . $TaxGroupsRow['taxgroupdescription'] . "');\n"; } /*tax categories table */ - $TaxCategoriesResult = DB_query('SELECT taxcatid, - taxcatname - FROM taxcategories',$db); + $TaxCategoriesResult = DB_query("SELECT taxcatid, + taxcatname + FROM taxcategories",$db); while ($TaxCategoriesRow = DB_fetch_array($TaxCategoriesResult)){ $SQLScript .= "INSERT INTO taxcategories (taxcatid, @@ -167,9 +167,9 @@ '" . $TaxCategoriesRow['taxcatname'] . "');\n"; } /*tax provinces table */ - $TaxProvincesResult = DB_query('SELECT taxprovinceid, - taxprovincename - FROM taxprovinces',$db); + $TaxProvincesResult = DB_query("SELECT taxprovinceid, + taxprovincename + FROM taxprovinces",$db); while ($TaxProvincesRow = DB_fetch_array($TaxProvincesResult)){ $SQLScript .= "INSERT INTO taxprovinces (taxprovinceid, @@ -178,11 +178,11 @@ '" . $TaxProvincesRow['taxprovincename'] . "');\n"; } /*taxgroup taxes table */ - $TaxGroupTaxesResult = DB_query('SELECT taxgroupid, - taxauthid, - calculationorder, - taxontax - FROM taxgrouptaxes',$db); + $TaxGroupTaxesResult = DB_query("SELECT taxgroupid, + taxauthid, + calculationorder, + taxontax + FROM taxgrouptaxes",$db); while ($TaxGroupTaxesRow = DB_fetch_array($TaxGroupTaxesResult)){ $SQLScript .= "INSERT INTO taxgrouptaxes (taxgroupid, @@ -194,7 +194,7 @@ " . $TaxGroupTaxesRow['calculationorder'] . ", " . $TaxGroupTaxesRow['taxontax'] . ");\n"; } - $SQLScript .= 'SET FOREIGN_KEY_CHECKS=1;'; + $SQLScript .= "SET FOREIGN_KEY_CHECKS=1;"; /*Now write $SQLScript to a file */ $FileHandle = fopen("./companies/" . $_SESSION['DatabaseName'] . "/reports/" . $_POST['TemplateName'] .".sql","w"); fwrite ($FileHandle, $SQLScript); @@ -225,10 +225,10 @@ echo '<table>'; /*Show the chart of accounts to be exported for deslection of company specific ones */ -$ChartResult = DB_query('SELECT accountcode, accountname, group_ FROM chartmaster',$db); +$ChartResult = DB_query("SELECT accountcode, accountname, group_ FROM chartmaster",$db); $TableHeadings = '<tr><th>' . _('Account Code') . '</th> - <th>' . _('Account Name') . '</th></tr>'; + <th>' . _('Account Name') . '</th></tr>'; $i = 0; while ($ChartRow = DB_fetch_array($ChartResult)){ echo '<tr><td>' . $ChartRow['accountcode'] . '</td> Modified: trunk/Z_CurrencyDebtorsBalances.php =================================================================== --- trunk/Z_CurrencyDebtorsBalances.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_CurrencyDebtorsBalances.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -1,6 +1,5 @@ <?php /* $Id$*/ -//$PageSecurity=15; include('includes/session.inc'); $title=_('Currency Debtor Balances'); @@ -8,12 +7,12 @@ echo '<font size=4><b>' . _('Debtors Balances By Currency Totals') . '</b></font>'; -$sql = 'SELECT SUM(ovamount+ovgst+ovdiscount+ovfreight-alloc) AS currencybalance, +$sql = "SELECT SUM(ovamount+ovgst+ovdiscount+ovfreight-alloc) AS currencybalance, currcode, SUM((ovamount+ovgst+ovdiscount+ovfreight-alloc)/rate) AS localbalance FROM debtortrans INNER JOIN debtorsmaster ON debtortrans.debtorno=debtorsmaster.debtorno - WHERE (ovamount+ovgst+ovdiscount+ovfreight-alloc)<>0 GROUP BY currcode'; + WHERE (ovamount+ovgst+ovdiscount+ovfreight-alloc)<>0 GROUP BY currcode"; $result = DB_query($sql,$db); Modified: trunk/Z_CurrencySuppliersBalances.php =================================================================== --- trunk/Z_CurrencySuppliersBalances.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_CurrencySuppliersBalances.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -1,6 +1,5 @@ <?php /* $Id$*/ -//$PageSecurity=15; include('includes/session.inc'); $title=_('Currency Debtor Balances'); @@ -8,11 +7,11 @@ echo '<font size=4><b>' . _('Suppliers Balances By Currency Totals') . '</b></font>'; -$sql = 'SELECT SUM(ovamount+ovgst-alloc) AS currencybalance, +$sql = "SELECT SUM(ovamount+ovgst-alloc) AS currencybalance, currcode, SUM((ovamount+ovgst-alloc)/rate) AS localbalance FROM supptrans INNER JOIN suppliers ON supptrans.supplierno=suppliers.supplierid - WHERE (ovamount+ovgst-alloc)<>0 GROUP BY currcode'; + WHERE (ovamount+ovgst-alloc)<>0 GROUP BY currcode"; $result = DB_query($sql,$db); Modified: trunk/Z_DataExport.php =================================================================== --- trunk/Z_DataExport.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_DataExport.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -2,7 +2,6 @@ /* $Id$*/ -//$PageSecurity=15; include('includes/session.inc'); @@ -70,9 +69,9 @@ $title = _('Price List Export Problem ....'); include('includes/header.inc'); prnMsg( _('The Price List 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; @@ -166,9 +165,9 @@ $title = _('Customer List Export Problem ....'); include('includes/header.inc'); prnMsg( _('The Customer List 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; @@ -257,9 +256,9 @@ $title = _('Salesman List Export Problem ....'); include('includes/header.inc'); prnMsg( _('The Salesman List 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; @@ -306,9 +305,9 @@ $title = _('Security Token List Export Problem ....'); include('includes/header.inc'); prnMsg( _('The Image List 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; @@ -345,9 +344,9 @@ $title = _('Security Token List Export Problem ....'); include('includes/header.inc'); prnMsg( _('The Security Token List 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; @@ -381,9 +380,9 @@ $title = _('Security Role List Export Problem ....'); include('includes/header.inc'); prnMsg( _('The Security Role List 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; @@ -417,9 +416,9 @@ $title = _('Security Group List Export Problem ....'); include('includes/header.inc'); prnMsg( _('The Security Group List 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; @@ -469,9 +468,9 @@ $title = _('Security User List Export Problem ....'); include('includes/header.inc'); prnMsg( _('The Security User List 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; @@ -532,8 +531,8 @@ // SELECT EXPORT FOR PRICE LIST - echo "<br>"; - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . "?" . SID . ">"; + echo '<br />'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table>'; echo '<tr><th colspan=2>' . _('Price List Export') . '</th></tr>'; @@ -554,16 +553,16 @@ echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; } echo '</select></td></tr>'; - echo "</table>"; + echo '</table>'; echo "<div class='centre'><input type='Submit' name='pricelist' value='" . _('Export') . "'></div>"; - echo "</form><br>"; + echo '</form><br />'; // SELECT EXPORT FOR CUSTOMER LIST - echo "<br>"; + echo "<br />"; // Export Stock For Location - 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>'; echo '<tr><th colspan=2>' . _('Customer List Export') . '</th></tr>'; @@ -576,66 +575,66 @@ echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; } echo '</select></td></tr>'; - echo "</table>"; + echo '</table>'; echo "<div class='centre'><input type='Submit' name='custlist' value='" . _('Export') . "'></div>"; - echo "</form><br>"; + echo '</form><br />'; // SELECT EXPORT FOR SALES MAN - echo "<br>"; + echo "<br />"; // Export Stock For Location - 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>'; echo '<tr><th colspan=2>' . _('Salesman List Export') . '</th></tr>'; - echo "</table>"; + echo '</table>'; echo "<div class='centre'><div class='centre'><input type='Submit' name='salesmanlist' value='" . _('Export') . "'></div>"; - echo "</form><br>"; + echo '</form><br />'; // SELECT EXPORT FOR IMAGES - 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>'; echo '<tr><th colspan=2>' . _('Image List Export') . '</th></tr>'; - echo "</table>"; + echo '</table>'; echo "<div class='centre'><input type='Submit' name='imagelist' value='" . _('Export') . "'></div>"; - echo "</form><br>"; + echo '</form><br />'; // SELECT EXPORT SECURITY TOKENS - 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>'; echo '<tr><th colspan=2>' . _('Security Token List Export') . '</th></tr>'; - echo "</table>"; + echo '</table>'; echo "<div class='centre'><input type='Submit' name='sectokenlist' value='" . _('Export') . "'></div>"; - echo "</form><br>"; + echo '</form><br />'; // SELECT EXPORT SECURITY ROLES - 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>'; echo '<tr><th colspan=2>' . _('Security Role List Export') . '</th></tr>'; - echo "</table>"; + echo '</table>'; echo "<div class='centre'><input type='Submit' name='secrolelist' value='" . _('Export') . "'></div>"; - echo "</form><br>"; + echo '</form><br />'; // SELECT EXPORT SECURITY GROUPS - 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>'; echo '<tr><th colspan=2>' . _('Security Group List Export') . '</th></tr>'; - echo "</table>"; + echo '</table>'; echo "<div class='centre'><input type='Submit' name='secgrouplist' value='" . _('Export') . "'></div>"; - echo "</form><br>"; + echo '</form><br />'; // SELECT EXPORT SECURITY USERS - 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>'; echo '<tr><th colspan=2>' . _('Security User List Export') . '</th></tr>'; - echo "</table>"; - echo "<div class='centre'><input type='Submit' name='secuserlist' value='" . _('Export') . "'></div>"; - echo "</form><br>"; + echo '</table>'; + echo '<div class="centre"><input type="Submit" name="secuserlist" value="' . _('Export') . '"></div>'; + echo '</form><br />'; include('includes/footer.inc'); Modified: trunk/Z_DeleteCreditNote.php =================================================================== --- trunk/Z_DeleteCreditNote.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_DeleteCreditNote.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -5,11 +5,12 @@ /* Script to delete a credit note - it expects and credit note number to delete not included on any menu for obvious reasons +STRONGLY RECOMMEND NOT USING THIS - RE INVOICE INSTEAD + must be called directly with path/DeleteCreditnote.php?CreditNoteNo=??????? !! */ -//$PageSecurity=15; include ('includes/session.inc'); $title = _('Delete Credit Note'); @@ -21,7 +22,7 @@ } /*get the order number that was credited */ -$SQL = 'SELECT order_ FROM debtortrans WHERE transno=' . $_GET['CreditNoteNo'] . ' AND type=11'; +$SQL = "SELECT order_ FROM debtortrans WHERE transno='" . $_GET['CreditNoteNo'] . "' AND type='11'"; $Result = DB_query($SQL, $db); $myrow = DB_fetch_row($Result); @@ -29,14 +30,14 @@ /*Now get the stock movements that were credited into an array */ -$SQL = 'SELECT stockid, - loccode, - debtorno, - branchcode, - prd, - qty - FROM stockmoves - WHERE transno =' .$_GET['CreditNoteNo'] . ' AND type=11'; +$SQL = "SELECT stockid, + loccode, + debtorno, + branchcode, + prd, + qty + FROM stockmoves + WHERE transno ='" .$_GET['CreditNoteNo'] . "' AND type='11'"; $Result = DB_query($SQL,$db); $i=0; @@ -72,8 +73,8 @@ /*reverse the update to LocStock */ $SQL = "UPDATE locstock SET locstock.quantity = locstock.quantity + " . $CreditLine['qty'] . " - WHERE locstock.stockid = '" . $CreditLine['stockid'] . "' - AND loccode = '" . $CreditLine['loccode'] . "'"; + WHERE locstock.stockid = '" . $CreditLine['stockid'] . "' + AND loccode = '" . $CreditLine['loccode'] . "'"; $ErrMsg = _('SQL to reverse update to the location stock records failed with the error'); @@ -100,7 +101,7 @@ $ErrMsg = _('SQL to delete the stock movement record failed with the message'); $Result = DB_query($SQL, $db,$ErrMsg,$DbgMsg,true); prnMsg(_('Deleted the credit note stock movements').'info'); -echo '<br><br>'; +echo '<br /><br />'; $result = DB_Txn_Commit($db); prnMsg(_('Credit note number') . ' ' . $_GET['CreditNoteNo'] . ' ' . _('has been completely deleted') . '. ' . _('To ensure the integrity of the general ledger transactions must be reposted from the period the credit note was created'),'info'); Modified: trunk/Z_DeleteInvoice.php =================================================================== --- trunk/Z_DeleteInvoice.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_DeleteInvoice.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -4,9 +4,12 @@ /* Script to delete an invoice expects and invoice number to delete not included on any menu for obvious reasons +* +* STRONGLY RECOMMEND NOT USING THIS -CREDIT THE INVOICE AND RE INVOICE +* * +* This page must be called directly using path/Z_DeleteInvoice.php?InvoiceNo=????? !! */ -//$PageSecurity=15; include ('includes/session.inc'); $title = _('Delete Invoice'); @@ -19,9 +22,10 @@ } /*Get the order number that was invoiced */ -$SQL = 'SELECT order_ - FROM debtortrans - WHERE debtortrans.type = 10 and transno = ' . $_GET['InvoiceNo']; +$SQL = "SELECT order_ + FROM debtortrans + WHERE debtortrans.type = 10 + AND transno = '" . $_GET['InvoiceNo'] . "'"; $Result = DB_query($SQL,$db); $myrow = DB_fetch_row($Result); @@ -40,7 +44,7 @@ // mbflag // We now use fully qualified column names -$SQL = 'SELECT stockmoves.stockid, +$SQL = "SELECT stockmoves.stockid, stockmoves.loccode, stockmoves.debtorno, stockmoves.branchcode, @@ -49,7 +53,7 @@ stockmaster.mbflag FROM stockmoves INNER JOIN stockmaster ON stockmoves.stockid = stockmaster.stockid - WHERE transno =' .$_GET['InvoiceNo'] . ' AND type=10'; + WHERE transno ='" .$_GET['InvoiceNo'] . "' AND type=10"; $Result = DB_query($SQL,$db); @@ -77,9 +81,9 @@ /*Now delete the DebtorTrans */ -$SQL = 'DELETE FROM debtortrans - WHERE transno =' . $_GET['InvoiceNo'] . ' - AND debtortrans.type=10'; +$SQL = "DELETE FROM debtortrans + WHERE transno ='" . $_GET['InvoiceNo'] . "' + AND debtortrans.type=10"; $DbgMsg = _('The SQL that failed was'); $ErrMsg = _('The debtorTrans record could not be deleted') . ' - ' . _('the sql server returned the following error'); $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); Modified: trunk/Z_ImportFixedAssets.php =================================================================== --- trunk/Z_ImportFixedAssets.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_ImportFixedAssets.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -2,7 +2,6 @@ /* $Id: $*/ /* Script to import fixed assets into a specified period*/ -//$PageSecurity = 15; include('includes/session.inc'); $title = _('Import Fixed Assets'); include('includes/header.inc'); @@ -122,57 +121,57 @@ if (strlen($Description)==0 OR strlen($Description)>50){ prnMsg('The description of the asset is expected to be more than 3 characters long and less than 50 characters long','error'); - echo '<br>' . _('Row:') . $Row . ' - ' . _('Invalid Description:') . ' ' . $Description; + echo '<br />' . _('Row:') . $Row . ' - ' . _('Invalid Description:') . ' ' . $Description; $InputError=true; } if (!is_numeric($DepnRate)){ prnMsg(_('The depreciation rate is expected to be numeric'),'error'); - echo '<br>' . _('Row:') . $Row . ' - ' . _('Invalid Depreciation Rate:') . ' ' . $DepnRate; + echo '<br />' . _('Row:') . $Row . ' - ' . _('Invalid Depreciation Rate:') . ' ' . $DepnRate; $InputError=true; }elseif ($DepnRate<0 OR $DepnRate>100){ prnMsg(_('The depreciation rate is expected to be a number between 0 and 100'),'error'); - echo '<br>' . _('Row:') . $Row . ' - ' ._('Invalid Depreciation Rate:') . ' ' . $DepnRate; + echo '<br />' . _('Row:') . $Row . ' - ' ._('Invalid Depreciation Rate:') . ' ' . $DepnRate; $InputError=true; } if (!is_numeric($AccumDepn)){ prnMsg(_('The accumulated depreciation is expected to be numeric'),'error'); - echo '<br>' . _('Row:') . $Row . ' - ' . _('Invalid Accumulated Depreciation:') . ' ' . $AccumDepn; + echo '<br />' . _('Row:') . $Row . ' - ' . _('Invalid Accumulated Depreciation:') . ' ' . $AccumDepn; $InputError=true; } elseif ($AccumDepn<0){ prnMsg(_('The accumulated depreciation is expected to be either zero or a positive number'),'error'); - echo '<br>' . _('Row:') . $Row . ' - ' . _('Invalid Accumulated Depreciation:') . ' ' . $AccumDepn; + echo '<br />' . _('Row:') . $Row . ' - ' . _('Invalid Accumulated Depreciation:') . ' ' . $AccumDepn; $InputError=true; } if (!is_numeric($Cost)){ prnMsg(_('The cost is expected to be numeric'),'error'); - echo '<br>' . _('Row:') . $Row . ' - ' . _('Invalid Cost:') . ' ' . $Cost; + echo '<br />' . _('Row:') . $Row . ' - ' . _('Invalid Cost:') . ' ' . $Cost; $InputError=true; } elseif ($Cost<=0){ prnMsg(_('The cost is expected to be a positive number'),'error'); - echo '<br>' . _('Row:') . $Row . ' - ' . _('Invalid Cost:') . ' ' . $AccumDepn; + echo '<br />' . _('Row:') . $Row . ' - ' . _('Invalid Cost:') . ' ' . $AccumDepn; $InputError=true; } if ($DepnType !='SL' AND $DepnType!='DV'){ prnMsg(_('The depreciation type must be either "SL" - Straight Line or "DV" - Diminishing Value'),'error'); - echo '<br>' . _('Row:') . $Row . ' - ' . _('Invalid depreciation type:') . ' ' . $DepnType; + echo '<br />' . _('Row:') . $Row . ' - ' . _('Invalid depreciation type:') . ' ' . $DepnType; $InputError = true; } - $result = DB_query('SELECT categoryid FROM fixedassetcategories WHERE categoryid="' . $AssetCategoryID . '"', $db); + $result = DB_query("SELECT categoryid FROM fixedassetcategories WHERE categoryid='" . $AssetCategoryID . "'", $db); if (DB_num_rows($result)==0){ $InputError = true; prnMsg(_('The asset category code entered must be exist in the assetcategories table'),'error'); - echo '<br>' . _('Row:') . $Row . ' - ' . _('Invalid asset category:') . ' ' . $AssetCategoryID; + echo '<br />' . _('Row:') . $Row . ' - ' . _('Invalid asset category:') . ' ' . $AssetCategoryID; } - $result = DB_query('SELECT locationid FROM fixedassetlocations WHERE locationid="' . $AssetLocationCode . '"', $db); + $result = DB_query("SELECT locationid FROM fixedassetlocations WHERE locationid='" . $AssetLocationCode . "'", $db); if (DB_num_rows($result)==0){ $InputError = true; prnMsg(_('The asset location code entered must be exist in the asset locations table'),'error'); - echo '<br>' . _('Row:') . $Row . ' - ' . _('Invalid asset location code:') . ' ' . $AssetLocationCode; + echo '<br />' . _('Row:') . $Row . ' - ' . _('Invalid asset location code:') . ' ' . $AssetLocationCode; } if (!Is_Date($DatePurchased)){ $InputError = true; prnMsg(_('The date purchased must be entered in the format:') . ' ' . $_SESSION['DefaultDateFormat'],'error'); - echo '<br>' . _('Row:') . $Row . ' - ' . _('Invalid date format:') . ' ' . $DatePurchased; + echo '<br />' . _('Row:') . $Row . ' - ' . _('Invalid date format:') . ' ' . $DatePurchased; } if ($DepnType=='DV'){ $DepnType=1; @@ -187,27 +186,27 @@ //attempt to insert the stock item $sql = "INSERT INTO fixedassets (description, - longdescription, - assetcategoryid, - serialno, - barcode, - assetlocation, - cost, - accumdepn, - depntype, - depnrate, - datepurchased) - VALUES ('" . $Description . "', - '" . $LongDescription . "', - '" . $AssetCategoryID . "', - '" . $SerialNo . "', - '" . $BarCode . "', - '" . $AssetLocationCode . "', - '" . $Cost . "', - '" . $AccumDepn . "', - '" . $DepnType . "', - '" . $DepnRate . "', - '" . FormatDateForSQL($DatePurchased) . "')"; + longdescription, + assetcategoryid, + serialno, + barcode, + assetlocation, + cost, + accumdepn, + depntype, + depnrate, + datepurchased) + VALUES ('" . $Description . "', + '" . $LongDescription . "', + '" . $AssetCategoryID . "', + '" . $SerialNo . "', + '" . $BarCode . "', + '" . $AssetLocationCode . "', + '" . $Cost . "', + '" . $AccumDepn . "', + '" . $DepnType . "', + '" . $DepnRate . "', + '" . FormatDateForSQL($DatePurchased) . "')"; $ErrMsg = _('The asset could not be added because'); $DbgMsg = _('The SQL that was used to add the asset and failed was'); @@ -218,43 +217,43 @@ $AssetID = DB_Last_Insert_ID($db, 'fixedassets','assetid'); $sql = "INSERT INTO fixedassettrans ( assetid, - transtype, - transno, - transdate, - periodno, - inputdate, - fixedassettranstype, - amount) - VALUES ( '" . $AssetID . "', - '49', - '" . $TransNo . "', - '" . $_POST['DateToEnter'] . "', - '" . $PeriodNo . "', - '" . Date('Y-m-d') . "', - 'cost', - '" . $Cost . "')"; + transtype, + transno, + transdate, + periodno, + inputdate, + fixedassettranstype, + amount) + VALUES ( '" . $AssetID . "', + '49', + '" . $TransNo . "', + '" . $_POST['DateToEnter'] . "', + '" . $PeriodNo . "', + '" . Date('Y-m-d') . "', + 'cost', + '" . $Cost . "')"; $ErrMsg = _('The transaction for the cost of the asset could not be added because'); $DbgMsg = _('The SQL that was used to add the fixedasset trans record that failed was'); $InsResult = DB_query($sql,$db,$ErrMsg,$DbgMsg); $sql = "INSERT INTO fixedassettrans ( assetid, - transtype, - transno, - transdate, - periodno, - inputdate, - fixedassettranstype, - amount) - VALUES ( '" . $AssetID . "', - '49', - '" . $TransNo . "', - '" . $_POST['DateToEnter'] . "', - '" . $PeriodNo . "', - '" . Date('Y-m-d') . "', - 'depn', - '" . $AccumDepn . "')"; - + transtype, + transno, + transdate, + periodno, + inputdate, + fixedassettranstype, + amount) + VALUES ( '" . $AssetID . "', + '49', + '" . $TransNo . "', + '" . $_POST['DateToEnter'] . "', + '" . $PeriodNo . "', + '" . Date('Y-m-d') . "', + 'depn', + '" . $AccumDepn . "')"; + $ErrMsg = _('The transaction for the cost of the asset could not be added because'); $DbgMsg = _('The SQL that was used to add the fixedasset trans record that failed was'); $InsResult = DB_query($sql,$db,$ErrMsg,$DbgMsg); @@ -285,7 +284,7 @@ echo ' <br /> - <a href="Z_ImportFixedAssets.php?gettemplate=1">Get Import Template</a> + <a href="Z_ImportFixedAssets.php?gettemplate=1">' . _('Get Import Template') . '</a> <br /> <br /> '; @@ -296,17 +295,16 @@ echo '<table class="selection"> <tr><td>' . _('Select Date to Upload B/Fwd Assets To:') . '</td> <td><select name="DateToEnter">'; - $PeriodsResult = DB_query('SELECT lastdate_in_period FROM periods ORDER BY periodno',$db); + $PeriodsResult = DB_query("SELECT lastdate_in_period FROM periods ORDER BY periodno",$db); while ($PeriodRow = DB_fetch_row($PeriodsResult)){ echo '<option value="' . $PeriodRow[0] . '">' . ConvertSQLDate($PeriodRow[0]) . '</option>'; } echo '</select></td></tr>'; echo '<tr><td>' . _('Fixed Assets Upload file:') . '</td><td><input name="SelectedAssetFile" type="file"></tr></table> - <input type="submit" VALUE="' . _('Send File') . '"> + <input type="submit" value="' . _('Send File') . '"> </form>'; } - include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/Z_ImportGLAccountGroups.php =================================================================== --- trunk/Z_ImportGLAccountGroups.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_ImportGLAccountGroups.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -1,8 +1,6 @@ <?php /* $Id$*/ -//$PageSecurity = 11; - include('includes/session.inc'); $title = _('Import Chart of Accounts'); include('includes/header.inc'); @@ -10,7 +8,7 @@ include('api/api_errorcodes.php'); $weberpuser = $_SESSION['UserID']; -$sql='SELECT password FROM www_users WHERE userid="'.$weberpuser.'"'; +$sql="SELECT password FROM www_users WHERE userid='" . $weberpuser . "'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $weberppassword = $myrow[0]; Modified: trunk/Z_ImportGLAccountSections.php =================================================================== --- trunk/Z_ImportGLAccountSections.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_ImportGLAccountSections.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -1,21 +1,19 @@ <?php /* $Id$*/ -//$PageSecurity = 11; - include('includes/session.inc'); $title = _('Import Chart of Accounts'); include('includes/header.inc'); include('xmlrpc/lib/xmlrpc.inc'); include('api/api_errorcodes.php'); -$weberpuser = $_SESSION['UserID']; -$sql='SELECT password FROM www_users WHERE userid="'.$weberpuser.'"'; +$webERPUser = $_SESSION['UserID']; +$sql="SELECT password FROM www_users WHERE userid='" . $webERPUser ."'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $weberppassword = $myrow[0]; -$ServerURL = "http://". $_SERVER['HTTP_HOST'].$rootpath."/api/api_xml-rpc.php"; +$ServerURL = 'http://'. $_SERVER['HTTP_HOST'] . $rootpath . '/api/api_xml-rpc.php'; $DebugLevel = 0; //Set to 0,1, or 2 with 2 being the highest level of debug info @@ -25,7 +23,11 @@ $FieldNames = explode(',', $buffer); $SuccessStyle='style="color:green; font-weight:bold"'; $FailureStyle='style="color:red; font-weight:bold"'; - echo '<table><tr><th>'. _('Account Section') .'</th><th>'. _('Result') . '</th><th>'. _('Comments') .'</th></tr>'; + echo '<table> + <tr><th>'. _('Account Section') .'</th> + <th>'. _('Result') . '</th> + <th>'. _('Comments') .'</th> + </tr>'; $successes=0; $failures=0; while (!feof ($fp)) { @@ -36,7 +38,7 @@ $AccountSectionDetails[$FieldNames[$i]]=$FieldValues[$i]; } $accountsection = php_xmlrpc_encode($AccountSectionDetails); - $user = new xmlrpcval($weberpuser); + $user = new xmlrpcval($webERPUser); $password = new xmlrpcval($weberppassword); $msg = new xmlrpcmsg("weberp.xmlrpc_InsertGLAccountSection", array($accountsection, $user, $password)); @@ -75,7 +77,5 @@ echo '<div class= "centre"><input type="submit" name="update" value="Process"></div>'; echo '</form>'; } - include('includes/footer.inc'); - ?> \ No newline at end of file Modified: trunk/Z_ImportPartCodes.php =================================================================== --- trunk/Z_ImportPartCodes.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_ImportPartCodes.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -1,7 +1,6 @@ <?php /* $Id$*/ -//$PageSecurity = 11; include('includes/session.inc'); $title = _('Import Stock Items'); @@ -9,13 +8,13 @@ include('xmlrpc/lib/xmlrpc.inc'); include('api/api_errorcodes.php'); -$weberpuser = $_SESSION['UserID']; -$sql='SELECT password FROM www_users WHERE userid="'.$weberpuser.'"'; +$webERPUser = $_SESSION['UserID']; +$sql="SELECT password FROM www_users WHERE userid='" . $webERPUser."'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $weberppassword = $myrow[0]; -$ServerURL = "http://". $_SERVER['HTTP_HOST'].$rootpath."/api/api_xml-rpc.php"; +$ServerURL = 'http://'. $_SERVER['HTTP_HOST'] . $rootpath . '/api/api_xml-rpc.php'; $DebugLevel = 0; //Set to 0,1, or 2 with 2 being the highest level of debug info @@ -25,7 +24,12 @@ $FieldNames = explode(',', $buffer); $SuccessStyle='style="color:green; font-weight:bold"'; $FailureStyle='style="color:red; font-weight:bold"'; - echo '<table><tr><th>'. _('Part Code') .'</th><th>'. _('Result') . '</th><th>'. _('Comments') .'</th></tr>'; + echo '<table> + <tr> + <th>'. _('Part Code') .'</th> + <th>'. _('Result') . '</th> + <th>'. _('Comments') .'</th> + </tr>'; $successes=0; $failures=0; while (!feof ($fp)) { @@ -36,7 +40,7 @@ $ItemDetails[$FieldNames[$i]]=$FieldValues[$i]; } $stockitem = php_xmlrpc_encode($ItemDetails); - $user = new xmlrpcval($weberpuser); + $user = new xmlrpcval($webERPUser); $password = new xmlrpcval($weberppassword); $msg = new xmlrpcmsg("weberp.xmlrpc_InsertStockItem", array($stockitem, $user, $password)); @@ -65,7 +69,7 @@ echo '</table>'; fclose ($fp); } else { - $sql = 'select * from locations'; + $sql = "select * from locations"; $result = DB_query($sql,$db); if (DB_num_rows($result)==0) { prnMsg( _('No locations have been set up. At least one location should be set up first'), "error"); Modified: trunk/Z_MakeStockLocns.php =================================================================== --- trunk/Z_MakeStockLocns.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_MakeStockLocns.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -2,30 +2,25 @@ /* $Id$*/ /* Script to make stock locations for all parts that do not have stock location records set up*/ - -//$PageSecurity=15; include ('includes/session.inc'); $title = _('Make LocStock Records'); include('includes/header.inc'); +echo '<br /><br />' . _('This script makes stock location records for parts where they do not already exist'); -echo '<br><br>' . _('This script makes stock location records for parts where they do not already exist'); - -$sql = 'INSERT INTO locstock (stockid, loccode) +$sql = "INSERT INTO locstock (stockid, loccode) SELECT stockmaster.stockid, locations.loccode FROM stockmaster CROSS JOIN locations LEFT JOIN locstock ON stockmaster.stockid = locstock.stockid AND locations.loccode = locstock.loccode - WHERE locstock.stockid IS NULL'; + WHERE locstock.stockid IS NULL"; $ErrMsg = _('The items/locations that need stock location records created cannot be retrieved because'); $Result = DB_query($sql,$db,$ErrMsg); - - -echo '<p>'; +echo '<p />'; prnMsg(_('Any stock items that may not have had stock location records have now been given new location stock records'),'info'); include('includes/footer.inc'); Modified: trunk/Z_PriceChanges.php =================================================================== --- trunk/Z_PriceChanges.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_PriceChanges.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -1,43 +1,41 @@ <?php /* $Id$*/ -//$PageSecurity=15; - include('includes/session.inc'); $title=_('Update Pricing'); include('includes/header.inc'); -echo '<br>' . _('This page updates already existing prices for a specified sales type (price list)') . '. ' . _('Choose between updating only customer special prices where the customer is set up under the price list selected, or all prices under the sales type or just specific prices for a customer for the stock category selected'); +echo '<br />' . _('This page updates already existing prices for a specified sales type (price list)') . '. ' . _('Choose between updating only customer special prices where the customer is set up under the price list selected, or all prices under the sales type or just specific prices for a customer for the stock category selected'); prnMsg (_('This script takes no account of start and end dates of prices and updates all historical prices as well as current prices - better to use new scripts under Inventory -> Maintenance'),'warn'); -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'] . '" />'; -$SQL = 'SELECT sales_type, typeabbrev FROM salestypes'; +$SQL = "SELECT sales_type, typeabbrev FROM salestypes"; $result = DB_query($SQL,$db); echo '<p><table> <tr> - <td>' . _('Select the Price List to update the costs for') .":</td> - <td><select name='PriceList'>"; + <td>' . _('Select the Price List to update the costs for') .':</td> + <td><select name="PriceList">'; if (!isset($_POST['PriceList'])){ - echo '<option selected VALUE=0>' . _('No Price List Selected'); + echo '<option selected value=0>' . _('No Price List Selected') . '</option>'; } while ($PriceLists=DB_fetch_array($result)){ - echo "<option VALUE='" . $PriceLists['typeabbrev'] . "'>" . $PriceLists['sales_type']; + echo '<option value="' . $PriceLists['typeabbrev'] . '">' . $PriceLists['sales_type'] . '</option>'; } echo '</select></td></tr>'; -echo '<tr><td>' . _('Category') . ":</td> - <td><select name='StkCat'>"; +echo '<tr><td>' . _('Category') . ':</td> + <td><select name="StkCat">'; -$sql = 'SELECT categoryid, categorydescription FROM stockcategory'; +$sql = "SELECT categoryid, categorydescription FROM stockcategory"; $ErrMsg = _('The stock categories could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve stock categories and failed was'); @@ -45,19 +43,19 @@ while ($myrow=DB_fetch_array($result)){ if ($myrow['categoryid']==$_POST['StkCat']){ - echo "<option selected VALUE='". $myrow['categoryid'] . "'>" . $myrow['categorydescription']; + echo '<option selected value="'. $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; } else { - echo "<option VALUE='". $myrow['categoryid'] . "'>" . $myrow['categorydescription']; + echo '<option value="'. $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; } } echo '</select></td></tr>'; echo '<tr><td>' . _('Which Prices to update') . ":</td> <td><select name='WhichPrices'>"; - echo "<option VALUE='Only Non-customer special prices'>" . _('Only Non-customer special prices'); - echo "<option VALUE='Only customer special prices'>" . _('Only customer special prices'); - echo "<option VALUE='Both customer special prices and non-customer special prices'>" . _('Both customer special prices and non-customer special prices'); - echo "<option VALUE='Selected customer special prices only'>" . $_SESSION['CustomerID'] . ' ' . _('customer special prices only'); + echo "<option value='Only Non-customer special prices'>" . _('Only Non-customer special prices') . '</option>'; + echo "<option value='Only customer special prices'>" . _('Only customer special prices') . '</option>'; + echo "<option value='Both customer special prices and non-customer special prices'>" . _('Both customer special prices and non-customer special prices') . '</option>'; + echo "<option value='Selected customer special prices only'>" . $_SESSION['CustomerID'] . ' ' . _('customer special prices only') . '</option>'; echo '</select></td></tr>'; if (!isset($_POST['IncreasePercent'])){ @@ -65,28 +63,28 @@ } echo '<tr><td>' . _('Percentage Increase (positive) or decrease (negative)') . "</td> - <td><input name='IncreasePercent' size=4 maxlength=4 VALUE=" . $_POST['IncreasePercent'] . "></td></tr></table>"; + <td><input name='IncreasePercent' size=4 maxlength=4 value=" . $_POST['IncreasePercent'] . "></td></tr></table>"; -echo "<div class='centre'><p><input type=submit name='UpdatePrices' VALUE='" . _('Update Prices') . '\' onclick="return confirm(\'' . _('Are you sure you wish to update all the prices according to the criteria selected?') . '\');"></div>'; +echo "<div class='centre'><p><input type=submit name='UpdatePrices' value='" . _('Update Prices') . '\' onclick="return confirm(\'' . _('Are you sure you wish to update all the prices according to the criteria selected?') . '\');"></div>'; echo '</form>'; if (isset($_POST['UpdatePrices']) AND isset($_POST['StkCat'])){ - echo '<br>' . _('So we are using a price list/sales type of') .' : ' . $_POST['PriceList']; - echo '<br>' . _('and a stock category code of') . ' : ' . $_POST['StkCat']; - echo '<br>' . _('and a increase percent of') . ' : ' . $_POST['IncreasePercent']; + echo '<br />' . _('So we are using a price list/sales type of') .' : ' . $_POST['PriceList']; + echo '<br />' . _('and a stock category code of') . ' : ' . $_POST['StkCat']; + echo '<br />' . _('and a increase percent of') . ' : ' . $_POST['IncreasePercent']; if ($_POST['PriceList']=='0'){ - echo '<br>' . _('The price list/sales type to be updated must be selected first'); + echo '<br />' . _('The price list/sales type to be updated must be selected first'); include ('includes/footer.inc'); exit; } if (ABS($_POST['IncreasePercent']) < 0.5 OR ABS($_POST['IncreasePercent'])>40 OR !is_numeric($_POST['IncreasePercent'])){ - echo '<br>' . _('The increase or decrease to be applied is expected to be an integer between 1 and 40 it is not necessary to enter the').' '. '%'.' '. _('sign') . ' - ' . _('the amount is assumed to be a percentage'); + echo '<br />' . _('The increase or decrease to be applied is expected to be an integer between 1 and 40 it is not necessary to enter the').' '. '%'.' '. _('sign') . ' - ' . _('the amount is assumed to be a percentage'); include ('includes/footer.inc'); exit; } @@ -102,7 +100,7 @@ if ($_POST['WhichPrices'] == 'Only Non-customer special prices'){ - $sql = 'UPDATE prices SET price=price*(1+' . $IncrementPercentage . ") + $sql = "UPDATE prices SET price=price*(1+" . $IncrementPercentage . ") WHERE typeabbrev='" . $_POST['PriceList'] . "' AND stockid='" . $myrow['stockid'] . "' AND typeabbrev='" . $_POST['PriceList'] . "' @@ -125,7 +123,7 @@ } else if ($_POST['WhichPrices'] == 'Selected customer special prices only'){ - $sql = 'UPDATE prices SET price=price*(1+' . $IncrementPercentage . ") + $sql = "UPDATE prices SET price=price*(1+" . $IncrementPercentage . ") WHERE typeabbrev='" . $_POST['PriceList'] . "' AND stockid='" . $myrow['stockid'] . "' AND typeabbrev='" . $_POST['PriceList'] . "' Modified: trunk/Z_ReApplyCostToSA.php =================================================================== --- trunk/Z_ReApplyCostToSA.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_ReApplyCostToSA.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -2,8 +2,6 @@ /* $Id$*/ -//$PageSecurity=15; - include('includes/session.inc'); $title=_('Apply Current Cost to Sales Analysis'); include('includes/header.inc'); @@ -13,33 +11,33 @@ echo "<form method='POST' action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>"; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -$SQL = 'SELECT MonthName(lastdate_in_period) AS mnth, +$SQL = "SELECT MonthName(lastdate_in_period) AS mnth, YEAR(lastdate_in_period) AS yr, periodno - FROM periods'; -echo '<p><div class="centre">' . _('Select the Period to update the costs for') . ":<select name='PeriodNo'>"; + FROM periods"; +echo '<p><div class="centre">' . _('Select the Period to update the costs for') . ':<select name="PeriodNo">'; $result = DB_query($SQL,$db); -echo '<option selected VALUE=0>' . _('No Period Selected'); +echo '<option selected value=0>' . _('No Period Selected') . '</option>'; while ($PeriodInfo=DB_fetch_array($result)){ - echo '<option VALUE=' . $PeriodInfo['periodno'] . '>' . $PeriodInfo['mnth'] . ' ' . $PeriodInfo['Yr']; + echo '<option value=' . $PeriodInfo['periodno'] . '>' . $PeriodInfo['mnth'] . ' ' . $PeriodInfo['Yr'] . '</option>'; } echo '</select>'; -echo "<p><input type=submit name='UpdateSalesAnalysis' VALUE='" . _('Update Sales Analysis Costs') ."'></div>"; +echo '<p><input type=submit name="UpdateSalesAnalysis" value="' . _('Update Sales Analysis Costs') .'"></div>'; echo '</form>'; if (isset($_POST['UpdateSalesAnalysis']) AND $_POST['PeriodNo']!=0){ - $sql = 'SELECT stockmaster.stockid, + $sql = "SELECT stockmaster.stockid, materialcost+overheadcost+labourcost AS standardcost, stockmaster.mbflag FROM salesanalysis INNER JOIN stockmaster ON salesanalysis.stockid=stockmaster.stockid - WHERE periodno=' . $_POST['PeriodNo'] . " + WHERE periodno='" . $_POST['PeriodNo'] . "' AND stockmaster.mbflag<>'D' GROUP BY stockmaster.stockid, stockmaster.materialcost, Modified: trunk/Z_RePostGLFromPeriod.php =================================================================== --- trunk/Z_RePostGLFromPeriod.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_RePostGLFromPeriod.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -2,13 +2,11 @@ /* $Id$*/ -//$PageSecurity=15; - include ('includes/session.inc'); $title = _('Recalculation of GL Balances in Chart Details Table'); include('includes/header.inc'); -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($_POST['FromPeriod'])){ @@ -16,39 +14,37 @@ /*Show a form to allow input of criteria for TB to show */ echo '<table> <tr> - <td>' . _('Select Period From') . ":</td> - <td><select Name='FromPeriod'>"; + <td>' . _('Select Period From') . ':</td> + <td><select Name="FromPeriod">'; - $sql = 'SELECT periodno, + $sql = "SELECT periodno, lastdate_in_period - FROM periods ORDER BY periodno'; + FROM periods ORDER BY periodno"; $Periods = DB_query($sql,$db); while ($myrow=DB_fetch_array($Periods,$db)){ - echo '<option VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']); + echo '<option VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } echo '</select></td> </tr> </table>'; - echo "<div class='centre'><input type=submit Name='recalc' Value='" . _('Do the Recalculation') . "' - onclick=\"return confirm('" . _('Are you sure you wish to re-post all general ledger transactions since the selected period - .... this can take some time?') . '\');"></div></form>'; + echo "<div class='centre'><input type=submit Name='recalc' value='" . _('Do the Recalculation') . "' onclick=\"return confirm('" . _('Are you sure you wish to re-post all general ledger transactions since the selected period this can take some time?') . '\');"></div></form>'; } else { /*OK do the updates */ /* Make the posted flag on all GL entries including and after the period selected = 0 */ - $sql = 'UPDATE gltrans SET posted=0 WHERE periodno >='. $_POST['FromPeriod']; + $sql = "UPDATE gltrans SET posted=0 WHERE periodno >='" . $_POST['FromPeriod'] . "'"; $UpdGLTransPostedFlag = DB_query($sql,$db); /* Now make all the actuals 0 for all periods including and after the period from */ - $sql = 'UPDATE chartdetails SET actual =0 WHERE period >= ' . $_POST['FromPeriod']; + $sql = "UPDATE chartdetails SET actual =0 WHERE period >= '" . $_POST['FromPeriod'] . "'"; $UpdActualChartDetails = DB_query($sql,$db); - $ChartDetailBFwdResult = DB_query('SELECT accountcode, bfwd FROM chartdetails WHERE period=' . $_POST['FromPeriod'],$db); + $ChartDetailBFwdResult = DB_query("SELECT accountcode, bfwd FROM chartdetails WHERE period='" . $_POST['FromPeriod'] . "'",$db); while ($ChartRow=DB_fetch_array($ChartDetailBFwdResult)){ - $sql = 'UPDATE chartdetails SET bfwd =' . $ChartRow['bfwd'] . ' WHERE period > ' . $_POST['FromPeriod'] . ' AND accountcode=' . $ChartRow['accountcode']; + $sql = "UPDATE chartdetails SET bfwd ='" . $ChartRow['bfwd'] . "' WHERE period > '" . $_POST['FromPeriod'] . "' AND accountcode='" . $ChartRow['accountcode'] . "'"; $UpdActualChartDetails = DB_query($sql,$db); } Modified: trunk/Z_ReverseSuppPaymentRun.php =================================================================== --- trunk/Z_ReverseSuppPaymentRun.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_ReverseSuppPaymentRun.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -4,7 +4,7 @@ /* Script to delete all supplier payments entered or created from a payment run on a specified day */ -//$PageSecurity=15; + include ('includes/session.inc'); $title = _('Reverse and Delete Supplier Payments'); include('includes/header.inc'); @@ -83,10 +83,10 @@ } -echo "<form method=post action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>"; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; +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 "<input type=submit name='RevPayts' value='" . _('Reverse Supplier Payments on the Date Entered') . "'>"; +echo '<input type="submit" name="RevPayts" value="' . _('Reverse Supplier Payments on the Date Entered') . '">'; echo '</form>'; include('includes/footer.inc'); Modified: trunk/Z_SalesIntegrityCheck... [truncated message content] |
From: <dai...@us...> - 2011-04-09 06:12:13
|
Revision: 4543 http://web-erp.svn.sourceforge.net/web-erp/?rev=4543&view=rev Author: daintree Date: 2011-04-09 06:12:05 +0000 (Sat, 09 Apr 2011) Log Message: ----------- SQL and xhtml quoting Modified Paths: -------------- trunk/ShipmentCosting.php trunk/Z_CreateCompanyTemplateFile.php trunk/Z_CurrencyDebtorsBalances.php trunk/Z_CurrencySuppliersBalances.php trunk/Z_DataExport.php trunk/Z_DeleteCreditNote.php trunk/Z_DeleteInvoice.php trunk/Z_ImportFixedAssets.php trunk/Z_ImportGLAccountGroups.php trunk/Z_ImportGLAccountSections.php trunk/Z_ImportPartCodes.php trunk/Z_MakeStockLocns.php trunk/Z_PriceChanges.php trunk/Z_ReApplyCostToSA.php trunk/Z_RePostGLFromPeriod.php trunk/Z_ReverseSuppPaymentRun.php trunk/Z_SalesIntegrityCheck.php trunk/Z_UpdateChartDetailsBFwd.php trunk/api/api_debtortransactions.php trunk/api/api_glgroups.php trunk/api/api_glsections.php trunk/api/api_locations.php trunk/api/api_login.php trunk/api/api_purchdata.php trunk/api/api_salestypes.php trunk/api/api_stockcategories.php trunk/includes/SQL_CommonFunctions.inc Modified: trunk/ShipmentCosting.php =================================================================== --- trunk/ShipmentCosting.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/ShipmentCosting.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -321,8 +321,9 @@ if ($TotalQuantityOnHand>0) { $CostIncrement = ($myrow['totqtyinvoiced'] *($ItemShipmentCost - $StdCostUnit) - $WriteOffToVariances) / $TotalQuantityOnHand; - $sql = 'UPDATE stockmaster SET lastcost=materialcost+overheadcost+labourcost, - materialcost=materialcost+' . $CostIncrement . " WHERE stockid='" . $myrow['itemcode'] . "'"; + $sql = "UPDATE stockmaster SET lastcost=materialcost+overheadcost+labourcost, + materialcost=materialcost+" . $CostIncrement . " + WHERE stockid='" . $myrow['itemcode'] . "'"; $Result = DB_query($sql, $db, $ErrMsg, $DbgMsg,'',TRUE); } else { $sql = "UPDATE stockmaster SET lastcost=materialcost+overheadcost+labourcost, @@ -385,7 +386,7 @@ if ($_SESSION['CompanyRecord']['gllink_stock']==1){ $CostUpdateNo = GetNextTransNo(35, $db); - $PeriodNo = GetPeriod(Date("d/m/Y"), $db); + $PeriodNo = GetPeriod(Date('d/m/Y'), $db); $ValueOfChange = $QOH * ($ItemShipmentCost - $StdCostUnit); Modified: trunk/Z_CreateCompanyTemplateFile.php =================================================================== --- trunk/Z_CreateCompanyTemplateFile.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_CreateCompanyTemplateFile.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -1,8 +1,6 @@ <?php /* $Id$*/ -//$PageSecurity =15; - include ('includes/session.inc'); $title = _('Create Database Template File'); include ('includes/header.inc'); @@ -15,20 +13,20 @@ } if ($InputError==false){ - $CurrResult = DB_query( 'SELECT currabrev, - currency, - country, - debtorsact, - creditorsact, - payrollact, - grnact, - exchangediffact, - purchasesexchangediffact, - retainedearnings, - freightact - FROM currencies INNER JOIN companies - ON companies.currencydefault=currencies.currabrev - WHERE coycode=1',$db); + $CurrResult = DB_query( "SELECT currabrev, + currency, + country, + debtorsact, + creditorsact, + payrollact, + grnact, + exchangediffact, + purchasesexchangediffact, + retainedearnings, + freightact + FROM currencies INNER JOIN companies + ON companies.currencydefault=currencies.currabrev + WHERE coycode='1'",$db); $CurrRow = DB_fetch_array($CurrResult); @@ -46,7 +44,7 @@ purchasesexchangediffact=" . $CurrRow['purchasesexchangediffact'] . ", retainedearnings=" . $CurrRow['retainedearnings'] . ", freightact=" . $CurrRow['freightact'] . " - WHERE coycode=1;\n"; + WHERE coycode='1';\n"; /*empty out any existing records in chartmaster, @@ -67,12 +65,12 @@ $SQLScript .= "TRUNCATE TABLE taxcategories;\n"; $SQLScript .= "TRUNCATE TABLE taxprovinces;\n"; - $GroupsResult = DB_query('SELECT groupname, - sectioninaccounts, - pandl, - sequenceintb, - parentgroupname - FROM accountgroups',$db); + $GroupsResult = DB_query("SELECT groupname, + sectioninaccounts, + pandl, + sequenceintb, + parentgroupname + FROM accountgroups",$db); while ($GroupRow = DB_fetch_array($GroupsResult)){ $SQLScript .= "INSERT INTO accountgroups (groupname,sectioninaccounts,pandl, sequenceintb, parentgroupname) @@ -83,13 +81,15 @@ '" . $GroupRow['parentgroupname'] . "');\n"; } - $ChartResult = DB_query('SELECT accountcode, accountname, group_ FROM chartmaster',$db); + $ChartResult = DB_query("SELECT accountcode, accountname, group_ FROM chartmaster",$db); $i=0; while ($ChartRow = DB_fetch_array($ChartResult)){ if ($_POST['IncludeAccount_' .$i]=='on'){ $SQLScript .= "INSERT INTO chartmaster (accountcode,accountname,group_) - VALUES (" . $ChartRow['accountcode'] . ", '" . $ChartRow['accountname'] . "', '" . $ChartRow['group_'] . "');\n"; + VALUES ('" . $ChartRow['accountcode'] . "', + '" . $ChartRow['accountname'] . "', + '" . $ChartRow['group_'] . "');\n"; } $i++; } @@ -98,14 +98,14 @@ /*Tax Authorities table */ $TaxAuthoritiesResult = DB_query("SELECT taxid, - description, - taxglcode, - purchtaxglaccount, - bank, - bankacctype, - bankacc, - bankswift - FROM taxauthorities",$db); + description, + taxglcode, + purchtaxglaccount, + bank, + bankacctype, + bankacc, + bankswift + FROM taxauthorities",$db); while ($TaxAuthoritiesRow = DB_fetch_array($TaxAuthoritiesResult)){ $SQLScript .= "INSERT INTO taxauthorities (taxid, @@ -127,11 +127,11 @@ } /*taxauthrates table */ - $TaxAuthRatesResult = DB_query('SELECT taxauthority, - dispatchtaxprovince, - taxcatid, - taxrate - FROM taxauthrates',$db); + $TaxAuthRatesResult = DB_query("SELECT taxauthority, + dispatchtaxprovince, + taxcatid, + taxrate + FROM taxauthrates",$db); while ($TaxAuthRatesRow = DB_fetch_array($TaxAuthRatesResult)){ $SQLScript .= "INSERT INTO taxauthrates (taxauthority, @@ -145,20 +145,20 @@ } /*taxgroups table */ - $TaxGroupsResult = DB_query('SELECT taxgroupid, - taxgroupdescription - FROM taxgroups',$db); + $TaxGroupsResult = DB_query("SELECT taxgroupid, + taxgroupdescription + FROM taxgroups",$db); while ($TaxGroupsRow = DB_fetch_array($TaxGroupsResult)){ $SQLScript .= "INSERT INTO taxgroups (taxgroupid, taxgroupdescription) - VALUES (" . $TaxGroupsRow['taxgroupid'] . ", + VALUES ('" . $TaxGroupsRow['taxgroupid'] . "', '" . $TaxGroupsRow['taxgroupdescription'] . "');\n"; } /*tax categories table */ - $TaxCategoriesResult = DB_query('SELECT taxcatid, - taxcatname - FROM taxcategories',$db); + $TaxCategoriesResult = DB_query("SELECT taxcatid, + taxcatname + FROM taxcategories",$db); while ($TaxCategoriesRow = DB_fetch_array($TaxCategoriesResult)){ $SQLScript .= "INSERT INTO taxcategories (taxcatid, @@ -167,9 +167,9 @@ '" . $TaxCategoriesRow['taxcatname'] . "');\n"; } /*tax provinces table */ - $TaxProvincesResult = DB_query('SELECT taxprovinceid, - taxprovincename - FROM taxprovinces',$db); + $TaxProvincesResult = DB_query("SELECT taxprovinceid, + taxprovincename + FROM taxprovinces",$db); while ($TaxProvincesRow = DB_fetch_array($TaxProvincesResult)){ $SQLScript .= "INSERT INTO taxprovinces (taxprovinceid, @@ -178,11 +178,11 @@ '" . $TaxProvincesRow['taxprovincename'] . "');\n"; } /*taxgroup taxes table */ - $TaxGroupTaxesResult = DB_query('SELECT taxgroupid, - taxauthid, - calculationorder, - taxontax - FROM taxgrouptaxes',$db); + $TaxGroupTaxesResult = DB_query("SELECT taxgroupid, + taxauthid, + calculationorder, + taxontax + FROM taxgrouptaxes",$db); while ($TaxGroupTaxesRow = DB_fetch_array($TaxGroupTaxesResult)){ $SQLScript .= "INSERT INTO taxgrouptaxes (taxgroupid, @@ -194,7 +194,7 @@ " . $TaxGroupTaxesRow['calculationorder'] . ", " . $TaxGroupTaxesRow['taxontax'] . ");\n"; } - $SQLScript .= 'SET FOREIGN_KEY_CHECKS=1;'; + $SQLScript .= "SET FOREIGN_KEY_CHECKS=1;"; /*Now write $SQLScript to a file */ $FileHandle = fopen("./companies/" . $_SESSION['DatabaseName'] . "/reports/" . $_POST['TemplateName'] .".sql","w"); fwrite ($FileHandle, $SQLScript); @@ -225,10 +225,10 @@ echo '<table>'; /*Show the chart of accounts to be exported for deslection of company specific ones */ -$ChartResult = DB_query('SELECT accountcode, accountname, group_ FROM chartmaster',$db); +$ChartResult = DB_query("SELECT accountcode, accountname, group_ FROM chartmaster",$db); $TableHeadings = '<tr><th>' . _('Account Code') . '</th> - <th>' . _('Account Name') . '</th></tr>'; + <th>' . _('Account Name') . '</th></tr>'; $i = 0; while ($ChartRow = DB_fetch_array($ChartResult)){ echo '<tr><td>' . $ChartRow['accountcode'] . '</td> Modified: trunk/Z_CurrencyDebtorsBalances.php =================================================================== --- trunk/Z_CurrencyDebtorsBalances.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_CurrencyDebtorsBalances.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -1,6 +1,5 @@ <?php /* $Id$*/ -//$PageSecurity=15; include('includes/session.inc'); $title=_('Currency Debtor Balances'); @@ -8,12 +7,12 @@ echo '<font size=4><b>' . _('Debtors Balances By Currency Totals') . '</b></font>'; -$sql = 'SELECT SUM(ovamount+ovgst+ovdiscount+ovfreight-alloc) AS currencybalance, +$sql = "SELECT SUM(ovamount+ovgst+ovdiscount+ovfreight-alloc) AS currencybalance, currcode, SUM((ovamount+ovgst+ovdiscount+ovfreight-alloc)/rate) AS localbalance FROM debtortrans INNER JOIN debtorsmaster ON debtortrans.debtorno=debtorsmaster.debtorno - WHERE (ovamount+ovgst+ovdiscount+ovfreight-alloc)<>0 GROUP BY currcode'; + WHERE (ovamount+ovgst+ovdiscount+ovfreight-alloc)<>0 GROUP BY currcode"; $result = DB_query($sql,$db); Modified: trunk/Z_CurrencySuppliersBalances.php =================================================================== --- trunk/Z_CurrencySuppliersBalances.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_CurrencySuppliersBalances.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -1,6 +1,5 @@ <?php /* $Id$*/ -//$PageSecurity=15; include('includes/session.inc'); $title=_('Currency Debtor Balances'); @@ -8,11 +7,11 @@ echo '<font size=4><b>' . _('Suppliers Balances By Currency Totals') . '</b></font>'; -$sql = 'SELECT SUM(ovamount+ovgst-alloc) AS currencybalance, +$sql = "SELECT SUM(ovamount+ovgst-alloc) AS currencybalance, currcode, SUM((ovamount+ovgst-alloc)/rate) AS localbalance FROM supptrans INNER JOIN suppliers ON supptrans.supplierno=suppliers.supplierid - WHERE (ovamount+ovgst-alloc)<>0 GROUP BY currcode'; + WHERE (ovamount+ovgst-alloc)<>0 GROUP BY currcode"; $result = DB_query($sql,$db); Modified: trunk/Z_DataExport.php =================================================================== --- trunk/Z_DataExport.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_DataExport.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -2,7 +2,6 @@ /* $Id$*/ -//$PageSecurity=15; include('includes/session.inc'); @@ -70,9 +69,9 @@ $title = _('Price List Export Problem ....'); include('includes/header.inc'); prnMsg( _('The Price List 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; @@ -166,9 +165,9 @@ $title = _('Customer List Export Problem ....'); include('includes/header.inc'); prnMsg( _('The Customer List 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; @@ -257,9 +256,9 @@ $title = _('Salesman List Export Problem ....'); include('includes/header.inc'); prnMsg( _('The Salesman List 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; @@ -306,9 +305,9 @@ $title = _('Security Token List Export Problem ....'); include('includes/header.inc'); prnMsg( _('The Image List 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; @@ -345,9 +344,9 @@ $title = _('Security Token List Export Problem ....'); include('includes/header.inc'); prnMsg( _('The Security Token List 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; @@ -381,9 +380,9 @@ $title = _('Security Role List Export Problem ....'); include('includes/header.inc'); prnMsg( _('The Security Role List 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; @@ -417,9 +416,9 @@ $title = _('Security Group List Export Problem ....'); include('includes/header.inc'); prnMsg( _('The Security Group List 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; @@ -469,9 +468,9 @@ $title = _('Security User List Export Problem ....'); include('includes/header.inc'); prnMsg( _('The Security User List 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; @@ -532,8 +531,8 @@ // SELECT EXPORT FOR PRICE LIST - echo "<br>"; - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . "?" . SID . ">"; + echo '<br />'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table>'; echo '<tr><th colspan=2>' . _('Price List Export') . '</th></tr>'; @@ -554,16 +553,16 @@ echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; } echo '</select></td></tr>'; - echo "</table>"; + echo '</table>'; echo "<div class='centre'><input type='Submit' name='pricelist' value='" . _('Export') . "'></div>"; - echo "</form><br>"; + echo '</form><br />'; // SELECT EXPORT FOR CUSTOMER LIST - echo "<br>"; + echo "<br />"; // Export Stock For Location - 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>'; echo '<tr><th colspan=2>' . _('Customer List Export') . '</th></tr>'; @@ -576,66 +575,66 @@ echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; } echo '</select></td></tr>'; - echo "</table>"; + echo '</table>'; echo "<div class='centre'><input type='Submit' name='custlist' value='" . _('Export') . "'></div>"; - echo "</form><br>"; + echo '</form><br />'; // SELECT EXPORT FOR SALES MAN - echo "<br>"; + echo "<br />"; // Export Stock For Location - 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>'; echo '<tr><th colspan=2>' . _('Salesman List Export') . '</th></tr>'; - echo "</table>"; + echo '</table>'; echo "<div class='centre'><div class='centre'><input type='Submit' name='salesmanlist' value='" . _('Export') . "'></div>"; - echo "</form><br>"; + echo '</form><br />'; // SELECT EXPORT FOR IMAGES - 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>'; echo '<tr><th colspan=2>' . _('Image List Export') . '</th></tr>'; - echo "</table>"; + echo '</table>'; echo "<div class='centre'><input type='Submit' name='imagelist' value='" . _('Export') . "'></div>"; - echo "</form><br>"; + echo '</form><br />'; // SELECT EXPORT SECURITY TOKENS - 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>'; echo '<tr><th colspan=2>' . _('Security Token List Export') . '</th></tr>'; - echo "</table>"; + echo '</table>'; echo "<div class='centre'><input type='Submit' name='sectokenlist' value='" . _('Export') . "'></div>"; - echo "</form><br>"; + echo '</form><br />'; // SELECT EXPORT SECURITY ROLES - 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>'; echo '<tr><th colspan=2>' . _('Security Role List Export') . '</th></tr>'; - echo "</table>"; + echo '</table>'; echo "<div class='centre'><input type='Submit' name='secrolelist' value='" . _('Export') . "'></div>"; - echo "</form><br>"; + echo '</form><br />'; // SELECT EXPORT SECURITY GROUPS - 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>'; echo '<tr><th colspan=2>' . _('Security Group List Export') . '</th></tr>'; - echo "</table>"; + echo '</table>'; echo "<div class='centre'><input type='Submit' name='secgrouplist' value='" . _('Export') . "'></div>"; - echo "</form><br>"; + echo '</form><br />'; // SELECT EXPORT SECURITY USERS - 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>'; echo '<tr><th colspan=2>' . _('Security User List Export') . '</th></tr>'; - echo "</table>"; - echo "<div class='centre'><input type='Submit' name='secuserlist' value='" . _('Export') . "'></div>"; - echo "</form><br>"; + echo '</table>'; + echo '<div class="centre"><input type="Submit" name="secuserlist" value="' . _('Export') . '"></div>'; + echo '</form><br />'; include('includes/footer.inc'); Modified: trunk/Z_DeleteCreditNote.php =================================================================== --- trunk/Z_DeleteCreditNote.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_DeleteCreditNote.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -5,11 +5,12 @@ /* Script to delete a credit note - it expects and credit note number to delete not included on any menu for obvious reasons +STRONGLY RECOMMEND NOT USING THIS - RE INVOICE INSTEAD + must be called directly with path/DeleteCreditnote.php?CreditNoteNo=??????? !! */ -//$PageSecurity=15; include ('includes/session.inc'); $title = _('Delete Credit Note'); @@ -21,7 +22,7 @@ } /*get the order number that was credited */ -$SQL = 'SELECT order_ FROM debtortrans WHERE transno=' . $_GET['CreditNoteNo'] . ' AND type=11'; +$SQL = "SELECT order_ FROM debtortrans WHERE transno='" . $_GET['CreditNoteNo'] . "' AND type='11'"; $Result = DB_query($SQL, $db); $myrow = DB_fetch_row($Result); @@ -29,14 +30,14 @@ /*Now get the stock movements that were credited into an array */ -$SQL = 'SELECT stockid, - loccode, - debtorno, - branchcode, - prd, - qty - FROM stockmoves - WHERE transno =' .$_GET['CreditNoteNo'] . ' AND type=11'; +$SQL = "SELECT stockid, + loccode, + debtorno, + branchcode, + prd, + qty + FROM stockmoves + WHERE transno ='" .$_GET['CreditNoteNo'] . "' AND type='11'"; $Result = DB_query($SQL,$db); $i=0; @@ -72,8 +73,8 @@ /*reverse the update to LocStock */ $SQL = "UPDATE locstock SET locstock.quantity = locstock.quantity + " . $CreditLine['qty'] . " - WHERE locstock.stockid = '" . $CreditLine['stockid'] . "' - AND loccode = '" . $CreditLine['loccode'] . "'"; + WHERE locstock.stockid = '" . $CreditLine['stockid'] . "' + AND loccode = '" . $CreditLine['loccode'] . "'"; $ErrMsg = _('SQL to reverse update to the location stock records failed with the error'); @@ -100,7 +101,7 @@ $ErrMsg = _('SQL to delete the stock movement record failed with the message'); $Result = DB_query($SQL, $db,$ErrMsg,$DbgMsg,true); prnMsg(_('Deleted the credit note stock movements').'info'); -echo '<br><br>'; +echo '<br /><br />'; $result = DB_Txn_Commit($db); prnMsg(_('Credit note number') . ' ' . $_GET['CreditNoteNo'] . ' ' . _('has been completely deleted') . '. ' . _('To ensure the integrity of the general ledger transactions must be reposted from the period the credit note was created'),'info'); Modified: trunk/Z_DeleteInvoice.php =================================================================== --- trunk/Z_DeleteInvoice.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_DeleteInvoice.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -4,9 +4,12 @@ /* Script to delete an invoice expects and invoice number to delete not included on any menu for obvious reasons +* +* STRONGLY RECOMMEND NOT USING THIS -CREDIT THE INVOICE AND RE INVOICE +* * +* This page must be called directly using path/Z_DeleteInvoice.php?InvoiceNo=????? !! */ -//$PageSecurity=15; include ('includes/session.inc'); $title = _('Delete Invoice'); @@ -19,9 +22,10 @@ } /*Get the order number that was invoiced */ -$SQL = 'SELECT order_ - FROM debtortrans - WHERE debtortrans.type = 10 and transno = ' . $_GET['InvoiceNo']; +$SQL = "SELECT order_ + FROM debtortrans + WHERE debtortrans.type = 10 + AND transno = '" . $_GET['InvoiceNo'] . "'"; $Result = DB_query($SQL,$db); $myrow = DB_fetch_row($Result); @@ -40,7 +44,7 @@ // mbflag // We now use fully qualified column names -$SQL = 'SELECT stockmoves.stockid, +$SQL = "SELECT stockmoves.stockid, stockmoves.loccode, stockmoves.debtorno, stockmoves.branchcode, @@ -49,7 +53,7 @@ stockmaster.mbflag FROM stockmoves INNER JOIN stockmaster ON stockmoves.stockid = stockmaster.stockid - WHERE transno =' .$_GET['InvoiceNo'] . ' AND type=10'; + WHERE transno ='" .$_GET['InvoiceNo'] . "' AND type=10"; $Result = DB_query($SQL,$db); @@ -77,9 +81,9 @@ /*Now delete the DebtorTrans */ -$SQL = 'DELETE FROM debtortrans - WHERE transno =' . $_GET['InvoiceNo'] . ' - AND debtortrans.type=10'; +$SQL = "DELETE FROM debtortrans + WHERE transno ='" . $_GET['InvoiceNo'] . "' + AND debtortrans.type=10"; $DbgMsg = _('The SQL that failed was'); $ErrMsg = _('The debtorTrans record could not be deleted') . ' - ' . _('the sql server returned the following error'); $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); Modified: trunk/Z_ImportFixedAssets.php =================================================================== --- trunk/Z_ImportFixedAssets.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_ImportFixedAssets.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -2,7 +2,6 @@ /* $Id: $*/ /* Script to import fixed assets into a specified period*/ -//$PageSecurity = 15; include('includes/session.inc'); $title = _('Import Fixed Assets'); include('includes/header.inc'); @@ -122,57 +121,57 @@ if (strlen($Description)==0 OR strlen($Description)>50){ prnMsg('The description of the asset is expected to be more than 3 characters long and less than 50 characters long','error'); - echo '<br>' . _('Row:') . $Row . ' - ' . _('Invalid Description:') . ' ' . $Description; + echo '<br />' . _('Row:') . $Row . ' - ' . _('Invalid Description:') . ' ' . $Description; $InputError=true; } if (!is_numeric($DepnRate)){ prnMsg(_('The depreciation rate is expected to be numeric'),'error'); - echo '<br>' . _('Row:') . $Row . ' - ' . _('Invalid Depreciation Rate:') . ' ' . $DepnRate; + echo '<br />' . _('Row:') . $Row . ' - ' . _('Invalid Depreciation Rate:') . ' ' . $DepnRate; $InputError=true; }elseif ($DepnRate<0 OR $DepnRate>100){ prnMsg(_('The depreciation rate is expected to be a number between 0 and 100'),'error'); - echo '<br>' . _('Row:') . $Row . ' - ' ._('Invalid Depreciation Rate:') . ' ' . $DepnRate; + echo '<br />' . _('Row:') . $Row . ' - ' ._('Invalid Depreciation Rate:') . ' ' . $DepnRate; $InputError=true; } if (!is_numeric($AccumDepn)){ prnMsg(_('The accumulated depreciation is expected to be numeric'),'error'); - echo '<br>' . _('Row:') . $Row . ' - ' . _('Invalid Accumulated Depreciation:') . ' ' . $AccumDepn; + echo '<br />' . _('Row:') . $Row . ' - ' . _('Invalid Accumulated Depreciation:') . ' ' . $AccumDepn; $InputError=true; } elseif ($AccumDepn<0){ prnMsg(_('The accumulated depreciation is expected to be either zero or a positive number'),'error'); - echo '<br>' . _('Row:') . $Row . ' - ' . _('Invalid Accumulated Depreciation:') . ' ' . $AccumDepn; + echo '<br />' . _('Row:') . $Row . ' - ' . _('Invalid Accumulated Depreciation:') . ' ' . $AccumDepn; $InputError=true; } if (!is_numeric($Cost)){ prnMsg(_('The cost is expected to be numeric'),'error'); - echo '<br>' . _('Row:') . $Row . ' - ' . _('Invalid Cost:') . ' ' . $Cost; + echo '<br />' . _('Row:') . $Row . ' - ' . _('Invalid Cost:') . ' ' . $Cost; $InputError=true; } elseif ($Cost<=0){ prnMsg(_('The cost is expected to be a positive number'),'error'); - echo '<br>' . _('Row:') . $Row . ' - ' . _('Invalid Cost:') . ' ' . $AccumDepn; + echo '<br />' . _('Row:') . $Row . ' - ' . _('Invalid Cost:') . ' ' . $AccumDepn; $InputError=true; } if ($DepnType !='SL' AND $DepnType!='DV'){ prnMsg(_('The depreciation type must be either "SL" - Straight Line or "DV" - Diminishing Value'),'error'); - echo '<br>' . _('Row:') . $Row . ' - ' . _('Invalid depreciation type:') . ' ' . $DepnType; + echo '<br />' . _('Row:') . $Row . ' - ' . _('Invalid depreciation type:') . ' ' . $DepnType; $InputError = true; } - $result = DB_query('SELECT categoryid FROM fixedassetcategories WHERE categoryid="' . $AssetCategoryID . '"', $db); + $result = DB_query("SELECT categoryid FROM fixedassetcategories WHERE categoryid='" . $AssetCategoryID . "'", $db); if (DB_num_rows($result)==0){ $InputError = true; prnMsg(_('The asset category code entered must be exist in the assetcategories table'),'error'); - echo '<br>' . _('Row:') . $Row . ' - ' . _('Invalid asset category:') . ' ' . $AssetCategoryID; + echo '<br />' . _('Row:') . $Row . ' - ' . _('Invalid asset category:') . ' ' . $AssetCategoryID; } - $result = DB_query('SELECT locationid FROM fixedassetlocations WHERE locationid="' . $AssetLocationCode . '"', $db); + $result = DB_query("SELECT locationid FROM fixedassetlocations WHERE locationid='" . $AssetLocationCode . "'", $db); if (DB_num_rows($result)==0){ $InputError = true; prnMsg(_('The asset location code entered must be exist in the asset locations table'),'error'); - echo '<br>' . _('Row:') . $Row . ' - ' . _('Invalid asset location code:') . ' ' . $AssetLocationCode; + echo '<br />' . _('Row:') . $Row . ' - ' . _('Invalid asset location code:') . ' ' . $AssetLocationCode; } if (!Is_Date($DatePurchased)){ $InputError = true; prnMsg(_('The date purchased must be entered in the format:') . ' ' . $_SESSION['DefaultDateFormat'],'error'); - echo '<br>' . _('Row:') . $Row . ' - ' . _('Invalid date format:') . ' ' . $DatePurchased; + echo '<br />' . _('Row:') . $Row . ' - ' . _('Invalid date format:') . ' ' . $DatePurchased; } if ($DepnType=='DV'){ $DepnType=1; @@ -187,27 +186,27 @@ //attempt to insert the stock item $sql = "INSERT INTO fixedassets (description, - longdescription, - assetcategoryid, - serialno, - barcode, - assetlocation, - cost, - accumdepn, - depntype, - depnrate, - datepurchased) - VALUES ('" . $Description . "', - '" . $LongDescription . "', - '" . $AssetCategoryID . "', - '" . $SerialNo . "', - '" . $BarCode . "', - '" . $AssetLocationCode . "', - '" . $Cost . "', - '" . $AccumDepn . "', - '" . $DepnType . "', - '" . $DepnRate . "', - '" . FormatDateForSQL($DatePurchased) . "')"; + longdescription, + assetcategoryid, + serialno, + barcode, + assetlocation, + cost, + accumdepn, + depntype, + depnrate, + datepurchased) + VALUES ('" . $Description . "', + '" . $LongDescription . "', + '" . $AssetCategoryID . "', + '" . $SerialNo . "', + '" . $BarCode . "', + '" . $AssetLocationCode . "', + '" . $Cost . "', + '" . $AccumDepn . "', + '" . $DepnType . "', + '" . $DepnRate . "', + '" . FormatDateForSQL($DatePurchased) . "')"; $ErrMsg = _('The asset could not be added because'); $DbgMsg = _('The SQL that was used to add the asset and failed was'); @@ -218,43 +217,43 @@ $AssetID = DB_Last_Insert_ID($db, 'fixedassets','assetid'); $sql = "INSERT INTO fixedassettrans ( assetid, - transtype, - transno, - transdate, - periodno, - inputdate, - fixedassettranstype, - amount) - VALUES ( '" . $AssetID . "', - '49', - '" . $TransNo . "', - '" . $_POST['DateToEnter'] . "', - '" . $PeriodNo . "', - '" . Date('Y-m-d') . "', - 'cost', - '" . $Cost . "')"; + transtype, + transno, + transdate, + periodno, + inputdate, + fixedassettranstype, + amount) + VALUES ( '" . $AssetID . "', + '49', + '" . $TransNo . "', + '" . $_POST['DateToEnter'] . "', + '" . $PeriodNo . "', + '" . Date('Y-m-d') . "', + 'cost', + '" . $Cost . "')"; $ErrMsg = _('The transaction for the cost of the asset could not be added because'); $DbgMsg = _('The SQL that was used to add the fixedasset trans record that failed was'); $InsResult = DB_query($sql,$db,$ErrMsg,$DbgMsg); $sql = "INSERT INTO fixedassettrans ( assetid, - transtype, - transno, - transdate, - periodno, - inputdate, - fixedassettranstype, - amount) - VALUES ( '" . $AssetID . "', - '49', - '" . $TransNo . "', - '" . $_POST['DateToEnter'] . "', - '" . $PeriodNo . "', - '" . Date('Y-m-d') . "', - 'depn', - '" . $AccumDepn . "')"; - + transtype, + transno, + transdate, + periodno, + inputdate, + fixedassettranstype, + amount) + VALUES ( '" . $AssetID . "', + '49', + '" . $TransNo . "', + '" . $_POST['DateToEnter'] . "', + '" . $PeriodNo . "', + '" . Date('Y-m-d') . "', + 'depn', + '" . $AccumDepn . "')"; + $ErrMsg = _('The transaction for the cost of the asset could not be added because'); $DbgMsg = _('The SQL that was used to add the fixedasset trans record that failed was'); $InsResult = DB_query($sql,$db,$ErrMsg,$DbgMsg); @@ -285,7 +284,7 @@ echo ' <br /> - <a href="Z_ImportFixedAssets.php?gettemplate=1">Get Import Template</a> + <a href="Z_ImportFixedAssets.php?gettemplate=1">' . _('Get Import Template') . '</a> <br /> <br /> '; @@ -296,17 +295,16 @@ echo '<table class="selection"> <tr><td>' . _('Select Date to Upload B/Fwd Assets To:') . '</td> <td><select name="DateToEnter">'; - $PeriodsResult = DB_query('SELECT lastdate_in_period FROM periods ORDER BY periodno',$db); + $PeriodsResult = DB_query("SELECT lastdate_in_period FROM periods ORDER BY periodno",$db); while ($PeriodRow = DB_fetch_row($PeriodsResult)){ echo '<option value="' . $PeriodRow[0] . '">' . ConvertSQLDate($PeriodRow[0]) . '</option>'; } echo '</select></td></tr>'; echo '<tr><td>' . _('Fixed Assets Upload file:') . '</td><td><input name="SelectedAssetFile" type="file"></tr></table> - <input type="submit" VALUE="' . _('Send File') . '"> + <input type="submit" value="' . _('Send File') . '"> </form>'; } - include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/Z_ImportGLAccountGroups.php =================================================================== --- trunk/Z_ImportGLAccountGroups.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_ImportGLAccountGroups.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -1,8 +1,6 @@ <?php /* $Id$*/ -//$PageSecurity = 11; - include('includes/session.inc'); $title = _('Import Chart of Accounts'); include('includes/header.inc'); @@ -10,7 +8,7 @@ include('api/api_errorcodes.php'); $weberpuser = $_SESSION['UserID']; -$sql='SELECT password FROM www_users WHERE userid="'.$weberpuser.'"'; +$sql="SELECT password FROM www_users WHERE userid='" . $weberpuser . "'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $weberppassword = $myrow[0]; Modified: trunk/Z_ImportGLAccountSections.php =================================================================== --- trunk/Z_ImportGLAccountSections.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_ImportGLAccountSections.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -1,21 +1,19 @@ <?php /* $Id$*/ -//$PageSecurity = 11; - include('includes/session.inc'); $title = _('Import Chart of Accounts'); include('includes/header.inc'); include('xmlrpc/lib/xmlrpc.inc'); include('api/api_errorcodes.php'); -$weberpuser = $_SESSION['UserID']; -$sql='SELECT password FROM www_users WHERE userid="'.$weberpuser.'"'; +$webERPUser = $_SESSION['UserID']; +$sql="SELECT password FROM www_users WHERE userid='" . $webERPUser ."'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $weberppassword = $myrow[0]; -$ServerURL = "http://". $_SERVER['HTTP_HOST'].$rootpath."/api/api_xml-rpc.php"; +$ServerURL = 'http://'. $_SERVER['HTTP_HOST'] . $rootpath . '/api/api_xml-rpc.php'; $DebugLevel = 0; //Set to 0,1, or 2 with 2 being the highest level of debug info @@ -25,7 +23,11 @@ $FieldNames = explode(',', $buffer); $SuccessStyle='style="color:green; font-weight:bold"'; $FailureStyle='style="color:red; font-weight:bold"'; - echo '<table><tr><th>'. _('Account Section') .'</th><th>'. _('Result') . '</th><th>'. _('Comments') .'</th></tr>'; + echo '<table> + <tr><th>'. _('Account Section') .'</th> + <th>'. _('Result') . '</th> + <th>'. _('Comments') .'</th> + </tr>'; $successes=0; $failures=0; while (!feof ($fp)) { @@ -36,7 +38,7 @@ $AccountSectionDetails[$FieldNames[$i]]=$FieldValues[$i]; } $accountsection = php_xmlrpc_encode($AccountSectionDetails); - $user = new xmlrpcval($weberpuser); + $user = new xmlrpcval($webERPUser); $password = new xmlrpcval($weberppassword); $msg = new xmlrpcmsg("weberp.xmlrpc_InsertGLAccountSection", array($accountsection, $user, $password)); @@ -75,7 +77,5 @@ echo '<div class= "centre"><input type="submit" name="update" value="Process"></div>'; echo '</form>'; } - include('includes/footer.inc'); - ?> \ No newline at end of file Modified: trunk/Z_ImportPartCodes.php =================================================================== --- trunk/Z_ImportPartCodes.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_ImportPartCodes.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -1,7 +1,6 @@ <?php /* $Id$*/ -//$PageSecurity = 11; include('includes/session.inc'); $title = _('Import Stock Items'); @@ -9,13 +8,13 @@ include('xmlrpc/lib/xmlrpc.inc'); include('api/api_errorcodes.php'); -$weberpuser = $_SESSION['UserID']; -$sql='SELECT password FROM www_users WHERE userid="'.$weberpuser.'"'; +$webERPUser = $_SESSION['UserID']; +$sql="SELECT password FROM www_users WHERE userid='" . $webERPUser."'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $weberppassword = $myrow[0]; -$ServerURL = "http://". $_SERVER['HTTP_HOST'].$rootpath."/api/api_xml-rpc.php"; +$ServerURL = 'http://'. $_SERVER['HTTP_HOST'] . $rootpath . '/api/api_xml-rpc.php'; $DebugLevel = 0; //Set to 0,1, or 2 with 2 being the highest level of debug info @@ -25,7 +24,12 @@ $FieldNames = explode(',', $buffer); $SuccessStyle='style="color:green; font-weight:bold"'; $FailureStyle='style="color:red; font-weight:bold"'; - echo '<table><tr><th>'. _('Part Code') .'</th><th>'. _('Result') . '</th><th>'. _('Comments') .'</th></tr>'; + echo '<table> + <tr> + <th>'. _('Part Code') .'</th> + <th>'. _('Result') . '</th> + <th>'. _('Comments') .'</th> + </tr>'; $successes=0; $failures=0; while (!feof ($fp)) { @@ -36,7 +40,7 @@ $ItemDetails[$FieldNames[$i]]=$FieldValues[$i]; } $stockitem = php_xmlrpc_encode($ItemDetails); - $user = new xmlrpcval($weberpuser); + $user = new xmlrpcval($webERPUser); $password = new xmlrpcval($weberppassword); $msg = new xmlrpcmsg("weberp.xmlrpc_InsertStockItem", array($stockitem, $user, $password)); @@ -65,7 +69,7 @@ echo '</table>'; fclose ($fp); } else { - $sql = 'select * from locations'; + $sql = "select * from locations"; $result = DB_query($sql,$db); if (DB_num_rows($result)==0) { prnMsg( _('No locations have been set up. At least one location should be set up first'), "error"); Modified: trunk/Z_MakeStockLocns.php =================================================================== --- trunk/Z_MakeStockLocns.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_MakeStockLocns.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -2,30 +2,25 @@ /* $Id$*/ /* Script to make stock locations for all parts that do not have stock location records set up*/ - -//$PageSecurity=15; include ('includes/session.inc'); $title = _('Make LocStock Records'); include('includes/header.inc'); +echo '<br /><br />' . _('This script makes stock location records for parts where they do not already exist'); -echo '<br><br>' . _('This script makes stock location records for parts where they do not already exist'); - -$sql = 'INSERT INTO locstock (stockid, loccode) +$sql = "INSERT INTO locstock (stockid, loccode) SELECT stockmaster.stockid, locations.loccode FROM stockmaster CROSS JOIN locations LEFT JOIN locstock ON stockmaster.stockid = locstock.stockid AND locations.loccode = locstock.loccode - WHERE locstock.stockid IS NULL'; + WHERE locstock.stockid IS NULL"; $ErrMsg = _('The items/locations that need stock location records created cannot be retrieved because'); $Result = DB_query($sql,$db,$ErrMsg); - - -echo '<p>'; +echo '<p />'; prnMsg(_('Any stock items that may not have had stock location records have now been given new location stock records'),'info'); include('includes/footer.inc'); Modified: trunk/Z_PriceChanges.php =================================================================== --- trunk/Z_PriceChanges.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_PriceChanges.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -1,43 +1,41 @@ <?php /* $Id$*/ -//$PageSecurity=15; - include('includes/session.inc'); $title=_('Update Pricing'); include('includes/header.inc'); -echo '<br>' . _('This page updates already existing prices for a specified sales type (price list)') . '. ' . _('Choose between updating only customer special prices where the customer is set up under the price list selected, or all prices under the sales type or just specific prices for a customer for the stock category selected'); +echo '<br />' . _('This page updates already existing prices for a specified sales type (price list)') . '. ' . _('Choose between updating only customer special prices where the customer is set up under the price list selected, or all prices under the sales type or just specific prices for a customer for the stock category selected'); prnMsg (_('This script takes no account of start and end dates of prices and updates all historical prices as well as current prices - better to use new scripts under Inventory -> Maintenance'),'warn'); -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'] . '" />'; -$SQL = 'SELECT sales_type, typeabbrev FROM salestypes'; +$SQL = "SELECT sales_type, typeabbrev FROM salestypes"; $result = DB_query($SQL,$db); echo '<p><table> <tr> - <td>' . _('Select the Price List to update the costs for') .":</td> - <td><select name='PriceList'>"; + <td>' . _('Select the Price List to update the costs for') .':</td> + <td><select name="PriceList">'; if (!isset($_POST['PriceList'])){ - echo '<option selected VALUE=0>' . _('No Price List Selected'); + echo '<option selected value=0>' . _('No Price List Selected') . '</option>'; } while ($PriceLists=DB_fetch_array($result)){ - echo "<option VALUE='" . $PriceLists['typeabbrev'] . "'>" . $PriceLists['sales_type']; + echo '<option value="' . $PriceLists['typeabbrev'] . '">' . $PriceLists['sales_type'] . '</option>'; } echo '</select></td></tr>'; -echo '<tr><td>' . _('Category') . ":</td> - <td><select name='StkCat'>"; +echo '<tr><td>' . _('Category') . ':</td> + <td><select name="StkCat">'; -$sql = 'SELECT categoryid, categorydescription FROM stockcategory'; +$sql = "SELECT categoryid, categorydescription FROM stockcategory"; $ErrMsg = _('The stock categories could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve stock categories and failed was'); @@ -45,19 +43,19 @@ while ($myrow=DB_fetch_array($result)){ if ($myrow['categoryid']==$_POST['StkCat']){ - echo "<option selected VALUE='". $myrow['categoryid'] . "'>" . $myrow['categorydescription']; + echo '<option selected value="'. $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; } else { - echo "<option VALUE='". $myrow['categoryid'] . "'>" . $myrow['categorydescription']; + echo '<option value="'. $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; } } echo '</select></td></tr>'; echo '<tr><td>' . _('Which Prices to update') . ":</td> <td><select name='WhichPrices'>"; - echo "<option VALUE='Only Non-customer special prices'>" . _('Only Non-customer special prices'); - echo "<option VALUE='Only customer special prices'>" . _('Only customer special prices'); - echo "<option VALUE='Both customer special prices and non-customer special prices'>" . _('Both customer special prices and non-customer special prices'); - echo "<option VALUE='Selected customer special prices only'>" . $_SESSION['CustomerID'] . ' ' . _('customer special prices only'); + echo "<option value='Only Non-customer special prices'>" . _('Only Non-customer special prices') . '</option>'; + echo "<option value='Only customer special prices'>" . _('Only customer special prices') . '</option>'; + echo "<option value='Both customer special prices and non-customer special prices'>" . _('Both customer special prices and non-customer special prices') . '</option>'; + echo "<option value='Selected customer special prices only'>" . $_SESSION['CustomerID'] . ' ' . _('customer special prices only') . '</option>'; echo '</select></td></tr>'; if (!isset($_POST['IncreasePercent'])){ @@ -65,28 +63,28 @@ } echo '<tr><td>' . _('Percentage Increase (positive) or decrease (negative)') . "</td> - <td><input name='IncreasePercent' size=4 maxlength=4 VALUE=" . $_POST['IncreasePercent'] . "></td></tr></table>"; + <td><input name='IncreasePercent' size=4 maxlength=4 value=" . $_POST['IncreasePercent'] . "></td></tr></table>"; -echo "<div class='centre'><p><input type=submit name='UpdatePrices' VALUE='" . _('Update Prices') . '\' onclick="return confirm(\'' . _('Are you sure you wish to update all the prices according to the criteria selected?') . '\');"></div>'; +echo "<div class='centre'><p><input type=submit name='UpdatePrices' value='" . _('Update Prices') . '\' onclick="return confirm(\'' . _('Are you sure you wish to update all the prices according to the criteria selected?') . '\');"></div>'; echo '</form>'; if (isset($_POST['UpdatePrices']) AND isset($_POST['StkCat'])){ - echo '<br>' . _('So we are using a price list/sales type of') .' : ' . $_POST['PriceList']; - echo '<br>' . _('and a stock category code of') . ' : ' . $_POST['StkCat']; - echo '<br>' . _('and a increase percent of') . ' : ' . $_POST['IncreasePercent']; + echo '<br />' . _('So we are using a price list/sales type of') .' : ' . $_POST['PriceList']; + echo '<br />' . _('and a stock category code of') . ' : ' . $_POST['StkCat']; + echo '<br />' . _('and a increase percent of') . ' : ' . $_POST['IncreasePercent']; if ($_POST['PriceList']=='0'){ - echo '<br>' . _('The price list/sales type to be updated must be selected first'); + echo '<br />' . _('The price list/sales type to be updated must be selected first'); include ('includes/footer.inc'); exit; } if (ABS($_POST['IncreasePercent']) < 0.5 OR ABS($_POST['IncreasePercent'])>40 OR !is_numeric($_POST['IncreasePercent'])){ - echo '<br>' . _('The increase or decrease to be applied is expected to be an integer between 1 and 40 it is not necessary to enter the').' '. '%'.' '. _('sign') . ' - ' . _('the amount is assumed to be a percentage'); + echo '<br />' . _('The increase or decrease to be applied is expected to be an integer between 1 and 40 it is not necessary to enter the').' '. '%'.' '. _('sign') . ' - ' . _('the amount is assumed to be a percentage'); include ('includes/footer.inc'); exit; } @@ -102,7 +100,7 @@ if ($_POST['WhichPrices'] == 'Only Non-customer special prices'){ - $sql = 'UPDATE prices SET price=price*(1+' . $IncrementPercentage . ") + $sql = "UPDATE prices SET price=price*(1+" . $IncrementPercentage . ") WHERE typeabbrev='" . $_POST['PriceList'] . "' AND stockid='" . $myrow['stockid'] . "' AND typeabbrev='" . $_POST['PriceList'] . "' @@ -125,7 +123,7 @@ } else if ($_POST['WhichPrices'] == 'Selected customer special prices only'){ - $sql = 'UPDATE prices SET price=price*(1+' . $IncrementPercentage . ") + $sql = "UPDATE prices SET price=price*(1+" . $IncrementPercentage . ") WHERE typeabbrev='" . $_POST['PriceList'] . "' AND stockid='" . $myrow['stockid'] . "' AND typeabbrev='" . $_POST['PriceList'] . "' Modified: trunk/Z_ReApplyCostToSA.php =================================================================== --- trunk/Z_ReApplyCostToSA.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_ReApplyCostToSA.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -2,8 +2,6 @@ /* $Id$*/ -//$PageSecurity=15; - include('includes/session.inc'); $title=_('Apply Current Cost to Sales Analysis'); include('includes/header.inc'); @@ -13,33 +11,33 @@ echo "<form method='POST' action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>"; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -$SQL = 'SELECT MonthName(lastdate_in_period) AS mnth, +$SQL = "SELECT MonthName(lastdate_in_period) AS mnth, YEAR(lastdate_in_period) AS yr, periodno - FROM periods'; -echo '<p><div class="centre">' . _('Select the Period to update the costs for') . ":<select name='PeriodNo'>"; + FROM periods"; +echo '<p><div class="centre">' . _('Select the Period to update the costs for') . ':<select name="PeriodNo">'; $result = DB_query($SQL,$db); -echo '<option selected VALUE=0>' . _('No Period Selected'); +echo '<option selected value=0>' . _('No Period Selected') . '</option>'; while ($PeriodInfo=DB_fetch_array($result)){ - echo '<option VALUE=' . $PeriodInfo['periodno'] . '>' . $PeriodInfo['mnth'] . ' ' . $PeriodInfo['Yr']; + echo '<option value=' . $PeriodInfo['periodno'] . '>' . $PeriodInfo['mnth'] . ' ' . $PeriodInfo['Yr'] . '</option>'; } echo '</select>'; -echo "<p><input type=submit name='UpdateSalesAnalysis' VALUE='" . _('Update Sales Analysis Costs') ."'></div>"; +echo '<p><input type=submit name="UpdateSalesAnalysis" value="' . _('Update Sales Analysis Costs') .'"></div>'; echo '</form>'; if (isset($_POST['UpdateSalesAnalysis']) AND $_POST['PeriodNo']!=0){ - $sql = 'SELECT stockmaster.stockid, + $sql = "SELECT stockmaster.stockid, materialcost+overheadcost+labourcost AS standardcost, stockmaster.mbflag FROM salesanalysis INNER JOIN stockmaster ON salesanalysis.stockid=stockmaster.stockid - WHERE periodno=' . $_POST['PeriodNo'] . " + WHERE periodno='" . $_POST['PeriodNo'] . "' AND stockmaster.mbflag<>'D' GROUP BY stockmaster.stockid, stockmaster.materialcost, Modified: trunk/Z_RePostGLFromPeriod.php =================================================================== --- trunk/Z_RePostGLFromPeriod.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_RePostGLFromPeriod.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -2,13 +2,11 @@ /* $Id$*/ -//$PageSecurity=15; - include ('includes/session.inc'); $title = _('Recalculation of GL Balances in Chart Details Table'); include('includes/header.inc'); -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($_POST['FromPeriod'])){ @@ -16,39 +14,37 @@ /*Show a form to allow input of criteria for TB to show */ echo '<table> <tr> - <td>' . _('Select Period From') . ":</td> - <td><select Name='FromPeriod'>"; + <td>' . _('Select Period From') . ':</td> + <td><select Name="FromPeriod">'; - $sql = 'SELECT periodno, + $sql = "SELECT periodno, lastdate_in_period - FROM periods ORDER BY periodno'; + FROM periods ORDER BY periodno"; $Periods = DB_query($sql,$db); while ($myrow=DB_fetch_array($Periods,$db)){ - echo '<option VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']); + echo '<option VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } echo '</select></td> </tr> </table>'; - echo "<div class='centre'><input type=submit Name='recalc' Value='" . _('Do the Recalculation') . "' - onclick=\"return confirm('" . _('Are you sure you wish to re-post all general ledger transactions since the selected period - .... this can take some time?') . '\');"></div></form>'; + echo "<div class='centre'><input type=submit Name='recalc' value='" . _('Do the Recalculation') . "' onclick=\"return confirm('" . _('Are you sure you wish to re-post all general ledger transactions since the selected period this can take some time?') . '\');"></div></form>'; } else { /*OK do the updates */ /* Make the posted flag on all GL entries including and after the period selected = 0 */ - $sql = 'UPDATE gltrans SET posted=0 WHERE periodno >='. $_POST['FromPeriod']; + $sql = "UPDATE gltrans SET posted=0 WHERE periodno >='" . $_POST['FromPeriod'] . "'"; $UpdGLTransPostedFlag = DB_query($sql,$db); /* Now make all the actuals 0 for all periods including and after the period from */ - $sql = 'UPDATE chartdetails SET actual =0 WHERE period >= ' . $_POST['FromPeriod']; + $sql = "UPDATE chartdetails SET actual =0 WHERE period >= '" . $_POST['FromPeriod'] . "'"; $UpdActualChartDetails = DB_query($sql,$db); - $ChartDetailBFwdResult = DB_query('SELECT accountcode, bfwd FROM chartdetails WHERE period=' . $_POST['FromPeriod'],$db); + $ChartDetailBFwdResult = DB_query("SELECT accountcode, bfwd FROM chartdetails WHERE period='" . $_POST['FromPeriod'] . "'",$db); while ($ChartRow=DB_fetch_array($ChartDetailBFwdResult)){ - $sql = 'UPDATE chartdetails SET bfwd =' . $ChartRow['bfwd'] . ' WHERE period > ' . $_POST['FromPeriod'] . ' AND accountcode=' . $ChartRow['accountcode']; + $sql = "UPDATE chartdetails SET bfwd ='" . $ChartRow['bfwd'] . "' WHERE period > '" . $_POST['FromPeriod'] . "' AND accountcode='" . $ChartRow['accountcode'] . "'"; $UpdActualChartDetails = DB_query($sql,$db); } Modified: trunk/Z_ReverseSuppPaymentRun.php =================================================================== --- trunk/Z_ReverseSuppPaymentRun.php 2011-04-08 23:37:01 UTC (rev 4542) +++ trunk/Z_ReverseSuppPaymentRun.php 2011-04-09 06:12:05 UTC (rev 4543) @@ -4,7 +4,7 @@ /* Script to delete all supplier payments entered or created from a payment run on a specified day */ -//$PageSecurity=15; + include ('includes/session.inc'); $title = _('Reverse and Delete Supplier Payments'); include('includes/header.inc'); @@ -83,10 +83,10 @@ } -echo "<form method=post action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>"; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; +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 "<input type=submit name='RevPayts' value='" . _('Reverse Supplier Payments on the Date Entered') . "'>"; +echo '<input type="submit" name="RevPayts" value="' . _('Reverse Supplier Payments on the Date Entered') . '">'; echo '</form>'; include('includes/footer.inc'); Modified: trunk/Z_SalesIntegrityCheck... [truncated message content] |
From: <dai...@us...> - 2011-04-10 02:05:04
|
Revision: 4544 http://web-erp.svn.sourceforge.net/web-erp/?rev=4544&view=rev Author: daintree Date: 2011-04-10 02:04:57 +0000 (Sun, 10 Apr 2011) Log Message: ----------- Tim changes Modified Paths: -------------- trunk/PaymentMethods.php trunk/Payments.php trunk/Stocks.php trunk/doc/Change.log.html trunk/includes/ConnectDB.inc trunk/index.php trunk/sql/mysql/upgrade3.11.1-4.00.sql Added Paths: ----------- trunk/PDFPeriodStockTransListing.php trunk/includes/PDFPeriodStockTransListingPageHeader.inc Removed Paths: ------------- trunk/PDFStockTransListing.php trunk/includes/PDFStockTransListingPageHeader.inc Added: trunk/PDFPeriodStockTransListing.php =================================================================== --- trunk/PDFPeriodStockTransListing.php (rev 0) +++ trunk/PDFPeriodStockTransListing.php 2011-04-10 02:04:57 UTC (rev 4544) @@ -0,0 +1,203 @@ +<?php +/* $Id: PDFPeriodStockTransListing.php 4307 2010-12-22 16:06:03Z tim_schofield $*/ + + +include('includes/SQL_CommonFunctions.inc'); +include ('includes/session.inc'); + +$InputError=0; +if (isset($_POST['FromDate']) AND !Is_Date($_POST['FromDate'])){ + $msg = _('The date must be specified in the format') . ' ' . $_SESSION['DefaultDateFormat']; + $InputError=1; + unset($_POST['FromDate']); +} + +if (!isset($_POST['FromDate'])){ + + $title = _('Stock 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="">' . ' ' + . _('Stock Transaction Listing').'</img></p></div>'; + + 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>'; + echo '<tr> + <td>' . _('Enter the date from which the transactions 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 the transactions 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>' . _('Transaction type') . '</td><td>'; + + echo '<select name="TransType">'; + + echo '<option value=10>' . _('Sales Invoice').'</option> + <option value=11>' . _('Sales Credit Note').'</option> + <option value=16>' . _('Location Transfer').'</option> + <option value=17>' . _('Stock Adjustment').'</option> + <option value=25>' . _('Purchase Order Delivery').'</option> + <option value=26>' . _('Work Order Receipt').'</option> + <option value=28>' . _('Work Order Issue').'</option>'; + + echo '</select></td></tr>'; + + $sql = "SELECT loccode, locationname FROM locations"; + $resultStkLocs = DB_query($sql, $db); + + echo '<tr><td>' . _('For Stock Location') . ':</td> + <td><select name="StockLocation">'; + echo '<option VALUE="All">' . _('All') . '</option>'; + while ($myrow=DB_fetch_array($resultStkLocs)){ + if (isset($_POST['StockLocation']) AND $_POST['StockLocation']!='All'){ + if ($myrow['loccode'] == $_POST['StockLocation']){ + echo '<option selected VALUE="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + } else { + echo '<option VALUE="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + } + } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ + echo '<option selected VALUE="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + $_POST['StockLocation']=$myrow['loccode']; + } else { + echo '<option VALUE="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + } + } + echo '</select></td></tr>'; + + echo '</table><br><div class="centre"><input type=submit name="Go" value="' . _('Create PDF') . '"></div>'; + + include('includes/footer.inc'); + exit; +} else { + + include('includes/ConnectDB.inc'); +} + + +if ($_POST['StockLocation']=='All') { + $sql= "SELECT stockmoves.type, + stockmoves.stockid, + stockmaster.description, + stockmaster.decimalplaces, + stockmoves.transno, + stockmoves.trandate, + stockmoves.qty, + stockmoves.reference, + stockmoves.narrative, + locations.locationname + FROM stockmoves + LEFT JOIN stockmaster + ON stockmoves.stockid=stockmaster.stockid + LEFT JOIN locations + ON stockmoves.loccode=locations.loccode + WHERE type='" . $_POST['TransType'] . "' + AND date_format(trandate, '%Y-%m-%d')>='".FormatDateForSQL($_POST['FromDate'])."' + AND date_format(trandate, '%Y-%m-%d')<='".FormatDateForSQL($_POST['ToDate'])."'"; +} else { + $sql= "SELECT stockmoves.type, + stockmoves.stockid, + stockmaster.description, + stockmaster.decimalplaces, + stockmoves.transno, + stockmoves.trandate, + stockmoves.qty, + stockmoves.reference, + stockmoves.narrative, + locations.locationname + FROM stockmoves + LEFT JOIN stockmaster + ON stockmoves.stockid=stockmaster.stockid + LEFT JOIN locations + ON stockmoves.loccode=locations.loccode + WHERE type='" . $_POST['TransType'] . "' + AND date_format(trandate, '%Y-%m-%d')>='".FormatDateForSQL($_POST['FromDate'])."' + AND date_format(trandate, '%Y-%m-%d')<='".FormatDateForSQL($_POST['ToDate'])."' + AND stockmoves.loccode='" . $_POST['StockLocation'] . "'"; +} +$result=DB_query($sql,$db,'','',false,false); + +if (DB_error_no($db)!=0){ + $title = _('Transaction Listing'); + include('includes/header.inc'); + prnMsg(_('An error occurred getting the transactions'),'error'); + include('includes/footer.inc'); + exit; +} elseif (DB_num_rows($result) == 0){ + $title = _('Transaction Listing'); + include('includes/header.inc'); + echo '<br>'; + prnMsg (_('There were no transactions found in the database between the dates') . ' ' . $_POST['FromDate'] . ' ' . _('and') . ' '. $_POST['ToDate'] .'<br />' ._('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',_('Stock Transaction Listing')); +$pdf->addInfo('Subject',_('Stock transaction listing from') . ' ' . $_POST['FromDate'] . ' ' . $_POST['ToDate']); +$line_height=12; +$PageNumber = 1; + + +switch ($_POST['TransType']) { + case 10: + $TransType=_('Customer Invoices'); + break; + case 11: + $TransType=_('Customer Credit Notes'); + break; + case 16: + $TransType=_('Location Transfers'); + break; + case 17: + $TransType=_('Stock Adjustments'); + break; + case 25: + $TransType=_('Purchase Order Deliveries'); + break; + case 26: + $TransType=_('Work Order Receipts'); + break; + case 28: + $TransType=_('Work Order Issues'); + break; +} + +include ('includes/PDFPeriodStockTransListingPageHeader.inc'); + +while ($myrow=DB_fetch_array($result)){ + + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,160,$FontSize,$myrow['description'], 'left'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+162,$YPos,80,$FontSize,$myrow['transno'], '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['qty'],$myrow['decimalplaces']), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+382,$YPos,70,$FontSize,$myrow['locationname'], 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,$myrow['reference'], 'right'); + + $YPos -= ($line_height); + + if ($YPos - (2 *$line_height) < $Bottom_Margin){ + /*Then set up a new page */ + $PageNumber++; + include ('includes/PDFPeriodStockTransListingPageHeader.inc'); + } /*end of new page header */ +} /* end of while there are customer receipts in the batch to print */ + + +$YPos-=$line_height; + +$ReportFileName = $_SESSION['DatabaseName'] . '_StockTransListing_' . date('Y-m-d').'.pdf'; +$pdf->OutputD($ReportFileName); +$pdf->__destruct(); + +?> \ No newline at end of file Deleted: trunk/PDFStockTransListing.php =================================================================== --- trunk/PDFStockTransListing.php 2011-04-09 06:12:05 UTC (rev 4543) +++ trunk/PDFStockTransListing.php 2011-04-10 02:04:57 UTC (rev 4544) @@ -1,145 +0,0 @@ -<?php - -/* $Id$*/ - -/* $Revision: 1.13 $ */ - -//$PageSecurity = 3; -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 = _('Stock 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="" />' . ' ' - . _('Stock Transaction Listing').'</p></div>'; - - 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=10>' . _('Sales Invoice').'</option>'; - echo '<option value=11>' . _('Sales Credit Note').'</option>'; - echo '<option value=16>' . _('Location Transfer').'</option>'; - echo '<option value=17>' . _('Stock Adjustment').'</option>'; - echo '<option value=25>' . _('Purchase Order Delivery').'</option>'; - echo '<option value=26>' . _('Work Order Receipt').'</option>'; - echo '<option value=28>' . _('Work Order Issue').'</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 stockmoves.type, - stockmoves.stockid, - stockmaster.description, - stockmaster.decimalplaces, - stockmoves.transno, - stockmoves.trandate, - stockmoves.qty, - stockmoves.reference, - stockmoves.narrative, - locations.locationname - FROM stockmoves - LEFT JOIN stockmaster - ON stockmoves.stockid=stockmaster.stockid - LEFT JOIN locations - ON stockmoves.loccode=locations.loccode - WHERE type='" . $_POST['TransType'] . "' - AND date_format(trandate, '%Y-%m-%d')='".FormatDateForSQL($_POST['Date'])."'"; - -$result=DB_query($sql,$db,'','',false,false); - -if (DB_error_no($db)!=0){ - $title = _('Transaction Listing'); - include('includes/header.inc'); - prnMsg(_('An error occurred getting the transactions'),'error'); - include('includes/footer.inc'); - exit; -} elseif (DB_num_rows($result) == 0){ - $title = _('Transaction 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',_('Stock Transaction Listing')); -$pdf->addInfo('Subject',_('Stock transaction listing from') . ' ' . $_POST['Date'] ); -$line_height=12; -$PageNumber = 1; - -include ('includes/PDFStockTransListingPageHeader.inc'); - -while ($myrow=DB_fetch_array($result)){ - - $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,160,$FontSize,$myrow['description'], 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+162,$YPos,80,$FontSize,$myrow['transno'], '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['qty'],$myrow['decimalplaces']), 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+382,$YPos,70,$FontSize,$myrow['locationname'], 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,$myrow['reference'], 'right'); - - $YPos -= ($line_height); - - if ($YPos - (2 *$line_height) < $Bottom_Margin){ - /*Then set up a new page */ - $PageNumber++; - include ('includes/PDFStockTransListingPageHeader.inc'); - } /*end of new page header */ -} /* end of while there are customer receipts in the batch to print */ - - -$YPos-=$line_height; - -/* 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'] . '_StockTransListing_' . date('Y-m-d').'.pdf'; -$pdf->OutputD($ReportFileName);//UldisN -$pdf->__destruct(); //UldisN - -?> \ No newline at end of file Modified: trunk/PaymentMethods.php =================================================================== --- trunk/PaymentMethods.php 2011-04-09 06:12:05 UTC (rev 4543) +++ trunk/PaymentMethods.php 2011-04-10 02:04:57 UTC (rev 4544) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.9 $ */ + /* $Id$*/ -//$PageSecurity = 15; - include('includes/session.inc'); $title = _('Payment Methods'); @@ -72,8 +70,9 @@ $sql = "UPDATE paymentmethods SET paymentname='" . $_POST['MethodName'] . "', paymenttype = '" . $_POST['ForPayment'] . "', - receipttype = '" . $_POST['ForReceipt'] . "' - WHERE paymentname LIKE '".$OldName."'"; + receipttype = '" . $_POST['ForReceipt'] . "', + usepreprintedstationery = '" . $_POST['UsePrePrintedStationery']. "' + WHERE paymentname " . LIKE . " '".$OldName."'"; /* lets leave well alone existing entries if ($_POST['MethodName'] != $OldMeasureName ) { @@ -103,11 +102,13 @@ $sql = "INSERT INTO paymentmethods ( paymentname, paymenttype, - receipttype) + receipttype, + usepreprintedstationery) VALUES ( '" . $_POST['MethodName'] ."', '" . $_POST['ForPayment'] ."', '" . $_POST['ForReceipt'] ."' + '" . $_POST['UsePrePrintedStationery'] ."' )"; } $msg = _('Record inserted'); @@ -124,6 +125,7 @@ unset ($_POST['MethodName']); unset ($_POST['ForPayment']); unset ($_POST['ForReceipt']); + unset ($_POST['UsePrePrintedStationery']); } elseif (isset($_GET['delete'])) { //the link to delete a selected record was clicked instead of the submit button @@ -143,12 +145,12 @@ $myrow = DB_fetch_row($result); if ($myrow[0]>0) { prnMsg( _('Cannot delete this payment method because bank transactions have been created using this payment method'),'warn'); - echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('bank transactions that refer to this payment method') . '</font>'; + echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('bank transactions that refer to this payment method') . '</font>'; } else { - $sql="DELETE FROM paymentmethods WHERE paymentname LIKE '" . $OldMeasureName . "'"; + $sql="DELETE FROM paymentmethods WHERE paymentname " . LIKE . " '" . $OldMeasureName . "'"; $result = DB_query($sql,$db); prnMsg( $OldMeasureName . ' ' . _('payment method has been deleted') . '!','success'); - echo '<br>'; + echo '<br />'; } //end if not used } //end if payment method exist unset ($SelectedPaymentID); @@ -174,19 +176,21 @@ $sql = "SELECT paymentid, paymentname, paymenttype, - receipttype + receipttype, + usepreprintedstationery FROM paymentmethods ORDER BY paymentid"; $ErrMsg = _('Could not get payment methods because'); $result = DB_query($sql,$db,$ErrMsg); - echo "<table class=selection> + echo '<table class=selection> <tr> - <th>" . _('Payment Method') . "</th> - <th>" . _('For Payments') . "</th> - <th>" . _('For Receipts') . "</th> - </tr>"; + <th>' . _('Payment Method') . '</th> + <th>' . _('For Payments') . '</th> + <th>' . _('For Receipts') . '</th> + <th>' . _('Use Pre-printed') .'<br />' . _('Stationery') . '</th> + </tr>'; $k=0; //row colour counter while ($myrow = DB_fetch_array($result)) { @@ -202,8 +206,9 @@ echo '<td>' . $myrow['paymentname'] . '</td>'; echo '<td>' . ($myrow['paymenttype'] ? _('Yes') : _('No')) . '</td>'; echo '<td>' . ($myrow['receipttype'] ? _('Yes') : _('No')) . '</td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&SelectedPaymentID=' . $myrow['paymentid'] . '">' . _('Edit') . '</a></td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&SelectedPaymentID=' . $myrow['paymentid'] . '&delete=1">' . _('Delete') .'</a></td>'; + echo '<td>' . ($myrow['usepreprintedstationery'] ? _('Yes') : _('No')) . '</td>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedPaymentID=' . $myrow['paymentid'] . '">' . _('Edit') . '</a></td>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedPaymentID=' . $myrow['paymentid'] . '&delete=1">' . _('Delete') .'</a></td>'; echo '</tr>'; } //END WHILE LIST LOOP @@ -219,7 +224,7 @@ 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($SelectedPaymentID)) { @@ -228,7 +233,8 @@ $sql = "SELECT paymentid, paymentname, paymenttype, - receipttype + receipttype, + usepreprintedstationery FROM paymentmethods WHERE paymentid='" . $SelectedPaymentID . "'"; @@ -243,37 +249,45 @@ $_POST['MethodName'] = $myrow['paymentname']; $_POST['ForPayment'] = $myrow['paymenttype']; $_POST['ForReceipt'] = $myrow['receipttype']; + $_POST['UsePrePrintedStationery'] = $myrow['usepreprintedstationery']; - echo "<input type=hidden name='SelectedPaymentID' VALUE='" . $_POST['MethodID'] . "'>"; - echo "<table class=selection>"; + echo '<input type="hidden" name="SelectedPaymentID" value="' . $_POST['MethodID'] . '">'; + echo '<table class="selection">'; } } else { $_POST['MethodName']=''; $_POST['ForPayment'] = 1; // Default is use for payment $_POST['ForReceipt'] = 1; // Default is use for receipts - echo "<table class=selection>"; + $_POST['UsePrePrintedStationery'] = 0; // Default is use for receipts + echo '<table class=selection>'; } - echo "<tr> - <td>" . _('Payment Method') . ':' . "</td> - <td><input type='Text' ". (in_array('MethodName',$Errors) ? 'class="inputerror"' : '' ) ." name='MethodName' size=30 maxlength=30 value='" . $_POST['MethodName'] . "'></td> - </tr>"; - echo "<tr> - <td>" . _('Use For Payments') . ':' . "</td> - <td><select name='ForPayment'>"; - echo "<option".($_POST['ForPayment'] ? ' selected' : '') ." VALUE='1'>" . _('Yes'); - echo "<option".($_POST['ForPayment'] ? '' : ' selected') ." VALUE='0'>" . _('No'); - echo "</select></td></tr>"; - echo "<tr> - <td>" . _('Use For Receipts') . ':' . "</td> - <td><select name='ForReceipt'>"; - echo "<option".($_POST['ForReceipt'] ? ' selected' : '') ." VALUE='1'>" . _('Yes'); - echo "<option".($_POST['ForReceipt'] ? '' : ' selected') ." VALUE='0'>" . _('No'); - echo "</select></td></tr>"; + echo '<tr> + <td>' . _('Payment Method') . ':' . '</td> + <td><input type="Text" '. (in_array('MethodName',$Errors) ? 'class="inputerror"' : '' ) .' name="MethodName" size="30" maxlength="30" value="' . $_POST['MethodName'] . '"></td> + </tr>'; + echo '<tr> + <td>' . _('Use For Payments') . ':' . '</td> + <td><select name="ForPayment"> + <option' . ($_POST['ForPayment'] ? ' selected' : '') .' value="1">' . _('Yes') . '</option> + <option' . ($_POST['ForPayment'] ? '' : ' selected') .' value="0">' . _('No') . '</select></td> + </tr>'; + echo '<tr> + <td>' . _('Use For Receipts') . ':' . '</td> + <td><select name="ForReceipt"> + <option' . ($_POST['ForReceipt'] ? ' selected' : '') .' value="1">' . _('Yes') . '</option> + <option' . ($_POST['ForReceipt'] ? '' : ' selected') .' value="0">' . _('No') . '</option> + </select></td></tr>'; + echo '<tr> + <td>' . _('Use Pre-printed Stationery') . ':' . '</td> + <td><select name="UsePrePrintedStationery"> + <option' . ($_POST['UsePrePrintedStationery'] ? ' selected': '' ) .' value="1">' . _('Yes') . '</option> + <option' . ($_POST['UsePrePrintedStationery']==1 ? '' : ' selected' ) .' value="0">' . _('No') . '</option> + </select></td></tr>'; echo '</table>'; - echo '<br><div class="centre"><input type=Submit name=submit value=' . _('Enter Information') . '></div>'; + echo '<br /><div class="centre"><input type=Submit name=submit value=' . _('Enter Information') . '></div>'; echo '</form>'; Modified: trunk/Payments.php =================================================================== --- trunk/Payments.php 2011-04-09 06:12:05 UTC (rev 4543) +++ trunk/Payments.php 2011-04-10 02:04:57 UTC (rev 4544) @@ -246,11 +246,16 @@ $PeriodNo = GetPeriod($_SESSION['PaymentDetail']->DatePaid,$db); + $sql="SELECT usepreprintedstationery + FROM paymentmethods + WHERE paymentname='" . $_SESSION['PaymentDetail']->Paymenttype ."'"; + $result=DB_query($sql, $db); + $myrow=DB_fetch_row($result); // first time through commit if supplier cheque then print it first if ((!isset($_POST['ChequePrinted'])) AND (!isset($_POST['PaymentCancelled'])) - AND ($_SESSION['PaymentDetail']->Paymenttype == 'Cheque')) { + AND ($myrow[0] == 1)) { // it is a supplier payment by cheque and haven't printed yet so print cheque echo '<br /><a href="' . $rootpath . '/PrintCheque.php?' . SID . '&ChequeNum=' . $_POST['ChequeNum'] . '">' . _('Print Cheque using pre-printed stationery') . '</a><br /><br />'; @@ -607,14 +612,14 @@ $_SESSION['PaymentDetail']->Remove_GLItem($_GET['Delete']); } elseif (isset($_POST['Process']) and !$BankAccountEmpty){ //user hit submit a new GL Analysis line into the payment - $ChequeNoSQL='select account from gltrans where chequeno="'.$_POST['cheque'].'"'; + $ChequeNoSQL="SELECT account FROM gltrans WHERE chequeno='" . $_POST['cheque'] ."'"; $ChequeNoResult=DB_query($ChequeNoSQL, $db); if (is_numeric($_POST['GLManualCode'])){ - $SQL = "select accountname - FROM chartmaster - WHERE accountcode='" . $_POST['GLManualCode'] . "'"; + $SQL = "SELECT accountname + FROM chartmaster + WHERE accountcode='" . $_POST['GLManualCode'] . "'"; $Result=DB_query($SQL,$db); Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2011-04-09 06:12:05 UTC (rev 4543) +++ trunk/Stocks.php 2011-04-10 02:04:57 UTC (rev 4544) @@ -22,12 +22,15 @@ $myrow = DB_fetch_row($result); if ($myrow[0]==0) { $New=1; + } else { + $New=0; } } -?> +if (isset($_POST['New'])) { + $New=$_POST['New']; +} -<?php echo '<a href="' . $rootpath . '/SelectProduct.php?' . SID . '">' . _('Back to Items') . '</a><br>' . "\n"; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' @@ -62,7 +65,6 @@ $result = move_uploaded_file($_FILES['ItemPicture']['tmp_name'], $filename); $message = ($result)?_('File url') ."<a href='". $filename ."'>" . $filename . '</a>' : _('Something is wrong with uploading a file'); } - /* EOR Add Image upload for New Item - by Ori */ } if (isset($Errors)) { @@ -202,7 +204,7 @@ if ($_POST['Serialised']==1){ /*Not appropriate to have several dp on serial items */ $_POST['DecimalPlaces']=0; } - if (!isset($_POST['New']) and !isset($New)) { /*so its an existing one */ + if ($New==0) { /*so its an existing one */ /*first check on the changes being made we must disallow: - changes from manufactured or purchased to Service, Assembly or Kitset if there is stock - changes from manufactured, kitset or assembly where a BOM exists @@ -447,6 +449,7 @@ }//THE INSERT OF THE NEW CODE WORKED SO BANG IN THE STOCK LOCATION RECORDS TOO }//END CHECK FOR ALREADY EXISTING ITEM OF THE SAME CODE } + $New=1; } else { echo '<br>'. "\n"; @@ -563,7 +566,7 @@ unset($StockID); //echo "<meta http-equiv='Refresh' content='0; url=" . $rootpath . '/SelectProduct.php?' . SID ."'>"; - + $New=1; } //end if Delete Part } @@ -572,17 +575,20 @@ <tr><td>'. "\n"; // Nested table echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; +echo '<input type="hidden" name="New" value="'.$New.'">'. "\n"; + if (!isset($StockID) or $StockID=='' or isset($_POST['UpdateCategories'])) { /*If the page was called without $StockID passed to page then assume a new stock item is to be entered show a form with a part Code field other wise the form showing the fields with the existing entries against the part will show for editing with only a hidden StockID field. New is set to flag that the page may have called itself and still be entering a new part, in which case the page needs to know not to go looking up details for an existing part*/ - - $New = true; - echo '<input type="hidden" name="New" value="1">'. "\n"; if (!isset($StockID)) { - echo '<tr><td>'. _('Item Code'). ':</td><td><input ' . (in_array('StockID',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="StockID" size=21 maxlength=20 /></td></tr>'. "\n"; + $StockID=''; + } + if ($New==1) { + echo '<tr><td>'. _('Item Code'). ':</td><td><input ' . (in_array('StockID',$Errors) ? 'class="inputerror"' : '' ) .' type="text" + value="'.$StockID.'" name="StockID" size=21 maxlength=20 /></td></tr>'. "\n"; } else { - echo '<tr><td>'. _('Item Code'). ':</td><td><input ' . (in_array('StockID',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="StockID" size=21 maxlength=20 - value="'.$StockID.'" /></td></tr>'. "\n"; + echo '<tr><td>'. _('Item Code'). ':</td><td>'.$StockID.'</td></tr>'. "\n"; + echo '<input type="hidden" name ="StockID" value="'.$StockID.'" />'; } } elseif (!isset($_POST['UpdateCategories']) and $InputError!=1) { // Must be modifying an existing item and no changes made yet @@ -1016,7 +1022,7 @@ echo '</table><br>'; echo '<input type="hidden" name="PropertyCounter" value=' . $PropertyCounter . '>'; -if (isset($New)) { +if ($New==1) { echo '<input type="Submit" name="submit" value="' . _('Insert New Item') . '">'; echo '<input type="submit" name="UpdateCategories" style="visibility:hidden;width:1px" value="' . _('Categories') . '">'; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-04-09 06:12:05 UTC (rev 4543) +++ trunk/doc/Change.log.html 2011-04-10 02:04:57 UTC (rev 4544) @@ -1,5 +1,10 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p /> +<p> +<p>10/4/11 Tim: PDFPeriodStockTransListing - new report to print off stock transactions of a specified type for a selected period>/p> +<p>10/4/11 Tim: PDFStockTransListing.php option to print off transactions by inventory location</p> +<p>10/4/11 Tim: Stocks.php - more logical use of $New and $_POST['New']</p> +<p>10/4/11 Tim: Payments.php PaymentMethods.php Add new field userpreprintedstationery to payment methods to determine whether to print cheques</p> <p>5/4/11 Tim: includes/LanguageSetup.php - discovered solution to Turkish character set problem!!</p> <p>5/4/11 Phil: couple of is_date functions left over from experiment to see if changing fixed Turkish - now removed from SupplierInvoice.php and PDFOrdersInvoiced.php</p> <p>5/4/11 Phil: SuppCreditGRNs was not showing old GRNs and no way to input an older date</p> Modified: trunk/includes/ConnectDB.inc =================================================================== --- trunk/includes/ConnectDB.inc 2011-04-09 06:12:05 UTC (rev 4543) +++ trunk/includes/ConnectDB.inc 2011-04-10 02:04:57 UTC (rev 4544) @@ -4,7 +4,7 @@ * this value is saved in the $_SESSION['Versionumber'] when includes/GetConfig.php is run * if VersionNumber is < $Version then the DB update script is run */ -$Version='4.03.6'; //must update manually every time there is a DB change +$Version='4.03.7'; //must update manually every time there is a DB change require_once ($PathPrefix .'includes/MiscFunctions.php'); Added: trunk/includes/PDFPeriodStockTransListingPageHeader.inc =================================================================== --- trunk/includes/PDFPeriodStockTransListingPageHeader.inc (rev 0) +++ trunk/includes/PDFPeriodStockTransListingPageHeader.inc 2011-04-10 02:04:57 UTC (rev 4544) @@ -0,0 +1,59 @@ +<?php +/* $Id: PDFPeriodStockTransListingPageHeader.inc 4307 2010-12-22 16:06:03Z tim_schofield $*/ + +if ($PageNumber>1){ + $pdf->newPage(); +} + +$YPos = $Page_Height - $Top_Margin - 50; + +$pdf->addJpegFromFile($_SESSION['LogoFile'],$Left_Margin,$YPos,0,50); + +$FontSize=15; + + +$XPos = $Page_Width/2; +$YPos += 30; +$pdf->addText($XPos, $YPos,$FontSize, $_SESSION['CompanyRecord']['coyname']); +$FontSize=12; +$YPos -=30; +$pdf->addText($XPos, $YPos,$FontSize, $TransType . ' ' ._('dated from') . ' ' . $_POST['FromDate'] . ' ' . _('to') . ' ' . $_POST['ToDate']); + + +$XPos = $Page_Width-$Right_Margin-50; +$YPos -=30; +$pdf->addText($XPos, $YPos+10,$FontSize, _('Page') . ': ' . $PageNumber); + +/*Now print out the company name and address */ +$XPos = $Left_Margin; +$YPos -= $line_height; + +/*draw a square grid for entering line items */ +$pdf->line($XPos, $YPos,$Page_Width-$Right_Margin, $YPos); +$pdf->line($Page_Width-$Right_Margin, $YPos,$Page_Width-$Right_Margin, $Bottom_Margin); +$pdf->line($Page_Width-$Right_Margin, $Bottom_Margin,$XPos, $Bottom_Margin); +$pdf->line($XPos, $Bottom_Margin,$XPos, $YPos); + +$pdf->line($Left_Margin+160, $YPos,$Left_Margin+160, $Bottom_Margin); +$pdf->line($Left_Margin+240, $YPos,$Left_Margin+240, $Bottom_Margin); +$pdf->line($Left_Margin+310, $YPos,$Left_Margin+310, $Bottom_Margin); +$pdf->line($Left_Margin+384, $YPos,$Left_Margin+384, $Bottom_Margin); +$pdf->line($Left_Margin+454, $YPos,$Left_Margin+454, $Bottom_Margin); + +$YPos -= $line_height; +/*Set up headings */ +$FontSize=8; + +$LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,160,$FontSize,_('Stock Item'), 'left'); +$LeftOvers = $pdf->addTextWrap($Left_Margin+162,$YPos,80,$FontSize,_('Reference'), 'left'); +$LeftOvers = $pdf->addTextWrap($Left_Margin+242,$YPos,70,$FontSize,_('Trans Date'), 'left'); +$LeftOvers = $pdf->addTextWrap($Left_Margin+312,$YPos,70,$FontSize,_('Quantity'), 'right'); +$LeftOvers = $pdf->addTextWrap($Left_Margin+382,$YPos,70,$FontSize,_('Location'), 'right'); +$LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,_('Reference'), 'right'); +$YPos-=$line_height; + +/*draw a line */ +$pdf->line($XPos, $YPos,$Page_Width-$Right_Margin, $YPos); + +$YPos -= ($line_height); +?> \ No newline at end of file Deleted: trunk/includes/PDFStockTransListingPageHeader.inc =================================================================== --- trunk/includes/PDFStockTransListingPageHeader.inc 2011-04-09 06:12:05 UTC (rev 4543) +++ trunk/includes/PDFStockTransListingPageHeader.inc 2011-04-10 02:04:57 UTC (rev 4544) @@ -1,79 +0,0 @@ -<?php -/* $Id$*/ -if ($PageNumber>1){ - $pdf->newPage(); -} - -$YPos = $Page_Height - $Top_Margin - 50; - -$pdf->addJpegFromFile($_SESSION['LogoFile'],$Left_Margin,$YPos,0,50); - -$FontSize=15; - -Switch ($_POST['TransType']) { - case 10: - $TransType=_('Customer Invoices'); - break; - case 11: - $TransType=_('Customer Credit Notes'); - break; - case 16: - $TransType=_('Location Transfers'); - break; - case 17: - $TransType=_('Stock Adjustments'); - break; - case 25: - $TransType=_('Purchase Order Deliveries'); - break; - case 26: - $TransType=_('Work Order Receipts'); - break; - case 28: - $TransType=_('Work Order Issues'); - break; -} - -$XPos = $Page_Width/2; -$YPos += 30; -$pdf->addText($XPos, $YPos,$FontSize, $_SESSION['CompanyRecord']['coyname']); -$FontSize=12; -$pdf->addText($XPos, $YPos-20,$FontSize, $TransType . ' ' ._('dated') . ' ' . $_POST['Date']); - -$XPos = $Page_Width-$Right_Margin-50; -$YPos -=30; -$pdf->addText($XPos, $YPos+10,$FontSize, _('Page') . ': ' . $PageNumber); - -/*Now print out the company name and address */ -$XPos = $Left_Margin; -$YPos -= $line_height; - -/*draw a square grid for entering line items */ -$pdf->line($XPos, $YPos,$Page_Width-$Right_Margin, $YPos); -$pdf->line($Page_Width-$Right_Margin, $YPos,$Page_Width-$Right_Margin, $Bottom_Margin); -$pdf->line($Page_Width-$Right_Margin, $Bottom_Margin,$XPos, $Bottom_Margin); -$pdf->line($XPos, $Bottom_Margin,$XPos, $YPos); - -$pdf->line($Left_Margin+160, $YPos,$Left_Margin+160, $Bottom_Margin); -$pdf->line($Left_Margin+240, $YPos,$Left_Margin+240, $Bottom_Margin); -$pdf->line($Left_Margin+310, $YPos,$Left_Margin+310, $Bottom_Margin); -$pdf->line($Left_Margin+384, $YPos,$Left_Margin+384, $Bottom_Margin); -$pdf->line($Left_Margin+454, $YPos,$Left_Margin+454, $Bottom_Margin); - -$YPos -= $line_height; -/*Set up headings */ -$FontSize=8; - -$LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,160,$FontSize,_('Stock Item'), 'left'); -$LeftOvers = $pdf->addTextWrap($Left_Margin+162,$YPos,80,$FontSize,_('Reference'), 'left'); -$LeftOvers = $pdf->addTextWrap($Left_Margin+242,$YPos,70,$FontSize,_('Trans Date'), 'left'); -$LeftOvers = $pdf->addTextWrap($Left_Margin+312,$YPos,70,$FontSize,_('Quantity'), 'right'); -$LeftOvers = $pdf->addTextWrap($Left_Margin+382,$YPos,70,$FontSize,_('Location'), 'right'); -$LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,_('Reference'), 'right'); -$YPos-=$line_height; - -/*draw a line */ -$pdf->line($XPos, $YPos,$Page_Width-$Right_Margin, $YPos); - -$YPos -= ($line_height); -?> \ No newline at end of file Modified: trunk/index.php =================================================================== --- trunk/index.php 2011-04-09 06:12:05 UTC (rev 4543) +++ trunk/index.php 2011-04-10 02:04:57 UTC (rev 4544) @@ -695,7 +695,7 @@ </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFStockTransListing.php">' . _('Daily Stock Transaction Listing') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFPeriodStockTransListing.php?">' . _('Period Stock Transaction Listing') . '</a></p>'; ?> </td> </tr> <tr> Modified: trunk/sql/mysql/upgrade3.11.1-4.00.sql =================================================================== --- trunk/sql/mysql/upgrade3.11.1-4.00.sql 2011-04-09 06:12:05 UTC (rev 4543) +++ trunk/sql/mysql/upgrade3.11.1-4.00.sql 2011-04-10 02:04:57 UTC (rev 4544) @@ -838,3 +838,7 @@ UPDATE config SET confvalue='4.03.5' WHERE confname='VersionNumber'; INSERT INTO `scripts` (`script` ,`pagesecurity` ,`description`) VALUES ( 'ReprintGRN.php', '11', 'Allows selection of a goods received batch for reprinting the goods received note given a purchase order number'); UPDATE config SET confvalue='4.03.6' WHERE confname='VersionNumber'; +ALTER TABLE `paymentmethods` ADD `usepreprintedstationery` TINYINT NOT NULL DEFAULT '0'; +DELETE FROM scripts WHERE script='PDFStockTransListing.php'; +INSERT INTO scripts (`script` ,`pagesecurity` ,`description`) VALUES('PDFPeriodStockTransListing.php','3','Allows stock transactions of a specific transaction type to be listed over a single day or period range'); +IUPDATE config SET confvalue='4.03.7' WHERE confname='VersionNumber'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-04-10 02:05:05
|
Revision: 4544 http://web-erp.svn.sourceforge.net/web-erp/?rev=4544&view=rev Author: daintree Date: 2011-04-10 02:04:57 +0000 (Sun, 10 Apr 2011) Log Message: ----------- Tim changes Modified Paths: -------------- trunk/PaymentMethods.php trunk/Payments.php trunk/Stocks.php trunk/doc/Change.log.html trunk/includes/ConnectDB.inc trunk/index.php trunk/sql/mysql/upgrade3.11.1-4.00.sql Added Paths: ----------- trunk/PDFPeriodStockTransListing.php trunk/includes/PDFPeriodStockTransListingPageHeader.inc Removed Paths: ------------- trunk/PDFStockTransListing.php trunk/includes/PDFStockTransListingPageHeader.inc Added: trunk/PDFPeriodStockTransListing.php =================================================================== --- trunk/PDFPeriodStockTransListing.php (rev 0) +++ trunk/PDFPeriodStockTransListing.php 2011-04-10 02:04:57 UTC (rev 4544) @@ -0,0 +1,203 @@ +<?php +/* $Id: PDFPeriodStockTransListing.php 4307 2010-12-22 16:06:03Z tim_schofield $*/ + + +include('includes/SQL_CommonFunctions.inc'); +include ('includes/session.inc'); + +$InputError=0; +if (isset($_POST['FromDate']) AND !Is_Date($_POST['FromDate'])){ + $msg = _('The date must be specified in the format') . ' ' . $_SESSION['DefaultDateFormat']; + $InputError=1; + unset($_POST['FromDate']); +} + +if (!isset($_POST['FromDate'])){ + + $title = _('Stock 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="">' . ' ' + . _('Stock Transaction Listing').'</img></p></div>'; + + 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>'; + echo '<tr> + <td>' . _('Enter the date from which the transactions 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 the transactions 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>' . _('Transaction type') . '</td><td>'; + + echo '<select name="TransType">'; + + echo '<option value=10>' . _('Sales Invoice').'</option> + <option value=11>' . _('Sales Credit Note').'</option> + <option value=16>' . _('Location Transfer').'</option> + <option value=17>' . _('Stock Adjustment').'</option> + <option value=25>' . _('Purchase Order Delivery').'</option> + <option value=26>' . _('Work Order Receipt').'</option> + <option value=28>' . _('Work Order Issue').'</option>'; + + echo '</select></td></tr>'; + + $sql = "SELECT loccode, locationname FROM locations"; + $resultStkLocs = DB_query($sql, $db); + + echo '<tr><td>' . _('For Stock Location') . ':</td> + <td><select name="StockLocation">'; + echo '<option VALUE="All">' . _('All') . '</option>'; + while ($myrow=DB_fetch_array($resultStkLocs)){ + if (isset($_POST['StockLocation']) AND $_POST['StockLocation']!='All'){ + if ($myrow['loccode'] == $_POST['StockLocation']){ + echo '<option selected VALUE="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + } else { + echo '<option VALUE="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + } + } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ + echo '<option selected VALUE="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + $_POST['StockLocation']=$myrow['loccode']; + } else { + echo '<option VALUE="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + } + } + echo '</select></td></tr>'; + + echo '</table><br><div class="centre"><input type=submit name="Go" value="' . _('Create PDF') . '"></div>'; + + include('includes/footer.inc'); + exit; +} else { + + include('includes/ConnectDB.inc'); +} + + +if ($_POST['StockLocation']=='All') { + $sql= "SELECT stockmoves.type, + stockmoves.stockid, + stockmaster.description, + stockmaster.decimalplaces, + stockmoves.transno, + stockmoves.trandate, + stockmoves.qty, + stockmoves.reference, + stockmoves.narrative, + locations.locationname + FROM stockmoves + LEFT JOIN stockmaster + ON stockmoves.stockid=stockmaster.stockid + LEFT JOIN locations + ON stockmoves.loccode=locations.loccode + WHERE type='" . $_POST['TransType'] . "' + AND date_format(trandate, '%Y-%m-%d')>='".FormatDateForSQL($_POST['FromDate'])."' + AND date_format(trandate, '%Y-%m-%d')<='".FormatDateForSQL($_POST['ToDate'])."'"; +} else { + $sql= "SELECT stockmoves.type, + stockmoves.stockid, + stockmaster.description, + stockmaster.decimalplaces, + stockmoves.transno, + stockmoves.trandate, + stockmoves.qty, + stockmoves.reference, + stockmoves.narrative, + locations.locationname + FROM stockmoves + LEFT JOIN stockmaster + ON stockmoves.stockid=stockmaster.stockid + LEFT JOIN locations + ON stockmoves.loccode=locations.loccode + WHERE type='" . $_POST['TransType'] . "' + AND date_format(trandate, '%Y-%m-%d')>='".FormatDateForSQL($_POST['FromDate'])."' + AND date_format(trandate, '%Y-%m-%d')<='".FormatDateForSQL($_POST['ToDate'])."' + AND stockmoves.loccode='" . $_POST['StockLocation'] . "'"; +} +$result=DB_query($sql,$db,'','',false,false); + +if (DB_error_no($db)!=0){ + $title = _('Transaction Listing'); + include('includes/header.inc'); + prnMsg(_('An error occurred getting the transactions'),'error'); + include('includes/footer.inc'); + exit; +} elseif (DB_num_rows($result) == 0){ + $title = _('Transaction Listing'); + include('includes/header.inc'); + echo '<br>'; + prnMsg (_('There were no transactions found in the database between the dates') . ' ' . $_POST['FromDate'] . ' ' . _('and') . ' '. $_POST['ToDate'] .'<br />' ._('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',_('Stock Transaction Listing')); +$pdf->addInfo('Subject',_('Stock transaction listing from') . ' ' . $_POST['FromDate'] . ' ' . $_POST['ToDate']); +$line_height=12; +$PageNumber = 1; + + +switch ($_POST['TransType']) { + case 10: + $TransType=_('Customer Invoices'); + break; + case 11: + $TransType=_('Customer Credit Notes'); + break; + case 16: + $TransType=_('Location Transfers'); + break; + case 17: + $TransType=_('Stock Adjustments'); + break; + case 25: + $TransType=_('Purchase Order Deliveries'); + break; + case 26: + $TransType=_('Work Order Receipts'); + break; + case 28: + $TransType=_('Work Order Issues'); + break; +} + +include ('includes/PDFPeriodStockTransListingPageHeader.inc'); + +while ($myrow=DB_fetch_array($result)){ + + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,160,$FontSize,$myrow['description'], 'left'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+162,$YPos,80,$FontSize,$myrow['transno'], '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['qty'],$myrow['decimalplaces']), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+382,$YPos,70,$FontSize,$myrow['locationname'], 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,$myrow['reference'], 'right'); + + $YPos -= ($line_height); + + if ($YPos - (2 *$line_height) < $Bottom_Margin){ + /*Then set up a new page */ + $PageNumber++; + include ('includes/PDFPeriodStockTransListingPageHeader.inc'); + } /*end of new page header */ +} /* end of while there are customer receipts in the batch to print */ + + +$YPos-=$line_height; + +$ReportFileName = $_SESSION['DatabaseName'] . '_StockTransListing_' . date('Y-m-d').'.pdf'; +$pdf->OutputD($ReportFileName); +$pdf->__destruct(); + +?> \ No newline at end of file Deleted: trunk/PDFStockTransListing.php =================================================================== --- trunk/PDFStockTransListing.php 2011-04-09 06:12:05 UTC (rev 4543) +++ trunk/PDFStockTransListing.php 2011-04-10 02:04:57 UTC (rev 4544) @@ -1,145 +0,0 @@ -<?php - -/* $Id$*/ - -/* $Revision: 1.13 $ */ - -//$PageSecurity = 3; -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 = _('Stock 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="" />' . ' ' - . _('Stock Transaction Listing').'</p></div>'; - - 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=10>' . _('Sales Invoice').'</option>'; - echo '<option value=11>' . _('Sales Credit Note').'</option>'; - echo '<option value=16>' . _('Location Transfer').'</option>'; - echo '<option value=17>' . _('Stock Adjustment').'</option>'; - echo '<option value=25>' . _('Purchase Order Delivery').'</option>'; - echo '<option value=26>' . _('Work Order Receipt').'</option>'; - echo '<option value=28>' . _('Work Order Issue').'</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 stockmoves.type, - stockmoves.stockid, - stockmaster.description, - stockmaster.decimalplaces, - stockmoves.transno, - stockmoves.trandate, - stockmoves.qty, - stockmoves.reference, - stockmoves.narrative, - locations.locationname - FROM stockmoves - LEFT JOIN stockmaster - ON stockmoves.stockid=stockmaster.stockid - LEFT JOIN locations - ON stockmoves.loccode=locations.loccode - WHERE type='" . $_POST['TransType'] . "' - AND date_format(trandate, '%Y-%m-%d')='".FormatDateForSQL($_POST['Date'])."'"; - -$result=DB_query($sql,$db,'','',false,false); - -if (DB_error_no($db)!=0){ - $title = _('Transaction Listing'); - include('includes/header.inc'); - prnMsg(_('An error occurred getting the transactions'),'error'); - include('includes/footer.inc'); - exit; -} elseif (DB_num_rows($result) == 0){ - $title = _('Transaction 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',_('Stock Transaction Listing')); -$pdf->addInfo('Subject',_('Stock transaction listing from') . ' ' . $_POST['Date'] ); -$line_height=12; -$PageNumber = 1; - -include ('includes/PDFStockTransListingPageHeader.inc'); - -while ($myrow=DB_fetch_array($result)){ - - $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,160,$FontSize,$myrow['description'], 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+162,$YPos,80,$FontSize,$myrow['transno'], '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['qty'],$myrow['decimalplaces']), 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+382,$YPos,70,$FontSize,$myrow['locationname'], 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,$myrow['reference'], 'right'); - - $YPos -= ($line_height); - - if ($YPos - (2 *$line_height) < $Bottom_Margin){ - /*Then set up a new page */ - $PageNumber++; - include ('includes/PDFStockTransListingPageHeader.inc'); - } /*end of new page header */ -} /* end of while there are customer receipts in the batch to print */ - - -$YPos-=$line_height; - -/* 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'] . '_StockTransListing_' . date('Y-m-d').'.pdf'; -$pdf->OutputD($ReportFileName);//UldisN -$pdf->__destruct(); //UldisN - -?> \ No newline at end of file Modified: trunk/PaymentMethods.php =================================================================== --- trunk/PaymentMethods.php 2011-04-09 06:12:05 UTC (rev 4543) +++ trunk/PaymentMethods.php 2011-04-10 02:04:57 UTC (rev 4544) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.9 $ */ + /* $Id$*/ -//$PageSecurity = 15; - include('includes/session.inc'); $title = _('Payment Methods'); @@ -72,8 +70,9 @@ $sql = "UPDATE paymentmethods SET paymentname='" . $_POST['MethodName'] . "', paymenttype = '" . $_POST['ForPayment'] . "', - receipttype = '" . $_POST['ForReceipt'] . "' - WHERE paymentname LIKE '".$OldName."'"; + receipttype = '" . $_POST['ForReceipt'] . "', + usepreprintedstationery = '" . $_POST['UsePrePrintedStationery']. "' + WHERE paymentname " . LIKE . " '".$OldName."'"; /* lets leave well alone existing entries if ($_POST['MethodName'] != $OldMeasureName ) { @@ -103,11 +102,13 @@ $sql = "INSERT INTO paymentmethods ( paymentname, paymenttype, - receipttype) + receipttype, + usepreprintedstationery) VALUES ( '" . $_POST['MethodName'] ."', '" . $_POST['ForPayment'] ."', '" . $_POST['ForReceipt'] ."' + '" . $_POST['UsePrePrintedStationery'] ."' )"; } $msg = _('Record inserted'); @@ -124,6 +125,7 @@ unset ($_POST['MethodName']); unset ($_POST['ForPayment']); unset ($_POST['ForReceipt']); + unset ($_POST['UsePrePrintedStationery']); } elseif (isset($_GET['delete'])) { //the link to delete a selected record was clicked instead of the submit button @@ -143,12 +145,12 @@ $myrow = DB_fetch_row($result); if ($myrow[0]>0) { prnMsg( _('Cannot delete this payment method because bank transactions have been created using this payment method'),'warn'); - echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('bank transactions that refer to this payment method') . '</font>'; + echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('bank transactions that refer to this payment method') . '</font>'; } else { - $sql="DELETE FROM paymentmethods WHERE paymentname LIKE '" . $OldMeasureName . "'"; + $sql="DELETE FROM paymentmethods WHERE paymentname " . LIKE . " '" . $OldMeasureName . "'"; $result = DB_query($sql,$db); prnMsg( $OldMeasureName . ' ' . _('payment method has been deleted') . '!','success'); - echo '<br>'; + echo '<br />'; } //end if not used } //end if payment method exist unset ($SelectedPaymentID); @@ -174,19 +176,21 @@ $sql = "SELECT paymentid, paymentname, paymenttype, - receipttype + receipttype, + usepreprintedstationery FROM paymentmethods ORDER BY paymentid"; $ErrMsg = _('Could not get payment methods because'); $result = DB_query($sql,$db,$ErrMsg); - echo "<table class=selection> + echo '<table class=selection> <tr> - <th>" . _('Payment Method') . "</th> - <th>" . _('For Payments') . "</th> - <th>" . _('For Receipts') . "</th> - </tr>"; + <th>' . _('Payment Method') . '</th> + <th>' . _('For Payments') . '</th> + <th>' . _('For Receipts') . '</th> + <th>' . _('Use Pre-printed') .'<br />' . _('Stationery') . '</th> + </tr>'; $k=0; //row colour counter while ($myrow = DB_fetch_array($result)) { @@ -202,8 +206,9 @@ echo '<td>' . $myrow['paymentname'] . '</td>'; echo '<td>' . ($myrow['paymenttype'] ? _('Yes') : _('No')) . '</td>'; echo '<td>' . ($myrow['receipttype'] ? _('Yes') : _('No')) . '</td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&SelectedPaymentID=' . $myrow['paymentid'] . '">' . _('Edit') . '</a></td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&SelectedPaymentID=' . $myrow['paymentid'] . '&delete=1">' . _('Delete') .'</a></td>'; + echo '<td>' . ($myrow['usepreprintedstationery'] ? _('Yes') : _('No')) . '</td>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedPaymentID=' . $myrow['paymentid'] . '">' . _('Edit') . '</a></td>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedPaymentID=' . $myrow['paymentid'] . '&delete=1">' . _('Delete') .'</a></td>'; echo '</tr>'; } //END WHILE LIST LOOP @@ -219,7 +224,7 @@ 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($SelectedPaymentID)) { @@ -228,7 +233,8 @@ $sql = "SELECT paymentid, paymentname, paymenttype, - receipttype + receipttype, + usepreprintedstationery FROM paymentmethods WHERE paymentid='" . $SelectedPaymentID . "'"; @@ -243,37 +249,45 @@ $_POST['MethodName'] = $myrow['paymentname']; $_POST['ForPayment'] = $myrow['paymenttype']; $_POST['ForReceipt'] = $myrow['receipttype']; + $_POST['UsePrePrintedStationery'] = $myrow['usepreprintedstationery']; - echo "<input type=hidden name='SelectedPaymentID' VALUE='" . $_POST['MethodID'] . "'>"; - echo "<table class=selection>"; + echo '<input type="hidden" name="SelectedPaymentID" value="' . $_POST['MethodID'] . '">'; + echo '<table class="selection">'; } } else { $_POST['MethodName']=''; $_POST['ForPayment'] = 1; // Default is use for payment $_POST['ForReceipt'] = 1; // Default is use for receipts - echo "<table class=selection>"; + $_POST['UsePrePrintedStationery'] = 0; // Default is use for receipts + echo '<table class=selection>'; } - echo "<tr> - <td>" . _('Payment Method') . ':' . "</td> - <td><input type='Text' ". (in_array('MethodName',$Errors) ? 'class="inputerror"' : '' ) ." name='MethodName' size=30 maxlength=30 value='" . $_POST['MethodName'] . "'></td> - </tr>"; - echo "<tr> - <td>" . _('Use For Payments') . ':' . "</td> - <td><select name='ForPayment'>"; - echo "<option".($_POST['ForPayment'] ? ' selected' : '') ." VALUE='1'>" . _('Yes'); - echo "<option".($_POST['ForPayment'] ? '' : ' selected') ." VALUE='0'>" . _('No'); - echo "</select></td></tr>"; - echo "<tr> - <td>" . _('Use For Receipts') . ':' . "</td> - <td><select name='ForReceipt'>"; - echo "<option".($_POST['ForReceipt'] ? ' selected' : '') ." VALUE='1'>" . _('Yes'); - echo "<option".($_POST['ForReceipt'] ? '' : ' selected') ." VALUE='0'>" . _('No'); - echo "</select></td></tr>"; + echo '<tr> + <td>' . _('Payment Method') . ':' . '</td> + <td><input type="Text" '. (in_array('MethodName',$Errors) ? 'class="inputerror"' : '' ) .' name="MethodName" size="30" maxlength="30" value="' . $_POST['MethodName'] . '"></td> + </tr>'; + echo '<tr> + <td>' . _('Use For Payments') . ':' . '</td> + <td><select name="ForPayment"> + <option' . ($_POST['ForPayment'] ? ' selected' : '') .' value="1">' . _('Yes') . '</option> + <option' . ($_POST['ForPayment'] ? '' : ' selected') .' value="0">' . _('No') . '</select></td> + </tr>'; + echo '<tr> + <td>' . _('Use For Receipts') . ':' . '</td> + <td><select name="ForReceipt"> + <option' . ($_POST['ForReceipt'] ? ' selected' : '') .' value="1">' . _('Yes') . '</option> + <option' . ($_POST['ForReceipt'] ? '' : ' selected') .' value="0">' . _('No') . '</option> + </select></td></tr>'; + echo '<tr> + <td>' . _('Use Pre-printed Stationery') . ':' . '</td> + <td><select name="UsePrePrintedStationery"> + <option' . ($_POST['UsePrePrintedStationery'] ? ' selected': '' ) .' value="1">' . _('Yes') . '</option> + <option' . ($_POST['UsePrePrintedStationery']==1 ? '' : ' selected' ) .' value="0">' . _('No') . '</option> + </select></td></tr>'; echo '</table>'; - echo '<br><div class="centre"><input type=Submit name=submit value=' . _('Enter Information') . '></div>'; + echo '<br /><div class="centre"><input type=Submit name=submit value=' . _('Enter Information') . '></div>'; echo '</form>'; Modified: trunk/Payments.php =================================================================== --- trunk/Payments.php 2011-04-09 06:12:05 UTC (rev 4543) +++ trunk/Payments.php 2011-04-10 02:04:57 UTC (rev 4544) @@ -246,11 +246,16 @@ $PeriodNo = GetPeriod($_SESSION['PaymentDetail']->DatePaid,$db); + $sql="SELECT usepreprintedstationery + FROM paymentmethods + WHERE paymentname='" . $_SESSION['PaymentDetail']->Paymenttype ."'"; + $result=DB_query($sql, $db); + $myrow=DB_fetch_row($result); // first time through commit if supplier cheque then print it first if ((!isset($_POST['ChequePrinted'])) AND (!isset($_POST['PaymentCancelled'])) - AND ($_SESSION['PaymentDetail']->Paymenttype == 'Cheque')) { + AND ($myrow[0] == 1)) { // it is a supplier payment by cheque and haven't printed yet so print cheque echo '<br /><a href="' . $rootpath . '/PrintCheque.php?' . SID . '&ChequeNum=' . $_POST['ChequeNum'] . '">' . _('Print Cheque using pre-printed stationery') . '</a><br /><br />'; @@ -607,14 +612,14 @@ $_SESSION['PaymentDetail']->Remove_GLItem($_GET['Delete']); } elseif (isset($_POST['Process']) and !$BankAccountEmpty){ //user hit submit a new GL Analysis line into the payment - $ChequeNoSQL='select account from gltrans where chequeno="'.$_POST['cheque'].'"'; + $ChequeNoSQL="SELECT account FROM gltrans WHERE chequeno='" . $_POST['cheque'] ."'"; $ChequeNoResult=DB_query($ChequeNoSQL, $db); if (is_numeric($_POST['GLManualCode'])){ - $SQL = "select accountname - FROM chartmaster - WHERE accountcode='" . $_POST['GLManualCode'] . "'"; + $SQL = "SELECT accountname + FROM chartmaster + WHERE accountcode='" . $_POST['GLManualCode'] . "'"; $Result=DB_query($SQL,$db); Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2011-04-09 06:12:05 UTC (rev 4543) +++ trunk/Stocks.php 2011-04-10 02:04:57 UTC (rev 4544) @@ -22,12 +22,15 @@ $myrow = DB_fetch_row($result); if ($myrow[0]==0) { $New=1; + } else { + $New=0; } } -?> +if (isset($_POST['New'])) { + $New=$_POST['New']; +} -<?php echo '<a href="' . $rootpath . '/SelectProduct.php?' . SID . '">' . _('Back to Items') . '</a><br>' . "\n"; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' @@ -62,7 +65,6 @@ $result = move_uploaded_file($_FILES['ItemPicture']['tmp_name'], $filename); $message = ($result)?_('File url') ."<a href='". $filename ."'>" . $filename . '</a>' : _('Something is wrong with uploading a file'); } - /* EOR Add Image upload for New Item - by Ori */ } if (isset($Errors)) { @@ -202,7 +204,7 @@ if ($_POST['Serialised']==1){ /*Not appropriate to have several dp on serial items */ $_POST['DecimalPlaces']=0; } - if (!isset($_POST['New']) and !isset($New)) { /*so its an existing one */ + if ($New==0) { /*so its an existing one */ /*first check on the changes being made we must disallow: - changes from manufactured or purchased to Service, Assembly or Kitset if there is stock - changes from manufactured, kitset or assembly where a BOM exists @@ -447,6 +449,7 @@ }//THE INSERT OF THE NEW CODE WORKED SO BANG IN THE STOCK LOCATION RECORDS TOO }//END CHECK FOR ALREADY EXISTING ITEM OF THE SAME CODE } + $New=1; } else { echo '<br>'. "\n"; @@ -563,7 +566,7 @@ unset($StockID); //echo "<meta http-equiv='Refresh' content='0; url=" . $rootpath . '/SelectProduct.php?' . SID ."'>"; - + $New=1; } //end if Delete Part } @@ -572,17 +575,20 @@ <tr><td>'. "\n"; // Nested table echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; +echo '<input type="hidden" name="New" value="'.$New.'">'. "\n"; + if (!isset($StockID) or $StockID=='' or isset($_POST['UpdateCategories'])) { /*If the page was called without $StockID passed to page then assume a new stock item is to be entered show a form with a part Code field other wise the form showing the fields with the existing entries against the part will show for editing with only a hidden StockID field. New is set to flag that the page may have called itself and still be entering a new part, in which case the page needs to know not to go looking up details for an existing part*/ - - $New = true; - echo '<input type="hidden" name="New" value="1">'. "\n"; if (!isset($StockID)) { - echo '<tr><td>'. _('Item Code'). ':</td><td><input ' . (in_array('StockID',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="StockID" size=21 maxlength=20 /></td></tr>'. "\n"; + $StockID=''; + } + if ($New==1) { + echo '<tr><td>'. _('Item Code'). ':</td><td><input ' . (in_array('StockID',$Errors) ? 'class="inputerror"' : '' ) .' type="text" + value="'.$StockID.'" name="StockID" size=21 maxlength=20 /></td></tr>'. "\n"; } else { - echo '<tr><td>'. _('Item Code'). ':</td><td><input ' . (in_array('StockID',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="StockID" size=21 maxlength=20 - value="'.$StockID.'" /></td></tr>'. "\n"; + echo '<tr><td>'. _('Item Code'). ':</td><td>'.$StockID.'</td></tr>'. "\n"; + echo '<input type="hidden" name ="StockID" value="'.$StockID.'" />'; } } elseif (!isset($_POST['UpdateCategories']) and $InputError!=1) { // Must be modifying an existing item and no changes made yet @@ -1016,7 +1022,7 @@ echo '</table><br>'; echo '<input type="hidden" name="PropertyCounter" value=' . $PropertyCounter . '>'; -if (isset($New)) { +if ($New==1) { echo '<input type="Submit" name="submit" value="' . _('Insert New Item') . '">'; echo '<input type="submit" name="UpdateCategories" style="visibility:hidden;width:1px" value="' . _('Categories') . '">'; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-04-09 06:12:05 UTC (rev 4543) +++ trunk/doc/Change.log.html 2011-04-10 02:04:57 UTC (rev 4544) @@ -1,5 +1,10 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p /> +<p> +<p>10/4/11 Tim: PDFPeriodStockTransListing - new report to print off stock transactions of a specified type for a selected period>/p> +<p>10/4/11 Tim: PDFStockTransListing.php option to print off transactions by inventory location</p> +<p>10/4/11 Tim: Stocks.php - more logical use of $New and $_POST['New']</p> +<p>10/4/11 Tim: Payments.php PaymentMethods.php Add new field userpreprintedstationery to payment methods to determine whether to print cheques</p> <p>5/4/11 Tim: includes/LanguageSetup.php - discovered solution to Turkish character set problem!!</p> <p>5/4/11 Phil: couple of is_date functions left over from experiment to see if changing fixed Turkish - now removed from SupplierInvoice.php and PDFOrdersInvoiced.php</p> <p>5/4/11 Phil: SuppCreditGRNs was not showing old GRNs and no way to input an older date</p> Modified: trunk/includes/ConnectDB.inc =================================================================== --- trunk/includes/ConnectDB.inc 2011-04-09 06:12:05 UTC (rev 4543) +++ trunk/includes/ConnectDB.inc 2011-04-10 02:04:57 UTC (rev 4544) @@ -4,7 +4,7 @@ * this value is saved in the $_SESSION['Versionumber'] when includes/GetConfig.php is run * if VersionNumber is < $Version then the DB update script is run */ -$Version='4.03.6'; //must update manually every time there is a DB change +$Version='4.03.7'; //must update manually every time there is a DB change require_once ($PathPrefix .'includes/MiscFunctions.php'); Added: trunk/includes/PDFPeriodStockTransListingPageHeader.inc =================================================================== --- trunk/includes/PDFPeriodStockTransListingPageHeader.inc (rev 0) +++ trunk/includes/PDFPeriodStockTransListingPageHeader.inc 2011-04-10 02:04:57 UTC (rev 4544) @@ -0,0 +1,59 @@ +<?php +/* $Id: PDFPeriodStockTransListingPageHeader.inc 4307 2010-12-22 16:06:03Z tim_schofield $*/ + +if ($PageNumber>1){ + $pdf->newPage(); +} + +$YPos = $Page_Height - $Top_Margin - 50; + +$pdf->addJpegFromFile($_SESSION['LogoFile'],$Left_Margin,$YPos,0,50); + +$FontSize=15; + + +$XPos = $Page_Width/2; +$YPos += 30; +$pdf->addText($XPos, $YPos,$FontSize, $_SESSION['CompanyRecord']['coyname']); +$FontSize=12; +$YPos -=30; +$pdf->addText($XPos, $YPos,$FontSize, $TransType . ' ' ._('dated from') . ' ' . $_POST['FromDate'] . ' ' . _('to') . ' ' . $_POST['ToDate']); + + +$XPos = $Page_Width-$Right_Margin-50; +$YPos -=30; +$pdf->addText($XPos, $YPos+10,$FontSize, _('Page') . ': ' . $PageNumber); + +/*Now print out the company name and address */ +$XPos = $Left_Margin; +$YPos -= $line_height; + +/*draw a square grid for entering line items */ +$pdf->line($XPos, $YPos,$Page_Width-$Right_Margin, $YPos); +$pdf->line($Page_Width-$Right_Margin, $YPos,$Page_Width-$Right_Margin, $Bottom_Margin); +$pdf->line($Page_Width-$Right_Margin, $Bottom_Margin,$XPos, $Bottom_Margin); +$pdf->line($XPos, $Bottom_Margin,$XPos, $YPos); + +$pdf->line($Left_Margin+160, $YPos,$Left_Margin+160, $Bottom_Margin); +$pdf->line($Left_Margin+240, $YPos,$Left_Margin+240, $Bottom_Margin); +$pdf->line($Left_Margin+310, $YPos,$Left_Margin+310, $Bottom_Margin); +$pdf->line($Left_Margin+384, $YPos,$Left_Margin+384, $Bottom_Margin); +$pdf->line($Left_Margin+454, $YPos,$Left_Margin+454, $Bottom_Margin); + +$YPos -= $line_height; +/*Set up headings */ +$FontSize=8; + +$LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,160,$FontSize,_('Stock Item'), 'left'); +$LeftOvers = $pdf->addTextWrap($Left_Margin+162,$YPos,80,$FontSize,_('Reference'), 'left'); +$LeftOvers = $pdf->addTextWrap($Left_Margin+242,$YPos,70,$FontSize,_('Trans Date'), 'left'); +$LeftOvers = $pdf->addTextWrap($Left_Margin+312,$YPos,70,$FontSize,_('Quantity'), 'right'); +$LeftOvers = $pdf->addTextWrap($Left_Margin+382,$YPos,70,$FontSize,_('Location'), 'right'); +$LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,_('Reference'), 'right'); +$YPos-=$line_height; + +/*draw a line */ +$pdf->line($XPos, $YPos,$Page_Width-$Right_Margin, $YPos); + +$YPos -= ($line_height); +?> \ No newline at end of file Deleted: trunk/includes/PDFStockTransListingPageHeader.inc =================================================================== --- trunk/includes/PDFStockTransListingPageHeader.inc 2011-04-09 06:12:05 UTC (rev 4543) +++ trunk/includes/PDFStockTransListingPageHeader.inc 2011-04-10 02:04:57 UTC (rev 4544) @@ -1,79 +0,0 @@ -<?php -/* $Id$*/ -if ($PageNumber>1){ - $pdf->newPage(); -} - -$YPos = $Page_Height - $Top_Margin - 50; - -$pdf->addJpegFromFile($_SESSION['LogoFile'],$Left_Margin,$YPos,0,50); - -$FontSize=15; - -Switch ($_POST['TransType']) { - case 10: - $TransType=_('Customer Invoices'); - break; - case 11: - $TransType=_('Customer Credit Notes'); - break; - case 16: - $TransType=_('Location Transfers'); - break; - case 17: - $TransType=_('Stock Adjustments'); - break; - case 25: - $TransType=_('Purchase Order Deliveries'); - break; - case 26: - $TransType=_('Work Order Receipts'); - break; - case 28: - $TransType=_('Work Order Issues'); - break; -} - -$XPos = $Page_Width/2; -$YPos += 30; -$pdf->addText($XPos, $YPos,$FontSize, $_SESSION['CompanyRecord']['coyname']); -$FontSize=12; -$pdf->addText($XPos, $YPos-20,$FontSize, $TransType . ' ' ._('dated') . ' ' . $_POST['Date']); - -$XPos = $Page_Width-$Right_Margin-50; -$YPos -=30; -$pdf->addText($XPos, $YPos+10,$FontSize, _('Page') . ': ' . $PageNumber); - -/*Now print out the company name and address */ -$XPos = $Left_Margin; -$YPos -= $line_height; - -/*draw a square grid for entering line items */ -$pdf->line($XPos, $YPos,$Page_Width-$Right_Margin, $YPos); -$pdf->line($Page_Width-$Right_Margin, $YPos,$Page_Width-$Right_Margin, $Bottom_Margin); -$pdf->line($Page_Width-$Right_Margin, $Bottom_Margin,$XPos, $Bottom_Margin); -$pdf->line($XPos, $Bottom_Margin,$XPos, $YPos); - -$pdf->line($Left_Margin+160, $YPos,$Left_Margin+160, $Bottom_Margin); -$pdf->line($Left_Margin+240, $YPos,$Left_Margin+240, $Bottom_Margin); -$pdf->line($Left_Margin+310, $YPos,$Left_Margin+310, $Bottom_Margin); -$pdf->line($Left_Margin+384, $YPos,$Left_Margin+384, $Bottom_Margin); -$pdf->line($Left_Margin+454, $YPos,$Left_Margin+454, $Bottom_Margin); - -$YPos -= $line_height; -/*Set up headings */ -$FontSize=8; - -$LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,160,$FontSize,_('Stock Item'), 'left'); -$LeftOvers = $pdf->addTextWrap($Left_Margin+162,$YPos,80,$FontSize,_('Reference'), 'left'); -$LeftOvers = $pdf->addTextWrap($Left_Margin+242,$YPos,70,$FontSize,_('Trans Date'), 'left'); -$LeftOvers = $pdf->addTextWrap($Left_Margin+312,$YPos,70,$FontSize,_('Quantity'), 'right'); -$LeftOvers = $pdf->addTextWrap($Left_Margin+382,$YPos,70,$FontSize,_('Location'), 'right'); -$LeftOvers = $pdf->addTextWrap($Left_Margin+452,$YPos,70,$FontSize,_('Reference'), 'right'); -$YPos-=$line_height; - -/*draw a line */ -$pdf->line($XPos, $YPos,$Page_Width-$Right_Margin, $YPos); - -$YPos -= ($line_height); -?> \ No newline at end of file Modified: trunk/index.php =================================================================== --- trunk/index.php 2011-04-09 06:12:05 UTC (rev 4543) +++ trunk/index.php 2011-04-10 02:04:57 UTC (rev 4544) @@ -695,7 +695,7 @@ </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFStockTransListing.php">' . _('Daily Stock Transaction Listing') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFPeriodStockTransListing.php?">' . _('Period Stock Transaction Listing') . '</a></p>'; ?> </td> </tr> <tr> Modified: trunk/sql/mysql/upgrade3.11.1-4.00.sql =================================================================== --- trunk/sql/mysql/upgrade3.11.1-4.00.sql 2011-04-09 06:12:05 UTC (rev 4543) +++ trunk/sql/mysql/upgrade3.11.1-4.00.sql 2011-04-10 02:04:57 UTC (rev 4544) @@ -838,3 +838,7 @@ UPDATE config SET confvalue='4.03.5' WHERE confname='VersionNumber'; INSERT INTO `scripts` (`script` ,`pagesecurity` ,`description`) VALUES ( 'ReprintGRN.php', '11', 'Allows selection of a goods received batch for reprinting the goods received note given a purchase order number'); UPDATE config SET confvalue='4.03.6' WHERE confname='VersionNumber'; +ALTER TABLE `paymentmethods` ADD `usepreprintedstationery` TINYINT NOT NULL DEFAULT '0'; +DELETE FROM scripts WHERE script='PDFStockTransListing.php'; +INSERT INTO scripts (`script` ,`pagesecurity` ,`description`) VALUES('PDFPeriodStockTransListing.php','3','Allows stock transactions of a specific transaction type to be listed over a single day or period range'); +IUPDATE config SET confvalue='4.03.7' WHERE confname='VersionNumber'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-04-10 10:41:28
|
Revision: 4545 http://web-erp.svn.sourceforge.net/web-erp/?rev=4545&view=rev Author: daintree Date: 2011-04-10 10:41:20 +0000 (Sun, 10 Apr 2011) Log Message: ----------- Tim launchpad stuff Modified Paths: -------------- trunk/GLAccountInquiry.php trunk/GLAccounts.php trunk/MRP.php trunk/MRPCalendar.php trunk/MRPShortages.php trunk/PDFPrintLabel.php trunk/PDFStockTransfer.php trunk/SelectProduct.php trunk/StockTransferControlled.php trunk/StockTransfers.php trunk/SupplierInvoice.php trunk/doc/Change.log.html trunk/includes/DefineLabelClass.php trunk/includes/DefineStockTransfers.php trunk/includes/OutputSerialItems.php trunk/index.php trunk/sql/mysql/upgrade3.11.1-4.00.sql Added Paths: ----------- trunk/ReprintGRN.php Modified: trunk/GLAccountInquiry.php =================================================================== --- trunk/GLAccountInquiry.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/GLAccountInquiry.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -268,7 +268,9 @@ $tagsql="SELECT tagdescription FROM tags WHERE tagref='".$myrow['tag'] . "'"; $tagresult=DB_query($tagsql,$db); $tagrow = DB_fetch_array($tagresult); - + if ($tagrow['tagdescription']=='') { + $tagrow['tagdescription']=_('None'); + } printf("<td>%s</td> <td class=number><a href='%s'>%s</a></td> <td>%s</td> Modified: trunk/GLAccounts.php =================================================================== --- trunk/GLAccounts.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/GLAccounts.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -1,8 +1,6 @@ <?php -/* $Revision: 1.21 $ */ /* $Id$*/ -//$PageSecurity = 10; include('includes/session.inc'); $title = _('Chart of Accounts Maintenance'); @@ -58,19 +56,6 @@ )"; $result = DB_query($sql,$db,$ErrMsg); - /*Add the new chart details records for existing periods first */ -/*Maybe not required since these will be created from GLPostings.inc with correct B/fwd balances - $ErrMsg = _('Could not add the chart details for the new account'); - - $sql = 'INSERT INTO chartdetails (accountcode, period) - SELECT chartmaster.accountcode, periods.periodno - FROM chartmaster - CROSS JOIN periods - WHERE ( chartmaster.accountcode, periods.periodno ) NOT - IN ( SELECT chartdetails.accountcode, chartdetails.period FROM chartdetails )'; - - $result = DB_query($sql,$db,$ErrMsg); -*/ prnMsg(_('The new general ledger account has been added'),'success'); } @@ -218,7 +203,7 @@ if (!isset($_GET['delete'])) { - echo "<form method='post' name='GLAccounts' action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>"; + echo '<form method="post" name="GLAccounts" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedAccount)) { @@ -233,12 +218,16 @@ $_POST['AccountName'] = $myrow['accountname']; $_POST['Group'] = $myrow['group_']; - echo "<input type=hidden name='SelectedAccount' VALUE=$SelectedAccount>"; - echo "<input type=hidden name='AccountCode' VALUE=" . $_POST['AccountCode'] .">"; - echo "<table class=selection><tr><td>" . _('Account Code') . ":</td><td>" . $_POST['AccountCode'] . "</td></tr>"; + echo '<input type="hidden" name="SelectedAccount" value="' . $SelectedAccount . '">'; + echo '<input type="hidden" name="AccountCode" VALUE="' . $_POST['AccountCode'] .'">'; + echo '<table class=selection> + <tr><td>' . _('Account Code') . ':</td> + <td>' . $_POST['AccountCode'] . '</td></tr>'; } else { echo "<table class=selection>"; - echo "<tr><td>" . _('Account Code') . ":</td><td><input type=TEXT name='AccountCode' size=11 class=number maxlength=10></td></tr>"; + echo '<tr><td>' . _('Account Code') . ':</td> + <td><input type="text" name="AccountCode" size="11" class="number" maxlength="10" /></td> + </tr>'; } if (!isset($_POST['AccountName'])) {$_POST['AccountName']='';} @@ -251,17 +240,17 @@ while ($myrow = DB_fetch_array($result)){ if (isset($_POST['Group']) and $myrow[0]==$_POST['Group']){ - echo "<option selected VALUE='"; + echo '<option selected value="'; } else { - echo "<option VALUE='"; + echo '<option VALUE="'; } - echo $myrow[0] . "'>" . $myrow[0]; + echo $myrow[0] . '">' . $myrow[0] . '</option>'; } if (!isset($_GET['SelectedAccount']) or $_GET['SelectedAccount']=='') { - echo "<script>defaultControl(document.GLAccounts.AccountCode);</script>"; + echo '<script>defaultControl(document.GLAccounts.AccountCode);</script>'; } else { - echo "<script>defaultControl(document.GLAccounts.AccountName);</script>"; + echo '<script>defaultControl(document.GLAccounts.AccountName);</script>'; } echo '</select></td></tr></table>'; @@ -293,12 +282,12 @@ $result = DB_query($sql,$db,$ErrMsg); echo '<br><table class=selection>'; - echo "<tr> - <th>" . _('Account Code') . "</th> - <th>" . _('Account Name') . "</th> - <th>" . _('Account Group') . "</th> - <th>" . _('P/L or B/S') . "</th> - </tr>"; + echo '<tr> + <th>' . _('Account Code') . '</th> + <th>' . _('Account Name') . '</th> + <th>' . _('Account Group') . '</th> + <th>' . _('P/L or B/S') . '</th> + </tr>'; $k=0; //row colour counter @@ -323,9 +312,9 @@ $myrow[1], $myrow[2], $myrow[3], - $_SERVER['PHP_SELF'] . '?' . SID, + $_SERVER['PHP_SELF'] . '?', $myrow[0], - $_SERVER['PHP_SELF'] . '?' . SID, + $_SERVER['PHP_SELF'] . '?', $myrow[0]); } @@ -338,10 +327,10 @@ echo '<p>'; if (isset($SelectedAccount)) { - echo "<div class='centre'><a href='" . $_SERVER['PHP_SELF'] . '?' . SID ."'>" . _('Show All Accounts') . '</a></div>'; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Show All Accounts') . '</a></div>'; } -echo '<p>'; +echo '<p />'; include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/MRP.php =================================================================== --- trunk/MRP.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/MRP.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.7 $ */ + /* $Id$*/ -//$PageSecurity=9; - include('includes/session.inc'); $title = _('Run MRP Calculation'); include('includes/header.inc'); @@ -18,21 +16,21 @@ echo '</br>' ._('Start time') . ': ' . date('h:i:s') . '</br>'; echo '</br>' . _('Initialising tables .....') . '</br>'; flush(); - $result = DB_query('DROP TABLE IF EXISTS tempbom',$db); - $result = DB_query('DROP TABLE IF EXISTS passbom',$db); - $result = DB_query('DROP TABLE IF EXISTS passbom2',$db); - $result = DB_query('DROP TABLE IF EXISTS bomlevels',$db); - $result = DB_query('DROP TABLE IF EXISTS levels',$db); + $result = DB_query("DROP TABLE IF EXISTS tempbom",$db); + $result = DB_query("DROP TABLE IF EXISTS passbom",$db); + $result = DB_query("DROP TABLE IF EXISTS passbom2",$db); + $result = DB_query("DROP TABLE IF EXISTS bomlevels",$db); + $result = DB_query("DROP TABLE IF EXISTS levels",$db); - $sql = 'CREATE TEMPORARY TABLE passbom (part char(20), - sortpart text) DEFAULT CHARSET=utf8'; + $sql = "CREATE TEMPORARY TABLE passbom (part char(20), + sortpart text) DEFAULT CHARSET=utf8"; $ErrMsg = _('The SQL to to create passbom failed with the message'); $result = DB_query($sql,$db,$ErrMsg); - $sql = 'CREATE TEMPORARY TABLE tempbom (parent char(20), + $sql = "CREATE TEMPORARY TABLE tempbom (parent char(20), component char(20), sortpart text, - level int) DEFAULT CHARSET=utf8'; + level int) DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db,_('Create of tempbom failed because')); // To create levels, first, find parts in bom that are top level assemblies. // Do this by doing a LEFT JOIN from bom to bom (as bom2), linking @@ -45,10 +43,10 @@ flush(); // This finds the top level $sql = "INSERT INTO passbom (part, sortpart) - SELECT bom.component AS part, - CONCAT(bom.parent,'%',bom.component) AS sortpart - FROM bom LEFT JOIN bom as bom2 ON bom.parent = bom2.component - WHERE bom2.component IS NULL"; + SELECT bom.component AS part, + CONCAT(bom.parent,'%',bom.component) AS sortpart + FROM bom LEFT JOIN bom as bom2 ON bom.parent = bom2.component + WHERE bom2.component IS NULL"; $result = DB_query($sql,$db); $lctr = 2; @@ -76,12 +74,12 @@ FROM bom,passbom WHERE bom.parent = passbom.part"; $result = DB_query($sql,$db); - $result = DB_query('DROP TABLE IF EXISTS passbom2',$db); - $result = DB_query('ALTER TABLE passbom RENAME AS passbom2',$db); - $result = DB_query('DROP TABLE IF EXISTS passbom',$db); + $result = DB_query("DROP TABLE IF EXISTS passbom2",$db); + $result = DB_query("ALTER TABLE passbom RENAME AS passbom2",$db); + $result = DB_query("DROP TABLE IF EXISTS passbom",$db); - $sql = 'CREATE TEMPORARY TABLE passbom (part char(20), - sortpart text) DEFAULT CHARSET=utf8'; + $sql = "CREATE TEMPORARY TABLE passbom (part char(20), + sortpart text) DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db); $sql = "INSERT INTO passbom (part, sortpart) @@ -92,9 +90,9 @@ $result = DB_query($sql,$db); - $sql = 'SELECT COUNT(*) FROM bom + $sql = "SELECT COUNT(*) FROM bom INNER JOIN passbom ON bom.parent = passbom.part - GROUP BY bom.parent'; + GROUP BY bom.parent"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); @@ -104,9 +102,9 @@ prnMsg(_('Creating bomlevels table'),'info'); flush(); - $sql = 'CREATE TEMPORARY TABLE bomlevels ( + $sql = "CREATE TEMPORARY TABLE bomlevels ( part char(20), - level int) DEFAULT CHARSET=utf8'; + level int) DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db); // Read tempbom and split sortpart into separate parts. For each separate part, calculate level as @@ -114,7 +112,7 @@ // part in the array for a level 4 sortpart would be created as a level 3 in levels, the fourth // and last part in sortpart would have a level code of zero, meaning it has no components - $sql = 'SELECT * FROM tempbom'; + $sql = "SELECT * FROM tempbom"; $result = DB_query($sql,$db); while ($myrow=DB_fetch_array($result)) { $parts = explode('%',$myrow['sortpart']); @@ -140,7 +138,7 @@ shrinkfactor double NOT NULL default '0', eoq double NOT NULL default '0') DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db); - $sql = 'INSERT INTO levels (part, + $sql = "INSERT INTO levels (part, level, leadtime, pansize, @@ -157,15 +155,15 @@ GROUP BY bomlevels.part, pansize, shrinkfactor, - stockmaster.eoq'; + stockmaster.eoq"; $result = DB_query($sql,$db); - $sql = 'ALTER TABLE levels ADD INDEX part(part)'; + $sql = "ALTER TABLE levels ADD INDEX part(part)"; $result = DB_query($sql,$db); // Create levels records with level of zero for all parts in stockmaster that // are not in bom - $sql = 'INSERT INTO levels (part, + $sql = "INSERT INTO levels (part, level, leadtime, pansize, @@ -179,53 +177,53 @@ stockmaster.eoq FROM stockmaster LEFT JOIN levels ON stockmaster.stockid = levels.part - WHERE levels.part IS NULL'; + WHERE levels.part IS NULL"; $result = DB_query($sql,$db); // Update leadtime in levels from purchdata. Do it twice so can make sure leadtime from preferred // vendor is used - $sql = 'UPDATE levels,purchdata + $sql = "UPDATE levels,purchdata SET levels.leadtime = purchdata.leadtime WHERE levels.part = purchdata.stockid - AND purchdata.leadtime > 0'; + AND purchdata.leadtime > 0"; $result = DB_query($sql,$db); - $sql = 'UPDATE levels,purchdata + $sql = "UPDATE levels,purchdata SET levels.leadtime = purchdata.leadtime WHERE levels.part = purchdata.stockid AND purchdata.preferred = 1 - AND purchdata.leadtime > 0'; + AND purchdata.leadtime > 0"; $result = DB_query($sql,$db); prnMsg(_('Levels table has been created'),'info'); flush(); // Get rid if temporary tables - $sql = 'DROP TABLE IF EXISTS tempbom'; + $sql = "DROP TABLE IF EXISTS tempbom"; //$result = DB_query($sql,$db); - $sql = 'DROP TABLE IF EXISTS passbom'; + $sql = "DROP TABLE IF EXISTS passbom"; //$result = DB_query($sql,$db); - $sql = 'DROP TABLE IF EXISTS passbom2'; + $sql = "DROP TABLE IF EXISTS passbom2"; //$result = DB_query($sql,$db); - $sql = 'DROP TABLE IF EXISTS bomlevels'; + $sql = "DROP TABLE IF EXISTS bomlevels"; //$result = DB_query($sql,$db); // In the following section, create mrprequirements from open sales orders and // mrpdemands prnMsg(_('Creating requirements table'),'info'); flush(); - $result = DB_query('DROP TABLE IF EXISTS mrprequirements',$db); + $result = DB_query("DROP TABLE IF EXISTS mrprequirements",$db); // directdemand is 1 if demand is directly for this part, is 0 if created because have netted // out supply and demands for a top level part and determined there is still a net // requirement left and have to pass that down to the BOM parts using the // CreateLowerLevelRequirement() function. Mostly do this so can distinguish the type // of requirements for the MRPShortageReport so don't show double requirements. - $sql = 'CREATE TABLE mrprequirements ( part char(20), + $sql = "CREATE TABLE mrprequirements ( part char(20), daterequired date, quantity double, mrpdemandtype varchar(6), orderno int(11), directdemand smallint, - whererequired char(20)) DEFAULT CHARSET=utf8'; + whererequired char(20)) DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db,_('Create of mrprequirements failed because')); prnMsg(_('Loading requirements from sales orders'),'info'); Modified: trunk/MRPCalendar.php =================================================================== --- trunk/MRPCalendar.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/MRPCalendar.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -1,12 +1,10 @@ <?php /* $Id$ */ -/* $Revision: 1.6 $ */ + // MRPCalendar.php // Maintains the calendar of valid manufacturing dates for MRP -//$PageSecurity=9; - include('includes/session.inc'); $title = _('MRP Calendar'); include('includes/header.inc'); @@ -75,15 +73,15 @@ return; } - $sql = 'DROP TABLE IF EXISTS mrpcalendar'; + $sql = "DROP TABLE IF EXISTS mrpcalendar"; $result = DB_query($sql,$db); - $sql = 'CREATE TABLE mrpcalendar ( + $sql = "CREATE TABLE mrpcalendar ( calendardate date NOT NULL, daynumber int(6) NOT NULL, - manufacturingflag smallint(6) NOT NULL default "1", + manufacturingflag smallint(6) NOT NULL default '1', INDEX (daynumber), - PRIMARY KEY (calendardate))'; + PRIMARY KEY (calendardate)) DEFAULT CHARSET=utf8"; $ErrMsg = _('The SQL to to create passbom failed with the message'); $result = DB_query($sql,$db,$ErrMsg); @@ -95,9 +93,9 @@ $ExcludeDays = array($_POST['Sunday'],$_POST['Monday'],$_POST['Tuesday'],$_POST['Wednesday'], $_POST['Thursday'],$_POST['Friday'],$_POST['Saturday']); - $caldate = $convertfromdate; + $CalDate = $convertfromdate; for ($i = 0; $i <= $datediff; $i++) { - $dateadd = FormatDateForSQL(DateAdd($caldate,"d",$i)); + $dateadd = FormatDateForSQL(DateAdd($CalDate,"d",$i)); // If the check box for the calendar date's day of week was clicked, set the manufacturing flag to 0 $dayofweek = DayOfWeekFromSQLDate($dateadd); @@ -121,16 +119,16 @@ // Update daynumber. Set it so non-manufacturing days will have the same daynumber as a valid // manufacturing day that precedes it. That way can read the table by the non-manufacturing day, // subtract the leadtime from the daynumber, and find the valid manufacturing day with that daynumber. - $daynumber = 1; - $sql = 'SELECT * FROM mrpcalendar ORDER BY calendardate'; + $DayNumber = 1; + $sql = "SELECT * FROM mrpcalendar ORDER BY calendardate"; $result = DB_query($sql,$db,$ErrMsg); while ($myrow = DB_fetch_array($result)) { if ($myrow['manufacturingflag'] == "1") { - $daynumber++; + $DayNumber++; } - $caldate = $myrow['calendardate']; - $sql = "UPDATE mrpcalendar SET daynumber = '$daynumber' - WHERE calendardate = '$caldate'"; + $CalDate = $myrow['calendardate']; + $sql = "UPDATE mrpcalendar SET daynumber = '" . $DayNumber . "' + WHERE calendardate = '$CalDate'"; $resultupdate = DB_query($sql,$db,$ErrMsg); } prnMsg(_("The MRP Calendar has been created"),'succes'); @@ -145,9 +143,9 @@ // After change the flag, re-calculate the daynumber for all dates. $InputError = 0; - $caldate = FormatDateForSQL($ChangeDate); + $CalDate = FormatDateForSQL($ChangeDate); $sql="SELECT COUNT(*) FROM mrpcalendar - WHERE calendardate='$caldate' + WHERE calendardate='$CalDate' GROUP BY calendardate"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); @@ -161,7 +159,7 @@ return; } - $sql="SELECT mrpcalendar.* FROM mrpcalendar WHERE calendardate='$caldate'"; + $sql="SELECT mrpcalendar.* FROM mrpcalendar WHERE calendardate='$CalDate'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); $newmanufacturingflag = 0; @@ -169,7 +167,7 @@ $newmanufacturingflag = 1; } $sql = "UPDATE mrpcalendar SET manufacturingflag = '".$newmanufacturingflag."' - WHERE calendardate = '".$caldate."'"; + WHERE calendardate = '".$CalDate."'"; $ErrMsg = _('Cannot update the MRP Calendar'); $resultupdate = DB_query($sql,$db,$ErrMsg); prnMsg(_("The MRP calendar record for $ChangeDate has been updated"),'success'); @@ -180,16 +178,16 @@ // Update daynumber. Set it so non-manufacturing days will have the same daynumber as a valid // manufacturing day that precedes it. That way can read the table by the non-manufacturing day, // subtract the leadtime from the daynumber, and find the valid manufacturing day with that daynumber. - $daynumber = 1; - $sql = 'SELECT * FROM mrpcalendar ORDER BY calendardate'; + $DayNumber = 1; + $sql = "SELECT * FROM mrpcalendar ORDER BY calendardate"; $result = DB_query($sql,$db,$ErrMsg); while ($myrow = DB_fetch_array($result)) { - if ($myrow['manufacturingflag'] == "1") { - $daynumber++; + if ($myrow['manufacturingflag'] == '1') { + $DayNumber++; } - $caldate = $myrow['calendardate']; - $sql = "UPDATE mrpcalendar SET daynumber = '$daynumber' - WHERE calendardate = '$caldate'"; + $CalDate = $myrow['calendardate']; + $sql = "UPDATE mrpcalendar SET daynumber = '" . $DayNumber . "' + WHERE calendardate = '" . $CalDate . "'"; $resultupdate = DB_query($sql,$db,$ErrMsg); } // End of while @@ -199,24 +197,24 @@ function listall(&$db) //####LISTALL_LISTALL_LISTALL_LISTALL_LISTALL_LISTALL_LISTALL_#### { // List all records in date range - $fromdate = FormatDateForSQL($_POST['FromDate']); - $todate = FormatDateForSQL($_POST['ToDate']); + $FromDate = FormatDateForSQL($_POST['FromDate']); + $ToDate = FormatDateForSQL($_POST['ToDate']); $sql = "SELECT calendardate, daynumber, manufacturingflag, DAYNAME(calendardate) as dayname FROM mrpcalendar - WHERE calendardate >='$fromdate' - AND calendardate <='$todate'"; + WHERE calendardate >='" . $FromDate . "' + AND calendardate <='" . $ToDate . "'"; $ErrMsg = _('The SQL to find the parts selected failed with the message'); $result = DB_query($sql,$db,$ErrMsg); - echo "</br><table class=selection> - <tr BGCOLOR =#800000> - <th>" . _('Date') . "</th> - <th>" . _('Manufacturing Date') . "</th> - </tr></font>"; + echo '</br><table class="selection"> + <tr bgcolor ="#800000"> + <th>' . _('Date') . '</th> + <th>' . _('Manufacturing Date') . '</th> + </tr>'; $ctr = 0; while ($myrow = DB_fetch_array($result)) { $flag = _('Yes'); @@ -251,51 +249,51 @@ $_POST['FromDate']=date($_SESSION['DefaultDateFormat']); $_POST['ToDate']=date($_SESSION['DefaultDateFormat']); } - echo "<form action=" . $_SERVER['PHP_SELF'] . "?" . SID ." method=post></br></br>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post"><br /><br />'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<br><table class=selection>'; + echo '<br><table class="selection">'; echo '<tr> - <td>' . _('From Date') . ":</td> - <td><input type='Text' class=date alt='".$_SESSION['DefaultDateFormat'] ."' name='FromDate' size=10 maxlength=10 value=" . $_POST['FromDate'] . '></td></tr> - <tr></tr><td>' . _('To Date') . ":</td> - <td><input type='Text' class=date alt='".$_SESSION['DefaultDateFormat'] ."' name='ToDate' size=10 maxlength=10 value=" . $_POST['ToDate'] . '></td> + <td>' . _('From Date') . ':</td> + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] .'" name="FromDate" size="10" maxlength="10" value="' . $_POST['FromDate'] . '"></td></tr> + <tr></tr><td>' . _('To Date') . ':</td> + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] .'" name="ToDate" size="10" maxlength="10" value="' . $_POST['ToDate'] . '"></td> </tr> <tr><td></td></tr> <tr><td></td></tr> <tr><td>'._('Exclude The Following Days').'</td></tr> <tr> - <td>' . _('Saturday') . ":</td> - <td><input type='checkbox' name='Saturday' value='Saturday'></td> + <td>' . _('Saturday') . ':</td> + <td><input type="checkbox" name="Saturday" value="Saturday"></td> </tr> <tr> - <td>" . _('Sunday') . ":</td> - <td><input type='checkbox' name='Sunday' value='Sunday'></td> + <td>' . _('Sunday') . ':</td> + <td><input type="checkbox" name="Sunday" value="Sunday"></td> </tr> <tr> - <td>" . _('Monday') . ":</td> - <td><input type='checkbox' name='Monday' value='Monday'></td> + <td>' . _('Monday') . ':</td> + <td><input type="checkbox" name="Monday" value="Monday"></td> </tr> <tr> - <td>" . _('Tuesday') . ":</td> - <td><input type='checkbox' name='Tuesday' value='Tuesday'></td> + <td>' . _('Tuesday') . ':</td> + <td><input type="checkbox" name="Tuesday" value="Tuesday"></td> </tr> <tr> - <td>" . _('Wednesday') . ":</td> - <td><input type='checkbox' name='Wednesday' value='Wednesday'></td> + <td>' . _('Wednesday') . ':</td> + <td><input type="checkbox" name="Wednesday" value="Wednesday"></td> </tr> <tr> - <td>" . _('Thursday') . ":</td> - <td><input type='checkbox' name='Thursday' value='Thursday'></td> + <td>' . _('Thursday') . ':</td> + <td><input type="checkbox" name="Thursday" value="Thursday"></td> </tr> <tr> - <td>" . _('Friday') . ":</td> - <td><input type='checkbox' name='Friday' value='Friday'></td> + <td>' . _('Friday') . ':</td> + <td><input type="checkbox" name="Friday" value="Friday"></td> </tr> </table><br> - <div class=centre><input type='submit' name='submit' value='" . _('Create Calendar') . "'> - <input type='submit' name='listall' value='" . _('List Date Range') . "'></div>"; + <div class=centre><input type="submit" name="submit" value="' . _('Create Calendar') . '"> + <input type="submit" name="listall" value="' . _('List Date Range') . '"></div>'; if (!isset($_POST['ChangeDate'])) { $_POST['ChangeDate']=date($_SESSION['DefaultDateFormat']); @@ -303,15 +301,14 @@ echo '<br><table class=selection>'; echo '<tr> - <td>' . _('Change Date Status') . ":</td> - <td><input type='Text' name='ChangeDate' class=date alt='".$_SESSION['DefaultDateFormat'] . - "' size=12 maxlength=12 value=" . $_POST['ChangeDate'] . '></td> + <td>' . _('Change Date Status') . ':</td> + <td><input type="text" name="ChangeDate" class="date" alt="' . $_SESSION['DefaultDateFormat'] . + '" size="12" maxlength="12" value="' . $_POST['ChangeDate'] . '"></td> <td><input type="submit" name="update" value="' . _('Update') . '"></td></tr></table>'; -echo "</br></br><div class='centre'></div>"; +echo '<br /><br /><div class="centre"></div>'; echo '</form>'; } // End of function display() - include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/MRPShortages.php =================================================================== --- trunk/MRPShortages.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/MRPShortages.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -6,7 +6,7 @@ include('includes/session.inc'); //ANSI SQL??? -$sql='SHOW TABLES WHERE Tables_in_'.$_SESSION['DatabaseName']."='mrprequirements'"; +$sql="SHOW TABLES WHERE Tables_in_" . $_SESSION['DatabaseName'] . "='mrprequirements'"; $result=DB_query($sql,$db); if (DB_num_rows($result)==0) { @@ -32,48 +32,47 @@ // total for either supply or demand. Did this to simplify main sql where used // several subqueries. - $sql = 'CREATE TEMPORARY TABLE demandtotal ( + $sql = "CREATE TEMPORARY TABLE demandtotal ( part char(20), demand double, - KEY `PART` (`part`)) DEFAULT CHARSET=utf8'; + KEY `PART` (`part`)) DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db,_('Create of demandtotal failed because')); - $sql = 'INSERT INTO demandtotal + $sql = "INSERT INTO demandtotal (part, demand) SELECT part, SUM(quantity) as demand FROM mrprequirements - GROUP BY part'; + GROUP BY part"; $result = DB_query($sql,$db); - $sql = 'CREATE TEMPORARY TABLE supplytotal ( + $sql = "CREATE TEMPORARY TABLE supplytotal ( part char(20), supply double, - KEY `PART` (`part`)) DEFAULT CHARSET=utf8'; + KEY `PART` (`part`)) DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db,_('Create of supplytotal failed because')); /* 21/03/2010: Ricard modification to allow items with total supply = 0 be included in the report */ - $sql = 'INSERT INTO supplytotal + $sql = "INSERT INTO supplytotal (part, supply) SELECT stockid, 0 - FROM stockmaster'; + FROM stockmaster"; $result = DB_query($sql,$db); - $sql = 'UPDATE supplytotal + $sql = "UPDATE supplytotal SET supply = (SELECT SUM(mrpsupplies.supplyquantity) FROM mrpsupplies WHERE supplytotal.part = mrpsupplies.part - AND mrpsupplies.supplyquantity > 0)'; + AND mrpsupplies.supplyquantity > 0)"; $result = DB_query($sql,$db); - $sql = 'UPDATE supplytotal SET supply = 0 WHERE supply IS NULL '; + $sql = "UPDATE supplytotal SET supply = 0 WHERE supply IS NULL"; $result = DB_query($sql,$db); -/* End Ricard modification */ // Only include directdemand mrprequirements so don't have demand for top level parts and also // show demand for the lower level parts that the upper level part generates. See MRP.php for Modified: trunk/PDFPrintLabel.php =================================================================== --- trunk/PDFPrintLabel.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/PDFPrintLabel.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -118,15 +118,15 @@ <input type="submit" name="PDFTest" value="'. _('Print labels with borders') .'"></div>'; $iTxt=0; - echo '<script type="text/javascript"> - function setAll(all) { - var x=document.getElementById("form1"); - for (var i=0;i<x.length;i++) { - if (x.elements[i].id==\'item\'); - x.elements[i].checked=all.checked; - } - } - </script>'; + echo "<script type=\"text/javascript\"> + function setAll(all) { + var x=document.getElementById('form1'); + for (var i=0;i<x.length;i++) { + if (x.elements[i].id=='item'); + x.elements[i].checked=all.checked; + } + } + </script>"; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' .$txt[$iTxt++].'</p>'; echo '<form name ="form1" action="'.$_SERVER['PHP_SELF'].'" method="POST" id="form1">'; Modified: trunk/PDFStockTransfer.php =================================================================== --- trunk/PDFStockTransfer.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/PDFStockTransfer.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -74,7 +74,7 @@ //get the next row which will be the quantity received in the receiving location $myNextRow=DB_fetch_array($result); $ToCode=$myNextRow['loccode']; -$To = $myrow['locationname']; +$To = $myNextRow['locationname']; $Quantity=$myNextRow['qty']; $Description=$myNextRow['description']; Added: trunk/ReprintGRN.php =================================================================== --- trunk/ReprintGRN.php (rev 0) +++ trunk/ReprintGRN.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -0,0 +1,100 @@ +<?php +/* $Id: ReprintGrn.php 4486 2011-02-08 09:20:50Z daintree $*/ + +include('includes/session.inc'); +$title=_('Reprint a GRN'); +include('includes/header.inc'); + +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . + $title . '" alt="" />' . ' ' . $title . '</p>'; + +if (!isset($_POST['PONumber'])) { + $_POST['PONumber']=''; +} + +echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; +echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; +echo '<table class="selection">'; +echo '<tr><th colspan="2"><font size="2" color="navy">' . _('Select a purchase order') . '</th></tr>'; +echo '<tr><td>' . _('Enter a Purchase Order Number') . '</td>'; +echo '<td>' . '<input type="text" name="PONumber" class="number" size="7" value="'.$_POST['PONumber'].'" /></td></tr>'; +echo '<tr><td colspan=2 style="text-align: center">' . '<input type="submit" name="Show" value="Show GRNs" /></td></tr>'; + +echo '</table>'; +echo '</form>'; + +if (isset($_POST['Show'])) { + if ($_POST['PONumber']=='') { + echo '<br />'; + prnMsg( _('You must enter a purchase order number in the box above'), 'warn'); + include('includes/footer.inc'); + exit; + } + $sql="SELECT count(orderno) + FROM purchorders + WHERE orderno='" . $_POST['PONumber'] ."'"; + $result=DB_query($sql, $db); + $myrow=DB_fetch_row($result); + if ($myrow[0]==0) { + echo '<br />'; + prnMsg( _('This purchase order does not exist on the system. Please try again.'), 'warn'); + include('includes/footer.inc'); + exit; + } + $sql="SELECT grnbatch, + grnno, + grns.podetailitem, + grns.itemcode, + grns.itemdescription, + grns.deliverydate, + grns.qtyrecd, + suppliers.suppname, + stockmaster.decimalplaces + FROM grns INNER JOIN suppliers + ON grns.supplierid=suppliers.supplierid + INNER JOIN purchorderdetails + ON grns.podetailitem=purchorderdetails.podetailitem + LEFT JOIN stockmaster + ON grns.itemcode=stockmaster.stockid + WHERE orderno='" . $_POST['PONumber'] ."'"; + $result=DB_query($sql, $db); + if (DB_num_rows($result)==0) { + echo '<br />'; + prnMsg( _('There are no GRNs for this purchase order that can be reprinted.'), 'warn'); + include('includes/footer.inc'); + exit; + } + $k=0; + echo '<br /><table class="selection">'; + echo '<tr><th colspan="8"><font size="2" color="navy">' . _('GRNs for Purchase Order No') .' ' . $_POST['PONumber'] . '</th></tr>'; + echo '<tr><th>' . _('Supplier') . '</th>'; + echo '<th>' . _('PO Order line') . '</th>'; + echo '<th>' . _('GRN Number') . '</th>'; + echo '<th>' . _('Item Code') . '</th>'; + echo '<th>' . _('Item Description') . '</th>'; + echo '<th>' . _('Delivery Date') . '</th>'; + echo '<th>' . _('Quantity Received') . '</th></tr>'; + while ($myrow=DB_fetch_array($result)) { + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k=1; + } + echo '<td>' . $myrow['suppname'] . '</td>'; + echo '<td class="number">' . $myrow['podetailitem'] . '</td>'; + echo '<td class="number">' . $myrow['grnbatch'] . '</td>'; + echo '<td>' . $myrow['itemcode'] . '</td>'; + echo '<td>' . $myrow['itemdescription'] . '</td>'; + echo '<td>' . $myrow['deliverydate'] . '</td>'; + echo '<td class="number">' . number_format($myrow['qtyrecd'], $myrow['decimalplaces']) . '</td>'; + echo '<td><a href="PDFGrn.php?GRNNo=' . $myrow['grnbatch'] .'&PONo=' . $_POST['PONumber'] . '">' . _('Reprint') . '</a></td>'; + echo '</tr>'; + } + echo '</table>'; +} + +include('includes/footer.inc'); + +?> \ No newline at end of file Modified: trunk/SelectProduct.php =================================================================== --- trunk/SelectProduct.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/SelectProduct.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -28,10 +28,10 @@ $_POST['StockCode'] = trim(strtoupper($_POST['StockCode'])); } // Always show the search facilities -$SQL = 'SELECT categoryid, +$SQL = "SELECT categoryid, categorydescription FROM stockcategory - ORDER BY categorydescription'; + ORDER BY categorydescription"; $result1 = DB_query($SQL, $db); if (DB_num_rows($result1) == 0) { echo '<p><font size=4 color=red>' . _('Problem Report') . ':</font><br />' . _('There are no stock categories currently defined please use the link below to set them up').'</p>'; @@ -671,7 +671,7 @@ $_POST['PageOffset'] = $ListPageMax; } if ($ListPageMax > 1) { - echo "<div class='centre'><p> " . $_POST['PageOffset'] . ' ' . _('of') . ' ' . $ListPageMax . ' ' . _('pages') . '. ' . _('Go to Page') . ': '; + echo '<div class="centre"><p> ' . $_POST['PageOffset'] . ' ' . _('of') . ' ' . $ListPageMax . ' ' . _('pages') . '. ' . _('Go to Page') . ': '; echo '<select name="PageOffset">'; $ListPage = 1; while ($ListPage <= $ListPageMax) { Modified: trunk/StockTransferControlled.php =================================================================== --- trunk/StockTransferControlled.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/StockTransferControlled.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -72,14 +72,19 @@ $StockID = $LineItem->StockID; $InOutModifier=1; //seems odd, but it's correct $ShowExisting = true; -include ('includes/InputSerialItems.php'); +if (isset($TransferItem)){ + $LineNo=$TransferItem; +} else { + $LineNo=0; +} +include ('includes/OutputSerialItems.php'); /*TotalQuantity set inside this include file from the sum of the bundles of the item selected for adjusting */ -$LineItem->Quantity = $TotalQuantity; +$LineItem->Quantity = $TransferQuantity; /*Also a multi select box for adding bundles to the Transfer without keying */ include('includes/footer.inc'); exit; -?> +?> \ No newline at end of file Modified: trunk/StockTransfers.php =================================================================== --- trunk/StockTransfers.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/StockTransfers.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -11,15 +11,19 @@ include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); +if (isset($_GET['New'])) { + unset($_SESSION['Transfer']); +} + if (isset($_POST['CheckCode'])) { -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Dispatch') . + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Dispatch') . '" alt="" />' . ' ' . _('Select Item to Transfer') . '</p>'; if (strlen($_POST['StockText'])>0) { - $sql="SELECT stockid, description from stockmaster where description like '%" . $_POST['StockText'] . "%'"; + $sql="SELECT stockid, description from stockmaster where description " . LIKE . " '%" . $_POST['StockText'] . "%'"; } else { - $sql="SELECT stockid, description from stockmaster where stockid like '%" . $_POST['StockCode']."%'"; + $sql="SELECT stockid, description from stockmaster where stockid " . LIKE . " '%" . $_POST['StockCode']."%'"; } $ErrMsg=_('The stock information cannot be retrieved because'); $DbgMsg=_('The SQL to get the stock description was'); @@ -30,7 +34,7 @@ while ($myrow = DB_fetch_row($result)) { echo '<tr><td>'.$myrow[0].'</td> <td>'.$myrow[1].'</td> - <td><a href="StockTransfers.php?StockID='.$myrow[0].'&Description='.$myrow[1].'">Transfer</a></td> + <td><a href="StockTransfers.php?StockID='.$myrow[0].'&Description='.$myrow[1].'">' . _('Transfer') . '</a></td> </tr>'; } echo '</table>'; @@ -43,6 +47,7 @@ if (isset($_GET['NewTransfer'])){ unset($_SESSION['Transfer']); unset($_SESSION['TransferItem']); /*this is defined in bulk transfers but needs to be unset for individual trsnsfers */ + $NewTransfer=$_GET['NewTransfer']; } @@ -73,22 +78,24 @@ materialcost+labourcost+overheadcost as standardcost, controlled, serialised, + perishable, decimalplaces FROM stockmaster WHERE stockid='" . trim(strtoupper($_POST['StockID'])) . "'", $db); - $myrow = DB_fetch_row($result); + if (DB_num_rows($result) == 0){ prnMsg( _('Unable to locate Stock Code').' '.strtoupper($_POST['StockID']), 'error' ); } elseif (DB_num_rows($result)>0){ - - $_SESSION['Transfer']->TransferItem[0] = new LineItem ( trim(strtoupper($_POST['StockID'])), - $myrow[0], - $_POST['Quantity'], - $myrow[1], - $myrow[4], - $myrow[5], - $myrow[6]); + $myrow = DB_fetch_row($result); + $_SESSION['Transfer']->TransferItem[0] = new LineItem ( trim(strtoupper($_POST['StockID'])), + $myrow['description'], + $_POST['Quantity'], + $myrow['units'], + $myrow['controlled'], + $myrow['serialised'], + $myrow['perishable'], + $myrow['decimalplaces']); $_SESSION['Transfer']->TransferItem[0]->StandardCost = $myrow[3]; @@ -222,7 +229,8 @@ if ($SerialItemExistsRow[0]==1){ $SQL = "UPDATE stockserialitems - SET quantity= quantity - '" . $Item->BundleQty . "' + SET quantity= quantity - '" . $Item->BundleQty . "', + expirationdate='" . FormatDateForSQL($Item->ExpiryDate) . "' WHERE stockid='" . $_SESSION['Transfer']->TransferItem[0]->StockID . "' AND loccode='" . $_SESSION['Transfer']->StockLocationFrom . "' AND serialno='" . $Item->BundleRef . "'"; @@ -235,10 +243,12 @@ $SQL = "INSERT INTO stockserialitems (stockid, loccode, serialno, + expirationdate, quantity) VALUES ('" . $_SESSION['Transfer']->TransferItem[0]->StockID . "', '" . $_SESSION['Transfer']->StockLocationFrom . "', '" . $Item->BundleRef . "', + '" . FormatDateForSQL($Item->ExpiryDate) . "', '" . -$Item->BundleQty . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record could not be added because'); @@ -334,7 +344,8 @@ if ($SerialItemExistsRow[0]==1){ $SQL = "UPDATE stockserialitems - SET quantity= quantity + '" . $Item->BundleQty . "' + SET quantity= quantity + '" . $Item->BundleQty . "', + expirationdate='" . FormatDateForSQL($Item->ExpiryDate) . "' WHERE stockid='" . $_SESSION['Transfer']->TransferItem[0]->StockID . "' AND loccode='" . $_SESSION['Transfer']->StockLocationTo . "' AND serialno='" . $Item->BundleRef . "'"; @@ -347,10 +358,12 @@ $SQL = "INSERT INTO stockserialitems (stockid, loccode, serialno, + expirationdate, quantity) VALUES ('" . $_SESSION['Transfer']->TransferItem[0]->StockID . "', '" . $_SESSION['Transfer']->StockLocationTo . "', '" . $Item->BundleRef . "', + '" . FormatDateForSQL($Item->ExpiryDate) . "', '" . $Item->BundleQty . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record could not be added because'); @@ -398,7 +411,7 @@ $Result = DB_Txn_Commit($db); prnMsg(_('An inventory transfer of').' ' . $_SESSION['Transfer']->TransferItem[0]->StockID . ' - ' . $_SESSION['Transfer']->TransferItem[0]->ItemDescription . ' '. _('has been created from').' ' . $_SESSION['Transfer']->StockLocationFrom . ' '. _('to') . ' ' . $_SESSION['Transfer']->StockLocationTo . ' '._('for a quantity of').' ' . $_SESSION['Transfer']->TransferItem[0]->Quantity,'success'); - echo '</br><a href="PDFStockTransfer.php?TransferNo='.$TransferNumber.'">Print Transfer Note</a>'; + echo '</br><a href="PDFStockTransfer.php?TransferNo='.$TransferNumber.'">' . _('Print Transfer Note') . '</a>'; unset ($_SESSION['Transfer']); include ('includes/footer.inc'); exit; @@ -406,28 +419,13 @@ } -if (!isset($_SESSION['Transfer']->TransferItem[0]->StockID)) { - $_SESSION['Transfer']->TransferItem[0]->StockID = ' '; -} -if (!isset($_SESSION['Transfer']->TransferItem[0]->ItemDescription)) { - $_SESSION['Transfer']->TransferItem[0]->ItemDescription = ''; -} -if (!isset($_SESSION['Transfer']->TransferItem[0]->Controlled)) { - $_SESSION['Transfer']->TransferItem[0]->Controlled = ''; -} - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Dispatch') . '" alt="" />' . ' ' . $title . '</p>'; echo '<form action="'. $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -//echo '<table> -// <tr> -// <td>'. _('Stock Code').':</td> -// <td><input type=text name="StockID" size=21 value="' . $_SESSION['Transfer']->TransferItem[0]->StockID . '" maxlength=20></td> -// <td><input type=submit name="CheckCode" VALUE="'._('Check Part').'"></td> -// </tr>'; + if (!isset($_GET['Description'])) { $_GET['Description']=''; } @@ -446,13 +444,13 @@ } echo '</td><td><input type=submit name="CheckCode" VALUE="'._('Check Part').'"></td></tr>'; -if (strlen($_SESSION['Transfer']->TransferItem[0]->ItemDescription)>1){ +if (isset($_SESSION['Transfer']->TransferItem[0]->ItemDescription) and strlen($_SESSION['Transfer']->TransferItem[0]->ItemDescription)>1){ echo '<tr><td colspan=3><font color=BLUE size=3>' . $_SESSION['Transfer']->TransferItem[0]->ItemDescription . ' ('._('In Units of').' ' . $_SESSION['Transfer']->TransferItem[0]->PartUnit . ' )</font></td></tr>'; } echo '<tr><td>' . _('From Stock Location').':</td><td><select name="StockLocationFrom">'; -$sql = 'SELECT loccode, locationname FROM locations'; +$sql = "SELECT loccode, locationname FROM locations"; $resultStkLocs = DB_query($sql,$db); while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_SESSION['Transfer']->StockLocationFrom)){ @@ -476,13 +474,13 @@ DB_data_seek($resultStkLocs,0); while ($myrow=DB_fetch_array($resultStkLocs)){ - if (isset($_SESSION['Transfer']->StockLocationTo)){ + if (isset($_SESSION['Transfer']) AND isset($_SESSION['Transfer']->StockLocationTo)){ if ($myrow['loccode'] == $_SESSION['Transfer']->StockLocationTo){ echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } - } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ + } elseif ($myrow['loccode']==$_SESSION['UserStockLocation'] AND isset($_SESSION['Transfer'])){ echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; $_SESSION['Transfer']->StockLocationTo=$myrow['loccode'] . '</option>'; } else { @@ -495,18 +493,18 @@ echo '<tr><td>'._('Transfer Quantity').':</td>'; -if (!isset($_SESSION['Transfer']->TransferItem[0]->Quantity)) { - $_SESSION['Transfer']->TransferItem[0]->Quantity=0; -} - -if ($_SESSION['Transfer']->TransferItem[0]->Controlled==1){ - echo '<td class=number><input type=hidden name="Quantity" value=' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '><a href="' . $rootpath .'/StockTransferControlled.php">' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '</a></td></tr>'; -} else { +if (isset($_SESSION['Transfer']->TransferItem[0]->Controlled) and $_SESSION['Transfer']->TransferItem[0]->Controlled==1){ + echo '<td class=number><input type=hidden name="Quantity" value=' . $_SESSION['Transfer']->TransferItem[0]->Quantity . + '><a href="' . $rootpath .'/StockTransferControlled.php?StockLocationFrom='.$_SESSION['Transfer']->StockLocationFrom.'">' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '</a></td></tr>'; +} else if (isset($_SESSION['Transfer']->TransferItem[0]->Controlled)){ echo '<td><input type=text class="number" name="Quantity" size=12 maxlength=12 value=' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '></td></tr>'; +} else { + echo '<td><input type=text class="number" name="Quantity" size=12 maxlength=12 Value="0"></td></tr>'; } echo '</table><div class="centre"><br /><input type="submit" name="EnterTransfer" value="' . _('Enter Stock Transfer') . '"><br />'; + if (empty($_SESSION['Transfer']->TransferItem[0]->StockID) and isset($_POST['StockID'])) { $StockID=$_POST['StockID']; } else if (isset($_SESSION['Transfer']->TransferItem[0]->StockID)) { @@ -514,13 +512,13 @@ } else { $StockID=''; } - -echo '<br /><a href="'.$rootpath.'/StockStatus.php?StockID=' . $StockID . '">'._('Show Stock Status').'</a>'; -echo '<br /><a href="'.$rootpath.'/StockMovements.php?StockID=' . $StockID . '">'._('Show Movements').'</a>'; -echo '<br /><a href="'.$rootpath.'/StockUsage.php?StockID=' . $StockID . '&StockLocation=' . $_SESSION['Transfer']->StockLocationFrom . '">' . _('Show Stock Usage') . '</a>'; -echo '<br /><a href="'.$rootpath.'/SelectSalesOrder.php?SelectedStockItem=' . $StockID . '&StockLocation=' . $_SESSION['Transfer']->StockLocationFrom . '">' . _('Search Outstanding Sales Orders') . '</a>'; -echo '<br /><a href="'.$rootpath.'/SelectCompletedOrder.php?SelectedStockItem=' . $StockID . '">'._('Search Completed Sales Orders').'</a>'; - +if (isset($_SESSION['Transfer'])) { + echo '<br /><a href="'.$rootpath.'/StockStatus.php?StockID=' . $StockID . '">'._('Show Stock Status').'</a>'; + echo '<br /><a href="'.$rootpath.'/StockMovements.php?StockID=' . $StockID . '">'._('Show Movements').'</a>'; + echo '<br /><a href="'.$rootpath.'/StockUsage.php?StockID=' . $StockID . '&StockLocation=' . $_SESSION['Transfer']->StockLocationFrom . '">' . _('Show Stock Usage') . '</a>'; + echo '<br /><a href="'.$rootpath.'/SelectSalesOrder.php?SelectedStockItem=' . $StockID . '&StockLocation=' . $_SESSION['Transfer']->StockLocationFrom . '">' . _('Search Outstanding Sales Orders') . '</a>'; + echo '<br /><a href="'.$rootpath.'/SelectCompletedOrder.php?SelectedStockItem=' . $StockID . '">'._('Search Completed Sales Orders').'</a>'; +} echo '</div></form>'; include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/SupplierInvoice.php =================================================================== --- trunk/SupplierInvoice.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/SupplierInvoice.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -510,7 +510,7 @@ echo '<br /><table class=selection> <tr> <td>' . _('Comments') . '</td> - <td><TEXTAREA name=Comments COLS=40 ROWS=2>' . $_SESSION['SuppTrans']->Comments . '</textarea></td> + <td><textarea name="Comments" cols="40" rows="2">' . $_SESSION['SuppTrans']->Comments . '</textarea></td> </tr> </table>'; @@ -550,8 +550,8 @@ $InputError = True; prnMsg(_('The invoice as entered cannot be processed because the total amount of the invoice is less than 0') . '. ' . _('Invoices are expected to have a positive charge'),'error'); - echo '<p> The tax total is : ' . $TaxTotal; - echo '<p> The ovamount is : ' . $_SESSION['SuppTrans']->OvAmount; + echo '<p>' . _('The tax total is') . ' : ' . $TaxTotal; + echo '<p>' . _('The ovamount is') . ' : ' . $_SESSION['SuppTrans']->OvAmount; } elseif ( $TaxTotal + $_SESSION['SuppTrans']->OvAmount == 0){ Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/doc/Change.log.html 2011-04-10 10:41:20 UTC (rev 4545) @@ -1,6 +1,9 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p /> -<p> +<p>10/4/11 Tim: +<p>10/4/11 Tim: GLAccountInquiry.php show None if no tag selected</p> +<p>10/4/11 Tim : PDFPrintLabel.php javascript fix</p> +<p>10/4/11 Tim: Add perishable to StockTransfer.php and PDFStockTransfer</p> <p>10/4/11 Tim: PDFPeriodStockTransListing - new report to print off stock transactions of a specified type for a selected period>/p> <p>10/4/11 Tim: PDFStockTransListing.php option to print off transactions by inventory location</p> <p>10/4/11 Tim: Stocks.php - more logical use of $New and $_POST['New']</p> Modified: trunk/includes/DefineLabelClass.php =================================================================== --- trunk/includes/DefineLabelClass.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/includes/DefineLabelClass.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -1,25 +1,25 @@ <?php define('MAX_LINES_PER_LABEL', 5); -define('LABELS_FILE', $_SESSION['reports_dir'] . "/labels.xml"); +define('LABELS_FILE', $_SESSION['reports_dir'] . '/labels.xml'); /** * These tags contains the more general data of the labels */ $GlobalTags = array('id'=>array('desc'=> _('Label id'), - 'type'=>'t', - 'sz'=>8, - 'maxsz'=>12), // text - 'description'=>array('desc'=>_('Description'), - 'type'=>'t', - 'sz'=>15, - 'maxsz'=>30) // text -); + 'type'=>'t', + 'sz'=>8, + 'maxsz'=>12), // text + 'description'=>array('desc'=>_('Description'), + 'type'=>'t', + 'sz'=>15, + 'maxsz'=>30) // text + ); /** * These tags specifies the dimension of individual label */ $DimensionTags = array( 'Unit'=>array('desc'=>_('Units'),'type'=>'s', - 'values'=>array('pt'=>'pt', 'in'=>'in', 'mm'=>'mm', 'cm'=>'cm' ) ), // select + 'values'=>array('pt'=>'pt', 'in'=>'in', 'mm'=>'mm', 'cm'=>'cm' ) ), // select 'Rows'=>array('desc'=>_('Rows per sheet'),'type'=>'i','sz'=>2,'maxsz'=>3), // integer numeric 'Cols'=>array('desc'=>_('Cols per sheet'),'type'=>'i','sz'=>2,'maxsz'=>3), 'Sh'=>array('desc'=>_('Sheet height'),'type'=>'n','sz'=>5,'maxsz'=>8), // float numeric @@ -164,8 +164,10 @@ * @return nothing */ function abortMsg($msg) { - global $rootpath, $DefaultClock, $Version; + global $rootpath, $DefaultClock, $Version, $theme; + $title=_('No label templates exist'); include ('includes/header.inc'); + echo '<br />'; prnMsg( $msg, 'error'); include ('includes/footer.inc'); exit; Modified: trunk/includes/DefineStockTransfers.php =================================================================== --- trunk/includes/DefineStockTransfers.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/includes/DefineStockTransfers.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -33,13 +33,14 @@ class LineItem { var $StockID; var $ItemDescription; - Var $ShipQty; - Var $PrevRecvQty; - Var $Quantity; - Var $PartUnit; + var $ShipQty; + var $PrevRecvQty; + var $Quantity; + var $PartUnit; var $Controlled; var $Serialised; - Var $DecimalPlaces; + var $DecimalPlaces; + var $Perishable; var $SerialItems; /*array to hold controlled items*/ //Constructor function LineItem($StockID, @@ -48,6 +49,7 @@ $PartUnit, $Controlled, $Serialised, + $Perishable, $DecimalPlaces){ $this->StockID = $StockID; @@ -56,6 +58,7 @@ $this->Controlled = $Controlled; $this->Serialised = $Serialised; $this->DecimalPlaces = $DecimalPlaces; + $this->Perishable = $Perishable; $this->ShipQty = $Quantity; if ($this->Controlled==1){ $this->Quantity = 0; Modified: trunk/includes/OutputSerialItems.php =================================================================== --- trunk/includes/OutputSerialItems.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/includes/OutputSerialItems.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -17,9 +17,9 @@ global $tableheader; /* Link to clear the list and start from scratch */ -$EditLink = '<br><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&EditControlled=true&StockID=' . $LineItem->StockID . +$EditLink = '<br><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?EditControlled=true&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Edit'). '</a> | '; -$RemoveLink = '<a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&DELETEALL=YES&StockID=' . $LineItem->StockID . +$RemoveLink = '<a href="' . $_SERVER['PHP_SELF'] . '?DELETEALL=YES&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Remove All'). '</a><br></div>'; $sql="SELECT perishable FROM stockmaster @@ -95,8 +95,9 @@ echo '<td class=number>' . $Bundle->ExpiryDate . '</td>'; } - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . 'Delete=' . $Bundle->BundleRef . '&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Delete'). '</a></td></tr>'; - + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?Delete=' . $Bundle->BundleRef . '&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Delete'). '</a></td></tr>'; + + $LineItem->SerialItems[]=$Bundle; $TotalQuantity += $Bundle->BundleQty; } @@ -114,13 +115,13 @@ /*Start a new table for the Serial/Batch ref input in one column (as a sub table then the multi select box for selection of existing bundle/serial nos for dispatch if applicable*/ //echo '<TABLE><TR><TD valign=TOP>'; - +$TransferQuantity=$TotalQuantity; /*in the first column add a table for the input of newies */ echo '<table class=selection>'; echo $tableheader; -echo '<form action="' . $_SERVER['PHP_SELF'] . '?=' . SID . '" name="Ga6uF5Wa" method="post"> +echo '<form action="' . $_SERVER['PHP_SELF'] . '" name="Ga6uF5Wa" method="post"> <input type=hidden name=LineNo value="' . $LineNo . '"> <input type=hidden name=StockID value="' . $StockID . '"> <input type=hidden name=EntryType value="KEYED">'; @@ -161,12 +162,18 @@ } } +if (isset($_SESSION['Transfer']->StockLocationFrom)) { + $Location=$_SESSION['Transfer']->StockLocationFrom; +} else if (isset($_SESSION['Items']->Location)) { + $Location=$_SESSION['Items']->Location; +} + $sql="SELECT serialno, quantity, expirationdate FROM stockserialitems WHERE stockid='".$StockID."' - AND loccode='".$_SESSION['Items']->Location."'"; + AND loccode='" . $Location . "'"; $result=DB_query($sql, $db); $RowNumber=0; Modified: trunk/index.php =================================================================== --- trunk/index.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/index.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -2,8 +2,6 @@ /* $Id$*/ -//$PageSecurity = 1; now comes from DB scripts table - include('includes/session.inc'); $title=_('Main Menu'); @@ -581,12 +579,12 @@ </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockTransfers.php">' . _('Inventory Location Transfers') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockTransfers.php?New=Yes">' . _('Inventory Location Transfers') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockAdjustments.php?NewAdjustment=Yes' . SID . '">' . _('Inventory Adjustments') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockAdjustments.php?NewAdjustment=Yes">' . _('Inventory Adjustments') . '</a></p>'; ?> </td> </tr> <tr> Modified: trunk/sql/mysql/upgrade3.11.1-4.00.sql =================================================================== --- trunk/sql/mysql/upgrade3.11.1-4.00.sql 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/sql/mysql/upgrade3.11.1-4.00.sql 2011-04-10 10:41:20 UTC (rev 4545) @@ -841,4 +841,4 @@ ALTER TABLE `paymentmethods` ADD `usepreprintedstationery` TINYINT NOT NULL DEFAULT '0'; DELETE FROM scripts WHERE script='PDFStockTransListing.php'; INSERT INTO scripts (`script` ,`pagesecurity` ,`description`) VALUES('PDFPeriodStockTransListing.php','3','Allows stock transactions of a specific transaction type to be listed over a single day or period range'); -IUPDATE config SET confvalue='4.03.7' WHERE confname='VersionNumber'; +UPDATE config SET confvalue='4.03.7' WHERE confname='VersionNumber'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-04-10 10:41:28
|
Revision: 4545 http://web-erp.svn.sourceforge.net/web-erp/?rev=4545&view=rev Author: daintree Date: 2011-04-10 10:41:20 +0000 (Sun, 10 Apr 2011) Log Message: ----------- Tim launchpad stuff Modified Paths: -------------- trunk/GLAccountInquiry.php trunk/GLAccounts.php trunk/MRP.php trunk/MRPCalendar.php trunk/MRPShortages.php trunk/PDFPrintLabel.php trunk/PDFStockTransfer.php trunk/SelectProduct.php trunk/StockTransferControlled.php trunk/StockTransfers.php trunk/SupplierInvoice.php trunk/doc/Change.log.html trunk/includes/DefineLabelClass.php trunk/includes/DefineStockTransfers.php trunk/includes/OutputSerialItems.php trunk/index.php trunk/sql/mysql/upgrade3.11.1-4.00.sql Added Paths: ----------- trunk/ReprintGRN.php Modified: trunk/GLAccountInquiry.php =================================================================== --- trunk/GLAccountInquiry.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/GLAccountInquiry.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -268,7 +268,9 @@ $tagsql="SELECT tagdescription FROM tags WHERE tagref='".$myrow['tag'] . "'"; $tagresult=DB_query($tagsql,$db); $tagrow = DB_fetch_array($tagresult); - + if ($tagrow['tagdescription']=='') { + $tagrow['tagdescription']=_('None'); + } printf("<td>%s</td> <td class=number><a href='%s'>%s</a></td> <td>%s</td> Modified: trunk/GLAccounts.php =================================================================== --- trunk/GLAccounts.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/GLAccounts.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -1,8 +1,6 @@ <?php -/* $Revision: 1.21 $ */ /* $Id$*/ -//$PageSecurity = 10; include('includes/session.inc'); $title = _('Chart of Accounts Maintenance'); @@ -58,19 +56,6 @@ )"; $result = DB_query($sql,$db,$ErrMsg); - /*Add the new chart details records for existing periods first */ -/*Maybe not required since these will be created from GLPostings.inc with correct B/fwd balances - $ErrMsg = _('Could not add the chart details for the new account'); - - $sql = 'INSERT INTO chartdetails (accountcode, period) - SELECT chartmaster.accountcode, periods.periodno - FROM chartmaster - CROSS JOIN periods - WHERE ( chartmaster.accountcode, periods.periodno ) NOT - IN ( SELECT chartdetails.accountcode, chartdetails.period FROM chartdetails )'; - - $result = DB_query($sql,$db,$ErrMsg); -*/ prnMsg(_('The new general ledger account has been added'),'success'); } @@ -218,7 +203,7 @@ if (!isset($_GET['delete'])) { - echo "<form method='post' name='GLAccounts' action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>"; + echo '<form method="post" name="GLAccounts" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedAccount)) { @@ -233,12 +218,16 @@ $_POST['AccountName'] = $myrow['accountname']; $_POST['Group'] = $myrow['group_']; - echo "<input type=hidden name='SelectedAccount' VALUE=$SelectedAccount>"; - echo "<input type=hidden name='AccountCode' VALUE=" . $_POST['AccountCode'] .">"; - echo "<table class=selection><tr><td>" . _('Account Code') . ":</td><td>" . $_POST['AccountCode'] . "</td></tr>"; + echo '<input type="hidden" name="SelectedAccount" value="' . $SelectedAccount . '">'; + echo '<input type="hidden" name="AccountCode" VALUE="' . $_POST['AccountCode'] .'">'; + echo '<table class=selection> + <tr><td>' . _('Account Code') . ':</td> + <td>' . $_POST['AccountCode'] . '</td></tr>'; } else { echo "<table class=selection>"; - echo "<tr><td>" . _('Account Code') . ":</td><td><input type=TEXT name='AccountCode' size=11 class=number maxlength=10></td></tr>"; + echo '<tr><td>' . _('Account Code') . ':</td> + <td><input type="text" name="AccountCode" size="11" class="number" maxlength="10" /></td> + </tr>'; } if (!isset($_POST['AccountName'])) {$_POST['AccountName']='';} @@ -251,17 +240,17 @@ while ($myrow = DB_fetch_array($result)){ if (isset($_POST['Group']) and $myrow[0]==$_POST['Group']){ - echo "<option selected VALUE='"; + echo '<option selected value="'; } else { - echo "<option VALUE='"; + echo '<option VALUE="'; } - echo $myrow[0] . "'>" . $myrow[0]; + echo $myrow[0] . '">' . $myrow[0] . '</option>'; } if (!isset($_GET['SelectedAccount']) or $_GET['SelectedAccount']=='') { - echo "<script>defaultControl(document.GLAccounts.AccountCode);</script>"; + echo '<script>defaultControl(document.GLAccounts.AccountCode);</script>'; } else { - echo "<script>defaultControl(document.GLAccounts.AccountName);</script>"; + echo '<script>defaultControl(document.GLAccounts.AccountName);</script>'; } echo '</select></td></tr></table>'; @@ -293,12 +282,12 @@ $result = DB_query($sql,$db,$ErrMsg); echo '<br><table class=selection>'; - echo "<tr> - <th>" . _('Account Code') . "</th> - <th>" . _('Account Name') . "</th> - <th>" . _('Account Group') . "</th> - <th>" . _('P/L or B/S') . "</th> - </tr>"; + echo '<tr> + <th>' . _('Account Code') . '</th> + <th>' . _('Account Name') . '</th> + <th>' . _('Account Group') . '</th> + <th>' . _('P/L or B/S') . '</th> + </tr>'; $k=0; //row colour counter @@ -323,9 +312,9 @@ $myrow[1], $myrow[2], $myrow[3], - $_SERVER['PHP_SELF'] . '?' . SID, + $_SERVER['PHP_SELF'] . '?', $myrow[0], - $_SERVER['PHP_SELF'] . '?' . SID, + $_SERVER['PHP_SELF'] . '?', $myrow[0]); } @@ -338,10 +327,10 @@ echo '<p>'; if (isset($SelectedAccount)) { - echo "<div class='centre'><a href='" . $_SERVER['PHP_SELF'] . '?' . SID ."'>" . _('Show All Accounts') . '</a></div>'; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Show All Accounts') . '</a></div>'; } -echo '<p>'; +echo '<p />'; include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/MRP.php =================================================================== --- trunk/MRP.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/MRP.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.7 $ */ + /* $Id$*/ -//$PageSecurity=9; - include('includes/session.inc'); $title = _('Run MRP Calculation'); include('includes/header.inc'); @@ -18,21 +16,21 @@ echo '</br>' ._('Start time') . ': ' . date('h:i:s') . '</br>'; echo '</br>' . _('Initialising tables .....') . '</br>'; flush(); - $result = DB_query('DROP TABLE IF EXISTS tempbom',$db); - $result = DB_query('DROP TABLE IF EXISTS passbom',$db); - $result = DB_query('DROP TABLE IF EXISTS passbom2',$db); - $result = DB_query('DROP TABLE IF EXISTS bomlevels',$db); - $result = DB_query('DROP TABLE IF EXISTS levels',$db); + $result = DB_query("DROP TABLE IF EXISTS tempbom",$db); + $result = DB_query("DROP TABLE IF EXISTS passbom",$db); + $result = DB_query("DROP TABLE IF EXISTS passbom2",$db); + $result = DB_query("DROP TABLE IF EXISTS bomlevels",$db); + $result = DB_query("DROP TABLE IF EXISTS levels",$db); - $sql = 'CREATE TEMPORARY TABLE passbom (part char(20), - sortpart text) DEFAULT CHARSET=utf8'; + $sql = "CREATE TEMPORARY TABLE passbom (part char(20), + sortpart text) DEFAULT CHARSET=utf8"; $ErrMsg = _('The SQL to to create passbom failed with the message'); $result = DB_query($sql,$db,$ErrMsg); - $sql = 'CREATE TEMPORARY TABLE tempbom (parent char(20), + $sql = "CREATE TEMPORARY TABLE tempbom (parent char(20), component char(20), sortpart text, - level int) DEFAULT CHARSET=utf8'; + level int) DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db,_('Create of tempbom failed because')); // To create levels, first, find parts in bom that are top level assemblies. // Do this by doing a LEFT JOIN from bom to bom (as bom2), linking @@ -45,10 +43,10 @@ flush(); // This finds the top level $sql = "INSERT INTO passbom (part, sortpart) - SELECT bom.component AS part, - CONCAT(bom.parent,'%',bom.component) AS sortpart - FROM bom LEFT JOIN bom as bom2 ON bom.parent = bom2.component - WHERE bom2.component IS NULL"; + SELECT bom.component AS part, + CONCAT(bom.parent,'%',bom.component) AS sortpart + FROM bom LEFT JOIN bom as bom2 ON bom.parent = bom2.component + WHERE bom2.component IS NULL"; $result = DB_query($sql,$db); $lctr = 2; @@ -76,12 +74,12 @@ FROM bom,passbom WHERE bom.parent = passbom.part"; $result = DB_query($sql,$db); - $result = DB_query('DROP TABLE IF EXISTS passbom2',$db); - $result = DB_query('ALTER TABLE passbom RENAME AS passbom2',$db); - $result = DB_query('DROP TABLE IF EXISTS passbom',$db); + $result = DB_query("DROP TABLE IF EXISTS passbom2",$db); + $result = DB_query("ALTER TABLE passbom RENAME AS passbom2",$db); + $result = DB_query("DROP TABLE IF EXISTS passbom",$db); - $sql = 'CREATE TEMPORARY TABLE passbom (part char(20), - sortpart text) DEFAULT CHARSET=utf8'; + $sql = "CREATE TEMPORARY TABLE passbom (part char(20), + sortpart text) DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db); $sql = "INSERT INTO passbom (part, sortpart) @@ -92,9 +90,9 @@ $result = DB_query($sql,$db); - $sql = 'SELECT COUNT(*) FROM bom + $sql = "SELECT COUNT(*) FROM bom INNER JOIN passbom ON bom.parent = passbom.part - GROUP BY bom.parent'; + GROUP BY bom.parent"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); @@ -104,9 +102,9 @@ prnMsg(_('Creating bomlevels table'),'info'); flush(); - $sql = 'CREATE TEMPORARY TABLE bomlevels ( + $sql = "CREATE TEMPORARY TABLE bomlevels ( part char(20), - level int) DEFAULT CHARSET=utf8'; + level int) DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db); // Read tempbom and split sortpart into separate parts. For each separate part, calculate level as @@ -114,7 +112,7 @@ // part in the array for a level 4 sortpart would be created as a level 3 in levels, the fourth // and last part in sortpart would have a level code of zero, meaning it has no components - $sql = 'SELECT * FROM tempbom'; + $sql = "SELECT * FROM tempbom"; $result = DB_query($sql,$db); while ($myrow=DB_fetch_array($result)) { $parts = explode('%',$myrow['sortpart']); @@ -140,7 +138,7 @@ shrinkfactor double NOT NULL default '0', eoq double NOT NULL default '0') DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db); - $sql = 'INSERT INTO levels (part, + $sql = "INSERT INTO levels (part, level, leadtime, pansize, @@ -157,15 +155,15 @@ GROUP BY bomlevels.part, pansize, shrinkfactor, - stockmaster.eoq'; + stockmaster.eoq"; $result = DB_query($sql,$db); - $sql = 'ALTER TABLE levels ADD INDEX part(part)'; + $sql = "ALTER TABLE levels ADD INDEX part(part)"; $result = DB_query($sql,$db); // Create levels records with level of zero for all parts in stockmaster that // are not in bom - $sql = 'INSERT INTO levels (part, + $sql = "INSERT INTO levels (part, level, leadtime, pansize, @@ -179,53 +177,53 @@ stockmaster.eoq FROM stockmaster LEFT JOIN levels ON stockmaster.stockid = levels.part - WHERE levels.part IS NULL'; + WHERE levels.part IS NULL"; $result = DB_query($sql,$db); // Update leadtime in levels from purchdata. Do it twice so can make sure leadtime from preferred // vendor is used - $sql = 'UPDATE levels,purchdata + $sql = "UPDATE levels,purchdata SET levels.leadtime = purchdata.leadtime WHERE levels.part = purchdata.stockid - AND purchdata.leadtime > 0'; + AND purchdata.leadtime > 0"; $result = DB_query($sql,$db); - $sql = 'UPDATE levels,purchdata + $sql = "UPDATE levels,purchdata SET levels.leadtime = purchdata.leadtime WHERE levels.part = purchdata.stockid AND purchdata.preferred = 1 - AND purchdata.leadtime > 0'; + AND purchdata.leadtime > 0"; $result = DB_query($sql,$db); prnMsg(_('Levels table has been created'),'info'); flush(); // Get rid if temporary tables - $sql = 'DROP TABLE IF EXISTS tempbom'; + $sql = "DROP TABLE IF EXISTS tempbom"; //$result = DB_query($sql,$db); - $sql = 'DROP TABLE IF EXISTS passbom'; + $sql = "DROP TABLE IF EXISTS passbom"; //$result = DB_query($sql,$db); - $sql = 'DROP TABLE IF EXISTS passbom2'; + $sql = "DROP TABLE IF EXISTS passbom2"; //$result = DB_query($sql,$db); - $sql = 'DROP TABLE IF EXISTS bomlevels'; + $sql = "DROP TABLE IF EXISTS bomlevels"; //$result = DB_query($sql,$db); // In the following section, create mrprequirements from open sales orders and // mrpdemands prnMsg(_('Creating requirements table'),'info'); flush(); - $result = DB_query('DROP TABLE IF EXISTS mrprequirements',$db); + $result = DB_query("DROP TABLE IF EXISTS mrprequirements",$db); // directdemand is 1 if demand is directly for this part, is 0 if created because have netted // out supply and demands for a top level part and determined there is still a net // requirement left and have to pass that down to the BOM parts using the // CreateLowerLevelRequirement() function. Mostly do this so can distinguish the type // of requirements for the MRPShortageReport so don't show double requirements. - $sql = 'CREATE TABLE mrprequirements ( part char(20), + $sql = "CREATE TABLE mrprequirements ( part char(20), daterequired date, quantity double, mrpdemandtype varchar(6), orderno int(11), directdemand smallint, - whererequired char(20)) DEFAULT CHARSET=utf8'; + whererequired char(20)) DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db,_('Create of mrprequirements failed because')); prnMsg(_('Loading requirements from sales orders'),'info'); Modified: trunk/MRPCalendar.php =================================================================== --- trunk/MRPCalendar.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/MRPCalendar.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -1,12 +1,10 @@ <?php /* $Id$ */ -/* $Revision: 1.6 $ */ + // MRPCalendar.php // Maintains the calendar of valid manufacturing dates for MRP -//$PageSecurity=9; - include('includes/session.inc'); $title = _('MRP Calendar'); include('includes/header.inc'); @@ -75,15 +73,15 @@ return; } - $sql = 'DROP TABLE IF EXISTS mrpcalendar'; + $sql = "DROP TABLE IF EXISTS mrpcalendar"; $result = DB_query($sql,$db); - $sql = 'CREATE TABLE mrpcalendar ( + $sql = "CREATE TABLE mrpcalendar ( calendardate date NOT NULL, daynumber int(6) NOT NULL, - manufacturingflag smallint(6) NOT NULL default "1", + manufacturingflag smallint(6) NOT NULL default '1', INDEX (daynumber), - PRIMARY KEY (calendardate))'; + PRIMARY KEY (calendardate)) DEFAULT CHARSET=utf8"; $ErrMsg = _('The SQL to to create passbom failed with the message'); $result = DB_query($sql,$db,$ErrMsg); @@ -95,9 +93,9 @@ $ExcludeDays = array($_POST['Sunday'],$_POST['Monday'],$_POST['Tuesday'],$_POST['Wednesday'], $_POST['Thursday'],$_POST['Friday'],$_POST['Saturday']); - $caldate = $convertfromdate; + $CalDate = $convertfromdate; for ($i = 0; $i <= $datediff; $i++) { - $dateadd = FormatDateForSQL(DateAdd($caldate,"d",$i)); + $dateadd = FormatDateForSQL(DateAdd($CalDate,"d",$i)); // If the check box for the calendar date's day of week was clicked, set the manufacturing flag to 0 $dayofweek = DayOfWeekFromSQLDate($dateadd); @@ -121,16 +119,16 @@ // Update daynumber. Set it so non-manufacturing days will have the same daynumber as a valid // manufacturing day that precedes it. That way can read the table by the non-manufacturing day, // subtract the leadtime from the daynumber, and find the valid manufacturing day with that daynumber. - $daynumber = 1; - $sql = 'SELECT * FROM mrpcalendar ORDER BY calendardate'; + $DayNumber = 1; + $sql = "SELECT * FROM mrpcalendar ORDER BY calendardate"; $result = DB_query($sql,$db,$ErrMsg); while ($myrow = DB_fetch_array($result)) { if ($myrow['manufacturingflag'] == "1") { - $daynumber++; + $DayNumber++; } - $caldate = $myrow['calendardate']; - $sql = "UPDATE mrpcalendar SET daynumber = '$daynumber' - WHERE calendardate = '$caldate'"; + $CalDate = $myrow['calendardate']; + $sql = "UPDATE mrpcalendar SET daynumber = '" . $DayNumber . "' + WHERE calendardate = '$CalDate'"; $resultupdate = DB_query($sql,$db,$ErrMsg); } prnMsg(_("The MRP Calendar has been created"),'succes'); @@ -145,9 +143,9 @@ // After change the flag, re-calculate the daynumber for all dates. $InputError = 0; - $caldate = FormatDateForSQL($ChangeDate); + $CalDate = FormatDateForSQL($ChangeDate); $sql="SELECT COUNT(*) FROM mrpcalendar - WHERE calendardate='$caldate' + WHERE calendardate='$CalDate' GROUP BY calendardate"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); @@ -161,7 +159,7 @@ return; } - $sql="SELECT mrpcalendar.* FROM mrpcalendar WHERE calendardate='$caldate'"; + $sql="SELECT mrpcalendar.* FROM mrpcalendar WHERE calendardate='$CalDate'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); $newmanufacturingflag = 0; @@ -169,7 +167,7 @@ $newmanufacturingflag = 1; } $sql = "UPDATE mrpcalendar SET manufacturingflag = '".$newmanufacturingflag."' - WHERE calendardate = '".$caldate."'"; + WHERE calendardate = '".$CalDate."'"; $ErrMsg = _('Cannot update the MRP Calendar'); $resultupdate = DB_query($sql,$db,$ErrMsg); prnMsg(_("The MRP calendar record for $ChangeDate has been updated"),'success'); @@ -180,16 +178,16 @@ // Update daynumber. Set it so non-manufacturing days will have the same daynumber as a valid // manufacturing day that precedes it. That way can read the table by the non-manufacturing day, // subtract the leadtime from the daynumber, and find the valid manufacturing day with that daynumber. - $daynumber = 1; - $sql = 'SELECT * FROM mrpcalendar ORDER BY calendardate'; + $DayNumber = 1; + $sql = "SELECT * FROM mrpcalendar ORDER BY calendardate"; $result = DB_query($sql,$db,$ErrMsg); while ($myrow = DB_fetch_array($result)) { - if ($myrow['manufacturingflag'] == "1") { - $daynumber++; + if ($myrow['manufacturingflag'] == '1') { + $DayNumber++; } - $caldate = $myrow['calendardate']; - $sql = "UPDATE mrpcalendar SET daynumber = '$daynumber' - WHERE calendardate = '$caldate'"; + $CalDate = $myrow['calendardate']; + $sql = "UPDATE mrpcalendar SET daynumber = '" . $DayNumber . "' + WHERE calendardate = '" . $CalDate . "'"; $resultupdate = DB_query($sql,$db,$ErrMsg); } // End of while @@ -199,24 +197,24 @@ function listall(&$db) //####LISTALL_LISTALL_LISTALL_LISTALL_LISTALL_LISTALL_LISTALL_#### { // List all records in date range - $fromdate = FormatDateForSQL($_POST['FromDate']); - $todate = FormatDateForSQL($_POST['ToDate']); + $FromDate = FormatDateForSQL($_POST['FromDate']); + $ToDate = FormatDateForSQL($_POST['ToDate']); $sql = "SELECT calendardate, daynumber, manufacturingflag, DAYNAME(calendardate) as dayname FROM mrpcalendar - WHERE calendardate >='$fromdate' - AND calendardate <='$todate'"; + WHERE calendardate >='" . $FromDate . "' + AND calendardate <='" . $ToDate . "'"; $ErrMsg = _('The SQL to find the parts selected failed with the message'); $result = DB_query($sql,$db,$ErrMsg); - echo "</br><table class=selection> - <tr BGCOLOR =#800000> - <th>" . _('Date') . "</th> - <th>" . _('Manufacturing Date') . "</th> - </tr></font>"; + echo '</br><table class="selection"> + <tr bgcolor ="#800000"> + <th>' . _('Date') . '</th> + <th>' . _('Manufacturing Date') . '</th> + </tr>'; $ctr = 0; while ($myrow = DB_fetch_array($result)) { $flag = _('Yes'); @@ -251,51 +249,51 @@ $_POST['FromDate']=date($_SESSION['DefaultDateFormat']); $_POST['ToDate']=date($_SESSION['DefaultDateFormat']); } - echo "<form action=" . $_SERVER['PHP_SELF'] . "?" . SID ." method=post></br></br>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post"><br /><br />'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<br><table class=selection>'; + echo '<br><table class="selection">'; echo '<tr> - <td>' . _('From Date') . ":</td> - <td><input type='Text' class=date alt='".$_SESSION['DefaultDateFormat'] ."' name='FromDate' size=10 maxlength=10 value=" . $_POST['FromDate'] . '></td></tr> - <tr></tr><td>' . _('To Date') . ":</td> - <td><input type='Text' class=date alt='".$_SESSION['DefaultDateFormat'] ."' name='ToDate' size=10 maxlength=10 value=" . $_POST['ToDate'] . '></td> + <td>' . _('From Date') . ':</td> + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] .'" name="FromDate" size="10" maxlength="10" value="' . $_POST['FromDate'] . '"></td></tr> + <tr></tr><td>' . _('To Date') . ':</td> + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] .'" name="ToDate" size="10" maxlength="10" value="' . $_POST['ToDate'] . '"></td> </tr> <tr><td></td></tr> <tr><td></td></tr> <tr><td>'._('Exclude The Following Days').'</td></tr> <tr> - <td>' . _('Saturday') . ":</td> - <td><input type='checkbox' name='Saturday' value='Saturday'></td> + <td>' . _('Saturday') . ':</td> + <td><input type="checkbox" name="Saturday" value="Saturday"></td> </tr> <tr> - <td>" . _('Sunday') . ":</td> - <td><input type='checkbox' name='Sunday' value='Sunday'></td> + <td>' . _('Sunday') . ':</td> + <td><input type="checkbox" name="Sunday" value="Sunday"></td> </tr> <tr> - <td>" . _('Monday') . ":</td> - <td><input type='checkbox' name='Monday' value='Monday'></td> + <td>' . _('Monday') . ':</td> + <td><input type="checkbox" name="Monday" value="Monday"></td> </tr> <tr> - <td>" . _('Tuesday') . ":</td> - <td><input type='checkbox' name='Tuesday' value='Tuesday'></td> + <td>' . _('Tuesday') . ':</td> + <td><input type="checkbox" name="Tuesday" value="Tuesday"></td> </tr> <tr> - <td>" . _('Wednesday') . ":</td> - <td><input type='checkbox' name='Wednesday' value='Wednesday'></td> + <td>' . _('Wednesday') . ':</td> + <td><input type="checkbox" name="Wednesday" value="Wednesday"></td> </tr> <tr> - <td>" . _('Thursday') . ":</td> - <td><input type='checkbox' name='Thursday' value='Thursday'></td> + <td>' . _('Thursday') . ':</td> + <td><input type="checkbox" name="Thursday" value="Thursday"></td> </tr> <tr> - <td>" . _('Friday') . ":</td> - <td><input type='checkbox' name='Friday' value='Friday'></td> + <td>' . _('Friday') . ':</td> + <td><input type="checkbox" name="Friday" value="Friday"></td> </tr> </table><br> - <div class=centre><input type='submit' name='submit' value='" . _('Create Calendar') . "'> - <input type='submit' name='listall' value='" . _('List Date Range') . "'></div>"; + <div class=centre><input type="submit" name="submit" value="' . _('Create Calendar') . '"> + <input type="submit" name="listall" value="' . _('List Date Range') . '"></div>'; if (!isset($_POST['ChangeDate'])) { $_POST['ChangeDate']=date($_SESSION['DefaultDateFormat']); @@ -303,15 +301,14 @@ echo '<br><table class=selection>'; echo '<tr> - <td>' . _('Change Date Status') . ":</td> - <td><input type='Text' name='ChangeDate' class=date alt='".$_SESSION['DefaultDateFormat'] . - "' size=12 maxlength=12 value=" . $_POST['ChangeDate'] . '></td> + <td>' . _('Change Date Status') . ':</td> + <td><input type="text" name="ChangeDate" class="date" alt="' . $_SESSION['DefaultDateFormat'] . + '" size="12" maxlength="12" value="' . $_POST['ChangeDate'] . '"></td> <td><input type="submit" name="update" value="' . _('Update') . '"></td></tr></table>'; -echo "</br></br><div class='centre'></div>"; +echo '<br /><br /><div class="centre"></div>'; echo '</form>'; } // End of function display() - include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/MRPShortages.php =================================================================== --- trunk/MRPShortages.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/MRPShortages.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -6,7 +6,7 @@ include('includes/session.inc'); //ANSI SQL??? -$sql='SHOW TABLES WHERE Tables_in_'.$_SESSION['DatabaseName']."='mrprequirements'"; +$sql="SHOW TABLES WHERE Tables_in_" . $_SESSION['DatabaseName'] . "='mrprequirements'"; $result=DB_query($sql,$db); if (DB_num_rows($result)==0) { @@ -32,48 +32,47 @@ // total for either supply or demand. Did this to simplify main sql where used // several subqueries. - $sql = 'CREATE TEMPORARY TABLE demandtotal ( + $sql = "CREATE TEMPORARY TABLE demandtotal ( part char(20), demand double, - KEY `PART` (`part`)) DEFAULT CHARSET=utf8'; + KEY `PART` (`part`)) DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db,_('Create of demandtotal failed because')); - $sql = 'INSERT INTO demandtotal + $sql = "INSERT INTO demandtotal (part, demand) SELECT part, SUM(quantity) as demand FROM mrprequirements - GROUP BY part'; + GROUP BY part"; $result = DB_query($sql,$db); - $sql = 'CREATE TEMPORARY TABLE supplytotal ( + $sql = "CREATE TEMPORARY TABLE supplytotal ( part char(20), supply double, - KEY `PART` (`part`)) DEFAULT CHARSET=utf8'; + KEY `PART` (`part`)) DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db,_('Create of supplytotal failed because')); /* 21/03/2010: Ricard modification to allow items with total supply = 0 be included in the report */ - $sql = 'INSERT INTO supplytotal + $sql = "INSERT INTO supplytotal (part, supply) SELECT stockid, 0 - FROM stockmaster'; + FROM stockmaster"; $result = DB_query($sql,$db); - $sql = 'UPDATE supplytotal + $sql = "UPDATE supplytotal SET supply = (SELECT SUM(mrpsupplies.supplyquantity) FROM mrpsupplies WHERE supplytotal.part = mrpsupplies.part - AND mrpsupplies.supplyquantity > 0)'; + AND mrpsupplies.supplyquantity > 0)"; $result = DB_query($sql,$db); - $sql = 'UPDATE supplytotal SET supply = 0 WHERE supply IS NULL '; + $sql = "UPDATE supplytotal SET supply = 0 WHERE supply IS NULL"; $result = DB_query($sql,$db); -/* End Ricard modification */ // Only include directdemand mrprequirements so don't have demand for top level parts and also // show demand for the lower level parts that the upper level part generates. See MRP.php for Modified: trunk/PDFPrintLabel.php =================================================================== --- trunk/PDFPrintLabel.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/PDFPrintLabel.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -118,15 +118,15 @@ <input type="submit" name="PDFTest" value="'. _('Print labels with borders') .'"></div>'; $iTxt=0; - echo '<script type="text/javascript"> - function setAll(all) { - var x=document.getElementById("form1"); - for (var i=0;i<x.length;i++) { - if (x.elements[i].id==\'item\'); - x.elements[i].checked=all.checked; - } - } - </script>'; + echo "<script type=\"text/javascript\"> + function setAll(all) { + var x=document.getElementById('form1'); + for (var i=0;i<x.length;i++) { + if (x.elements[i].id=='item'); + x.elements[i].checked=all.checked; + } + } + </script>"; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' .$txt[$iTxt++].'</p>'; echo '<form name ="form1" action="'.$_SERVER['PHP_SELF'].'" method="POST" id="form1">'; Modified: trunk/PDFStockTransfer.php =================================================================== --- trunk/PDFStockTransfer.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/PDFStockTransfer.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -74,7 +74,7 @@ //get the next row which will be the quantity received in the receiving location $myNextRow=DB_fetch_array($result); $ToCode=$myNextRow['loccode']; -$To = $myrow['locationname']; +$To = $myNextRow['locationname']; $Quantity=$myNextRow['qty']; $Description=$myNextRow['description']; Added: trunk/ReprintGRN.php =================================================================== --- trunk/ReprintGRN.php (rev 0) +++ trunk/ReprintGRN.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -0,0 +1,100 @@ +<?php +/* $Id: ReprintGrn.php 4486 2011-02-08 09:20:50Z daintree $*/ + +include('includes/session.inc'); +$title=_('Reprint a GRN'); +include('includes/header.inc'); + +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . + $title . '" alt="" />' . ' ' . $title . '</p>'; + +if (!isset($_POST['PONumber'])) { + $_POST['PONumber']=''; +} + +echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; +echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; +echo '<table class="selection">'; +echo '<tr><th colspan="2"><font size="2" color="navy">' . _('Select a purchase order') . '</th></tr>'; +echo '<tr><td>' . _('Enter a Purchase Order Number') . '</td>'; +echo '<td>' . '<input type="text" name="PONumber" class="number" size="7" value="'.$_POST['PONumber'].'" /></td></tr>'; +echo '<tr><td colspan=2 style="text-align: center">' . '<input type="submit" name="Show" value="Show GRNs" /></td></tr>'; + +echo '</table>'; +echo '</form>'; + +if (isset($_POST['Show'])) { + if ($_POST['PONumber']=='') { + echo '<br />'; + prnMsg( _('You must enter a purchase order number in the box above'), 'warn'); + include('includes/footer.inc'); + exit; + } + $sql="SELECT count(orderno) + FROM purchorders + WHERE orderno='" . $_POST['PONumber'] ."'"; + $result=DB_query($sql, $db); + $myrow=DB_fetch_row($result); + if ($myrow[0]==0) { + echo '<br />'; + prnMsg( _('This purchase order does not exist on the system. Please try again.'), 'warn'); + include('includes/footer.inc'); + exit; + } + $sql="SELECT grnbatch, + grnno, + grns.podetailitem, + grns.itemcode, + grns.itemdescription, + grns.deliverydate, + grns.qtyrecd, + suppliers.suppname, + stockmaster.decimalplaces + FROM grns INNER JOIN suppliers + ON grns.supplierid=suppliers.supplierid + INNER JOIN purchorderdetails + ON grns.podetailitem=purchorderdetails.podetailitem + LEFT JOIN stockmaster + ON grns.itemcode=stockmaster.stockid + WHERE orderno='" . $_POST['PONumber'] ."'"; + $result=DB_query($sql, $db); + if (DB_num_rows($result)==0) { + echo '<br />'; + prnMsg( _('There are no GRNs for this purchase order that can be reprinted.'), 'warn'); + include('includes/footer.inc'); + exit; + } + $k=0; + echo '<br /><table class="selection">'; + echo '<tr><th colspan="8"><font size="2" color="navy">' . _('GRNs for Purchase Order No') .' ' . $_POST['PONumber'] . '</th></tr>'; + echo '<tr><th>' . _('Supplier') . '</th>'; + echo '<th>' . _('PO Order line') . '</th>'; + echo '<th>' . _('GRN Number') . '</th>'; + echo '<th>' . _('Item Code') . '</th>'; + echo '<th>' . _('Item Description') . '</th>'; + echo '<th>' . _('Delivery Date') . '</th>'; + echo '<th>' . _('Quantity Received') . '</th></tr>'; + while ($myrow=DB_fetch_array($result)) { + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k=1; + } + echo '<td>' . $myrow['suppname'] . '</td>'; + echo '<td class="number">' . $myrow['podetailitem'] . '</td>'; + echo '<td class="number">' . $myrow['grnbatch'] . '</td>'; + echo '<td>' . $myrow['itemcode'] . '</td>'; + echo '<td>' . $myrow['itemdescription'] . '</td>'; + echo '<td>' . $myrow['deliverydate'] . '</td>'; + echo '<td class="number">' . number_format($myrow['qtyrecd'], $myrow['decimalplaces']) . '</td>'; + echo '<td><a href="PDFGrn.php?GRNNo=' . $myrow['grnbatch'] .'&PONo=' . $_POST['PONumber'] . '">' . _('Reprint') . '</a></td>'; + echo '</tr>'; + } + echo '</table>'; +} + +include('includes/footer.inc'); + +?> \ No newline at end of file Modified: trunk/SelectProduct.php =================================================================== --- trunk/SelectProduct.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/SelectProduct.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -28,10 +28,10 @@ $_POST['StockCode'] = trim(strtoupper($_POST['StockCode'])); } // Always show the search facilities -$SQL = 'SELECT categoryid, +$SQL = "SELECT categoryid, categorydescription FROM stockcategory - ORDER BY categorydescription'; + ORDER BY categorydescription"; $result1 = DB_query($SQL, $db); if (DB_num_rows($result1) == 0) { echo '<p><font size=4 color=red>' . _('Problem Report') . ':</font><br />' . _('There are no stock categories currently defined please use the link below to set them up').'</p>'; @@ -671,7 +671,7 @@ $_POST['PageOffset'] = $ListPageMax; } if ($ListPageMax > 1) { - echo "<div class='centre'><p> " . $_POST['PageOffset'] . ' ' . _('of') . ' ' . $ListPageMax . ' ' . _('pages') . '. ' . _('Go to Page') . ': '; + echo '<div class="centre"><p> ' . $_POST['PageOffset'] . ' ' . _('of') . ' ' . $ListPageMax . ' ' . _('pages') . '. ' . _('Go to Page') . ': '; echo '<select name="PageOffset">'; $ListPage = 1; while ($ListPage <= $ListPageMax) { Modified: trunk/StockTransferControlled.php =================================================================== --- trunk/StockTransferControlled.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/StockTransferControlled.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -72,14 +72,19 @@ $StockID = $LineItem->StockID; $InOutModifier=1; //seems odd, but it's correct $ShowExisting = true; -include ('includes/InputSerialItems.php'); +if (isset($TransferItem)){ + $LineNo=$TransferItem; +} else { + $LineNo=0; +} +include ('includes/OutputSerialItems.php'); /*TotalQuantity set inside this include file from the sum of the bundles of the item selected for adjusting */ -$LineItem->Quantity = $TotalQuantity; +$LineItem->Quantity = $TransferQuantity; /*Also a multi select box for adding bundles to the Transfer without keying */ include('includes/footer.inc'); exit; -?> +?> \ No newline at end of file Modified: trunk/StockTransfers.php =================================================================== --- trunk/StockTransfers.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/StockTransfers.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -11,15 +11,19 @@ include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); +if (isset($_GET['New'])) { + unset($_SESSION['Transfer']); +} + if (isset($_POST['CheckCode'])) { -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Dispatch') . + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Dispatch') . '" alt="" />' . ' ' . _('Select Item to Transfer') . '</p>'; if (strlen($_POST['StockText'])>0) { - $sql="SELECT stockid, description from stockmaster where description like '%" . $_POST['StockText'] . "%'"; + $sql="SELECT stockid, description from stockmaster where description " . LIKE . " '%" . $_POST['StockText'] . "%'"; } else { - $sql="SELECT stockid, description from stockmaster where stockid like '%" . $_POST['StockCode']."%'"; + $sql="SELECT stockid, description from stockmaster where stockid " . LIKE . " '%" . $_POST['StockCode']."%'"; } $ErrMsg=_('The stock information cannot be retrieved because'); $DbgMsg=_('The SQL to get the stock description was'); @@ -30,7 +34,7 @@ while ($myrow = DB_fetch_row($result)) { echo '<tr><td>'.$myrow[0].'</td> <td>'.$myrow[1].'</td> - <td><a href="StockTransfers.php?StockID='.$myrow[0].'&Description='.$myrow[1].'">Transfer</a></td> + <td><a href="StockTransfers.php?StockID='.$myrow[0].'&Description='.$myrow[1].'">' . _('Transfer') . '</a></td> </tr>'; } echo '</table>'; @@ -43,6 +47,7 @@ if (isset($_GET['NewTransfer'])){ unset($_SESSION['Transfer']); unset($_SESSION['TransferItem']); /*this is defined in bulk transfers but needs to be unset for individual trsnsfers */ + $NewTransfer=$_GET['NewTransfer']; } @@ -73,22 +78,24 @@ materialcost+labourcost+overheadcost as standardcost, controlled, serialised, + perishable, decimalplaces FROM stockmaster WHERE stockid='" . trim(strtoupper($_POST['StockID'])) . "'", $db); - $myrow = DB_fetch_row($result); + if (DB_num_rows($result) == 0){ prnMsg( _('Unable to locate Stock Code').' '.strtoupper($_POST['StockID']), 'error' ); } elseif (DB_num_rows($result)>0){ - - $_SESSION['Transfer']->TransferItem[0] = new LineItem ( trim(strtoupper($_POST['StockID'])), - $myrow[0], - $_POST['Quantity'], - $myrow[1], - $myrow[4], - $myrow[5], - $myrow[6]); + $myrow = DB_fetch_row($result); + $_SESSION['Transfer']->TransferItem[0] = new LineItem ( trim(strtoupper($_POST['StockID'])), + $myrow['description'], + $_POST['Quantity'], + $myrow['units'], + $myrow['controlled'], + $myrow['serialised'], + $myrow['perishable'], + $myrow['decimalplaces']); $_SESSION['Transfer']->TransferItem[0]->StandardCost = $myrow[3]; @@ -222,7 +229,8 @@ if ($SerialItemExistsRow[0]==1){ $SQL = "UPDATE stockserialitems - SET quantity= quantity - '" . $Item->BundleQty . "' + SET quantity= quantity - '" . $Item->BundleQty . "', + expirationdate='" . FormatDateForSQL($Item->ExpiryDate) . "' WHERE stockid='" . $_SESSION['Transfer']->TransferItem[0]->StockID . "' AND loccode='" . $_SESSION['Transfer']->StockLocationFrom . "' AND serialno='" . $Item->BundleRef . "'"; @@ -235,10 +243,12 @@ $SQL = "INSERT INTO stockserialitems (stockid, loccode, serialno, + expirationdate, quantity) VALUES ('" . $_SESSION['Transfer']->TransferItem[0]->StockID . "', '" . $_SESSION['Transfer']->StockLocationFrom . "', '" . $Item->BundleRef . "', + '" . FormatDateForSQL($Item->ExpiryDate) . "', '" . -$Item->BundleQty . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record could not be added because'); @@ -334,7 +344,8 @@ if ($SerialItemExistsRow[0]==1){ $SQL = "UPDATE stockserialitems - SET quantity= quantity + '" . $Item->BundleQty . "' + SET quantity= quantity + '" . $Item->BundleQty . "', + expirationdate='" . FormatDateForSQL($Item->ExpiryDate) . "' WHERE stockid='" . $_SESSION['Transfer']->TransferItem[0]->StockID . "' AND loccode='" . $_SESSION['Transfer']->StockLocationTo . "' AND serialno='" . $Item->BundleRef . "'"; @@ -347,10 +358,12 @@ $SQL = "INSERT INTO stockserialitems (stockid, loccode, serialno, + expirationdate, quantity) VALUES ('" . $_SESSION['Transfer']->TransferItem[0]->StockID . "', '" . $_SESSION['Transfer']->StockLocationTo . "', '" . $Item->BundleRef . "', + '" . FormatDateForSQL($Item->ExpiryDate) . "', '" . $Item->BundleQty . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record could not be added because'); @@ -398,7 +411,7 @@ $Result = DB_Txn_Commit($db); prnMsg(_('An inventory transfer of').' ' . $_SESSION['Transfer']->TransferItem[0]->StockID . ' - ' . $_SESSION['Transfer']->TransferItem[0]->ItemDescription . ' '. _('has been created from').' ' . $_SESSION['Transfer']->StockLocationFrom . ' '. _('to') . ' ' . $_SESSION['Transfer']->StockLocationTo . ' '._('for a quantity of').' ' . $_SESSION['Transfer']->TransferItem[0]->Quantity,'success'); - echo '</br><a href="PDFStockTransfer.php?TransferNo='.$TransferNumber.'">Print Transfer Note</a>'; + echo '</br><a href="PDFStockTransfer.php?TransferNo='.$TransferNumber.'">' . _('Print Transfer Note') . '</a>'; unset ($_SESSION['Transfer']); include ('includes/footer.inc'); exit; @@ -406,28 +419,13 @@ } -if (!isset($_SESSION['Transfer']->TransferItem[0]->StockID)) { - $_SESSION['Transfer']->TransferItem[0]->StockID = ' '; -} -if (!isset($_SESSION['Transfer']->TransferItem[0]->ItemDescription)) { - $_SESSION['Transfer']->TransferItem[0]->ItemDescription = ''; -} -if (!isset($_SESSION['Transfer']->TransferItem[0]->Controlled)) { - $_SESSION['Transfer']->TransferItem[0]->Controlled = ''; -} - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Dispatch') . '" alt="" />' . ' ' . $title . '</p>'; echo '<form action="'. $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -//echo '<table> -// <tr> -// <td>'. _('Stock Code').':</td> -// <td><input type=text name="StockID" size=21 value="' . $_SESSION['Transfer']->TransferItem[0]->StockID . '" maxlength=20></td> -// <td><input type=submit name="CheckCode" VALUE="'._('Check Part').'"></td> -// </tr>'; + if (!isset($_GET['Description'])) { $_GET['Description']=''; } @@ -446,13 +444,13 @@ } echo '</td><td><input type=submit name="CheckCode" VALUE="'._('Check Part').'"></td></tr>'; -if (strlen($_SESSION['Transfer']->TransferItem[0]->ItemDescription)>1){ +if (isset($_SESSION['Transfer']->TransferItem[0]->ItemDescription) and strlen($_SESSION['Transfer']->TransferItem[0]->ItemDescription)>1){ echo '<tr><td colspan=3><font color=BLUE size=3>' . $_SESSION['Transfer']->TransferItem[0]->ItemDescription . ' ('._('In Units of').' ' . $_SESSION['Transfer']->TransferItem[0]->PartUnit . ' )</font></td></tr>'; } echo '<tr><td>' . _('From Stock Location').':</td><td><select name="StockLocationFrom">'; -$sql = 'SELECT loccode, locationname FROM locations'; +$sql = "SELECT loccode, locationname FROM locations"; $resultStkLocs = DB_query($sql,$db); while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_SESSION['Transfer']->StockLocationFrom)){ @@ -476,13 +474,13 @@ DB_data_seek($resultStkLocs,0); while ($myrow=DB_fetch_array($resultStkLocs)){ - if (isset($_SESSION['Transfer']->StockLocationTo)){ + if (isset($_SESSION['Transfer']) AND isset($_SESSION['Transfer']->StockLocationTo)){ if ($myrow['loccode'] == $_SESSION['Transfer']->StockLocationTo){ echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } - } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ + } elseif ($myrow['loccode']==$_SESSION['UserStockLocation'] AND isset($_SESSION['Transfer'])){ echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; $_SESSION['Transfer']->StockLocationTo=$myrow['loccode'] . '</option>'; } else { @@ -495,18 +493,18 @@ echo '<tr><td>'._('Transfer Quantity').':</td>'; -if (!isset($_SESSION['Transfer']->TransferItem[0]->Quantity)) { - $_SESSION['Transfer']->TransferItem[0]->Quantity=0; -} - -if ($_SESSION['Transfer']->TransferItem[0]->Controlled==1){ - echo '<td class=number><input type=hidden name="Quantity" value=' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '><a href="' . $rootpath .'/StockTransferControlled.php">' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '</a></td></tr>'; -} else { +if (isset($_SESSION['Transfer']->TransferItem[0]->Controlled) and $_SESSION['Transfer']->TransferItem[0]->Controlled==1){ + echo '<td class=number><input type=hidden name="Quantity" value=' . $_SESSION['Transfer']->TransferItem[0]->Quantity . + '><a href="' . $rootpath .'/StockTransferControlled.php?StockLocationFrom='.$_SESSION['Transfer']->StockLocationFrom.'">' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '</a></td></tr>'; +} else if (isset($_SESSION['Transfer']->TransferItem[0]->Controlled)){ echo '<td><input type=text class="number" name="Quantity" size=12 maxlength=12 value=' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '></td></tr>'; +} else { + echo '<td><input type=text class="number" name="Quantity" size=12 maxlength=12 Value="0"></td></tr>'; } echo '</table><div class="centre"><br /><input type="submit" name="EnterTransfer" value="' . _('Enter Stock Transfer') . '"><br />'; + if (empty($_SESSION['Transfer']->TransferItem[0]->StockID) and isset($_POST['StockID'])) { $StockID=$_POST['StockID']; } else if (isset($_SESSION['Transfer']->TransferItem[0]->StockID)) { @@ -514,13 +512,13 @@ } else { $StockID=''; } - -echo '<br /><a href="'.$rootpath.'/StockStatus.php?StockID=' . $StockID . '">'._('Show Stock Status').'</a>'; -echo '<br /><a href="'.$rootpath.'/StockMovements.php?StockID=' . $StockID . '">'._('Show Movements').'</a>'; -echo '<br /><a href="'.$rootpath.'/StockUsage.php?StockID=' . $StockID . '&StockLocation=' . $_SESSION['Transfer']->StockLocationFrom . '">' . _('Show Stock Usage') . '</a>'; -echo '<br /><a href="'.$rootpath.'/SelectSalesOrder.php?SelectedStockItem=' . $StockID . '&StockLocation=' . $_SESSION['Transfer']->StockLocationFrom . '">' . _('Search Outstanding Sales Orders') . '</a>'; -echo '<br /><a href="'.$rootpath.'/SelectCompletedOrder.php?SelectedStockItem=' . $StockID . '">'._('Search Completed Sales Orders').'</a>'; - +if (isset($_SESSION['Transfer'])) { + echo '<br /><a href="'.$rootpath.'/StockStatus.php?StockID=' . $StockID . '">'._('Show Stock Status').'</a>'; + echo '<br /><a href="'.$rootpath.'/StockMovements.php?StockID=' . $StockID . '">'._('Show Movements').'</a>'; + echo '<br /><a href="'.$rootpath.'/StockUsage.php?StockID=' . $StockID . '&StockLocation=' . $_SESSION['Transfer']->StockLocationFrom . '">' . _('Show Stock Usage') . '</a>'; + echo '<br /><a href="'.$rootpath.'/SelectSalesOrder.php?SelectedStockItem=' . $StockID . '&StockLocation=' . $_SESSION['Transfer']->StockLocationFrom . '">' . _('Search Outstanding Sales Orders') . '</a>'; + echo '<br /><a href="'.$rootpath.'/SelectCompletedOrder.php?SelectedStockItem=' . $StockID . '">'._('Search Completed Sales Orders').'</a>'; +} echo '</div></form>'; include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/SupplierInvoice.php =================================================================== --- trunk/SupplierInvoice.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/SupplierInvoice.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -510,7 +510,7 @@ echo '<br /><table class=selection> <tr> <td>' . _('Comments') . '</td> - <td><TEXTAREA name=Comments COLS=40 ROWS=2>' . $_SESSION['SuppTrans']->Comments . '</textarea></td> + <td><textarea name="Comments" cols="40" rows="2">' . $_SESSION['SuppTrans']->Comments . '</textarea></td> </tr> </table>'; @@ -550,8 +550,8 @@ $InputError = True; prnMsg(_('The invoice as entered cannot be processed because the total amount of the invoice is less than 0') . '. ' . _('Invoices are expected to have a positive charge'),'error'); - echo '<p> The tax total is : ' . $TaxTotal; - echo '<p> The ovamount is : ' . $_SESSION['SuppTrans']->OvAmount; + echo '<p>' . _('The tax total is') . ' : ' . $TaxTotal; + echo '<p>' . _('The ovamount is') . ' : ' . $_SESSION['SuppTrans']->OvAmount; } elseif ( $TaxTotal + $_SESSION['SuppTrans']->OvAmount == 0){ Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/doc/Change.log.html 2011-04-10 10:41:20 UTC (rev 4545) @@ -1,6 +1,9 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p /> -<p> +<p>10/4/11 Tim: +<p>10/4/11 Tim: GLAccountInquiry.php show None if no tag selected</p> +<p>10/4/11 Tim : PDFPrintLabel.php javascript fix</p> +<p>10/4/11 Tim: Add perishable to StockTransfer.php and PDFStockTransfer</p> <p>10/4/11 Tim: PDFPeriodStockTransListing - new report to print off stock transactions of a specified type for a selected period>/p> <p>10/4/11 Tim: PDFStockTransListing.php option to print off transactions by inventory location</p> <p>10/4/11 Tim: Stocks.php - more logical use of $New and $_POST['New']</p> Modified: trunk/includes/DefineLabelClass.php =================================================================== --- trunk/includes/DefineLabelClass.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/includes/DefineLabelClass.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -1,25 +1,25 @@ <?php define('MAX_LINES_PER_LABEL', 5); -define('LABELS_FILE', $_SESSION['reports_dir'] . "/labels.xml"); +define('LABELS_FILE', $_SESSION['reports_dir'] . '/labels.xml'); /** * These tags contains the more general data of the labels */ $GlobalTags = array('id'=>array('desc'=> _('Label id'), - 'type'=>'t', - 'sz'=>8, - 'maxsz'=>12), // text - 'description'=>array('desc'=>_('Description'), - 'type'=>'t', - 'sz'=>15, - 'maxsz'=>30) // text -); + 'type'=>'t', + 'sz'=>8, + 'maxsz'=>12), // text + 'description'=>array('desc'=>_('Description'), + 'type'=>'t', + 'sz'=>15, + 'maxsz'=>30) // text + ); /** * These tags specifies the dimension of individual label */ $DimensionTags = array( 'Unit'=>array('desc'=>_('Units'),'type'=>'s', - 'values'=>array('pt'=>'pt', 'in'=>'in', 'mm'=>'mm', 'cm'=>'cm' ) ), // select + 'values'=>array('pt'=>'pt', 'in'=>'in', 'mm'=>'mm', 'cm'=>'cm' ) ), // select 'Rows'=>array('desc'=>_('Rows per sheet'),'type'=>'i','sz'=>2,'maxsz'=>3), // integer numeric 'Cols'=>array('desc'=>_('Cols per sheet'),'type'=>'i','sz'=>2,'maxsz'=>3), 'Sh'=>array('desc'=>_('Sheet height'),'type'=>'n','sz'=>5,'maxsz'=>8), // float numeric @@ -164,8 +164,10 @@ * @return nothing */ function abortMsg($msg) { - global $rootpath, $DefaultClock, $Version; + global $rootpath, $DefaultClock, $Version, $theme; + $title=_('No label templates exist'); include ('includes/header.inc'); + echo '<br />'; prnMsg( $msg, 'error'); include ('includes/footer.inc'); exit; Modified: trunk/includes/DefineStockTransfers.php =================================================================== --- trunk/includes/DefineStockTransfers.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/includes/DefineStockTransfers.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -33,13 +33,14 @@ class LineItem { var $StockID; var $ItemDescription; - Var $ShipQty; - Var $PrevRecvQty; - Var $Quantity; - Var $PartUnit; + var $ShipQty; + var $PrevRecvQty; + var $Quantity; + var $PartUnit; var $Controlled; var $Serialised; - Var $DecimalPlaces; + var $DecimalPlaces; + var $Perishable; var $SerialItems; /*array to hold controlled items*/ //Constructor function LineItem($StockID, @@ -48,6 +49,7 @@ $PartUnit, $Controlled, $Serialised, + $Perishable, $DecimalPlaces){ $this->StockID = $StockID; @@ -56,6 +58,7 @@ $this->Controlled = $Controlled; $this->Serialised = $Serialised; $this->DecimalPlaces = $DecimalPlaces; + $this->Perishable = $Perishable; $this->ShipQty = $Quantity; if ($this->Controlled==1){ $this->Quantity = 0; Modified: trunk/includes/OutputSerialItems.php =================================================================== --- trunk/includes/OutputSerialItems.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/includes/OutputSerialItems.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -17,9 +17,9 @@ global $tableheader; /* Link to clear the list and start from scratch */ -$EditLink = '<br><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&EditControlled=true&StockID=' . $LineItem->StockID . +$EditLink = '<br><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?EditControlled=true&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Edit'). '</a> | '; -$RemoveLink = '<a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&DELETEALL=YES&StockID=' . $LineItem->StockID . +$RemoveLink = '<a href="' . $_SERVER['PHP_SELF'] . '?DELETEALL=YES&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Remove All'). '</a><br></div>'; $sql="SELECT perishable FROM stockmaster @@ -95,8 +95,9 @@ echo '<td class=number>' . $Bundle->ExpiryDate . '</td>'; } - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . 'Delete=' . $Bundle->BundleRef . '&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Delete'). '</a></td></tr>'; - + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?Delete=' . $Bundle->BundleRef . '&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Delete'). '</a></td></tr>'; + + $LineItem->SerialItems[]=$Bundle; $TotalQuantity += $Bundle->BundleQty; } @@ -114,13 +115,13 @@ /*Start a new table for the Serial/Batch ref input in one column (as a sub table then the multi select box for selection of existing bundle/serial nos for dispatch if applicable*/ //echo '<TABLE><TR><TD valign=TOP>'; - +$TransferQuantity=$TotalQuantity; /*in the first column add a table for the input of newies */ echo '<table class=selection>'; echo $tableheader; -echo '<form action="' . $_SERVER['PHP_SELF'] . '?=' . SID . '" name="Ga6uF5Wa" method="post"> +echo '<form action="' . $_SERVER['PHP_SELF'] . '" name="Ga6uF5Wa" method="post"> <input type=hidden name=LineNo value="' . $LineNo . '"> <input type=hidden name=StockID value="' . $StockID . '"> <input type=hidden name=EntryType value="KEYED">'; @@ -161,12 +162,18 @@ } } +if (isset($_SESSION['Transfer']->StockLocationFrom)) { + $Location=$_SESSION['Transfer']->StockLocationFrom; +} else if (isset($_SESSION['Items']->Location)) { + $Location=$_SESSION['Items']->Location; +} + $sql="SELECT serialno, quantity, expirationdate FROM stockserialitems WHERE stockid='".$StockID."' - AND loccode='".$_SESSION['Items']->Location."'"; + AND loccode='" . $Location . "'"; $result=DB_query($sql, $db); $RowNumber=0; Modified: trunk/index.php =================================================================== --- trunk/index.php 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/index.php 2011-04-10 10:41:20 UTC (rev 4545) @@ -2,8 +2,6 @@ /* $Id$*/ -//$PageSecurity = 1; now comes from DB scripts table - include('includes/session.inc'); $title=_('Main Menu'); @@ -581,12 +579,12 @@ </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockTransfers.php">' . _('Inventory Location Transfers') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockTransfers.php?New=Yes">' . _('Inventory Location Transfers') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockAdjustments.php?NewAdjustment=Yes' . SID . '">' . _('Inventory Adjustments') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockAdjustments.php?NewAdjustment=Yes">' . _('Inventory Adjustments') . '</a></p>'; ?> </td> </tr> <tr> Modified: trunk/sql/mysql/upgrade3.11.1-4.00.sql =================================================================== --- trunk/sql/mysql/upgrade3.11.1-4.00.sql 2011-04-10 02:04:57 UTC (rev 4544) +++ trunk/sql/mysql/upgrade3.11.1-4.00.sql 2011-04-10 10:41:20 UTC (rev 4545) @@ -841,4 +841,4 @@ ALTER TABLE `paymentmethods` ADD `usepreprintedstationery` TINYINT NOT NULL DEFAULT '0'; DELETE FROM scripts WHERE script='PDFStockTransListing.php'; INSERT INTO scripts (`script` ,`pagesecurity` ,`description`) VALUES('PDFPeriodStockTransListing.php','3','Allows stock transactions of a specific transaction type to be listed over a single day or period range'); -IUPDATE config SET confvalue='4.03.7' WHERE confname='VersionNumber'; +UPDATE config SET confvalue='4.03.7' WHERE confname='VersionNumber'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-04-11 10:33:41
|
Revision: 4546 http://web-erp.svn.sourceforge.net/web-erp/?rev=4546&view=rev Author: daintree Date: 2011-04-11 10:33:34 +0000 (Mon, 11 Apr 2011) Log Message: ----------- to launchpad 4587-86 Modified Paths: -------------- trunk/AddCustomerContacts.php trunk/AuditTrail.php trunk/GLBudgets.php trunk/PcAuthorizeExpenses.php trunk/PcExpensesTypeTab.php trunk/PcTypeTabs.php trunk/SelectSalesOrder.php trunk/StockLocTransfer.php trunk/TopItems.php trunk/UserSettings.php trunk/WWW_Users.php trunk/api/api_workorders.php trunk/doc/Change.log.html Modified: trunk/AddCustomerContacts.php =================================================================== --- trunk/AddCustomerContacts.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/AddCustomerContacts.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -1,5 +1,5 @@ <?php -/* $Revision: 1.6 $ */ + /* $Id$*/ include('includes/session.inc'); @@ -17,8 +17,8 @@ } elseif (isset($_GET['DebtorNo'])){ $DebtorNo = $_GET['DebtorNo']; } -echo "<a href='" . $rootpath . '/Customers.php?' . SID .'&DebtorNo='.$DebtorNo."'>" . _('Back to Customers') . '</a><br>'; -$SQLname="SELECT * from debtorsmaster where debtorno='" .$DebtorNo."'"; +echo "<a href='" . $rootpath . '/Customers.php?' . SID .'&DebtorNo='.$DebtorNo."'>" . _('Back to Customers') . '</a><br />'; +$SQLname="SELECT name FROM debtorsmaster where debtorno='" .$DebtorNo."'"; $Result = DB_query($SQLname,$db); $row = DB_fetch_array($Result); if (!isset($_GET['Id'])) { @@ -38,13 +38,13 @@ //first off validate inputs sensible if (isset($_POST['Con_ID']) and !is_long((integer)$_POST['Con_ID'])) { $InputError = 1; - prnMsg( _('The Contact must be an integer.'), 'error'); + prnMsg( _('The Contact ID must be an integer.'), 'error'); } elseif (strlen($_POST['conName']) >40) { $InputError = 1; - prnMsg( _("The contact's name must be forty characters or less long"), 'error'); + prnMsg( _('The contact name must be forty characters or less long'), 'error'); } elseif( trim($_POST['conName']) == '' ) { $InputError = 1; - prnMsg( _("The contact's name may not be empty"), 'error'); + prnMsg( _('The contact name may not be empty'), 'error'); } if (isset($Id) and ($Id and $InputError !=1)) { @@ -72,11 +72,11 @@ if ($InputError !=1) { $result = DB_query($sql,$db); - //echo '<br>'.$sql; + //echo '<br />'.$sql; - echo '<br>'; + echo '<br />'; prnMsg($msg, 'success'); - echo '<br>'; + echo '<br />'; unset($Id); unset($_POST['conName']); unset($_POST['conRole']); @@ -92,9 +92,9 @@ $sql="DELETE FROM custcontacts WHERE contid=".$Id." and debtorno='".$DebtorNo."'"; $result = DB_query($sql,$db); - //echo '<br>'.$sql; + //echo '<br />'.$sql; - echo '<br>'; + echo '<br />'; prnMsg( _('The contact record has been deleted'), 'success'); unset($Id); unset($_GET['delete']); @@ -105,7 +105,7 @@ $sql = "SELECT * FROM custcontacts where debtorno='".$DebtorNo."' ORDER BY contid"; $result = DB_query($sql,$db); - //echo '<br>'.$sql; + //echo '<br />'.$sql; echo '<table class=selection>'; echo '<tr> @@ -153,7 +153,7 @@ <?php if (!isset($_GET['delete'])) { - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '&DebtorNo='.$DebtorNo.'">'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?DebtorNo='.$DebtorNo.'">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($Id)) { @@ -163,7 +163,7 @@ and debtorno='".$DebtorNo."'"; $result = DB_query($sql, $db); - //echo '<br>'.$sql; + //echo '<br />'.$sql; $myrow = DB_fetch_array($result); Modified: trunk/AuditTrail.php =================================================================== --- trunk/AuditTrail.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/AuditTrail.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -2,8 +2,6 @@ /* $Id$ */ -//$PageSecurity=15; - include('includes/session.inc'); $title = _('Audit Trail'); @@ -25,12 +23,12 @@ } // Get list of tables -$tableresult = DB_show_tables($db); +$TableResult = DB_show_tables($db); // Get list of users -$userresult = DB_query('SELECT userid FROM www_users',$db); +$UserResult = DB_query("SELECT userid FROM www_users",$db); -echo '<form action=' . $_SERVER['PHP_SELF'] . '?' . SID . ' method=post>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class=selection>'; @@ -43,29 +41,29 @@ echo '<tr><td>'. _('User ID'). '</td> <td><select tabindex="3" name="SelectedUser">'; echo '<option value=ALL>ALL'; -while ($users = DB_fetch_row($userresult)) { +while ($users = DB_fetch_row($UserResult)) { if (isset($_POST['SelectedUser']) and $users[0]==$_POST['SelectedUser']) { - echo '<option selected value=' . $users[0] . '>' . $users[0]; + echo '<option selected value=' . $users[0] . '>' . $users[0] . '</option>'; } else { - echo '<option value=' . $users[0] . '>' . $users[0]; + echo '<option value=' . $users[0] . '>' . $users[0] . '</option>'; } } echo '</select></td></tr>'; // Show table selections echo '<tr><td>'. _('Table '). '</td><td><select tabindex="4" name="SelectedTable">'; -echo '<option value=ALL>ALL'; -while ($tables = DB_fetch_row($tableresult)) { +echo '<option value="ALL">' . _('ALL') . '</option>'; +while ($tables = DB_fetch_row($TableResult)) { if (isset($_POST['SelectedTable']) and $tables[0]==$_POST['SelectedTable']) { - echo '<option selected value=' . $tables[0] . '>' . $tables[0]; + echo '<option selected value=' . $tables[0] . '>' . $tables[0] . '</option>'; } else { - echo '<option value=' . $tables[0] . '>' . $tables[0]; + echo '<option value=' . $tables[0] . '>' . $tables[0] . '</option>'; } } echo '</select></td></tr>'; echo '</table><br />'; -echo "<div class=centre><input tabindex='5' type=submit name=View value='" . _('View') . "'></div>"; +echo '<div class="centre"><input tabindex="5" type="submit" name="View" value="' . _('View') . '"></div>'; echo '</form>'; // View the audit trail @@ -112,12 +110,12 @@ } function DeleteQueryInfo($SQLString) { - $SQLArray = explode('WHERE', $SQLString); + $SQLArray = explode("WHERE", $SQLString); $_SESSION['SQLString']['table'] = $SQLArray[0]; $SQLString = trim(str_replace($SQLArray[0], '', $SQLString)); - $SQLString = trim(str_replace('DELETE', '', $SQLString)); - $SQLString = trim(str_replace('FROM', '', $SQLString)); - $SQLString = trim(str_replace('WHERE', '', $SQLString)); + $SQLString = trim(str_replace("DELETE", '', $SQLString)); + $SQLString = trim(str_replace("FROM", '', $SQLString)); + $SQLString = trim(str_replace("WHERE", '', $SQLString)); $Assigment = explode('=', $SQLString); $_SESSION['SQLString']['fields'][0] = $Assigment[0]; $_SESSION['SQLString']['values'][0] = $Assigment[1]; @@ -148,16 +146,16 @@ <th>' . _('Field Name') . '</th> <th>' . _('Value') . '</th></tr>'; while ($myrow = DB_fetch_row($result)) { - if (Query_Type($myrow[2]) == 'INSERT') { + if (Query_Type($myrow[2]) == "INSERT") { InsertQueryInfo(str_replace("INSERT INTO",'',$myrow[2])); $RowColour = '#a8ff90'; } - if (Query_Type($myrow[2]) == 'UPDATE') { - UpdateQueryInfo(str_replace('UPDATE','',$myrow[2])); + if (Query_Type($myrow[2]) == "UPDATE") { + UpdateQueryInfo(str_replace("UPDATE",'',$myrow[2])); $RowColour = '#feff90'; } - if (Query_Type($myrow[2]) == 'DELETE') { - DeleteQueryInfo(str_replace('DELETE FROM','',$myrow[2])); + if (Query_Type($myrow[2]) == "DELETE") { + DeleteQueryInfo(str_replace("DELETE FROM",'',$myrow[2])); $RowColour = '#fe90bf'; } Modified: trunk/GLBudgets.php =================================================================== --- trunk/GLBudgets.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/GLBudgets.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -33,10 +33,10 @@ echo '</br><tr><td>'. _('Select GL Account'). ":</td><td><select name='SelectedAccount' onChange='ReloadForm(selectaccount.Select)'>"; -$SQL = 'SELECT accountcode, +$SQL = "SELECT accountcode, accountname FROM chartmaster - ORDER BY accountcode'; + ORDER BY accountcode"; $result=DB_query($SQL,$db); if (DB_num_rows($result)==0){ @@ -215,12 +215,12 @@ echo '<script>defaultControl(document.form.1next);</script>'; echo '</br><div class="centre"><input type="submit" name=update value="' . _('Update') . '"></div></form>'; - $SQL='SELECT MIN(periodno) FROM periods'; + $SQL="SELECT MIN(periodno) FROM periods"; $result=DB_query($SQL,$db); $MyRow=DB_fetch_array($result); $FirstPeriod=$MyRow[0]; - $SQL='SELECT MAX(periodno) FROM periods'; + $SQL="SELECT MAX(periodno) FROM periods"; $result=DB_query($SQL,$db); $MyRow=DB_fetch_array($result); $LastPeriod=$MyRow[0]; Modified: trunk/PcAuthorizeExpenses.php =================================================================== --- trunk/PcAuthorizeExpenses.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/PcAuthorizeExpenses.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -1,7 +1,6 @@ <?php -/* $Revision: 1.0 $ */ -//$PageSecurity = 6; +/* $Id$ */ include('includes/session.inc'); $title = _('Authorization of Petty Cash Expenses'); @@ -41,16 +40,16 @@ } if (isset($_POST['submit']) or isset($_POST['update']) OR isset($SelectedTabs) OR isset ($_POST['GO'])) { - 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 ($Days)){ $Days=30; } - echo "<input type=hidden name='SelectedTabs' VALUE=" . $SelectedTabs . ">"; + 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 '<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,15 +76,15 @@ $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>"; + 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>'; $k=0; //row colour counter echo'<form action="PcAuthorizeExpenses.php" method="POST" name="'._('update').'">'; @@ -94,7 +93,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); @@ -124,7 +123,7 @@ $typeno = GetNextTransNo($type,$db); //build narrative - $narrative= "PettyCash - ".$myrow['tabcode']." - ".$myrow['codeexpense']." - ".$myrow['notes']." - ".$myrow['receipt'].""; + $narrative= _('PettyCash') . ' - ' . $myrow['tabcode'] . ' - ' . $myrow['codeexpense'] . ' - ' . DB_escape_string($myrow['notes']) . ' - '.$myrow['receipt']; //insert to gltrans DB_Txn_Begin($db); Modified: trunk/PcExpensesTypeTab.php =================================================================== --- trunk/PcExpensesTypeTab.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/PcExpensesTypeTab.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -1,7 +1,6 @@ <?php -/* $Revision: 1.0 $ */ -//$PageSecurity = 15; +/* $Id$ */ include('includes/session.inc'); $title = _('Maintenance Of Petty Cash Expenses For a Type Tab'); @@ -14,6 +13,8 @@ $SelectedType = strtoupper($_POST['SelectedType']); } elseif (isset($_GET['SelectedType'])){ $SelectedType = strtoupper($_GET['SelectedType']); +} else { + $SelectedType=''; } if (ContainsIllegalCharacters($SelectedType) OR strpos($SelectedType,' ')>0){ $InputError = 1; @@ -58,7 +59,7 @@ VALUES ('" . $_POST['SelectedTabs'] . "', '" . $_POST['SelectedExpense'] . "')"; - $msg = _('Expense code:') . ' ' . $_POST["SelectedExpense"].' '._('for Type of Tab:') .' '. $_POST["SelectedTabs"] . ' ' . _('has been created'); + $msg = _('Expense code:') . ' ' . $_POST['SelectedExpense'].' '._('for Type of Tab:') .' '. $_POST['SelectedTabs'] . ' ' . _('has been created'); $checkSql = "SELECT count(typetabcode) FROM pctypetabs"; $result = DB_query($checkSql, $db); @@ -96,25 +97,26 @@ then none of the above are true and the list of sales types will be displayed with links to delete or edit each. These will call the same page again and allow update/input or deletion of the records*/ -echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; -echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<table class=selection>'; //Main table + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<table class=selection>'; //Main table + + echo '<tr><td>' . _('Select Type of Tab') . ':</td><td><select name="SelectedTabs">'; -echo '<tr><td>' . _('Select Type of Tab') . ":</td><td><select name='SelectedTabs'>"; - DB_free_result($result); - $SQL = "SELECT typetabcode,typetabdescription - FROM pctypetabs"; + $SQL = "SELECT typetabcode, + typetabdescription + FROM pctypetabs"; $result = DB_query($SQL,$db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['SelectedTabs']) and $myrow['typetabcode']==$_POST['SelectedTabs']) { - echo "<option selected VALUE='"; + echo '<option selected value="'; } else { - echo "<option VALUE='"; + echo '<option VALUE="'; } - echo $myrow['typetabcode'] . "'>" . $myrow['typetabcode'] . ' - ' . $myrow['typetabdescription']; + echo $myrow['typetabcode'] . '">' . $myrow['typetabcode'] . ' - ' . $myrow['typetabdescription'] . '</option>'; } //end while loop @@ -142,11 +144,11 @@ $result = DB_query($sql,$db); - echo '<table class=selection>'; - echo "<tr> - <th>" . _('Expense Code') . "</th> - <th>" . _('Description') . "</th> - </tr>"; + echo '<table class="selection">'; + echo '<tr> + <th>' . _('Expense Code') . '</th> + <th>' . _('Description') . '</th> + </tr>'; $k=0; //row colour counter @@ -176,47 +178,44 @@ if (! isset($_GET['delete'])) { - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '>'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<br /><table class=selection>'; //Main table - - - - echo '<tr><td>' . _('Select Expense Code') . ":</td><td><select name='SelectedExpense'>"; - - DB_free_result($result); - $SQL = "SELECT codeexpense,description - FROM pcexpenses"; - - $result = DB_query($SQL,$db); - - while ($myrow = DB_fetch_array($result)) { - if (isset($_POST['SelectedExpense']) and $myrow['codeexpense']==$_POST['SelectedExpense']) { - echo "<option selected VALUE='"; - } else { - echo "<option VALUE='"; - } - echo $myrow['codeexpense'] . "'>" . $myrow['codeexpense'] . ' - ' . $myrow['description']; - - } //end while loop - - echo '</select></td></tr>'; - - - echo "<input type=hidden name='SelectedTabs' VALUE=" . $SelectedTabs . ">"; - - echo '</td></tr></table>'; // close main table - - echo '<p><div class="centre"><input type=submit name=submit VALUE="' . _('Accept') . '"><input type=submit name=Cancel VALUE="' . _('Cancel') . '"></div>'; - - echo '</form>'; - -} // end if user wish to delete - - + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<br /><table class="selection">'; //Main table + + + + echo '<tr><td>' . _('Select Expense Code') . ':</td><td><select name="SelectedExpense">'; + + DB_free_result($result); + $SQL = "SELECT codeexpense, + description + FROM pcexpenses"; + + $result = DB_query($SQL,$db); + + while ($myrow = DB_fetch_array($result)) { + if (isset($_POST['SelectedExpense']) and $myrow['codeexpense']==$_POST['SelectedExpense']) { + echo '<option selected value="'; + } else { + echo '<option value="'; + } + echo $myrow['codeexpense'] . '">' . $myrow['codeexpense'] . ' - ' . $myrow['description'] . '</option>'; + + } //end while loop + + echo '</select></td></tr>'; + + + echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '">'; + + echo '</td></tr></table>'; // close main table + + echo '<p><div class="centre"><input type=submit name=submit VALUE="' . _('Accept') . '"><input type=submit name=Cancel VALUE="' . _('Cancel') . '"></div>'; + + echo '</form>'; + + } // end if user wish to delete } - - include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/PcTypeTabs.php =================================================================== --- trunk/PcTypeTabs.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/PcTypeTabs.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -1,8 +1,6 @@ <?php /* $Id$ */ -//$PageSecurity = 15; - include('includes/session.inc'); $title = _('Maintenance Of Petty Cash Type of Tabs'); include('includes/header.inc'); @@ -125,7 +123,7 @@ echo '<br>'; echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<p><div class="centre"><input type=submit name=return VALUE="' . _('Return to list of tab types') . '"></div>'; + echo '<p><div class="centre"><input type=submit name=return value="' . _('Return to list of tab types') . '"></div>'; echo '</form>'; include('includes/footer.inc'); exit; @@ -190,7 +188,7 @@ } if (! isset($_GET['delete'])) { - 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 '<p><table class=selection>'; //Main table @@ -220,19 +218,19 @@ // This is a new type so the user may volunteer a type code - echo "<table class=selection><tr><td>" . _('Code Of Type Of Tab') . ":</td><td><input type='Text' - " . (in_array('TypeTabCode',$Errors) ? 'class="inputerror"' : '' ) ." name='TypeTabCode'></td></tr>"; + echo '<table class="selection"><tr><td>' . _('Code Of Type Of Tab') . ':</td><td><input type="text" + ' . (in_array('TypeTabCode',$Errors) ? 'class="inputerror"' : '' ) .' name="TypeTabCode"></td></tr>'; } if (!isset($_POST['TypeTabDescription'])) { $_POST['TypeTabDescription']=''; } - echo "<tr><td>" . _('Description Of Type of Tab') . ":</td><td><input type='Text' name='TypeTabDescription' size=50 maxlength=49 value='" . $_POST['TypeTabDescription'] . "'></td></tr>"; + echo '<tr><td>' . _('Description Of Type of Tab') . ':</td><td><input type="text" name="TypeTabDescription" size="50" maxlength="49" value="' . $_POST['TypeTabDescription'] . '"></td></tr>'; echo '</td></tr></table>'; // close main table - echo '<p><div class="centre"><input type=submit name=submit VALUE="' . _('Accept') . '"><input type=submit name=Cancel VALUE="' . _('Cancel') . '"></div>'; + echo '<p><div class="centre"><input type=submit name=submit value="' . _('Accept') . '"><input type=submit name="Cancel" VALUE="' . _('Cancel') . '"></div>'; echo '</form>'; Modified: trunk/SelectSalesOrder.php =================================================================== --- trunk/SelectSalesOrder.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/SelectSalesOrder.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -417,10 +417,11 @@ if (!isset($_REQUEST['OrderNumber']) or $_REQUEST['OrderNumber']==''){ echo '<table class=selection>'; - echo '<tr><td>' . _('Order number') . ": </td><td><input type=text name='OrderNumber' maxlength=8 size=9></td><td>" . - _('From Stock Location') . ":</td><td><select name='StockLocation'> "; + echo '<tr><td>' . _('Order number') . ': </td> + <td><input type="text" name="OrderNumber" maxlength="8" size="9"></td> + <td>' . _('From Stock Location') . ':</td><td><select name="StockLocation"> '; - $sql = 'SELECT loccode, locationname FROM locations'; + $sql = "SELECT loccode, locationname FROM locations"; $resultStkLocs = DB_query($sql,$db); @@ -459,10 +460,10 @@ _('Add Sales Order') . '</a></td></tr></table>'; } - $SQL='SELECT categoryid, + $SQL="SELECT categoryid, categorydescription FROM stockcategory - ORDER BY categorydescription'; + ORDER BY categorydescription"; $result1 = DB_query($SQL,$db); Modified: trunk/StockLocTransfer.php =================================================================== --- trunk/StockLocTransfer.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/StockLocTransfer.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -1,8 +1,6 @@ <?php /* $Id$*/ -/* contributed by Chris Bice */ -//$PageSecurity = 11; include('includes/session.inc'); $title = _('Inventory Location Transfer Shipment'); include('includes/header.inc'); @@ -17,7 +15,7 @@ $result = DB_query("SELECT * FROM loctransfers WHERE reference='" . $_POST['Trf_ID'] . "'",$db); if (DB_num_rows($result)!=0){ $InputError = true; - $ErrorMessage = _('This transaction has already been entered') . '. ' . _('Please start over now').'<br>'; + $ErrorMessage = _('This transaction has already been entered') . '. ' . _('Please start over now').'<br />'; unset($_POST['submit']); unset($_POST['EnterMoreItems']); for ($i=$_POST['LinesCounter']-10;$i<$_POST['LinesCounter'];$i++){ @@ -33,19 +31,19 @@ $myrow = DB_fetch_row($result); if ($myrow[0]==0){ $InputError = True; - $ErrorMessage .= _('The part code entered of'). ' ' . $_POST['StockID' . $i] . ' '. _('is not set up in the database') . '. ' . _('Only valid parts can be entered for transfers'). '<br>'; + $ErrorMessage .= _('The part code entered of'). ' ' . $_POST['StockID' . $i] . ' '. _('is not set up in the database') . '. ' . _('Only valid parts can be entered for transfers'). '<br />'; $_POST['LinesCounter'] -= 10; } DB_free_result( $result ); if (!is_numeric($_POST['StockQTY' . $i])){ $InputError = True; - $ErrorMessage .= _('The quantity entered of'). ' ' . $_POST['StockQTY' . $i] . ' '. _('for part code'). ' ' . $_POST['StockID' . $i] . ' '. _('is not numeric') . '. ' . _('The quantity entered for transfers is expected to be numeric').'<br>'; + $ErrorMessage .= _('The quantity entered of'). ' ' . $_POST['StockQTY' . $i] . ' '. _('for part code'). ' ' . $_POST['StockID' . $i] . ' '. _('is not numeric') . '. ' . _('The quantity entered for transfers is expected to be numeric').'<br />'; $_POST['LinesCounter'] -= 10; } if ($_POST['StockQTY' . $i] <= 0){ $InputError = True; - $ErrorMessage .= _('The quantity entered for').' '. $_POST['StockID' . $i] . ' ' . _('is less than or equal to 0') . '. ' . _('Please correct this or remove the item').'<br>'; - + $ErrorMessage .= _('The quantity entered for').' '. $_POST['StockID' . $i] . ' ' . _('is less than or equal to 0') . '. ' . _('Please correct this or remove the item').'<br />'; + $_POST['LinesCounter'] -= 10; } // Only if stock exists at this location $result = DB_query("SELECT quantity FROM locstock WHERE stockid='" . $_POST['StockID' . $i] . "' and loccode='".$_POST['FromStockLocation']."'",$db); @@ -61,7 +59,7 @@ }//for all LinesCounter if ($TotalItems == 0){ $InputError = True; - $ErrorMessage .= _('You must enter at least 1 Stock Item to transfer').'<br>'; + $ErrorMessage .= _('You must enter at least 1 Stock Item to transfer').'<br />'; } /*Ship location and Receive location are different */ @@ -122,10 +120,10 @@ } if (isset($InputError) and $InputError==true){ - echo '<br>'; + echo '<br />'; prnMsg($ErrorMessage, 'error'); - echo '<br>'; + echo '<br />'; } @@ -215,8 +213,8 @@ $i++; } - echo '</table><br><div class="centre"> - <input type=hidden name="LinesCounter" value='. $i .'><input type=submit name="EnterMoreItems" value="'. _('Add More Items'). '"><input type=submit name="Submit" value="'. _('Create Transfer Shipment'). '"><br>'; + echo '</table><br /><div class="centre"> + <input type=hidden name="LinesCounter" value='. $i .'><input type=submit name="EnterMoreItems" value="'. _('Add More Items'). '"><input type=submit name="Submit" value="'. _('Create Transfer Shipment'). '"><br />'; echo '<script type="text/javascript">defaultControl(document.forms[0].StockID0);</script>'; echo '</form></div>'; include('includes/footer.inc'); Modified: trunk/TopItems.php =================================================================== --- trunk/TopItems.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/TopItems.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -11,9 +11,9 @@ if (!(isset($_POST['Search']))) { echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Top Sales Order Search') . '" alt="" />' . ' ' . _('Top Sales Order Search') . '</p>'; - echo "<form action=" . $_SERVER['PHP_SELF'] . '?' . SID . ' name="SelectCustomer" method=POST>'; + echo '<form action="' . $_SERVER['PHP_SELF'] . '?name="SelectCustomer" method="POST">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table cellpadding=3 colspan=4 class=selection>'; + echo '<table cellpadding="3" colspan="4" class="selection">'; //to view store location echo '<tr><td width="150">' . _('Select Location') . ' </td><td>:</td><td><select name=Location>'; $sql = "SELECT loccode, @@ -83,7 +83,7 @@ AND salesorderdetails.stkcode = stockmaster.stockid AND salesorders.debtorno = debtorsmaster.debtorno AND debtorsmaster.currcode = currencies.currabrev - AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' + AND salesorderdetails.actualdispatchdate >= '" . $FromDate . "' GROUP BY salesorderdetails.stkcode ORDER BY '" . $_POST['Sequence'] . "' DESC LIMIT " . $_POST['NumberOfTopItems'] . ""; @@ -104,7 +104,7 @@ AND salesorders.debtorno = debtorsmaster.debtorno AND debtorsmaster.currcode = currencies.currabrev AND debtorsmaster.typeid = '" . $_POST['Customers'] . "' - AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' + AND salesorderdetails.actualdispatchdate >= '" . $FromDate . "' GROUP BY salesorderdetails.stkcode ORDER BY '" . $_POST['Sequence'] . "' DESC LIMIT " . $_POST[NumberOfTopItems] . ""; @@ -112,44 +112,44 @@ //the situation if the customer type selected "All" if ($_POST['Customers'] == 'All') { $SQL = "SELECT salesorderdetails.stkcode, - SUM(salesorderdetails.qtyinvoiced) TotalInvoiced, - SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS ValueSales, - stockmaster.description, - stockmaster.units, - currencies.rate, - debtorsmaster.currcode, - stockmaster.decimalplaces - FROM salesorderdetails, salesorders, debtorsmaster,stockmaster, currencies - WHERE salesorderdetails.orderno = salesorders.orderno - AND salesorderdetails.stkcode = stockmaster.stockid - AND salesorders.debtorno = debtorsmaster.debtorno - AND debtorsmaster.currcode = currencies.currabrev - AND salesorders.fromstkloc = '" . $_POST['Location'] . "' - AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' - GROUP BY salesorderdetails.stkcode - ORDER BY " . $_POST['Sequence'] . " DESC - LIMIT " . $_POST['NumberOfTopItems'] . ""; + SUM(salesorderdetails.qtyinvoiced) TotalInvoiced, + SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS ValueSales, + stockmaster.description, + stockmaster.units, + currencies.rate, + debtorsmaster.currcode, + stockmaster.decimalplaces + FROM salesorderdetails, salesorders, debtorsmaster,stockmaster, currencies + WHERE salesorderdetails.orderno = salesorders.orderno + AND salesorderdetails.stkcode = stockmaster.stockid + AND salesorders.debtorno = debtorsmaster.debtorno + AND debtorsmaster.currcode = currencies.currabrev + AND salesorders.fromstkloc = '" . $_POST['Location'] . "' + AND salesorderdetails.actualdispatchdate >= '" . $FromDate . "' + GROUP BY salesorderdetails.stkcode + ORDER BY " . $_POST['Sequence'] . " DESC + LIMIT " . $_POST['NumberOfTopItems'] . ""; } else { //the situation if the location and customer type not selected "All" $SQL = "SELECT salesorderdetails.stkcode, - SUM(salesorderdetails.qtyinvoiced) TotalInvoiced, - SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS ValueSales, - stockmaster.description, - stockmaster.units, - currencies.rate, - debtorsmaster.currcode, - stockmaster.decimalplaces - FROM salesorderdetails, salesorders, debtorsmaster,stockmaster, currencies - WHERE salesorderdetails.orderno = salesorders.orderno - AND salesorderdetails.stkcode = stockmaster.stockid - AND salesorders.debtorno = debtorsmaster.debtorno - AND debtorsmaster.currcode = currencies.currabrev - AND salesorders.fromstkloc = '" . $_POST['Location'] . "' - AND debtorsmaster.typeid = '" . $_POST['Customers'] . "' - AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' - GROUP BY salesorderdetails.stkcode - ORDER BY '" . $_POST['Sequence'] . "' DESC - LIMIT " . $_POST['NumberOfTopItems'] . ""; + SUM(salesorderdetails.qtyinvoiced) TotalInvoiced, + SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS ValueSales, + stockmaster.description, + stockmaster.units, + currencies.rate, + debtorsmaster.currcode, + stockmaster.decimalplaces + FROM salesorderdetails, salesorders, debtorsmaster,stockmaster, currencies + WHERE salesorderdetails.orderno = salesorders.orderno + AND salesorderdetails.stkcode = stockmaster.stockid + AND salesorders.debtorno = debtorsmaster.debtorno + AND debtorsmaster.currcode = currencies.currabrev + AND salesorders.fromstkloc = '" . $_POST['Location'] . "' + AND debtorsmaster.typeid = '" . $_POST['Customers'] . "' + AND salesorderdetails.actualdispatchdate >= '" . $FromDate . "' + GROUP BY salesorderdetails.stkcode + ORDER BY '" . $_POST['Sequence'] . "' DESC + LIMIT " . $_POST['NumberOfTopItems'] . ""; } } } Modified: trunk/UserSettings.php =================================================================== --- trunk/UserSettings.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/UserSettings.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -97,7 +97,7 @@ } } -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($_POST['DisplayRecordsMax']) OR $_POST['DisplayRecordsMax']=='') { @@ -114,20 +114,19 @@ <input type="hidden" name="RealName" VALUE="'.$_SESSION['UsersRealName'].'"<td></tr>'; echo '<tr> - <td>' . _('Maximum Number of Records to Display') . ":</td> - <td><input type='Text' class='number' name='DisplayRecordsMax' size=3 maxlength=3 VALUE=" . $_POST['DisplayRecordsMax'] . " ></td> - </tr>"; + <td>' . _('Maximum Number of Records to Display') . ':</td> + <td><input type="text" class="number" name="DisplayRecordsMax" size="3" maxlength="3" value="' . $_POST['DisplayRecordsMax'] . '" ></td> + </tr>'; echo '<tr> - <td>' . _('Language') . ":</td> - <td><select name='Language'>"; + <td>' . _('Language') . ':</td> + <td><select name="Language">'; - $LangDirHandle = dir('locale/'); + $Languages = scandir('locale/', 0); - - while (false != ($LanguageEntry = $LangDirHandle->read())){ - + foreach ($Languages as $LanguageEntry){ + if (is_dir('locale/' . $LanguageEntry) AND $LanguageEntry != '..' AND $LanguageEntry != '.svn' Modified: trunk/WWW_Users.php =================================================================== --- trunk/WWW_Users.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/WWW_Users.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -574,13 +574,15 @@ <td>' . _('Language') . ':</td> <td><select name="UserLanguage">'; - $LangDirHandle = dir('locale/'); +$Languages = scandir('locale/', 0); +foreach ($Languages as $LanguageEntry){ + + if (is_dir('locale/' . $LanguageEntry) + AND $LanguageEntry != '..' + AND $LanguageEntry != '.svn' + AND $LanguageEntry!='.'){ -while (false != ($LanguageEntry = $LangDirHandle->read())){ - - if (is_dir('locale/' . $LanguageEntry) AND $LanguageEntry != '..' AND $LanguageEntry != 'CVS' AND $LanguageEntry!='.'){ - if (isset($_POST['UserLanguage']) and $_POST['UserLanguage'] == $LanguageEntry){ echo '<option selected value="' . $LanguageEntry . '">' . $LanguageEntry .'</option>'; } elseif (!isset($_POST['UserLanguage']) and $LanguageEntry == $DefaultLanguage) { @@ -591,6 +593,8 @@ } } + + echo '</select></td></tr>'; Modified: trunk/api/api_workorders.php =================================================================== --- trunk/api/api_workorders.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/api/api_workorders.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -44,7 +44,7 @@ } function VerifyRequiredByDate($RequiredByDate, $i, $Errors, $db) { - $sql="select confvalue from config where confname='DefaultDateFormat'"; + $sql="SELECT confvalue FROM config WHERE confname='DefaultDateFormat'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; @@ -77,7 +77,7 @@ } function VerifyStartDate($StartDate, $i, $Errors, $db) { - $sql="select confvalue from config where confname='DefaultDateFormat'"; + $sql="SELECT confvalue FROM config WHERE confname='DefaultDateFormat'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; @@ -310,37 +310,37 @@ '".$newqoh."', '".$cost."', '".$cost."')"; - $locstocksql='UPDATE locstock SET quantity = quantity + '.$Quantity." - WHERE loccode='". $Location."' - AND stockid='".$StockID."'"; + $locstocksql="UPDATE locstock SET quantity = quantity + " . $Quantity ." + WHERE loccode='". $Location."' + AND stockid='".$StockID."'"; $glupdatesql1="INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - amount, - narrative) - VALUES (28, - '".$TransactionNo. "', - '".$TranDate."', - '".GetPeriodFromTransactionDate($TranDate, sizeof($Errors), $Errors, $db)."', - '".$wipglact."', - '".$cost*-$Quantity."', - '".$StockID.' x '.$Quantity.' @ '.$cost."')"; + typeno, + trandate, + periodno, + account, + amount, + narrative) + VALUES (28, + '".$TransactionNo. "', + '".$TranDate."', + '".GetPeriodFromTransactionDate($TranDate, sizeof($Errors), $Errors, $db)."', + '".$wipglact."', + '".$cost*-$Quantity."', + '".$StockID.' x '.$Quantity.' @ '.$cost."')"; $glupdatesql2="INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - amount, - narrative) - VALUES (28, - '".$TransactionNo."', - '".$TranDate."', - '".GetPeriodFromTransactionDate($TranDate, sizeof($Errors), $Errors, $db)."', - '".$stockact."', - '".$cost*$Quantity."', - '".$StockID.' x '.$Quantity.' @ '.$cost."')"; + typeno, + trandate, + periodno, + account, + amount, + narrative) + VALUES (28, + '".$TransactionNo."', + '".$TranDate."', + '".GetPeriodFromTransactionDate($TranDate, sizeof($Errors), $Errors, $db)."', + '".$stockact."', + '".$cost*$Quantity."', + '".$StockID.' x '.$Quantity.' @ '.$cost."')"; $systypessql = "UPDATE systypes set typeno='".$TransactionNo."' where typeid=28"; $batchsql="UPDATE stockserialitems SET quantity=quantity-" . $Quantity. " WHERE stockid='".$StockID."' @@ -474,7 +474,7 @@ } $sql="SELECT wo FROM woitems - WHERE ".$Field." LIKE '%".$Criteria."%'"; + WHERE " . $Field ." " . LIKE . " '%".$Criteria."%'"; $result = DB_Query($sql, $db); $i=0; $WOList = array(); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/doc/Change.log.html 2011-04-11 10:33:34 UTC (rev 4546) @@ -1,6 +1,9 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p /> -<p>10/4/11 Tim: +<p>11/4/11 Tim: pcAuthorizeExpenses.php DB_escape_string(notes)</p> +<p>11/4/11 Tim: StockLocTransfer.php added $_POST['LinesCounter'] -= 10;</p> +<p>11/4/11 Tim/Phil: Use PHP 5 specific scandir to sort languages into alphabetic order for UserSettings and WWW_Users language selection</p> +<p>10/4/11 Tim: AddCustomerContacts.php use single field rather than * in SQL></p> <p>10/4/11 Tim: GLAccountInquiry.php show None if no tag selected</p> <p>10/4/11 Tim : PDFPrintLabel.php javascript fix</p> <p>10/4/11 Tim: Add perishable to StockTransfer.php and PDFStockTransfer</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-04-11 10:33:41
|
Revision: 4546 http://web-erp.svn.sourceforge.net/web-erp/?rev=4546&view=rev Author: daintree Date: 2011-04-11 10:33:34 +0000 (Mon, 11 Apr 2011) Log Message: ----------- to launchpad 4587-86 Modified Paths: -------------- trunk/AddCustomerContacts.php trunk/AuditTrail.php trunk/GLBudgets.php trunk/PcAuthorizeExpenses.php trunk/PcExpensesTypeTab.php trunk/PcTypeTabs.php trunk/SelectSalesOrder.php trunk/StockLocTransfer.php trunk/TopItems.php trunk/UserSettings.php trunk/WWW_Users.php trunk/api/api_workorders.php trunk/doc/Change.log.html Modified: trunk/AddCustomerContacts.php =================================================================== --- trunk/AddCustomerContacts.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/AddCustomerContacts.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -1,5 +1,5 @@ <?php -/* $Revision: 1.6 $ */ + /* $Id$*/ include('includes/session.inc'); @@ -17,8 +17,8 @@ } elseif (isset($_GET['DebtorNo'])){ $DebtorNo = $_GET['DebtorNo']; } -echo "<a href='" . $rootpath . '/Customers.php?' . SID .'&DebtorNo='.$DebtorNo."'>" . _('Back to Customers') . '</a><br>'; -$SQLname="SELECT * from debtorsmaster where debtorno='" .$DebtorNo."'"; +echo "<a href='" . $rootpath . '/Customers.php?' . SID .'&DebtorNo='.$DebtorNo."'>" . _('Back to Customers') . '</a><br />'; +$SQLname="SELECT name FROM debtorsmaster where debtorno='" .$DebtorNo."'"; $Result = DB_query($SQLname,$db); $row = DB_fetch_array($Result); if (!isset($_GET['Id'])) { @@ -38,13 +38,13 @@ //first off validate inputs sensible if (isset($_POST['Con_ID']) and !is_long((integer)$_POST['Con_ID'])) { $InputError = 1; - prnMsg( _('The Contact must be an integer.'), 'error'); + prnMsg( _('The Contact ID must be an integer.'), 'error'); } elseif (strlen($_POST['conName']) >40) { $InputError = 1; - prnMsg( _("The contact's name must be forty characters or less long"), 'error'); + prnMsg( _('The contact name must be forty characters or less long'), 'error'); } elseif( trim($_POST['conName']) == '' ) { $InputError = 1; - prnMsg( _("The contact's name may not be empty"), 'error'); + prnMsg( _('The contact name may not be empty'), 'error'); } if (isset($Id) and ($Id and $InputError !=1)) { @@ -72,11 +72,11 @@ if ($InputError !=1) { $result = DB_query($sql,$db); - //echo '<br>'.$sql; + //echo '<br />'.$sql; - echo '<br>'; + echo '<br />'; prnMsg($msg, 'success'); - echo '<br>'; + echo '<br />'; unset($Id); unset($_POST['conName']); unset($_POST['conRole']); @@ -92,9 +92,9 @@ $sql="DELETE FROM custcontacts WHERE contid=".$Id." and debtorno='".$DebtorNo."'"; $result = DB_query($sql,$db); - //echo '<br>'.$sql; + //echo '<br />'.$sql; - echo '<br>'; + echo '<br />'; prnMsg( _('The contact record has been deleted'), 'success'); unset($Id); unset($_GET['delete']); @@ -105,7 +105,7 @@ $sql = "SELECT * FROM custcontacts where debtorno='".$DebtorNo."' ORDER BY contid"; $result = DB_query($sql,$db); - //echo '<br>'.$sql; + //echo '<br />'.$sql; echo '<table class=selection>'; echo '<tr> @@ -153,7 +153,7 @@ <?php if (!isset($_GET['delete'])) { - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '&DebtorNo='.$DebtorNo.'">'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?DebtorNo='.$DebtorNo.'">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($Id)) { @@ -163,7 +163,7 @@ and debtorno='".$DebtorNo."'"; $result = DB_query($sql, $db); - //echo '<br>'.$sql; + //echo '<br />'.$sql; $myrow = DB_fetch_array($result); Modified: trunk/AuditTrail.php =================================================================== --- trunk/AuditTrail.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/AuditTrail.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -2,8 +2,6 @@ /* $Id$ */ -//$PageSecurity=15; - include('includes/session.inc'); $title = _('Audit Trail'); @@ -25,12 +23,12 @@ } // Get list of tables -$tableresult = DB_show_tables($db); +$TableResult = DB_show_tables($db); // Get list of users -$userresult = DB_query('SELECT userid FROM www_users',$db); +$UserResult = DB_query("SELECT userid FROM www_users",$db); -echo '<form action=' . $_SERVER['PHP_SELF'] . '?' . SID . ' method=post>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class=selection>'; @@ -43,29 +41,29 @@ echo '<tr><td>'. _('User ID'). '</td> <td><select tabindex="3" name="SelectedUser">'; echo '<option value=ALL>ALL'; -while ($users = DB_fetch_row($userresult)) { +while ($users = DB_fetch_row($UserResult)) { if (isset($_POST['SelectedUser']) and $users[0]==$_POST['SelectedUser']) { - echo '<option selected value=' . $users[0] . '>' . $users[0]; + echo '<option selected value=' . $users[0] . '>' . $users[0] . '</option>'; } else { - echo '<option value=' . $users[0] . '>' . $users[0]; + echo '<option value=' . $users[0] . '>' . $users[0] . '</option>'; } } echo '</select></td></tr>'; // Show table selections echo '<tr><td>'. _('Table '). '</td><td><select tabindex="4" name="SelectedTable">'; -echo '<option value=ALL>ALL'; -while ($tables = DB_fetch_row($tableresult)) { +echo '<option value="ALL">' . _('ALL') . '</option>'; +while ($tables = DB_fetch_row($TableResult)) { if (isset($_POST['SelectedTable']) and $tables[0]==$_POST['SelectedTable']) { - echo '<option selected value=' . $tables[0] . '>' . $tables[0]; + echo '<option selected value=' . $tables[0] . '>' . $tables[0] . '</option>'; } else { - echo '<option value=' . $tables[0] . '>' . $tables[0]; + echo '<option value=' . $tables[0] . '>' . $tables[0] . '</option>'; } } echo '</select></td></tr>'; echo '</table><br />'; -echo "<div class=centre><input tabindex='5' type=submit name=View value='" . _('View') . "'></div>"; +echo '<div class="centre"><input tabindex="5" type="submit" name="View" value="' . _('View') . '"></div>'; echo '</form>'; // View the audit trail @@ -112,12 +110,12 @@ } function DeleteQueryInfo($SQLString) { - $SQLArray = explode('WHERE', $SQLString); + $SQLArray = explode("WHERE", $SQLString); $_SESSION['SQLString']['table'] = $SQLArray[0]; $SQLString = trim(str_replace($SQLArray[0], '', $SQLString)); - $SQLString = trim(str_replace('DELETE', '', $SQLString)); - $SQLString = trim(str_replace('FROM', '', $SQLString)); - $SQLString = trim(str_replace('WHERE', '', $SQLString)); + $SQLString = trim(str_replace("DELETE", '', $SQLString)); + $SQLString = trim(str_replace("FROM", '', $SQLString)); + $SQLString = trim(str_replace("WHERE", '', $SQLString)); $Assigment = explode('=', $SQLString); $_SESSION['SQLString']['fields'][0] = $Assigment[0]; $_SESSION['SQLString']['values'][0] = $Assigment[1]; @@ -148,16 +146,16 @@ <th>' . _('Field Name') . '</th> <th>' . _('Value') . '</th></tr>'; while ($myrow = DB_fetch_row($result)) { - if (Query_Type($myrow[2]) == 'INSERT') { + if (Query_Type($myrow[2]) == "INSERT") { InsertQueryInfo(str_replace("INSERT INTO",'',$myrow[2])); $RowColour = '#a8ff90'; } - if (Query_Type($myrow[2]) == 'UPDATE') { - UpdateQueryInfo(str_replace('UPDATE','',$myrow[2])); + if (Query_Type($myrow[2]) == "UPDATE") { + UpdateQueryInfo(str_replace("UPDATE",'',$myrow[2])); $RowColour = '#feff90'; } - if (Query_Type($myrow[2]) == 'DELETE') { - DeleteQueryInfo(str_replace('DELETE FROM','',$myrow[2])); + if (Query_Type($myrow[2]) == "DELETE") { + DeleteQueryInfo(str_replace("DELETE FROM",'',$myrow[2])); $RowColour = '#fe90bf'; } Modified: trunk/GLBudgets.php =================================================================== --- trunk/GLBudgets.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/GLBudgets.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -33,10 +33,10 @@ echo '</br><tr><td>'. _('Select GL Account'). ":</td><td><select name='SelectedAccount' onChange='ReloadForm(selectaccount.Select)'>"; -$SQL = 'SELECT accountcode, +$SQL = "SELECT accountcode, accountname FROM chartmaster - ORDER BY accountcode'; + ORDER BY accountcode"; $result=DB_query($SQL,$db); if (DB_num_rows($result)==0){ @@ -215,12 +215,12 @@ echo '<script>defaultControl(document.form.1next);</script>'; echo '</br><div class="centre"><input type="submit" name=update value="' . _('Update') . '"></div></form>'; - $SQL='SELECT MIN(periodno) FROM periods'; + $SQL="SELECT MIN(periodno) FROM periods"; $result=DB_query($SQL,$db); $MyRow=DB_fetch_array($result); $FirstPeriod=$MyRow[0]; - $SQL='SELECT MAX(periodno) FROM periods'; + $SQL="SELECT MAX(periodno) FROM periods"; $result=DB_query($SQL,$db); $MyRow=DB_fetch_array($result); $LastPeriod=$MyRow[0]; Modified: trunk/PcAuthorizeExpenses.php =================================================================== --- trunk/PcAuthorizeExpenses.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/PcAuthorizeExpenses.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -1,7 +1,6 @@ <?php -/* $Revision: 1.0 $ */ -//$PageSecurity = 6; +/* $Id$ */ include('includes/session.inc'); $title = _('Authorization of Petty Cash Expenses'); @@ -41,16 +40,16 @@ } if (isset($_POST['submit']) or isset($_POST['update']) OR isset($SelectedTabs) OR isset ($_POST['GO'])) { - 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 ($Days)){ $Days=30; } - echo "<input type=hidden name='SelectedTabs' VALUE=" . $SelectedTabs . ">"; + 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 '<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,15 +76,15 @@ $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>"; + 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>'; $k=0; //row colour counter echo'<form action="PcAuthorizeExpenses.php" method="POST" name="'._('update').'">'; @@ -94,7 +93,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); @@ -124,7 +123,7 @@ $typeno = GetNextTransNo($type,$db); //build narrative - $narrative= "PettyCash - ".$myrow['tabcode']." - ".$myrow['codeexpense']." - ".$myrow['notes']." - ".$myrow['receipt'].""; + $narrative= _('PettyCash') . ' - ' . $myrow['tabcode'] . ' - ' . $myrow['codeexpense'] . ' - ' . DB_escape_string($myrow['notes']) . ' - '.$myrow['receipt']; //insert to gltrans DB_Txn_Begin($db); Modified: trunk/PcExpensesTypeTab.php =================================================================== --- trunk/PcExpensesTypeTab.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/PcExpensesTypeTab.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -1,7 +1,6 @@ <?php -/* $Revision: 1.0 $ */ -//$PageSecurity = 15; +/* $Id$ */ include('includes/session.inc'); $title = _('Maintenance Of Petty Cash Expenses For a Type Tab'); @@ -14,6 +13,8 @@ $SelectedType = strtoupper($_POST['SelectedType']); } elseif (isset($_GET['SelectedType'])){ $SelectedType = strtoupper($_GET['SelectedType']); +} else { + $SelectedType=''; } if (ContainsIllegalCharacters($SelectedType) OR strpos($SelectedType,' ')>0){ $InputError = 1; @@ -58,7 +59,7 @@ VALUES ('" . $_POST['SelectedTabs'] . "', '" . $_POST['SelectedExpense'] . "')"; - $msg = _('Expense code:') . ' ' . $_POST["SelectedExpense"].' '._('for Type of Tab:') .' '. $_POST["SelectedTabs"] . ' ' . _('has been created'); + $msg = _('Expense code:') . ' ' . $_POST['SelectedExpense'].' '._('for Type of Tab:') .' '. $_POST['SelectedTabs'] . ' ' . _('has been created'); $checkSql = "SELECT count(typetabcode) FROM pctypetabs"; $result = DB_query($checkSql, $db); @@ -96,25 +97,26 @@ then none of the above are true and the list of sales types will be displayed with links to delete or edit each. These will call the same page again and allow update/input or deletion of the records*/ -echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; -echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<table class=selection>'; //Main table + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<table class=selection>'; //Main table + + echo '<tr><td>' . _('Select Type of Tab') . ':</td><td><select name="SelectedTabs">'; -echo '<tr><td>' . _('Select Type of Tab') . ":</td><td><select name='SelectedTabs'>"; - DB_free_result($result); - $SQL = "SELECT typetabcode,typetabdescription - FROM pctypetabs"; + $SQL = "SELECT typetabcode, + typetabdescription + FROM pctypetabs"; $result = DB_query($SQL,$db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['SelectedTabs']) and $myrow['typetabcode']==$_POST['SelectedTabs']) { - echo "<option selected VALUE='"; + echo '<option selected value="'; } else { - echo "<option VALUE='"; + echo '<option VALUE="'; } - echo $myrow['typetabcode'] . "'>" . $myrow['typetabcode'] . ' - ' . $myrow['typetabdescription']; + echo $myrow['typetabcode'] . '">' . $myrow['typetabcode'] . ' - ' . $myrow['typetabdescription'] . '</option>'; } //end while loop @@ -142,11 +144,11 @@ $result = DB_query($sql,$db); - echo '<table class=selection>'; - echo "<tr> - <th>" . _('Expense Code') . "</th> - <th>" . _('Description') . "</th> - </tr>"; + echo '<table class="selection">'; + echo '<tr> + <th>' . _('Expense Code') . '</th> + <th>' . _('Description') . '</th> + </tr>'; $k=0; //row colour counter @@ -176,47 +178,44 @@ if (! isset($_GET['delete'])) { - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '>'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<br /><table class=selection>'; //Main table - - - - echo '<tr><td>' . _('Select Expense Code') . ":</td><td><select name='SelectedExpense'>"; - - DB_free_result($result); - $SQL = "SELECT codeexpense,description - FROM pcexpenses"; - - $result = DB_query($SQL,$db); - - while ($myrow = DB_fetch_array($result)) { - if (isset($_POST['SelectedExpense']) and $myrow['codeexpense']==$_POST['SelectedExpense']) { - echo "<option selected VALUE='"; - } else { - echo "<option VALUE='"; - } - echo $myrow['codeexpense'] . "'>" . $myrow['codeexpense'] . ' - ' . $myrow['description']; - - } //end while loop - - echo '</select></td></tr>'; - - - echo "<input type=hidden name='SelectedTabs' VALUE=" . $SelectedTabs . ">"; - - echo '</td></tr></table>'; // close main table - - echo '<p><div class="centre"><input type=submit name=submit VALUE="' . _('Accept') . '"><input type=submit name=Cancel VALUE="' . _('Cancel') . '"></div>'; - - echo '</form>'; - -} // end if user wish to delete - - + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<br /><table class="selection">'; //Main table + + + + echo '<tr><td>' . _('Select Expense Code') . ':</td><td><select name="SelectedExpense">'; + + DB_free_result($result); + $SQL = "SELECT codeexpense, + description + FROM pcexpenses"; + + $result = DB_query($SQL,$db); + + while ($myrow = DB_fetch_array($result)) { + if (isset($_POST['SelectedExpense']) and $myrow['codeexpense']==$_POST['SelectedExpense']) { + echo '<option selected value="'; + } else { + echo '<option value="'; + } + echo $myrow['codeexpense'] . '">' . $myrow['codeexpense'] . ' - ' . $myrow['description'] . '</option>'; + + } //end while loop + + echo '</select></td></tr>'; + + + echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '">'; + + echo '</td></tr></table>'; // close main table + + echo '<p><div class="centre"><input type=submit name=submit VALUE="' . _('Accept') . '"><input type=submit name=Cancel VALUE="' . _('Cancel') . '"></div>'; + + echo '</form>'; + + } // end if user wish to delete } - - include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/PcTypeTabs.php =================================================================== --- trunk/PcTypeTabs.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/PcTypeTabs.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -1,8 +1,6 @@ <?php /* $Id$ */ -//$PageSecurity = 15; - include('includes/session.inc'); $title = _('Maintenance Of Petty Cash Type of Tabs'); include('includes/header.inc'); @@ -125,7 +123,7 @@ echo '<br>'; echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<p><div class="centre"><input type=submit name=return VALUE="' . _('Return to list of tab types') . '"></div>'; + echo '<p><div class="centre"><input type=submit name=return value="' . _('Return to list of tab types') . '"></div>'; echo '</form>'; include('includes/footer.inc'); exit; @@ -190,7 +188,7 @@ } if (! isset($_GET['delete'])) { - 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 '<p><table class=selection>'; //Main table @@ -220,19 +218,19 @@ // This is a new type so the user may volunteer a type code - echo "<table class=selection><tr><td>" . _('Code Of Type Of Tab') . ":</td><td><input type='Text' - " . (in_array('TypeTabCode',$Errors) ? 'class="inputerror"' : '' ) ." name='TypeTabCode'></td></tr>"; + echo '<table class="selection"><tr><td>' . _('Code Of Type Of Tab') . ':</td><td><input type="text" + ' . (in_array('TypeTabCode',$Errors) ? 'class="inputerror"' : '' ) .' name="TypeTabCode"></td></tr>'; } if (!isset($_POST['TypeTabDescription'])) { $_POST['TypeTabDescription']=''; } - echo "<tr><td>" . _('Description Of Type of Tab') . ":</td><td><input type='Text' name='TypeTabDescription' size=50 maxlength=49 value='" . $_POST['TypeTabDescription'] . "'></td></tr>"; + echo '<tr><td>' . _('Description Of Type of Tab') . ':</td><td><input type="text" name="TypeTabDescription" size="50" maxlength="49" value="' . $_POST['TypeTabDescription'] . '"></td></tr>'; echo '</td></tr></table>'; // close main table - echo '<p><div class="centre"><input type=submit name=submit VALUE="' . _('Accept') . '"><input type=submit name=Cancel VALUE="' . _('Cancel') . '"></div>'; + echo '<p><div class="centre"><input type=submit name=submit value="' . _('Accept') . '"><input type=submit name="Cancel" VALUE="' . _('Cancel') . '"></div>'; echo '</form>'; Modified: trunk/SelectSalesOrder.php =================================================================== --- trunk/SelectSalesOrder.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/SelectSalesOrder.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -417,10 +417,11 @@ if (!isset($_REQUEST['OrderNumber']) or $_REQUEST['OrderNumber']==''){ echo '<table class=selection>'; - echo '<tr><td>' . _('Order number') . ": </td><td><input type=text name='OrderNumber' maxlength=8 size=9></td><td>" . - _('From Stock Location') . ":</td><td><select name='StockLocation'> "; + echo '<tr><td>' . _('Order number') . ': </td> + <td><input type="text" name="OrderNumber" maxlength="8" size="9"></td> + <td>' . _('From Stock Location') . ':</td><td><select name="StockLocation"> '; - $sql = 'SELECT loccode, locationname FROM locations'; + $sql = "SELECT loccode, locationname FROM locations"; $resultStkLocs = DB_query($sql,$db); @@ -459,10 +460,10 @@ _('Add Sales Order') . '</a></td></tr></table>'; } - $SQL='SELECT categoryid, + $SQL="SELECT categoryid, categorydescription FROM stockcategory - ORDER BY categorydescription'; + ORDER BY categorydescription"; $result1 = DB_query($SQL,$db); Modified: trunk/StockLocTransfer.php =================================================================== --- trunk/StockLocTransfer.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/StockLocTransfer.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -1,8 +1,6 @@ <?php /* $Id$*/ -/* contributed by Chris Bice */ -//$PageSecurity = 11; include('includes/session.inc'); $title = _('Inventory Location Transfer Shipment'); include('includes/header.inc'); @@ -17,7 +15,7 @@ $result = DB_query("SELECT * FROM loctransfers WHERE reference='" . $_POST['Trf_ID'] . "'",$db); if (DB_num_rows($result)!=0){ $InputError = true; - $ErrorMessage = _('This transaction has already been entered') . '. ' . _('Please start over now').'<br>'; + $ErrorMessage = _('This transaction has already been entered') . '. ' . _('Please start over now').'<br />'; unset($_POST['submit']); unset($_POST['EnterMoreItems']); for ($i=$_POST['LinesCounter']-10;$i<$_POST['LinesCounter'];$i++){ @@ -33,19 +31,19 @@ $myrow = DB_fetch_row($result); if ($myrow[0]==0){ $InputError = True; - $ErrorMessage .= _('The part code entered of'). ' ' . $_POST['StockID' . $i] . ' '. _('is not set up in the database') . '. ' . _('Only valid parts can be entered for transfers'). '<br>'; + $ErrorMessage .= _('The part code entered of'). ' ' . $_POST['StockID' . $i] . ' '. _('is not set up in the database') . '. ' . _('Only valid parts can be entered for transfers'). '<br />'; $_POST['LinesCounter'] -= 10; } DB_free_result( $result ); if (!is_numeric($_POST['StockQTY' . $i])){ $InputError = True; - $ErrorMessage .= _('The quantity entered of'). ' ' . $_POST['StockQTY' . $i] . ' '. _('for part code'). ' ' . $_POST['StockID' . $i] . ' '. _('is not numeric') . '. ' . _('The quantity entered for transfers is expected to be numeric').'<br>'; + $ErrorMessage .= _('The quantity entered of'). ' ' . $_POST['StockQTY' . $i] . ' '. _('for part code'). ' ' . $_POST['StockID' . $i] . ' '. _('is not numeric') . '. ' . _('The quantity entered for transfers is expected to be numeric').'<br />'; $_POST['LinesCounter'] -= 10; } if ($_POST['StockQTY' . $i] <= 0){ $InputError = True; - $ErrorMessage .= _('The quantity entered for').' '. $_POST['StockID' . $i] . ' ' . _('is less than or equal to 0') . '. ' . _('Please correct this or remove the item').'<br>'; - + $ErrorMessage .= _('The quantity entered for').' '. $_POST['StockID' . $i] . ' ' . _('is less than or equal to 0') . '. ' . _('Please correct this or remove the item').'<br />'; + $_POST['LinesCounter'] -= 10; } // Only if stock exists at this location $result = DB_query("SELECT quantity FROM locstock WHERE stockid='" . $_POST['StockID' . $i] . "' and loccode='".$_POST['FromStockLocation']."'",$db); @@ -61,7 +59,7 @@ }//for all LinesCounter if ($TotalItems == 0){ $InputError = True; - $ErrorMessage .= _('You must enter at least 1 Stock Item to transfer').'<br>'; + $ErrorMessage .= _('You must enter at least 1 Stock Item to transfer').'<br />'; } /*Ship location and Receive location are different */ @@ -122,10 +120,10 @@ } if (isset($InputError) and $InputError==true){ - echo '<br>'; + echo '<br />'; prnMsg($ErrorMessage, 'error'); - echo '<br>'; + echo '<br />'; } @@ -215,8 +213,8 @@ $i++; } - echo '</table><br><div class="centre"> - <input type=hidden name="LinesCounter" value='. $i .'><input type=submit name="EnterMoreItems" value="'. _('Add More Items'). '"><input type=submit name="Submit" value="'. _('Create Transfer Shipment'). '"><br>'; + echo '</table><br /><div class="centre"> + <input type=hidden name="LinesCounter" value='. $i .'><input type=submit name="EnterMoreItems" value="'. _('Add More Items'). '"><input type=submit name="Submit" value="'. _('Create Transfer Shipment'). '"><br />'; echo '<script type="text/javascript">defaultControl(document.forms[0].StockID0);</script>'; echo '</form></div>'; include('includes/footer.inc'); Modified: trunk/TopItems.php =================================================================== --- trunk/TopItems.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/TopItems.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -11,9 +11,9 @@ if (!(isset($_POST['Search']))) { echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Top Sales Order Search') . '" alt="" />' . ' ' . _('Top Sales Order Search') . '</p>'; - echo "<form action=" . $_SERVER['PHP_SELF'] . '?' . SID . ' name="SelectCustomer" method=POST>'; + echo '<form action="' . $_SERVER['PHP_SELF'] . '?name="SelectCustomer" method="POST">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table cellpadding=3 colspan=4 class=selection>'; + echo '<table cellpadding="3" colspan="4" class="selection">'; //to view store location echo '<tr><td width="150">' . _('Select Location') . ' </td><td>:</td><td><select name=Location>'; $sql = "SELECT loccode, @@ -83,7 +83,7 @@ AND salesorderdetails.stkcode = stockmaster.stockid AND salesorders.debtorno = debtorsmaster.debtorno AND debtorsmaster.currcode = currencies.currabrev - AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' + AND salesorderdetails.actualdispatchdate >= '" . $FromDate . "' GROUP BY salesorderdetails.stkcode ORDER BY '" . $_POST['Sequence'] . "' DESC LIMIT " . $_POST['NumberOfTopItems'] . ""; @@ -104,7 +104,7 @@ AND salesorders.debtorno = debtorsmaster.debtorno AND debtorsmaster.currcode = currencies.currabrev AND debtorsmaster.typeid = '" . $_POST['Customers'] . "' - AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' + AND salesorderdetails.actualdispatchdate >= '" . $FromDate . "' GROUP BY salesorderdetails.stkcode ORDER BY '" . $_POST['Sequence'] . "' DESC LIMIT " . $_POST[NumberOfTopItems] . ""; @@ -112,44 +112,44 @@ //the situation if the customer type selected "All" if ($_POST['Customers'] == 'All') { $SQL = "SELECT salesorderdetails.stkcode, - SUM(salesorderdetails.qtyinvoiced) TotalInvoiced, - SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS ValueSales, - stockmaster.description, - stockmaster.units, - currencies.rate, - debtorsmaster.currcode, - stockmaster.decimalplaces - FROM salesorderdetails, salesorders, debtorsmaster,stockmaster, currencies - WHERE salesorderdetails.orderno = salesorders.orderno - AND salesorderdetails.stkcode = stockmaster.stockid - AND salesorders.debtorno = debtorsmaster.debtorno - AND debtorsmaster.currcode = currencies.currabrev - AND salesorders.fromstkloc = '" . $_POST['Location'] . "' - AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' - GROUP BY salesorderdetails.stkcode - ORDER BY " . $_POST['Sequence'] . " DESC - LIMIT " . $_POST['NumberOfTopItems'] . ""; + SUM(salesorderdetails.qtyinvoiced) TotalInvoiced, + SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS ValueSales, + stockmaster.description, + stockmaster.units, + currencies.rate, + debtorsmaster.currcode, + stockmaster.decimalplaces + FROM salesorderdetails, salesorders, debtorsmaster,stockmaster, currencies + WHERE salesorderdetails.orderno = salesorders.orderno + AND salesorderdetails.stkcode = stockmaster.stockid + AND salesorders.debtorno = debtorsmaster.debtorno + AND debtorsmaster.currcode = currencies.currabrev + AND salesorders.fromstkloc = '" . $_POST['Location'] . "' + AND salesorderdetails.actualdispatchdate >= '" . $FromDate . "' + GROUP BY salesorderdetails.stkcode + ORDER BY " . $_POST['Sequence'] . " DESC + LIMIT " . $_POST['NumberOfTopItems'] . ""; } else { //the situation if the location and customer type not selected "All" $SQL = "SELECT salesorderdetails.stkcode, - SUM(salesorderdetails.qtyinvoiced) TotalInvoiced, - SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS ValueSales, - stockmaster.description, - stockmaster.units, - currencies.rate, - debtorsmaster.currcode, - stockmaster.decimalplaces - FROM salesorderdetails, salesorders, debtorsmaster,stockmaster, currencies - WHERE salesorderdetails.orderno = salesorders.orderno - AND salesorderdetails.stkcode = stockmaster.stockid - AND salesorders.debtorno = debtorsmaster.debtorno - AND debtorsmaster.currcode = currencies.currabrev - AND salesorders.fromstkloc = '" . $_POST['Location'] . "' - AND debtorsmaster.typeid = '" . $_POST['Customers'] . "' - AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' - GROUP BY salesorderdetails.stkcode - ORDER BY '" . $_POST['Sequence'] . "' DESC - LIMIT " . $_POST['NumberOfTopItems'] . ""; + SUM(salesorderdetails.qtyinvoiced) TotalInvoiced, + SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS ValueSales, + stockmaster.description, + stockmaster.units, + currencies.rate, + debtorsmaster.currcode, + stockmaster.decimalplaces + FROM salesorderdetails, salesorders, debtorsmaster,stockmaster, currencies + WHERE salesorderdetails.orderno = salesorders.orderno + AND salesorderdetails.stkcode = stockmaster.stockid + AND salesorders.debtorno = debtorsmaster.debtorno + AND debtorsmaster.currcode = currencies.currabrev + AND salesorders.fromstkloc = '" . $_POST['Location'] . "' + AND debtorsmaster.typeid = '" . $_POST['Customers'] . "' + AND salesorderdetails.actualdispatchdate >= '" . $FromDate . "' + GROUP BY salesorderdetails.stkcode + ORDER BY '" . $_POST['Sequence'] . "' DESC + LIMIT " . $_POST['NumberOfTopItems'] . ""; } } } Modified: trunk/UserSettings.php =================================================================== --- trunk/UserSettings.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/UserSettings.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -97,7 +97,7 @@ } } -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($_POST['DisplayRecordsMax']) OR $_POST['DisplayRecordsMax']=='') { @@ -114,20 +114,19 @@ <input type="hidden" name="RealName" VALUE="'.$_SESSION['UsersRealName'].'"<td></tr>'; echo '<tr> - <td>' . _('Maximum Number of Records to Display') . ":</td> - <td><input type='Text' class='number' name='DisplayRecordsMax' size=3 maxlength=3 VALUE=" . $_POST['DisplayRecordsMax'] . " ></td> - </tr>"; + <td>' . _('Maximum Number of Records to Display') . ':</td> + <td><input type="text" class="number" name="DisplayRecordsMax" size="3" maxlength="3" value="' . $_POST['DisplayRecordsMax'] . '" ></td> + </tr>'; echo '<tr> - <td>' . _('Language') . ":</td> - <td><select name='Language'>"; + <td>' . _('Language') . ':</td> + <td><select name="Language">'; - $LangDirHandle = dir('locale/'); + $Languages = scandir('locale/', 0); - - while (false != ($LanguageEntry = $LangDirHandle->read())){ - + foreach ($Languages as $LanguageEntry){ + if (is_dir('locale/' . $LanguageEntry) AND $LanguageEntry != '..' AND $LanguageEntry != '.svn' Modified: trunk/WWW_Users.php =================================================================== --- trunk/WWW_Users.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/WWW_Users.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -574,13 +574,15 @@ <td>' . _('Language') . ':</td> <td><select name="UserLanguage">'; - $LangDirHandle = dir('locale/'); +$Languages = scandir('locale/', 0); +foreach ($Languages as $LanguageEntry){ + + if (is_dir('locale/' . $LanguageEntry) + AND $LanguageEntry != '..' + AND $LanguageEntry != '.svn' + AND $LanguageEntry!='.'){ -while (false != ($LanguageEntry = $LangDirHandle->read())){ - - if (is_dir('locale/' . $LanguageEntry) AND $LanguageEntry != '..' AND $LanguageEntry != 'CVS' AND $LanguageEntry!='.'){ - if (isset($_POST['UserLanguage']) and $_POST['UserLanguage'] == $LanguageEntry){ echo '<option selected value="' . $LanguageEntry . '">' . $LanguageEntry .'</option>'; } elseif (!isset($_POST['UserLanguage']) and $LanguageEntry == $DefaultLanguage) { @@ -591,6 +593,8 @@ } } + + echo '</select></td></tr>'; Modified: trunk/api/api_workorders.php =================================================================== --- trunk/api/api_workorders.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/api/api_workorders.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -44,7 +44,7 @@ } function VerifyRequiredByDate($RequiredByDate, $i, $Errors, $db) { - $sql="select confvalue from config where confname='DefaultDateFormat'"; + $sql="SELECT confvalue FROM config WHERE confname='DefaultDateFormat'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; @@ -77,7 +77,7 @@ } function VerifyStartDate($StartDate, $i, $Errors, $db) { - $sql="select confvalue from config where confname='DefaultDateFormat'"; + $sql="SELECT confvalue FROM config WHERE confname='DefaultDateFormat'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; @@ -310,37 +310,37 @@ '".$newqoh."', '".$cost."', '".$cost."')"; - $locstocksql='UPDATE locstock SET quantity = quantity + '.$Quantity." - WHERE loccode='". $Location."' - AND stockid='".$StockID."'"; + $locstocksql="UPDATE locstock SET quantity = quantity + " . $Quantity ." + WHERE loccode='". $Location."' + AND stockid='".$StockID."'"; $glupdatesql1="INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - amount, - narrative) - VALUES (28, - '".$TransactionNo. "', - '".$TranDate."', - '".GetPeriodFromTransactionDate($TranDate, sizeof($Errors), $Errors, $db)."', - '".$wipglact."', - '".$cost*-$Quantity."', - '".$StockID.' x '.$Quantity.' @ '.$cost."')"; + typeno, + trandate, + periodno, + account, + amount, + narrative) + VALUES (28, + '".$TransactionNo. "', + '".$TranDate."', + '".GetPeriodFromTransactionDate($TranDate, sizeof($Errors), $Errors, $db)."', + '".$wipglact."', + '".$cost*-$Quantity."', + '".$StockID.' x '.$Quantity.' @ '.$cost."')"; $glupdatesql2="INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - amount, - narrative) - VALUES (28, - '".$TransactionNo."', - '".$TranDate."', - '".GetPeriodFromTransactionDate($TranDate, sizeof($Errors), $Errors, $db)."', - '".$stockact."', - '".$cost*$Quantity."', - '".$StockID.' x '.$Quantity.' @ '.$cost."')"; + typeno, + trandate, + periodno, + account, + amount, + narrative) + VALUES (28, + '".$TransactionNo."', + '".$TranDate."', + '".GetPeriodFromTransactionDate($TranDate, sizeof($Errors), $Errors, $db)."', + '".$stockact."', + '".$cost*$Quantity."', + '".$StockID.' x '.$Quantity.' @ '.$cost."')"; $systypessql = "UPDATE systypes set typeno='".$TransactionNo."' where typeid=28"; $batchsql="UPDATE stockserialitems SET quantity=quantity-" . $Quantity. " WHERE stockid='".$StockID."' @@ -474,7 +474,7 @@ } $sql="SELECT wo FROM woitems - WHERE ".$Field." LIKE '%".$Criteria."%'"; + WHERE " . $Field ." " . LIKE . " '%".$Criteria."%'"; $result = DB_Query($sql, $db); $i=0; $WOList = array(); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/doc/Change.log.html 2011-04-11 10:33:34 UTC (rev 4546) @@ -1,6 +1,9 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p /> -<p>10/4/11 Tim: +<p>11/4/11 Tim: pcAuthorizeExpenses.php DB_escape_string(notes)</p> +<p>11/4/11 Tim: StockLocTransfer.php added $_POST['LinesCounter'] -= 10;</p> +<p>11/4/11 Tim/Phil: Use PHP 5 specific scandir to sort languages into alphabetic order for UserSettings and WWW_Users language selection</p> +<p>10/4/11 Tim: AddCustomerContacts.php use single field rather than * in SQL></p> <p>10/4/11 Tim: GLAccountInquiry.php show None if no tag selected</p> <p>10/4/11 Tim : PDFPrintLabel.php javascript fix</p> <p>10/4/11 Tim: Add perishable to StockTransfer.php and PDFStockTransfer</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-04-12 10:33:53
|
Revision: 4548 http://web-erp.svn.sourceforge.net/web-erp/?rev=4548&view=rev Author: daintree Date: 2011-04-12 10:33:45 +0000 (Tue, 12 Apr 2011) Log Message: ----------- tim launchpad fork Modified Paths: -------------- trunk/DeliveryDetails.php trunk/POReport.php trunk/Stocks.php trunk/TaxProvinces.php trunk/UnitsOfMeasure.php trunk/UpgradeDatabase.php trunk/WOSerialNos.php trunk/WorkOrderIssue.php trunk/Z_Upgrade3.10.php trunk/Z_Upgrade_3.09-3.10.php Modified: trunk/DeliveryDetails.php =================================================================== --- trunk/DeliveryDetails.php 2011-04-11 10:49:45 UTC (rev 4547) +++ trunk/DeliveryDetails.php 2011-04-12 10:33:45 UTC (rev 4548) @@ -1,7 +1,6 @@ <?php /* $Id$ */ -/* $Revision: 1.76 $ */ /* This is where the delivery details are confirmed/entered/modified and the order committed to the database once the place order/modify order button is hit. @@ -81,13 +80,13 @@ /* If (strlen($_POST['BrAdd3'])==0 OR !isset($_POST['BrAdd3'])){ $InputErrors =1; - echo "<br>A region or city must be entered.<br>"; + echo "<br />A region or city must be entered.<br />"; } Maybe appropriate in some installations but not here If (strlen($_POST['BrAdd2'])<=1){ $InputErrors =1; - echo "<br>You should enter the suburb in the box provided. Orders cannot be accepted without a valid suburb being entered.<br>"; + echo "<br />You should enter the suburb in the box provided. Orders cannot be accepted without a valid suburb being entered.<br />"; } */ @@ -111,7 +110,7 @@ elseif (Date1GreaterThanDate2(Date($_SESSION['DefaultDateFormat'],$EarliestDispatch), $_POST['DeliveryDate'])){ $InputErrors =1; - echo '<br><b>' . _('The delivery details cannot be updated because you are attempting to set the date the order is to be dispatched earlier than is possible. No dispatches are made on Saturday and Sunday. Also, the dispatch cut off time is') . $_SESSION['DispatchCutOffTime'] . _(':00 hrs. Orders placed after this time will be dispatched the following working day.'); + echo '<br /><b>' . _('The delivery details cannot be updated because you are attempting to set the date the order is to be dispatched earlier than is possible. No dispatches are made on Saturday and Sunday. Also, the dispatch cut off time is') . $_SESSION['DispatchCutOffTime'] . _(':00 hrs. Orders placed after this time will be dispatched the following working day.'); } */ @@ -153,7 +152,7 @@ prnMsg(_('The branch details for branch code') . ': ' . $_SESSION['Items'.$identifier]->Branch . ' ' . _('against customer code') . ': ' . $_POST['Select'] . ' ' . _('could not be retrieved') . '. ' . _('Check the set up of the customer and branch'),'error'); if ($debug==1){ - echo '<br>' . _('The SQL that failed to get the branch details was') . ':<br>' . $sql; + echo '<br />' . _('The SQL that failed to get the branch details was') . ':<br />' . $sql; } include('includes/footer.inc'); exit; @@ -280,7 +279,7 @@ } If ($_POST['FreightCost'] != $OldFreightCost && $_SESSION['DoFreightCalc']==True){ $OK_to_PROCESS = 0; - prnMsg(_('The freight charge has been updated') . '. ' . _('Please reconfirm that the order and the freight charges are acceptable and then confirm the order again if OK') .' <br> '. _('The new freight cost is') .' ' . $_POST['FreightCost'] . ' ' . _('and the previously calculated freight cost was') .' '. $OldFreightCost,'warn'); + prnMsg(_('The freight charge has been updated') . '. ' . _('Please reconfirm that the order and the freight charges are acceptable and then confirm the order again if OK') .' <br /> '. _('The new freight cost is') .' ' . $_POST['FreightCost'] . ' ' . _('and the previously calculated freight cost was') .' '. $OldFreightCost,'warn'); } else { /*check the customer's payment terms */ @@ -417,7 +416,7 @@ AND $_SESSION['AutoCreateWOs']==1 AND $_SESSION['Items'.$identifier]->Quotation!=1){ //oh yeah its all on! - echo '<br>'; + echo '<br />'; //now get the data required to test to see if we need to make a new WO $QOHResult = DB_query("SELECT SUM(quantity) FROM locstock WHERE stockid='" . $StockItem->StockID . "'",$db); @@ -559,7 +558,7 @@ } /* end inserted line items into sales order details */ $result = DB_Txn_Commit($db); - echo '<br>'; + echo '<br />'; if ($_SESSION['Items'.$identifier]->Quotation==1){ prnMsg(_('Quotation Number') . ' ' . $OrderNo . ' ' . _('has been entered'),'success'); } else { @@ -571,19 +570,44 @@ if ($_POST['Quotation']==0) { /*then its not a quotation its a real order */ - echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td>' . ' ' . '<a target="_blank" href="' . $rootpath . '/PrintCustOrder.php?identifier='.$identifier . '&TransNo=' . $OrderNo . '">'. _('Print packing slip') . ' (' . _('Preprinted stationery') . ')' .'</a></td></tr>'; - echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td>' . ' ' . '<a target="_blank" href="' . $rootpath . '/PrintCustOrder_generic.php?identifier='.$identifier . '&TransNo=' . $OrderNo . '">'. _('Print packing slip') . ' (' . _('Laser') . ')' .'</a></td></tr>'; + echo '<br /><table class=selection> + <tr> + <td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td> + <td>' . ' ' . '<a target="_blank" href="' . $rootpath . '/PrintCustOrder.php?identifier='.$identifier . '&TransNo=' . $OrderNo . '">'. _('Print packing slip') . ' (' . _('Preprinted stationery') . ')' .'</a></td> + </tr>'; + echo '<tr> + <td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td> + <td>' . ' ' . '<a target="_blank" href="' . $rootpath . '/PrintCustOrder_generic.php?identifier='.$identifier . '&TransNo=' . $OrderNo . '">'. _('Print packing slip') . ' (' . _('Laser') . ')' .'</a></td> + </tr>'; - echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Invoice') . '" alt=""></td><td>' . ' ' . '<a href="' . $rootpath . '/ConfirmDispatch_Invoice.php?identifier='.$identifier . '&OrderNumber=' . $OrderNo .'">'. _('Confirm Dispatch and Produce Invoice') .'</a></td></tr>'; - //Add option to Print Sales Orders or Proforma invoice - echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/pdf.png" title="' . _('Sales Order') . '" alt=""></td><td>' . ' ' . '<a href="' . $rootpath . '/PrintSalesOrder_generic.php?identifier='.$identifier . '&TransNo=' . $OrderNo .'">'. _('Print Sales Order / Pro-forma Invoice') .'</a></td></tr></table>'; + echo '<tr> + <td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Invoice') . '" alt=""></td> + <td>' . ' ' . '<a href="' . $rootpath . '/ConfirmDispatch_Invoice.php?identifier='.$identifier . '&OrderNumber=' . $OrderNo .'">'. _('Confirm Dispatch and Produce Invoice') .'</a></td> + </tr>'; + + echo '</table>'; } else { /*link to print the quotation */ - echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Order') . '" alt=""></td><td>' . ' ' . '<a href="' . $rootpath . '/PDFQuotation.php?' . SID .'identifier='.$identifier . '&QuotationNo=' . $OrderNo . '">'. _('Print Quotation (Landscape)') .'</a></td></tr></table>'; - echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Order') . '" alt=""></td><td>' . ' ' . '<a href="' . $rootpath . '/PDFQuotationPortrait.php?' . SID .'identifier='.$identifier . '&QuotationNo=' . $OrderNo . '">'. _('Print Quotation (Portrait)') .'</a></td></tr></table>'; + echo '<br /><table class=selection> + <tr> + <td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Order') . '" alt=""></td> + <td>' . ' ' . '<a href="' . $rootpath . '/PDFQuotation.php?' . SID .'identifier='.$identifier . '&QuotationNo=' . $OrderNo . '">'. _('Print Quotation (Landscape)') .'</a></td> + </tr> + </table>'; + echo '<br /><table class=selection> + <tr> + <td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Order') . '" alt=""></td> + <td>' . ' ' . '<a href="' . $rootpath . '/PDFQuotationPortrait.php?' . SID .'identifier='.$identifier . '&QuotationNo=' . $OrderNo . '">'. _('Print Quotation (Portrait)') .'</a></td> + </tr> + </table>'; } - echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Order') . '" alt=""></td><td>' . ' ' . '<a href="'. $rootpath .'/SelectOrderItems.php?identifier='.$identifier . '&NewOrder=Yes">'. _('Add Another Sales Order') .'</a></td></tr></table>'; + echo '<br /><table class=selection> + <tr> + <td><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Order') . '" alt=""></td> + <td>' . ' ' . '<a href="'. $rootpath .'/SelectOrderItems.php?identifier='.$identifier . '&NewOrder=Yes">'. _('Add Another Sales Order') .'</a></td> + </tr> + </table>'; } else { /*its a customer logon so thank them */ prnMsg(_('Thank you for your business'),'success'); @@ -747,7 +771,7 @@ prnMsg(_('Order Number') .' ' . $_SESSION['ExistingOrder'] . ' ' . _('has been updated'),'success'); - echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td><a href="' . $rootpath . '/PrintCustOrder.php?identifier='.$identifier . '&TransNo=' . $_SESSION['ExistingOrder'] . '">'. _('Print packing slip - pre-printed stationery') .'</a></td></tr>'; + echo '<br /><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td><a href="' . $rootpath . '/PrintCustOrder.php?identifier='.$identifier . '&TransNo=' . $_SESSION['ExistingOrder'] . '">'. _('Print packing slip - pre-printed stationery') .'</a></td></tr>'; echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td><a target="_blank" href="' . $rootpath . '/PrintCustOrder_generic.php?identifier='.$identifier . '&TransNo=' . $_SESSION['ExistingOrder'] . '">'. _('Print packing slip') . ' (' . _('Laser') . ')' .'</a></td></tr>'; echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Invoice') . '" alt=""></td><td><a href="' . $rootpath .'/ConfirmDispatch_Invoice.php?identifier='.$identifier . '&OrderNumber=' . $_SESSION['ExistingOrder'] . '">'. _('Confirm Order Delivery Quantities and Produce Invoice') .'</a></td></tr>'; echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Order') . '" alt=""></td><td><a href="' . $rootpath .'/SelectSalesOrder.php?identifier='.$identifier . '">'. _('Select A Different Order') .'</a></td></tr></table>'; @@ -833,7 +857,7 @@ $DisplayVolume = number_format($_SESSION['Items'.$identifier]->totalVolume,2); $DisplayWeight = number_format($_SESSION['Items'.$identifier]->totalWeight,2); - echo '<br><table><tr class="EvenTableRows"> + echo '<br /><table><tr class="EvenTableRows"> <td>'. _('Total Weight') .':</td> <td>'.$DisplayWeight.'</td> <td>'. _('Total Volume') .':</td> @@ -903,7 +927,7 @@ } -echo '<br><table class=selection><tr> +echo '<br /><table class=selection><tr> <td>'. _('Deliver To') .':</td> <td><input type=text size=42 maxlength=40 name="DeliverTo" value="' . $_SESSION['Items'.$identifier]->DeliverTo . '"></td> </tr>'; @@ -1082,13 +1106,13 @@ echo '</table>'; -echo '<br><div class="centre"><input type=submit name="BackToLineDetails" value="' . _('Modify Order Lines') . '"><br>'; +echo '<br /><div class="centre"><input type=submit name="BackToLineDetails" value="' . _('Modify Order Lines') . '"><br />'; if ($_SESSION['ExistingOrder']==0){ - echo '<br><br><input type=submit name="ProcessOrder" value="' . _('Place Order') . '">'; - echo '<br><br><input type=submit name="MakeRecurringOrder" VALUE="' . _('Create Recurring Order') . '">'; + echo '<br /><br /><input type=submit name="ProcessOrder" value="' . _('Place Order') . '">'; + echo '<br /><br /><input type=submit name="MakeRecurringOrder" VALUE="' . _('Create Recurring Order') . '">'; } else { - echo '<br><input type=submit name="ProcessOrder" VALUE="' . _('Commit Order Changes') . '">'; + echo '<br /><input type=submit name="ProcessOrder" VALUE="' . _('Commit Order Changes') . '">'; } echo '</div></form>'; Modified: trunk/POReport.php =================================================================== --- trunk/POReport.php 2011-04-11 10:49:45 UTC (rev 4547) +++ trunk/POReport.php 2011-04-12 10:33:45 UTC (rev 4548) @@ -40,9 +40,9 @@ $SupplierNameOp = $_POST['SupplierNameOp']; - // Save $_POST['SummaryType'] in $savesummarytype because change $_POST['SummaryType'] when + // Save $_POST['SummaryType'] in $SaveSummaryType because change $_POST['SummaryType'] when // create $sql - $savesummarytype = $_POST['SummaryType']; + $SaveSummaryType = $_POST['SummaryType']; } if (isset($_POST['SupplierName'])){ @@ -60,11 +60,11 @@ if (isset($_POST['submit'])) { echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p>'; - submit($db,$PartNumber,$PartNumberOp,$SupplierId,$SupplierIdOp,$SupplierName,$SupplierNameOp,$savesummarytype); + submit($db,$PartNumber,$PartNumberOp,$SupplierId,$SupplierIdOp,$SupplierName,$SupplierNameOp,$SaveSummaryType); } else if (isset($_POST['submitcsv'])) { echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p>'; - submitcsv($db,$PartNumber,$PartNumberOp,$SupplierId,$SupplierIdOp,$SupplierName,$SupplierNameOp,$savesummarytype); + submitcsv($db,$PartNumber,$PartNumberOp,$SupplierId,$SupplierIdOp,$SupplierName,$SupplierNameOp,$SaveSummaryType); } else { echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . '</img>' . $title.'</p>'; @@ -73,7 +73,7 @@ //####_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT#### -function submit(&$db,$PartNumber,$PartNumberOp,$SupplierId,$SupplierIdOp,$SupplierName,$SupplierNameOp,$savesummarytype) +function submit(&$db,$PartNumber,$PartNumberOp,$SupplierId,$SupplierIdOp,$SupplierName,$SupplierNameOp,$SaveSummaryType) { //initialize no input errors @@ -94,71 +94,71 @@ } # Add more to WHERE statement, if user entered something for the part number,supplierid, name - $wherepart = ' '; + $WherePart = ' '; if (strlen($PartNumber) > 0 && $PartNumberOp == 'LIKE') { $PartNumber = $PartNumber . '%'; } else { $PartNumberOp = '='; } if (strlen($PartNumber) > 0) { - $wherepart = " AND purchorderdetails.itemcode " . $PartNumberOp . " '" . $PartNumber . "' "; + $WherePart = " AND purchorderdetails.itemcode " . $PartNumberOp . " '" . $PartNumber . "' "; } else { - $wherepart=' '; + $WherePart=' '; } - $wheresupplierid = ' '; + $WhereSupplierID = ' '; if ($SupplierIdOp == 'LIKE') { $SupplierId = $SupplierId . '%'; } else { $SupplierIdOp = '='; } if (strlen($SupplierId) > 0) { - $wheresupplierid = " AND purchorders.supplierno " . $SupplierIdOp . " '" . $SupplierId . "' "; + $WhereSupplierID = " AND purchorders.supplierno " . $SupplierIdOp . " '" . $SupplierId . "' "; } else { - $wheresupplierid=' '; + $WhereSupplierID=' '; } - $wheresuppliername = ' '; + $WhereSupplierName = ' '; if (strlen($SupplierName) > 0 && $SupplierNameOp == 'LIKE') { $SupplierName = $SupplierName . '%'; } else { $SupplierNameOp = '='; } if (strlen($SupplierName) > 0) { - $wheresuppliername = " AND suppliers.suppname " . $SupplierNameOp . " '" . $SupplierName . "' "; + $WhereSupplierName = " AND suppliers.suppname " . $SupplierNameOp . " '" . $SupplierName . "' "; } else { - $wheresuppliername=' '; + $WhereSupplierName=' '; } if (strlen($_POST['OrderNo']) > 0) { - $whereorderno = ' AND purchorderdetails.orderno = ' . " '" . $_POST['OrderNo'] . "' "; + $WhereOrderNo = ' AND purchorderdetails.orderno = ' . " '" . $_POST['OrderNo'] . "' "; } else { - $whereorderno=' '; + $WhereOrderNo=' '; } - $wherelinestatus = ' '; + $WhereLineStatus = ' '; # Had to use IF statement instead of comparing 'linestatus' to $_POST['LineStatus'] #in WHERE clause because the WHERE clause didn't recognize # that had used the IF statement to create a field called linestatus if ($_POST['LineStatus'] != 'All') { if ($_POST['DateType'] == 'Order') { - $wherelinestatus = " AND IF(purchorderdetails.quantityord = purchorderdetails.qtyinvoiced || + $WhereLineStatus = " AND IF(purchorderdetails.quantityord = purchorderdetails.qtyinvoiced || purchorderdetails.completed = 1,'Completed','Open') = '" . $_POST['LineStatus'] . "'"; } else { - $wherelinestatus = " AND IF(grns.qtyrecd - grns.quantityinv <> 0,'Open','Completed') = '" + $WhereLineStatus = " AND IF(grns.qtyrecd - grns.quantityinv <> 0,'Open','Completed') = '" . $_POST['LineStatus'] . "'"; } } - $wherecategory = ' '; + $WhereCategory = ' '; if ($_POST['Category'] != 'All') { - $wherecategory = " AND stockmaster.categoryid = '" . $_POST['Category'] . "'"; + $WhereCategory = " AND stockmaster.categoryid = '" . $_POST['Category'] . "'"; } if ($InputError !=1) { - $fromdate = FormatDateForSQL($_POST['FromDate']); - $todate = FormatDateForSQL($_POST['ToDate']); + $FromDate = FormatDateForSQL($_POST['FromDate']); + $ToDate = FormatDateForSQL($_POST['ToDate']); if ($_POST['ReportType'] == 'Detail') { if ($_POST['DateType'] == 'Order') { $sql = "SELECT purchorderdetails.orderno, @@ -179,14 +179,14 @@ LEFT JOIN purchorders ON purchorders.orderno=purchorderdetails.orderno LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory ORDER BY " . $_POST['SortBy']; } else { // Selects by delivery date from grns @@ -208,14 +208,14 @@ LEFT JOIN purchorders ON purchorders.orderno=purchorderdetails.orderno LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory ORDER BY " . $_POST['SortBy']; } } else { @@ -242,14 +242,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ',stockmaster.decimalplaces, stockmaster.description @@ -267,14 +267,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ',purchorders.supplierno, suppliers.suppname @@ -291,14 +291,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ',purchorders.supplierno, suppliers.suppname @@ -315,14 +315,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ', monthname ORDER BY ' . $orderby; @@ -338,14 +338,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ', categorydescription ORDER BY ' . $orderby; @@ -365,14 +365,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ', stockmaster.description ORDER BY ' . $orderby; @@ -390,14 +390,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ', purchorders.supplierno, suppliers.suppname @@ -415,14 +415,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ', purchorders.supplierno, suppliers.suppname @@ -440,14 +440,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ',monthname ORDER BY ' . $orderby; @@ -464,14 +464,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ',categorydescription ORDER BY ' . $orderby; @@ -482,35 +482,35 @@ $ErrMsg = _('The SQL to find the parts selected failed with the message'); $result = DB_query($sql,$db,$ErrMsg); $ctr = 0; - $totalqty = 0; - $totalextcost = 0; - $totalextprice = 0; - $totalinvqty = 0; + $TotalQty = 0; + $TotalExtCost = 0; + $TotalExtPrice = 0; + $TotalInvQty = 0; - // Create array for summary type to display in header. Access it with $savesummarytype - $summary_array["orderno"] = _('Order Number'); - $summary_array["itemcode"] = _('Part Number'); - $summary_array["extprice"] = _('Extended Price'); - $summary_array["supplierno"] = _('Customer Number'); - $summary_array["suppname"] = _('Customer Name'); - $summary_array["month"] = _('Month'); - $summary_array["categoryid"] = _('Stock Category'); + // Create array for summary type to display in header. Access it with $SaveSummaryType + $Summary_Array["orderno"] = _('Order Number'); + $Summary_Array["itemcode"] = _('Part Number'); + $Summary_Array["extprice"] = _('Extended Price'); + $Summary_Array["supplierno"] = _('Customer Number'); + $Summary_Array["suppname"] = _('Customer Name'); + $Summary_Array["month"] = _('Month'); + $Summary_Array["categoryid"] = _('Stock Category'); // Create array for sort for detail report to display in header - $detail_array['purchorderdetails.orderno'] = _('Order Number'); - $detail_array['purchorderdetails.itemcode'] = _('Part Number'); - $detail_array['suppliers.supplierid,purchorderdetails.orderno'] = _('Supplier Number'); - $detail_array['suppliers.suppname,suppliers.supplierid,purchorderdetails.orderno'] = _('Supplier Name'); + $Detail_Array['purchorderdetails.orderno'] = _('Order Number'); + $Detail_Array['purchorderdetails.itemcode'] = _('Part Number'); + $Detail_Array['suppliers.supplierid,purchorderdetails.orderno'] = _('Supplier Number'); + $Detail_Array['suppliers.suppname,suppliers.supplierid,purchorderdetails.orderno'] = _('Supplier Name'); // Display Header info echo '<table class=selection>'; if ($_POST['ReportType'] == 'Summary') { - $sortby_display = $summary_array[$savesummarytype]; + $SortBy_Display = $Summary_Array[$SaveSummaryType]; } else { - $sortby_display = $detail_array[$_POST['SortBy']]; + $SortBy_Display = $Detail_Array[$_POST['SortBy']]; } echo '<tr><th colspan=2><font size=3 color=navy>'._('Header Details').'</font></th></tr>'; - echo '<tr><td>' . _('Purchase Order Report') . '</td><td>' . $_POST['ReportType'] . ' By '.$sortby_display .'</td></tr>'; + echo '<tr><td>' . _('Purchase Order Report') . '</td><td>' . $_POST['ReportType'] . ' By '.$SortBy_Display .'</td></tr>'; echo '<tr><td>' . _('Date Type') . '</td><td>' . $_POST['DateType'] . '</tr>'; echo '<tr><td>' . _('Date Range') . '</td><td>' . $_POST['FromDate'] . _(' To ') . $_POST['ToDate'] . '</td></tr>'; if (strlen(trim($PartNumber)) > 0) { @@ -567,11 +567,11 @@ $myrow['linestatus'], ConvertSQLDate($myrow['deliverydate']), $myrow['description']); - $lastdecimalplaces = $myrow['decimalplaces']; - $totalqty += $myrow['quantityord']; - $totalextcost += $myrow['extcost']; - $totalextprice += $myrow['extprice']; - $totalinvqty += $myrow['qtyinvoiced']; + $LastDecimalPlaces = $myrow['decimalplaces']; + $TotalQty += $myrow['quantityord']; + $TotalExtCost += $myrow['extcost']; + $TotalExtPrice += $myrow['extprice']; + $TotalInvQty += $myrow['qtyinvoiced']; } //END WHILE LIST LOOP // Print totals printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td class=number>%s</td><td class=number>%s</td> @@ -581,10 +581,10 @@ ' ', ' ', ' ', - number_format($totalqty,2), - number_format($totalextcost,2), - number_format($totalextprice,2), - number_format($totalinvqty,2), + number_format($TotalQty,2), + number_format($TotalExtCost,2), + number_format($TotalExtPrice,2), + number_format($TotalInvQty,2), ' ', ' '); } else { @@ -629,11 +629,11 @@ $myrow['linestatus'], ConvertSQLDate($myrow['deliverydate']), $myrow['description']); - $lastdecimalplaces = $myrow['decimalplaces']; - $totalqty += $myrow['quantityord']; - $totalextcost += $myrow['extcost']; - $totalextprice += $myrow['extprice']; - $totalinvqty += $myrow['qtyinvoiced']; + $LastDecimalPlaces = $myrow['decimalplaces']; + $TotalQty += $myrow['quantityord']; + $TotalExtCost += $myrow['extcost']; + $TotalExtPrice += $myrow['extprice']; + $TotalInvQty += $myrow['qtyinvoiced']; } //END WHILE LIST LOOP // Print totals printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td class=number>%s</td><td class=number> @@ -643,10 +643,10 @@ ' ', ' ', ' ', - number_format($totalqty,$lastdecimalplaces), - number_format($totalextcost,2), - number_format($totalextprice,2), - number_format($totalinvqty,$lastdecimalplaces), + number_format($TotalQty,$LastDecimalPlaces), + number_format($TotalExtCost,2), + number_format($TotalExtPrice,2), + number_format($TotalInvQty,$LastDecimalPlaces), ' ', ' '); } @@ -724,23 +724,23 @@ number_format($myrow['extprice'],2), $myrow['qtyinvoiced'], $suppname); - $totalqty += $myrow['quantityord']; - $totalextcost += $myrow['extcost']; - $totalextprice += $myrow['extprice']; - $totalinvqty += $myrow['qtyinvoiced']; + $TotalQty += $myrow['quantityord']; + $TotalExtCost += $myrow['extcost']; + $TotalExtPrice += $myrow['extprice']; + $TotalInvQty += $myrow['qtyinvoiced']; } //END WHILE LIST LOOP // Print totals printf("<tr><td>%s</td><td>%s</td><td class=number>%s</td><td class=number>%s</td><td class=number>%s</td><td class=number>%s</td></tr>", 'Totals', _('Lines - ') . $linectr, - $totalqty, - number_format($totalextcost,2), - number_format($totalextprice,2), - $totalinvqty, + $TotalQty, + number_format($TotalExtCost,2), + number_format($TotalExtPrice,2), + $TotalInvQty, ' '); } // End of if ($_POST['ReportType'] echo '</table>'; - echo "<form action=" . $_SERVER['PHP_SELF'] . "?" . SID ." method=post>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo "<input type=hidden name='ReportType' value=".$_POST['ReportType'].">"; echo "<input type=hidden name='DateType' value=".$_POST['DateType'].">"; @@ -758,13 +758,19 @@ echo "<input type=hidden name='SortBy' value=".$_POST['SortBy'].">"; echo "<input type=hidden name='SummaryType' value=".$_POST['SummaryType'].">"; echo "<br><div class=centre><input type='submit' name='submitcsv' value='" . _('Export as csv file') . "'></div></td>"; - echo "</form>"; + echo '</form>'; } // End of if inputerror != 1 } // End of function submit() //####_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT#### -function submitcsv(&$db,$PartNumber,$PartNumberOp,$SupplierId,$SupplierIdOp,$SupplierName,$SupplierNameOp,$savesummarytype) -{ +function submitcsv(&$db, + $PartNumber, + $PartNumberOp, + $SupplierId, + $SupplierIdOp, + $SupplierName, + $SupplierNameOp, + $SaveSummaryType) { //initialize no input errors $InputError = 0; @@ -784,71 +790,71 @@ } # Add more to WHERE statement, if user entered something for the part number,supplierid, name - $wherepart = ' '; + $WherePart = ' '; if (strlen($PartNumber) > 0 && $PartNumberOp == 'LIKE') { $PartNumber = $PartNumber . '%'; } else { $PartNumberOp = '='; } if (strlen($PartNumber) > 0) { - $wherepart = " AND purchorderdetails.itemcode " . $PartNumberOp . " '" . $PartNumber . "' "; + $WherePart = " AND purchorderdetails.itemcode " . $PartNumberOp . " '" . $PartNumber . "' "; } else { - $wherepart=' '; + $WherePart=' '; } - $wheresupplierid = ' '; + $WhereSupplierID = ' '; if ($SupplierIdOp == 'LIKE') { $SupplierId = $SupplierId . '%'; } else { $SupplierIdOp = '='; } if (strlen($SupplierId) > 0) { - $wheresupplierid = " AND purchorders.supplierno " . $SupplierIdOp . " '" . $SupplierId . "' "; + $WhereSupplierID = " AND purchorders.supplierno " . $SupplierIdOp . " '" . $SupplierId . "' "; } else { - $wheresupplierid=' '; + $WhereSupplierID=' '; } - $wheresuppliername = ' '; + $WhereSupplierName = ' '; if (strlen($SupplierName) > 0 && $SupplierNameOp == 'LIKE') { $SupplierName = $SupplierName . '%'; } else { $SupplierNameOp = '='; } if (strlen($SupplierName) > 0) { - $wheresuppliername = " AND suppliers.suppname " . $SupplierNameOp . " '" . $SupplierName . "' "; + $WhereSupplierName = " AND suppliers.suppname " . $SupplierNameOp . " '" . $SupplierName . "' "; } else { - $wheresuppliername=' '; + $WhereSupplierName=' '; } if (strlen($_POST['OrderNo']) > 0) { - $whereorderno = ' AND purchorderdetails.orderno = ' . " '" . $_POST['OrderNo'] . "' "; + $WhereOrderNo = ' AND purchorderdetails.orderno = ' . " '" . $_POST['OrderNo'] . "' "; } else { - $whereorderno=' '; + $WhereOrderNo=' '; } - $wherelinestatus = ' '; + $WhereLineStatus = ' '; # Had to use IF statement instead of comparing 'linestatus' to $_POST['LineStatus'] #in WHERE clause because the WHERE clause didn't recognize # that had used the IF statement to create a field called linestatus if ($_POST['LineStatus'] != 'All') { if ($_POST['DateType'] == 'Order') { - $wherelinestatus = " AND IF(purchorderdetails.quantityord = purchorderdetails.qtyinvoiced || + $WhereLineStatus = " AND IF(purchorderdetails.quantityord = purchorderdetails.qtyinvoiced || purchorderdetails.completed = 1,'Completed','Open') = '" . $_POST['LineStatus'] . "'"; } else { - $wherelinestatus = " AND IF(grns.qtyrecd - grns.quantityinv <> 0,'Open','Completed') = '" + $WhereLineStatus = " AND IF(grns.qtyrecd - grns.quantityinv <> 0,'Open','Completed') = '" . $_POST['LineStatus'] . "'"; } } - $wherecategory = ' '; + $WhereCategory = ' '; if ($_POST['Category'] != 'All') { - $wherecategory = " AND stockmaster.categoryid = '" . $_POST['Category'] . "'"; + $WhereCategory = " AND stockmaster.categoryid = '" . $_POST['Category'] . "'"; } if ($InputError !=1) { - $fromdate = FormatDateForSQL($_POST['FromDate']); - $todate = FormatDateForSQL($_POST['ToDate']); + $FromDate = FormatDateForSQL($_POST['FromDate']); + $ToDate = FormatDateForSQL($_POST['ToDate']); if ($_POST['ReportType'] == 'Detail') { if ($_POST['DateType'] == 'Order') { $sql = "SELECT purchorderdetails.orderno, @@ -869,14 +875,14 @@ LEFT JOIN purchorders ON purchorders.orderno=purchorderdetails.orderno LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory ORDER BY " . $_POST['SortBy']; } else { // Selects by delivery date from grns @@ -898,14 +904,14 @@ LEFT JOIN purchorders ON purchorders.orderno=purchorderdetails.orderno LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory ORDER BY " . $_POST['SortBy']; } } else { @@ -932,14 +938,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ',stockmaster.decimalplaces, stockmaster.description @@ -957,14 +963,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ',purchorders.supplierno, suppliers.suppname @@ -981,14 +987,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ',purchorders.supplierno, suppliers.suppname @@ -1005,14 +1011,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ', monthname ORDER BY ' . $orderby; @@ -1028,14 +1034,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ', categorydescription ORDER BY ' . $orderby; @@ -1055,14 +1061,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ', stockmaster.description ORDER BY ' . $orderby; @@ -1080,14 +1086,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ', purchorders.supplierno, suppliers.suppname @@ -1105,14 +1111,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ', purchorders.supplierno, suppliers.suppname @@ -1130,14 +1136,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ',monthname ORDER BY ' . $orderby; @@ -1154,14 +1160,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ',categorydescription ORDER BY ' . $orderby; @@ -1172,34 +1178,34 @@ $ErrMsg = _('The SQL to find the parts selected failed with the message'); $result = DB_query($sql,$db,$ErrMsg); $ctr = 0; - $totalqty = 0; - $totalextcost = 0; - $totalextprice = 0; - $totalinvqty = 0; + $TotalQty = 0; + $TotalExtCost = 0; + $TotalExtPrice = 0; + $TotalInvQty = 0; $FileName = $_SESSION['reports_dir'] .'/POReport.csv'; $FileHandle = fopen($FileName, 'w'); - // Create array for summary type to display in header. Access it with $savesummarytype - $summary_array["orderno"] = _('Order Number'); - $summary_array["itemcode"] = _('Part Number'); - $summary_array["extprice"] = _('Extended Price'); - $summary_array["supplierno"] = _('Customer Number'); - $summary_array["suppname"] = _('Customer Name'); - $summary_array["month"] = _('Month'); - $summary_array["categoryid"] = _('Stock Category'); + // Create array for summary type to display in header. Access it with $SaveSummaryType + $Summary_Array['orderno'] = _('Order Number'); + $Summary_Array['itemcode'] = _('Part Number'); + $Summary_Array['extprice'] = _('Extended Price'); + $Summary_Array['supplierno'] = _('Customer Number'); + $Summary_Array['suppname'] = _('Customer Name'); + $Summary_Array['month'] = _('Month'); + $Summary_Array['categoryid'] = _('Stock Category'); // Create array for sort for detail report to display in header - $detail_array['purchorderdetails.orderno'] = _('Order Number'); - $detail_array['purchorderdetails.itemcode'] = _('Part Number'); - $detail_array['suppliers.supplierid,purchorderdetails.orderno'] = _('Supplier Number'); - $detail_array['suppliers.suppname,suppliers.supplierid,purchorderdetails.orderno'] = _('Supplier Name'); + $Detail_Array['purchorderdetails.orderno'] = _('Order Number'); + $Detail_Array['purchorderdetails.itemcode'] = _('Part Number'); + $Detail_Array['suppliers.supplierid,purchorderdetails.orderno'] = _('Supplier Number'); + $Detail_Array['suppliers.suppname,suppliers.supplierid,purchorderdetails.orderno'] = _('Supplier Name'); // Display Header info if ($_POST['ReportType'] == 'Summary') { - $sortby_display = $summary_array[$savesummarytype]; + $SortBy_Display = $Summary_Array[$SaveSummaryType]; } else { - $sortby_display = $detail_array[$_POST['SortBy']]; + $SortBy_Display = $Detail_Array[$_POST['SortBy']]; } - fprintf($FileHandle, '"'. _('Purchase Order Report') . '","' . $_POST['ReportType'] . ' '._('By').' '.$sortby_display ."\n"); + fprintf($FileHandle, '"'. _('Purchase Order Report') . '","' . $_POST['ReportType'] . ' '._('By').' '.$SortBy_Display ."\n"); fprintf($FileHandle, '"'. _('Date Type') . '","' . $_POST['DateType'] . '"'. "\n"); fprintf($FileHandle, '"'. _('Date Range') . '","' . $_POST['FromDate'] . _(' To ') . $_POST['ToDate'] . '"'."\n"); if (strlen(trim($PartNumber)) > 0) { @@ -1246,11 +1252,11 @@ $myrow['linestatus'], ConvertSQLDate($myrow['deliverydate']), $myrow['description']); - $lastdecimalplaces = $myrow['decimalplaces']; - $totalqty += $myrow['quantityord']; - $totalextcost += $myrow['extcost']; - $totalextprice += $myrow['extprice']; - $totalinvqty += $myrow['qtyinvoiced']; + $LastDecimalPlaces = $myrow['decimalplaces']; + $TotalQty += $myrow['quantityord']; + $TotalExtCost += $myrow['extcost']; + $TotalExtPrice += $myrow['extprice']; + $TotalInvQty += $myrow['qtyinvoiced']; } //END WHILE LIST LOOP // Print totals fprintf($FileHandle, '"%s","%s","%s","%s","%s",%s,%s,%s,%s,"%s","%s"'."\n", @@ -1259,10 +1265,10 @@ ' ', ' ', ' ', - number_format($totalqty,2), - number_format($totalextcost,2), - number_format($totalextprice,2), - number_format($totalinvqty,2), + number_format($TotalQty,2), + number_format($TotalExtCost,2), + number_format($TotalExtPrice,2), + number_format($TotalInvQty,2), ' ', ' '); } else { @@ -1298,11 +1304,11 @@ $myrow['linestatus'], ConvertSQLDate($myrow['deliverydate']), $myrow['description']); - $lastdecimalplaces = $myrow['decimalplaces']; - $totalqty += $myrow['quantityord']; - $totalextcost += $myrow['extcost']; - $totalextprice += $myrow['extprice']; - $totalinvqty += $myrow['qtyinvoiced']; + $LastDecimalPlaces = $myrow['decimalplaces']; + $TotalQty += $myrow['quantityord']; + $TotalExtCost += $myrow['extcost']; + $TotalExtPrice += $myrow['extprice']; + $TotalInvQty += $myrow['qtyinvoiced']; } //END WHILE LIST LOOP // Print totals fprintf($FileHandle, '"%s","%s","%s","%s","%s",%s,%s,%s,%s,"%s","%s"'."\n", @@ -1311,10 +1317,10 @@ ' ', ' ', ' ', - number_format($totalqty,$lastdecimalplaces), - number_format($totalextcost,2), - number_format($totalextprice,2), - number_format($totalinvqty,$lastdecimalplaces), + number_format($TotalQty,$LastDecimalPlaces), + number_format($TotalExtCost,2), + number_format($TotalExtPrice,2), + number_format($TotalInvQty,$LastDecimalPlaces), " ", " "); } @@ -1383,20 +1389,20 @@ number_format($myrow['qtyinvoiced'],$myrow['decimalplaces']), $suppname); print '<br/>'; - $lastdecimalplaces = $myrow['decimalplaces']; - $totalqty += $myrow['quantityord']; - $totalextcost += $myrow['extcost']; - $totalextprice += $myrow['extprice']; - $totalinvqty += $myrow['qtyinvoiced']; + $LastDecimalPlaces = $myrow['decimalplaces']; + $TotalQty += $myrow['quantityord']; + $TotalExtCost += $myrow['extcost']; + $TotalExtPrice += $myrow['extprice']; + $TotalInvQty += $myrow['qtyinvoiced']; } //END WHILE LIST LOOP // Print totals fprintf($FileHandle, '"%s","%s",%s,%s,%s,%s,"%s"'."\n", 'Totals', _('Lines - ') . $linectr, - number_format($totalqty,$lastdecimalplaces), - number_format($totalextcost,2), - number_format($totalextprice,2), - number_format($totalinvqty,$lastdecimalplaces), + number_format($TotalQty,$LastDecimalPlaces), + number_format($TotalExtCost,2), + number_format($TotalExtPrice,2), + number_format($TotalInvQty,$LastDecimalPlaces), ' '); } // End of if ($_POST['ReportType'] fclose($FileHandle); @@ -1412,7 +1418,7 @@ // Display form fields. This function is called the first time // the page is called. - echo "<form action=" . $_SERVER['PHP_SELF'] . "?" . SID ." method=post>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class=selection>'; @@ -1461,15 +1467,15 @@ } echo '<tr><td>' . _('Supplier Name') . ':</td>'; - echo "<td><select name='SupplierNameOp'>"; - echo "<option selected value='LIKE'>" . _('Begins With'); - echo "<option value='Equals'>" . _('Equals'); + echo '<td><select name="SupplierNameOp">'; + echo '<option selected value="LIKE">' . _('Begins With') . '</option>'; + echo '<option value="Equals">' . _('Equals') . '</option>'; echo '</select>'; - echo "  <input type='Text' name='SupplierName' size=30 maxlength=30 value="; + echo '  <input type="text" name="SupplierName" size=30 maxlength=30 value="'; if (isset($_POST['SupplierName'])) { - echo $_POST['SupplierName'] . "></td></tr>"; + echo $_POST['SupplierName'] . '" /></td></tr>'; } else { - echo "></td></tr>"; + echo '" /></td></tr>'; } echo '<tr><td>' . _('Order Number') . ':</td>'; @@ -1482,56 +1488,55 @@ } echo '<tr><td>' . _('Line Item Status') . ':</td>'; - echo "<td><select name='LineStatus'>"; - echo "<option selected value='All'>" . _('All'); - echo "<option value='Completed'>" . _('Completed'); - echo "<option value='Open'>" . _('Not Completed'); + echo '<td><select name="LineStatus">'; + echo '<option selected value="All">' . _('All') . '</option>'; + echo '<option value="Completed">' . _('Completed') . '</option>'; + echo '<option value="Open">' . _('Not Completed') . '</option>'; echo '</select></td><td> </td></tr>'; - echo '<tr><td>' . _('Stock Categories') . ":</td><td><select name='Category'>"; - $sql='SELECT categoryid, categorydescription FROM stockcategory'; + echo '<tr><td>' . _('Stock Categories') . ':</td><td><select name="Category">'; + $sql="SELECT categoryid, categorydescription FROM stockcategory"; $CategoryResult= DB_query($sql,$db); - echo '<option selected value="All">' . _('All Categories'); + echo '<option selected value="All">' . _('All Categories') . '</option>'; While ($myrow = DB_fetch_array($CategoryResult)){ - echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categorydescription']; + echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; } echo '</select></td></tr>'; echo '<tr><td> </td></tr>'; echo '<tr><td>' . _('Sort By') . ':</td>'; - echo "<td><select name='SortBy'>"; - echo "<option selected value='purchorderdetails.orderno'>" . _('Order Number'); - echo "<option value='purchorderdetails.itemcode'>" . _('Part Number'); - echo "<option value='suppliers.supplierid,purchorderdetails.orderno'>" . _('Supplier Number'); - echo "<option value='suppliers.suppname,suppliers.supplierid,purchorderdetails.orderno'>" . _('Supplier Name'); + echo '<td><select name="SortBy">'; + echo '<option selected value="purchorderdetails.orderno">' . _('Order Number') . '</option>'; + echo '<option value="purchorderdetails.itemcode">' . _('Part Number') . '</option>'; + echo '<option value="suppliers.supplierid,purchorderdetails.orderno">' . _('Supplier Number') . '</option>'; + echo '<option value="suppliers.suppname,suppliers.supplierid,purchorderdetails.orderno">' . _('Supplier Name') . '</option>'; echo '</select></td><td> </td></tr>'; echo '<tr><td> </td></tr>'; echo '<tr><td>' . _('Summary Type') . ':</td>'; - echo "<td><select name='SummaryType'>"; - echo "<option selected value='orderno'>" . _('Order Number'); - echo "<option value='itemcode'>" . _('Part Number'); - echo "<option value='extprice'>" . _('Extended Price'); - echo "<option value='supplierno'>" . _('Supplier Number'); - echo "<option value='suppname'>" . _('Supplier Name'); - echo "<option value='month'>" . _('Month'); - echo "<option value='categoryid'>" . _('Stock Category'); + echo '<td><select name="SummaryType">'; + echo '<option selected value="orderno">' . _('Order Number') . '</option>'; + echo '<option value="itemcode">' . _('Part Number') . '</option>'; + echo '<option value="extprice">' . _('Extended Price') . '</option>'; + echo '<option value="supplierno">' . _('Supplier Number') . '</option>'; + echo '<option value="suppname">' . _('Supplier Name') . '</option>'; + echo '<option value="month">' . _('Month') . '</option>'; + echo '<option value="categoryid">' . _('Stock Category') . '</option>'; echo '</select></td><td> </td></tr>'; - echo " - <tr><td> </td></tr> - <tr> - <td colspan=4><div class=centre><input type='submit' name='submit' value='" . _('Run Inquiry') . "'></div></td> + echo '<tr><td> </td></tr> + <tr> + <td colspan=4><div class=centre><input type="submit" name="submit" value="' . _('Run Inquiry') . '"></div></td> </tr> <tr> - <td colspan=4><div class=centre><input type='submit' name='submitcsv' value='" . _('Export as csv file') . "'></div></td> + <td colspan=4><div class=centre><input type="submit" name="submitcsv" value="' . _('Export as csv file') . '"></div></td> </tr> </table> - <br/>"; + <br/>'; echo '</form>'; } // End of function display() include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2011-04-11 10:49:45 UTC (rev 4547) +++ trunk/Stocks.php 2011-04-12 10:33:45 UTC (rev 4548) @... [truncated message content] |
From: <dai...@us...> - 2011-04-12 10:33:53
|
Revision: 4548 http://web-erp.svn.sourceforge.net/web-erp/?rev=4548&view=rev Author: daintree Date: 2011-04-12 10:33:45 +0000 (Tue, 12 Apr 2011) Log Message: ----------- tim launchpad fork Modified Paths: -------------- trunk/DeliveryDetails.php trunk/POReport.php trunk/Stocks.php trunk/TaxProvinces.php trunk/UnitsOfMeasure.php trunk/UpgradeDatabase.php trunk/WOSerialNos.php trunk/WorkOrderIssue.php trunk/Z_Upgrade3.10.php trunk/Z_Upgrade_3.09-3.10.php Modified: trunk/DeliveryDetails.php =================================================================== --- trunk/DeliveryDetails.php 2011-04-11 10:49:45 UTC (rev 4547) +++ trunk/DeliveryDetails.php 2011-04-12 10:33:45 UTC (rev 4548) @@ -1,7 +1,6 @@ <?php /* $Id$ */ -/* $Revision: 1.76 $ */ /* This is where the delivery details are confirmed/entered/modified and the order committed to the database once the place order/modify order button is hit. @@ -81,13 +80,13 @@ /* If (strlen($_POST['BrAdd3'])==0 OR !isset($_POST['BrAdd3'])){ $InputErrors =1; - echo "<br>A region or city must be entered.<br>"; + echo "<br />A region or city must be entered.<br />"; } Maybe appropriate in some installations but not here If (strlen($_POST['BrAdd2'])<=1){ $InputErrors =1; - echo "<br>You should enter the suburb in the box provided. Orders cannot be accepted without a valid suburb being entered.<br>"; + echo "<br />You should enter the suburb in the box provided. Orders cannot be accepted without a valid suburb being entered.<br />"; } */ @@ -111,7 +110,7 @@ elseif (Date1GreaterThanDate2(Date($_SESSION['DefaultDateFormat'],$EarliestDispatch), $_POST['DeliveryDate'])){ $InputErrors =1; - echo '<br><b>' . _('The delivery details cannot be updated because you are attempting to set the date the order is to be dispatched earlier than is possible. No dispatches are made on Saturday and Sunday. Also, the dispatch cut off time is') . $_SESSION['DispatchCutOffTime'] . _(':00 hrs. Orders placed after this time will be dispatched the following working day.'); + echo '<br /><b>' . _('The delivery details cannot be updated because you are attempting to set the date the order is to be dispatched earlier than is possible. No dispatches are made on Saturday and Sunday. Also, the dispatch cut off time is') . $_SESSION['DispatchCutOffTime'] . _(':00 hrs. Orders placed after this time will be dispatched the following working day.'); } */ @@ -153,7 +152,7 @@ prnMsg(_('The branch details for branch code') . ': ' . $_SESSION['Items'.$identifier]->Branch . ' ' . _('against customer code') . ': ' . $_POST['Select'] . ' ' . _('could not be retrieved') . '. ' . _('Check the set up of the customer and branch'),'error'); if ($debug==1){ - echo '<br>' . _('The SQL that failed to get the branch details was') . ':<br>' . $sql; + echo '<br />' . _('The SQL that failed to get the branch details was') . ':<br />' . $sql; } include('includes/footer.inc'); exit; @@ -280,7 +279,7 @@ } If ($_POST['FreightCost'] != $OldFreightCost && $_SESSION['DoFreightCalc']==True){ $OK_to_PROCESS = 0; - prnMsg(_('The freight charge has been updated') . '. ' . _('Please reconfirm that the order and the freight charges are acceptable and then confirm the order again if OK') .' <br> '. _('The new freight cost is') .' ' . $_POST['FreightCost'] . ' ' . _('and the previously calculated freight cost was') .' '. $OldFreightCost,'warn'); + prnMsg(_('The freight charge has been updated') . '. ' . _('Please reconfirm that the order and the freight charges are acceptable and then confirm the order again if OK') .' <br /> '. _('The new freight cost is') .' ' . $_POST['FreightCost'] . ' ' . _('and the previously calculated freight cost was') .' '. $OldFreightCost,'warn'); } else { /*check the customer's payment terms */ @@ -417,7 +416,7 @@ AND $_SESSION['AutoCreateWOs']==1 AND $_SESSION['Items'.$identifier]->Quotation!=1){ //oh yeah its all on! - echo '<br>'; + echo '<br />'; //now get the data required to test to see if we need to make a new WO $QOHResult = DB_query("SELECT SUM(quantity) FROM locstock WHERE stockid='" . $StockItem->StockID . "'",$db); @@ -559,7 +558,7 @@ } /* end inserted line items into sales order details */ $result = DB_Txn_Commit($db); - echo '<br>'; + echo '<br />'; if ($_SESSION['Items'.$identifier]->Quotation==1){ prnMsg(_('Quotation Number') . ' ' . $OrderNo . ' ' . _('has been entered'),'success'); } else { @@ -571,19 +570,44 @@ if ($_POST['Quotation']==0) { /*then its not a quotation its a real order */ - echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td>' . ' ' . '<a target="_blank" href="' . $rootpath . '/PrintCustOrder.php?identifier='.$identifier . '&TransNo=' . $OrderNo . '">'. _('Print packing slip') . ' (' . _('Preprinted stationery') . ')' .'</a></td></tr>'; - echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td>' . ' ' . '<a target="_blank" href="' . $rootpath . '/PrintCustOrder_generic.php?identifier='.$identifier . '&TransNo=' . $OrderNo . '">'. _('Print packing slip') . ' (' . _('Laser') . ')' .'</a></td></tr>'; + echo '<br /><table class=selection> + <tr> + <td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td> + <td>' . ' ' . '<a target="_blank" href="' . $rootpath . '/PrintCustOrder.php?identifier='.$identifier . '&TransNo=' . $OrderNo . '">'. _('Print packing slip') . ' (' . _('Preprinted stationery') . ')' .'</a></td> + </tr>'; + echo '<tr> + <td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td> + <td>' . ' ' . '<a target="_blank" href="' . $rootpath . '/PrintCustOrder_generic.php?identifier='.$identifier . '&TransNo=' . $OrderNo . '">'. _('Print packing slip') . ' (' . _('Laser') . ')' .'</a></td> + </tr>'; - echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Invoice') . '" alt=""></td><td>' . ' ' . '<a href="' . $rootpath . '/ConfirmDispatch_Invoice.php?identifier='.$identifier . '&OrderNumber=' . $OrderNo .'">'. _('Confirm Dispatch and Produce Invoice') .'</a></td></tr>'; - //Add option to Print Sales Orders or Proforma invoice - echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/pdf.png" title="' . _('Sales Order') . '" alt=""></td><td>' . ' ' . '<a href="' . $rootpath . '/PrintSalesOrder_generic.php?identifier='.$identifier . '&TransNo=' . $OrderNo .'">'. _('Print Sales Order / Pro-forma Invoice') .'</a></td></tr></table>'; + echo '<tr> + <td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Invoice') . '" alt=""></td> + <td>' . ' ' . '<a href="' . $rootpath . '/ConfirmDispatch_Invoice.php?identifier='.$identifier . '&OrderNumber=' . $OrderNo .'">'. _('Confirm Dispatch and Produce Invoice') .'</a></td> + </tr>'; + + echo '</table>'; } else { /*link to print the quotation */ - echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Order') . '" alt=""></td><td>' . ' ' . '<a href="' . $rootpath . '/PDFQuotation.php?' . SID .'identifier='.$identifier . '&QuotationNo=' . $OrderNo . '">'. _('Print Quotation (Landscape)') .'</a></td></tr></table>'; - echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Order') . '" alt=""></td><td>' . ' ' . '<a href="' . $rootpath . '/PDFQuotationPortrait.php?' . SID .'identifier='.$identifier . '&QuotationNo=' . $OrderNo . '">'. _('Print Quotation (Portrait)') .'</a></td></tr></table>'; + echo '<br /><table class=selection> + <tr> + <td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Order') . '" alt=""></td> + <td>' . ' ' . '<a href="' . $rootpath . '/PDFQuotation.php?' . SID .'identifier='.$identifier . '&QuotationNo=' . $OrderNo . '">'. _('Print Quotation (Landscape)') .'</a></td> + </tr> + </table>'; + echo '<br /><table class=selection> + <tr> + <td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Order') . '" alt=""></td> + <td>' . ' ' . '<a href="' . $rootpath . '/PDFQuotationPortrait.php?' . SID .'identifier='.$identifier . '&QuotationNo=' . $OrderNo . '">'. _('Print Quotation (Portrait)') .'</a></td> + </tr> + </table>'; } - echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Order') . '" alt=""></td><td>' . ' ' . '<a href="'. $rootpath .'/SelectOrderItems.php?identifier='.$identifier . '&NewOrder=Yes">'. _('Add Another Sales Order') .'</a></td></tr></table>'; + echo '<br /><table class=selection> + <tr> + <td><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Order') . '" alt=""></td> + <td>' . ' ' . '<a href="'. $rootpath .'/SelectOrderItems.php?identifier='.$identifier . '&NewOrder=Yes">'. _('Add Another Sales Order') .'</a></td> + </tr> + </table>'; } else { /*its a customer logon so thank them */ prnMsg(_('Thank you for your business'),'success'); @@ -747,7 +771,7 @@ prnMsg(_('Order Number') .' ' . $_SESSION['ExistingOrder'] . ' ' . _('has been updated'),'success'); - echo '<br><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td><a href="' . $rootpath . '/PrintCustOrder.php?identifier='.$identifier . '&TransNo=' . $_SESSION['ExistingOrder'] . '">'. _('Print packing slip - pre-printed stationery') .'</a></td></tr>'; + echo '<br /><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td><a href="' . $rootpath . '/PrintCustOrder.php?identifier='.$identifier . '&TransNo=' . $_SESSION['ExistingOrder'] . '">'. _('Print packing slip - pre-printed stationery') .'</a></td></tr>'; echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td><a target="_blank" href="' . $rootpath . '/PrintCustOrder_generic.php?identifier='.$identifier . '&TransNo=' . $_SESSION['ExistingOrder'] . '">'. _('Print packing slip') . ' (' . _('Laser') . ')' .'</a></td></tr>'; echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Invoice') . '" alt=""></td><td><a href="' . $rootpath .'/ConfirmDispatch_Invoice.php?identifier='.$identifier . '&OrderNumber=' . $_SESSION['ExistingOrder'] . '">'. _('Confirm Order Delivery Quantities and Produce Invoice') .'</a></td></tr>'; echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Order') . '" alt=""></td><td><a href="' . $rootpath .'/SelectSalesOrder.php?identifier='.$identifier . '">'. _('Select A Different Order') .'</a></td></tr></table>'; @@ -833,7 +857,7 @@ $DisplayVolume = number_format($_SESSION['Items'.$identifier]->totalVolume,2); $DisplayWeight = number_format($_SESSION['Items'.$identifier]->totalWeight,2); - echo '<br><table><tr class="EvenTableRows"> + echo '<br /><table><tr class="EvenTableRows"> <td>'. _('Total Weight') .':</td> <td>'.$DisplayWeight.'</td> <td>'. _('Total Volume') .':</td> @@ -903,7 +927,7 @@ } -echo '<br><table class=selection><tr> +echo '<br /><table class=selection><tr> <td>'. _('Deliver To') .':</td> <td><input type=text size=42 maxlength=40 name="DeliverTo" value="' . $_SESSION['Items'.$identifier]->DeliverTo . '"></td> </tr>'; @@ -1082,13 +1106,13 @@ echo '</table>'; -echo '<br><div class="centre"><input type=submit name="BackToLineDetails" value="' . _('Modify Order Lines') . '"><br>'; +echo '<br /><div class="centre"><input type=submit name="BackToLineDetails" value="' . _('Modify Order Lines') . '"><br />'; if ($_SESSION['ExistingOrder']==0){ - echo '<br><br><input type=submit name="ProcessOrder" value="' . _('Place Order') . '">'; - echo '<br><br><input type=submit name="MakeRecurringOrder" VALUE="' . _('Create Recurring Order') . '">'; + echo '<br /><br /><input type=submit name="ProcessOrder" value="' . _('Place Order') . '">'; + echo '<br /><br /><input type=submit name="MakeRecurringOrder" VALUE="' . _('Create Recurring Order') . '">'; } else { - echo '<br><input type=submit name="ProcessOrder" VALUE="' . _('Commit Order Changes') . '">'; + echo '<br /><input type=submit name="ProcessOrder" VALUE="' . _('Commit Order Changes') . '">'; } echo '</div></form>'; Modified: trunk/POReport.php =================================================================== --- trunk/POReport.php 2011-04-11 10:49:45 UTC (rev 4547) +++ trunk/POReport.php 2011-04-12 10:33:45 UTC (rev 4548) @@ -40,9 +40,9 @@ $SupplierNameOp = $_POST['SupplierNameOp']; - // Save $_POST['SummaryType'] in $savesummarytype because change $_POST['SummaryType'] when + // Save $_POST['SummaryType'] in $SaveSummaryType because change $_POST['SummaryType'] when // create $sql - $savesummarytype = $_POST['SummaryType']; + $SaveSummaryType = $_POST['SummaryType']; } if (isset($_POST['SupplierName'])){ @@ -60,11 +60,11 @@ if (isset($_POST['submit'])) { echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p>'; - submit($db,$PartNumber,$PartNumberOp,$SupplierId,$SupplierIdOp,$SupplierName,$SupplierNameOp,$savesummarytype); + submit($db,$PartNumber,$PartNumberOp,$SupplierId,$SupplierIdOp,$SupplierName,$SupplierNameOp,$SaveSummaryType); } else if (isset($_POST['submitcsv'])) { echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p>'; - submitcsv($db,$PartNumber,$PartNumberOp,$SupplierId,$SupplierIdOp,$SupplierName,$SupplierNameOp,$savesummarytype); + submitcsv($db,$PartNumber,$PartNumberOp,$SupplierId,$SupplierIdOp,$SupplierName,$SupplierNameOp,$SaveSummaryType); } else { echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . '</img>' . $title.'</p>'; @@ -73,7 +73,7 @@ //####_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT#### -function submit(&$db,$PartNumber,$PartNumberOp,$SupplierId,$SupplierIdOp,$SupplierName,$SupplierNameOp,$savesummarytype) +function submit(&$db,$PartNumber,$PartNumberOp,$SupplierId,$SupplierIdOp,$SupplierName,$SupplierNameOp,$SaveSummaryType) { //initialize no input errors @@ -94,71 +94,71 @@ } # Add more to WHERE statement, if user entered something for the part number,supplierid, name - $wherepart = ' '; + $WherePart = ' '; if (strlen($PartNumber) > 0 && $PartNumberOp == 'LIKE') { $PartNumber = $PartNumber . '%'; } else { $PartNumberOp = '='; } if (strlen($PartNumber) > 0) { - $wherepart = " AND purchorderdetails.itemcode " . $PartNumberOp . " '" . $PartNumber . "' "; + $WherePart = " AND purchorderdetails.itemcode " . $PartNumberOp . " '" . $PartNumber . "' "; } else { - $wherepart=' '; + $WherePart=' '; } - $wheresupplierid = ' '; + $WhereSupplierID = ' '; if ($SupplierIdOp == 'LIKE') { $SupplierId = $SupplierId . '%'; } else { $SupplierIdOp = '='; } if (strlen($SupplierId) > 0) { - $wheresupplierid = " AND purchorders.supplierno " . $SupplierIdOp . " '" . $SupplierId . "' "; + $WhereSupplierID = " AND purchorders.supplierno " . $SupplierIdOp . " '" . $SupplierId . "' "; } else { - $wheresupplierid=' '; + $WhereSupplierID=' '; } - $wheresuppliername = ' '; + $WhereSupplierName = ' '; if (strlen($SupplierName) > 0 && $SupplierNameOp == 'LIKE') { $SupplierName = $SupplierName . '%'; } else { $SupplierNameOp = '='; } if (strlen($SupplierName) > 0) { - $wheresuppliername = " AND suppliers.suppname " . $SupplierNameOp . " '" . $SupplierName . "' "; + $WhereSupplierName = " AND suppliers.suppname " . $SupplierNameOp . " '" . $SupplierName . "' "; } else { - $wheresuppliername=' '; + $WhereSupplierName=' '; } if (strlen($_POST['OrderNo']) > 0) { - $whereorderno = ' AND purchorderdetails.orderno = ' . " '" . $_POST['OrderNo'] . "' "; + $WhereOrderNo = ' AND purchorderdetails.orderno = ' . " '" . $_POST['OrderNo'] . "' "; } else { - $whereorderno=' '; + $WhereOrderNo=' '; } - $wherelinestatus = ' '; + $WhereLineStatus = ' '; # Had to use IF statement instead of comparing 'linestatus' to $_POST['LineStatus'] #in WHERE clause because the WHERE clause didn't recognize # that had used the IF statement to create a field called linestatus if ($_POST['LineStatus'] != 'All') { if ($_POST['DateType'] == 'Order') { - $wherelinestatus = " AND IF(purchorderdetails.quantityord = purchorderdetails.qtyinvoiced || + $WhereLineStatus = " AND IF(purchorderdetails.quantityord = purchorderdetails.qtyinvoiced || purchorderdetails.completed = 1,'Completed','Open') = '" . $_POST['LineStatus'] . "'"; } else { - $wherelinestatus = " AND IF(grns.qtyrecd - grns.quantityinv <> 0,'Open','Completed') = '" + $WhereLineStatus = " AND IF(grns.qtyrecd - grns.quantityinv <> 0,'Open','Completed') = '" . $_POST['LineStatus'] . "'"; } } - $wherecategory = ' '; + $WhereCategory = ' '; if ($_POST['Category'] != 'All') { - $wherecategory = " AND stockmaster.categoryid = '" . $_POST['Category'] . "'"; + $WhereCategory = " AND stockmaster.categoryid = '" . $_POST['Category'] . "'"; } if ($InputError !=1) { - $fromdate = FormatDateForSQL($_POST['FromDate']); - $todate = FormatDateForSQL($_POST['ToDate']); + $FromDate = FormatDateForSQL($_POST['FromDate']); + $ToDate = FormatDateForSQL($_POST['ToDate']); if ($_POST['ReportType'] == 'Detail') { if ($_POST['DateType'] == 'Order') { $sql = "SELECT purchorderdetails.orderno, @@ -179,14 +179,14 @@ LEFT JOIN purchorders ON purchorders.orderno=purchorderdetails.orderno LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory ORDER BY " . $_POST['SortBy']; } else { // Selects by delivery date from grns @@ -208,14 +208,14 @@ LEFT JOIN purchorders ON purchorders.orderno=purchorderdetails.orderno LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory ORDER BY " . $_POST['SortBy']; } } else { @@ -242,14 +242,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ',stockmaster.decimalplaces, stockmaster.description @@ -267,14 +267,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ',purchorders.supplierno, suppliers.suppname @@ -291,14 +291,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ',purchorders.supplierno, suppliers.suppname @@ -315,14 +315,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ', monthname ORDER BY ' . $orderby; @@ -338,14 +338,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ', categorydescription ORDER BY ' . $orderby; @@ -365,14 +365,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ', stockmaster.description ORDER BY ' . $orderby; @@ -390,14 +390,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ', purchorders.supplierno, suppliers.suppname @@ -415,14 +415,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ', purchorders.supplierno, suppliers.suppname @@ -440,14 +440,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ',monthname ORDER BY ' . $orderby; @@ -464,14 +464,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ',categorydescription ORDER BY ' . $orderby; @@ -482,35 +482,35 @@ $ErrMsg = _('The SQL to find the parts selected failed with the message'); $result = DB_query($sql,$db,$ErrMsg); $ctr = 0; - $totalqty = 0; - $totalextcost = 0; - $totalextprice = 0; - $totalinvqty = 0; + $TotalQty = 0; + $TotalExtCost = 0; + $TotalExtPrice = 0; + $TotalInvQty = 0; - // Create array for summary type to display in header. Access it with $savesummarytype - $summary_array["orderno"] = _('Order Number'); - $summary_array["itemcode"] = _('Part Number'); - $summary_array["extprice"] = _('Extended Price'); - $summary_array["supplierno"] = _('Customer Number'); - $summary_array["suppname"] = _('Customer Name'); - $summary_array["month"] = _('Month'); - $summary_array["categoryid"] = _('Stock Category'); + // Create array for summary type to display in header. Access it with $SaveSummaryType + $Summary_Array["orderno"] = _('Order Number'); + $Summary_Array["itemcode"] = _('Part Number'); + $Summary_Array["extprice"] = _('Extended Price'); + $Summary_Array["supplierno"] = _('Customer Number'); + $Summary_Array["suppname"] = _('Customer Name'); + $Summary_Array["month"] = _('Month'); + $Summary_Array["categoryid"] = _('Stock Category'); // Create array for sort for detail report to display in header - $detail_array['purchorderdetails.orderno'] = _('Order Number'); - $detail_array['purchorderdetails.itemcode'] = _('Part Number'); - $detail_array['suppliers.supplierid,purchorderdetails.orderno'] = _('Supplier Number'); - $detail_array['suppliers.suppname,suppliers.supplierid,purchorderdetails.orderno'] = _('Supplier Name'); + $Detail_Array['purchorderdetails.orderno'] = _('Order Number'); + $Detail_Array['purchorderdetails.itemcode'] = _('Part Number'); + $Detail_Array['suppliers.supplierid,purchorderdetails.orderno'] = _('Supplier Number'); + $Detail_Array['suppliers.suppname,suppliers.supplierid,purchorderdetails.orderno'] = _('Supplier Name'); // Display Header info echo '<table class=selection>'; if ($_POST['ReportType'] == 'Summary') { - $sortby_display = $summary_array[$savesummarytype]; + $SortBy_Display = $Summary_Array[$SaveSummaryType]; } else { - $sortby_display = $detail_array[$_POST['SortBy']]; + $SortBy_Display = $Detail_Array[$_POST['SortBy']]; } echo '<tr><th colspan=2><font size=3 color=navy>'._('Header Details').'</font></th></tr>'; - echo '<tr><td>' . _('Purchase Order Report') . '</td><td>' . $_POST['ReportType'] . ' By '.$sortby_display .'</td></tr>'; + echo '<tr><td>' . _('Purchase Order Report') . '</td><td>' . $_POST['ReportType'] . ' By '.$SortBy_Display .'</td></tr>'; echo '<tr><td>' . _('Date Type') . '</td><td>' . $_POST['DateType'] . '</tr>'; echo '<tr><td>' . _('Date Range') . '</td><td>' . $_POST['FromDate'] . _(' To ') . $_POST['ToDate'] . '</td></tr>'; if (strlen(trim($PartNumber)) > 0) { @@ -567,11 +567,11 @@ $myrow['linestatus'], ConvertSQLDate($myrow['deliverydate']), $myrow['description']); - $lastdecimalplaces = $myrow['decimalplaces']; - $totalqty += $myrow['quantityord']; - $totalextcost += $myrow['extcost']; - $totalextprice += $myrow['extprice']; - $totalinvqty += $myrow['qtyinvoiced']; + $LastDecimalPlaces = $myrow['decimalplaces']; + $TotalQty += $myrow['quantityord']; + $TotalExtCost += $myrow['extcost']; + $TotalExtPrice += $myrow['extprice']; + $TotalInvQty += $myrow['qtyinvoiced']; } //END WHILE LIST LOOP // Print totals printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td class=number>%s</td><td class=number>%s</td> @@ -581,10 +581,10 @@ ' ', ' ', ' ', - number_format($totalqty,2), - number_format($totalextcost,2), - number_format($totalextprice,2), - number_format($totalinvqty,2), + number_format($TotalQty,2), + number_format($TotalExtCost,2), + number_format($TotalExtPrice,2), + number_format($TotalInvQty,2), ' ', ' '); } else { @@ -629,11 +629,11 @@ $myrow['linestatus'], ConvertSQLDate($myrow['deliverydate']), $myrow['description']); - $lastdecimalplaces = $myrow['decimalplaces']; - $totalqty += $myrow['quantityord']; - $totalextcost += $myrow['extcost']; - $totalextprice += $myrow['extprice']; - $totalinvqty += $myrow['qtyinvoiced']; + $LastDecimalPlaces = $myrow['decimalplaces']; + $TotalQty += $myrow['quantityord']; + $TotalExtCost += $myrow['extcost']; + $TotalExtPrice += $myrow['extprice']; + $TotalInvQty += $myrow['qtyinvoiced']; } //END WHILE LIST LOOP // Print totals printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td class=number>%s</td><td class=number> @@ -643,10 +643,10 @@ ' ', ' ', ' ', - number_format($totalqty,$lastdecimalplaces), - number_format($totalextcost,2), - number_format($totalextprice,2), - number_format($totalinvqty,$lastdecimalplaces), + number_format($TotalQty,$LastDecimalPlaces), + number_format($TotalExtCost,2), + number_format($TotalExtPrice,2), + number_format($TotalInvQty,$LastDecimalPlaces), ' ', ' '); } @@ -724,23 +724,23 @@ number_format($myrow['extprice'],2), $myrow['qtyinvoiced'], $suppname); - $totalqty += $myrow['quantityord']; - $totalextcost += $myrow['extcost']; - $totalextprice += $myrow['extprice']; - $totalinvqty += $myrow['qtyinvoiced']; + $TotalQty += $myrow['quantityord']; + $TotalExtCost += $myrow['extcost']; + $TotalExtPrice += $myrow['extprice']; + $TotalInvQty += $myrow['qtyinvoiced']; } //END WHILE LIST LOOP // Print totals printf("<tr><td>%s</td><td>%s</td><td class=number>%s</td><td class=number>%s</td><td class=number>%s</td><td class=number>%s</td></tr>", 'Totals', _('Lines - ') . $linectr, - $totalqty, - number_format($totalextcost,2), - number_format($totalextprice,2), - $totalinvqty, + $TotalQty, + number_format($TotalExtCost,2), + number_format($TotalExtPrice,2), + $TotalInvQty, ' '); } // End of if ($_POST['ReportType'] echo '</table>'; - echo "<form action=" . $_SERVER['PHP_SELF'] . "?" . SID ." method=post>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo "<input type=hidden name='ReportType' value=".$_POST['ReportType'].">"; echo "<input type=hidden name='DateType' value=".$_POST['DateType'].">"; @@ -758,13 +758,19 @@ echo "<input type=hidden name='SortBy' value=".$_POST['SortBy'].">"; echo "<input type=hidden name='SummaryType' value=".$_POST['SummaryType'].">"; echo "<br><div class=centre><input type='submit' name='submitcsv' value='" . _('Export as csv file') . "'></div></td>"; - echo "</form>"; + echo '</form>'; } // End of if inputerror != 1 } // End of function submit() //####_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT#### -function submitcsv(&$db,$PartNumber,$PartNumberOp,$SupplierId,$SupplierIdOp,$SupplierName,$SupplierNameOp,$savesummarytype) -{ +function submitcsv(&$db, + $PartNumber, + $PartNumberOp, + $SupplierId, + $SupplierIdOp, + $SupplierName, + $SupplierNameOp, + $SaveSummaryType) { //initialize no input errors $InputError = 0; @@ -784,71 +790,71 @@ } # Add more to WHERE statement, if user entered something for the part number,supplierid, name - $wherepart = ' '; + $WherePart = ' '; if (strlen($PartNumber) > 0 && $PartNumberOp == 'LIKE') { $PartNumber = $PartNumber . '%'; } else { $PartNumberOp = '='; } if (strlen($PartNumber) > 0) { - $wherepart = " AND purchorderdetails.itemcode " . $PartNumberOp . " '" . $PartNumber . "' "; + $WherePart = " AND purchorderdetails.itemcode " . $PartNumberOp . " '" . $PartNumber . "' "; } else { - $wherepart=' '; + $WherePart=' '; } - $wheresupplierid = ' '; + $WhereSupplierID = ' '; if ($SupplierIdOp == 'LIKE') { $SupplierId = $SupplierId . '%'; } else { $SupplierIdOp = '='; } if (strlen($SupplierId) > 0) { - $wheresupplierid = " AND purchorders.supplierno " . $SupplierIdOp . " '" . $SupplierId . "' "; + $WhereSupplierID = " AND purchorders.supplierno " . $SupplierIdOp . " '" . $SupplierId . "' "; } else { - $wheresupplierid=' '; + $WhereSupplierID=' '; } - $wheresuppliername = ' '; + $WhereSupplierName = ' '; if (strlen($SupplierName) > 0 && $SupplierNameOp == 'LIKE') { $SupplierName = $SupplierName . '%'; } else { $SupplierNameOp = '='; } if (strlen($SupplierName) > 0) { - $wheresuppliername = " AND suppliers.suppname " . $SupplierNameOp . " '" . $SupplierName . "' "; + $WhereSupplierName = " AND suppliers.suppname " . $SupplierNameOp . " '" . $SupplierName . "' "; } else { - $wheresuppliername=' '; + $WhereSupplierName=' '; } if (strlen($_POST['OrderNo']) > 0) { - $whereorderno = ' AND purchorderdetails.orderno = ' . " '" . $_POST['OrderNo'] . "' "; + $WhereOrderNo = ' AND purchorderdetails.orderno = ' . " '" . $_POST['OrderNo'] . "' "; } else { - $whereorderno=' '; + $WhereOrderNo=' '; } - $wherelinestatus = ' '; + $WhereLineStatus = ' '; # Had to use IF statement instead of comparing 'linestatus' to $_POST['LineStatus'] #in WHERE clause because the WHERE clause didn't recognize # that had used the IF statement to create a field called linestatus if ($_POST['LineStatus'] != 'All') { if ($_POST['DateType'] == 'Order') { - $wherelinestatus = " AND IF(purchorderdetails.quantityord = purchorderdetails.qtyinvoiced || + $WhereLineStatus = " AND IF(purchorderdetails.quantityord = purchorderdetails.qtyinvoiced || purchorderdetails.completed = 1,'Completed','Open') = '" . $_POST['LineStatus'] . "'"; } else { - $wherelinestatus = " AND IF(grns.qtyrecd - grns.quantityinv <> 0,'Open','Completed') = '" + $WhereLineStatus = " AND IF(grns.qtyrecd - grns.quantityinv <> 0,'Open','Completed') = '" . $_POST['LineStatus'] . "'"; } } - $wherecategory = ' '; + $WhereCategory = ' '; if ($_POST['Category'] != 'All') { - $wherecategory = " AND stockmaster.categoryid = '" . $_POST['Category'] . "'"; + $WhereCategory = " AND stockmaster.categoryid = '" . $_POST['Category'] . "'"; } if ($InputError !=1) { - $fromdate = FormatDateForSQL($_POST['FromDate']); - $todate = FormatDateForSQL($_POST['ToDate']); + $FromDate = FormatDateForSQL($_POST['FromDate']); + $ToDate = FormatDateForSQL($_POST['ToDate']); if ($_POST['ReportType'] == 'Detail') { if ($_POST['DateType'] == 'Order') { $sql = "SELECT purchorderdetails.orderno, @@ -869,14 +875,14 @@ LEFT JOIN purchorders ON purchorders.orderno=purchorderdetails.orderno LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory ORDER BY " . $_POST['SortBy']; } else { // Selects by delivery date from grns @@ -898,14 +904,14 @@ LEFT JOIN purchorders ON purchorders.orderno=purchorderdetails.orderno LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory ORDER BY " . $_POST['SortBy']; } } else { @@ -932,14 +938,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ',stockmaster.decimalplaces, stockmaster.description @@ -957,14 +963,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ',purchorders.supplierno, suppliers.suppname @@ -981,14 +987,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ',purchorders.supplierno, suppliers.suppname @@ -1005,14 +1011,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ', monthname ORDER BY ' . $orderby; @@ -1028,14 +1034,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE purchorders.orddate >='$fromdate' - AND purchorders.orddate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE purchorders.orddate >='$FromDate' + AND purchorders.orddate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ', categorydescription ORDER BY ' . $orderby; @@ -1055,14 +1061,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ', stockmaster.description ORDER BY ' . $orderby; @@ -1080,14 +1086,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ', purchorders.supplierno, suppliers.suppname @@ -1105,14 +1111,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ', purchorders.supplierno, suppliers.suppname @@ -1130,14 +1136,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ',monthname ORDER BY ' . $orderby; @@ -1154,14 +1160,14 @@ LEFT JOIN suppliers ON purchorders.supplierno = suppliers.supplierid LEFT JOIN stockmaster ON purchorderdetails.itemcode = stockmaster.stockid LEFT JOIN stockcategory ON stockcategory.categoryid = stockmaster.categoryid - WHERE grns.deliverydate >='$fromdate' - AND grns.deliverydate <='$todate' - $wherepart - $wheresupplierid - $wheresuppliername - $whereorderno - $wherelinestatus - $wherecategory + WHERE grns.deliverydate >='$FromDate' + AND grns.deliverydate <='$ToDate' + $WherePart + $WhereSupplierID + $WhereSupplierName + $WhereOrderNo + $WhereLineStatus + $WhereCategory GROUP BY " . $_POST['SummaryType'] . ',categorydescription ORDER BY ' . $orderby; @@ -1172,34 +1178,34 @@ $ErrMsg = _('The SQL to find the parts selected failed with the message'); $result = DB_query($sql,$db,$ErrMsg); $ctr = 0; - $totalqty = 0; - $totalextcost = 0; - $totalextprice = 0; - $totalinvqty = 0; + $TotalQty = 0; + $TotalExtCost = 0; + $TotalExtPrice = 0; + $TotalInvQty = 0; $FileName = $_SESSION['reports_dir'] .'/POReport.csv'; $FileHandle = fopen($FileName, 'w'); - // Create array for summary type to display in header. Access it with $savesummarytype - $summary_array["orderno"] = _('Order Number'); - $summary_array["itemcode"] = _('Part Number'); - $summary_array["extprice"] = _('Extended Price'); - $summary_array["supplierno"] = _('Customer Number'); - $summary_array["suppname"] = _('Customer Name'); - $summary_array["month"] = _('Month'); - $summary_array["categoryid"] = _('Stock Category'); + // Create array for summary type to display in header. Access it with $SaveSummaryType + $Summary_Array['orderno'] = _('Order Number'); + $Summary_Array['itemcode'] = _('Part Number'); + $Summary_Array['extprice'] = _('Extended Price'); + $Summary_Array['supplierno'] = _('Customer Number'); + $Summary_Array['suppname'] = _('Customer Name'); + $Summary_Array['month'] = _('Month'); + $Summary_Array['categoryid'] = _('Stock Category'); // Create array for sort for detail report to display in header - $detail_array['purchorderdetails.orderno'] = _('Order Number'); - $detail_array['purchorderdetails.itemcode'] = _('Part Number'); - $detail_array['suppliers.supplierid,purchorderdetails.orderno'] = _('Supplier Number'); - $detail_array['suppliers.suppname,suppliers.supplierid,purchorderdetails.orderno'] = _('Supplier Name'); + $Detail_Array['purchorderdetails.orderno'] = _('Order Number'); + $Detail_Array['purchorderdetails.itemcode'] = _('Part Number'); + $Detail_Array['suppliers.supplierid,purchorderdetails.orderno'] = _('Supplier Number'); + $Detail_Array['suppliers.suppname,suppliers.supplierid,purchorderdetails.orderno'] = _('Supplier Name'); // Display Header info if ($_POST['ReportType'] == 'Summary') { - $sortby_display = $summary_array[$savesummarytype]; + $SortBy_Display = $Summary_Array[$SaveSummaryType]; } else { - $sortby_display = $detail_array[$_POST['SortBy']]; + $SortBy_Display = $Detail_Array[$_POST['SortBy']]; } - fprintf($FileHandle, '"'. _('Purchase Order Report') . '","' . $_POST['ReportType'] . ' '._('By').' '.$sortby_display ."\n"); + fprintf($FileHandle, '"'. _('Purchase Order Report') . '","' . $_POST['ReportType'] . ' '._('By').' '.$SortBy_Display ."\n"); fprintf($FileHandle, '"'. _('Date Type') . '","' . $_POST['DateType'] . '"'. "\n"); fprintf($FileHandle, '"'. _('Date Range') . '","' . $_POST['FromDate'] . _(' To ') . $_POST['ToDate'] . '"'."\n"); if (strlen(trim($PartNumber)) > 0) { @@ -1246,11 +1252,11 @@ $myrow['linestatus'], ConvertSQLDate($myrow['deliverydate']), $myrow['description']); - $lastdecimalplaces = $myrow['decimalplaces']; - $totalqty += $myrow['quantityord']; - $totalextcost += $myrow['extcost']; - $totalextprice += $myrow['extprice']; - $totalinvqty += $myrow['qtyinvoiced']; + $LastDecimalPlaces = $myrow['decimalplaces']; + $TotalQty += $myrow['quantityord']; + $TotalExtCost += $myrow['extcost']; + $TotalExtPrice += $myrow['extprice']; + $TotalInvQty += $myrow['qtyinvoiced']; } //END WHILE LIST LOOP // Print totals fprintf($FileHandle, '"%s","%s","%s","%s","%s",%s,%s,%s,%s,"%s","%s"'."\n", @@ -1259,10 +1265,10 @@ ' ', ' ', ' ', - number_format($totalqty,2), - number_format($totalextcost,2), - number_format($totalextprice,2), - number_format($totalinvqty,2), + number_format($TotalQty,2), + number_format($TotalExtCost,2), + number_format($TotalExtPrice,2), + number_format($TotalInvQty,2), ' ', ' '); } else { @@ -1298,11 +1304,11 @@ $myrow['linestatus'], ConvertSQLDate($myrow['deliverydate']), $myrow['description']); - $lastdecimalplaces = $myrow['decimalplaces']; - $totalqty += $myrow['quantityord']; - $totalextcost += $myrow['extcost']; - $totalextprice += $myrow['extprice']; - $totalinvqty += $myrow['qtyinvoiced']; + $LastDecimalPlaces = $myrow['decimalplaces']; + $TotalQty += $myrow['quantityord']; + $TotalExtCost += $myrow['extcost']; + $TotalExtPrice += $myrow['extprice']; + $TotalInvQty += $myrow['qtyinvoiced']; } //END WHILE LIST LOOP // Print totals fprintf($FileHandle, '"%s","%s","%s","%s","%s",%s,%s,%s,%s,"%s","%s"'."\n", @@ -1311,10 +1317,10 @@ ' ', ' ', ' ', - number_format($totalqty,$lastdecimalplaces), - number_format($totalextcost,2), - number_format($totalextprice,2), - number_format($totalinvqty,$lastdecimalplaces), + number_format($TotalQty,$LastDecimalPlaces), + number_format($TotalExtCost,2), + number_format($TotalExtPrice,2), + number_format($TotalInvQty,$LastDecimalPlaces), " ", " "); } @@ -1383,20 +1389,20 @@ number_format($myrow['qtyinvoiced'],$myrow['decimalplaces']), $suppname); print '<br/>'; - $lastdecimalplaces = $myrow['decimalplaces']; - $totalqty += $myrow['quantityord']; - $totalextcost += $myrow['extcost']; - $totalextprice += $myrow['extprice']; - $totalinvqty += $myrow['qtyinvoiced']; + $LastDecimalPlaces = $myrow['decimalplaces']; + $TotalQty += $myrow['quantityord']; + $TotalExtCost += $myrow['extcost']; + $TotalExtPrice += $myrow['extprice']; + $TotalInvQty += $myrow['qtyinvoiced']; } //END WHILE LIST LOOP // Print totals fprintf($FileHandle, '"%s","%s",%s,%s,%s,%s,"%s"'."\n", 'Totals', _('Lines - ') . $linectr, - number_format($totalqty,$lastdecimalplaces), - number_format($totalextcost,2), - number_format($totalextprice,2), - number_format($totalinvqty,$lastdecimalplaces), + number_format($TotalQty,$LastDecimalPlaces), + number_format($TotalExtCost,2), + number_format($TotalExtPrice,2), + number_format($TotalInvQty,$LastDecimalPlaces), ' '); } // End of if ($_POST['ReportType'] fclose($FileHandle); @@ -1412,7 +1418,7 @@ // Display form fields. This function is called the first time // the page is called. - echo "<form action=" . $_SERVER['PHP_SELF'] . "?" . SID ." method=post>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class=selection>'; @@ -1461,15 +1467,15 @@ } echo '<tr><td>' . _('Supplier Name') . ':</td>'; - echo "<td><select name='SupplierNameOp'>"; - echo "<option selected value='LIKE'>" . _('Begins With'); - echo "<option value='Equals'>" . _('Equals'); + echo '<td><select name="SupplierNameOp">'; + echo '<option selected value="LIKE">' . _('Begins With') . '</option>'; + echo '<option value="Equals">' . _('Equals') . '</option>'; echo '</select>'; - echo "  <input type='Text' name='SupplierName' size=30 maxlength=30 value="; + echo '  <input type="text" name="SupplierName" size=30 maxlength=30 value="'; if (isset($_POST['SupplierName'])) { - echo $_POST['SupplierName'] . "></td></tr>"; + echo $_POST['SupplierName'] . '" /></td></tr>'; } else { - echo "></td></tr>"; + echo '" /></td></tr>'; } echo '<tr><td>' . _('Order Number') . ':</td>'; @@ -1482,56 +1488,55 @@ } echo '<tr><td>' . _('Line Item Status') . ':</td>'; - echo "<td><select name='LineStatus'>"; - echo "<option selected value='All'>" . _('All'); - echo "<option value='Completed'>" . _('Completed'); - echo "<option value='Open'>" . _('Not Completed'); + echo '<td><select name="LineStatus">'; + echo '<option selected value="All">' . _('All') . '</option>'; + echo '<option value="Completed">' . _('Completed') . '</option>'; + echo '<option value="Open">' . _('Not Completed') . '</option>'; echo '</select></td><td> </td></tr>'; - echo '<tr><td>' . _('Stock Categories') . ":</td><td><select name='Category'>"; - $sql='SELECT categoryid, categorydescription FROM stockcategory'; + echo '<tr><td>' . _('Stock Categories') . ':</td><td><select name="Category">'; + $sql="SELECT categoryid, categorydescription FROM stockcategory"; $CategoryResult= DB_query($sql,$db); - echo '<option selected value="All">' . _('All Categories'); + echo '<option selected value="All">' . _('All Categories') . '</option>'; While ($myrow = DB_fetch_array($CategoryResult)){ - echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categorydescription']; + echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; } echo '</select></td></tr>'; echo '<tr><td> </td></tr>'; echo '<tr><td>' . _('Sort By') . ':</td>'; - echo "<td><select name='SortBy'>"; - echo "<option selected value='purchorderdetails.orderno'>" . _('Order Number'); - echo "<option value='purchorderdetails.itemcode'>" . _('Part Number'); - echo "<option value='suppliers.supplierid,purchorderdetails.orderno'>" . _('Supplier Number'); - echo "<option value='suppliers.suppname,suppliers.supplierid,purchorderdetails.orderno'>" . _('Supplier Name'); + echo '<td><select name="SortBy">'; + echo '<option selected value="purchorderdetails.orderno">' . _('Order Number') . '</option>'; + echo '<option value="purchorderdetails.itemcode">' . _('Part Number') . '</option>'; + echo '<option value="suppliers.supplierid,purchorderdetails.orderno">' . _('Supplier Number') . '</option>'; + echo '<option value="suppliers.suppname,suppliers.supplierid,purchorderdetails.orderno">' . _('Supplier Name') . '</option>'; echo '</select></td><td> </td></tr>'; echo '<tr><td> </td></tr>'; echo '<tr><td>' . _('Summary Type') . ':</td>'; - echo "<td><select name='SummaryType'>"; - echo "<option selected value='orderno'>" . _('Order Number'); - echo "<option value='itemcode'>" . _('Part Number'); - echo "<option value='extprice'>" . _('Extended Price'); - echo "<option value='supplierno'>" . _('Supplier Number'); - echo "<option value='suppname'>" . _('Supplier Name'); - echo "<option value='month'>" . _('Month'); - echo "<option value='categoryid'>" . _('Stock Category'); + echo '<td><select name="SummaryType">'; + echo '<option selected value="orderno">' . _('Order Number') . '</option>'; + echo '<option value="itemcode">' . _('Part Number') . '</option>'; + echo '<option value="extprice">' . _('Extended Price') . '</option>'; + echo '<option value="supplierno">' . _('Supplier Number') . '</option>'; + echo '<option value="suppname">' . _('Supplier Name') . '</option>'; + echo '<option value="month">' . _('Month') . '</option>'; + echo '<option value="categoryid">' . _('Stock Category') . '</option>'; echo '</select></td><td> </td></tr>'; - echo " - <tr><td> </td></tr> - <tr> - <td colspan=4><div class=centre><input type='submit' name='submit' value='" . _('Run Inquiry') . "'></div></td> + echo '<tr><td> </td></tr> + <tr> + <td colspan=4><div class=centre><input type="submit" name="submit" value="' . _('Run Inquiry') . '"></div></td> </tr> <tr> - <td colspan=4><div class=centre><input type='submit' name='submitcsv' value='" . _('Export as csv file') . "'></div></td> + <td colspan=4><div class=centre><input type="submit" name="submitcsv" value="' . _('Export as csv file') . '"></div></td> </tr> </table> - <br/>"; + <br/>'; echo '</form>'; } // End of function display() include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2011-04-11 10:49:45 UTC (rev 4547) +++ trunk/Stocks.php 2011-04-12 10:33:45 UTC (rev 4548) @... [truncated message content] |
From: <dai...@us...> - 2011-04-14 10:28:59
|
Revision: 4550 http://web-erp.svn.sourceforge.net/web-erp/?rev=4550&view=rev Author: daintree Date: 2011-04-14 10:28:52 +0000 (Thu, 14 Apr 2011) Log Message: ----------- variosu Modified Paths: -------------- trunk/CustomerAllocations.php trunk/FixedAssetTransfer.php trunk/GeocodeSetup.php trunk/WorkOrderReceive.php trunk/Z_index.php Removed Paths: ------------- trunk/Z_PriceChanges.php Modified: trunk/CustomerAllocations.php =================================================================== --- trunk/CustomerAllocations.php 2011-04-14 09:18:16 UTC (rev 4549) +++ trunk/CustomerAllocations.php 2011-04-14 10:28:52 UTC (rev 4550) @@ -1,5 +1,5 @@ <?php -/* $Revision: 1.30 $ */ + /* $Id$*/ /* @@ -10,7 +10,6 @@ */ include('includes/DefineCustAllocsClass.php'); -//$PageSecurity = 3; include('includes/session.inc'); $title = _('Customer Receipt') . '/' . _('Credit Note Allocations'); include('includes/header.inc'); @@ -70,7 +69,7 @@ if ($TotalAllocated + $_SESSION['Alloc']->TransAmt > 0.008) { prnMsg(_('Allocation could not be processed because the amount allocated is more than the').' ' . - $_SESSION['Alloc']->TransTypeName . ' '._('being allocated') . '<br>' . _('Total allocated').' = ' . + $_SESSION['Alloc']->TransTypeName . ' '._('being allocated') . '<br />' . _('Total allocated').' = ' . $TotalAllocated . ' '._('and the total amount of the') .' ' . $_SESSION['Alloc']->TransTypeName . ' '. _('was').' ' . -$_SESSION['Alloc']->TransAmt,'error'); $InputError=1; @@ -324,22 +323,22 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Allocate Receipt') . '" alt="" />' . ' ' . _('Allocate Receipts') . '</p>'; - $TableHeader = "<tr> - <th>" . _('Trans Type') . "</th> - <th>" . _('Customer') . "</th> - <th>" . _('Cust No') . "</th> - <th>" . _('Number') . "</th> - <th>" . _('Date') . "</th> - <th>" . _('Total') . "</th> - <th>" . _('To Alloc') . "</th> - <th>" . _('Action') . "</th> - </tr>"; + $TableHeader = '<tr> + <th>' . _('Trans Type') . '</th> + <th>' . _('Customer') . '</th> + <th>' . _('Cust No') . '</th> + <th>' . _('Number') . '</th> + <th>' . _('Date') . '</th> + <th>' . _('Total') . '</th> + <th>' . _('To Alloc') . '</th> + <th>' . _('Action') . '</th> + </tr>'; if (isset($_POST['AllocTrans'])) { // Page called with trans number - echo "<form action='" . $_SERVER['PHP_SELF'] . '?' . SID . "' method=post>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo "<input type=hidden name='AllocTrans' value=" . $_POST['AllocTrans'] . '>'; + echo '<input type=hidden name="AllocTrans" value="' . $_POST['AllocTrans'] . '" />'; // Show trans already allocated and potential new allocations @@ -347,20 +346,20 @@ echo '<tr><th colspan=7><div class="centre"><font color=blue><b>' . $_SESSION['Alloc']->DebtorNo . ' - ' . $_SESSION['Alloc']->CustomerName . '</b></div>'; if ($_SESSION['Alloc']->TransExRate != 1) { - echo '<br>'._('Amount in customer currency').' <b>' . + echo '<br />'._('Amount in customer currency').' <b>' . number_format(-$_SESSION['Alloc']->TransAmt,2) . '</b><i> ('._('converted into local currency at an exchange rate of'). ' ' . $_SESSION['Alloc']->TransExRate . ')</i>'; } - echo "</th></tr><tr> - <th>" . _('Trans') . '<br>' . _('Type') . "</th> - <th>" . _('Trans') . '<br>' . _('Number') . "</th> - <th>" . _('Trans') . '<br>' . _('Date') . "</th> - <th>" . _('Total') . '<br>' . _('Amount') . "</th> - <th>" . _('Yet to') . '<br>' . _('Allocate') . "</th> - <th>" . _('This') . '<br>' . _('Allocation') . "</th> - <th>" . _('Running') . '<br>' . _('Balance') . "</th> - </tr>"; + echo '</th></tr><tr> + <th>' . _('Trans') . '<br />' . _('Type') . '</th> + <th>' . _('Trans') . '<br />' . _('Number') . '</th> + <th>' . _('Trans') . '<br />' . _('Date') . '</th> + <th>' . _('Total') . '<br />' . _('Amount') . '</th> + <th>' . _('Yet to') . '<br />' . _('Allocate') . '</th> + <th>' . _('This') . '<br />' . _('Allocation') . '</th> + <th>' . _('Running') . '<br />' . _('Balance') . '</th> + </tr>'; $Counter = 0; $TotalAllocated = 0; @@ -380,37 +379,37 @@ $curTrans = " "; } - echo "<td>" . $AllocnItem->TransType . "</td> - <td>" . $AllocnItem->TypeNo . "</td> - <td class=number>" . $AllocnItem->TransDate . "</td> - <td class=number>" . number_format($AllocnItem->TransAmount,2) . "</td> - <td class=number>" . number_format($YetToAlloc,2) . "</td>"; + echo '<td>' . $AllocnItem->TransType . '</td> + <td>' . $AllocnItem->TypeNo . '</td> + <td class=number>' . $AllocnItem->TransDate . '</td> + <td class=number>' . number_format($AllocnItem->TransAmount,2) . '</td> + <td class=number>' . number_format($YetToAlloc,2) . '</td>'; $j++; if ($AllocnItem->TransAmount < 0) { $balance+=$YetToAlloc; - echo "<td>" . $curTrans ."</td><td class=number>" . number_format($balance,2) . "</td></tr>"; + echo '<td>' . $curTrans .'</td><td class="number">' . number_format($balance,2) . '</td></tr>'; } else { - echo "<input type=hidden name='YetToAlloc" . $Counter . "' value=" . round($YetToAlloc,2) . '></td>'; - echo "<td class=number><input tabindex=".$j." type='checkbox' name='All" . $Counter . "'"; + echo '<input type=hidden name="YetToAlloc' . $Counter . '" value="' . round($YetToAlloc,2) . '"></td>'; + echo '<td class="number"><input tabindex="' . $j .'" type="checkbox" name="All' . $Counter . '"'; if (ABS($AllocnItem->AllocAmt-$YetToAlloc) < 0.01) { - echo ' value=' . True . '>'; + echo ' value=' . True . ' />'; } else { - echo '>'; + echo ' />'; } $balance += $YetToAlloc-$AllocnItem->AllocAmt; $j++; - echo "<input tabindex=".$j." type=text class=number name='Amt" . $Counter ."' maxlength=12 size=13 value=" . round($AllocnItem->AllocAmt,2) . "> - <input type=hidden name='AllocID" . $Counter . "' value=" . $AllocnItem->ID . '></td> - <td class=number>' . number_format($balance,2) . '</td></tr>'; + echo '<input tabindex="'.$j.'" type="text" class="number" name="Amt' . $Counter .'" maxlength=12 size=13 value="' . round($AllocnItem->AllocAmt,2) . '" /> + <input type=hidden name="AllocID' . $Counter . '" value="' . $AllocnItem->ID . '"></td> + <td class="number">' . number_format($balance,2) . '</td></tr>'; } $TotalAllocated = $TotalAllocated + round($AllocnItem->AllocAmt,2); $Counter++; } - echo "<tr> - <td colspan=5 class=number><b>"._('Total Allocated').':</b></td> + echo '<tr> + <td colspan=5 class="number"><b>'._('Total Allocated').':</b></td> <td class=number><b><u>' . number_format($TotalAllocated,2) . '</u></b></td>'; $j++; echo '<td rowspan=2> @@ -421,9 +420,9 @@ <td class=number><b>' . number_format($remaining-$TotalAllocated,2).'</b></td> </tr>'; echo '</table><p>'; - echo "<input type=hidden name=TotalNumberOfAllocs value=" . $Counter . ">"; - echo "<div class='centre'><input tabindex=".$j." type=submit name=UpdateDatabase value=" . _('Process Allocations') . ">"; - echo "<input tabindex=".$j." type=submit name=Cancel value=" . _('Cancel') . "></div>"; + echo '<input type="hidden" name="TotalNumberOfAllocs" value="' . $Counter . '">'; + echo '<div class="centre"><input tabindex="' . $j . '" type="submit" name="UpdateDatabase" value="' . _('Process Allocations') . '">'; + echo '<input tabindex="' . $j . '" type="submit" name="Cancel" value="' . _('Cancel') . '"></div>'; } elseif (isset($_GET['DebtorNo'])) { // Page called with customer code @@ -467,14 +466,14 @@ echo '<tr class="OddTableRows">';; $k++; } - echo "<td>" . $myrow['typename'] ."</td> - <td>" . $myrow['name'] . "</td> - <td>" . $myrow['debtorno'] . "</td> - <td>" . $myrow['transno'] . "</td> - <td>" . ConvertSQLDate($myrow['trandate']) . "</td> - <td class=number>" . number_format($myrow['total'],2) . "</td> - <td class=number>" . number_format($myrow['total']-$myrow['alloc'],2) . "</td>"; - echo '<td><a href=' . $_SERVER['PHP_SELF']. '?' . SID . '&AllocTrans=' . $myrow['id'] . '>' . _('Allocate') . '</a></td></tr>'; + echo '<td>' . $myrow['typename'] .'</td> + <td>' . $myrow['name'] . '</td> + <td>' . $myrow['debtorno'] . '</td> + <td>' . $myrow['transno'] . '</td> + <td>' . ConvertSQLDate($myrow['trandate']) . '</td> + <td class=number>' . number_format($myrow['total'],2) . '</td> + <td class=number>' . number_format($myrow['total']-$myrow['alloc'],2) . '</td>'; + echo '<td><a href=' . $_SERVER['PHP_SELF']. '?AllocTrans=' . $myrow['id'] . '>' . _('Allocate') . '</a></td></tr>'; } DB_free_result($result); echo '</table><p>'; @@ -516,7 +515,7 @@ if ( $curDebtor != $myrow['debtorno'] ) { if ( $curTrans > 1 ) { - echo "<tr class='OddTableRows'><td colspan=7 class=number>" . number_format($balance,2) . "</td><td><b>Balance</b></td></tr>"; + echo '<tr class="OddTableRows"><td colspan=7 class="number">' . number_format($balance,2) . '</td><td><b>' . _('Balance') . '</b></td></tr>'; } $balance = 0; @@ -548,20 +547,22 @@ $k++; } - echo "<td>" . $myrow['typename'] ."</td> - <td>" . $myrow['name'] . "</td> - <td>" . $myrow['debtorno'] . "</td> - <td>" . $myrow['transno'] . "</td> - <td>" . ConvertSQLDate($myrow['trandate']) . "</td> - <td class=number>" . number_format($myrow['total'],2) . "</td> - <td class=number>" . number_format($myrow['total']-$myrow['alloc'],2) . "</td>"; - echo '<td>' . $allocate . '</td></tr>'; + echo '<td>' . $myrow['typename'] .'</td> + <td>' . $myrow['name'] . '</td> + <td>' . $myrow['debtorno'] . '</td> + <td>' . $myrow['transno'] . '</td> + <td>' . ConvertSQLDate($myrow['trandate']) . '</td> + <td class=number>' . number_format($myrow['total'],2) . '</td> + <td class=number>' . number_format($myrow['total']-$myrow['alloc'],2) . '</td> + <td>' . $allocate . '</td></tr>'; if ( $curTrans > $trans ) { if (!isset($balance)) { $balance=0; } - echo "<tr class='OddTableRows'><td colspan=7 class=number>" . number_format($balance,2) . "</td><td><b>Balance</b></td></tr>"; + echo '<tr class="OddTableRows"> + <td colspan="7" class="number">' . number_format($balance,2) .'</td> + <td><b>' . _('Balance') . '</b></td></tr>'; } } DB_free_result($result); Modified: trunk/FixedAssetTransfer.php =================================================================== --- trunk/FixedAssetTransfer.php 2011-04-14 09:18:16 UTC (rev 4549) +++ trunk/FixedAssetTransfer.php 2011-04-14 10:28:52 UTC (rev 4550) @@ -1,6 +1,6 @@ <?php -//$PageSecurity = 11; +/* $Id$*/ include('includes/session.inc'); @@ -26,7 +26,7 @@ } else { $sql='SELECT categoryid, categorydescription FROM fixedassetcategories'; $result=DB_query($sql, $db); - echo '<form action="'. $_SERVER['PHP_SELF'] . '?' . SID .'" method=post>'; + echo '<form action="'. $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . '</p>'; @@ -121,11 +121,11 @@ while ($myrow=DB_fetch_array($Result)) { echo '<tr><td>'.$myrow['assetid'].'</td> - <td>'.$myrow['description'].'</td> - <td>'.$myrow['serialno'].'</td> - <td class=number>'.number_format($myrow['cost'],2).'</td> - <td class=number>'.number_format($myrow['accumdepn'],2).'</td> - <td>'.$myrow['locationdescription'].'</td>'; + <td>'.$myrow['description'].'</td> + <td>'.$myrow['serialno'].'</td> + <td class=number>'.number_format($myrow['cost'],2).'</td> + <td class=number>'.number_format($myrow['accumdepn'],2).'</td> + <td>'.$myrow['locationdescription'].'</td>'; echo '<td><select name="Location'.$myrow['assetid'].'" onChange="ReloadForm(Move'.$myrow['assetid'].')">'; echo '<option></option>'; while ($LocationRow=DB_fetch_array($LocationResult)) { @@ -137,11 +137,11 @@ } DB_data_seek($LocationResult,0); echo '</select></td>'; - echo '<input type=hidden name=AssetCat value="' . $_POST['AssetCat'].'"'; - echo '<input type=hidden name=Keywords value="' . $_POST['Keywords'].'"'; - echo '<input type=hidden name=AssetID value="' . $_POST['AssetID'].'"'; - echo '<input type=hidden name=Search value="' . $_POST['Search'].'"'; - echo '<td><input type=submit name="Move'.$myrow['assetid'].'" value=Move></td>'; + echo '<input type="hidden" name="AssetCat" value="' . $_POST['AssetCat'].'"'; + echo '<input type="hidden" name="Keywords" value="' . $_POST['Keywords'].'"'; + echo '<input type="hidden" name="AssetID" value="' . $_POST['AssetID'].'"'; + echo '<input type="hidden" name="Search" value="' . $_POST['Search'].'"'; + echo '<td><input type="submit" name="Move'.$myrow['assetid'].'" value=Move></td>'; echo '</tr>'; } echo '</table></form>'; Modified: trunk/GeocodeSetup.php =================================================================== --- trunk/GeocodeSetup.php 2011-04-14 09:18:16 UTC (rev 4549) +++ trunk/GeocodeSetup.php 2011-04-14 10:28:52 UTC (rev 4550) @@ -1,7 +1,7 @@ <?php /* $Id$*/ -//$PageSecurity = 3; + include('includes/session.inc'); $title = _('Geocode Maintenance'); include('includes/header.inc'); @@ -139,15 +139,16 @@ '<a href="http://www.batchgeocode.com/lookup/" target="_blank">http://www.batchgeocode.com/lookup/</a></b>'; echo '<p>'. _('Set the maps centre point using the Center Longitude and Center Latitude. Set the maps screen size using the height and width in pixels (px)').'</div><br>'; echo '<table border=1>'; - echo "<tr> - <th>". _('Geocode ID') ."</th> - <th>". _('Geocode Key') ."</th> - <th>". _('Center Longitude') ."</th> - <th>". _('Center Latitude') ."</th> - <th>". _('Map height (px)') ."</th> - <th>". _('Map width (px)') ."</th> - <th>". _('Map host') .'</th>'; - + + echo '<tr> + <th>'. _('Geocode ID') .'</th> + <th>'. _('Geocode Key') .'</th> + <th>'. _('Center Longitude') .'</th> + <th>'. _('Center Latitude') .'</th> + <th>'. _('Map height (px)') .'</th> + <th>'. _('Map width (px)') .'</th> + <th>'. _('Map host') .'</th>'; + $k=0; //row colour counter while ($myrow=DB_fetch_row($result)) { @@ -159,15 +160,15 @@ $k=1; } - printf("<td>%s</td> + printf('<td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> - <td><a href=\"%s?SelectedParam=%s\">" . _('Edit') . "</a></td> - <td><a href=\"%s?SelectedParam=%s&delete=%s\">". _('Delete') .'</a></td> + <td><a href=\'%s?SelectedParam=%s\'>' . _('Edit') . '</a></td> + <td><a href=\'%s?SelectedParam=%s&delete=%s\'>'. _('Delete') .'</a></td> </tr>', $myrow[0], $myrow[1], @@ -193,7 +194,7 @@ if (!isset($_GET['delete'])) { - 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'] . '" />'; if (isset($SelectedParam) and ($InputError!=1)) { @@ -220,11 +221,12 @@ $_POST['map_width'] = $myrow['map_width']; $_POST['map_host'] = $myrow['map_host']; - echo "<input type=hidden name='SelectedParam' VALUE='" . $SelectedParam . "'>"; - echo "<input type=hidden name='geocodeid' VALUE='" . $_POST['geocodeid'] . "'>"; + echo '<input type="hidden" name="SelectedParam" value="' . $SelectedParam . '" />'; + echo '<input type="hidden" name="geocodeid" value="' . $_POST['geocodeid'] . '" />'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Geocode Setup') . '" alt="">'. _('Setup configuration for Geocoding of Customers and Suppliers') .'</p>'; - echo "<table><tr><td>". _('Geocode Code') .':</td><td>'; - echo $_POST['geocodeid'] . '</td></tr>'; + echo '<table> + <tr><td>'. _('Geocode Code') .':</td> + <td>' . $_POST['geocodeid'] . '</td></tr>'; } else { //end of if $SelectedParam only do the else when a new record is being entered if (!isset($_POST['geocodeid'])) { @@ -242,29 +244,28 @@ $_POST['geocode_key'] = ''; } echo '<br><tr> - <td>'. _('Geocode Key') .":</td> - <td><input " . (in_array('geocode_key',$Errors) ? 'class="inputerror"' : '' ) . - " tabindex=2 type='text' name='geocode_key' VALUE='". $_POST['geocode_key'] ."' size=28 maxlength=300> - </td></tr> - <tr><td>". _('Geocode Center Long') . "</td> - <td><input tabindex=3 type='text' name='center_long' VALUE='". $_POST['center_long'] ."' size=28 maxlength=300></td></tr> + <td>'. _('Geocode Key') .':</td> + <td><input ' . (in_array('geocode_key',$Errors) ? 'class="inputerror"' : '' ) . + ' tabindex=2 type="text" name="geocode_key" VALUE="'. $_POST['geocode_key'] .'" size=28 maxlength=300> + </td></tr> + + <tr><td>'. _('Geocode Center Long') . '</td> + <td><input tabindex=3 type="text" name="center_long" VALUE="'. $_POST['center_long'] .'" size=28 maxlength=300></td></tr> -<tr><td>". _('Geocode Center Lat') . "</td> - <td><input tabindex=4 type='text' name='center_lat' VALUE='". $_POST['center_lat'] ."' size=28 maxlength=300></td></tr> + <tr><td>'. _('Geocode Center Lat') . '</td> + <td><input tabindex=4 type="text" name="center_lat" VALUE="'. $_POST['center_lat'] .'" size=28 maxlength=300></td></tr> -<tr><td>". _('Geocode Map Height') . "</td> - <td><input tabindex=5 type='text' name='map_height' VALUE='". $_POST['map_height'] ."' size=28 maxlength=300></td></tr> + <tr><td>'. _('Geocode Map Height') . '</td> + <td><input tabindex=5 type="text" name="map_height" VALUE="'. $_POST['map_height'] .'" size=28 maxlength=300></td></tr> -<tr><td>". _('Geocode Map Width') . "</td> - <td><input tabindex=6 type='text' name='map_width' VALUE='". $_POST['map_width'] ."' size=28 maxlength=300></td></tr> + <tr><td>'. _('Geocode Map Width') . '</td> + <td><input tabindex=6 type="text" name="map_width" VALUE="'. $_POST['map_width'] .'" size=28 maxlength=300></td></tr> -<tr><td>". _('Geocode Host') . "</td> - <td><input tabindex=7 type='text' name='map_host' VALUE='". $_POST['map_host'] ."' size=20 maxlength=300></td></tr> - - - </table> - <div class='centre'><input tabindex=4 type='Submit' name='submit' value='" . _('Enter Information') . "'</div><br><br> - </form>"; + <tr><td>'. _('Geocode Host') . '</td> + <td><input tabindex=7 type="text" name="map_host" VALUE="'. $_POST['map_host'] .'" size=20 maxlength=300></td></tr> + </table> + <div class="centre"><input tabindex=4 type="Submit" name="submit" value="' . _('Enter Information') . '"</div><br><br> + </form>'; echo '<div class="page_help_text">' . _('When ready, click on the link below to run the GeoCode process. This will Geocode all Branches and Suppliers. This may take some time. Errors will be returned to the screen.') . '</p>'; echo '<p>' . _('Suppliers and Customer Branches are geocoded when being entered/updated. You can rerun the geocode process from this screen at any time.') . '</p></div><br>'; Modified: trunk/WorkOrderReceive.php =================================================================== --- trunk/WorkOrderReceive.php 2011-04-14 09:18:16 UTC (rev 4549) +++ trunk/WorkOrderReceive.php 2011-04-14 10:28:52 UTC (rev 4550) @@ -10,7 +10,7 @@ echo '<a href="'. $rootpath . '/WorkOrderCosting.php?WO=' . $_REQUEST['WO'] . '">' . _('Back to Costing'). '</a><br>'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/group_add.png" title="' . - _('Search') . '" alt="" />' . ' ' . $title.'</p'; + _('Search') . '" alt="" />' . ' ' . $title.'</p>'; echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; Deleted: trunk/Z_PriceChanges.php =================================================================== --- trunk/Z_PriceChanges.php 2011-04-14 09:18:16 UTC (rev 4549) +++ trunk/Z_PriceChanges.php 2011-04-14 10:28:52 UTC (rev 4550) @@ -1,141 +0,0 @@ -<?php -/* $Id$*/ - -include('includes/session.inc'); -$title=_('Update Pricing'); -include('includes/header.inc'); - - -echo '<br />' . _('This page updates already existing prices for a specified sales type (price list)') . '. ' . _('Choose between updating only customer special prices where the customer is set up under the price list selected, or all prices under the sales type or just specific prices for a customer for the stock category selected'); - -prnMsg (_('This script takes no account of start and end dates of prices and updates all historical prices as well as current prices - better to use new scripts under Inventory -> Maintenance'),'warn'); - -echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; -echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - -$SQL = "SELECT sales_type, typeabbrev FROM salestypes"; - -$result = DB_query($SQL,$db); - -echo '<p><table> - <tr> - <td>' . _('Select the Price List to update the costs for') .':</td> - <td><select name="PriceList">'; - -if (!isset($_POST['PriceList'])){ - echo '<option selected value=0>' . _('No Price List Selected') . '</option>'; -} - -while ($PriceLists=DB_fetch_array($result)){ - echo '<option value="' . $PriceLists['typeabbrev'] . '">' . $PriceLists['sales_type'] . '</option>'; -} - -echo '</select></td></tr>'; - -echo '<tr><td>' . _('Category') . ':</td> - <td><select name="StkCat">'; - -$sql = "SELECT categoryid, categorydescription FROM stockcategory"; - -$ErrMsg = _('The stock categories could not be retrieved because'); -$DbgMsg = _('The SQL used to retrieve stock categories and failed was'); -$result = DB_query($sql,$db,$ErrMsg,$DbgMsg); - -while ($myrow=DB_fetch_array($result)){ - if ($myrow['categoryid']==$_POST['StkCat']){ - echo '<option selected value="'. $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; - } else { - echo '<option value="'. $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; - } -} -echo '</select></td></tr>'; - -echo '<tr><td>' . _('Which Prices to update') . ":</td> - <td><select name='WhichPrices'>"; - echo "<option value='Only Non-customer special prices'>" . _('Only Non-customer special prices') . '</option>'; - echo "<option value='Only customer special prices'>" . _('Only customer special prices') . '</option>'; - echo "<option value='Both customer special prices and non-customer special prices'>" . _('Both customer special prices and non-customer special prices') . '</option>'; - echo "<option value='Selected customer special prices only'>" . $_SESSION['CustomerID'] . ' ' . _('customer special prices only') . '</option>'; -echo '</select></td></tr>'; - -if (!isset($_POST['IncreasePercent'])){ - $_POST['IncreasePercent']=0; -} - -echo '<tr><td>' . _('Percentage Increase (positive) or decrease (negative)') . "</td> - <td><input name='IncreasePercent' size=4 maxlength=4 value=" . $_POST['IncreasePercent'] . "></td></tr></table>"; - - -echo "<div class='centre'><p><input type=submit name='UpdatePrices' value='" . _('Update Prices') . '\' onclick="return confirm(\'' . _('Are you sure you wish to update all the prices according to the criteria selected?') . '\');"></div>'; - -echo '</form>'; - -if (isset($_POST['UpdatePrices']) AND isset($_POST['StkCat'])){ - - echo '<br />' . _('So we are using a price list/sales type of') .' : ' . $_POST['PriceList']; - echo '<br />' . _('and a stock category code of') . ' : ' . $_POST['StkCat']; - echo '<br />' . _('and a increase percent of') . ' : ' . $_POST['IncreasePercent']; - - if ($_POST['PriceList']=='0'){ - echo '<br />' . _('The price list/sales type to be updated must be selected first'); - include ('includes/footer.inc'); - exit; - } - - if (ABS($_POST['IncreasePercent']) < 0.5 OR ABS($_POST['IncreasePercent'])>40 OR !is_numeric($_POST['IncreasePercent'])){ - - echo '<br />' . _('The increase or decrease to be applied is expected to be an integer between 1 and 40 it is not necessary to enter the').' '. '%'.' '. _('sign') . ' - ' . _('the amount is assumed to be a percentage'); - include ('includes/footer.inc'); - exit; - } - - echo '<p>' . _('Price list') . ' ' . $_POST['PriceList'] . ' ' . _('prices for') . ' ' . $_POST['WhichPrices'] . ' ' . _('for the stock category') . ' ' . $_POST['StkCat'] . ' ' . _('will been incremented by') . ' ' . $_POST['IncreasePercent'] . ' ' . _('percent'); - - $sql = "SELECT stockid FROM stockmaster WHERE categoryid='" . $_POST['StkCat'] . "'"; - $PartsResult = DB_query($sql,$db); - - $IncrementPercentage = $_POST['IncreasePercent']/100; - - while ($myrow=DB_fetch_array($PartsResult)){ - - if ($_POST['WhichPrices'] == 'Only Non-customer special prices'){ - - $sql = "UPDATE prices SET price=price*(1+" . $IncrementPercentage . ") - WHERE typeabbrev='" . $_POST['PriceList'] . "' - AND stockid='" . $myrow['stockid'] . "' - AND typeabbrev='" . $_POST['PriceList'] . "' - AND debtorno=''"; - - }else if ($_POST['WhichPrices'] == 'Only customer special prices'){ - - $sql = "UPDATE prices SET price=price*(1+" . $IncrementPercentage . ") - WHERE typeabbrev='" . $_POST['PriceList'] . "' - AND stockid='" . $myrow['stockid'] . "' - AND typeabbrev='" . $_POST['PriceList'] . "' - AND debtorno!=''"; - - } else if ($_POST['WhichPrices'] == 'Both customer special prices and non-customer special prices'){ - - $sql = "UPDATE prices SET price=price*(1+" . $IncrementPercentage . ") - WHERE typeabbrev='" . $_POST['PriceList'] . "' - AND stockd='" . $myrow['stockid'] . "' - AND typeabbrev='" . $_POST['PriceList'] . "'"; - - } else if ($_POST['WhichPrices'] == 'Selected customer special prices only'){ - - $sql = "UPDATE prices SET price=price*(1+" . $IncrementPercentage . ") - WHERE typeabbrev='" . $_POST['PriceList'] . "' - AND stockid='" . $myrow['stockid'] . "' - AND typeabbrev='" . $_POST['PriceList'] . "' - AND debtorno='" . $_SESSION['CustomerID'] . "'"; - - } - - $result = DB_query($sql,$db); - $ErrMsg =_('Error updating prices for') . ' ' . $myrow['stockid'] . ' ' . _('because'); - prnMsg(_('Updating prices for') . ' ' . $myrow['stockid'],'info'); - } - -} -include('includes/footer.inc'); -?> \ No newline at end of file Modified: trunk/Z_index.php =================================================================== --- trunk/Z_index.php 2011-04-14 09:18:16 UTC (rev 4549) +++ trunk/Z_index.php 2011-04-14 10:28:52 UTC (rev 4550) @@ -1,6 +1,5 @@ <?php /* $Id$*/ -// $PageSecurity = 15; include('includes/session.inc'); $title = _('Special Fixes and Utilities') . ' - ' . _('Only System Administrator'); @@ -8,38 +7,36 @@ echo '<p>' . _('BE VERY CAREFUL DO NOT RUN THESE LINKS BELOW WITHOUT UNDERSTANDING EXACTLY WHAT THEY DO AND THE IMPLICATIONS'); - echo "<p><a href='$rootpath/Z_ReApplyCostToSA.php?" . SID . "'>". _('Re-apply costs to Sales Analysis') . '</a>'; - echo "<p><a href='$rootpath/EDISendInvoices.php?" . SID . "'>" . _('Send All Unsent EDI Invoices and Credits') .'</a>'; - echo "<p><a href='$rootpath/Z_ChangeCustomerCode.php?" . SID . "'>". _('Change A Customer Code') . '</a>'; - echo "<p><a href='$rootpath/Z_ChangeBranchCode.php?" . SID . "'>" . _('Change A Customer Branch Code') . '</a>'; - echo "<p><a href='$rootpath/Z_ChangeStockCode.php?" . SID . "'>" . _('Change An Inventory Item Code') . '</a>'; - echo "<p><a href='$rootpath/Z_ChangeSupplierCode.php?" . SID . "'>" . _('Change A Supplier Code') . '</a>'; - echo "<p><a href='$rootpath/Z_PriceChanges.php?" . SID . "'>" . _('Bulk Change Customer Pricing') . '</a>'; - echo "<p><a href='$rootpath/Z_BottomUpCosts.php?" . SID . "'>" . _('Update costs for all BOM items, from the bottom up') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_ReApplyCostToSA.php">'. _('Re-apply costs to Sales Analysis') . '</a>'; + echo '<p><a href="' .$rootpath . '/EDISendInvoices.php">' . _('Send All Unsent EDI Invoices and Credits') .'</a>'; + echo '<p><a href="' .$rootpath . '/Z_ChangeCustomerCode.php">'. _('Change A Customer Code') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_ChangeBranchCode.php">' . _('Change A Customer Branch Code') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_ChangeStockCode.php">' . _('Change An Inventory Item Code') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_ChangeSupplierCode.php">' . _('Change A Supplier Code') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_BottomUpCosts.php">' . _('Update costs for all BOM items, from the bottom up') . '</a>'; - echo "<p><a href='$rootpath/Z_CurrencyDebtorsBalances.php?" . SID . "'>" . _('Show Local Currency Total Debtor Balances') . '</a>'; - echo "<p><a href='$rootpath/Z_CurrencySuppliersBalances.php?" . SID . "'>" . _('Show Local Currency Total Suppliers Balances') . '</a>'; - echo "<p><a href='$rootpath/Z_CheckGLTransBalance.php?" . SID . "'>" . _('Show General Transactions That Do Not Balance') . '</a>'; - echo "<p><a href='$rootpath/Z_poAdmin.php?" . SID . "'>" . _('Maintain Language Files') . '</a>'; - echo "<p><a href='$rootpath/Z_MakeNewCompany.php?" . SID . "'>" . _('Make New Company') . '</a>'; - echo "<p><a href='$rootpath/Z_DataExport.php?" . SID . "'>" . _('Data Export Options') . '</a>'; - echo "<p><a href='$rootpath/Z_GetStockImage.php?" . SID . "'>" . _('Image Manipulation Utility') . '</a>'; - echo "<p><a href='$rootpath/Z_ImportStocks.php?" . SID . "'>" . _('Import Stock Items from .csv') . '</a>'; - echo "<p><a href='$rootpath/Z_ImportFixedAssets.php?" . SID . "'>" . _('Import Fixed Assets from .csv file') . '</a>'; - echo "<p><a href='$rootpath/Z_CreateCompanyTemplateFile.php?" . SID . "'>" . _('Create new company template SQL file and submit to webERP') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_CurrencyDebtorsBalances.php">' . _('Show Local Currency Total Debtor Balances') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_CurrencySuppliersBalances.php">' . _('Show Local Currency Total Suppliers Balances') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_CheckGLTransBalance.php">' . _('Show General Transactions That Do Not Balance') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_poAdmin.php">' . _('Maintain Language Files') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_MakeNewCompany.php">' . _('Make New Company') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_DataExport.php">' . _('Data Export Options') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_GetStockImage.php">' . _('Image Manipulation Utility') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_ImportStocks.php">' . _('Import Stock Items from .csv') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_ImportFixedAssets.php">' . _('Import Fixed Assets from .csv file') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_CreateCompanyTemplateFile.php">' . _('Create new company template SQL file and submit to webERP') . '</a>'; echo '<br><br><hr><br>' . _('The stuff below is really quite dangerous!'); echo '<p>' . _('To delete a credit note call') . ' ' . $rootpath . '/Z_DeleteCreditNote.php?' . ' ' ._('and the credit note number to delete'); echo '<p>' . _('To delete an invoice call') . ' ' . $rootpath . '/Z_DeleteInvoice.php?' . _('and the invoice number to delete'); - echo "<p><a href='$rootpath/Z_UploadForm.php?" . SID . "'>" . _('Upload a file to the server') . '</a>'; - echo "<p><a href='$rootpath/Z_DeleteSalesTransActions.php?" . SID . "'>" . _('Delete sales transactions') . '</a>'; - echo "<p><a href='$rootpath/Z_ReverseSuppPaymentRun.php?" . SID . "'>" . _('Reverse all supplier payments on a specified date') . '</a>'; - echo "<p><a href='$rootpath/Z_UpdateChartDetailsBFwd.php?" . SID . "'>" . _('Re-calculate brought forward amounts in GL') . '</a>'; - echo "<p><a href='$rootpath/Z_RePostGLFromPeriod.php?" . SID . "'>" . _('Re-Post all GL transactions from a specified period') . '</a>'; - echo "<p><a href='$rootpath/Z_CheckDebtorsControl.php?" . SID . "'>" . _('Show Debtors Control (Need to edit Z_CheckDebtorsControl.php for the period to show control totals for') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_UploadForm.php">' . _('Upload a file to the server') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_DeleteSalesTransActions.php">' . _('Delete sales transactions') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_ReverseSuppPaymentRun.php">' . _('Reverse all supplier payments on a specified date') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_UpdateChartDetailsBFwd.php">' . _('Re-calculate brought forward amounts in GL') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_RePostGLFromPeriod.php">' . _('Re-Post all GL transactions from a specified period') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_CheckDebtorsControl.php">' . _('Show Debtors Control (Need to edit Z_CheckDebtorsControl.php for the period to show control totals for') . '</a>'; include('includes/footer.inc'); - -?> +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-04-14 10:28:59
|
Revision: 4550 http://web-erp.svn.sourceforge.net/web-erp/?rev=4550&view=rev Author: daintree Date: 2011-04-14 10:28:52 +0000 (Thu, 14 Apr 2011) Log Message: ----------- variosu Modified Paths: -------------- trunk/CustomerAllocations.php trunk/FixedAssetTransfer.php trunk/GeocodeSetup.php trunk/WorkOrderReceive.php trunk/Z_index.php Removed Paths: ------------- trunk/Z_PriceChanges.php Modified: trunk/CustomerAllocations.php =================================================================== --- trunk/CustomerAllocations.php 2011-04-14 09:18:16 UTC (rev 4549) +++ trunk/CustomerAllocations.php 2011-04-14 10:28:52 UTC (rev 4550) @@ -1,5 +1,5 @@ <?php -/* $Revision: 1.30 $ */ + /* $Id$*/ /* @@ -10,7 +10,6 @@ */ include('includes/DefineCustAllocsClass.php'); -//$PageSecurity = 3; include('includes/session.inc'); $title = _('Customer Receipt') . '/' . _('Credit Note Allocations'); include('includes/header.inc'); @@ -70,7 +69,7 @@ if ($TotalAllocated + $_SESSION['Alloc']->TransAmt > 0.008) { prnMsg(_('Allocation could not be processed because the amount allocated is more than the').' ' . - $_SESSION['Alloc']->TransTypeName . ' '._('being allocated') . '<br>' . _('Total allocated').' = ' . + $_SESSION['Alloc']->TransTypeName . ' '._('being allocated') . '<br />' . _('Total allocated').' = ' . $TotalAllocated . ' '._('and the total amount of the') .' ' . $_SESSION['Alloc']->TransTypeName . ' '. _('was').' ' . -$_SESSION['Alloc']->TransAmt,'error'); $InputError=1; @@ -324,22 +323,22 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Allocate Receipt') . '" alt="" />' . ' ' . _('Allocate Receipts') . '</p>'; - $TableHeader = "<tr> - <th>" . _('Trans Type') . "</th> - <th>" . _('Customer') . "</th> - <th>" . _('Cust No') . "</th> - <th>" . _('Number') . "</th> - <th>" . _('Date') . "</th> - <th>" . _('Total') . "</th> - <th>" . _('To Alloc') . "</th> - <th>" . _('Action') . "</th> - </tr>"; + $TableHeader = '<tr> + <th>' . _('Trans Type') . '</th> + <th>' . _('Customer') . '</th> + <th>' . _('Cust No') . '</th> + <th>' . _('Number') . '</th> + <th>' . _('Date') . '</th> + <th>' . _('Total') . '</th> + <th>' . _('To Alloc') . '</th> + <th>' . _('Action') . '</th> + </tr>'; if (isset($_POST['AllocTrans'])) { // Page called with trans number - echo "<form action='" . $_SERVER['PHP_SELF'] . '?' . SID . "' method=post>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo "<input type=hidden name='AllocTrans' value=" . $_POST['AllocTrans'] . '>'; + echo '<input type=hidden name="AllocTrans" value="' . $_POST['AllocTrans'] . '" />'; // Show trans already allocated and potential new allocations @@ -347,20 +346,20 @@ echo '<tr><th colspan=7><div class="centre"><font color=blue><b>' . $_SESSION['Alloc']->DebtorNo . ' - ' . $_SESSION['Alloc']->CustomerName . '</b></div>'; if ($_SESSION['Alloc']->TransExRate != 1) { - echo '<br>'._('Amount in customer currency').' <b>' . + echo '<br />'._('Amount in customer currency').' <b>' . number_format(-$_SESSION['Alloc']->TransAmt,2) . '</b><i> ('._('converted into local currency at an exchange rate of'). ' ' . $_SESSION['Alloc']->TransExRate . ')</i>'; } - echo "</th></tr><tr> - <th>" . _('Trans') . '<br>' . _('Type') . "</th> - <th>" . _('Trans') . '<br>' . _('Number') . "</th> - <th>" . _('Trans') . '<br>' . _('Date') . "</th> - <th>" . _('Total') . '<br>' . _('Amount') . "</th> - <th>" . _('Yet to') . '<br>' . _('Allocate') . "</th> - <th>" . _('This') . '<br>' . _('Allocation') . "</th> - <th>" . _('Running') . '<br>' . _('Balance') . "</th> - </tr>"; + echo '</th></tr><tr> + <th>' . _('Trans') . '<br />' . _('Type') . '</th> + <th>' . _('Trans') . '<br />' . _('Number') . '</th> + <th>' . _('Trans') . '<br />' . _('Date') . '</th> + <th>' . _('Total') . '<br />' . _('Amount') . '</th> + <th>' . _('Yet to') . '<br />' . _('Allocate') . '</th> + <th>' . _('This') . '<br />' . _('Allocation') . '</th> + <th>' . _('Running') . '<br />' . _('Balance') . '</th> + </tr>'; $Counter = 0; $TotalAllocated = 0; @@ -380,37 +379,37 @@ $curTrans = " "; } - echo "<td>" . $AllocnItem->TransType . "</td> - <td>" . $AllocnItem->TypeNo . "</td> - <td class=number>" . $AllocnItem->TransDate . "</td> - <td class=number>" . number_format($AllocnItem->TransAmount,2) . "</td> - <td class=number>" . number_format($YetToAlloc,2) . "</td>"; + echo '<td>' . $AllocnItem->TransType . '</td> + <td>' . $AllocnItem->TypeNo . '</td> + <td class=number>' . $AllocnItem->TransDate . '</td> + <td class=number>' . number_format($AllocnItem->TransAmount,2) . '</td> + <td class=number>' . number_format($YetToAlloc,2) . '</td>'; $j++; if ($AllocnItem->TransAmount < 0) { $balance+=$YetToAlloc; - echo "<td>" . $curTrans ."</td><td class=number>" . number_format($balance,2) . "</td></tr>"; + echo '<td>' . $curTrans .'</td><td class="number">' . number_format($balance,2) . '</td></tr>'; } else { - echo "<input type=hidden name='YetToAlloc" . $Counter . "' value=" . round($YetToAlloc,2) . '></td>'; - echo "<td class=number><input tabindex=".$j." type='checkbox' name='All" . $Counter . "'"; + echo '<input type=hidden name="YetToAlloc' . $Counter . '" value="' . round($YetToAlloc,2) . '"></td>'; + echo '<td class="number"><input tabindex="' . $j .'" type="checkbox" name="All' . $Counter . '"'; if (ABS($AllocnItem->AllocAmt-$YetToAlloc) < 0.01) { - echo ' value=' . True . '>'; + echo ' value=' . True . ' />'; } else { - echo '>'; + echo ' />'; } $balance += $YetToAlloc-$AllocnItem->AllocAmt; $j++; - echo "<input tabindex=".$j." type=text class=number name='Amt" . $Counter ."' maxlength=12 size=13 value=" . round($AllocnItem->AllocAmt,2) . "> - <input type=hidden name='AllocID" . $Counter . "' value=" . $AllocnItem->ID . '></td> - <td class=number>' . number_format($balance,2) . '</td></tr>'; + echo '<input tabindex="'.$j.'" type="text" class="number" name="Amt' . $Counter .'" maxlength=12 size=13 value="' . round($AllocnItem->AllocAmt,2) . '" /> + <input type=hidden name="AllocID' . $Counter . '" value="' . $AllocnItem->ID . '"></td> + <td class="number">' . number_format($balance,2) . '</td></tr>'; } $TotalAllocated = $TotalAllocated + round($AllocnItem->AllocAmt,2); $Counter++; } - echo "<tr> - <td colspan=5 class=number><b>"._('Total Allocated').':</b></td> + echo '<tr> + <td colspan=5 class="number"><b>'._('Total Allocated').':</b></td> <td class=number><b><u>' . number_format($TotalAllocated,2) . '</u></b></td>'; $j++; echo '<td rowspan=2> @@ -421,9 +420,9 @@ <td class=number><b>' . number_format($remaining-$TotalAllocated,2).'</b></td> </tr>'; echo '</table><p>'; - echo "<input type=hidden name=TotalNumberOfAllocs value=" . $Counter . ">"; - echo "<div class='centre'><input tabindex=".$j." type=submit name=UpdateDatabase value=" . _('Process Allocations') . ">"; - echo "<input tabindex=".$j." type=submit name=Cancel value=" . _('Cancel') . "></div>"; + echo '<input type="hidden" name="TotalNumberOfAllocs" value="' . $Counter . '">'; + echo '<div class="centre"><input tabindex="' . $j . '" type="submit" name="UpdateDatabase" value="' . _('Process Allocations') . '">'; + echo '<input tabindex="' . $j . '" type="submit" name="Cancel" value="' . _('Cancel') . '"></div>'; } elseif (isset($_GET['DebtorNo'])) { // Page called with customer code @@ -467,14 +466,14 @@ echo '<tr class="OddTableRows">';; $k++; } - echo "<td>" . $myrow['typename'] ."</td> - <td>" . $myrow['name'] . "</td> - <td>" . $myrow['debtorno'] . "</td> - <td>" . $myrow['transno'] . "</td> - <td>" . ConvertSQLDate($myrow['trandate']) . "</td> - <td class=number>" . number_format($myrow['total'],2) . "</td> - <td class=number>" . number_format($myrow['total']-$myrow['alloc'],2) . "</td>"; - echo '<td><a href=' . $_SERVER['PHP_SELF']. '?' . SID . '&AllocTrans=' . $myrow['id'] . '>' . _('Allocate') . '</a></td></tr>'; + echo '<td>' . $myrow['typename'] .'</td> + <td>' . $myrow['name'] . '</td> + <td>' . $myrow['debtorno'] . '</td> + <td>' . $myrow['transno'] . '</td> + <td>' . ConvertSQLDate($myrow['trandate']) . '</td> + <td class=number>' . number_format($myrow['total'],2) . '</td> + <td class=number>' . number_format($myrow['total']-$myrow['alloc'],2) . '</td>'; + echo '<td><a href=' . $_SERVER['PHP_SELF']. '?AllocTrans=' . $myrow['id'] . '>' . _('Allocate') . '</a></td></tr>'; } DB_free_result($result); echo '</table><p>'; @@ -516,7 +515,7 @@ if ( $curDebtor != $myrow['debtorno'] ) { if ( $curTrans > 1 ) { - echo "<tr class='OddTableRows'><td colspan=7 class=number>" . number_format($balance,2) . "</td><td><b>Balance</b></td></tr>"; + echo '<tr class="OddTableRows"><td colspan=7 class="number">' . number_format($balance,2) . '</td><td><b>' . _('Balance') . '</b></td></tr>'; } $balance = 0; @@ -548,20 +547,22 @@ $k++; } - echo "<td>" . $myrow['typename'] ."</td> - <td>" . $myrow['name'] . "</td> - <td>" . $myrow['debtorno'] . "</td> - <td>" . $myrow['transno'] . "</td> - <td>" . ConvertSQLDate($myrow['trandate']) . "</td> - <td class=number>" . number_format($myrow['total'],2) . "</td> - <td class=number>" . number_format($myrow['total']-$myrow['alloc'],2) . "</td>"; - echo '<td>' . $allocate . '</td></tr>'; + echo '<td>' . $myrow['typename'] .'</td> + <td>' . $myrow['name'] . '</td> + <td>' . $myrow['debtorno'] . '</td> + <td>' . $myrow['transno'] . '</td> + <td>' . ConvertSQLDate($myrow['trandate']) . '</td> + <td class=number>' . number_format($myrow['total'],2) . '</td> + <td class=number>' . number_format($myrow['total']-$myrow['alloc'],2) . '</td> + <td>' . $allocate . '</td></tr>'; if ( $curTrans > $trans ) { if (!isset($balance)) { $balance=0; } - echo "<tr class='OddTableRows'><td colspan=7 class=number>" . number_format($balance,2) . "</td><td><b>Balance</b></td></tr>"; + echo '<tr class="OddTableRows"> + <td colspan="7" class="number">' . number_format($balance,2) .'</td> + <td><b>' . _('Balance') . '</b></td></tr>'; } } DB_free_result($result); Modified: trunk/FixedAssetTransfer.php =================================================================== --- trunk/FixedAssetTransfer.php 2011-04-14 09:18:16 UTC (rev 4549) +++ trunk/FixedAssetTransfer.php 2011-04-14 10:28:52 UTC (rev 4550) @@ -1,6 +1,6 @@ <?php -//$PageSecurity = 11; +/* $Id$*/ include('includes/session.inc'); @@ -26,7 +26,7 @@ } else { $sql='SELECT categoryid, categorydescription FROM fixedassetcategories'; $result=DB_query($sql, $db); - echo '<form action="'. $_SERVER['PHP_SELF'] . '?' . SID .'" method=post>'; + echo '<form action="'. $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . '</p>'; @@ -121,11 +121,11 @@ while ($myrow=DB_fetch_array($Result)) { echo '<tr><td>'.$myrow['assetid'].'</td> - <td>'.$myrow['description'].'</td> - <td>'.$myrow['serialno'].'</td> - <td class=number>'.number_format($myrow['cost'],2).'</td> - <td class=number>'.number_format($myrow['accumdepn'],2).'</td> - <td>'.$myrow['locationdescription'].'</td>'; + <td>'.$myrow['description'].'</td> + <td>'.$myrow['serialno'].'</td> + <td class=number>'.number_format($myrow['cost'],2).'</td> + <td class=number>'.number_format($myrow['accumdepn'],2).'</td> + <td>'.$myrow['locationdescription'].'</td>'; echo '<td><select name="Location'.$myrow['assetid'].'" onChange="ReloadForm(Move'.$myrow['assetid'].')">'; echo '<option></option>'; while ($LocationRow=DB_fetch_array($LocationResult)) { @@ -137,11 +137,11 @@ } DB_data_seek($LocationResult,0); echo '</select></td>'; - echo '<input type=hidden name=AssetCat value="' . $_POST['AssetCat'].'"'; - echo '<input type=hidden name=Keywords value="' . $_POST['Keywords'].'"'; - echo '<input type=hidden name=AssetID value="' . $_POST['AssetID'].'"'; - echo '<input type=hidden name=Search value="' . $_POST['Search'].'"'; - echo '<td><input type=submit name="Move'.$myrow['assetid'].'" value=Move></td>'; + echo '<input type="hidden" name="AssetCat" value="' . $_POST['AssetCat'].'"'; + echo '<input type="hidden" name="Keywords" value="' . $_POST['Keywords'].'"'; + echo '<input type="hidden" name="AssetID" value="' . $_POST['AssetID'].'"'; + echo '<input type="hidden" name="Search" value="' . $_POST['Search'].'"'; + echo '<td><input type="submit" name="Move'.$myrow['assetid'].'" value=Move></td>'; echo '</tr>'; } echo '</table></form>'; Modified: trunk/GeocodeSetup.php =================================================================== --- trunk/GeocodeSetup.php 2011-04-14 09:18:16 UTC (rev 4549) +++ trunk/GeocodeSetup.php 2011-04-14 10:28:52 UTC (rev 4550) @@ -1,7 +1,7 @@ <?php /* $Id$*/ -//$PageSecurity = 3; + include('includes/session.inc'); $title = _('Geocode Maintenance'); include('includes/header.inc'); @@ -139,15 +139,16 @@ '<a href="http://www.batchgeocode.com/lookup/" target="_blank">http://www.batchgeocode.com/lookup/</a></b>'; echo '<p>'. _('Set the maps centre point using the Center Longitude and Center Latitude. Set the maps screen size using the height and width in pixels (px)').'</div><br>'; echo '<table border=1>'; - echo "<tr> - <th>". _('Geocode ID') ."</th> - <th>". _('Geocode Key') ."</th> - <th>". _('Center Longitude') ."</th> - <th>". _('Center Latitude') ."</th> - <th>". _('Map height (px)') ."</th> - <th>". _('Map width (px)') ."</th> - <th>". _('Map host') .'</th>'; - + + echo '<tr> + <th>'. _('Geocode ID') .'</th> + <th>'. _('Geocode Key') .'</th> + <th>'. _('Center Longitude') .'</th> + <th>'. _('Center Latitude') .'</th> + <th>'. _('Map height (px)') .'</th> + <th>'. _('Map width (px)') .'</th> + <th>'. _('Map host') .'</th>'; + $k=0; //row colour counter while ($myrow=DB_fetch_row($result)) { @@ -159,15 +160,15 @@ $k=1; } - printf("<td>%s</td> + printf('<td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> - <td><a href=\"%s?SelectedParam=%s\">" . _('Edit') . "</a></td> - <td><a href=\"%s?SelectedParam=%s&delete=%s\">". _('Delete') .'</a></td> + <td><a href=\'%s?SelectedParam=%s\'>' . _('Edit') . '</a></td> + <td><a href=\'%s?SelectedParam=%s&delete=%s\'>'. _('Delete') .'</a></td> </tr>', $myrow[0], $myrow[1], @@ -193,7 +194,7 @@ if (!isset($_GET['delete'])) { - 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'] . '" />'; if (isset($SelectedParam) and ($InputError!=1)) { @@ -220,11 +221,12 @@ $_POST['map_width'] = $myrow['map_width']; $_POST['map_host'] = $myrow['map_host']; - echo "<input type=hidden name='SelectedParam' VALUE='" . $SelectedParam . "'>"; - echo "<input type=hidden name='geocodeid' VALUE='" . $_POST['geocodeid'] . "'>"; + echo '<input type="hidden" name="SelectedParam" value="' . $SelectedParam . '" />'; + echo '<input type="hidden" name="geocodeid" value="' . $_POST['geocodeid'] . '" />'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Geocode Setup') . '" alt="">'. _('Setup configuration for Geocoding of Customers and Suppliers') .'</p>'; - echo "<table><tr><td>". _('Geocode Code') .':</td><td>'; - echo $_POST['geocodeid'] . '</td></tr>'; + echo '<table> + <tr><td>'. _('Geocode Code') .':</td> + <td>' . $_POST['geocodeid'] . '</td></tr>'; } else { //end of if $SelectedParam only do the else when a new record is being entered if (!isset($_POST['geocodeid'])) { @@ -242,29 +244,28 @@ $_POST['geocode_key'] = ''; } echo '<br><tr> - <td>'. _('Geocode Key') .":</td> - <td><input " . (in_array('geocode_key',$Errors) ? 'class="inputerror"' : '' ) . - " tabindex=2 type='text' name='geocode_key' VALUE='". $_POST['geocode_key'] ."' size=28 maxlength=300> - </td></tr> - <tr><td>". _('Geocode Center Long') . "</td> - <td><input tabindex=3 type='text' name='center_long' VALUE='". $_POST['center_long'] ."' size=28 maxlength=300></td></tr> + <td>'. _('Geocode Key') .':</td> + <td><input ' . (in_array('geocode_key',$Errors) ? 'class="inputerror"' : '' ) . + ' tabindex=2 type="text" name="geocode_key" VALUE="'. $_POST['geocode_key'] .'" size=28 maxlength=300> + </td></tr> + + <tr><td>'. _('Geocode Center Long') . '</td> + <td><input tabindex=3 type="text" name="center_long" VALUE="'. $_POST['center_long'] .'" size=28 maxlength=300></td></tr> -<tr><td>". _('Geocode Center Lat') . "</td> - <td><input tabindex=4 type='text' name='center_lat' VALUE='". $_POST['center_lat'] ."' size=28 maxlength=300></td></tr> + <tr><td>'. _('Geocode Center Lat') . '</td> + <td><input tabindex=4 type="text" name="center_lat" VALUE="'. $_POST['center_lat'] .'" size=28 maxlength=300></td></tr> -<tr><td>". _('Geocode Map Height') . "</td> - <td><input tabindex=5 type='text' name='map_height' VALUE='". $_POST['map_height'] ."' size=28 maxlength=300></td></tr> + <tr><td>'. _('Geocode Map Height') . '</td> + <td><input tabindex=5 type="text" name="map_height" VALUE="'. $_POST['map_height'] .'" size=28 maxlength=300></td></tr> -<tr><td>". _('Geocode Map Width') . "</td> - <td><input tabindex=6 type='text' name='map_width' VALUE='". $_POST['map_width'] ."' size=28 maxlength=300></td></tr> + <tr><td>'. _('Geocode Map Width') . '</td> + <td><input tabindex=6 type="text" name="map_width" VALUE="'. $_POST['map_width'] .'" size=28 maxlength=300></td></tr> -<tr><td>". _('Geocode Host') . "</td> - <td><input tabindex=7 type='text' name='map_host' VALUE='". $_POST['map_host'] ."' size=20 maxlength=300></td></tr> - - - </table> - <div class='centre'><input tabindex=4 type='Submit' name='submit' value='" . _('Enter Information') . "'</div><br><br> - </form>"; + <tr><td>'. _('Geocode Host') . '</td> + <td><input tabindex=7 type="text" name="map_host" VALUE="'. $_POST['map_host'] .'" size=20 maxlength=300></td></tr> + </table> + <div class="centre"><input tabindex=4 type="Submit" name="submit" value="' . _('Enter Information') . '"</div><br><br> + </form>'; echo '<div class="page_help_text">' . _('When ready, click on the link below to run the GeoCode process. This will Geocode all Branches and Suppliers. This may take some time. Errors will be returned to the screen.') . '</p>'; echo '<p>' . _('Suppliers and Customer Branches are geocoded when being entered/updated. You can rerun the geocode process from this screen at any time.') . '</p></div><br>'; Modified: trunk/WorkOrderReceive.php =================================================================== --- trunk/WorkOrderReceive.php 2011-04-14 09:18:16 UTC (rev 4549) +++ trunk/WorkOrderReceive.php 2011-04-14 10:28:52 UTC (rev 4550) @@ -10,7 +10,7 @@ echo '<a href="'. $rootpath . '/WorkOrderCosting.php?WO=' . $_REQUEST['WO'] . '">' . _('Back to Costing'). '</a><br>'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/group_add.png" title="' . - _('Search') . '" alt="" />' . ' ' . $title.'</p'; + _('Search') . '" alt="" />' . ' ' . $title.'</p>'; echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; Deleted: trunk/Z_PriceChanges.php =================================================================== --- trunk/Z_PriceChanges.php 2011-04-14 09:18:16 UTC (rev 4549) +++ trunk/Z_PriceChanges.php 2011-04-14 10:28:52 UTC (rev 4550) @@ -1,141 +0,0 @@ -<?php -/* $Id$*/ - -include('includes/session.inc'); -$title=_('Update Pricing'); -include('includes/header.inc'); - - -echo '<br />' . _('This page updates already existing prices for a specified sales type (price list)') . '. ' . _('Choose between updating only customer special prices where the customer is set up under the price list selected, or all prices under the sales type or just specific prices for a customer for the stock category selected'); - -prnMsg (_('This script takes no account of start and end dates of prices and updates all historical prices as well as current prices - better to use new scripts under Inventory -> Maintenance'),'warn'); - -echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; -echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - -$SQL = "SELECT sales_type, typeabbrev FROM salestypes"; - -$result = DB_query($SQL,$db); - -echo '<p><table> - <tr> - <td>' . _('Select the Price List to update the costs for') .':</td> - <td><select name="PriceList">'; - -if (!isset($_POST['PriceList'])){ - echo '<option selected value=0>' . _('No Price List Selected') . '</option>'; -} - -while ($PriceLists=DB_fetch_array($result)){ - echo '<option value="' . $PriceLists['typeabbrev'] . '">' . $PriceLists['sales_type'] . '</option>'; -} - -echo '</select></td></tr>'; - -echo '<tr><td>' . _('Category') . ':</td> - <td><select name="StkCat">'; - -$sql = "SELECT categoryid, categorydescription FROM stockcategory"; - -$ErrMsg = _('The stock categories could not be retrieved because'); -$DbgMsg = _('The SQL used to retrieve stock categories and failed was'); -$result = DB_query($sql,$db,$ErrMsg,$DbgMsg); - -while ($myrow=DB_fetch_array($result)){ - if ($myrow['categoryid']==$_POST['StkCat']){ - echo '<option selected value="'. $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; - } else { - echo '<option value="'. $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; - } -} -echo '</select></td></tr>'; - -echo '<tr><td>' . _('Which Prices to update') . ":</td> - <td><select name='WhichPrices'>"; - echo "<option value='Only Non-customer special prices'>" . _('Only Non-customer special prices') . '</option>'; - echo "<option value='Only customer special prices'>" . _('Only customer special prices') . '</option>'; - echo "<option value='Both customer special prices and non-customer special prices'>" . _('Both customer special prices and non-customer special prices') . '</option>'; - echo "<option value='Selected customer special prices only'>" . $_SESSION['CustomerID'] . ' ' . _('customer special prices only') . '</option>'; -echo '</select></td></tr>'; - -if (!isset($_POST['IncreasePercent'])){ - $_POST['IncreasePercent']=0; -} - -echo '<tr><td>' . _('Percentage Increase (positive) or decrease (negative)') . "</td> - <td><input name='IncreasePercent' size=4 maxlength=4 value=" . $_POST['IncreasePercent'] . "></td></tr></table>"; - - -echo "<div class='centre'><p><input type=submit name='UpdatePrices' value='" . _('Update Prices') . '\' onclick="return confirm(\'' . _('Are you sure you wish to update all the prices according to the criteria selected?') . '\');"></div>'; - -echo '</form>'; - -if (isset($_POST['UpdatePrices']) AND isset($_POST['StkCat'])){ - - echo '<br />' . _('So we are using a price list/sales type of') .' : ' . $_POST['PriceList']; - echo '<br />' . _('and a stock category code of') . ' : ' . $_POST['StkCat']; - echo '<br />' . _('and a increase percent of') . ' : ' . $_POST['IncreasePercent']; - - if ($_POST['PriceList']=='0'){ - echo '<br />' . _('The price list/sales type to be updated must be selected first'); - include ('includes/footer.inc'); - exit; - } - - if (ABS($_POST['IncreasePercent']) < 0.5 OR ABS($_POST['IncreasePercent'])>40 OR !is_numeric($_POST['IncreasePercent'])){ - - echo '<br />' . _('The increase or decrease to be applied is expected to be an integer between 1 and 40 it is not necessary to enter the').' '. '%'.' '. _('sign') . ' - ' . _('the amount is assumed to be a percentage'); - include ('includes/footer.inc'); - exit; - } - - echo '<p>' . _('Price list') . ' ' . $_POST['PriceList'] . ' ' . _('prices for') . ' ' . $_POST['WhichPrices'] . ' ' . _('for the stock category') . ' ' . $_POST['StkCat'] . ' ' . _('will been incremented by') . ' ' . $_POST['IncreasePercent'] . ' ' . _('percent'); - - $sql = "SELECT stockid FROM stockmaster WHERE categoryid='" . $_POST['StkCat'] . "'"; - $PartsResult = DB_query($sql,$db); - - $IncrementPercentage = $_POST['IncreasePercent']/100; - - while ($myrow=DB_fetch_array($PartsResult)){ - - if ($_POST['WhichPrices'] == 'Only Non-customer special prices'){ - - $sql = "UPDATE prices SET price=price*(1+" . $IncrementPercentage . ") - WHERE typeabbrev='" . $_POST['PriceList'] . "' - AND stockid='" . $myrow['stockid'] . "' - AND typeabbrev='" . $_POST['PriceList'] . "' - AND debtorno=''"; - - }else if ($_POST['WhichPrices'] == 'Only customer special prices'){ - - $sql = "UPDATE prices SET price=price*(1+" . $IncrementPercentage . ") - WHERE typeabbrev='" . $_POST['PriceList'] . "' - AND stockid='" . $myrow['stockid'] . "' - AND typeabbrev='" . $_POST['PriceList'] . "' - AND debtorno!=''"; - - } else if ($_POST['WhichPrices'] == 'Both customer special prices and non-customer special prices'){ - - $sql = "UPDATE prices SET price=price*(1+" . $IncrementPercentage . ") - WHERE typeabbrev='" . $_POST['PriceList'] . "' - AND stockd='" . $myrow['stockid'] . "' - AND typeabbrev='" . $_POST['PriceList'] . "'"; - - } else if ($_POST['WhichPrices'] == 'Selected customer special prices only'){ - - $sql = "UPDATE prices SET price=price*(1+" . $IncrementPercentage . ") - WHERE typeabbrev='" . $_POST['PriceList'] . "' - AND stockid='" . $myrow['stockid'] . "' - AND typeabbrev='" . $_POST['PriceList'] . "' - AND debtorno='" . $_SESSION['CustomerID'] . "'"; - - } - - $result = DB_query($sql,$db); - $ErrMsg =_('Error updating prices for') . ' ' . $myrow['stockid'] . ' ' . _('because'); - prnMsg(_('Updating prices for') . ' ' . $myrow['stockid'],'info'); - } - -} -include('includes/footer.inc'); -?> \ No newline at end of file Modified: trunk/Z_index.php =================================================================== --- trunk/Z_index.php 2011-04-14 09:18:16 UTC (rev 4549) +++ trunk/Z_index.php 2011-04-14 10:28:52 UTC (rev 4550) @@ -1,6 +1,5 @@ <?php /* $Id$*/ -// $PageSecurity = 15; include('includes/session.inc'); $title = _('Special Fixes and Utilities') . ' - ' . _('Only System Administrator'); @@ -8,38 +7,36 @@ echo '<p>' . _('BE VERY CAREFUL DO NOT RUN THESE LINKS BELOW WITHOUT UNDERSTANDING EXACTLY WHAT THEY DO AND THE IMPLICATIONS'); - echo "<p><a href='$rootpath/Z_ReApplyCostToSA.php?" . SID . "'>". _('Re-apply costs to Sales Analysis') . '</a>'; - echo "<p><a href='$rootpath/EDISendInvoices.php?" . SID . "'>" . _('Send All Unsent EDI Invoices and Credits') .'</a>'; - echo "<p><a href='$rootpath/Z_ChangeCustomerCode.php?" . SID . "'>". _('Change A Customer Code') . '</a>'; - echo "<p><a href='$rootpath/Z_ChangeBranchCode.php?" . SID . "'>" . _('Change A Customer Branch Code') . '</a>'; - echo "<p><a href='$rootpath/Z_ChangeStockCode.php?" . SID . "'>" . _('Change An Inventory Item Code') . '</a>'; - echo "<p><a href='$rootpath/Z_ChangeSupplierCode.php?" . SID . "'>" . _('Change A Supplier Code') . '</a>'; - echo "<p><a href='$rootpath/Z_PriceChanges.php?" . SID . "'>" . _('Bulk Change Customer Pricing') . '</a>'; - echo "<p><a href='$rootpath/Z_BottomUpCosts.php?" . SID . "'>" . _('Update costs for all BOM items, from the bottom up') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_ReApplyCostToSA.php">'. _('Re-apply costs to Sales Analysis') . '</a>'; + echo '<p><a href="' .$rootpath . '/EDISendInvoices.php">' . _('Send All Unsent EDI Invoices and Credits') .'</a>'; + echo '<p><a href="' .$rootpath . '/Z_ChangeCustomerCode.php">'. _('Change A Customer Code') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_ChangeBranchCode.php">' . _('Change A Customer Branch Code') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_ChangeStockCode.php">' . _('Change An Inventory Item Code') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_ChangeSupplierCode.php">' . _('Change A Supplier Code') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_BottomUpCosts.php">' . _('Update costs for all BOM items, from the bottom up') . '</a>'; - echo "<p><a href='$rootpath/Z_CurrencyDebtorsBalances.php?" . SID . "'>" . _('Show Local Currency Total Debtor Balances') . '</a>'; - echo "<p><a href='$rootpath/Z_CurrencySuppliersBalances.php?" . SID . "'>" . _('Show Local Currency Total Suppliers Balances') . '</a>'; - echo "<p><a href='$rootpath/Z_CheckGLTransBalance.php?" . SID . "'>" . _('Show General Transactions That Do Not Balance') . '</a>'; - echo "<p><a href='$rootpath/Z_poAdmin.php?" . SID . "'>" . _('Maintain Language Files') . '</a>'; - echo "<p><a href='$rootpath/Z_MakeNewCompany.php?" . SID . "'>" . _('Make New Company') . '</a>'; - echo "<p><a href='$rootpath/Z_DataExport.php?" . SID . "'>" . _('Data Export Options') . '</a>'; - echo "<p><a href='$rootpath/Z_GetStockImage.php?" . SID . "'>" . _('Image Manipulation Utility') . '</a>'; - echo "<p><a href='$rootpath/Z_ImportStocks.php?" . SID . "'>" . _('Import Stock Items from .csv') . '</a>'; - echo "<p><a href='$rootpath/Z_ImportFixedAssets.php?" . SID . "'>" . _('Import Fixed Assets from .csv file') . '</a>'; - echo "<p><a href='$rootpath/Z_CreateCompanyTemplateFile.php?" . SID . "'>" . _('Create new company template SQL file and submit to webERP') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_CurrencyDebtorsBalances.php">' . _('Show Local Currency Total Debtor Balances') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_CurrencySuppliersBalances.php">' . _('Show Local Currency Total Suppliers Balances') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_CheckGLTransBalance.php">' . _('Show General Transactions That Do Not Balance') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_poAdmin.php">' . _('Maintain Language Files') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_MakeNewCompany.php">' . _('Make New Company') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_DataExport.php">' . _('Data Export Options') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_GetStockImage.php">' . _('Image Manipulation Utility') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_ImportStocks.php">' . _('Import Stock Items from .csv') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_ImportFixedAssets.php">' . _('Import Fixed Assets from .csv file') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_CreateCompanyTemplateFile.php">' . _('Create new company template SQL file and submit to webERP') . '</a>'; echo '<br><br><hr><br>' . _('The stuff below is really quite dangerous!'); echo '<p>' . _('To delete a credit note call') . ' ' . $rootpath . '/Z_DeleteCreditNote.php?' . ' ' ._('and the credit note number to delete'); echo '<p>' . _('To delete an invoice call') . ' ' . $rootpath . '/Z_DeleteInvoice.php?' . _('and the invoice number to delete'); - echo "<p><a href='$rootpath/Z_UploadForm.php?" . SID . "'>" . _('Upload a file to the server') . '</a>'; - echo "<p><a href='$rootpath/Z_DeleteSalesTransActions.php?" . SID . "'>" . _('Delete sales transactions') . '</a>'; - echo "<p><a href='$rootpath/Z_ReverseSuppPaymentRun.php?" . SID . "'>" . _('Reverse all supplier payments on a specified date') . '</a>'; - echo "<p><a href='$rootpath/Z_UpdateChartDetailsBFwd.php?" . SID . "'>" . _('Re-calculate brought forward amounts in GL') . '</a>'; - echo "<p><a href='$rootpath/Z_RePostGLFromPeriod.php?" . SID . "'>" . _('Re-Post all GL transactions from a specified period') . '</a>'; - echo "<p><a href='$rootpath/Z_CheckDebtorsControl.php?" . SID . "'>" . _('Show Debtors Control (Need to edit Z_CheckDebtorsControl.php for the period to show control totals for') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_UploadForm.php">' . _('Upload a file to the server') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_DeleteSalesTransActions.php">' . _('Delete sales transactions') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_ReverseSuppPaymentRun.php">' . _('Reverse all supplier payments on a specified date') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_UpdateChartDetailsBFwd.php">' . _('Re-calculate brought forward amounts in GL') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_RePostGLFromPeriod.php">' . _('Re-Post all GL transactions from a specified period') . '</a>'; + echo '<p><a href="' .$rootpath . '/Z_CheckDebtorsControl.php">' . _('Show Debtors Control (Need to edit Z_CheckDebtorsControl.php for the period to show control totals for') . '</a>'; include('includes/footer.inc'); - -?> +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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] |
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] |
From: <dai...@us...> - 2011-04-17 10:18:10
|
Revision: 4552 http://web-erp.svn.sourceforge.net/web-erp/?rev=4552&view=rev Author: daintree Date: 2011-04-17 10:18:02 +0000 (Sun, 17 Apr 2011) Log Message: ----------- various Modified Paths: -------------- trunk/PO_Header.php trunk/Prices_Customer.php trunk/PrintCustTrans.php trunk/RecurringSalesOrders.php trunk/SupplierTypes.php trunk/includes/OutputSerialItems.php Modified: trunk/PO_Header.php =================================================================== --- trunk/PO_Header.php 2011-04-16 06:20:56 UTC (rev 4551) +++ trunk/PO_Header.php 2011-04-17 10:18:02 UTC (rev 4552) @@ -766,7 +766,7 @@ if($_SESSION['ExistingOrder'] != 0 AND $_SESSION['PO'.$identifier]->Status == 'Printed'){ - echo '<tr><td><a href="' . $rootpath . '/GoodsReceived.php?' . SID . '&PONumber=' . + echo '<tr><td><a href="' . $rootpath . '/GoodsReceived.php?PONumber=' . $_SESSION['PO'.$identifier]->OrderNo . '&identifier=' . $identifier . '">'._('Receive this order').'</a></td></tr>'; } if ($_SESSION['PO'.$identifier]->Status==''){ //then its a new order @@ -959,9 +959,9 @@ <td><input type="text" name="Tel" size="31" maxlength="30" value="' . $_SESSION['PO'.$identifier]->Tel . '"></td> </tr>'; - echo '<tr><td>' . _('Delivery By') . ':</td><td><select name=DeliveryBy>'; + echo '<tr><td>' . _('Delivery By') . ':</td><td><select name="DeliveryBy">'; - $ShipperResult = DB_query('SELECT shipper_id, shippername FROM shippers',$db); + $ShipperResult = DB_query("SELECT shipper_id, shippername FROM shippers",$db); while ($ShipperRow=DB_fetch_array($ShipperResult)){ if (isset($_POST['DeliveryBy']) and ($_POST['DeliveryBy'] == $ShipperRow['shipper_id'])) { @@ -978,7 +978,7 @@ echo '<table class=selection width=100%><tr><td>' . _('Supplier Selection') . ':</td><td> <select name=Keywords onChange="ReloadForm(form1.SearchSuppliers)">'; - $SuppCoResult = DB_query('SELECT supplierid, suppname FROM suppliers ORDER BY suppname',$db); + $SuppCoResult = DB_query("SELECT supplierid, suppname FROM suppliers ORDER BY suppname",$db); while ( $SuppCoRow=DB_fetch_array($SuppCoResult)){ if ($SuppCoRow['suppname'] == $_SESSION['PO'.$identifier]->SupplierName) { @@ -1029,9 +1029,10 @@ </td><td><input type="text" name="SuppTel" size="31" maxlength="30" value="' . $_SESSION['PO'.$identifier]->SuppTel . '"></td> </tr>'; - $result=DB_query('SELECT terms, termsindicator FROM paymentterms', $db); + $result=DB_query("SELECT terms, termsindicator FROM paymentterms", $db); - echo '<tr><td>' . _('Payment Terms') . ':</td><td><select name="PaymentTerms">'; + echo '<tr><td>' . _('Payment Terms') . ':</td> + <td><select name="PaymentTerms">'; while ($myrow = DB_fetch_array($result)) { if ($myrow['termsindicator']==$_SESSION['PO'.$identifier]->PaymentTerms) { @@ -1054,8 +1055,9 @@ </tr>'; if ($_SESSION['PO'.$identifier]->CurrCode != $_SESSION['CompanyRecord']['currencydefault']) { - echo '<tr><td>'. _('Exchange Rate').':'.'</td><td><input type=text name="ExRate" - value='.$_POST['ExRate'].' class=number size=11></td></tr>'; + echo '<tr><td>'. _('Exchange Rate').':'.'</td> + <td><input type=text name="ExRate" value='.$_POST['ExRate'].' class="number" size=11></td> + </tr>'; } else { echo '<input type=hidden name="ExRate" value="1">'; } Modified: trunk/Prices_Customer.php =================================================================== --- trunk/Prices_Customer.php 2011-04-16 06:20:56 UTC (rev 4551) +++ trunk/Prices_Customer.php 2011-04-17 10:18:02 UTC (rev 4552) @@ -1,7 +1,5 @@ <?php -/* $Revision: 1.11 $ */ /* $Id$*/ -//$PageSecurity = 11; include('includes/session.inc'); @@ -275,158 +273,142 @@ } else { $EndDateDisplay = ConvertSQLDate($myrow['enddate']); } - printf("<tr bgcolor='#CCCCCC'> - <td class=number>%0.2f</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td><a href='%s?Item=%s&Price=%s&Branch=%s&StartDate=%s&EndDate=%s&Edit=1'>" . _('Edit') . "</td> - <td><a href='%s?Item=%s&Branch=%s&StartDate=%s&EndDate=%s&delete=yes'>" . _('Delete') . "</td></tr>", - $myrow['price'], - $Branch, - ConvertSQLDate($myrow['startdate']), - $EndDateDisplay, - $_SERVER['PHP_SELF'], - $Item, - $myrow['price'], - $myrow['branchcode'], - $myrow['startdate'], - $myrow['enddate'], - $_SERVER['PHP_SELF'], - $Item, - $myrow['branchcode'], - $myrow['startdate'], - $myrow['enddate']); + echo '<tr bgcolor="#CCCCCC"> + <td class=number>'.number_format($myrow['price'],2).'</td> + <td>'.$Branch.'</td> + <td>'.$myrow['units'].'</td> + <td class=number>'.$myrow['conversionfactor'].'</td> + <td>'.ConvertSQLDate($myrow['startdate']).'</td> + <td>'.$EndDateDisplay.'</td> + <td><a href="'.$_SERVER['PHP_SELF'].'?Item='.$Item.'&Price='.$myrow['price'].'&Branch='.$myrow['branchcode']. + '&StartDate='.$myrow['startdate'].'&EndDate='.$myrow['enddate'].'&Edit=1">' . _('Edit') . '</td> + <td><a href="'.$_SERVER['PHP_SELF'].'?Item='.$Item.'&Branch='.$myrow['branchcode'].'&StartDate='.$myrow['startdate'] .'&EndDate='.$myrow['enddate'].'&delete=yes">' . _('Delete') . '</td></tr>'; + } //END WHILE LIST LOOP } -?> +echo '</table></tr></table><p />'; -</table></tr></table> +echo '<form method="post" action=' . $_SERVER['PHP_SELF'] . '?' . SID . '>'; +echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; +echo '<input type=hidden name="Item" VALUE="' . $Item . '">'; -<p> - -<?php - echo '<form method="post" action=' . $_SERVER['PHP_SELF'] . '?' . SID . '>'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<input type=hidden name="Item" VALUE="' . $Item . '">'; - - if (isset($_GET['Edit']) and $_GET['Edit']==1){ - echo '<input type=hidden name="Editing" VALUE="Yes">'; - echo '<input type=hidden name="OldStartDate" VALUE="' . $_GET['StartDate'] .'">'; - echo '<input type=hidden name="OldEndDate" VALUE="' . $_GET['EndDate'] . '">'; - $_POST['Price']=$_GET['Price']; - $_POST['Branch']=$_GET['Branch']; - $_POST['StartDate'] = ConvertSQLDate($_GET['StartDate']); - if (Is_Date($_GET['EndDate'])){ - $_POST['EndDate'] = ConvertSQLDate($_GET['EndDate']); - } else { - $_POST['EndDate']=''; - } +if (isset($_GET['Edit']) and $_GET['Edit']==1){ + echo '<input type=hidden name="Editing" VALUE="Yes">'; + echo '<input type=hidden name="OldStartDate" VALUE="' . $_GET['StartDate'] .'">'; + echo '<input type=hidden name="OldEndDate" VALUE="' . $_GET['EndDate'] . '">'; + $_POST['Price']=$_GET['Price']; + $_POST['Branch']=$_GET['Branch']; + $_POST['StartDate'] = ConvertSQLDate($_GET['StartDate']); + if (Is_Date($_GET['EndDate'])){ + $_POST['EndDate'] = ConvertSQLDate($_GET['EndDate']); + } else { + $_POST['EndDate']=''; } - if (!isset($_POST['Branch'])) { - $_POST['Branch']=''; - } - if (!isset($_POST['Price'])) { - $_POST['Price']=0; - } +} +if (!isset($_POST['Branch'])) { + $_POST['Branch']=''; +} +if (!isset($_POST['Price'])) { + $_POST['Price']=0; +} - if (!isset($_POST['StartDate'])){ - $_POST['StartDate'] = Date($_SESSION['DefaultDateFormat']); - } +if (!isset($_POST['StartDate'])){ + $_POST['StartDate'] = Date($_SESSION['DefaultDateFormat']); +} - if (!isset($_POST['EndDate'])){ - $_POST['EndDate'] = DateAdd(Date($_SESSION['DefaultDateFormat']), 'y', 1); - } +if (!isset($_POST['EndDate'])){ + $_POST['EndDate'] = ''; +} - $sql = "SELECT - branchcode, - brname - FROM custbranch - WHERE debtorno='".$_SESSION['CustomerID'] ."'"; - $result = DB_query($sql, $db); - echo '<table class=selection>'; - echo '<tr><td>' . _('Branch') . ':</td>'; - echo '<td><select name="Branch"'; - while ($myrow=DB_fetch_array($result)) { - if ($myrow['branchcode']==$_POST['branch']) { - echo '<option selected value='.$myrow['branchcode'].'>'.$myrow['brname'].'</option>'; - } else { - echo '<option value='.$myrow['branchcode'].'>'.$myrow['brname'].'</option>'; - } +$sql = "SELECT + branchcode, + brname + FROM custbranch + WHERE debtorno='".$_SESSION['CustomerID'] ."'"; +$result = DB_query($sql, $db); +echo '<table class=selection>'; +echo '<tr><td>' . _('Branch') . ':</td>'; +echo '<td><select name="Branch"'; +while ($myrow=DB_fetch_array($result)) { + if ($myrow['branchcode']==$_POST['branch']) { + echo '<option selected value='.$myrow['branchcode'].'>'.$myrow['brname'].'</option>'; + } else { + echo '<option value='.$myrow['branchcode'].'>'.$myrow['brname'].'</option>'; } - echo '></td></tr>'; - echo '<tr><td>' . _('Start Date') . ':</td> - <td><input type="Text" name="StartDate" class=date alt='.$_SESSION['DefaultDateFormat']. - ' size=11 maxlength=10 value=' . $_POST['StartDate'] . '></td></tr>'; - echo '<tr><td>' . _('End Date') . ':</td> - <td><input type="Text" name="EndDate" class=date alt='.$_SESSION['DefaultDateFormat']. - ' size=11 maxlength=10 value=' . $_POST['EndDate'] . '></td></tr>'; +} +echo '></td></tr>'; +echo '<tr><td>' . _('Start Date') . ':</td> + <td><input type="Text" name="StartDate" class=date alt='.$_SESSION['DefaultDateFormat']. + ' size=11 maxlength=10 value=' . $_POST['StartDate'] . '></td></tr>'; +echo '<tr><td>' . _('End Date') . ':</td> + <td><input type="Text" name="EndDate" class=date alt='.$_SESSION['DefaultDateFormat']. + ' size=11 maxlength=10 value=' . $_POST['EndDate'] . '></td></tr>'; - echo '<tr><td>' . _('Price') . ':</td> - <td><input type="Text" class=number name="Price" size=11 maxlength=10 value=' . $_POST['Price'] . '></td> - </tr></table>'; +echo '<tr><td>' . _('Price') . ':</td> + <td><input type="Text" class=number name="Price" size=11 maxlength=10 value=' . $_POST['Price'] . '></td> + </tr></table>'; - echo '<br><div class="centre"><input type="Submit" name="submit" VALUE="' . _('Enter Information') . '"></div>'; +echo '<br><div class="centre"><input type="Submit" name="submit" VALUE="' . _('Enter Information') . '"></div>'; - echo '</form>'; - include('includes/footer.inc'); +echo '</form>'; +include('includes/footer.inc'); - function ReSequenceEffectiveDates ($Item, $PriceList, $CurrAbbrev, $CustomerID, $db) { +function ReSequenceEffectiveDates ($Item, $PriceList, $CurrAbbrev, $CustomerID, $db) { - /*This is quite complicated - the idea is that prices set up should be unique and there is no way two prices could be returned as valid - when getting a price in includes/GetPrice.inc the logic is to first look for a price of the salestype/currency within the effective start and end dates - then if not get the price with a start date prior but a blank end date (the default price). We would not want two prices where the effective dates fall between an existing price so it is necessary to update enddates of prices - with me - I am just hanging on here myself + /*This is quite complicated - the idea is that prices set up should be unique and there is no way two prices could be returned as valid - when getting a price in includes/GetPrice.inc the logic is to first look for a price of the salestype/currency within the effective start and end dates - then if not get the price with a start date prior but a blank end date (the default price). We would not want two prices where the effective dates fall between an existing price so it is necessary to update enddates of prices - with me - I am just hanging on here myself - Prices with no end date are default prices and need to be ignored in this resquence*/ + Prices with no end date are default prices and need to be ignored in this resquence*/ - $SQL = "SELECT branchcode, - startdate, - enddate - FROM prices - WHERE debtorno='" . $CustomerID . "' - AND stockid='" . $Item . "' - AND currabrev='" . $CurrAbbrev . "' - AND typeabbrev='" . $PriceList . "' - AND enddate<>'' - ORDER BY - branchcode, - startdate, - enddate"; + $SQL = "SELECT branchcode, + startdate, + enddate + FROM prices + WHERE debtorno='" . $CustomerID . "' + AND stockid='" . $Item . "' + AND currabrev='" . $CurrAbbrev . "' + AND typeabbrev='" . $PriceList . "' + AND enddate<>'' + ORDER BY + branchcode, + startdate, + enddate"; - $result = DB_query($SQL,$db); + $result = DB_query($SQL,$db); - unset($BranchCode); + unset($BranchCode); - while ($myrow = DB_fetch_array($result)){ - if (!isset($BranchCode)){ - unset($NextDefaultStartDate); //a price with a blank end date - unset($NextStartDate); - unset($EndDate); - unset($StartDate); - $BranchCode = $myrow['branchcode']; - } - if (isset($NextStartDate)){ - if (Date1GreaterThanDate2(ConvertSQLDate($myrow['startdate']),$NextStartDate)){ - $NextStartDate = ConvertSQLDate($myrow['startdate']); - if (Date1GreaterThanDate2(ConvertSQLDate($EndDate),ConvertSQLDate($myrow['startdate']))) { - /*Need to make the end date the new start date less 1 day */ - $SQL = "UPDATE prices SET enddate = '" . FormatDateForSQL(DateAdd($NextStartDate,'d',-1)) . "' - WHERE stockid ='" .$Item . "' - AND currabrev='" . $CurrAbbrev . "' - AND typeabbrev='" . $PriceList . "' - AND startdate ='" . $StartDate . "' - AND enddate = '" . $EndDate . "' - AND debtorno ='" . $CustomerID . "'"; - $UpdateResult = DB_query($SQL,$db); - } - } //end of if startdate after NextStartDate - we have a new NextStartDate - } //end of if set NextStartDate - else { - $NextStartDate = ConvertSQLDate($myrow['startdate']); - } - $StartDate = $myrow['startdate']; - $EndDate = $myrow['enddate']; + while ($myrow = DB_fetch_array($result)){ + if (!isset($BranchCode)){ + unset($NextDefaultStartDate); //a price with a blank end date + unset($NextStartDate); + unset($EndDate); + unset($StartDate); + $BranchCode = $myrow['branchcode']; } + if (isset($NextStartDate)){ + if (Date1GreaterThanDate2(ConvertSQLDate($myrow['startdate']),$NextStartDate)){ + $NextStartDate = ConvertSQLDate($myrow['startdate']); + if (Date1GreaterThanDate2(ConvertSQLDate($EndDate),ConvertSQLDate($myrow['startdate']))) { + /*Need to make the end date the new start date less 1 day */ + $SQL = "UPDATE prices SET enddate = '" . FormatDateForSQL(DateAdd($NextStartDate,'d',-1)) . "' + WHERE stockid ='" .$Item . "' + AND currabrev='" . $CurrAbbrev . "' + AND typeabbrev='" . $PriceList . "' + AND startdate ='" . $StartDate . "' + AND enddate = '" . $EndDate . "' + AND debtorno ='" . $CustomerID . "'"; + $UpdateResult = DB_query($SQL,$db); + } + } //end of if startdate after NextStartDate - we have a new NextStartDate + } //end of if set NextStartDate + else { + $NextStartDate = ConvertSQLDate($myrow['startdate']); + } + $StartDate = $myrow['startdate']; + $EndDate = $myrow['enddate']; + } } ?> \ No newline at end of file Modified: trunk/PrintCustTrans.php =================================================================== --- trunk/PrintCustTrans.php 2011-04-16 06:20:56 UTC (rev 4551) +++ trunk/PrintCustTrans.php 2011-04-17 10:18:02 UTC (rev 4552) @@ -1,6 +1,6 @@ <?php /* $Id$ */ -//$PageSecurity = 1; + include ('includes/session.inc'); if (isset($_GET['FromTransNo'])) { $FromTransNo = trim($_GET['FromTransNo']); @@ -31,7 +31,6 @@ if (isset($PrintPDF) or isset($_GET['PrintPDF']) and $PrintPDF and isset($FromTransNo) and isset($InvOrCredit) and $FromTransNo != '') { $PaperSize = $FormDesign->PaperSize; include ('includes/PDFStarter.php'); - // Javier: now I use the native constructor, better to not use references if ($InvOrCredit == 'Invoice') { $pdf->addInfo('Title', _('Sales Invoice') . ' ' . $FromTransNo . ' to ' . $_POST['ToTransNo']); $pdf->addInfo('Subject', _('Invoices from') . ' ' . $FromTransNo . ' ' . _('to') . ' ' . $_POST['ToTransNo']); @@ -39,11 +38,7 @@ $pdf->addInfo('Title', _('Sales Credit Note')); $pdf->addInfo('Subject', _('Credit Notes from') . ' ' . $FromTransNo . ' ' . _('to') . ' ' . $_POST['ToTransNo']); } - /* Javier: I have brought this piece from the pdf class constructor to get it closer to the admin/user, - I corrected it to match TCPDF, but it still needs some check, after which, - I think it should be moved to each report to provide flexible Document Header and Margins in a per-report basis. */ - /* END Brought from class.pdf.php constructor */ - // $pdf->selectFont('helvetica'); + $FirstPage = true; $line_height = $FormDesign->LineHeight; while ($FromTransNo <= $_POST['ToTransNo']) { @@ -167,7 +162,7 @@ AND debtortrans.branchcode=custbranch.branchcode AND custbranch.salesman=salesman.salesmancode"; if ($_POST['PrintEDI'] == 'No') { - $sql = $sql . ' AND debtorsmaster.ediinvoices=0'; + $sql = $sql . " AND debtorsmaster.ediinvoices=0"; } } // end else if ($FromTransNo!='Preview') { @@ -177,7 +172,7 @@ include ('includes/header.inc'); prnMsg(_('There was a problem retrieving the invoice or credit note details for note number') . ' ' . $InvoiceToPrint . ' ' . _('from the database') . '. ' . _('To print an invoice, the sales order record, the customer transaction record and the branch record for the customer must not have been purged') . '. ' . _('To print a credit note only requires the customer, transaction, salesman and branch records be available'), 'error'); if ($debug == 1) { - prnMsg(_('The SQL used to get this information that failed was') . "<br />" . $sql, 'error'); + prnMsg(_('The SQL used to get this information that failed was') . '<br />' . $sql, 'error'); } include ('includes/footer.inc'); exit; @@ -230,9 +225,9 @@ if (DB_error_no($db) != 0) { $title = _('Transaction Print Error Report'); include ('includes/header.inc'); - echo '<br>' . _('There was a problem retrieving the invoice or credit note stock movement details for invoice number') . ' ' . $FromTransNo . ' ' . _('from the database'); + echo '<br />' . _('There was a problem retrieving the invoice or credit note stock movement details for invoice number') . ' ' . $FromTransNo . ' ' . _('from the database'); if ($debug == 1) { - echo '<br>' . _('The SQL used to get this information that failed was') . "<br>$sql"; + echo '<br />' . _('The SQL used to get this information that failed was') . '<br />' . $sql; } include ('includes/footer.inc'); exit; @@ -389,36 +384,40 @@ include ('includes/header.inc'); if (!isset($FromTransNo) OR $FromTransNo == '') { /* if FromTransNo is not set then show a form to allow input of either a single invoice number or a range of invoices to be printed. Also get the last invoice number created to show the user where the current range is up to */ - echo "<form action='" . $_SERVER['PHP_SELF'] . '?' . SID . "' 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 '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . _('Print Invoices or Credit Notes (Landscape Mode)') . '</p>'; echo '<tr><td>' . _('Print Invoices or Credit Notes') . '</td><td><select name=InvOrCredit>'; if ($InvOrCredit == 'Invoice' OR !isset($InvOrCredit)) { - echo "<option selected VALUE='Invoice'>" . _('Invoices'); - echo "<option VALUE='Credit'>" . _('Credit Notes'); + echo '<option selected value="Invoice">' . _('Invoices') . '</option>'; + echo '<option value="Credit">' . _('Credit Notes'). '</option>'; } else { - echo "<option selected VALUE='Credit'>" . _('Credit Notes'); - echo "<option VALUE='Invoice'>" . _('Invoices'); + echo '<option selected value="Credit">' . _('Credit Notes') . '</option>'; + echo '<option value="Invoice">' . _('Invoices') . '</option>'; } echo '</select></td></tr>'; echo '<tr><td>' . _('Print EDI Transactions') . '</td><td><select name=PrintEDI>'; if ($InvOrCredit == 'Invoice' OR !isset($InvOrCredit)) { - echo "<option selected VALUE='No'>" . _('Do not Print PDF EDI Transactions'); - echo "<option VALUE='Yes'>" . _('Print PDF EDI Transactions Too'); + echo '<option selected value="No">' . _('Do not Print PDF EDI Transactions') . '</option>'; + echo '<option value="Yes">' . _('Print PDF EDI Transactions Too') . '</option>'; } else { - echo "<option VALUE='No'>" . _('Do not Print PDF EDI Transactions'); - echo "<option selected VALUE='Yes'>" . _('Print PDF EDI Transactions Too'); + echo '<option value="No">' . _('Do not Print PDF EDI Transactions') . '</option>'; + echo '<option selected value="Yes">' . _('Print PDF EDI Transactions Too') . '</option>'; } echo '</select></td></tr>'; - echo '<tr><td>' . _('Start invoice/credit note number to print') . '</td><td><input Type=text class=number max=6 size=7 name=FromTransNo></td></tr>'; - echo '<tr><td>' . _('End invoice/credit note number to print') . "</td><td><input Type=text class=number max=6 size=7 name='ToTransNo'></td></tr></table>"; - echo "<br><div class='centre'><input type=Submit Name='Print' Value='" . _('Print') . "'><p>"; - echo "<input type=Submit Name='PrintPDF' Value='" . _('Print PDF') . "'></div>"; - $sql = 'SELECT typeno FROM systypes WHERE typeid=10'; + echo '<tr><td>' . _('Start invoice/credit note number to print') . '</td> + <td><input type="text" class="number" max=6 size=7 name=FromTransNo></td></tr>'; + echo '<tr><td>' . _('End invoice/credit note number to print') . '</td> + <td><input Type="text" class="number" max=6 size=7 name="ToTransNo"></td> + </tr></table>'; + echo '<br /><div class="centre"><input type="submit" name="Print" value="' . _('Print') . '"><p />'; + echo '<input type="submit" name="PrintPDF" value="' . _('Print PDF') . '"></div>'; + $sql = "SELECT typeno FROM systypes WHERE typeid=10"; $result = DB_query($sql, $db); $myrow = DB_fetch_row($result); - echo '<div class="page_help_text"><b>' . _('The last invoice created was number') . ' ' . $myrow[0] . '</b><br>' . _('If only a single invoice is required') . ', ' . _('enter the invoice number to print in the Start transaction number to print field and leave the End transaction number to print field blank') . '. ' . _('Only use the end invoice to print field if you wish to print a sequential range of invoices') . ''; - $sql = 'SELECT typeno FROM systypes WHERE typeid=11'; + echo '<div class="page_help_text"><b>' . _('The last invoice created was number') . ' ' . $myrow[0] . '</b><br />' . _('If only a single invoice is required') . ', ' . _('enter the invoice number to print in the Start transaction number to print field and leave the End transaction number to print field blank') . '. ' . _('Only use the end invoice to print field if you wish to print a sequential range of invoices') . ''; + $sql = "SELECT typeno FROM systypes WHERE typeid=11"; $result = DB_query($sql, $db); $myrow = DB_fetch_row($result); echo '<br /><b>' . _('The last credit note created was number') . ' ' . $myrow[0] . '</b><br />' . @@ -518,12 +517,9 @@ } $result = DB_query($sql, $db); if (DB_num_rows($result) == 0 OR DB_error_no($db) != 0) { - echo '<div class="page_help_text">' . _('There was a problem retrieving the invoice or credit note details for note number') . - ' ' . $FromTransNo . ' ' . _('from the database') . '. ' . - _('To print an invoice, the sales order record, the customer transaction record and the branch record for the customer must not have been purged') . - '. ' . _('To print a credit note only requires the customer, transaction, salesman and branch records be available').'</div>'; + echo '<div class="page_help_text">' . _('There was a problem retrieving the invoice or credit note details for note number') . ' ' . $FromTransNo . ' ' . _('from the database') . '. ' . _('To print an invoice, the sales order record, the customer transaction record and the branch record for the customer must not have been purged') . '. ' . _('To print a credit note only requires the customer, transaction, salesman and branch records be available').'</div>'; if ($debug == 1) { - echo _('The SQL used to get this information that failed was') . "<br>$sql"; + echo _('The SQL used to get this information that failed was') . "<br />$sql"; } break; include ('includes/footer.inc'); @@ -543,22 +539,22 @@ } else { echo '<font color=RED size=4>' . _('TAX CREDIT NOTE') . ' '; } - echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br><font size=1>' . _('Tax Authority Ref') . '. ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr></table>'; + echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br /><font size=1>' . _('Tax Authority Ref') . '. ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr></table>'; /* Now print out the logo and company name and address */ - echo '<table class="table1"><tr><td><font size=4 color="#333333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br>'; - echo $_SESSION['CompanyRecord']['regoffice1'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice2'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice3'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice4'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice5'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice6'] . '<br>'; - echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br>'; - echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br>'; - echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br>'; + echo '<table class="table1"><tr><td><font size=4 color="#333333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br />'; + echo $_SESSION['CompanyRecord']['regoffice1'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice2'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice3'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice4'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice5'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice6'] . '<br />'; + echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br />'; + echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br />'; + echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br />'; echo '</td><td WIDTH=50% class=number>'; /* Now the customer charged to details in a sub table within a cell of the main table*/ echo '<table class="table1"><tr><td align=left bgcolor="#BBBBBB"><b>' . _('Charge To') . ':</b></td></tr><tr><td bgcolor="#EEEEEE">'; - echo $myrow['name'] . '<br>' . $myrow['address1'] . '<br>' . $myrow['address2'] . '<br>' . $myrow['address3'] . '<br>' . $myrow['address4'] . '<br>' . $myrow['address5'] . '<br>' . $myrow['address6']; + echo $myrow['name'] . '<br />' . $myrow['address1'] . '<br />' . $myrow['address2'] . '<br />' . $myrow['address3'] . '<br />' . $myrow['address4'] . '<br />' . $myrow['address5'] . '<br />' . $myrow['address6']; echo '</td></tr></table>'; /*end of the small table showing charge to account details */ echo _('Page') . ': ' . $PageNumber; @@ -571,8 +567,8 @@ <td align=left bgcolor="#BBBBBB"><b>' . _('Delivered To') . ':</b></td> </tr>'; echo '<tr> - <td bgcolor="#EEEEEE">' . $myrow['brname'] . '<br>' . $myrow['braddress1'] . '<br>' . $myrow['braddress2'] . '<br>' . $myrow['braddress3'] . '<br>' . $myrow['braddress4'] . '<br>' . $myrow['braddress5'] . '<br>' . $myrow['braddress6'] . '</td>'; - echo '<td bgcolor="#EEEEEE">' . $myrow['deliverto'] . '<br>' . $myrow['deladd1'] . '<br>' . $myrow['deladd2'] . '<br>' . $myrow['deladd3'] . '<br>' . $myrow['deladd4'] . '<br>' . $myrow['deladd5'] . '<br>' . $myrow['deladd6'] . '</td>'; + <td bgcolor="#EEEEEE">' . $myrow['brname'] . '<br />' . $myrow['braddress1'] . '<br />' . $myrow['braddress2'] . '<br />' . $myrow['braddress3'] . '<br />' . $myrow['braddress4'] . '<br />' . $myrow['braddress5'] . '<br />' . $myrow['braddress6'] . '</td>'; + echo '<td bgcolor="#EEEEEE">' . $myrow['deliverto'] . '<br />' . $myrow['deladd1'] . '<br />' . $myrow['deladd2'] . '<br />' . $myrow['deladd3'] . '<br />' . $myrow['deladd4'] . '<br />' . $myrow['deladd5'] . '<br />' . $myrow['deladd6'] . '</td>'; echo '</tr> </table><hr>'; echo '<table class="table1"> @@ -614,7 +610,7 @@ <td align=left bgcolor="#BBBBBB"><b>' . _('Branch') . ':</b></td> </tr>'; echo '<tr> - <td bgcolor="#EEEEEE">' . $myrow['brname'] . '<br>' . $myrow['braddress1'] . '<br>' . $myrow['braddress2'] . '<br>' . $myrow['braddress3'] . '<br>' . $myrow['braddress4'] . '<br>' . $myrow['braddress5'] . '<br>' . $myrow['braddress6'] . '</td> + <td bgcolor="#EEEEEE">' . $myrow['brname'] . '<br />' . $myrow['braddress1'] . '<br />' . $myrow['braddress2'] . '<br />' . $myrow['braddress3'] . '<br />' . $myrow['braddress4'] . '<br />' . $myrow['braddress5'] . '<br />' . $myrow['braddress6'] . '</td> </tr></table>'; echo '<hr><table class="table1"><tr> <td align=left bgcolor="#BBBBBB"><b>' . _('Date') . '</b></td> @@ -643,7 +639,7 @@ if (DB_error_no($db) != 0) { echo '<div class="page_help_text">' . _('There was a problem retrieving the invoice or credit note stock movement details for invoice number') . ' ' . $FromTransNo . ' ' . _('from the database').'</div>'; if ($debug == 1) { - echo '<br>' . _('The SQL used to get this information that failed was') . '<br>'.$sql; + echo '<br />' . _('The SQL used to get this information that failed was') . '<br />'.$sql; } exit; } @@ -700,16 +696,16 @@ echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br /><font size=1>' . _('GST Number') . ' - ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr></table>'; /*Now print out company name and address */ echo '<table class="table1"><tr> - <td><font size=4 color="#333333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br>'; - echo $_SESSION['CompanyRecord']['regoffice1'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice2'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice3'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice4'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice5'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice6'] . '<br>'; - echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br>'; - echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br>'; - echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br>'; + <td><font size=4 color="#333333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br />'; + echo $_SESSION['CompanyRecord']['regoffice1'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice2'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice3'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice4'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice5'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice6'] . '<br />'; + echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br />'; + echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br />'; + echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br />'; echo '</td><td class=number>' . _('Page') . ': '.$PageNumber.'</td></tr></table>'; echo '<table class="table1"><tr> <th>' . _('Item Code') . '</th> @@ -736,18 +732,18 @@ } else { echo '<font color=RED size=4>' . _('TAX CREDIT NOTE') . ' '; } - echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br><font size=1>' . _('GST Number') . ' - ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr><table>'; + echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br /><font size=1>' . _('GST Number') . ' - ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr><table>'; /* Print out the logo and company name and address */ - echo '<table class="table1"><tr><td><font size=4 color="#333333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br>'; - echo $_SESSION['CompanyRecord']['regoffice1'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice2'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice3'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice4'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice5'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice6'] . '<br>'; - echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br>'; - echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br>'; - echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br>'; + echo '<table class="table1"><tr><td><font size=4 color="#333333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br />'; + echo $_SESSION['CompanyRecord']['regoffice1'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice2'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice3'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice4'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice5'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice6'] . '<br />'; + echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br />'; + echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br />'; + echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br />'; echo '</td><td class=number>' . _('Page') . ': '.$PageNumber.'</td></tr></table>'; echo '<table class="table1"><tr> <th>' . _('Item Code') . '</th> @@ -760,10 +756,10 @@ $LineCounter = 10; } /* Space out the footer to the bottom of the page */ - echo '<br><br>' . $myrow['invtext']; + echo '<br /><br />' . $myrow['invtext']; $LineCounter = $LineCounter + 2 + $LinesRequiredForText; while ($LineCounter < ($_SESSION['PageLength'] - 6)) { - echo '<br>'; + echo '<br />'; $LineCounter++; } /* Now print out the footer and totals */ Modified: trunk/RecurringSalesOrders.php =================================================================== --- trunk/RecurringSalesOrders.php 2011-04-16 06:20:56 UTC (rev 4551) +++ trunk/RecurringSalesOrders.php 2011-04-17 10:18:02 UTC (rev 4552) @@ -6,7 +6,6 @@ /* Session started in header.inc for password checking the session will contain the details of the order from the Cart class object. The details of the order come from SelectOrderItems.php */ -//$PageSecurity=1; include('includes/session.inc'); $title = _('Recurring Orders'); include('includes/header.inc'); @@ -494,13 +493,13 @@ echo '<br><div class="centre">'; if ($NewRecurringOrder=='Yes'){ - echo '<input type=hidden name="NewRecurringOrder" value="Yes">'; - echo "<input type=submit name='Process' value='" . _('Create Recurring Order') . "'>"; + echo '<input type="hidden" name="NewRecurringOrder" value="Yes">'; + echo '<input type="submit" name="Process" value="' . _('Create Recurring Order') . '">'; } else { echo '<input type=hidden name="NewRecurringOrder" value="No">'; echo '<input type=hidden name="ExistingRecurrOrderNo" value=' . $_POST['ExistingRecurrOrderNo'] . '>'; - echo "<input type=submit name='Process' value='" . _('Update Recurring Order Details') . "'>"; + echo '<input type="submit" name="Process" value="' . _('Update Recurring Order Details') . '">'; echo '<hr>'; echo '<br><br><input type=submit name="DeleteRecurringOrder" value="' . _('Delete Recurring Order') . ' ' . $_POST['ExistingRecurrOrderNo'] . '" onclick="return confirm(\'' . _('Are you sure you wish to delete this recurring order template?') . '\');">'; } Modified: trunk/SupplierTypes.php =================================================================== --- trunk/SupplierTypes.php 2011-04-16 06:20:56 UTC (rev 4551) +++ trunk/SupplierTypes.php 2011-04-17 10:18:02 UTC (rev 4552) @@ -1,8 +1,6 @@ <?php -/* $Revision: 1.6 $ */ -/* $Id$*/ -//$PageSecurity = 4; +/* $Id SupplierTypes.php 4183 2010-12-14 09:30:20Z daintree $ */ include('includes/session.inc'); $title = _('Supplier Types') . ' / ' . _('Maintenance'); Modified: trunk/includes/OutputSerialItems.php =================================================================== --- trunk/includes/OutputSerialItems.php 2011-04-16 06:20:56 UTC (rev 4551) +++ trunk/includes/OutputSerialItems.php 2011-04-17 10:18:02 UTC (rev 4552) @@ -34,21 +34,21 @@ $listtableheader=$tableheader; } else if ($LineItem->Serialised==0 and $Perishable==1){ $tableheader = '<tr> - <th>'. _('Batch/Roll/Bundle'). ' #</th> - <th>'. _('Available'). '</th> - <th>'. _('Quantity'). '</th> - <th>'. _('Expiry Date'). '</th> - </tr>'; + <th>'. _('Batch/Roll/Bundle'). ' #</th> + <th>'. _('Available'). '</th> + <th>'. _('Quantity'). '</th> + <th>'. _('Expiry Date'). '</th> + </tr>'; $listtableheader = '<tr> - <th>'. _('Batch/Roll/Bundle'). ' #</th> - <th>'. _('Quantity'). '</th> - <th>'. _('Expiry Date'). '</th> - </tr>'; + <th>'. _('Batch/Roll/Bundle'). ' #</th> + <th>'. _('Quantity'). '</th> + <th>'. _('Expiry Date'). '</th> + </tr>'; } else { $tableheader = '<tr> - <th>'. _('Batch/Roll/Bundle'). ' #</th> - <th>'. _('Quantity'). '</th> - </tr>'; + <th>'. _('Batch/Roll/Bundle'). ' #</th> + <th>'. _('Quantity'). '</th> + </tr>'; $listtableheader=$tableheader; } @@ -97,7 +97,6 @@ echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?Delete=' . $Bundle->BundleRef . '&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Delete'). '</a></td></tr>'; - $LineItem->SerialItems[]=$Bundle; $TotalQuantity += $Bundle->BundleQty; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-04-17 10:18:10
|
Revision: 4552 http://web-erp.svn.sourceforge.net/web-erp/?rev=4552&view=rev Author: daintree Date: 2011-04-17 10:18:02 +0000 (Sun, 17 Apr 2011) Log Message: ----------- various Modified Paths: -------------- trunk/PO_Header.php trunk/Prices_Customer.php trunk/PrintCustTrans.php trunk/RecurringSalesOrders.php trunk/SupplierTypes.php trunk/includes/OutputSerialItems.php Modified: trunk/PO_Header.php =================================================================== --- trunk/PO_Header.php 2011-04-16 06:20:56 UTC (rev 4551) +++ trunk/PO_Header.php 2011-04-17 10:18:02 UTC (rev 4552) @@ -766,7 +766,7 @@ if($_SESSION['ExistingOrder'] != 0 AND $_SESSION['PO'.$identifier]->Status == 'Printed'){ - echo '<tr><td><a href="' . $rootpath . '/GoodsReceived.php?' . SID . '&PONumber=' . + echo '<tr><td><a href="' . $rootpath . '/GoodsReceived.php?PONumber=' . $_SESSION['PO'.$identifier]->OrderNo . '&identifier=' . $identifier . '">'._('Receive this order').'</a></td></tr>'; } if ($_SESSION['PO'.$identifier]->Status==''){ //then its a new order @@ -959,9 +959,9 @@ <td><input type="text" name="Tel" size="31" maxlength="30" value="' . $_SESSION['PO'.$identifier]->Tel . '"></td> </tr>'; - echo '<tr><td>' . _('Delivery By') . ':</td><td><select name=DeliveryBy>'; + echo '<tr><td>' . _('Delivery By') . ':</td><td><select name="DeliveryBy">'; - $ShipperResult = DB_query('SELECT shipper_id, shippername FROM shippers',$db); + $ShipperResult = DB_query("SELECT shipper_id, shippername FROM shippers",$db); while ($ShipperRow=DB_fetch_array($ShipperResult)){ if (isset($_POST['DeliveryBy']) and ($_POST['DeliveryBy'] == $ShipperRow['shipper_id'])) { @@ -978,7 +978,7 @@ echo '<table class=selection width=100%><tr><td>' . _('Supplier Selection') . ':</td><td> <select name=Keywords onChange="ReloadForm(form1.SearchSuppliers)">'; - $SuppCoResult = DB_query('SELECT supplierid, suppname FROM suppliers ORDER BY suppname',$db); + $SuppCoResult = DB_query("SELECT supplierid, suppname FROM suppliers ORDER BY suppname",$db); while ( $SuppCoRow=DB_fetch_array($SuppCoResult)){ if ($SuppCoRow['suppname'] == $_SESSION['PO'.$identifier]->SupplierName) { @@ -1029,9 +1029,10 @@ </td><td><input type="text" name="SuppTel" size="31" maxlength="30" value="' . $_SESSION['PO'.$identifier]->SuppTel . '"></td> </tr>'; - $result=DB_query('SELECT terms, termsindicator FROM paymentterms', $db); + $result=DB_query("SELECT terms, termsindicator FROM paymentterms", $db); - echo '<tr><td>' . _('Payment Terms') . ':</td><td><select name="PaymentTerms">'; + echo '<tr><td>' . _('Payment Terms') . ':</td> + <td><select name="PaymentTerms">'; while ($myrow = DB_fetch_array($result)) { if ($myrow['termsindicator']==$_SESSION['PO'.$identifier]->PaymentTerms) { @@ -1054,8 +1055,9 @@ </tr>'; if ($_SESSION['PO'.$identifier]->CurrCode != $_SESSION['CompanyRecord']['currencydefault']) { - echo '<tr><td>'. _('Exchange Rate').':'.'</td><td><input type=text name="ExRate" - value='.$_POST['ExRate'].' class=number size=11></td></tr>'; + echo '<tr><td>'. _('Exchange Rate').':'.'</td> + <td><input type=text name="ExRate" value='.$_POST['ExRate'].' class="number" size=11></td> + </tr>'; } else { echo '<input type=hidden name="ExRate" value="1">'; } Modified: trunk/Prices_Customer.php =================================================================== --- trunk/Prices_Customer.php 2011-04-16 06:20:56 UTC (rev 4551) +++ trunk/Prices_Customer.php 2011-04-17 10:18:02 UTC (rev 4552) @@ -1,7 +1,5 @@ <?php -/* $Revision: 1.11 $ */ /* $Id$*/ -//$PageSecurity = 11; include('includes/session.inc'); @@ -275,158 +273,142 @@ } else { $EndDateDisplay = ConvertSQLDate($myrow['enddate']); } - printf("<tr bgcolor='#CCCCCC'> - <td class=number>%0.2f</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td><a href='%s?Item=%s&Price=%s&Branch=%s&StartDate=%s&EndDate=%s&Edit=1'>" . _('Edit') . "</td> - <td><a href='%s?Item=%s&Branch=%s&StartDate=%s&EndDate=%s&delete=yes'>" . _('Delete') . "</td></tr>", - $myrow['price'], - $Branch, - ConvertSQLDate($myrow['startdate']), - $EndDateDisplay, - $_SERVER['PHP_SELF'], - $Item, - $myrow['price'], - $myrow['branchcode'], - $myrow['startdate'], - $myrow['enddate'], - $_SERVER['PHP_SELF'], - $Item, - $myrow['branchcode'], - $myrow['startdate'], - $myrow['enddate']); + echo '<tr bgcolor="#CCCCCC"> + <td class=number>'.number_format($myrow['price'],2).'</td> + <td>'.$Branch.'</td> + <td>'.$myrow['units'].'</td> + <td class=number>'.$myrow['conversionfactor'].'</td> + <td>'.ConvertSQLDate($myrow['startdate']).'</td> + <td>'.$EndDateDisplay.'</td> + <td><a href="'.$_SERVER['PHP_SELF'].'?Item='.$Item.'&Price='.$myrow['price'].'&Branch='.$myrow['branchcode']. + '&StartDate='.$myrow['startdate'].'&EndDate='.$myrow['enddate'].'&Edit=1">' . _('Edit') . '</td> + <td><a href="'.$_SERVER['PHP_SELF'].'?Item='.$Item.'&Branch='.$myrow['branchcode'].'&StartDate='.$myrow['startdate'] .'&EndDate='.$myrow['enddate'].'&delete=yes">' . _('Delete') . '</td></tr>'; + } //END WHILE LIST LOOP } -?> +echo '</table></tr></table><p />'; -</table></tr></table> +echo '<form method="post" action=' . $_SERVER['PHP_SELF'] . '?' . SID . '>'; +echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; +echo '<input type=hidden name="Item" VALUE="' . $Item . '">'; -<p> - -<?php - echo '<form method="post" action=' . $_SERVER['PHP_SELF'] . '?' . SID . '>'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<input type=hidden name="Item" VALUE="' . $Item . '">'; - - if (isset($_GET['Edit']) and $_GET['Edit']==1){ - echo '<input type=hidden name="Editing" VALUE="Yes">'; - echo '<input type=hidden name="OldStartDate" VALUE="' . $_GET['StartDate'] .'">'; - echo '<input type=hidden name="OldEndDate" VALUE="' . $_GET['EndDate'] . '">'; - $_POST['Price']=$_GET['Price']; - $_POST['Branch']=$_GET['Branch']; - $_POST['StartDate'] = ConvertSQLDate($_GET['StartDate']); - if (Is_Date($_GET['EndDate'])){ - $_POST['EndDate'] = ConvertSQLDate($_GET['EndDate']); - } else { - $_POST['EndDate']=''; - } +if (isset($_GET['Edit']) and $_GET['Edit']==1){ + echo '<input type=hidden name="Editing" VALUE="Yes">'; + echo '<input type=hidden name="OldStartDate" VALUE="' . $_GET['StartDate'] .'">'; + echo '<input type=hidden name="OldEndDate" VALUE="' . $_GET['EndDate'] . '">'; + $_POST['Price']=$_GET['Price']; + $_POST['Branch']=$_GET['Branch']; + $_POST['StartDate'] = ConvertSQLDate($_GET['StartDate']); + if (Is_Date($_GET['EndDate'])){ + $_POST['EndDate'] = ConvertSQLDate($_GET['EndDate']); + } else { + $_POST['EndDate']=''; } - if (!isset($_POST['Branch'])) { - $_POST['Branch']=''; - } - if (!isset($_POST['Price'])) { - $_POST['Price']=0; - } +} +if (!isset($_POST['Branch'])) { + $_POST['Branch']=''; +} +if (!isset($_POST['Price'])) { + $_POST['Price']=0; +} - if (!isset($_POST['StartDate'])){ - $_POST['StartDate'] = Date($_SESSION['DefaultDateFormat']); - } +if (!isset($_POST['StartDate'])){ + $_POST['StartDate'] = Date($_SESSION['DefaultDateFormat']); +} - if (!isset($_POST['EndDate'])){ - $_POST['EndDate'] = DateAdd(Date($_SESSION['DefaultDateFormat']), 'y', 1); - } +if (!isset($_POST['EndDate'])){ + $_POST['EndDate'] = ''; +} - $sql = "SELECT - branchcode, - brname - FROM custbranch - WHERE debtorno='".$_SESSION['CustomerID'] ."'"; - $result = DB_query($sql, $db); - echo '<table class=selection>'; - echo '<tr><td>' . _('Branch') . ':</td>'; - echo '<td><select name="Branch"'; - while ($myrow=DB_fetch_array($result)) { - if ($myrow['branchcode']==$_POST['branch']) { - echo '<option selected value='.$myrow['branchcode'].'>'.$myrow['brname'].'</option>'; - } else { - echo '<option value='.$myrow['branchcode'].'>'.$myrow['brname'].'</option>'; - } +$sql = "SELECT + branchcode, + brname + FROM custbranch + WHERE debtorno='".$_SESSION['CustomerID'] ."'"; +$result = DB_query($sql, $db); +echo '<table class=selection>'; +echo '<tr><td>' . _('Branch') . ':</td>'; +echo '<td><select name="Branch"'; +while ($myrow=DB_fetch_array($result)) { + if ($myrow['branchcode']==$_POST['branch']) { + echo '<option selected value='.$myrow['branchcode'].'>'.$myrow['brname'].'</option>'; + } else { + echo '<option value='.$myrow['branchcode'].'>'.$myrow['brname'].'</option>'; } - echo '></td></tr>'; - echo '<tr><td>' . _('Start Date') . ':</td> - <td><input type="Text" name="StartDate" class=date alt='.$_SESSION['DefaultDateFormat']. - ' size=11 maxlength=10 value=' . $_POST['StartDate'] . '></td></tr>'; - echo '<tr><td>' . _('End Date') . ':</td> - <td><input type="Text" name="EndDate" class=date alt='.$_SESSION['DefaultDateFormat']. - ' size=11 maxlength=10 value=' . $_POST['EndDate'] . '></td></tr>'; +} +echo '></td></tr>'; +echo '<tr><td>' . _('Start Date') . ':</td> + <td><input type="Text" name="StartDate" class=date alt='.$_SESSION['DefaultDateFormat']. + ' size=11 maxlength=10 value=' . $_POST['StartDate'] . '></td></tr>'; +echo '<tr><td>' . _('End Date') . ':</td> + <td><input type="Text" name="EndDate" class=date alt='.$_SESSION['DefaultDateFormat']. + ' size=11 maxlength=10 value=' . $_POST['EndDate'] . '></td></tr>'; - echo '<tr><td>' . _('Price') . ':</td> - <td><input type="Text" class=number name="Price" size=11 maxlength=10 value=' . $_POST['Price'] . '></td> - </tr></table>'; +echo '<tr><td>' . _('Price') . ':</td> + <td><input type="Text" class=number name="Price" size=11 maxlength=10 value=' . $_POST['Price'] . '></td> + </tr></table>'; - echo '<br><div class="centre"><input type="Submit" name="submit" VALUE="' . _('Enter Information') . '"></div>'; +echo '<br><div class="centre"><input type="Submit" name="submit" VALUE="' . _('Enter Information') . '"></div>'; - echo '</form>'; - include('includes/footer.inc'); +echo '</form>'; +include('includes/footer.inc'); - function ReSequenceEffectiveDates ($Item, $PriceList, $CurrAbbrev, $CustomerID, $db) { +function ReSequenceEffectiveDates ($Item, $PriceList, $CurrAbbrev, $CustomerID, $db) { - /*This is quite complicated - the idea is that prices set up should be unique and there is no way two prices could be returned as valid - when getting a price in includes/GetPrice.inc the logic is to first look for a price of the salestype/currency within the effective start and end dates - then if not get the price with a start date prior but a blank end date (the default price). We would not want two prices where the effective dates fall between an existing price so it is necessary to update enddates of prices - with me - I am just hanging on here myself + /*This is quite complicated - the idea is that prices set up should be unique and there is no way two prices could be returned as valid - when getting a price in includes/GetPrice.inc the logic is to first look for a price of the salestype/currency within the effective start and end dates - then if not get the price with a start date prior but a blank end date (the default price). We would not want two prices where the effective dates fall between an existing price so it is necessary to update enddates of prices - with me - I am just hanging on here myself - Prices with no end date are default prices and need to be ignored in this resquence*/ + Prices with no end date are default prices and need to be ignored in this resquence*/ - $SQL = "SELECT branchcode, - startdate, - enddate - FROM prices - WHERE debtorno='" . $CustomerID . "' - AND stockid='" . $Item . "' - AND currabrev='" . $CurrAbbrev . "' - AND typeabbrev='" . $PriceList . "' - AND enddate<>'' - ORDER BY - branchcode, - startdate, - enddate"; + $SQL = "SELECT branchcode, + startdate, + enddate + FROM prices + WHERE debtorno='" . $CustomerID . "' + AND stockid='" . $Item . "' + AND currabrev='" . $CurrAbbrev . "' + AND typeabbrev='" . $PriceList . "' + AND enddate<>'' + ORDER BY + branchcode, + startdate, + enddate"; - $result = DB_query($SQL,$db); + $result = DB_query($SQL,$db); - unset($BranchCode); + unset($BranchCode); - while ($myrow = DB_fetch_array($result)){ - if (!isset($BranchCode)){ - unset($NextDefaultStartDate); //a price with a blank end date - unset($NextStartDate); - unset($EndDate); - unset($StartDate); - $BranchCode = $myrow['branchcode']; - } - if (isset($NextStartDate)){ - if (Date1GreaterThanDate2(ConvertSQLDate($myrow['startdate']),$NextStartDate)){ - $NextStartDate = ConvertSQLDate($myrow['startdate']); - if (Date1GreaterThanDate2(ConvertSQLDate($EndDate),ConvertSQLDate($myrow['startdate']))) { - /*Need to make the end date the new start date less 1 day */ - $SQL = "UPDATE prices SET enddate = '" . FormatDateForSQL(DateAdd($NextStartDate,'d',-1)) . "' - WHERE stockid ='" .$Item . "' - AND currabrev='" . $CurrAbbrev . "' - AND typeabbrev='" . $PriceList . "' - AND startdate ='" . $StartDate . "' - AND enddate = '" . $EndDate . "' - AND debtorno ='" . $CustomerID . "'"; - $UpdateResult = DB_query($SQL,$db); - } - } //end of if startdate after NextStartDate - we have a new NextStartDate - } //end of if set NextStartDate - else { - $NextStartDate = ConvertSQLDate($myrow['startdate']); - } - $StartDate = $myrow['startdate']; - $EndDate = $myrow['enddate']; + while ($myrow = DB_fetch_array($result)){ + if (!isset($BranchCode)){ + unset($NextDefaultStartDate); //a price with a blank end date + unset($NextStartDate); + unset($EndDate); + unset($StartDate); + $BranchCode = $myrow['branchcode']; } + if (isset($NextStartDate)){ + if (Date1GreaterThanDate2(ConvertSQLDate($myrow['startdate']),$NextStartDate)){ + $NextStartDate = ConvertSQLDate($myrow['startdate']); + if (Date1GreaterThanDate2(ConvertSQLDate($EndDate),ConvertSQLDate($myrow['startdate']))) { + /*Need to make the end date the new start date less 1 day */ + $SQL = "UPDATE prices SET enddate = '" . FormatDateForSQL(DateAdd($NextStartDate,'d',-1)) . "' + WHERE stockid ='" .$Item . "' + AND currabrev='" . $CurrAbbrev . "' + AND typeabbrev='" . $PriceList . "' + AND startdate ='" . $StartDate . "' + AND enddate = '" . $EndDate . "' + AND debtorno ='" . $CustomerID . "'"; + $UpdateResult = DB_query($SQL,$db); + } + } //end of if startdate after NextStartDate - we have a new NextStartDate + } //end of if set NextStartDate + else { + $NextStartDate = ConvertSQLDate($myrow['startdate']); + } + $StartDate = $myrow['startdate']; + $EndDate = $myrow['enddate']; + } } ?> \ No newline at end of file Modified: trunk/PrintCustTrans.php =================================================================== --- trunk/PrintCustTrans.php 2011-04-16 06:20:56 UTC (rev 4551) +++ trunk/PrintCustTrans.php 2011-04-17 10:18:02 UTC (rev 4552) @@ -1,6 +1,6 @@ <?php /* $Id$ */ -//$PageSecurity = 1; + include ('includes/session.inc'); if (isset($_GET['FromTransNo'])) { $FromTransNo = trim($_GET['FromTransNo']); @@ -31,7 +31,6 @@ if (isset($PrintPDF) or isset($_GET['PrintPDF']) and $PrintPDF and isset($FromTransNo) and isset($InvOrCredit) and $FromTransNo != '') { $PaperSize = $FormDesign->PaperSize; include ('includes/PDFStarter.php'); - // Javier: now I use the native constructor, better to not use references if ($InvOrCredit == 'Invoice') { $pdf->addInfo('Title', _('Sales Invoice') . ' ' . $FromTransNo . ' to ' . $_POST['ToTransNo']); $pdf->addInfo('Subject', _('Invoices from') . ' ' . $FromTransNo . ' ' . _('to') . ' ' . $_POST['ToTransNo']); @@ -39,11 +38,7 @@ $pdf->addInfo('Title', _('Sales Credit Note')); $pdf->addInfo('Subject', _('Credit Notes from') . ' ' . $FromTransNo . ' ' . _('to') . ' ' . $_POST['ToTransNo']); } - /* Javier: I have brought this piece from the pdf class constructor to get it closer to the admin/user, - I corrected it to match TCPDF, but it still needs some check, after which, - I think it should be moved to each report to provide flexible Document Header and Margins in a per-report basis. */ - /* END Brought from class.pdf.php constructor */ - // $pdf->selectFont('helvetica'); + $FirstPage = true; $line_height = $FormDesign->LineHeight; while ($FromTransNo <= $_POST['ToTransNo']) { @@ -167,7 +162,7 @@ AND debtortrans.branchcode=custbranch.branchcode AND custbranch.salesman=salesman.salesmancode"; if ($_POST['PrintEDI'] == 'No') { - $sql = $sql . ' AND debtorsmaster.ediinvoices=0'; + $sql = $sql . " AND debtorsmaster.ediinvoices=0"; } } // end else if ($FromTransNo!='Preview') { @@ -177,7 +172,7 @@ include ('includes/header.inc'); prnMsg(_('There was a problem retrieving the invoice or credit note details for note number') . ' ' . $InvoiceToPrint . ' ' . _('from the database') . '. ' . _('To print an invoice, the sales order record, the customer transaction record and the branch record for the customer must not have been purged') . '. ' . _('To print a credit note only requires the customer, transaction, salesman and branch records be available'), 'error'); if ($debug == 1) { - prnMsg(_('The SQL used to get this information that failed was') . "<br />" . $sql, 'error'); + prnMsg(_('The SQL used to get this information that failed was') . '<br />' . $sql, 'error'); } include ('includes/footer.inc'); exit; @@ -230,9 +225,9 @@ if (DB_error_no($db) != 0) { $title = _('Transaction Print Error Report'); include ('includes/header.inc'); - echo '<br>' . _('There was a problem retrieving the invoice or credit note stock movement details for invoice number') . ' ' . $FromTransNo . ' ' . _('from the database'); + echo '<br />' . _('There was a problem retrieving the invoice or credit note stock movement details for invoice number') . ' ' . $FromTransNo . ' ' . _('from the database'); if ($debug == 1) { - echo '<br>' . _('The SQL used to get this information that failed was') . "<br>$sql"; + echo '<br />' . _('The SQL used to get this information that failed was') . '<br />' . $sql; } include ('includes/footer.inc'); exit; @@ -389,36 +384,40 @@ include ('includes/header.inc'); if (!isset($FromTransNo) OR $FromTransNo == '') { /* if FromTransNo is not set then show a form to allow input of either a single invoice number or a range of invoices to be printed. Also get the last invoice number created to show the user where the current range is up to */ - echo "<form action='" . $_SERVER['PHP_SELF'] . '?' . SID . "' 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 '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . _('Print Invoices or Credit Notes (Landscape Mode)') . '</p>'; echo '<tr><td>' . _('Print Invoices or Credit Notes') . '</td><td><select name=InvOrCredit>'; if ($InvOrCredit == 'Invoice' OR !isset($InvOrCredit)) { - echo "<option selected VALUE='Invoice'>" . _('Invoices'); - echo "<option VALUE='Credit'>" . _('Credit Notes'); + echo '<option selected value="Invoice">' . _('Invoices') . '</option>'; + echo '<option value="Credit">' . _('Credit Notes'). '</option>'; } else { - echo "<option selected VALUE='Credit'>" . _('Credit Notes'); - echo "<option VALUE='Invoice'>" . _('Invoices'); + echo '<option selected value="Credit">' . _('Credit Notes') . '</option>'; + echo '<option value="Invoice">' . _('Invoices') . '</option>'; } echo '</select></td></tr>'; echo '<tr><td>' . _('Print EDI Transactions') . '</td><td><select name=PrintEDI>'; if ($InvOrCredit == 'Invoice' OR !isset($InvOrCredit)) { - echo "<option selected VALUE='No'>" . _('Do not Print PDF EDI Transactions'); - echo "<option VALUE='Yes'>" . _('Print PDF EDI Transactions Too'); + echo '<option selected value="No">' . _('Do not Print PDF EDI Transactions') . '</option>'; + echo '<option value="Yes">' . _('Print PDF EDI Transactions Too') . '</option>'; } else { - echo "<option VALUE='No'>" . _('Do not Print PDF EDI Transactions'); - echo "<option selected VALUE='Yes'>" . _('Print PDF EDI Transactions Too'); + echo '<option value="No">' . _('Do not Print PDF EDI Transactions') . '</option>'; + echo '<option selected value="Yes">' . _('Print PDF EDI Transactions Too') . '</option>'; } echo '</select></td></tr>'; - echo '<tr><td>' . _('Start invoice/credit note number to print') . '</td><td><input Type=text class=number max=6 size=7 name=FromTransNo></td></tr>'; - echo '<tr><td>' . _('End invoice/credit note number to print') . "</td><td><input Type=text class=number max=6 size=7 name='ToTransNo'></td></tr></table>"; - echo "<br><div class='centre'><input type=Submit Name='Print' Value='" . _('Print') . "'><p>"; - echo "<input type=Submit Name='PrintPDF' Value='" . _('Print PDF') . "'></div>"; - $sql = 'SELECT typeno FROM systypes WHERE typeid=10'; + echo '<tr><td>' . _('Start invoice/credit note number to print') . '</td> + <td><input type="text" class="number" max=6 size=7 name=FromTransNo></td></tr>'; + echo '<tr><td>' . _('End invoice/credit note number to print') . '</td> + <td><input Type="text" class="number" max=6 size=7 name="ToTransNo"></td> + </tr></table>'; + echo '<br /><div class="centre"><input type="submit" name="Print" value="' . _('Print') . '"><p />'; + echo '<input type="submit" name="PrintPDF" value="' . _('Print PDF') . '"></div>'; + $sql = "SELECT typeno FROM systypes WHERE typeid=10"; $result = DB_query($sql, $db); $myrow = DB_fetch_row($result); - echo '<div class="page_help_text"><b>' . _('The last invoice created was number') . ' ' . $myrow[0] . '</b><br>' . _('If only a single invoice is required') . ', ' . _('enter the invoice number to print in the Start transaction number to print field and leave the End transaction number to print field blank') . '. ' . _('Only use the end invoice to print field if you wish to print a sequential range of invoices') . ''; - $sql = 'SELECT typeno FROM systypes WHERE typeid=11'; + echo '<div class="page_help_text"><b>' . _('The last invoice created was number') . ' ' . $myrow[0] . '</b><br />' . _('If only a single invoice is required') . ', ' . _('enter the invoice number to print in the Start transaction number to print field and leave the End transaction number to print field blank') . '. ' . _('Only use the end invoice to print field if you wish to print a sequential range of invoices') . ''; + $sql = "SELECT typeno FROM systypes WHERE typeid=11"; $result = DB_query($sql, $db); $myrow = DB_fetch_row($result); echo '<br /><b>' . _('The last credit note created was number') . ' ' . $myrow[0] . '</b><br />' . @@ -518,12 +517,9 @@ } $result = DB_query($sql, $db); if (DB_num_rows($result) == 0 OR DB_error_no($db) != 0) { - echo '<div class="page_help_text">' . _('There was a problem retrieving the invoice or credit note details for note number') . - ' ' . $FromTransNo . ' ' . _('from the database') . '. ' . - _('To print an invoice, the sales order record, the customer transaction record and the branch record for the customer must not have been purged') . - '. ' . _('To print a credit note only requires the customer, transaction, salesman and branch records be available').'</div>'; + echo '<div class="page_help_text">' . _('There was a problem retrieving the invoice or credit note details for note number') . ' ' . $FromTransNo . ' ' . _('from the database') . '. ' . _('To print an invoice, the sales order record, the customer transaction record and the branch record for the customer must not have been purged') . '. ' . _('To print a credit note only requires the customer, transaction, salesman and branch records be available').'</div>'; if ($debug == 1) { - echo _('The SQL used to get this information that failed was') . "<br>$sql"; + echo _('The SQL used to get this information that failed was') . "<br />$sql"; } break; include ('includes/footer.inc'); @@ -543,22 +539,22 @@ } else { echo '<font color=RED size=4>' . _('TAX CREDIT NOTE') . ' '; } - echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br><font size=1>' . _('Tax Authority Ref') . '. ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr></table>'; + echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br /><font size=1>' . _('Tax Authority Ref') . '. ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr></table>'; /* Now print out the logo and company name and address */ - echo '<table class="table1"><tr><td><font size=4 color="#333333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br>'; - echo $_SESSION['CompanyRecord']['regoffice1'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice2'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice3'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice4'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice5'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice6'] . '<br>'; - echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br>'; - echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br>'; - echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br>'; + echo '<table class="table1"><tr><td><font size=4 color="#333333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br />'; + echo $_SESSION['CompanyRecord']['regoffice1'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice2'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice3'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice4'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice5'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice6'] . '<br />'; + echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br />'; + echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br />'; + echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br />'; echo '</td><td WIDTH=50% class=number>'; /* Now the customer charged to details in a sub table within a cell of the main table*/ echo '<table class="table1"><tr><td align=left bgcolor="#BBBBBB"><b>' . _('Charge To') . ':</b></td></tr><tr><td bgcolor="#EEEEEE">'; - echo $myrow['name'] . '<br>' . $myrow['address1'] . '<br>' . $myrow['address2'] . '<br>' . $myrow['address3'] . '<br>' . $myrow['address4'] . '<br>' . $myrow['address5'] . '<br>' . $myrow['address6']; + echo $myrow['name'] . '<br />' . $myrow['address1'] . '<br />' . $myrow['address2'] . '<br />' . $myrow['address3'] . '<br />' . $myrow['address4'] . '<br />' . $myrow['address5'] . '<br />' . $myrow['address6']; echo '</td></tr></table>'; /*end of the small table showing charge to account details */ echo _('Page') . ': ' . $PageNumber; @@ -571,8 +567,8 @@ <td align=left bgcolor="#BBBBBB"><b>' . _('Delivered To') . ':</b></td> </tr>'; echo '<tr> - <td bgcolor="#EEEEEE">' . $myrow['brname'] . '<br>' . $myrow['braddress1'] . '<br>' . $myrow['braddress2'] . '<br>' . $myrow['braddress3'] . '<br>' . $myrow['braddress4'] . '<br>' . $myrow['braddress5'] . '<br>' . $myrow['braddress6'] . '</td>'; - echo '<td bgcolor="#EEEEEE">' . $myrow['deliverto'] . '<br>' . $myrow['deladd1'] . '<br>' . $myrow['deladd2'] . '<br>' . $myrow['deladd3'] . '<br>' . $myrow['deladd4'] . '<br>' . $myrow['deladd5'] . '<br>' . $myrow['deladd6'] . '</td>'; + <td bgcolor="#EEEEEE">' . $myrow['brname'] . '<br />' . $myrow['braddress1'] . '<br />' . $myrow['braddress2'] . '<br />' . $myrow['braddress3'] . '<br />' . $myrow['braddress4'] . '<br />' . $myrow['braddress5'] . '<br />' . $myrow['braddress6'] . '</td>'; + echo '<td bgcolor="#EEEEEE">' . $myrow['deliverto'] . '<br />' . $myrow['deladd1'] . '<br />' . $myrow['deladd2'] . '<br />' . $myrow['deladd3'] . '<br />' . $myrow['deladd4'] . '<br />' . $myrow['deladd5'] . '<br />' . $myrow['deladd6'] . '</td>'; echo '</tr> </table><hr>'; echo '<table class="table1"> @@ -614,7 +610,7 @@ <td align=left bgcolor="#BBBBBB"><b>' . _('Branch') . ':</b></td> </tr>'; echo '<tr> - <td bgcolor="#EEEEEE">' . $myrow['brname'] . '<br>' . $myrow['braddress1'] . '<br>' . $myrow['braddress2'] . '<br>' . $myrow['braddress3'] . '<br>' . $myrow['braddress4'] . '<br>' . $myrow['braddress5'] . '<br>' . $myrow['braddress6'] . '</td> + <td bgcolor="#EEEEEE">' . $myrow['brname'] . '<br />' . $myrow['braddress1'] . '<br />' . $myrow['braddress2'] . '<br />' . $myrow['braddress3'] . '<br />' . $myrow['braddress4'] . '<br />' . $myrow['braddress5'] . '<br />' . $myrow['braddress6'] . '</td> </tr></table>'; echo '<hr><table class="table1"><tr> <td align=left bgcolor="#BBBBBB"><b>' . _('Date') . '</b></td> @@ -643,7 +639,7 @@ if (DB_error_no($db) != 0) { echo '<div class="page_help_text">' . _('There was a problem retrieving the invoice or credit note stock movement details for invoice number') . ' ' . $FromTransNo . ' ' . _('from the database').'</div>'; if ($debug == 1) { - echo '<br>' . _('The SQL used to get this information that failed was') . '<br>'.$sql; + echo '<br />' . _('The SQL used to get this information that failed was') . '<br />'.$sql; } exit; } @@ -700,16 +696,16 @@ echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br /><font size=1>' . _('GST Number') . ' - ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr></table>'; /*Now print out company name and address */ echo '<table class="table1"><tr> - <td><font size=4 color="#333333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br>'; - echo $_SESSION['CompanyRecord']['regoffice1'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice2'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice3'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice4'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice5'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice6'] . '<br>'; - echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br>'; - echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br>'; - echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br>'; + <td><font size=4 color="#333333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br />'; + echo $_SESSION['CompanyRecord']['regoffice1'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice2'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice3'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice4'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice5'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice6'] . '<br />'; + echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br />'; + echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br />'; + echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br />'; echo '</td><td class=number>' . _('Page') . ': '.$PageNumber.'</td></tr></table>'; echo '<table class="table1"><tr> <th>' . _('Item Code') . '</th> @@ -736,18 +732,18 @@ } else { echo '<font color=RED size=4>' . _('TAX CREDIT NOTE') . ' '; } - echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br><font size=1>' . _('GST Number') . ' - ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr><table>'; + echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br /><font size=1>' . _('GST Number') . ' - ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr><table>'; /* Print out the logo and company name and address */ - echo '<table class="table1"><tr><td><font size=4 color="#333333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br>'; - echo $_SESSION['CompanyRecord']['regoffice1'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice2'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice3'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice4'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice5'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice6'] . '<br>'; - echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br>'; - echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br>'; - echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br>'; + echo '<table class="table1"><tr><td><font size=4 color="#333333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br />'; + echo $_SESSION['CompanyRecord']['regoffice1'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice2'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice3'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice4'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice5'] . '<br />'; + echo $_SESSION['CompanyRecord']['regoffice6'] . '<br />'; + echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br />'; + echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br />'; + echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br />'; echo '</td><td class=number>' . _('Page') . ': '.$PageNumber.'</td></tr></table>'; echo '<table class="table1"><tr> <th>' . _('Item Code') . '</th> @@ -760,10 +756,10 @@ $LineCounter = 10; } /* Space out the footer to the bottom of the page */ - echo '<br><br>' . $myrow['invtext']; + echo '<br /><br />' . $myrow['invtext']; $LineCounter = $LineCounter + 2 + $LinesRequiredForText; while ($LineCounter < ($_SESSION['PageLength'] - 6)) { - echo '<br>'; + echo '<br />'; $LineCounter++; } /* Now print out the footer and totals */ Modified: trunk/RecurringSalesOrders.php =================================================================== --- trunk/RecurringSalesOrders.php 2011-04-16 06:20:56 UTC (rev 4551) +++ trunk/RecurringSalesOrders.php 2011-04-17 10:18:02 UTC (rev 4552) @@ -6,7 +6,6 @@ /* Session started in header.inc for password checking the session will contain the details of the order from the Cart class object. The details of the order come from SelectOrderItems.php */ -//$PageSecurity=1; include('includes/session.inc'); $title = _('Recurring Orders'); include('includes/header.inc'); @@ -494,13 +493,13 @@ echo '<br><div class="centre">'; if ($NewRecurringOrder=='Yes'){ - echo '<input type=hidden name="NewRecurringOrder" value="Yes">'; - echo "<input type=submit name='Process' value='" . _('Create Recurring Order') . "'>"; + echo '<input type="hidden" name="NewRecurringOrder" value="Yes">'; + echo '<input type="submit" name="Process" value="' . _('Create Recurring Order') . '">'; } else { echo '<input type=hidden name="NewRecurringOrder" value="No">'; echo '<input type=hidden name="ExistingRecurrOrderNo" value=' . $_POST['ExistingRecurrOrderNo'] . '>'; - echo "<input type=submit name='Process' value='" . _('Update Recurring Order Details') . "'>"; + echo '<input type="submit" name="Process" value="' . _('Update Recurring Order Details') . '">'; echo '<hr>'; echo '<br><br><input type=submit name="DeleteRecurringOrder" value="' . _('Delete Recurring Order') . ' ' . $_POST['ExistingRecurrOrderNo'] . '" onclick="return confirm(\'' . _('Are you sure you wish to delete this recurring order template?') . '\');">'; } Modified: trunk/SupplierTypes.php =================================================================== --- trunk/SupplierTypes.php 2011-04-16 06:20:56 UTC (rev 4551) +++ trunk/SupplierTypes.php 2011-04-17 10:18:02 UTC (rev 4552) @@ -1,8 +1,6 @@ <?php -/* $Revision: 1.6 $ */ -/* $Id$*/ -//$PageSecurity = 4; +/* $Id SupplierTypes.php 4183 2010-12-14 09:30:20Z daintree $ */ include('includes/session.inc'); $title = _('Supplier Types') . ' / ' . _('Maintenance'); Modified: trunk/includes/OutputSerialItems.php =================================================================== --- trunk/includes/OutputSerialItems.php 2011-04-16 06:20:56 UTC (rev 4551) +++ trunk/includes/OutputSerialItems.php 2011-04-17 10:18:02 UTC (rev 4552) @@ -34,21 +34,21 @@ $listtableheader=$tableheader; } else if ($LineItem->Serialised==0 and $Perishable==1){ $tableheader = '<tr> - <th>'. _('Batch/Roll/Bundle'). ' #</th> - <th>'. _('Available'). '</th> - <th>'. _('Quantity'). '</th> - <th>'. _('Expiry Date'). '</th> - </tr>'; + <th>'. _('Batch/Roll/Bundle'). ' #</th> + <th>'. _('Available'). '</th> + <th>'. _('Quantity'). '</th> + <th>'. _('Expiry Date'). '</th> + </tr>'; $listtableheader = '<tr> - <th>'. _('Batch/Roll/Bundle'). ' #</th> - <th>'. _('Quantity'). '</th> - <th>'. _('Expiry Date'). '</th> - </tr>'; + <th>'. _('Batch/Roll/Bundle'). ' #</th> + <th>'. _('Quantity'). '</th> + <th>'. _('Expiry Date'). '</th> + </tr>'; } else { $tableheader = '<tr> - <th>'. _('Batch/Roll/Bundle'). ' #</th> - <th>'. _('Quantity'). '</th> - </tr>'; + <th>'. _('Batch/Roll/Bundle'). ' #</th> + <th>'. _('Quantity'). '</th> + </tr>'; $listtableheader=$tableheader; } @@ -97,7 +97,6 @@ echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?Delete=' . $Bundle->BundleRef . '&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Delete'). '</a></td></tr>'; - $LineItem->SerialItems[]=$Bundle; $TotalQuantity += $Bundle->BundleQty; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-04-18 00:09:32
|
Revision: 4553 http://web-erp.svn.sourceforge.net/web-erp/?rev=4553&view=rev Author: daintree Date: 2011-04-18 00:09:23 +0000 (Mon, 18 Apr 2011) Log Message: ----------- lang updates, xhtml, closing > Modified Paths: -------------- trunk/Prices_Customer.php trunk/SelectCustomer.php trunk/SelectOrderItems.php trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.po trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.po trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.po Modified: trunk/Prices_Customer.php =================================================================== --- trunk/Prices_Customer.php 2011-04-17 10:18:02 UTC (rev 4552) +++ trunk/Prices_Customer.php 2011-04-18 00:09:23 UTC (rev 4553) @@ -330,7 +330,7 @@ $result = DB_query($sql, $db); echo '<table class=selection>'; echo '<tr><td>' . _('Branch') . ':</td>'; -echo '<td><select name="Branch"'; +echo '<td><select name="Branch">'; while ($myrow=DB_fetch_array($result)) { if ($myrow['branchcode']==$_POST['branch']) { echo '<option selected value='.$myrow['branchcode'].'>'.$myrow['brname'].'</option>'; @@ -338,13 +338,13 @@ echo '<option value='.$myrow['branchcode'].'>'.$myrow['brname'].'</option>'; } } -echo '></td></tr>'; +echo '</select></td></tr>'; echo '<tr><td>' . _('Start Date') . ':</td> <td><input type="Text" name="StartDate" class=date alt='.$_SESSION['DefaultDateFormat']. - ' size=11 maxlength=10 value=' . $_POST['StartDate'] . '></td></tr>'; + ' size=11 maxlength=10 value="' . $_POST['StartDate'] . '"></td></tr>'; echo '<tr><td>' . _('End Date') . ':</td> <td><input type="Text" name="EndDate" class=date alt='.$_SESSION['DefaultDateFormat']. - ' size=11 maxlength=10 value=' . $_POST['EndDate'] . '></td></tr>'; + ' size=11 maxlength=10 value="' . $_POST['EndDate'] . '"></td></tr>'; echo '<tr><td>' . _('Price') . ':</td> <td><input type="Text" class=number name="Price" size=11 maxlength=10 value=' . $_POST['Price'] . '></td> Modified: trunk/SelectCustomer.php =================================================================== --- trunk/SelectCustomer.php 2011-04-17 10:18:02 UTC (rev 4552) +++ trunk/SelectCustomer.php 2011-04-18 00:09:23 UTC (rev 4553) @@ -541,8 +541,8 @@ 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 '</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>'; } Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-04-17 10:18:02 UTC (rev 4552) +++ trunk/SelectOrderItems.php 2011-04-18 00:09:23 UTC (rev 4553) @@ -658,7 +658,7 @@ echo '<td></td>'; } echo '<td><input tabindex='.($j+5).' type=submit name="SubmitCustomerSelection' . $j .'" value="' . htmlentities($myrow['brname'], ENT_QUOTES,'UTF-8'). '"></td> - <input type="hidden" name="SelectedCustomer' . $j .'" value="'.$myrow['debtorno'].'"><input type="hidden" name="SelectedBranch' . $j .'" value="'. $myrow['branchcode'].'"> + <input type="hidden" name="SelectedCustomer' . $j .'" value="'.$myrow['debtorno'].'"><input type="hidden" name="SelectedBranch' . $j .'" value="'. $myrow['branchcode'].'" /> <td>'.$myrow['contactname'].'</td> <td>'.$myrow['phoneno'].'</td> <td>'.$myrow['faxno'].'</td> Modified: trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.po 2011-04-17 10:18:02 UTC (rev 4552) +++ trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.po 2011-04-18 00:09:23 UTC (rev 4553) @@ -7,21 +7,21 @@ msgstr "" "Project-Id-Version: Persian & rtl support\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-03-31 20:06+1200\n" -"PO-Revision-Date: 2011-02-18 11:42+0000\n" -"Last-Translator: Mohsen Karimi <Unknown>\n" +"POT-Creation-Date: 2011-01-04 22:15+1200\n" +"PO-Revision-Date: 2011-04-10 22:01+0000\n" +"Last-Translator: پویان <Unknown>\n" "Language-Team: Persian <hos...@io...>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-03-31 06:31+0000\n" -"X-Generator: Launchpad (build 12696)\n" +"X-Launchpad-Export-Date: 2011-04-17 23:41+0000\n" +"X-Generator: Launchpad (build 12821)\n" "X-Poedit-Country: IRAN, ISLAMIC REPUBLIC OF\n" "Language: fa\n" "X-Poedit-Language: Persian\n" "X-Poedit-SourceCharset: utf-8\n" -#: AccountGroups.php:9 index.php:1277 +#: AccountGroups.php:9 index.php:1273 msgid "Account Groups" msgstr "گروه حساب" @@ -59,7 +59,7 @@ msgstr "حساب کاربری نام گروه می تواند شخصیت نیست" #: AccountGroups.php:71 AccountSections.php:75 PaymentMethods.php:41 -#: TaxCategories.php:33 TaxProvinces.php:32 UnitsOfMeasure.php:30 +#: TaxCategories.php:33 TaxProvinces.php:32 UnitsOfMeasure.php:32 msgid "or the character" msgstr "و یا شخصیت" @@ -117,7 +117,8 @@ msgstr "درج رکورد" #: AccountGroups.php:176 -msgid "An error occurred in retrieving the group information from chartmaster" +msgid "" +"An error occurred in retrieving the group information from chartmaster" msgstr "خطا رخ داده است در بازیابی اطلاعات از گروه chartmaster" #: AccountGroups.php:181 @@ -132,21 +133,22 @@ #: Areas.php:117 Areas.php:126 BankAccounts.php:163 CreditStatus.php:126 #: Currencies.php:144 Currencies.php:152 Currencies.php:159 #: CustomerBranches.php:296 CustomerBranches.php:306 CustomerBranches.php:316 -#: CustomerBranches.php:326 Customers.php:311 Customers.php:320 -#: Customers.php:328 Customers.php:336 CustomerTypes.php:149 -#: CustomerTypes.php:159 Factors.php:136 FixedAssetCategories.php:131 +#: CustomerBranches.php:326 Customers.php:317 Customers.php:326 +#: Customers.php:334 Customers.php:342 CustomerTypes.php:149 +#: CustomerTypes.php:159 Factors.php:136 FixedAssetCategories.php:132 #: GLAccounts.php:95 GLAccounts.php:109 Locations.php:247 Locations.php:255 #: Locations.php:264 Locations.php:272 Locations.php:280 Locations.php:288 #: Locations.php:296 Locations.php:304 MRPDemandTypes.php:89 #: PaymentMethods.php:146 PaymentTerms.php:147 PaymentTerms.php:154 -#: PcExpenses.php:129 SalesCategories.php:127 SalesCategories.php:135 +#: PcExpenses.php:119 SalesCategories.php:127 SalesCategories.php:135 #: SalesPeople.php:144 SalesPeople.php:151 SalesTypes.php:147 #: SalesTypes.php:157 Shippers.php:82 Shippers.php:94 StockCategories.php:182 -#: Stocks.php:469 Stocks.php:478 Stocks.php:486 Stocks.php:494 Stocks.php:502 -#: Stocks.php:510 Suppliers.php:613 Suppliers.php:622 Suppliers.php:630 +#: Stocks.php:471 Stocks.php:480 Stocks.php:488 Stocks.php:496 Stocks.php:504 +#: Stocks.php:512 Suppliers.php:613 Suppliers.php:622 Suppliers.php:630 #: SupplierTypes.php:147 TaxCategories.php:133 TaxGroups.php:128 -#: TaxGroups.php:135 TaxProvinces.php:127 UnitsOfMeasure.php:137 -#: WorkCentres.php:90 WorkCentres.php:96 WWW_Access.php:87 +#: TaxGroups.php:135 TaxProvinces.php:127 UnitsOfMeasure.php:142 +#: UnitsOfMeasure.php:149 WorkCentres.php:90 WorkCentres.php:96 +#: WWW_Access.php:87 msgid "There are" msgstr "وجود دارند" @@ -195,17 +197,17 @@ #: AccountGroups.php:226 AccountSections.php:177 AddCustomerContacts.php:25 #: AddCustomerContacts.php:28 AddCustomerNotes.php:97 #: AddCustomerTypeNotes.php:94 AgedDebtors.php:468 AgedSuppliers.php:277 -#: Areas.php:145 AuditTrail.php:13 BOMExtendedQty.php:272 BOMIndented.php:252 -#: BOMIndentedReverse.php:246 BOMInquiry.php:165 BOMListing.php:128 -#: BOMs.php:214 BOMs.php:793 COGSGLPostings.php:20 CompanyPreferences.php:155 -#: CounterSales.php:1983 CounterSales.php:2107 Credit_Invoice.php:256 +#: Areas.php:145 AuditTrail.php:13 BOMExtendedQty.php:286 BOMIndented.php:262 +#: BOMIndentedReverse.php:257 BOMInquiry.php:165 BOMListing.php:128 +#: BOMs.php:214 BOMs.php:793 COGSGLPostings.php:20 CompanyPreferences.php:158 +#: CounterSales.php:1940 CounterSales.php:2062 Credit_Invoice.php:257 #: CreditStatus.php:21 Currencies.php:29 CustEDISetup.php:19 #: DailyBankTransactions.php:9 DebtorsAtPeriodEnd.php:138 #: DiscountCategories.php:12 DiscountCategories.php:122 DiscountMatrix.php:18 -#: EDIMessageFormat.php:104 FixedAssetLocations.php:9 -#: FixedAssetRegister.php:13 FixedAssetRegister.php:238 +#: EDIMessageFormat.php:106 FixedAssetList.php:8 FixedAssetLocations.php:9 +#: FixedAssetRegister.php:13 FixedAssetRegister.php:232 #: FixedAssetTransfer.php:31 FormDesigner.php:132 GLBalanceSheet.php:351 -#: GLBudgets.php:28 GLJournal.php:228 InventoryPlanning.php:374 +#: GLBudgets.php:30 GLJournal.php:243 InventoryPlanning.php:369 #: InventoryPlanningPrefSupplier.php:474 Labels.php:117 Labels.php:273 #: MRPReport.php:536 OutstandingGRNs.php:174 PcAssignCashToTab.php:39 #: PcAssignCashToTab.php:113 PcAssignCashToTab.php:129 @@ -213,24 +215,24 @@ #: PDFStockLocTransfer.php:21 PO_AuthorisationLevels.php:12 POReport.php:61 #: POReport.php:65 POReport.php:69 PO_SelectOSPurchOrder.php:136 #: PricesBasedOnMarkUp.php:11 Prices_Customer.php:45 Prices.php:32 -#: PurchData.php:141 PurchData.php:256 PurchData.php:275 -#: RecurringSalesOrders.php:311 SalesAnalReptCols.php:51 SalesAnalRepts.php:13 +#: PurchData.php:141 PurchData.php:231 PurchData.php:250 +#: RecurringSalesOrders.php:307 SalesAnalReptCols.php:51 SalesAnalRepts.php:13 #: SalesCategories.php:13 SalesGLPostings.php:18 SalesGraph.php:34 #: SalesPeople.php:22 SalesTypes.php:22 SelectAsset.php:44 -#: SelectCompletedOrder.php:13 SelectContract.php:81 SelectCreditItems.php:202 -#: SelectCreditItems.php:270 SelectCustomer.php:323 SelectGLAccount.php:19 -#: SelectGLAccount.php:79 SelectOrderItems.php:607 SelectOrderItems.php:1431 -#: SelectOrderItems.php:1555 SelectProduct.php:473 SelectSalesOrder.php:457 +#: SelectCompletedOrder.php:13 SelectContract.php:81 SelectCreditItems.php:204 +#: SelectCreditItems.php:272 SelectCustomer.php:315 SelectGLAccount.php:19 +#: SelectGLAccount.php:79 SelectOrderItems.php:605 SelectOrderItems.php:1436 +#: SelectOrderItems.php:1556 SelectProduct.php:456 SelectSalesOrder.php:155 #: SelectSupplier.php:9 SelectSupplier.php:198 SelectWorkOrder.php:11 #: SelectWorkOrder.php:147 ShipmentCosting.php:13 Shipments.php:18 #: Shippers.php:123 Shippers.php:159 Shipt_Select.php:10 #: StockLocMovements.php:15 StockLocStatus.php:27 Suppliers.php:306 #: SupplierTenders.php:261 SupplierTenders.php:318 SupplierTransInquiry.php:11 -#: TaxGroups.php:16 TaxProvinces.php:12 TopItems.php:62 +#: TaxGroups.php:16 TaxProvinces.php:12 TopItems.php:60 #: WhereUsedInquiry.php:18 WorkCentres.php:111 WorkCentres.php:158 -#: WorkOrderCosting.php:14 WorkOrderEntry.php:10 WorkOrderIssue.php:22 +#: WorkOrderCosting.php:14 WorkOrderEntry.php:12 WorkOrderIssue.php:22 #: WorkOrderReceive.php:15 WorkOrderStatus.php:43 WWW_Access.php:13 -#: WWW_Users.php:33 Z_BottomUpCosts.php:51 +#: WWW_Users.php:38 Z_BottomUpCosts.php:51 msgid "Search" msgstr "جستجو" @@ -238,7 +240,7 @@ msgid "Group Name" msgstr "نام گروه" -#: AccountGroups.php:231 EDIMessageFormat.php:129 EDIMessageFormat.php:207 +#: AccountGroups.php:231 EDIMessageFormat.php:131 msgid "Section" msgstr "قسمت" @@ -260,34 +262,34 @@ #: AccountGroups.php:386 BankAccounts.php:217 BankAccounts.php:361 #: BankAccounts.php:363 BankAccounts.php:367 BOMs.php:128 BOMs.php:713 #: BOMs.php:715 CompanyPreferences.php:439 CompanyPreferences.php:441 -#: CompanyPreferences.php:452 CompanyPreferences.php:454 -#: CompanyPreferences.php:465 CompanyPreferences.php:467 +#: CompanyPreferences.php:451 CompanyPreferences.php:453 +#: CompanyPreferences.php:463 CompanyPreferences.php:465 #: ContractCosting.php:174 CustLoginSetup.php:590 CustLoginSetup.php:592 -#: CustomerBranches.php:420 Customers.php:590 Customers.php:847 -#: Customers.php:854 Customers.php:857 DeliveryDetails.php:1034 +#: CustomerBranches.php:420 Customers.php:600 Customers.php:857 +#: Customers.php:864 Customers.php:867 DeliveryDetails.php:1034 #: DeliveryDetails.php:1074 DeliveryDetails.php:1077 GLTransInquiry.php:73 -#: MRPCalendar.php:222 MRP.php:529 MRP.php:533 MRP.php:537 MRP.php:541 -#: PaymentMethods.php:203 PaymentMethods.php:204 PaymentMethods.php:264 -#: PaymentMethods.php:270 PDFChequeListing.php:63 +#: Locations.php:373 MRPCalendar.php:222 MRP.php:530 MRP.php:534 MRP.php:538 +#: MRP.php:542 PaymentMethods.php:203 PaymentMethods.php:204 +#: PaymentMethods.php:264 PaymentMethods.php:270 PDFChequeListing.php:63 #: PDFDeliveryDifferences.php:64 PDFDIFOT.php:67 #: PO_AuthorisationLevels.php:132 PO_AuthorisationLevels.php:137 -#: PO_Header.php:754 PO_PDFPurchOrder.php:344 PO_PDFPurchOrder.php:347 -#: PurchData.php:192 PurchData.php:494 PurchData.php:497 -#: RecurringSalesOrders.php:483 RecurringSalesOrders.php:486 +#: PO_Header.php:758 PO_PDFPurchOrder.php:367 PO_PDFPurchOrder.php:370 +#: PurchData.php:189 PurchData.php:469 PurchData.php:472 +#: RecurringSalesOrders.php:479 RecurringSalesOrders.php:482 #: SalesAnalReptCols.php:279 SalesAnalReptCols.php:401 #: SalesAnalReptCols.php:404 SalesAnalRepts.php:406 SalesAnalRepts.php:409 #: SalesAnalRepts.php:432 SalesAnalRepts.php:435 SalesAnalRepts.php:458 #: SalesAnalRepts.php:461 SelectProduct.php:351 ShipmentCosting.php:622 -#: Stocks.php:869 Stocks.php:871 Stocks.php:889 Stocks.php:891 +#: Stocks.php:867 Stocks.php:869 Stocks.php:887 Stocks.php:889 #: SuppContractChgs.php:83 SuppLoginSetup.php:511 SuppLoginSetup.php:513 -#: SystemParameters.php:376 SystemParameters.php:399 SystemParameters.php:415 +#: SystemParameters.php:373 SystemParameters.php:405 SystemParameters.php:450 #: SystemParameters.php:468 SystemParameters.php:476 SystemParameters.php:516 -#: SystemParameters.php:589 SystemParameters.php:598 SystemParameters.php:606 -#: SystemParameters.php:624 SystemParameters.php:631 SystemParameters.php:756 -#: SystemParameters.php:887 SystemParameters.php:889 SystemParameters.php:899 -#: SystemParameters.php:901 SystemParameters.php:955 SystemParameters.php:967 -#: SystemParameters.php:969 TaxGroups.php:292 TaxGroups.php:295 -#: TaxGroups.php:344 WWW_Users.php:605 WWW_Users.php:607 +#: SystemParameters.php:589 SystemParameters.php:597 SystemParameters.php:615 +#: SystemParameters.php:622 SystemParameters.php:746 SystemParameters.php:877 +#: SystemParameters.php:879 SystemParameters.php:889 SystemParameters.php:891 +#: SystemParameters.php:945 SystemParameters.php:957 SystemParameters.php:959 +#: TaxGroups.php:292 TaxGroups.php:295 TaxGroups.php:344 WWW_Users.php:610 +#: WWW_Users.php:612 msgid "Yes" msgstr "بلی" @@ -295,60 +297,59 @@ #: BankAccounts.php:215 BankAccounts.php:361 BankAccounts.php:363 #: BankAccounts.php:367 BOMs.php:130 BOMs.php:712 BOMs.php:716 #: CompanyPreferences.php:438 CompanyPreferences.php:442 -#: CompanyPreferences.php:451 CompanyPreferences.php:455 -#: CompanyPreferences.php:464 CompanyPreferences.php:468 +#: CompanyPreferences.php:450 CompanyPreferences.php:454 +#: CompanyPreferences.php:462 CompanyPreferences.php:466 #: ContractCosting.php:172 CustLoginSetup.php:589 CustLoginSetup.php:593 -#: CustomerBranches.php:420 Customers.php:589 Customers.php:845 -#: Customers.php:853 Customers.php:856 DeliveryDetails.php:1035 +#: CustomerBranches.php:420 Customers.php:599 Customers.php:855 +#: Customers.php:863 Customers.php:866 DeliveryDetails.php:1035 #: DeliveryDetails.php:1075 DeliveryDetails.php:1078 GLTransInquiry.php:127 -#: MRPCalendar.php:224 MRP.php:527 MRP.php:531 MRP.php:535 MRP.php:539 -#: PaymentMethods.php:203 PaymentMethods.php:204 PaymentMethods.php:265 -#: PaymentMethods.php:271 PDFChequeListing.php:62 +#: Locations.php:375 MRPCalendar.php:224 MRP.php:528 MRP.php:532 MRP.php:536 +#: MRP.php:540 PaymentMethods.php:203 PaymentMethods.php:204 +#: PaymentMethods.php:265 PaymentMethods.php:271 PDFChequeListing.php:62 #: PDFDeliveryDifferences.php:63 PDFDIFOT.php:66 #: PO_AuthorisationLevels.php:134 PO_AuthorisationLevels.php:139 -#: PO_Header.php:753 PO_PDFPurchOrder.php:345 PO_PDFPurchOrder.php:348 -#: PurchData.php:195 PurchData.php:495 PurchData.php:498 -#: RecurringSalesOrders.php:482 RecurringSalesOrders.php:485 +#: PO_Header.php:757 PO_PDFPurchOrder.php:368 PO_PDFPurchOrder.php:371 +#: PurchData.php:192 PurchData.php:470 PurchData.php:473 +#: RecurringSalesOrders.php:478 RecurringSalesOrders.php:481 #: SalesAnalReptCols.php:277 SalesAnalReptCols.php:402 #: SalesAnalReptCols.php:405 SalesAnalRepts.php:405 SalesAnalRepts.php:408 #: SalesAnalRepts.php:431 SalesAnalRepts.php:434 SalesAnalRepts.php:457 #: SalesAnalRepts.php:460 SelectProduct.php:353 ShipmentCosting.php:623 -#: Stocks.php:864 Stocks.php:866 Stocks.php:884 Stocks.php:886 +#: Stocks.php:862 Stocks.php:864 Stocks.php:882 Stocks.php:884 #: SuppContractChgs.php:85 SuppLoginSetup.php:510 SuppLoginSetup.php:514 -#: SystemParameters.php:377 SystemParameters.php:400 SystemParameters.php:416 +#: SystemParameters.php:374 SystemParameters.php:406 SystemParameters.php:451 #: SystemParameters.php:469 SystemParameters.php:477 SystemParameters.php:517 -#: SystemParameters.php:590 SystemParameters.php:599 SystemParameters.php:607 -#: SystemParameters.php:625 SystemParameters.php:632 SystemParameters.php:757 -#: SystemParameters.php:886 SystemParameters.php:890 SystemParameters.php:898 -#: SystemParameters.php:902 SystemParameters.php:956 SystemParameters.php:966 -#: SystemParameters.php:970 TaxGroups.php:293 TaxGroups.php:296 -#: TaxGroups.php:346 WWW_Users.php:604 WWW_Users.php:608 -#: includes/PDFLowGPPageHeader.inc:44 includes/PDFTaxPageHeader.inc:35 +#: SystemParameters.php:590 SystemParameters.php:598 SystemParameters.php:616 +#: SystemParameters.php:623 SystemParameters.php:747 SystemParameters.php:876 +#: SystemParameters.php:880 SystemParameters.php:888 SystemParameters.php:892 +#: SystemParameters.php:946 SystemParameters.php:956 SystemParameters.php:960 +#: TaxGroups.php:293 TaxGroups.php:296 TaxGroups.php:346 WWW_Users.php:609 +#: WWW_Users.php:613 includes/PDFLowGPPageHeader.inc:44 +#: includes/PDFTaxPageHeader.inc:35 msgid "No" msgstr "خیر" #: AccountGroups.php:265 AccountSections.php:197 AddCustomerContacts.php:131 #: AddCustomerNotes.php:125 AddCustomerTypeNotes.php:123 Areas.php:165 #: BankAccounts.php:226 BOMs.php:150 COGSGLPostings.php:113 -#: COGSGLPostings.php:215 CreditStatus.php:175 Currencies.php:239 -#: CustLoginSetup.php:312 CustomerBranches.php:424 Customers.php:899 -#: Customers.php:931 CustomerTypes.php:205 EDIMessageFormat.php:150 -#: Factors.php:208 FixedAssetCategories.php:181 FixedAssetLocations.php:102 +#: COGSGLPostings.php:218 CreditStatus.php:175 Currencies.php:239 +#: CustLoginSetup.php:312 CustomerBranches.php:424 Customers.php:909 +#: Customers.php:941 CustomerTypes.php:205 EDIMessageFormat.php:152 +#: Factors.php:208 FixedAssetCategories.php:182 FixedAssetLocations.php:102 #: FreightCosts.php:243 GeocodeSetup.php:169 GLAccounts.php:319 GLTags.php:62 -#: Labels.php:414 Locations.php:380 MRPDemands.php:304 MRPDemandTypes.php:122 +#: Labels.php:414 Locations.php:382 MRPDemands.php:304 MRPDemandTypes.php:122 #: PaymentMethods.php:205 PaymentTerms.php:203 PcAssignCashToTab.php:251 -#: PcClaimExpensesFromTab.php:229 PcExpenses.php:186 PcTabs.php:188 -#: PcTypeTabs.php:174 PO_AuthorisationLevels.php:148 Prices_Customer.php:283 -#: Prices.php:227 PurchData.php:207 SalesCategories.php:263 +#: PcClaimExpensesFromTab.php:229 PcExpenses.php:176 PcTabs.php:188 +#: PcTypeTabs.php:171 PO_AuthorisationLevels.php:148 Prices_Customer.php:283 +#: Prices.php:227 PurchData.php:202 SalesCategories.php:263 #: SalesGLPostings.php:135 SalesGLPostings.php:247 SalesPeople.php:210 -#: SalesTypes.php:206 SelectCustomer.php:610 SelectCustomer.php:626 -#: SelectCustomer.php:648 SelectCustomer.php:664 SelectCustomer.php:686 -#: SelectCustomer.php:702 Shippers.php:144 StockCategories.php:244 -#: SupplierContacts.php:153 SupplierTypes.php:192 SuppLoginSetup.php:274 +#: SalesTypes.php:206 SelectCustomer.php:607 SelectCustomer.php:623 +#: SelectCustomer.php:645 SelectCustomer.php:661 SelectCustomer.php:683 +#: SelectCustomer.php:699 Shippers.php:144 StockCategories.php:244 +#: SupplierContacts.php:156 SupplierTypes.php:192 SuppLoginSetup.php:274 #: TaxAuthorities.php:173 TaxCategories.php:184 TaxGroups.php:179 -#: TaxProvinces.php:178 UnitsOfMeasure.php:187 WorkCentres.php:138 -#: WWW_Access.php:127 WWW_Users.php:307 includes/InputSerialItems.php:88 -#: includes/OutputSerialItems.php:21 +#: TaxProvinces.php:178 UnitsOfMeasure.php:201 WorkCentres.php:138 +#: WWW_Access.php:127 WWW_Users.php:312 includes/InputSerialItems.php:88 #, php-format msgid "Edit" msgstr "ویرایش" @@ -356,32 +357,31 @@ #: AccountGroups.php:266 AccountSections.php:201 AddCustomerContacts.php:132 #: AddCustomerNotes.php:126 AddCustomerTypeNotes.php:124 Areas.php:166 #: BankAccounts.php:227 BOMs.php:152 COGSGLPostings.php:114 -#: COGSGLPostings.php:216 ContractBOM.php:272 ContractOtherReqts.php:121 -#: CounterSales.php:781 Credit_Invoice.php:385 CreditStatus.php:176 -#: Currencies.php:242 CustLoginSetup.php:313 CustomerReceipt.php:863 -#: Customers.php:932 CustomerTypes.php:206 DiscountCategories.php:204 -#: DiscountMatrix.php:178 EDIMessageFormat.php:151 -#: FixedAssetCategories.php:182 FreightCosts.php:244 GeocodeSetup.php:170 -#: GLAccounts.php:320 GLJournal.php:385 Labels.php:414 Locations.php:381 +#: COGSGLPostings.php:219 ContractBOM.php:272 ContractOtherReqts.php:121 +#: CounterSales.php:741 Credit_Invoice.php:386 CreditStatus.php:176 +#: Currencies.php:242 CustLoginSetup.php:313 CustomerReceipt.php:866 +#: Customers.php:942 CustomerTypes.php:206 DiscountCategories.php:204 +#: DiscountMatrix.php:178 EDIMessageFormat.php:153 +#: FixedAssetCategories.php:183 FreightCosts.php:244 GeocodeSetup.php:170 +#: GLAccounts.php:320 GLJournal.php:403 Labels.php:414 Locations.php:383 #: MRPDemands.php:305 MRPDemandTypes.php:123 PaymentMethods.php:206 -#: Payments.php:959 PaymentTerms.php:204 PcAssignCashToTab.php:255 -#: PcClaimExpensesFromTab.php:230 PcExpenses.php:187 PcExpensesTypeTab.php:164 -#: PcTabs.php:189 PcTypeTabs.php:175 PO_AuthorisationLevels.php:150 -#: PO_Items.php:762 Prices_Customer.php:284 Prices.php:228 PurchData.php:208 +#: Payments.php:961 PaymentTerms.php:204 PcAssignCashToTab.php:255 +#: PcClaimExpensesFromTab.php:230 PcExpenses.php:177 PcExpensesTypeTab.php:161 +#: PcTabs.php:189 PcTypeTabs.php:172 PO_AuthorisationLevels.php:150 +#: PO_Items.php:976 Prices_Customer.php:284 Prices.php:228 PurchData.php:203 #: SalesAnalReptCols.php:294 SalesAnalRepts.php:305 SalesCategories.php:264 #: SalesGLPostings.php:136 SalesGLPostings.php:248 SalesPeople.php:211 -#: SalesTypes.php:207 SelectCreditItems.php:745 SelectCustomer.php:611 -#: SelectCustomer.php:627 SelectCustomer.php:649 SelectCustomer.php:665 -#: SelectCustomer.php:687 SelectCustomer.php:703 SelectOrderItems.php:1358 +#: SalesTypes.php:207 SelectCreditItems.php:747 SelectCustomer.php:608 +#: SelectCustomer.php:624 SelectCustomer.php:646 SelectCustomer.php:662 +#: SelectCustomer.php:684 SelectCustomer.php:700 SelectOrderItems.php:1363 #: Shipments.php:424 Shippers.php:145 SpecialOrder.php:590 #: StockCategories.php:245 StockCategories.php:539 SuppContractChgs.php:91 -#: SuppCreditGRNs.php:93 SuppFixedAssetChgs.php:81 SuppInvGRNs.php:135 -#: SupplierContacts.php:154 SupplierTypes.php:194 SuppLoginSetup.php:275 +#: SuppCreditGRNs.php:93 SuppFixedAssetChgs.php:87 SuppInvGRNs.php:135 +#: SupplierContacts.php:157 SupplierTypes.php:194 SuppLoginSetup.php:275 #: SuppShiptChgs.php:86 SuppTransGLAnalysis.php:111 TaxAuthorities.php:174 #: TaxCategories.php:185 TaxGroups.php:180 TaxProvinces.php:179 -#: UnitsOfMeasure.php:188 WorkCentres.php:139 WOSerialNos.php:300 -#: WWW_Access.php:128 WWW_Users.php:308 includes/InputSerialItemsKeyed.php:57 -#: includes/OutputSerialItems.php:98 +#: UnitsOfMeasure.php:202 WorkCentres.php:139 WOSerialNos.php:300 +#: WWW_Access.php:128 WWW_Users.php:313 includes/InputSerialItemsKeyed.php:54 #, php-format msgid "Delete" msgstr "حذف" @@ -425,23 +425,23 @@ #: AccountGroups.php:401 AccountSections.php:262 AddCustomerContacts.php:208 #: AddCustomerNotes.php:201 AddCustomerTypeNotes.php:192 Areas.php:222 -#: BankAccounts.php:373 BOMs.php:725 COGSGLPostings.php:353 +#: BankAccounts.php:373 BOMs.php:725 COGSGLPostings.php:347 #: CreditStatus.php:247 Currencies.php:339 CustLoginSetup.php:611 -#: DiscountMatrix.php:141 EDIMessageFormat.php:247 -#: FixedAssetCategories.php:327 FixedAssetLocations.php:148 +#: DiscountMatrix.php:141 EDIMessageFormat.php:249 +#: FixedAssetCategories.php:328 FixedAssetLocations.php:148 #: FreightCosts.php:342 GeocodeSetup.php:266 GLAccounts.php:269 -#: Locations.php:558 MRPDemands.php:402 MRPDemandTypes.php:182 +#: Locations.php:553 MRPDemands.php:402 MRPDemandTypes.php:182 #: OffersReceived.php:52 OffersReceived.php:128 PaymentMethods.php:276 #: PaymentTerms.php:282 PO_AuthorisationLevels.php:217 Prices_Customer.php:372 #: SalesAnalReptCols.php:510 SalesAnalRepts.php:496 SalesGLPostings.php:415 #: SalesPeople.php:302 Shippers.php:196 StockCategories.php:561 -#: SupplierContacts.php:250 SuppLoginSetup.php:532 TaxAuthorities.php:313 -#: TaxCategories.php:235 TaxProvinces.php:229 UnitsOfMeasure.php:239 -#: WorkCentres.php:261 WWW_Users.php:638 +#: SupplierContacts.php:251 SuppLoginSetup.php:532 TaxAuthorities.php:313 +#: TaxCategories.php:235 TaxProvinces.php:229 UnitsOfMeasure.php:253 +#: WorkCentres.php:261 WWW_Users.php:643 msgid "Enter Information" msgstr "ورود اطلاعات" -#: AccountSections.php:9 index.php:1282 +#: AccountSections.php:9 index.php:1278 msgid "Account Sections" msgstr "بخش ها حساب کاربری" @@ -501,8 +501,8 @@ msgid "Could not retrieve the requested section please try again." msgstr "نمی توان بازیابی بخش های درخواست شده لطفا دوباره سعی کنید." -#: AddCustomerContacts.php:6 AddCustomerContacts.php:59 SelectCustomer.php:604 -#: SelectCustomer.php:633 +#: AddCustomerContacts.php:6 AddCustomerContacts.php:59 SelectCustomer.php:601 +#: SelectCustomer.php:630 msgid "Customer Contacts" msgstr "تماس با ما مشتریان" @@ -533,10 +533,10 @@ #: AddCustomerContacts.php:59 AddCustomerNotes.php:49 #: AddCustomerTypeNotes.php:49 Areas.php:74 CustomerTypes.php:71 -#: DeliveryDetails.php:748 Factors.php:117 FixedAssetItems.php:236 -#: PcAssignCashToTab.php:73 PcClaimExpensesFromTab.php:61 PcExpenses.php:70 -#: PcTabs.php:60 PcTypeTabs.php:62 PO_Items.php:411 SalesAnalReptCols.php:129 -#: SalesPeople.php:94 SalesTypes.php:63 Stocks.php:353 Suppliers.php:514 +#: DeliveryDetails.php:748 Factors.php:117 FixedAssetItems.php:230 +#: PcAssignCashToTab.php:73 PcClaimExpensesFromTab.php:61 PcExpenses.php:60 +#: PcTabs.php:60 PcTypeTabs.php:59 PO_Items.php:381 SalesAnalReptCols.php:129 +#: SalesPeople.php:94 SalesTypes.php:63 Stocks.php:355 Suppliers.php:514 #: SupplierTypes.php:69 msgid "has been updated" msgstr "به روز شده است" @@ -549,31 +549,31 @@ msgid "The contact record has been deleted" msgstr "تماس با سابقه حذف شده است" -#: AddCustomerContacts.php:112 CompanyPreferences.php:224 -#: CustomerBranches.php:377 Customers.php:889 Customers.php:895 -#: Customers.php:961 SalesPeople.php:185 SelectCustomer.php:606 -#: StockDispatch.php:186 StockDispatch.php:198 SupplierContacts.php:141 -#: SupplierCredit.php:437 SupplierInvoice.php:408 SuppTransGLAnalysis.php:96 +#: AddCustomerContacts.php:112 CompanyPreferences.php:229 +#: CustomerBranches.php:377 Customers.php:899 Customers.php:905 +#: Customers.php:971 SalesPeople.php:185 SelectCustomer.php:603 +#: StockDispatch.php:186 StockDispatch.php:198 SupplierContacts.php:144 +#: SupplierCredit.php:433 SupplierInvoice.php:407 SuppTransGLAnalysis.php:96 #: includes/InputSerialItemsFile.php:84 includes/InputSerialItemsFile.php:124 #: includes/PDFTaxPageHeader.inc:37 msgid "Name" msgstr "نام" -#: AddCustomerContacts.php:113 AddCustomerContacts.php:190 Customers.php:890 -#: Customers.php:896 Customers.php:962 SelectCustomer.php:607 +#: AddCustomerContacts.php:113 AddCustomerContacts.php:190 Customers.php:900 +#: Customers.php:906 Customers.php:972 SelectCustomer.php:604 #: WWW_Access.php:111 WWW_Access.php:172 msgid "Role" msgstr "نقش" -#: AddCustomerContacts.php:114 Customers.php:963 +#: AddCustomerContacts.php:114 Customers.php:973 msgid "Phone no" msgstr "تلفن" -#: AddCustomerContacts.php:115 AddCustomerContacts.php:202 Customers.php:892 -#: Customers.php:898 Customers.php:964 PcAssignCashToTab.php:216 +#: AddCustomerContacts.php:115 AddCustomerContacts.php:202 Customers.php:902 +#: Customers.php:908 Customers.php:974 PcAssignCashToTab.php:216 #: PcAssignCashToTab.php:341 PcAuthorizeExpenses.php:85 #: PcClaimExpensesFromTab.php:195 PcClaimExpensesFromTab.php:348 -#: PcReportTab.php:348 SelectCustomer.php:609 SystemParameters.php:316 +#: PcReportTab.php:348 SelectCustomer.php:606 SystemParameters.php:313 #: WOSerialNos.php:277 WOSerialNos.php:279 msgid "Notes" msgstr "یادداشت ها" @@ -586,20 +586,20 @@ msgid "Contact Code" msgstr "تماس با کد" -#: AddCustomerContacts.php:184 Factors.php:279 SupplierContacts.php:218 +#: AddCustomerContacts.php:184 Factors.php:279 SupplierContacts.php:219 msgid "Contact Name" msgstr "نام تماس با ما" -#: AddCustomerContacts.php:196 Contracts.php:777 PDFRemittanceAdvice.php:247 -#: PO_Header.php:956 PO_Header.php:1026 SelectCreditItems.php:223 -#: SelectCustomer.php:464 SelectOrderItems.php:639 -#: includes/PDFStatementPageHeader.inc:63 includes/PDFTransPageHeader.inc:117 +#: AddCustomerContacts.php:196 Contracts.php:766 PDFRemittanceAdvice.php:247 +#: PO_Header.php:958 PO_Header.php:1028 SelectCreditItems.php:225 +#: SelectCustomer.php:461 SelectOrderItems.php:638 +#: includes/PDFStatementPageHeader.inc:63 includes/PDFTransPageHeader.inc:113 #: includes/PDFTransPageHeaderPortrait.inc:105 msgid "Phone" msgstr "تلفن" -#: AddCustomerNotes.php:6 AddCustomerNotes.php:49 SelectCustomer.php:641 -#: SelectCustomer.php:671 +#: AddCustomerNotes.php:6 AddCustomerNotes.php:49 SelectCustomer.php:638 +#: SelectCustomer.php:668 msgid "Customer Notes" msgstr "مشتری یادداشت ها" @@ -640,29 +640,28 @@ #: GLAccountReport.php:369 GLTransInquiry.php:45 MRPCalendar.php:217 #: PaymentAllocations.php:77 PcAssignCashToTab.php:212 #: PcAuthorizeExpenses.php:81 PDFRemittanceAdvice.php:308 -#: PrintCustTrans.php:616 PrintCustTransPortrait.php:790 ReverseGRN.php:378 +#: PrintCustTrans.php:678 PrintCustTransPortrait.php:860 ReverseGRN.php:378 #: ShipmentCosting.php:503 ShipmentCosting.php:574 Shipments.php:467 #: StockDispatch.php:188 StockDispatch.php:200 StockLocMovements.php:85 #: StockMovements.php:98 StockSerialItemResearch.php:79 #: SupplierAllocations.php:464 SupplierAllocations.php:576 #: SupplierAllocations.php:646 SupplierInquiry.php:195 #: SupplierTransInquiry.php:89 includes/PDFQuotationPageHeader.inc:91 -#: includes/PDFQuotationPortraitPageHeader.inc:90 #: includes/PDFStatementPageHeader.inc:169 includes/PDFTaxPageHeader.inc:36 -#: includes/PDFTransPageHeader.inc:84 +#: includes/PDFTransPageHeader.inc:80 #: includes/PDFTransPageHeaderPortrait.inc:58 msgid "Date" msgstr "تاریخ" #: AddCustomerNotes.php:107 AddCustomerTypeNotes.php:105 PcReportTab.php:176 -#: Stocks.php:873 UpgradeDatabase.php:147 UpgradeDatabase.php:150 -#: UpgradeDatabase.php:153 UpgradeDatabase.php:156 UpgradeDatabase.php:159 -#: UpgradeDatabase.php:162 UpgradeDatabase.php:165 UpgradeDatabase.php:168 -#: Z_Upgrade_3.10-3.11.php:62 Z_Upgrade_3.10-3.11.php:66 -#: Z_Upgrade_3.10-3.11.php:70 Z_Upgrade_3.10-3.11.php:74 -#: Z_Upgrade_3.10-3.11.php:78 Z_Upgrade_3.11-4.00.php:62 -#: Z_Upgrade_3.11-4.00.php:66 Z_Upgrade_3.11-4.00.php:70 -#: Z_Upgrade_3.11-4.00.php:74 Z_Upgrade_3.11-4.00.php:78 +#: Stocks.php:871 UpgradeDatabase.php:145 UpgradeDatabase.php:148 +#: UpgradeDatabase.php:151 UpgradeDatabase.php:154 UpgradeDatabase.php:157 +#: UpgradeDatabase.php:160 UpgradeDatabase.php:163 Z_Upgrade_3.10-3.11.php:62 +#: Z_Upgrade_3.10-3.11.php:66 Z_Upgrade_3.10-3.11.php:70 +#: Z_Upgrade_3.10-3.11.php:74 Z_Upgrade_3.10-3.11.php:78 +#: Z_Upgrade_3.11-4.00.php:62 Z_Upgrade_3.11-4.00.php:66 +#: Z_Upgrade_3.11-4.00.php:70 Z_Upgrade_3.11-4.00.php:74 +#: Z_Upgrade_3.11-4.00.php:78 msgid "Note" msgstr "یادداشت" @@ -687,7 +686,7 @@ msgid "Contact Note" msgstr "تماس با تبصره" -#: AddCustomerTypeNotes.php:6 SelectCustomer.php:679 +#: AddCustomerTypeNotes.php:6 SelectCustomer.php:676 msgid "Customer Type (Group) Notes" msgstr "نوع مشتری (گروه) یادداشت ها" @@ -695,7 +694,7 @@ msgid "The Contact priority must be an integer." msgstr "تماس با اولویت باید یک عدد صحیح باشد." -#: AddCustomerTypeNotes.php:49 SelectCustomer.php:709 +#: AddCustomerTypeNotes.php:49 SelectCustomer.php:706 msgid "Customer Group Notes" msgstr "یادداشت های مشتریان گروه" @@ -740,26 +739,26 @@ msgstr "سالمندان مشتریان تجزیه و تحلیل حساب کاربری" #: AgedDebtors.php:267 AgedDebtors.php:365 AgedDebtors.php:436 -#: AgedSuppliers.php:105 BOMExtendedQty.php:159 BOMIndented.php:150 -#: BOMIndentedReverse.php:151 BOMListing.php:48 BOMListing.php:59 +#: AgedSuppliers.php:105 BOMExtendedQty.php:156 BOMIndented.php:149 +#: BOMIndentedReverse.php:148 BOMListing.php:48 BOMListing.php:59 #: DebtorsAtPeriodEnd.php:58 DebtorsAtPeriodEnd.php:70 GLBalanceSheet.php:90 #: GLBalanceSheet.php:128 GLProfit_Loss.php:157 GLTagProfit_Loss.php:174 #: GLTrialBalance.php:151 InventoryPlanning.php:99 InventoryPlanning.php:174 -#: InventoryPlanning.php:209 InventoryPlanning.php:257 -#: InventoryPlanning.php:295 InventoryPlanningPrefSupplier.php:208 +#: InventoryPlanning.php:209 InventoryPlanning.php:252 +#: InventoryPlanning.php:290 InventoryPlanningPrefSupplier.php:208 #: InventoryPlanningPrefSupplier.php:276 InventoryPlanningPrefSupplier.php:310 -#: InventoryPlanningPrefSupplier.php:355 InventoryPlanningPrefSupplier.php:401 +#: InventoryPlanningPrefSupplier.php:353 InventoryPlanningPrefSupplier.php:401 #: InventoryQuantities.php:83 InventoryValuation.php:76 -#: MailInventoryValuation.php:115 MRPPlannedPurchaseOrders.php:114 +#: MailInventoryValuation.php:115 MRPPlannedPurchaseOrders.php:111 #: MRPPlannedWorkOrders.php:105 MRPReport.php:147 MRPReport.php:529 -#: MRPReschedules.php:46 MRPReschedules.php:58 MRPShortages.php:145 -#: MRPShortages.php:157 OutstandingGRNs.php:51 OutstandingGRNs.php:63 +#: MRPReschedules.php:46 MRPReschedules.php:58 MRPShortages.php:137 +#: MRPShortages.php:149 OutstandingGRNs.php:51 OutstandingGRNs.php:63 #: PDFCustomerList.php:20 PDFCustomerList.php:232 PDFCustomerList.php:244 #: PDFLowGP.php:23 PDFStockCheckComparison.php:35 #: PDFStockCheckComparison.php:61 PDFStockCheckComparison.php:262 #: ReorderLevel.php:59 SelectAsset.php:36 SelectProduct.php:37 #: StockCheck.php:65 StockCheck.php:139 SupplierTenders.php:325 -#: SuppPriceList.php:118 includes/PDFPaymentRun_PymtFooter.php:149 +#: SuppPriceList.php:118 includes/PDFPaymentRun_PymtFooter.php:148 msgid "Problem Report" msgstr "گزارش مشکل" @@ -769,38 +768,38 @@ msgstr "جزئیات مشتری می تواند با گذاشتن زیرا قابل بازیابی نیست" #: AgedDebtors.php:270 AgedDebtors.php:368 AgedDebtors.php:442 -#: AgedSuppliers.php:108 AgedSuppliers.php:190 BOMExtendedQty.php:162 -#: BOMExtendedQty.php:259 BOMIndented.php:153 BOMIndented.php:239 -#: BOMIndentedReverse.php:154 BOMIndentedReverse.php:232 BOMListing.php:51 -#: Credit_Invoice.php:185 DebtorsAtPeriodEnd.php:61 DebtorsAtPeriodEnd.php:73 +#: AgedSuppliers.php:108 AgedSuppliers.php:190 BOMExtendedQty.php:159 +#: BOMExtendedQty.php:263 BOMIndented.php:152 BOMIndented.php:238 +#: BOMIndentedReverse.php:151 BOMIndentedReverse.php:235 BOMListing.php:51 +#: Credit_Invoice.php:186 DebtorsAtPeriodEnd.php:61 DebtorsAtPeriodEnd.php:73 #: FTP_RadioBeacon.php:188 GetStockImage.php:154 GLBalanceSheet.php:93 #: GLBalanceSheet.php:131 GLBalanceSheet.php:294 GLProfit_Loss.php:160 #: GLProfit_Loss.php:172 GLTagProfit_Loss.php:177 GLTagProfit_Loss.php:189 #: GLTrialBalance.php:154 GLTrialBalance.php:166 InventoryPlanning.php:102 #: InventoryPlanning.php:177 InventoryPlanning.php:212 -#: InventoryPlanning.php:260 InventoryPlanning.php:298 -#: InventoryPlanning.php:361 InventoryPlanningPrefSupplier.php:211 +#: InventoryPlanning.php:255 InventoryPlanning.php:293 +#: InventoryPlanning.php:356 InventoryPlanningPrefSupplier.php:211 #: InventoryPlanningPrefSupplier.php:279 InventoryPlanningPrefSupplier.php:313 -#: InventoryPlanningPrefSupplier.php:358 InventoryPlanningPrefSupplier.php:404 +#: InventoryPlanningPrefSupplier.php:356 InventoryPlanningPrefSupplier.php:404 #: InventoryPlanningPrefSupplier.php:460 InventoryQuantities.php:86 #: InventoryQuantities.php:97 InventoryValuation.php:79 #: InventoryValuation.php:90 MailInventoryValuation.php:118 -#: MailInventoryValuation.php:214 MRPPlannedPurchaseOrders.php:117 -#: MRPPlannedPurchaseOrders.php:128 MRPPlannedWorkOrders.php:108 +#: MailInventoryValuation.php:214 MRPPlannedPurchaseOrders.php:114 +#: MRPPlannedPurchaseOrders.php:125 MRPPlannedWorkOrders.php:108 #: MRPPlannedWorkOrders.php:119 MRPPlannedWorkOrders.php:318 MRPReport.php:41 #: MRPReport.php:52 MRPReport.php:150 MRPReschedules.php:49 -#: MRPReschedules.php:61 MRPShortages.php:148 MRPShortages.php:160 +#: MRPReschedules.php:61 MRPShortages.php:140 MRPShortages.php:152 #: OutstandingGRNs.php:54 OutstandingGRNs.php:66 PcReportTab.php:236 -#: PDFCustomerList.php:235 PDFCustomerList.php:247 PDFGrn.php:123 -#: PDFLowGP.php:63 PDFLowGP.php:75 PDFPriceList.php:124 PDFQuotation.php:234 -#: PDFQuotationPortrait.php:235 PDFRemittanceAdvice.php:84 -#: PDFStockCheckComparison.php:39 PDFStockCheckComparison.php:65 -#: PDFStockCheckComparison.php:266 PDFTopItems.php:118 PO_PDFPurchOrder.php:30 -#: PO_PDFPurchOrder.php:144 PrintCustOrder_generic.php:180 -#: PrintCustOrder.php:198 ReorderLevel.php:62 ReorderLevel.php:151 -#: SalesAnalysis_UserDefined.php:28 SelectCreditItems.php:23 StockCheck.php:47 +#: PDFCustomerList.php:235 PDFCustomerList.php:247 PDFGrn.php:147 +#: PDFLowGP.php:63 PDFLowGP.php:75 PDFPriceList.php:124 PDFQuotation.php:237 +#: PDFRemittanceAdvice.php:84 PDFStockCheckComparison.php:39 +#: PDFStockCheckComparison.php:65 PDFStockCheckComparison.php:266 +#: PDFTopItems.php:123 PO_PDFPurchOrder.php:21 PO_PDFPurchOrder.php:131 +#: PrintCustOrder_generic.php:182 PrintCustOrder.php:198 +#: PrintSalesOrder_generic.php:183 ReorderLevel.php:62 ReorderLevel.php:151 +#: SalesAnalysis_UserDefined.php:28 SelectCreditItems.php:25 StockCheck.php:47 #: StockCheck.php:68 StockCheck.php:98 StockCheck.php:142 StockCheck.php:153 -#: StockCheck.php:195 StockDispatch.php:93 StockDispatch.php:105 +#: StockCheck.php:194 StockDispatch.php:93 StockDispatch.php:105 #: SupplierBalsAtPeriodEnd.php:57 SupplierBalsAtPeriodEnd.php:68 #: SuppPaymentRun.php:109 SuppPaymentRun.php:120 SuppPaymentRun.php:184 #: SuppPaymentRun.php:214 SuppPriceList.php:121 Tax.php:64 Tax.php:177 @@ -808,11 +807,11 @@ #: Z_DataExport.php:309 Z_DataExport.php:348 Z_DataExport.php:384 #: Z_DataExport.php:420 Z_DataExport.php:472 Z_poRebuildDefault.php:38 #: includes/PDFPaymentRun_PymtFooter.php:57 -#: includes/PDFPaymentRun_PymtFooter.php:87 -#: includes/PDFPaymentRun_PymtFooter.php:116 -#: includes/PDFPaymentRun_PymtFooter.php:152 -#: includes/PDFPaymentRun_PymtFooter.php:183 -#: includes/PDFPaymentRun_PymtFooter.php:215 +#: includes/PDFPaymentRun_PymtFooter.php:86 +#: includes/PDFPaymentRun_PymtFooter.php:115 +#: includes/PDFPaymentRun_PymtFooter.php:151 +#: includes/PDFPaymentRun_PymtFooter.php:182 +#: includes/PDFPaymentRun_PymtFooter.php:214 #: includes/ConstructSQLForUserDefinedSalesReport.inc:180 #: includes/ConstructSQLForUserDefinedSalesReport.inc:188 #: includes/ConstructSQLForUserDefinedSalesReport.inc:340 @@ -823,39 +822,39 @@ msgid "The details of outstanding transactions for customer" msgstr "جزئیات معاملات برجسته برای مشتری" -#: AgedDebtors.php:367 AgedSuppliers.php:189 GLAccountCSV.php:167 -#: GLAccountInquiry.php:145 GLAccountReport.php:93 PO_Items.php:471 -#: PO_Items.php:605 PO_Items.php:632 SalesAnalReptCols.php:356 -#: SpecialOrder.php:369 StockLocTransferReceive.php:373 -#: StockQuantityByDate.php:114 includes/SelectOrderItems_IntoCart.inc:53 +#: AgedDebtors.php:367 AgedSuppliers.php:189 GLAccountCSV.php:169 +#: GLAccountInquiry.php:145 GLAccountReport.php:93 PO_Items.php:532 +#: PO_Items.php:562 PO_Items.php:640 PO_Items.php:803 +#: SalesAnalReptCols.php:356 SpecialOrder.php:369 +#: StockLocTransferReceive.php:373 StockQuantityByDate.php:106 +#: includes/SelectOrderItems_IntoCart.inc:53 msgid "could not be retrieved because" msgstr "قابل بازیابی نیست زیرا" #: AgedDebtors.php:370 AgedSuppliers.php:192 Areas.php:96 -#: ConfirmDispatch_Invoice.php:152 ConfirmDispatch_Invoice.php:969 -#: ConfirmDispatch_Invoice.php:983 Contracts.php:581 CounterSales.php:1323 -#: CounterSales.php:1337 Credit_Invoice.php:706 Credit_Invoice.php:728 -#: CustomerReceipt.php:523 CustomerReceipt.php:655 CustomerReceipt.php:683 +#: ConfirmDispatch_Invoice.php:155 ConfirmDispatch_Invoice.php:962 +#: ConfirmDispatch_Invoice.php:976 Contracts.php:583 CounterSales.php:1280 +#: CounterSales.php:1294 Credit_Invoice.php:707 Credit_Invoice.php:729 +#: CustomerReceipt.php:526 CustomerReceipt.php:658 CustomerReceipt.php:686 #: CustomerTransInquiry.php:79 DeliveryDetails.php:395 GLProfit_Loss.php:578 -#: GLTagProfit_Loss.php:490 Payments.php:308 PDFRemittanceAdvice.php:86 -#: PurchData.php:89 PurchData.php:108 PurchData.php:244 ReverseGRN.php:191 -#: ReverseGRN.php:205 ReverseGRN.php:366 SelectCreditItems.php:1381 -#: SelectSalesOrder.php:113 SelectSalesOrder.php:281 StockCheck.php:225 -#: StockCostUpdate.php:79 StockCostUpdate.php:89 StockLocStatus.php:142 -#: StockMovements.php:92 StockQuantityByDate.php:90 StockReorderLevel.php:39 -#: StockStatus.php:271 StockTransfers.php:159 StockUsageGraph.php:53 -#: StockUsage.php:132 SupplierInquiry.php:79 SupplierInquiry.php:101 -#: SupplierInquiry.php:131 SupplierInquiry.php:177 SupplierTransInquiry.php:81 -#: SuppPaymentRun.php:111 SuppPaymentRun.php:186 SuppPaymentRun.php:216 -#: WorkOrderCosting.php:393 WorkOrderReceive.php:272 WOSerialNos.php:44 -#: Z_ChangeBranchCode.php:108 Z_ChangeCustomerCode.php:92 +#: GLTagProfit_Loss.php:490 Payments.php:307 PDFRemittanceAdvice.php:86 +#: PurchData.php:89 PurchData.php:108 PurchData.php:219 ReverseGRN.php:191 +#: ReverseGRN.php:205 ReverseGRN.php:366 SelectCreditItems.php:1383 +#: StockCheck.php:224 StockCostUpdate.php:79 StockCostUpdate.php:89 +#: StockLocStatus.php:142 StockMovements.php:92 StockQuantityByDate.php:82 +#: StockReorderLevel.php:39 StockStatus.php:271 StockTransfers.php:159 +#: StockUsageGraph.php:53 StockUsage.php:127 SupplierInquiry.php:79 +#: SupplierInquiry.php:101 SupplierInquiry.php:131 SupplierInquiry.php:177 +#: SupplierTransInquiry.php:81 SuppPaymentRun.php:111 SuppPaymentRun.php:186 +#: SuppPaymentRun.php:216 WorkOrderCosting.php:393 WorkOrderReceive.php:272 +#: WOSerialNos.php:44 Z_ChangeBranchCode.php:108 Z_ChangeCustomerCode.php:90 #: Z_DeleteCreditNote.php:57 Z_DeleteInvoice.php:83 #: includes/PDFPaymentRun_PymtFooter.php:59 -#: includes/PDFPaymentRun_PymtFooter.php:89 -#: includes/PDFPaymentRun_PymtFooter.php:118 -#: includes/PDFPaymentRun_PymtFooter.php:154 -#: includes/PDFPaymentRun_PymtFooter.php:185 includes/ConnectDB_mysqli.inc:79 -#: includes/ConnectDB_mysql.inc:64 +#: includes/PDFPaymentRun_PymtFooter.php:88 +#: includes/PDFPaymentRun_PymtFooter.php:117 +#: includes/PDFPaymentRun_PymtFooter.php:153 +#: includes/PDFPaymentRun_PymtFooter.php:184 includes/ConnectDB_mysqli.inc:83 +#: includes/ConnectDB_mysql.inc:65 msgid "The SQL that failed was" msgstr "گذاشتن که شکست خورده بود" @@ -911,17 +910,17 @@ msgid "Detailed Report" msgstr "جزئیات گزارش" -#: AgedDebtors.php:520 AgedSuppliers.php:320 BOMExtendedQty.php:286 -#: BOMIndented.php:268 BOMIndentedReverse.php:255 BOMListing.php:142 -#: DebtorsAtPeriodEnd.php:166 InventoryPlanning.php:442 +#: AgedDebtors.php:520 AgedSuppliers.php:320 BOMExtendedQty.php:300 +#: BOMIndented.php:278 BOMIndentedReverse.php:266 BOMListing.php:142 +#: DebtorsAtPeriodEnd.php:166 InventoryPlanning.php:437 #: InventoryPlanningPrefSupplier.php:518 InventoryQuantities.php:188 -#: InventoryValuation.php:242 MRPPlannedPurchaseOrders.php:282 -#: MRPPlannedWorkOrders.php:344 MRPReschedules.php:166 MRPShortages.php:259 +#: InventoryValuation.php:242 MRPPlannedPurchaseOrders.php:279 +#: MRPPlannedWorkOrders.php:344 MRPReschedules.php:166 MRPShortages.php:262 #: OutstandingGRNs.php:185 PDFCustomerList.php:412 PDFLowGP.php:168 #: PDFPriceList.php:301 PDFRemittanceAdvice.php:152 -#: PDFStockCheckComparison.php:379 PrintCustTrans.php:416 -#: PrintCustTransPortrait.php:560 ReorderLevel.php:229 StockDispatch.php:309 -#: SupplierBalsAtPeriodEnd.php:155 SuppPriceList.php:228 Tax.php:352 +#: PDFStockCheckComparison.php:379 PrintCustTrans.php:478 +#: PrintCustTransPortrait.php:630 ReorderLevel.php:229 StockDispatch.php:309 +#: SupplierBalsAtPeriodEnd.php:155 SuppPriceList.php:237 Tax.php:352 msgid "Print PDF" msgstr "پی دی اف نسخه قابل چاپ" @@ -1044,10 +1043,10 @@ msgstr "کد شهر" #: Areas.php:133 CustomerTypes.php:166 Factors.php:142 -#: FixedAssetCategories.php:136 GLAccounts.php:208 Locations.php:328 +#: FixedAssetCategories.php:137 GLAccounts.php:208 Locations.php:328 #: MRPDemands.php:248 PcAssignCashToTab.php:118 PcClaimExpensesFromTab.php:109 -#: PcExpenses.php:137 PcExpensesTypeTab.php:86 PcTabs.php:124 -#: PcTypeTabs.php:137 SalesAnalReptCols.php:215 SalesCategories.php:139 +#: PcExpenses.php:127 PcExpensesTypeTab.php:83 PcTabs.php:124 +#: PcTypeTabs.php:134 SalesAnalReptCols.php:215 SalesCategories.php:139 #: SalesTypes.php:163 StockCategories.php:199 Suppliers.php:639 #: SupplierTypes.php:153 Z_DeleteInvoice.php:142 msgid "has been deleted" @@ -1073,19 +1072,19 @@ msgid "Incorrect date format used, please re-enter" msgstr "اشتباه فرمت تاریخ استفاده می شود ، لطفا دوباره وارد کنید" -#: AuditTrail.php:37 BOMIndented.php:307 BOMIndentedReverse.php:294 +#: AuditTrail.php:37 BOMIndented.php:317 BOMIndentedReverse.php:305 #: MRPCalendar.php:260 msgid "From Date" msgstr "از تاریخ" -#: AuditTrail.php:39 BOMIndented.php:308 BOMIndentedReverse.php:295 +#: AuditTrail.php:39 BOMIndented.php:318 BOMIndentedReverse.php:306 #: MRPCalendar.php:262 msgid "To Date" msgstr "تا تاریخ" #: AuditTrail.php:43 PO_AuthorisationLevels.php:123 #: PO_AuthorisationLevels.php:160 PO_AuthorisationLevels.php:163 -#: UserSettings.php:109 +#: UserSettings.php:111 msgid "User ID" msgstr "شناسه کاربر" @@ -1093,8 +1092,8 @@ msgid "Table " msgstr "جدول " -#: AuditTrail.php:68 MRPReport.php:789 PO_SelectPurchOrder.php:363 -#: SelectContract.php:196 SelectProduct.php:727 +#: AuditTrail.php:68 MRPReport.php:789 PO_SelectPurchOrder.php:357 +#: SelectContract.php:196 SelectProduct.php:710 msgid "View" msgstr "نمایش" @@ -1109,9 +1108,9 @@ #: AuditTrail.php:146 BankReconciliation.php:185 BankReconciliation.php:257 #: CustomerAllocations.php:356 CustomerInquiry.php:189 #: CustomerTransInquiry.php:21 CustomerTransInquiry.php:85 -#: CustWhereAlloc.php:18 CustWhereAlloc.php:87 DailyBankTransactions.php:99 -#: GLAccountInquiry.php:152 GLAccountReport.php:367 GLJournal.php:241 -#: MRPReschedules.php:204 SelectCustomer.php:463 ShipmentCosting.php:501 +#: CustWhereAlloc.php:18 CustWhereAlloc.php:87 DailyBankTransactions.php:79 +#: GLAccountInquiry.php:152 GLAccountReport.php:367 GLJournal.php:256 +#: MRPReschedules.php:204 SelectCustomer.php:460 ShipmentCosting.php:501 #: ShipmentCosting.php:572 StockCategories.php:219 StockLocMovements.php:83 #: StockMovements.php:97 SupplierAllocations.php:462 SupplierInquiry.php:193 #: SupplierTransInquiry.php:19 SupplierTransInquiry.php:86 @@ -1131,7 +1130,7 @@ msgid "Field Name" msgstr "نام فیلد" -#: AuditTrail.php:149 SystemParameters.php:315 +#: AuditTrail.php:149 SystemParameters.php:312 #: includes/PDFInventoryValnPageHeader.inc:38 #: includes/PDFOstdgGRNsPageHeader.inc:43 msgid "Value" @@ -1227,7 +1226,7 @@ msgid "The SQL used to retrieve the bank account details was" msgstr "گذاشتن استفاده برای بازیابی جزئیات حساب بانکی بود" -#: BankAccounts.php:196 GLJournal.php:265 +#: BankAccounts.php:196 GLJournal.php:280 msgid "GL Account Code" msgstr "گرم در کد حساب کاربری" @@ -1247,16 +1246,16 @@ msgid "Bank Address" msgstr "بانک آدرس" -#: BankAccounts.php:201 CustomerReceipt.php:753 CustomerTransInquiry.php:95 +#: BankAccounts.php:201 CustomerReceipt.php:756 CustomerTransInquiry.php:95 #: OffersReceived.php:98 PcReportTab.php:291 PcTabs.php:147 PcTabs.php:295 #: PDFPrintLabel.php:94 PO_AuthorisationLevels.php:125 #: PO_AuthorisationLevels.php:180 PO_AuthorisationLevels.php:183 #: PO_AuthoriseMyOrders.php:107 PO_Header.php:534 -#: PO_SelectOSPurchOrder.php:444 PO_SelectPurchOrder.php:365 -#: PricesByCost.php:239 Prices.php:198 Prices.php:293 PurchData.php:172 -#: PurchData.php:340 PurchData.php:453 SelectSupplier.php:251 -#: SupplierCredit.php:268 SupplierInvoice.php:232 SupplierTransInquiry.php:95 -#: SuppPriceList.php:265 includes/PDFBankingSummaryPageHeader.inc:42 +#: PO_SelectOSPurchOrder.php:444 PO_SelectPurchOrder.php:359 +#: PricesByCost.php:209 Prices.php:198 Prices.php:293 PurchData.php:168 +#: PurchData.php:315 PurchData.php:428 SelectSupplier.php:251 +#: SupplierCredit.php:264 SupplierInvoice.php:232 SupplierTransInquiry.php:95 +#: SuppPriceList.php:274 includes/PDFBankingSummaryPageHeader.inc:42 #: includes/PDFDebtorBalsPageHeader.inc:33 #: includes/PDFSupplierBalsPageHeader.inc:36 msgid "Currency" @@ -1336,38 +1335,38 @@ "با استفاده از این صفحه برای مطابقت با webERP رسید و پرداخت خود را به بانک " "بیانیه. بررسی صورت حساب بانکی خود و کلیک بر روی چک باکس که همه معامله منطبق." -#: BankMatching.php:80 BankReconciliation.php:97 CustomerReceipt.php:726 -#: DailyBankTransactions.php:28 Payments.php:733 PDFChequeListing.php:46 +#: BankMatching.php:80 BankReconciliation.php:97 CustomerReceipt.php:729 +#: DailyBankTransactions.php:28 Payments.php:732 PDFChequeListing.php:46 #: TaxAuthorities.php:150 TaxAuthorities.php:306 msgid "Bank Account" msgstr "حساب بانکی ما" -#: BankMatching.php:102 +#: BankMatching.php:102 PO_SelectOSPurchOrder.php:489 msgid "Show" msgstr "نمایش" #: BankMatching.php:102 CreditItemsControlled.php:78 FreightCosts.php:270 -#: GoodsReceivedControlled.php:65 GoodsReceived.php:67 +#: GoodsReceivedControlled.php:56 GoodsReceived.php:66 #: StockLocTransferReceive.php:426 SupplierAllocations.php:443 #: SuppShiptChgs.php:126 msgid "from" msgstr "از" #: BankMatching.php:105 ConfirmDispatchControlled_Invoice.php:59 -#: EmailCustTrans.php:65 FixedAssetRegister.php:78 FTP_RadioBeacon.php:281 -#: GLAccountCSV.php:170 GLAccountReport.php:102 Payments.php:713 -#: PcReportTab.php:105 PDFChequeListing.php:108 PDFChequeListing.php:118 -#: PDFChequeListing.php:205 PDFDeliveryDifferences.php:166 -#: PDFDeliveryDifferences.php:179 PDFDeliveryDifferences.php:287 -#: PDFDIFOT.php:172 PDFDIFOT.php:185 PDFDIFOT.php:289 PDFOrdersInvoiced.php:74 -#: PDFOrdersInvoiced.php:271 PDFOrderStatus.php:75 PDFOrderStatus.php:250 -#: PO_PDFPurchOrder.php:302 PricesBasedOnMarkUp.php:216 -#: PricesBasedOnMarkUp.php:355 PrintCustStatements.php:50 -#: PrintCustTrans.php:37 PrintCustTrans.php:40 PrintCustTransPortrait.php:60 +#: EmailCustTrans.php:65 FTP_RadioBeacon.php:281 GLAccountCSV.php:172 +#: GLAccountReport.php:102 Payments.php:712 PcReportTab.php:105 +#: PDFChequeListing.php:108 PDFChequeListing.php:118 PDFChequeListing.php:205 +#: PDFDeliveryDifferences.php:166 PDFDeliveryDifferences.php:179 +#: PDFDeliveryDifferences.php:287 PDFDIFOT.php:172 PDFDIFOT.php:185 +#: PDFDIFOT.php:289 PDFOrdersInvoiced.php:74 PDFOrdersInvoiced.php:271 +#: PDFOrderStatus.php:75 PDFOrderStatus.php:250 PO_PDFPurchOrder.php:313 +#: PricesBasedOnMarkUp.php:216 PricesBasedOnMarkUp.php:334 +#: PricesBasedOnMarkUp.php:350 PrintCustStatements.php:50 +#: PrintCustTrans.php:38 PrintCustTrans.php:41 PrintCustTransPortrait.php:60 #: PrintCustTransPortrait.php:63 SalesGraph.php:200 SalesGraph.php:229 #: SalesGraph.php:233 StockLocTransferReceive.php:310 -#: StockLocTransferReceive.php:426 Stocks.php:229 Stocks.php:234 -#: StockStatus.php:309 StockStatus.php:350 StockTransfers.php:397 +#: StockLocTransferReceive.php:426 Stocks.php:231 Stocks.php:236 +#: StockStatus.php:305 StockStatus.php:347 StockTransfers.php:397 #: includes/PDFAgedDebtorsPageHeader.inc:18 #: includes/PDFAgedSuppliersPageHeader.inc:17 #: includes/PDFChequeListingPageHeader.inc:17 @@ -1458,7 +1457,8 @@ msgstr "بعد" #: BankMatching.php:218 -msgid "The payments with the selected criteria could not be retrieved because" +msgid "" +"The payments with the selected criteria could not be retrieved because" msgstr "پرداخت با معیار های انتخاب قابل بازیابی نیست زیرا" #: BankMatching.php:221 ShipmentCosting.php:502 ShipmentCosting.php:573 @@ -1466,19 +1466,19 @@ msgid "Ref" msgstr "کد عکس" -#: BankMatching.php:224 ConfirmDispatch_Invoice.php:279 Credit_Invoice.php:280 -#: CustomerAllocations.php:359 CustomerReceipt.php:842 +#: BankMatching.php:224 ConfirmDispatch_Invoice.php:272 Credit_Invoice.php:281 +#: CustomerAllocations.php:359 CustomerReceipt.php:845 #: CustomerTransInquiry.php:94 CustWhereAlloc.php:91 PaymentAllocations.php:78 -#: Payments.php:926 Payments.php:928 Payments.php:937 +#: Payments.php:928 Payments.php:930 Payments.php:939 #: PcAssignCashToTab.php:214 PcAssignCashToTab.php:335 #: PcAuthorizeExpenses.php:83 PcClaimExpensesFromTab.php:193 #: PcClaimExpensesFromTab.php:342 PcReportTab.php:175 PcReportTab.php:347 -#: PrintCheque.php:70 PrintCheque.php:84 SelectCreditItems.php:659 -#: SuppContractChgs.php:73 SuppContractChgs.php:142 SuppFixedAssetChgs.php:71 -#: SuppFixedAssetChgs.php:137 SupplierAllocations.php:466 -#: SupplierCredit.php:345 SupplierCredit.php:373 SupplierCredit.php:403 -#: SupplierCredit.php:438 SupplierInvoice.php:313 SupplierInvoice.php:344 -#: SupplierInvoice.php:373 SupplierInvoice.php:409 SupplierTransInquiry.php:94 +#: PrintCheque.php:70 PrintCheque.php:84 SelectCreditItems.php:661 +#: SuppContractChgs.php:73 SuppContractChgs.php:142 SuppFixedAssetChgs.php:77 +#: SuppFixedAssetChgs.php:136 SupplierAllocations.php:466 +#: SupplierCredit.php:341 SupplierCredit.php:369 SupplierCredit.php:399 +#: SupplierCredit.php:434 SupplierInvoice.php:312 SupplierInvoice.php:342 +#: SupplierInvoice.php:373 SupplierInvoice.php:408 SupplierTransInquiry.php:94 #: SuppShiptChgs.php:77 SuppShiptChgs.php:134 SuppTransGLAnalysis.php:97 #: SuppTransGLAnalysis.php:174 Z_CheckAllocs.php:63 #: includes/PDFBankingSummaryPageHeader.inc:55 @@ -1488,7 +1488,7 @@ #: BankMatching.php:225 BankReconciliation.php:189 BankReconciliation.php:261 #: PDFOrdersInvoiced.php:348 PDFOrderStatus.php:316 -#: PO_SelectOSPurchOrder.php:215 PO_SelectPurchOrder.php:180 +#: PO_SelectOSPurchOrder.php:215 PO_SelectPurchOrder.php:175 #: Shipt_Select.php:186 SuppCreditGRNs.php:225 #: includes/PDFStatementPageHeader.inc:173 #: includes/PDFStatementPageHeader.inc:180 @@ -1548,26 +1548,26 @@ msgid "The bank accounts could not be retrieved by the SQL because" msgstr "حساب های بانکی می تواند با گذاشتن زیرا قابل بازیابی نیست" -#: BankReconciliation.php:94 CustomerReceipt.php:717 -#: DailyBankTransactions.php:25 Payments.php:730 SuppPaymentRun.php:302 +#: BankReconciliation.php:94 CustomerReceipt.php:720 +#: DailyBankTransactions.php:25 Payments.php:729 SuppPaymentRun.php:302 msgid "The SQL used to retrieve the bank accounts was" msgstr "گذاشتن استفاده برای بازیابی حساب های بانکی شد" -#: BankReconciliation.php:100 CustomerReceipt.php:731 +#: BankReconciliation.php:100 CustomerReceipt.php:734 msgid "Bank Accounts have not yet been defined" msgstr "حساب بانک هنوز تعریف شده است" -#: BankReconciliation.php:100 CustomerReceipt.php:731 +#: BankReconciliation.php:100 CustomerReceipt.php:734 msgid "You must first" msgstr "شما باید اول" -#: BankReconciliation.php:100 CustomerReceipt.php:731 -#: DailyBankTransactions.php:32 Payments.php:737 SuppPaymentRun.php:310 +#: BankReconciliation.php:100 CustomerReceipt.php:734 +#: DailyBankTransactions.php:32 Payments.php:736 SuppPaymentRun.php:310 msgid "define the bank accounts" msgstr "تعریف حساب های بانکی" -#: BankReconciliation.php:100 CustomerReceipt.php:731 -#: DailyBankTransactions.php:32 Payments.php:737 SuppPaymentRun.php:310 +#: BankReconciliation.php:100 CustomerReceipt.php:734 +#: DailyBankTransactions.php:32 Payments.php:736 SuppPaymentRun.php:310 msgid "and general ledger accounts to be affected" msgstr "و حساب های دفتر کل عمومی که تحت تاثیر قرار" @@ -1600,24 +1600,23 @@ #: BankReconciliation.php:186 BankReconciliation.php:258 #: CustomerAllocations.php:331 CustomerAllocations.php:357 #: CustomerInquiry.php:190 CustomerTransInquiry.php:86 CustWhereAlloc.php:88 -#: EmailCustTrans.php:17 GLAccountInquiry.php:153 PrintCustTrans.php:378 -#: PrintCustTrans.php:542 PrintCustTrans.php:696 PrintCustTrans.php:735 -#: PrintCustTransPortrait.php:504 PrintCustTransPortrait.php:704 -#: PrintCustTransPortrait.php:894 PrintCustTransPortrait.php:939 +#: EmailCustTrans.php:17 GLAccountInquiry.php:153 PrintCustTrans.php:440 +#: PrintCustTrans.php:604 PrintCustTrans.php:758 PrintCustTrans.php:797 +#: PrintCustTransPortrait.php:574 PrintCustTransPortrait.php:774 +#: PrintCustTransPortrait.php:964 PrintCustTransPortrait.php:1009 #: StockMovements.php:97 SupplierAllocations.php:463 #: SupplierAllocations.php:575 SupplierAllocations.php:645 #: SupplierTransInquiry.php:87 Z_CheckAllocs.php:60 #: Z_CheckGLTransBalance.php:13 includes/PDFQuotationPageHeader.inc:87 -#: includes/PDFQuotationPortraitPageHeader.inc:86 #: includes/PDFStatementPageHeader.inc:168 -#: includes/PDFStatementPageHeader.inc:179 includes/PDFTransPageHeader.inc:80 +#: includes/PDFStatementPageHeader.inc:179 includes/PDFTransPageHeader.inc:76 #: includes/PDFTransPageHeaderPortrait.inc:52 msgid "Number" msgstr "عدد" #: BankReconciliation.php:187 BankReconciliation.php:259 #: ContractCosting.php:148 CustomerInquiry.php:193 CustomerTransInquiry.php:90 -#: CustWhereAlloc.php:89 DailyBankTransactions.php:100 GLAccountReport.php:368 +#: CustWhereAlloc.php:89 DailyBankTransactions.php:80 GLAccountReport.php:368 #: PaymentAllocations.php:75 PaymentAllocations.php:76 #: PDFRemittanceAdvice.php:309 ShiptsList.php:37 StockCounts.php:99 #: StockCounts.php:135 StockLocMovements.php:88 StockMovements.php:100 @@ -1672,9 +1671,9 @@ "کاربری ایجاد کنید. مهم است که نرخ ارز بالا نشان دهنده ارزش فعلی از ارز حساب " "بانکی" -#: BankReconciliation.php:311 CounterSales.php:781 Customers.php:1004 -#: SelectOrderItems.php:1369 Stocks.php:1031 WorkOrderCosting.php:512 -#: WorkOrderEntry.php:547 +#: BankReconciliation.php:311 CounterSales.php:741 Customers.php:1014 +#: SelectOrderItems.php:1374 Stocks.php:1029 WorkOrderCosting.php:512 +#: WorkOrderEntry.php:549 msgid "Are You Sure?" msgstr "مطمئن هستید؟" @@ -1703,135 +1702,132 @@ msgid "Match off cleared deposits" msgstr "تطابق پاک کردن رسوبات" -#: BOMExtendedQty.php:12 BOMExtendedQty.php:13 BOMExtendedQty.php:159 -#: BOMExtendedQty.php:269 +#: BOMExtendedQty.php:14 BOMExtendedQty.php:15 BOMExtendedQty.php:156 +#: BOMExtendedQty.php:283 msgid "Quantity Extended BOM Listing" msgstr "مقدار تمدید مثال BOM" -#: BOMExtendedQty.php:32 BOMIndentedReverse.php:29 MRPCalendar.php:87 +#: BOMExtendedQty.php:34 BOMIndentedReverse.php:30 MRPCalendar.php:87 #: MRP.php:29 SalesInquiry.php:1191 msgid "The SQL to to create passbom failed with the message" msgstr "گذاشتن به ایجاد passbom شکست خورده با پیام" -#: BOMExtendedQty.php:45 BOMIndented.php:40 BOMIndentedReverse.php:42 +#: BOMExtendedQty.php:47 BOMIndented.php:42 BOMIndentedReverse.php:43 #: MRP.php:36 msgid "Create of tempbom failed because" msgstr "ایجاد tempbom از شکست خورده به دلیل" -#: BOMExtendedQty.php:161 +#: BOMExtendedQty.php:158 msgid "" "The Quantiy Extended BOM Listing could not be retrieved by the SQL because" msgstr "Quantiy تمدید BOM مثال می توان با گذ... [truncated message content] |
From: <dai...@us...> - 2011-04-18 00:09:33
|
Revision: 4553 http://web-erp.svn.sourceforge.net/web-erp/?rev=4553&view=rev Author: daintree Date: 2011-04-18 00:09:23 +0000 (Mon, 18 Apr 2011) Log Message: ----------- lang updates, xhtml, closing > Modified Paths: -------------- trunk/Prices_Customer.php trunk/SelectCustomer.php trunk/SelectOrderItems.php trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.po trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.po trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.po Modified: trunk/Prices_Customer.php =================================================================== --- trunk/Prices_Customer.php 2011-04-17 10:18:02 UTC (rev 4552) +++ trunk/Prices_Customer.php 2011-04-18 00:09:23 UTC (rev 4553) @@ -330,7 +330,7 @@ $result = DB_query($sql, $db); echo '<table class=selection>'; echo '<tr><td>' . _('Branch') . ':</td>'; -echo '<td><select name="Branch"'; +echo '<td><select name="Branch">'; while ($myrow=DB_fetch_array($result)) { if ($myrow['branchcode']==$_POST['branch']) { echo '<option selected value='.$myrow['branchcode'].'>'.$myrow['brname'].'</option>'; @@ -338,13 +338,13 @@ echo '<option value='.$myrow['branchcode'].'>'.$myrow['brname'].'</option>'; } } -echo '></td></tr>'; +echo '</select></td></tr>'; echo '<tr><td>' . _('Start Date') . ':</td> <td><input type="Text" name="StartDate" class=date alt='.$_SESSION['DefaultDateFormat']. - ' size=11 maxlength=10 value=' . $_POST['StartDate'] . '></td></tr>'; + ' size=11 maxlength=10 value="' . $_POST['StartDate'] . '"></td></tr>'; echo '<tr><td>' . _('End Date') . ':</td> <td><input type="Text" name="EndDate" class=date alt='.$_SESSION['DefaultDateFormat']. - ' size=11 maxlength=10 value=' . $_POST['EndDate'] . '></td></tr>'; + ' size=11 maxlength=10 value="' . $_POST['EndDate'] . '"></td></tr>'; echo '<tr><td>' . _('Price') . ':</td> <td><input type="Text" class=number name="Price" size=11 maxlength=10 value=' . $_POST['Price'] . '></td> Modified: trunk/SelectCustomer.php =================================================================== --- trunk/SelectCustomer.php 2011-04-17 10:18:02 UTC (rev 4552) +++ trunk/SelectCustomer.php 2011-04-18 00:09:23 UTC (rev 4553) @@ -541,8 +541,8 @@ 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 '</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>'; } Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-04-17 10:18:02 UTC (rev 4552) +++ trunk/SelectOrderItems.php 2011-04-18 00:09:23 UTC (rev 4553) @@ -658,7 +658,7 @@ echo '<td></td>'; } echo '<td><input tabindex='.($j+5).' type=submit name="SubmitCustomerSelection' . $j .'" value="' . htmlentities($myrow['brname'], ENT_QUOTES,'UTF-8'). '"></td> - <input type="hidden" name="SelectedCustomer' . $j .'" value="'.$myrow['debtorno'].'"><input type="hidden" name="SelectedBranch' . $j .'" value="'. $myrow['branchcode'].'"> + <input type="hidden" name="SelectedCustomer' . $j .'" value="'.$myrow['debtorno'].'"><input type="hidden" name="SelectedBranch' . $j .'" value="'. $myrow['branchcode'].'" /> <td>'.$myrow['contactname'].'</td> <td>'.$myrow['phoneno'].'</td> <td>'.$myrow['faxno'].'</td> Modified: trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.po 2011-04-17 10:18:02 UTC (rev 4552) +++ trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.po 2011-04-18 00:09:23 UTC (rev 4553) @@ -7,21 +7,21 @@ msgstr "" "Project-Id-Version: Persian & rtl support\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-03-31 20:06+1200\n" -"PO-Revision-Date: 2011-02-18 11:42+0000\n" -"Last-Translator: Mohsen Karimi <Unknown>\n" +"POT-Creation-Date: 2011-01-04 22:15+1200\n" +"PO-Revision-Date: 2011-04-10 22:01+0000\n" +"Last-Translator: پویان <Unknown>\n" "Language-Team: Persian <hos...@io...>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-03-31 06:31+0000\n" -"X-Generator: Launchpad (build 12696)\n" +"X-Launchpad-Export-Date: 2011-04-17 23:41+0000\n" +"X-Generator: Launchpad (build 12821)\n" "X-Poedit-Country: IRAN, ISLAMIC REPUBLIC OF\n" "Language: fa\n" "X-Poedit-Language: Persian\n" "X-Poedit-SourceCharset: utf-8\n" -#: AccountGroups.php:9 index.php:1277 +#: AccountGroups.php:9 index.php:1273 msgid "Account Groups" msgstr "گروه حساب" @@ -59,7 +59,7 @@ msgstr "حساب کاربری نام گروه می تواند شخصیت نیست" #: AccountGroups.php:71 AccountSections.php:75 PaymentMethods.php:41 -#: TaxCategories.php:33 TaxProvinces.php:32 UnitsOfMeasure.php:30 +#: TaxCategories.php:33 TaxProvinces.php:32 UnitsOfMeasure.php:32 msgid "or the character" msgstr "و یا شخصیت" @@ -117,7 +117,8 @@ msgstr "درج رکورد" #: AccountGroups.php:176 -msgid "An error occurred in retrieving the group information from chartmaster" +msgid "" +"An error occurred in retrieving the group information from chartmaster" msgstr "خطا رخ داده است در بازیابی اطلاعات از گروه chartmaster" #: AccountGroups.php:181 @@ -132,21 +133,22 @@ #: Areas.php:117 Areas.php:126 BankAccounts.php:163 CreditStatus.php:126 #: Currencies.php:144 Currencies.php:152 Currencies.php:159 #: CustomerBranches.php:296 CustomerBranches.php:306 CustomerBranches.php:316 -#: CustomerBranches.php:326 Customers.php:311 Customers.php:320 -#: Customers.php:328 Customers.php:336 CustomerTypes.php:149 -#: CustomerTypes.php:159 Factors.php:136 FixedAssetCategories.php:131 +#: CustomerBranches.php:326 Customers.php:317 Customers.php:326 +#: Customers.php:334 Customers.php:342 CustomerTypes.php:149 +#: CustomerTypes.php:159 Factors.php:136 FixedAssetCategories.php:132 #: GLAccounts.php:95 GLAccounts.php:109 Locations.php:247 Locations.php:255 #: Locations.php:264 Locations.php:272 Locations.php:280 Locations.php:288 #: Locations.php:296 Locations.php:304 MRPDemandTypes.php:89 #: PaymentMethods.php:146 PaymentTerms.php:147 PaymentTerms.php:154 -#: PcExpenses.php:129 SalesCategories.php:127 SalesCategories.php:135 +#: PcExpenses.php:119 SalesCategories.php:127 SalesCategories.php:135 #: SalesPeople.php:144 SalesPeople.php:151 SalesTypes.php:147 #: SalesTypes.php:157 Shippers.php:82 Shippers.php:94 StockCategories.php:182 -#: Stocks.php:469 Stocks.php:478 Stocks.php:486 Stocks.php:494 Stocks.php:502 -#: Stocks.php:510 Suppliers.php:613 Suppliers.php:622 Suppliers.php:630 +#: Stocks.php:471 Stocks.php:480 Stocks.php:488 Stocks.php:496 Stocks.php:504 +#: Stocks.php:512 Suppliers.php:613 Suppliers.php:622 Suppliers.php:630 #: SupplierTypes.php:147 TaxCategories.php:133 TaxGroups.php:128 -#: TaxGroups.php:135 TaxProvinces.php:127 UnitsOfMeasure.php:137 -#: WorkCentres.php:90 WorkCentres.php:96 WWW_Access.php:87 +#: TaxGroups.php:135 TaxProvinces.php:127 UnitsOfMeasure.php:142 +#: UnitsOfMeasure.php:149 WorkCentres.php:90 WorkCentres.php:96 +#: WWW_Access.php:87 msgid "There are" msgstr "وجود دارند" @@ -195,17 +197,17 @@ #: AccountGroups.php:226 AccountSections.php:177 AddCustomerContacts.php:25 #: AddCustomerContacts.php:28 AddCustomerNotes.php:97 #: AddCustomerTypeNotes.php:94 AgedDebtors.php:468 AgedSuppliers.php:277 -#: Areas.php:145 AuditTrail.php:13 BOMExtendedQty.php:272 BOMIndented.php:252 -#: BOMIndentedReverse.php:246 BOMInquiry.php:165 BOMListing.php:128 -#: BOMs.php:214 BOMs.php:793 COGSGLPostings.php:20 CompanyPreferences.php:155 -#: CounterSales.php:1983 CounterSales.php:2107 Credit_Invoice.php:256 +#: Areas.php:145 AuditTrail.php:13 BOMExtendedQty.php:286 BOMIndented.php:262 +#: BOMIndentedReverse.php:257 BOMInquiry.php:165 BOMListing.php:128 +#: BOMs.php:214 BOMs.php:793 COGSGLPostings.php:20 CompanyPreferences.php:158 +#: CounterSales.php:1940 CounterSales.php:2062 Credit_Invoice.php:257 #: CreditStatus.php:21 Currencies.php:29 CustEDISetup.php:19 #: DailyBankTransactions.php:9 DebtorsAtPeriodEnd.php:138 #: DiscountCategories.php:12 DiscountCategories.php:122 DiscountMatrix.php:18 -#: EDIMessageFormat.php:104 FixedAssetLocations.php:9 -#: FixedAssetRegister.php:13 FixedAssetRegister.php:238 +#: EDIMessageFormat.php:106 FixedAssetList.php:8 FixedAssetLocations.php:9 +#: FixedAssetRegister.php:13 FixedAssetRegister.php:232 #: FixedAssetTransfer.php:31 FormDesigner.php:132 GLBalanceSheet.php:351 -#: GLBudgets.php:28 GLJournal.php:228 InventoryPlanning.php:374 +#: GLBudgets.php:30 GLJournal.php:243 InventoryPlanning.php:369 #: InventoryPlanningPrefSupplier.php:474 Labels.php:117 Labels.php:273 #: MRPReport.php:536 OutstandingGRNs.php:174 PcAssignCashToTab.php:39 #: PcAssignCashToTab.php:113 PcAssignCashToTab.php:129 @@ -213,24 +215,24 @@ #: PDFStockLocTransfer.php:21 PO_AuthorisationLevels.php:12 POReport.php:61 #: POReport.php:65 POReport.php:69 PO_SelectOSPurchOrder.php:136 #: PricesBasedOnMarkUp.php:11 Prices_Customer.php:45 Prices.php:32 -#: PurchData.php:141 PurchData.php:256 PurchData.php:275 -#: RecurringSalesOrders.php:311 SalesAnalReptCols.php:51 SalesAnalRepts.php:13 +#: PurchData.php:141 PurchData.php:231 PurchData.php:250 +#: RecurringSalesOrders.php:307 SalesAnalReptCols.php:51 SalesAnalRepts.php:13 #: SalesCategories.php:13 SalesGLPostings.php:18 SalesGraph.php:34 #: SalesPeople.php:22 SalesTypes.php:22 SelectAsset.php:44 -#: SelectCompletedOrder.php:13 SelectContract.php:81 SelectCreditItems.php:202 -#: SelectCreditItems.php:270 SelectCustomer.php:323 SelectGLAccount.php:19 -#: SelectGLAccount.php:79 SelectOrderItems.php:607 SelectOrderItems.php:1431 -#: SelectOrderItems.php:1555 SelectProduct.php:473 SelectSalesOrder.php:457 +#: SelectCompletedOrder.php:13 SelectContract.php:81 SelectCreditItems.php:204 +#: SelectCreditItems.php:272 SelectCustomer.php:315 SelectGLAccount.php:19 +#: SelectGLAccount.php:79 SelectOrderItems.php:605 SelectOrderItems.php:1436 +#: SelectOrderItems.php:1556 SelectProduct.php:456 SelectSalesOrder.php:155 #: SelectSupplier.php:9 SelectSupplier.php:198 SelectWorkOrder.php:11 #: SelectWorkOrder.php:147 ShipmentCosting.php:13 Shipments.php:18 #: Shippers.php:123 Shippers.php:159 Shipt_Select.php:10 #: StockLocMovements.php:15 StockLocStatus.php:27 Suppliers.php:306 #: SupplierTenders.php:261 SupplierTenders.php:318 SupplierTransInquiry.php:11 -#: TaxGroups.php:16 TaxProvinces.php:12 TopItems.php:62 +#: TaxGroups.php:16 TaxProvinces.php:12 TopItems.php:60 #: WhereUsedInquiry.php:18 WorkCentres.php:111 WorkCentres.php:158 -#: WorkOrderCosting.php:14 WorkOrderEntry.php:10 WorkOrderIssue.php:22 +#: WorkOrderCosting.php:14 WorkOrderEntry.php:12 WorkOrderIssue.php:22 #: WorkOrderReceive.php:15 WorkOrderStatus.php:43 WWW_Access.php:13 -#: WWW_Users.php:33 Z_BottomUpCosts.php:51 +#: WWW_Users.php:38 Z_BottomUpCosts.php:51 msgid "Search" msgstr "جستجو" @@ -238,7 +240,7 @@ msgid "Group Name" msgstr "نام گروه" -#: AccountGroups.php:231 EDIMessageFormat.php:129 EDIMessageFormat.php:207 +#: AccountGroups.php:231 EDIMessageFormat.php:131 msgid "Section" msgstr "قسمت" @@ -260,34 +262,34 @@ #: AccountGroups.php:386 BankAccounts.php:217 BankAccounts.php:361 #: BankAccounts.php:363 BankAccounts.php:367 BOMs.php:128 BOMs.php:713 #: BOMs.php:715 CompanyPreferences.php:439 CompanyPreferences.php:441 -#: CompanyPreferences.php:452 CompanyPreferences.php:454 -#: CompanyPreferences.php:465 CompanyPreferences.php:467 +#: CompanyPreferences.php:451 CompanyPreferences.php:453 +#: CompanyPreferences.php:463 CompanyPreferences.php:465 #: ContractCosting.php:174 CustLoginSetup.php:590 CustLoginSetup.php:592 -#: CustomerBranches.php:420 Customers.php:590 Customers.php:847 -#: Customers.php:854 Customers.php:857 DeliveryDetails.php:1034 +#: CustomerBranches.php:420 Customers.php:600 Customers.php:857 +#: Customers.php:864 Customers.php:867 DeliveryDetails.php:1034 #: DeliveryDetails.php:1074 DeliveryDetails.php:1077 GLTransInquiry.php:73 -#: MRPCalendar.php:222 MRP.php:529 MRP.php:533 MRP.php:537 MRP.php:541 -#: PaymentMethods.php:203 PaymentMethods.php:204 PaymentMethods.php:264 -#: PaymentMethods.php:270 PDFChequeListing.php:63 +#: Locations.php:373 MRPCalendar.php:222 MRP.php:530 MRP.php:534 MRP.php:538 +#: MRP.php:542 PaymentMethods.php:203 PaymentMethods.php:204 +#: PaymentMethods.php:264 PaymentMethods.php:270 PDFChequeListing.php:63 #: PDFDeliveryDifferences.php:64 PDFDIFOT.php:67 #: PO_AuthorisationLevels.php:132 PO_AuthorisationLevels.php:137 -#: PO_Header.php:754 PO_PDFPurchOrder.php:344 PO_PDFPurchOrder.php:347 -#: PurchData.php:192 PurchData.php:494 PurchData.php:497 -#: RecurringSalesOrders.php:483 RecurringSalesOrders.php:486 +#: PO_Header.php:758 PO_PDFPurchOrder.php:367 PO_PDFPurchOrder.php:370 +#: PurchData.php:189 PurchData.php:469 PurchData.php:472 +#: RecurringSalesOrders.php:479 RecurringSalesOrders.php:482 #: SalesAnalReptCols.php:279 SalesAnalReptCols.php:401 #: SalesAnalReptCols.php:404 SalesAnalRepts.php:406 SalesAnalRepts.php:409 #: SalesAnalRepts.php:432 SalesAnalRepts.php:435 SalesAnalRepts.php:458 #: SalesAnalRepts.php:461 SelectProduct.php:351 ShipmentCosting.php:622 -#: Stocks.php:869 Stocks.php:871 Stocks.php:889 Stocks.php:891 +#: Stocks.php:867 Stocks.php:869 Stocks.php:887 Stocks.php:889 #: SuppContractChgs.php:83 SuppLoginSetup.php:511 SuppLoginSetup.php:513 -#: SystemParameters.php:376 SystemParameters.php:399 SystemParameters.php:415 +#: SystemParameters.php:373 SystemParameters.php:405 SystemParameters.php:450 #: SystemParameters.php:468 SystemParameters.php:476 SystemParameters.php:516 -#: SystemParameters.php:589 SystemParameters.php:598 SystemParameters.php:606 -#: SystemParameters.php:624 SystemParameters.php:631 SystemParameters.php:756 -#: SystemParameters.php:887 SystemParameters.php:889 SystemParameters.php:899 -#: SystemParameters.php:901 SystemParameters.php:955 SystemParameters.php:967 -#: SystemParameters.php:969 TaxGroups.php:292 TaxGroups.php:295 -#: TaxGroups.php:344 WWW_Users.php:605 WWW_Users.php:607 +#: SystemParameters.php:589 SystemParameters.php:597 SystemParameters.php:615 +#: SystemParameters.php:622 SystemParameters.php:746 SystemParameters.php:877 +#: SystemParameters.php:879 SystemParameters.php:889 SystemParameters.php:891 +#: SystemParameters.php:945 SystemParameters.php:957 SystemParameters.php:959 +#: TaxGroups.php:292 TaxGroups.php:295 TaxGroups.php:344 WWW_Users.php:610 +#: WWW_Users.php:612 msgid "Yes" msgstr "بلی" @@ -295,60 +297,59 @@ #: BankAccounts.php:215 BankAccounts.php:361 BankAccounts.php:363 #: BankAccounts.php:367 BOMs.php:130 BOMs.php:712 BOMs.php:716 #: CompanyPreferences.php:438 CompanyPreferences.php:442 -#: CompanyPreferences.php:451 CompanyPreferences.php:455 -#: CompanyPreferences.php:464 CompanyPreferences.php:468 +#: CompanyPreferences.php:450 CompanyPreferences.php:454 +#: CompanyPreferences.php:462 CompanyPreferences.php:466 #: ContractCosting.php:172 CustLoginSetup.php:589 CustLoginSetup.php:593 -#: CustomerBranches.php:420 Customers.php:589 Customers.php:845 -#: Customers.php:853 Customers.php:856 DeliveryDetails.php:1035 +#: CustomerBranches.php:420 Customers.php:599 Customers.php:855 +#: Customers.php:863 Customers.php:866 DeliveryDetails.php:1035 #: DeliveryDetails.php:1075 DeliveryDetails.php:1078 GLTransInquiry.php:127 -#: MRPCalendar.php:224 MRP.php:527 MRP.php:531 MRP.php:535 MRP.php:539 -#: PaymentMethods.php:203 PaymentMethods.php:204 PaymentMethods.php:265 -#: PaymentMethods.php:271 PDFChequeListing.php:62 +#: Locations.php:375 MRPCalendar.php:224 MRP.php:528 MRP.php:532 MRP.php:536 +#: MRP.php:540 PaymentMethods.php:203 PaymentMethods.php:204 +#: PaymentMethods.php:265 PaymentMethods.php:271 PDFChequeListing.php:62 #: PDFDeliveryDifferences.php:63 PDFDIFOT.php:66 #: PO_AuthorisationLevels.php:134 PO_AuthorisationLevels.php:139 -#: PO_Header.php:753 PO_PDFPurchOrder.php:345 PO_PDFPurchOrder.php:348 -#: PurchData.php:195 PurchData.php:495 PurchData.php:498 -#: RecurringSalesOrders.php:482 RecurringSalesOrders.php:485 +#: PO_Header.php:757 PO_PDFPurchOrder.php:368 PO_PDFPurchOrder.php:371 +#: PurchData.php:192 PurchData.php:470 PurchData.php:473 +#: RecurringSalesOrders.php:478 RecurringSalesOrders.php:481 #: SalesAnalReptCols.php:277 SalesAnalReptCols.php:402 #: SalesAnalReptCols.php:405 SalesAnalRepts.php:405 SalesAnalRepts.php:408 #: SalesAnalRepts.php:431 SalesAnalRepts.php:434 SalesAnalRepts.php:457 #: SalesAnalRepts.php:460 SelectProduct.php:353 ShipmentCosting.php:623 -#: Stocks.php:864 Stocks.php:866 Stocks.php:884 Stocks.php:886 +#: Stocks.php:862 Stocks.php:864 Stocks.php:882 Stocks.php:884 #: SuppContractChgs.php:85 SuppLoginSetup.php:510 SuppLoginSetup.php:514 -#: SystemParameters.php:377 SystemParameters.php:400 SystemParameters.php:416 +#: SystemParameters.php:374 SystemParameters.php:406 SystemParameters.php:451 #: SystemParameters.php:469 SystemParameters.php:477 SystemParameters.php:517 -#: SystemParameters.php:590 SystemParameters.php:599 SystemParameters.php:607 -#: SystemParameters.php:625 SystemParameters.php:632 SystemParameters.php:757 -#: SystemParameters.php:886 SystemParameters.php:890 SystemParameters.php:898 -#: SystemParameters.php:902 SystemParameters.php:956 SystemParameters.php:966 -#: SystemParameters.php:970 TaxGroups.php:293 TaxGroups.php:296 -#: TaxGroups.php:346 WWW_Users.php:604 WWW_Users.php:608 -#: includes/PDFLowGPPageHeader.inc:44 includes/PDFTaxPageHeader.inc:35 +#: SystemParameters.php:590 SystemParameters.php:598 SystemParameters.php:616 +#: SystemParameters.php:623 SystemParameters.php:747 SystemParameters.php:876 +#: SystemParameters.php:880 SystemParameters.php:888 SystemParameters.php:892 +#: SystemParameters.php:946 SystemParameters.php:956 SystemParameters.php:960 +#: TaxGroups.php:293 TaxGroups.php:296 TaxGroups.php:346 WWW_Users.php:609 +#: WWW_Users.php:613 includes/PDFLowGPPageHeader.inc:44 +#: includes/PDFTaxPageHeader.inc:35 msgid "No" msgstr "خیر" #: AccountGroups.php:265 AccountSections.php:197 AddCustomerContacts.php:131 #: AddCustomerNotes.php:125 AddCustomerTypeNotes.php:123 Areas.php:165 #: BankAccounts.php:226 BOMs.php:150 COGSGLPostings.php:113 -#: COGSGLPostings.php:215 CreditStatus.php:175 Currencies.php:239 -#: CustLoginSetup.php:312 CustomerBranches.php:424 Customers.php:899 -#: Customers.php:931 CustomerTypes.php:205 EDIMessageFormat.php:150 -#: Factors.php:208 FixedAssetCategories.php:181 FixedAssetLocations.php:102 +#: COGSGLPostings.php:218 CreditStatus.php:175 Currencies.php:239 +#: CustLoginSetup.php:312 CustomerBranches.php:424 Customers.php:909 +#: Customers.php:941 CustomerTypes.php:205 EDIMessageFormat.php:152 +#: Factors.php:208 FixedAssetCategories.php:182 FixedAssetLocations.php:102 #: FreightCosts.php:243 GeocodeSetup.php:169 GLAccounts.php:319 GLTags.php:62 -#: Labels.php:414 Locations.php:380 MRPDemands.php:304 MRPDemandTypes.php:122 +#: Labels.php:414 Locations.php:382 MRPDemands.php:304 MRPDemandTypes.php:122 #: PaymentMethods.php:205 PaymentTerms.php:203 PcAssignCashToTab.php:251 -#: PcClaimExpensesFromTab.php:229 PcExpenses.php:186 PcTabs.php:188 -#: PcTypeTabs.php:174 PO_AuthorisationLevels.php:148 Prices_Customer.php:283 -#: Prices.php:227 PurchData.php:207 SalesCategories.php:263 +#: PcClaimExpensesFromTab.php:229 PcExpenses.php:176 PcTabs.php:188 +#: PcTypeTabs.php:171 PO_AuthorisationLevels.php:148 Prices_Customer.php:283 +#: Prices.php:227 PurchData.php:202 SalesCategories.php:263 #: SalesGLPostings.php:135 SalesGLPostings.php:247 SalesPeople.php:210 -#: SalesTypes.php:206 SelectCustomer.php:610 SelectCustomer.php:626 -#: SelectCustomer.php:648 SelectCustomer.php:664 SelectCustomer.php:686 -#: SelectCustomer.php:702 Shippers.php:144 StockCategories.php:244 -#: SupplierContacts.php:153 SupplierTypes.php:192 SuppLoginSetup.php:274 +#: SalesTypes.php:206 SelectCustomer.php:607 SelectCustomer.php:623 +#: SelectCustomer.php:645 SelectCustomer.php:661 SelectCustomer.php:683 +#: SelectCustomer.php:699 Shippers.php:144 StockCategories.php:244 +#: SupplierContacts.php:156 SupplierTypes.php:192 SuppLoginSetup.php:274 #: TaxAuthorities.php:173 TaxCategories.php:184 TaxGroups.php:179 -#: TaxProvinces.php:178 UnitsOfMeasure.php:187 WorkCentres.php:138 -#: WWW_Access.php:127 WWW_Users.php:307 includes/InputSerialItems.php:88 -#: includes/OutputSerialItems.php:21 +#: TaxProvinces.php:178 UnitsOfMeasure.php:201 WorkCentres.php:138 +#: WWW_Access.php:127 WWW_Users.php:312 includes/InputSerialItems.php:88 #, php-format msgid "Edit" msgstr "ویرایش" @@ -356,32 +357,31 @@ #: AccountGroups.php:266 AccountSections.php:201 AddCustomerContacts.php:132 #: AddCustomerNotes.php:126 AddCustomerTypeNotes.php:124 Areas.php:166 #: BankAccounts.php:227 BOMs.php:152 COGSGLPostings.php:114 -#: COGSGLPostings.php:216 ContractBOM.php:272 ContractOtherReqts.php:121 -#: CounterSales.php:781 Credit_Invoice.php:385 CreditStatus.php:176 -#: Currencies.php:242 CustLoginSetup.php:313 CustomerReceipt.php:863 -#: Customers.php:932 CustomerTypes.php:206 DiscountCategories.php:204 -#: DiscountMatrix.php:178 EDIMessageFormat.php:151 -#: FixedAssetCategories.php:182 FreightCosts.php:244 GeocodeSetup.php:170 -#: GLAccounts.php:320 GLJournal.php:385 Labels.php:414 Locations.php:381 +#: COGSGLPostings.php:219 ContractBOM.php:272 ContractOtherReqts.php:121 +#: CounterSales.php:741 Credit_Invoice.php:386 CreditStatus.php:176 +#: Currencies.php:242 CustLoginSetup.php:313 CustomerReceipt.php:866 +#: Customers.php:942 CustomerTypes.php:206 DiscountCategories.php:204 +#: DiscountMatrix.php:178 EDIMessageFormat.php:153 +#: FixedAssetCategories.php:183 FreightCosts.php:244 GeocodeSetup.php:170 +#: GLAccounts.php:320 GLJournal.php:403 Labels.php:414 Locations.php:383 #: MRPDemands.php:305 MRPDemandTypes.php:123 PaymentMethods.php:206 -#: Payments.php:959 PaymentTerms.php:204 PcAssignCashToTab.php:255 -#: PcClaimExpensesFromTab.php:230 PcExpenses.php:187 PcExpensesTypeTab.php:164 -#: PcTabs.php:189 PcTypeTabs.php:175 PO_AuthorisationLevels.php:150 -#: PO_Items.php:762 Prices_Customer.php:284 Prices.php:228 PurchData.php:208 +#: Payments.php:961 PaymentTerms.php:204 PcAssignCashToTab.php:255 +#: PcClaimExpensesFromTab.php:230 PcExpenses.php:177 PcExpensesTypeTab.php:161 +#: PcTabs.php:189 PcTypeTabs.php:172 PO_AuthorisationLevels.php:150 +#: PO_Items.php:976 Prices_Customer.php:284 Prices.php:228 PurchData.php:203 #: SalesAnalReptCols.php:294 SalesAnalRepts.php:305 SalesCategories.php:264 #: SalesGLPostings.php:136 SalesGLPostings.php:248 SalesPeople.php:211 -#: SalesTypes.php:207 SelectCreditItems.php:745 SelectCustomer.php:611 -#: SelectCustomer.php:627 SelectCustomer.php:649 SelectCustomer.php:665 -#: SelectCustomer.php:687 SelectCustomer.php:703 SelectOrderItems.php:1358 +#: SalesTypes.php:207 SelectCreditItems.php:747 SelectCustomer.php:608 +#: SelectCustomer.php:624 SelectCustomer.php:646 SelectCustomer.php:662 +#: SelectCustomer.php:684 SelectCustomer.php:700 SelectOrderItems.php:1363 #: Shipments.php:424 Shippers.php:145 SpecialOrder.php:590 #: StockCategories.php:245 StockCategories.php:539 SuppContractChgs.php:91 -#: SuppCreditGRNs.php:93 SuppFixedAssetChgs.php:81 SuppInvGRNs.php:135 -#: SupplierContacts.php:154 SupplierTypes.php:194 SuppLoginSetup.php:275 +#: SuppCreditGRNs.php:93 SuppFixedAssetChgs.php:87 SuppInvGRNs.php:135 +#: SupplierContacts.php:157 SupplierTypes.php:194 SuppLoginSetup.php:275 #: SuppShiptChgs.php:86 SuppTransGLAnalysis.php:111 TaxAuthorities.php:174 #: TaxCategories.php:185 TaxGroups.php:180 TaxProvinces.php:179 -#: UnitsOfMeasure.php:188 WorkCentres.php:139 WOSerialNos.php:300 -#: WWW_Access.php:128 WWW_Users.php:308 includes/InputSerialItemsKeyed.php:57 -#: includes/OutputSerialItems.php:98 +#: UnitsOfMeasure.php:202 WorkCentres.php:139 WOSerialNos.php:300 +#: WWW_Access.php:128 WWW_Users.php:313 includes/InputSerialItemsKeyed.php:54 #, php-format msgid "Delete" msgstr "حذف" @@ -425,23 +425,23 @@ #: AccountGroups.php:401 AccountSections.php:262 AddCustomerContacts.php:208 #: AddCustomerNotes.php:201 AddCustomerTypeNotes.php:192 Areas.php:222 -#: BankAccounts.php:373 BOMs.php:725 COGSGLPostings.php:353 +#: BankAccounts.php:373 BOMs.php:725 COGSGLPostings.php:347 #: CreditStatus.php:247 Currencies.php:339 CustLoginSetup.php:611 -#: DiscountMatrix.php:141 EDIMessageFormat.php:247 -#: FixedAssetCategories.php:327 FixedAssetLocations.php:148 +#: DiscountMatrix.php:141 EDIMessageFormat.php:249 +#: FixedAssetCategories.php:328 FixedAssetLocations.php:148 #: FreightCosts.php:342 GeocodeSetup.php:266 GLAccounts.php:269 -#: Locations.php:558 MRPDemands.php:402 MRPDemandTypes.php:182 +#: Locations.php:553 MRPDemands.php:402 MRPDemandTypes.php:182 #: OffersReceived.php:52 OffersReceived.php:128 PaymentMethods.php:276 #: PaymentTerms.php:282 PO_AuthorisationLevels.php:217 Prices_Customer.php:372 #: SalesAnalReptCols.php:510 SalesAnalRepts.php:496 SalesGLPostings.php:415 #: SalesPeople.php:302 Shippers.php:196 StockCategories.php:561 -#: SupplierContacts.php:250 SuppLoginSetup.php:532 TaxAuthorities.php:313 -#: TaxCategories.php:235 TaxProvinces.php:229 UnitsOfMeasure.php:239 -#: WorkCentres.php:261 WWW_Users.php:638 +#: SupplierContacts.php:251 SuppLoginSetup.php:532 TaxAuthorities.php:313 +#: TaxCategories.php:235 TaxProvinces.php:229 UnitsOfMeasure.php:253 +#: WorkCentres.php:261 WWW_Users.php:643 msgid "Enter Information" msgstr "ورود اطلاعات" -#: AccountSections.php:9 index.php:1282 +#: AccountSections.php:9 index.php:1278 msgid "Account Sections" msgstr "بخش ها حساب کاربری" @@ -501,8 +501,8 @@ msgid "Could not retrieve the requested section please try again." msgstr "نمی توان بازیابی بخش های درخواست شده لطفا دوباره سعی کنید." -#: AddCustomerContacts.php:6 AddCustomerContacts.php:59 SelectCustomer.php:604 -#: SelectCustomer.php:633 +#: AddCustomerContacts.php:6 AddCustomerContacts.php:59 SelectCustomer.php:601 +#: SelectCustomer.php:630 msgid "Customer Contacts" msgstr "تماس با ما مشتریان" @@ -533,10 +533,10 @@ #: AddCustomerContacts.php:59 AddCustomerNotes.php:49 #: AddCustomerTypeNotes.php:49 Areas.php:74 CustomerTypes.php:71 -#: DeliveryDetails.php:748 Factors.php:117 FixedAssetItems.php:236 -#: PcAssignCashToTab.php:73 PcClaimExpensesFromTab.php:61 PcExpenses.php:70 -#: PcTabs.php:60 PcTypeTabs.php:62 PO_Items.php:411 SalesAnalReptCols.php:129 -#: SalesPeople.php:94 SalesTypes.php:63 Stocks.php:353 Suppliers.php:514 +#: DeliveryDetails.php:748 Factors.php:117 FixedAssetItems.php:230 +#: PcAssignCashToTab.php:73 PcClaimExpensesFromTab.php:61 PcExpenses.php:60 +#: PcTabs.php:60 PcTypeTabs.php:59 PO_Items.php:381 SalesAnalReptCols.php:129 +#: SalesPeople.php:94 SalesTypes.php:63 Stocks.php:355 Suppliers.php:514 #: SupplierTypes.php:69 msgid "has been updated" msgstr "به روز شده است" @@ -549,31 +549,31 @@ msgid "The contact record has been deleted" msgstr "تماس با سابقه حذف شده است" -#: AddCustomerContacts.php:112 CompanyPreferences.php:224 -#: CustomerBranches.php:377 Customers.php:889 Customers.php:895 -#: Customers.php:961 SalesPeople.php:185 SelectCustomer.php:606 -#: StockDispatch.php:186 StockDispatch.php:198 SupplierContacts.php:141 -#: SupplierCredit.php:437 SupplierInvoice.php:408 SuppTransGLAnalysis.php:96 +#: AddCustomerContacts.php:112 CompanyPreferences.php:229 +#: CustomerBranches.php:377 Customers.php:899 Customers.php:905 +#: Customers.php:971 SalesPeople.php:185 SelectCustomer.php:603 +#: StockDispatch.php:186 StockDispatch.php:198 SupplierContacts.php:144 +#: SupplierCredit.php:433 SupplierInvoice.php:407 SuppTransGLAnalysis.php:96 #: includes/InputSerialItemsFile.php:84 includes/InputSerialItemsFile.php:124 #: includes/PDFTaxPageHeader.inc:37 msgid "Name" msgstr "نام" -#: AddCustomerContacts.php:113 AddCustomerContacts.php:190 Customers.php:890 -#: Customers.php:896 Customers.php:962 SelectCustomer.php:607 +#: AddCustomerContacts.php:113 AddCustomerContacts.php:190 Customers.php:900 +#: Customers.php:906 Customers.php:972 SelectCustomer.php:604 #: WWW_Access.php:111 WWW_Access.php:172 msgid "Role" msgstr "نقش" -#: AddCustomerContacts.php:114 Customers.php:963 +#: AddCustomerContacts.php:114 Customers.php:973 msgid "Phone no" msgstr "تلفن" -#: AddCustomerContacts.php:115 AddCustomerContacts.php:202 Customers.php:892 -#: Customers.php:898 Customers.php:964 PcAssignCashToTab.php:216 +#: AddCustomerContacts.php:115 AddCustomerContacts.php:202 Customers.php:902 +#: Customers.php:908 Customers.php:974 PcAssignCashToTab.php:216 #: PcAssignCashToTab.php:341 PcAuthorizeExpenses.php:85 #: PcClaimExpensesFromTab.php:195 PcClaimExpensesFromTab.php:348 -#: PcReportTab.php:348 SelectCustomer.php:609 SystemParameters.php:316 +#: PcReportTab.php:348 SelectCustomer.php:606 SystemParameters.php:313 #: WOSerialNos.php:277 WOSerialNos.php:279 msgid "Notes" msgstr "یادداشت ها" @@ -586,20 +586,20 @@ msgid "Contact Code" msgstr "تماس با کد" -#: AddCustomerContacts.php:184 Factors.php:279 SupplierContacts.php:218 +#: AddCustomerContacts.php:184 Factors.php:279 SupplierContacts.php:219 msgid "Contact Name" msgstr "نام تماس با ما" -#: AddCustomerContacts.php:196 Contracts.php:777 PDFRemittanceAdvice.php:247 -#: PO_Header.php:956 PO_Header.php:1026 SelectCreditItems.php:223 -#: SelectCustomer.php:464 SelectOrderItems.php:639 -#: includes/PDFStatementPageHeader.inc:63 includes/PDFTransPageHeader.inc:117 +#: AddCustomerContacts.php:196 Contracts.php:766 PDFRemittanceAdvice.php:247 +#: PO_Header.php:958 PO_Header.php:1028 SelectCreditItems.php:225 +#: SelectCustomer.php:461 SelectOrderItems.php:638 +#: includes/PDFStatementPageHeader.inc:63 includes/PDFTransPageHeader.inc:113 #: includes/PDFTransPageHeaderPortrait.inc:105 msgid "Phone" msgstr "تلفن" -#: AddCustomerNotes.php:6 AddCustomerNotes.php:49 SelectCustomer.php:641 -#: SelectCustomer.php:671 +#: AddCustomerNotes.php:6 AddCustomerNotes.php:49 SelectCustomer.php:638 +#: SelectCustomer.php:668 msgid "Customer Notes" msgstr "مشتری یادداشت ها" @@ -640,29 +640,28 @@ #: GLAccountReport.php:369 GLTransInquiry.php:45 MRPCalendar.php:217 #: PaymentAllocations.php:77 PcAssignCashToTab.php:212 #: PcAuthorizeExpenses.php:81 PDFRemittanceAdvice.php:308 -#: PrintCustTrans.php:616 PrintCustTransPortrait.php:790 ReverseGRN.php:378 +#: PrintCustTrans.php:678 PrintCustTransPortrait.php:860 ReverseGRN.php:378 #: ShipmentCosting.php:503 ShipmentCosting.php:574 Shipments.php:467 #: StockDispatch.php:188 StockDispatch.php:200 StockLocMovements.php:85 #: StockMovements.php:98 StockSerialItemResearch.php:79 #: SupplierAllocations.php:464 SupplierAllocations.php:576 #: SupplierAllocations.php:646 SupplierInquiry.php:195 #: SupplierTransInquiry.php:89 includes/PDFQuotationPageHeader.inc:91 -#: includes/PDFQuotationPortraitPageHeader.inc:90 #: includes/PDFStatementPageHeader.inc:169 includes/PDFTaxPageHeader.inc:36 -#: includes/PDFTransPageHeader.inc:84 +#: includes/PDFTransPageHeader.inc:80 #: includes/PDFTransPageHeaderPortrait.inc:58 msgid "Date" msgstr "تاریخ" #: AddCustomerNotes.php:107 AddCustomerTypeNotes.php:105 PcReportTab.php:176 -#: Stocks.php:873 UpgradeDatabase.php:147 UpgradeDatabase.php:150 -#: UpgradeDatabase.php:153 UpgradeDatabase.php:156 UpgradeDatabase.php:159 -#: UpgradeDatabase.php:162 UpgradeDatabase.php:165 UpgradeDatabase.php:168 -#: Z_Upgrade_3.10-3.11.php:62 Z_Upgrade_3.10-3.11.php:66 -#: Z_Upgrade_3.10-3.11.php:70 Z_Upgrade_3.10-3.11.php:74 -#: Z_Upgrade_3.10-3.11.php:78 Z_Upgrade_3.11-4.00.php:62 -#: Z_Upgrade_3.11-4.00.php:66 Z_Upgrade_3.11-4.00.php:70 -#: Z_Upgrade_3.11-4.00.php:74 Z_Upgrade_3.11-4.00.php:78 +#: Stocks.php:871 UpgradeDatabase.php:145 UpgradeDatabase.php:148 +#: UpgradeDatabase.php:151 UpgradeDatabase.php:154 UpgradeDatabase.php:157 +#: UpgradeDatabase.php:160 UpgradeDatabase.php:163 Z_Upgrade_3.10-3.11.php:62 +#: Z_Upgrade_3.10-3.11.php:66 Z_Upgrade_3.10-3.11.php:70 +#: Z_Upgrade_3.10-3.11.php:74 Z_Upgrade_3.10-3.11.php:78 +#: Z_Upgrade_3.11-4.00.php:62 Z_Upgrade_3.11-4.00.php:66 +#: Z_Upgrade_3.11-4.00.php:70 Z_Upgrade_3.11-4.00.php:74 +#: Z_Upgrade_3.11-4.00.php:78 msgid "Note" msgstr "یادداشت" @@ -687,7 +686,7 @@ msgid "Contact Note" msgstr "تماس با تبصره" -#: AddCustomerTypeNotes.php:6 SelectCustomer.php:679 +#: AddCustomerTypeNotes.php:6 SelectCustomer.php:676 msgid "Customer Type (Group) Notes" msgstr "نوع مشتری (گروه) یادداشت ها" @@ -695,7 +694,7 @@ msgid "The Contact priority must be an integer." msgstr "تماس با اولویت باید یک عدد صحیح باشد." -#: AddCustomerTypeNotes.php:49 SelectCustomer.php:709 +#: AddCustomerTypeNotes.php:49 SelectCustomer.php:706 msgid "Customer Group Notes" msgstr "یادداشت های مشتریان گروه" @@ -740,26 +739,26 @@ msgstr "سالمندان مشتریان تجزیه و تحلیل حساب کاربری" #: AgedDebtors.php:267 AgedDebtors.php:365 AgedDebtors.php:436 -#: AgedSuppliers.php:105 BOMExtendedQty.php:159 BOMIndented.php:150 -#: BOMIndentedReverse.php:151 BOMListing.php:48 BOMListing.php:59 +#: AgedSuppliers.php:105 BOMExtendedQty.php:156 BOMIndented.php:149 +#: BOMIndentedReverse.php:148 BOMListing.php:48 BOMListing.php:59 #: DebtorsAtPeriodEnd.php:58 DebtorsAtPeriodEnd.php:70 GLBalanceSheet.php:90 #: GLBalanceSheet.php:128 GLProfit_Loss.php:157 GLTagProfit_Loss.php:174 #: GLTrialBalance.php:151 InventoryPlanning.php:99 InventoryPlanning.php:174 -#: InventoryPlanning.php:209 InventoryPlanning.php:257 -#: InventoryPlanning.php:295 InventoryPlanningPrefSupplier.php:208 +#: InventoryPlanning.php:209 InventoryPlanning.php:252 +#: InventoryPlanning.php:290 InventoryPlanningPrefSupplier.php:208 #: InventoryPlanningPrefSupplier.php:276 InventoryPlanningPrefSupplier.php:310 -#: InventoryPlanningPrefSupplier.php:355 InventoryPlanningPrefSupplier.php:401 +#: InventoryPlanningPrefSupplier.php:353 InventoryPlanningPrefSupplier.php:401 #: InventoryQuantities.php:83 InventoryValuation.php:76 -#: MailInventoryValuation.php:115 MRPPlannedPurchaseOrders.php:114 +#: MailInventoryValuation.php:115 MRPPlannedPurchaseOrders.php:111 #: MRPPlannedWorkOrders.php:105 MRPReport.php:147 MRPReport.php:529 -#: MRPReschedules.php:46 MRPReschedules.php:58 MRPShortages.php:145 -#: MRPShortages.php:157 OutstandingGRNs.php:51 OutstandingGRNs.php:63 +#: MRPReschedules.php:46 MRPReschedules.php:58 MRPShortages.php:137 +#: MRPShortages.php:149 OutstandingGRNs.php:51 OutstandingGRNs.php:63 #: PDFCustomerList.php:20 PDFCustomerList.php:232 PDFCustomerList.php:244 #: PDFLowGP.php:23 PDFStockCheckComparison.php:35 #: PDFStockCheckComparison.php:61 PDFStockCheckComparison.php:262 #: ReorderLevel.php:59 SelectAsset.php:36 SelectProduct.php:37 #: StockCheck.php:65 StockCheck.php:139 SupplierTenders.php:325 -#: SuppPriceList.php:118 includes/PDFPaymentRun_PymtFooter.php:149 +#: SuppPriceList.php:118 includes/PDFPaymentRun_PymtFooter.php:148 msgid "Problem Report" msgstr "گزارش مشکل" @@ -769,38 +768,38 @@ msgstr "جزئیات مشتری می تواند با گذاشتن زیرا قابل بازیابی نیست" #: AgedDebtors.php:270 AgedDebtors.php:368 AgedDebtors.php:442 -#: AgedSuppliers.php:108 AgedSuppliers.php:190 BOMExtendedQty.php:162 -#: BOMExtendedQty.php:259 BOMIndented.php:153 BOMIndented.php:239 -#: BOMIndentedReverse.php:154 BOMIndentedReverse.php:232 BOMListing.php:51 -#: Credit_Invoice.php:185 DebtorsAtPeriodEnd.php:61 DebtorsAtPeriodEnd.php:73 +#: AgedSuppliers.php:108 AgedSuppliers.php:190 BOMExtendedQty.php:159 +#: BOMExtendedQty.php:263 BOMIndented.php:152 BOMIndented.php:238 +#: BOMIndentedReverse.php:151 BOMIndentedReverse.php:235 BOMListing.php:51 +#: Credit_Invoice.php:186 DebtorsAtPeriodEnd.php:61 DebtorsAtPeriodEnd.php:73 #: FTP_RadioBeacon.php:188 GetStockImage.php:154 GLBalanceSheet.php:93 #: GLBalanceSheet.php:131 GLBalanceSheet.php:294 GLProfit_Loss.php:160 #: GLProfit_Loss.php:172 GLTagProfit_Loss.php:177 GLTagProfit_Loss.php:189 #: GLTrialBalance.php:154 GLTrialBalance.php:166 InventoryPlanning.php:102 #: InventoryPlanning.php:177 InventoryPlanning.php:212 -#: InventoryPlanning.php:260 InventoryPlanning.php:298 -#: InventoryPlanning.php:361 InventoryPlanningPrefSupplier.php:211 +#: InventoryPlanning.php:255 InventoryPlanning.php:293 +#: InventoryPlanning.php:356 InventoryPlanningPrefSupplier.php:211 #: InventoryPlanningPrefSupplier.php:279 InventoryPlanningPrefSupplier.php:313 -#: InventoryPlanningPrefSupplier.php:358 InventoryPlanningPrefSupplier.php:404 +#: InventoryPlanningPrefSupplier.php:356 InventoryPlanningPrefSupplier.php:404 #: InventoryPlanningPrefSupplier.php:460 InventoryQuantities.php:86 #: InventoryQuantities.php:97 InventoryValuation.php:79 #: InventoryValuation.php:90 MailInventoryValuation.php:118 -#: MailInventoryValuation.php:214 MRPPlannedPurchaseOrders.php:117 -#: MRPPlannedPurchaseOrders.php:128 MRPPlannedWorkOrders.php:108 +#: MailInventoryValuation.php:214 MRPPlannedPurchaseOrders.php:114 +#: MRPPlannedPurchaseOrders.php:125 MRPPlannedWorkOrders.php:108 #: MRPPlannedWorkOrders.php:119 MRPPlannedWorkOrders.php:318 MRPReport.php:41 #: MRPReport.php:52 MRPReport.php:150 MRPReschedules.php:49 -#: MRPReschedules.php:61 MRPShortages.php:148 MRPShortages.php:160 +#: MRPReschedules.php:61 MRPShortages.php:140 MRPShortages.php:152 #: OutstandingGRNs.php:54 OutstandingGRNs.php:66 PcReportTab.php:236 -#: PDFCustomerList.php:235 PDFCustomerList.php:247 PDFGrn.php:123 -#: PDFLowGP.php:63 PDFLowGP.php:75 PDFPriceList.php:124 PDFQuotation.php:234 -#: PDFQuotationPortrait.php:235 PDFRemittanceAdvice.php:84 -#: PDFStockCheckComparison.php:39 PDFStockCheckComparison.php:65 -#: PDFStockCheckComparison.php:266 PDFTopItems.php:118 PO_PDFPurchOrder.php:30 -#: PO_PDFPurchOrder.php:144 PrintCustOrder_generic.php:180 -#: PrintCustOrder.php:198 ReorderLevel.php:62 ReorderLevel.php:151 -#: SalesAnalysis_UserDefined.php:28 SelectCreditItems.php:23 StockCheck.php:47 +#: PDFCustomerList.php:235 PDFCustomerList.php:247 PDFGrn.php:147 +#: PDFLowGP.php:63 PDFLowGP.php:75 PDFPriceList.php:124 PDFQuotation.php:237 +#: PDFRemittanceAdvice.php:84 PDFStockCheckComparison.php:39 +#: PDFStockCheckComparison.php:65 PDFStockCheckComparison.php:266 +#: PDFTopItems.php:123 PO_PDFPurchOrder.php:21 PO_PDFPurchOrder.php:131 +#: PrintCustOrder_generic.php:182 PrintCustOrder.php:198 +#: PrintSalesOrder_generic.php:183 ReorderLevel.php:62 ReorderLevel.php:151 +#: SalesAnalysis_UserDefined.php:28 SelectCreditItems.php:25 StockCheck.php:47 #: StockCheck.php:68 StockCheck.php:98 StockCheck.php:142 StockCheck.php:153 -#: StockCheck.php:195 StockDispatch.php:93 StockDispatch.php:105 +#: StockCheck.php:194 StockDispatch.php:93 StockDispatch.php:105 #: SupplierBalsAtPeriodEnd.php:57 SupplierBalsAtPeriodEnd.php:68 #: SuppPaymentRun.php:109 SuppPaymentRun.php:120 SuppPaymentRun.php:184 #: SuppPaymentRun.php:214 SuppPriceList.php:121 Tax.php:64 Tax.php:177 @@ -808,11 +807,11 @@ #: Z_DataExport.php:309 Z_DataExport.php:348 Z_DataExport.php:384 #: Z_DataExport.php:420 Z_DataExport.php:472 Z_poRebuildDefault.php:38 #: includes/PDFPaymentRun_PymtFooter.php:57 -#: includes/PDFPaymentRun_PymtFooter.php:87 -#: includes/PDFPaymentRun_PymtFooter.php:116 -#: includes/PDFPaymentRun_PymtFooter.php:152 -#: includes/PDFPaymentRun_PymtFooter.php:183 -#: includes/PDFPaymentRun_PymtFooter.php:215 +#: includes/PDFPaymentRun_PymtFooter.php:86 +#: includes/PDFPaymentRun_PymtFooter.php:115 +#: includes/PDFPaymentRun_PymtFooter.php:151 +#: includes/PDFPaymentRun_PymtFooter.php:182 +#: includes/PDFPaymentRun_PymtFooter.php:214 #: includes/ConstructSQLForUserDefinedSalesReport.inc:180 #: includes/ConstructSQLForUserDefinedSalesReport.inc:188 #: includes/ConstructSQLForUserDefinedSalesReport.inc:340 @@ -823,39 +822,39 @@ msgid "The details of outstanding transactions for customer" msgstr "جزئیات معاملات برجسته برای مشتری" -#: AgedDebtors.php:367 AgedSuppliers.php:189 GLAccountCSV.php:167 -#: GLAccountInquiry.php:145 GLAccountReport.php:93 PO_Items.php:471 -#: PO_Items.php:605 PO_Items.php:632 SalesAnalReptCols.php:356 -#: SpecialOrder.php:369 StockLocTransferReceive.php:373 -#: StockQuantityByDate.php:114 includes/SelectOrderItems_IntoCart.inc:53 +#: AgedDebtors.php:367 AgedSuppliers.php:189 GLAccountCSV.php:169 +#: GLAccountInquiry.php:145 GLAccountReport.php:93 PO_Items.php:532 +#: PO_Items.php:562 PO_Items.php:640 PO_Items.php:803 +#: SalesAnalReptCols.php:356 SpecialOrder.php:369 +#: StockLocTransferReceive.php:373 StockQuantityByDate.php:106 +#: includes/SelectOrderItems_IntoCart.inc:53 msgid "could not be retrieved because" msgstr "قابل بازیابی نیست زیرا" #: AgedDebtors.php:370 AgedSuppliers.php:192 Areas.php:96 -#: ConfirmDispatch_Invoice.php:152 ConfirmDispatch_Invoice.php:969 -#: ConfirmDispatch_Invoice.php:983 Contracts.php:581 CounterSales.php:1323 -#: CounterSales.php:1337 Credit_Invoice.php:706 Credit_Invoice.php:728 -#: CustomerReceipt.php:523 CustomerReceipt.php:655 CustomerReceipt.php:683 +#: ConfirmDispatch_Invoice.php:155 ConfirmDispatch_Invoice.php:962 +#: ConfirmDispatch_Invoice.php:976 Contracts.php:583 CounterSales.php:1280 +#: CounterSales.php:1294 Credit_Invoice.php:707 Credit_Invoice.php:729 +#: CustomerReceipt.php:526 CustomerReceipt.php:658 CustomerReceipt.php:686 #: CustomerTransInquiry.php:79 DeliveryDetails.php:395 GLProfit_Loss.php:578 -#: GLTagProfit_Loss.php:490 Payments.php:308 PDFRemittanceAdvice.php:86 -#: PurchData.php:89 PurchData.php:108 PurchData.php:244 ReverseGRN.php:191 -#: ReverseGRN.php:205 ReverseGRN.php:366 SelectCreditItems.php:1381 -#: SelectSalesOrder.php:113 SelectSalesOrder.php:281 StockCheck.php:225 -#: StockCostUpdate.php:79 StockCostUpdate.php:89 StockLocStatus.php:142 -#: StockMovements.php:92 StockQuantityByDate.php:90 StockReorderLevel.php:39 -#: StockStatus.php:271 StockTransfers.php:159 StockUsageGraph.php:53 -#: StockUsage.php:132 SupplierInquiry.php:79 SupplierInquiry.php:101 -#: SupplierInquiry.php:131 SupplierInquiry.php:177 SupplierTransInquiry.php:81 -#: SuppPaymentRun.php:111 SuppPaymentRun.php:186 SuppPaymentRun.php:216 -#: WorkOrderCosting.php:393 WorkOrderReceive.php:272 WOSerialNos.php:44 -#: Z_ChangeBranchCode.php:108 Z_ChangeCustomerCode.php:92 +#: GLTagProfit_Loss.php:490 Payments.php:307 PDFRemittanceAdvice.php:86 +#: PurchData.php:89 PurchData.php:108 PurchData.php:219 ReverseGRN.php:191 +#: ReverseGRN.php:205 ReverseGRN.php:366 SelectCreditItems.php:1383 +#: StockCheck.php:224 StockCostUpdate.php:79 StockCostUpdate.php:89 +#: StockLocStatus.php:142 StockMovements.php:92 StockQuantityByDate.php:82 +#: StockReorderLevel.php:39 StockStatus.php:271 StockTransfers.php:159 +#: StockUsageGraph.php:53 StockUsage.php:127 SupplierInquiry.php:79 +#: SupplierInquiry.php:101 SupplierInquiry.php:131 SupplierInquiry.php:177 +#: SupplierTransInquiry.php:81 SuppPaymentRun.php:111 SuppPaymentRun.php:186 +#: SuppPaymentRun.php:216 WorkOrderCosting.php:393 WorkOrderReceive.php:272 +#: WOSerialNos.php:44 Z_ChangeBranchCode.php:108 Z_ChangeCustomerCode.php:90 #: Z_DeleteCreditNote.php:57 Z_DeleteInvoice.php:83 #: includes/PDFPaymentRun_PymtFooter.php:59 -#: includes/PDFPaymentRun_PymtFooter.php:89 -#: includes/PDFPaymentRun_PymtFooter.php:118 -#: includes/PDFPaymentRun_PymtFooter.php:154 -#: includes/PDFPaymentRun_PymtFooter.php:185 includes/ConnectDB_mysqli.inc:79 -#: includes/ConnectDB_mysql.inc:64 +#: includes/PDFPaymentRun_PymtFooter.php:88 +#: includes/PDFPaymentRun_PymtFooter.php:117 +#: includes/PDFPaymentRun_PymtFooter.php:153 +#: includes/PDFPaymentRun_PymtFooter.php:184 includes/ConnectDB_mysqli.inc:83 +#: includes/ConnectDB_mysql.inc:65 msgid "The SQL that failed was" msgstr "گذاشتن که شکست خورده بود" @@ -911,17 +910,17 @@ msgid "Detailed Report" msgstr "جزئیات گزارش" -#: AgedDebtors.php:520 AgedSuppliers.php:320 BOMExtendedQty.php:286 -#: BOMIndented.php:268 BOMIndentedReverse.php:255 BOMListing.php:142 -#: DebtorsAtPeriodEnd.php:166 InventoryPlanning.php:442 +#: AgedDebtors.php:520 AgedSuppliers.php:320 BOMExtendedQty.php:300 +#: BOMIndented.php:278 BOMIndentedReverse.php:266 BOMListing.php:142 +#: DebtorsAtPeriodEnd.php:166 InventoryPlanning.php:437 #: InventoryPlanningPrefSupplier.php:518 InventoryQuantities.php:188 -#: InventoryValuation.php:242 MRPPlannedPurchaseOrders.php:282 -#: MRPPlannedWorkOrders.php:344 MRPReschedules.php:166 MRPShortages.php:259 +#: InventoryValuation.php:242 MRPPlannedPurchaseOrders.php:279 +#: MRPPlannedWorkOrders.php:344 MRPReschedules.php:166 MRPShortages.php:262 #: OutstandingGRNs.php:185 PDFCustomerList.php:412 PDFLowGP.php:168 #: PDFPriceList.php:301 PDFRemittanceAdvice.php:152 -#: PDFStockCheckComparison.php:379 PrintCustTrans.php:416 -#: PrintCustTransPortrait.php:560 ReorderLevel.php:229 StockDispatch.php:309 -#: SupplierBalsAtPeriodEnd.php:155 SuppPriceList.php:228 Tax.php:352 +#: PDFStockCheckComparison.php:379 PrintCustTrans.php:478 +#: PrintCustTransPortrait.php:630 ReorderLevel.php:229 StockDispatch.php:309 +#: SupplierBalsAtPeriodEnd.php:155 SuppPriceList.php:237 Tax.php:352 msgid "Print PDF" msgstr "پی دی اف نسخه قابل چاپ" @@ -1044,10 +1043,10 @@ msgstr "کد شهر" #: Areas.php:133 CustomerTypes.php:166 Factors.php:142 -#: FixedAssetCategories.php:136 GLAccounts.php:208 Locations.php:328 +#: FixedAssetCategories.php:137 GLAccounts.php:208 Locations.php:328 #: MRPDemands.php:248 PcAssignCashToTab.php:118 PcClaimExpensesFromTab.php:109 -#: PcExpenses.php:137 PcExpensesTypeTab.php:86 PcTabs.php:124 -#: PcTypeTabs.php:137 SalesAnalReptCols.php:215 SalesCategories.php:139 +#: PcExpenses.php:127 PcExpensesTypeTab.php:83 PcTabs.php:124 +#: PcTypeTabs.php:134 SalesAnalReptCols.php:215 SalesCategories.php:139 #: SalesTypes.php:163 StockCategories.php:199 Suppliers.php:639 #: SupplierTypes.php:153 Z_DeleteInvoice.php:142 msgid "has been deleted" @@ -1073,19 +1072,19 @@ msgid "Incorrect date format used, please re-enter" msgstr "اشتباه فرمت تاریخ استفاده می شود ، لطفا دوباره وارد کنید" -#: AuditTrail.php:37 BOMIndented.php:307 BOMIndentedReverse.php:294 +#: AuditTrail.php:37 BOMIndented.php:317 BOMIndentedReverse.php:305 #: MRPCalendar.php:260 msgid "From Date" msgstr "از تاریخ" -#: AuditTrail.php:39 BOMIndented.php:308 BOMIndentedReverse.php:295 +#: AuditTrail.php:39 BOMIndented.php:318 BOMIndentedReverse.php:306 #: MRPCalendar.php:262 msgid "To Date" msgstr "تا تاریخ" #: AuditTrail.php:43 PO_AuthorisationLevels.php:123 #: PO_AuthorisationLevels.php:160 PO_AuthorisationLevels.php:163 -#: UserSettings.php:109 +#: UserSettings.php:111 msgid "User ID" msgstr "شناسه کاربر" @@ -1093,8 +1092,8 @@ msgid "Table " msgstr "جدول " -#: AuditTrail.php:68 MRPReport.php:789 PO_SelectPurchOrder.php:363 -#: SelectContract.php:196 SelectProduct.php:727 +#: AuditTrail.php:68 MRPReport.php:789 PO_SelectPurchOrder.php:357 +#: SelectContract.php:196 SelectProduct.php:710 msgid "View" msgstr "نمایش" @@ -1109,9 +1108,9 @@ #: AuditTrail.php:146 BankReconciliation.php:185 BankReconciliation.php:257 #: CustomerAllocations.php:356 CustomerInquiry.php:189 #: CustomerTransInquiry.php:21 CustomerTransInquiry.php:85 -#: CustWhereAlloc.php:18 CustWhereAlloc.php:87 DailyBankTransactions.php:99 -#: GLAccountInquiry.php:152 GLAccountReport.php:367 GLJournal.php:241 -#: MRPReschedules.php:204 SelectCustomer.php:463 ShipmentCosting.php:501 +#: CustWhereAlloc.php:18 CustWhereAlloc.php:87 DailyBankTransactions.php:79 +#: GLAccountInquiry.php:152 GLAccountReport.php:367 GLJournal.php:256 +#: MRPReschedules.php:204 SelectCustomer.php:460 ShipmentCosting.php:501 #: ShipmentCosting.php:572 StockCategories.php:219 StockLocMovements.php:83 #: StockMovements.php:97 SupplierAllocations.php:462 SupplierInquiry.php:193 #: SupplierTransInquiry.php:19 SupplierTransInquiry.php:86 @@ -1131,7 +1130,7 @@ msgid "Field Name" msgstr "نام فیلد" -#: AuditTrail.php:149 SystemParameters.php:315 +#: AuditTrail.php:149 SystemParameters.php:312 #: includes/PDFInventoryValnPageHeader.inc:38 #: includes/PDFOstdgGRNsPageHeader.inc:43 msgid "Value" @@ -1227,7 +1226,7 @@ msgid "The SQL used to retrieve the bank account details was" msgstr "گذاشتن استفاده برای بازیابی جزئیات حساب بانکی بود" -#: BankAccounts.php:196 GLJournal.php:265 +#: BankAccounts.php:196 GLJournal.php:280 msgid "GL Account Code" msgstr "گرم در کد حساب کاربری" @@ -1247,16 +1246,16 @@ msgid "Bank Address" msgstr "بانک آدرس" -#: BankAccounts.php:201 CustomerReceipt.php:753 CustomerTransInquiry.php:95 +#: BankAccounts.php:201 CustomerReceipt.php:756 CustomerTransInquiry.php:95 #: OffersReceived.php:98 PcReportTab.php:291 PcTabs.php:147 PcTabs.php:295 #: PDFPrintLabel.php:94 PO_AuthorisationLevels.php:125 #: PO_AuthorisationLevels.php:180 PO_AuthorisationLevels.php:183 #: PO_AuthoriseMyOrders.php:107 PO_Header.php:534 -#: PO_SelectOSPurchOrder.php:444 PO_SelectPurchOrder.php:365 -#: PricesByCost.php:239 Prices.php:198 Prices.php:293 PurchData.php:172 -#: PurchData.php:340 PurchData.php:453 SelectSupplier.php:251 -#: SupplierCredit.php:268 SupplierInvoice.php:232 SupplierTransInquiry.php:95 -#: SuppPriceList.php:265 includes/PDFBankingSummaryPageHeader.inc:42 +#: PO_SelectOSPurchOrder.php:444 PO_SelectPurchOrder.php:359 +#: PricesByCost.php:209 Prices.php:198 Prices.php:293 PurchData.php:168 +#: PurchData.php:315 PurchData.php:428 SelectSupplier.php:251 +#: SupplierCredit.php:264 SupplierInvoice.php:232 SupplierTransInquiry.php:95 +#: SuppPriceList.php:274 includes/PDFBankingSummaryPageHeader.inc:42 #: includes/PDFDebtorBalsPageHeader.inc:33 #: includes/PDFSupplierBalsPageHeader.inc:36 msgid "Currency" @@ -1336,38 +1335,38 @@ "با استفاده از این صفحه برای مطابقت با webERP رسید و پرداخت خود را به بانک " "بیانیه. بررسی صورت حساب بانکی خود و کلیک بر روی چک باکس که همه معامله منطبق." -#: BankMatching.php:80 BankReconciliation.php:97 CustomerReceipt.php:726 -#: DailyBankTransactions.php:28 Payments.php:733 PDFChequeListing.php:46 +#: BankMatching.php:80 BankReconciliation.php:97 CustomerReceipt.php:729 +#: DailyBankTransactions.php:28 Payments.php:732 PDFChequeListing.php:46 #: TaxAuthorities.php:150 TaxAuthorities.php:306 msgid "Bank Account" msgstr "حساب بانکی ما" -#: BankMatching.php:102 +#: BankMatching.php:102 PO_SelectOSPurchOrder.php:489 msgid "Show" msgstr "نمایش" #: BankMatching.php:102 CreditItemsControlled.php:78 FreightCosts.php:270 -#: GoodsReceivedControlled.php:65 GoodsReceived.php:67 +#: GoodsReceivedControlled.php:56 GoodsReceived.php:66 #: StockLocTransferReceive.php:426 SupplierAllocations.php:443 #: SuppShiptChgs.php:126 msgid "from" msgstr "از" #: BankMatching.php:105 ConfirmDispatchControlled_Invoice.php:59 -#: EmailCustTrans.php:65 FixedAssetRegister.php:78 FTP_RadioBeacon.php:281 -#: GLAccountCSV.php:170 GLAccountReport.php:102 Payments.php:713 -#: PcReportTab.php:105 PDFChequeListing.php:108 PDFChequeListing.php:118 -#: PDFChequeListing.php:205 PDFDeliveryDifferences.php:166 -#: PDFDeliveryDifferences.php:179 PDFDeliveryDifferences.php:287 -#: PDFDIFOT.php:172 PDFDIFOT.php:185 PDFDIFOT.php:289 PDFOrdersInvoiced.php:74 -#: PDFOrdersInvoiced.php:271 PDFOrderStatus.php:75 PDFOrderStatus.php:250 -#: PO_PDFPurchOrder.php:302 PricesBasedOnMarkUp.php:216 -#: PricesBasedOnMarkUp.php:355 PrintCustStatements.php:50 -#: PrintCustTrans.php:37 PrintCustTrans.php:40 PrintCustTransPortrait.php:60 +#: EmailCustTrans.php:65 FTP_RadioBeacon.php:281 GLAccountCSV.php:172 +#: GLAccountReport.php:102 Payments.php:712 PcReportTab.php:105 +#: PDFChequeListing.php:108 PDFChequeListing.php:118 PDFChequeListing.php:205 +#: PDFDeliveryDifferences.php:166 PDFDeliveryDifferences.php:179 +#: PDFDeliveryDifferences.php:287 PDFDIFOT.php:172 PDFDIFOT.php:185 +#: PDFDIFOT.php:289 PDFOrdersInvoiced.php:74 PDFOrdersInvoiced.php:271 +#: PDFOrderStatus.php:75 PDFOrderStatus.php:250 PO_PDFPurchOrder.php:313 +#: PricesBasedOnMarkUp.php:216 PricesBasedOnMarkUp.php:334 +#: PricesBasedOnMarkUp.php:350 PrintCustStatements.php:50 +#: PrintCustTrans.php:38 PrintCustTrans.php:41 PrintCustTransPortrait.php:60 #: PrintCustTransPortrait.php:63 SalesGraph.php:200 SalesGraph.php:229 #: SalesGraph.php:233 StockLocTransferReceive.php:310 -#: StockLocTransferReceive.php:426 Stocks.php:229 Stocks.php:234 -#: StockStatus.php:309 StockStatus.php:350 StockTransfers.php:397 +#: StockLocTransferReceive.php:426 Stocks.php:231 Stocks.php:236 +#: StockStatus.php:305 StockStatus.php:347 StockTransfers.php:397 #: includes/PDFAgedDebtorsPageHeader.inc:18 #: includes/PDFAgedSuppliersPageHeader.inc:17 #: includes/PDFChequeListingPageHeader.inc:17 @@ -1458,7 +1457,8 @@ msgstr "بعد" #: BankMatching.php:218 -msgid "The payments with the selected criteria could not be retrieved because" +msgid "" +"The payments with the selected criteria could not be retrieved because" msgstr "پرداخت با معیار های انتخاب قابل بازیابی نیست زیرا" #: BankMatching.php:221 ShipmentCosting.php:502 ShipmentCosting.php:573 @@ -1466,19 +1466,19 @@ msgid "Ref" msgstr "کد عکس" -#: BankMatching.php:224 ConfirmDispatch_Invoice.php:279 Credit_Invoice.php:280 -#: CustomerAllocations.php:359 CustomerReceipt.php:842 +#: BankMatching.php:224 ConfirmDispatch_Invoice.php:272 Credit_Invoice.php:281 +#: CustomerAllocations.php:359 CustomerReceipt.php:845 #: CustomerTransInquiry.php:94 CustWhereAlloc.php:91 PaymentAllocations.php:78 -#: Payments.php:926 Payments.php:928 Payments.php:937 +#: Payments.php:928 Payments.php:930 Payments.php:939 #: PcAssignCashToTab.php:214 PcAssignCashToTab.php:335 #: PcAuthorizeExpenses.php:83 PcClaimExpensesFromTab.php:193 #: PcClaimExpensesFromTab.php:342 PcReportTab.php:175 PcReportTab.php:347 -#: PrintCheque.php:70 PrintCheque.php:84 SelectCreditItems.php:659 -#: SuppContractChgs.php:73 SuppContractChgs.php:142 SuppFixedAssetChgs.php:71 -#: SuppFixedAssetChgs.php:137 SupplierAllocations.php:466 -#: SupplierCredit.php:345 SupplierCredit.php:373 SupplierCredit.php:403 -#: SupplierCredit.php:438 SupplierInvoice.php:313 SupplierInvoice.php:344 -#: SupplierInvoice.php:373 SupplierInvoice.php:409 SupplierTransInquiry.php:94 +#: PrintCheque.php:70 PrintCheque.php:84 SelectCreditItems.php:661 +#: SuppContractChgs.php:73 SuppContractChgs.php:142 SuppFixedAssetChgs.php:77 +#: SuppFixedAssetChgs.php:136 SupplierAllocations.php:466 +#: SupplierCredit.php:341 SupplierCredit.php:369 SupplierCredit.php:399 +#: SupplierCredit.php:434 SupplierInvoice.php:312 SupplierInvoice.php:342 +#: SupplierInvoice.php:373 SupplierInvoice.php:408 SupplierTransInquiry.php:94 #: SuppShiptChgs.php:77 SuppShiptChgs.php:134 SuppTransGLAnalysis.php:97 #: SuppTransGLAnalysis.php:174 Z_CheckAllocs.php:63 #: includes/PDFBankingSummaryPageHeader.inc:55 @@ -1488,7 +1488,7 @@ #: BankMatching.php:225 BankReconciliation.php:189 BankReconciliation.php:261 #: PDFOrdersInvoiced.php:348 PDFOrderStatus.php:316 -#: PO_SelectOSPurchOrder.php:215 PO_SelectPurchOrder.php:180 +#: PO_SelectOSPurchOrder.php:215 PO_SelectPurchOrder.php:175 #: Shipt_Select.php:186 SuppCreditGRNs.php:225 #: includes/PDFStatementPageHeader.inc:173 #: includes/PDFStatementPageHeader.inc:180 @@ -1548,26 +1548,26 @@ msgid "The bank accounts could not be retrieved by the SQL because" msgstr "حساب های بانکی می تواند با گذاشتن زیرا قابل بازیابی نیست" -#: BankReconciliation.php:94 CustomerReceipt.php:717 -#: DailyBankTransactions.php:25 Payments.php:730 SuppPaymentRun.php:302 +#: BankReconciliation.php:94 CustomerReceipt.php:720 +#: DailyBankTransactions.php:25 Payments.php:729 SuppPaymentRun.php:302 msgid "The SQL used to retrieve the bank accounts was" msgstr "گذاشتن استفاده برای بازیابی حساب های بانکی شد" -#: BankReconciliation.php:100 CustomerReceipt.php:731 +#: BankReconciliation.php:100 CustomerReceipt.php:734 msgid "Bank Accounts have not yet been defined" msgstr "حساب بانک هنوز تعریف شده است" -#: BankReconciliation.php:100 CustomerReceipt.php:731 +#: BankReconciliation.php:100 CustomerReceipt.php:734 msgid "You must first" msgstr "شما باید اول" -#: BankReconciliation.php:100 CustomerReceipt.php:731 -#: DailyBankTransactions.php:32 Payments.php:737 SuppPaymentRun.php:310 +#: BankReconciliation.php:100 CustomerReceipt.php:734 +#: DailyBankTransactions.php:32 Payments.php:736 SuppPaymentRun.php:310 msgid "define the bank accounts" msgstr "تعریف حساب های بانکی" -#: BankReconciliation.php:100 CustomerReceipt.php:731 -#: DailyBankTransactions.php:32 Payments.php:737 SuppPaymentRun.php:310 +#: BankReconciliation.php:100 CustomerReceipt.php:734 +#: DailyBankTransactions.php:32 Payments.php:736 SuppPaymentRun.php:310 msgid "and general ledger accounts to be affected" msgstr "و حساب های دفتر کل عمومی که تحت تاثیر قرار" @@ -1600,24 +1600,23 @@ #: BankReconciliation.php:186 BankReconciliation.php:258 #: CustomerAllocations.php:331 CustomerAllocations.php:357 #: CustomerInquiry.php:190 CustomerTransInquiry.php:86 CustWhereAlloc.php:88 -#: EmailCustTrans.php:17 GLAccountInquiry.php:153 PrintCustTrans.php:378 -#: PrintCustTrans.php:542 PrintCustTrans.php:696 PrintCustTrans.php:735 -#: PrintCustTransPortrait.php:504 PrintCustTransPortrait.php:704 -#: PrintCustTransPortrait.php:894 PrintCustTransPortrait.php:939 +#: EmailCustTrans.php:17 GLAccountInquiry.php:153 PrintCustTrans.php:440 +#: PrintCustTrans.php:604 PrintCustTrans.php:758 PrintCustTrans.php:797 +#: PrintCustTransPortrait.php:574 PrintCustTransPortrait.php:774 +#: PrintCustTransPortrait.php:964 PrintCustTransPortrait.php:1009 #: StockMovements.php:97 SupplierAllocations.php:463 #: SupplierAllocations.php:575 SupplierAllocations.php:645 #: SupplierTransInquiry.php:87 Z_CheckAllocs.php:60 #: Z_CheckGLTransBalance.php:13 includes/PDFQuotationPageHeader.inc:87 -#: includes/PDFQuotationPortraitPageHeader.inc:86 #: includes/PDFStatementPageHeader.inc:168 -#: includes/PDFStatementPageHeader.inc:179 includes/PDFTransPageHeader.inc:80 +#: includes/PDFStatementPageHeader.inc:179 includes/PDFTransPageHeader.inc:76 #: includes/PDFTransPageHeaderPortrait.inc:52 msgid "Number" msgstr "عدد" #: BankReconciliation.php:187 BankReconciliation.php:259 #: ContractCosting.php:148 CustomerInquiry.php:193 CustomerTransInquiry.php:90 -#: CustWhereAlloc.php:89 DailyBankTransactions.php:100 GLAccountReport.php:368 +#: CustWhereAlloc.php:89 DailyBankTransactions.php:80 GLAccountReport.php:368 #: PaymentAllocations.php:75 PaymentAllocations.php:76 #: PDFRemittanceAdvice.php:309 ShiptsList.php:37 StockCounts.php:99 #: StockCounts.php:135 StockLocMovements.php:88 StockMovements.php:100 @@ -1672,9 +1671,9 @@ "کاربری ایجاد کنید. مهم است که نرخ ارز بالا نشان دهنده ارزش فعلی از ارز حساب " "بانکی" -#: BankReconciliation.php:311 CounterSales.php:781 Customers.php:1004 -#: SelectOrderItems.php:1369 Stocks.php:1031 WorkOrderCosting.php:512 -#: WorkOrderEntry.php:547 +#: BankReconciliation.php:311 CounterSales.php:741 Customers.php:1014 +#: SelectOrderItems.php:1374 Stocks.php:1029 WorkOrderCosting.php:512 +#: WorkOrderEntry.php:549 msgid "Are You Sure?" msgstr "مطمئن هستید؟" @@ -1703,135 +1702,132 @@ msgid "Match off cleared deposits" msgstr "تطابق پاک کردن رسوبات" -#: BOMExtendedQty.php:12 BOMExtendedQty.php:13 BOMExtendedQty.php:159 -#: BOMExtendedQty.php:269 +#: BOMExtendedQty.php:14 BOMExtendedQty.php:15 BOMExtendedQty.php:156 +#: BOMExtendedQty.php:283 msgid "Quantity Extended BOM Listing" msgstr "مقدار تمدید مثال BOM" -#: BOMExtendedQty.php:32 BOMIndentedReverse.php:29 MRPCalendar.php:87 +#: BOMExtendedQty.php:34 BOMIndentedReverse.php:30 MRPCalendar.php:87 #: MRP.php:29 SalesInquiry.php:1191 msgid "The SQL to to create passbom failed with the message" msgstr "گذاشتن به ایجاد passbom شکست خورده با پیام" -#: BOMExtendedQty.php:45 BOMIndented.php:40 BOMIndentedReverse.php:42 +#: BOMExtendedQty.php:47 BOMIndented.php:42 BOMIndentedReverse.php:43 #: MRP.php:36 msgid "Create of tempbom failed because" msgstr "ایجاد tempbom از شکست خورده به دلیل" -#: BOMExtendedQty.php:161 +#: BOMExtendedQty.php:158 msgid "" "The Quantiy Extended BOM Listing could not be retrieved by the SQL because" msgstr "Quantiy تمدید BOM مثال می توان با گذ... [truncated message content] |
From: <dai...@us...> - 2011-04-18 07:49:49
|
Revision: 4554 http://web-erp.svn.sourceforge.net/web-erp/?rev=4554&view=rev Author: daintree Date: 2011-04-18 07:49:36 +0000 (Mon, 18 Apr 2011) Log Message: ----------- pre 4.03.8 Modified Paths: -------------- trunk/PO_Header.php trunk/PO_Items.php trunk/PO_PDFPurchOrder.php trunk/PurchData.php trunk/doc/Change.log.html trunk/includes/ConnectDB.inc trunk/includes/DefinePOClass.php trunk/includes/PO_ReadInOrder.inc trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.mo trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po trunk/locale/de_DE.utf8/LC_MESSAGES/messages.mo trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po trunk/locale/el_GR.utf8/LC_MESSAGES/messages.mo trunk/locale/el_GR.utf8/LC_MESSAGES/messages.po trunk/locale/en_GB.utf8/LC_MESSAGES/messages.pot trunk/locale/en_US.utf8/LC_MESSAGES/messages.mo trunk/locale/en_US.utf8/LC_MESSAGES/messages.po trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po trunk/locale/et_EE.utf8/LC_MESSAGES/messages.mo trunk/locale/et_EE.utf8/LC_MESSAGES/messages.po trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.mo trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.po trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.mo trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.po trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.mo trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.po trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.mo trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.po trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.mo trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.po trunk/locale/id_ID.utf8/LC_MESSAGES/messages.mo trunk/locale/id_ID.utf8/LC_MESSAGES/messages.po trunk/locale/it_IT.utf8/LC_MESSAGES/messages.mo trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.mo trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.po trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.mo trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.po trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.mo trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.po trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.mo trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.po trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.po trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.po trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.mo trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.po trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.mo trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.po trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.mo trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.po trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.mo trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.po trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.mo trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.po trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.mo trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.po trunk/locale/vi_VN.utf8/LC_MESSAGES/messages.mo trunk/locale/vi_VN.utf8/LC_MESSAGES/messages.po trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.po trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.po trunk/sql/mysql/upgrade3.11.1-4.00.sql trunk/sql/mysql/weberp-demo.sql trunk/sql/mysql/weberp-new.sql Modified: trunk/PO_Header.php =================================================================== --- trunk/PO_Header.php 2011-04-18 00:09:23 UTC (rev 4553) +++ trunk/PO_Header.php 2011-04-18 07:49:36 UTC (rev 4554) @@ -228,7 +228,7 @@ $_POST['RePrint'] = 0; } - echo "<meta http-equiv='Refresh' content='0; url=" . $rootpath . '/PO_Items.php?identifier='.$identifier. "'>"; + echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/PO_Items.php?identifier='.$identifier. '">'; echo '<p>'; prnMsg(_('You should automatically be forwarded to the entry of the purchase order line items page') . '. ' . _('If this does not happen') . ' (' . _('if the browser does not support META Refresh') . ') ' . @@ -613,6 +613,7 @@ purchdata.suppliersuom, purchdata.suppliers_partno, purchdata.conversionfactor, + purchdata.leadtime, stockcategory.stockact FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid @@ -626,6 +627,9 @@ if (!isset($PurchItemRow['conversionfactor'])) { $PurchItemRow['conversionfactor']=1; } + if (!isset($PurchItemRow['leadtime'])) { + $PurchItemRow['leadtime']=1; + } $_SESSION['PO'.$identifier]->add_to_order( 1, $Purch_Item, @@ -644,18 +648,10 @@ 0, '', $PurchItemRow['decimalplaces'], - $Purch_Item, $PurchItemRow['suppliersuom'], $PurchItemRow['conversionfactor'], - $PurchItemRow['suppliers_partno'], - $Qty*$PurchItemRow['price'], - '', - 0, - 0, - 0, - 0, - $Qty, - $Qty*$PurchItemRow['price']); + $PurchItemRow['leadtime'], + $PurchItemRow['suppliers_partno'] ); echo "<meta http-equiv='Refresh' content='0; url=" . $rootpath . '/PO_Items.php?identifier='.$identifier. "'>"; } Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2011-04-18 00:09:23 UTC (rev 4553) +++ trunk/PO_Items.php 2011-04-18 07:49:36 UTC (rev 4554) @@ -49,7 +49,6 @@ } else { //ok to update the PO object variables $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->Price=(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['SuppPrice'.$POLine->LineNo]))/$_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor); } - $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->NetWeight=$_POST['NetWeight'.$POLine->LineNo]; $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ReqDelDate=$_POST['ReqDelDate'.$POLine->LineNo]; } } @@ -202,57 +201,39 @@ foreach ($_SESSION['PO'.$identifier]->LineItems as $POLine) { if ($POLine->Deleted==False) { $sql = "INSERT INTO purchorderdetails ( orderno, - itemcode, - deliverydate, - itemdescription, - glcode, - unitprice, - quantityord, - shiptref, - jobref, - itemno, - suppliersunit, - suppliers_partno, - subtotal_amount, - package, - pcunit, - netweight, - kgs, - cuft, - total_quantity, - total_amount, - assetid, - conversionfactor ) - VALUES ( - '" . $_SESSION['PO'.$identifier]->OrderNo . "', - '" . $POLine->StockID . "', - '" . FormatDateForSQL($POLine->ReqDelDate) . "', - '" . $POLine->ItemDescription . "', - '" . $POLine->GLCode . "', - '" . $POLine->Price . "', - '" . $POLine->Quantity . "', - '" . $POLine->ShiptRef . "', - '" . $POLine->JobRef . "', - '" . $POLine->ItemNo . "', - '" . $POLine->SuppliersUnit . "', - '" . $POLine->Suppliers_PartNo . "', - '" . $POLine->SubTotal_Amount . "', - '" . $POLine->Package . "', - '" . $POLine->PcUnit . "', - '" . $POLine->NetWeight . "', - '" . $POLine->KGs . "', - '" . $POLine->CuFt . "', - '" . $POLine->Total_Quantity . "', - '" . $POLine->Total_Amount . "', - '" . $POLine->AssetID . "', - '" . $POLine->ConversionFactor . "')"; + itemcode, + deliverydate, + itemdescription, + glcode, + unitprice, + quantityord, + shiptref, + jobref, + suppliersunit, + suppliers_partno, + assetid, + conversionfactor ) + VALUES ( + '" . $_SESSION['PO'.$identifier]->OrderNo . "', + '" . $POLine->StockID . "', + '" . FormatDateForSQL($POLine->ReqDelDate) . "', + '" . $POLine->ItemDescription . "', + '" . $POLine->GLCode . "', + '" . $POLine->Price . "', + '" . $POLine->Quantity . "', + '" . $POLine->ShiptRef . "', + '" . $POLine->JobRef . "', + '" . $POLine->SuppliersUnit . "', + '" . $POLine->Suppliers_PartNo . "', + '" . $POLine->AssetID . "', + '" . $POLine->ConversionFactor . "')"; $ErrMsg =_('One of the purchase order detail records could not be inserted into the database because'); $DbgMsg =_('The SQL statement used to insert the purchase order detail record and failed was'); $result =DB_query($sql,$db,$ErrMsg,$DbgMsg,true); } } /* end of the loop round the detail line items on the order */ - echo '<p>'; + echo '<p />'; prnMsg(_('Purchase Order') . ' ' . $_SESSION['PO'.$identifier]->OrderNo . ' ' . _('on') . ' ' . $_SESSION['PO'.$identifier]->SupplierName . ' ' . _('has been created'),'success'); } else { /*its an existing order need to update the old order info */ @@ -315,17 +296,8 @@ quantityord, shiptref, jobref, - itemno, suppliersunit, suppliers_partno, - subtotal_amount, - package, - pcunit, - netweight, - kgs, - cuft, - total_quantity, - total_amount, assetid, conversionfactor) VALUES ( @@ -338,17 +310,8 @@ '" . $POLine->Quantity . "', '" . $POLine->ShiptRef . "', '" . $POLine->JobRef . "', - '" . $POLine->ItemNo . "', '" . $POLine->SuppliersUnit . "', '" . $POLine->Suppliers_PartNo . "', - '" . $POLine->SubTotal_Amount . "', - '" . $POLine->Package . "', - '" . $POLine->PcUnit . "', - '" . $POLine->NetWeight . "', - '" . $POLine->KGs . "', - '" . $POLine->CuFt . "', - '" . $POLine->Total_Quantity . "', - '" . $POLine->Total_Amount . "', '" . $POLine->AssetID . "', '" . $POLine->ConversionFactor . "')"; @@ -362,17 +325,8 @@ quantityord='" . $POLine->Quantity . "', shiptref='" . $POLine->ShiptRef . "', jobref='" . $POLine->JobRef . "', - itemno='" . $POLine->ItemNo . "', suppliersunit='" . $POLine->SuppliersUnit . "', suppliers_partno='" . $POLine->Suppliers_PartNo . "', - subtotal_amount='" . $POLine->SubTotal_Amount . "', - package='" . $POLine->Package . "', - pcunit='" . $POLine->PcUnit . "', - netweight='" . $POLine->NetWeight . "', - kgs='" . $POLine->KGs . "', - cuft='" . $POLine->CuFt . "', - total_quantity='" . $POLine->Total_Quantity . "', - total_amount='" . $POLine->Total_Amount . "', completed=1, assetid='" . $POLine->AssetID . "', conversionfactor = '" . $POLine->ConversionFactor . "' @@ -386,17 +340,8 @@ quantityord='" . $POLine->Quantity . "', shiptref='" . $POLine->ShiptRef . "', jobref='" . $POLine->JobRef . "', - itemno='" . $POLine->ItemNo . "', suppliersunit='" . $POLine->SuppliersUnit . "', suppliers_partno='" . $POLine->Suppliers_PartNo . "', - subtotal_amount='" . $POLine->SubTotal_Amount . "', - package='" . $POLine->Package . "', - pcunit='" . $POLine->PcUnit . "', - netweight='" . $POLine->NetWeight . "', - kgs='" . $POLine->KGs . "', - cuft='" . $POLine->CuFt . "', - total_quantity='" . $POLine->Total_Quantity . "', - total_amount='" . $POLine->Total_Amount . "', assetid='" . $POLine->AssetID . "', conversionfactor = '" . $POLine->ConversionFactor . "' WHERE podetailitem='" . $POLine->PODetailRec . "'"; @@ -540,19 +485,9 @@ 0, $GLAccountName, 2, - '', $_POST['SuppliersUnit'], 1, '', - '', - ($_POST['Qty']*$_POST['Price']), - '', - '', - '', - '', - '', - $_POST['Qty'], - ($_POST['Qty']*$_POST['Price']), $_POST['AssetID']); include ('includes/PO_UnsetFormVbls.php'); } @@ -592,8 +527,6 @@ stockid, units, decimalplaces, - kgs, - netweight, stockact, accountname FROM stockmaster INNER JOIN stockcategory @@ -612,12 +545,10 @@ conversionfactor, supplierdescription, suppliersuom, - unitname, suppliers_partno, leadtime, MAX(purchdata.effectivefrom) AS latesteffectivefrom - FROM purchdata LEFT JOIN unitsofmeasure - ON purchdata.suppliersuom=unitsofmeasure.unitid + FROM purchdata WHERE purchdata.supplierno = '" . $_SESSION['PO'.$identifier]->SupplierID . "' AND purchdata.effectivefrom <='" . Date('Y-m-d') . "' AND purchdata.stockid = '". $ItemCode . "' @@ -625,7 +556,6 @@ purchdata.conversionfactor, purchdata.supplierdescription, purchdata.suppliersuom, - unitsofmeasure.unitname, purchdata.suppliers_partno, purchdata.leadtime"; @@ -637,14 +567,14 @@ $PurchPrice = $PurchRow['price']/$PurchRow['conversionfactor']; $ConversionFactor = $PurchRow['conversionfactor']; $SupplierDescription = $PurchRow['suppliers_partno'] .' - ' . $PurchRow['supplierdescription']; - $SuppliersUnitOfMeasure = $PurchRow['unitname']; + $SuppliersUnitOfMeasure = $PurchRow['suppliersuom']; $SuppliersPartNo = $PurchRow['suppliers_partno']; $LeadTime = $PurchRow['leadtime']; } else { // no purchasing data setup $PurchPrice = 0; $ConversionFactor = 1; $SupplierDescription = $ItemRow['description']; - $SuppliersUnitOfMeasure = $ItemRow['units']; + $SuppliersUnitOfMeasure = $ItemRow['unitname']; $SuppliersPartNo = ''; $LeadTime = 1; } @@ -666,19 +596,11 @@ 0, $Itemrow['accountname'], $ItemRow['decimalplaces'], - $ItemCode, $SuppliersUnitOfMeasure, $ConversionFactor, $LeadTime, - $SuppliersPartNo, - $Quantity*$PurchPrice, - '', - 0, - $ItemRow['netweight'], - $ItemRow['kgs'], - '', - $Quantity, - $Quantity*$PurchPrice ); + $SuppliersPartNo + ); } else { //no rows returned by the SQL to get the item prnMsg (_('The item code') . ' ' . $ItemCode . ' ' . _('does not exist in the database and therefore cannot be added to the order'),'error'); if ($debug==1){ @@ -711,15 +633,14 @@ echo '<tr> <th>' . _('Item Code') . '</th> <th>' . _('Description') . '</th> - <th>' . _('Weight') . '</th> <th>' . _('Quantity Our Units') . '</th> <th>' . _('Our Unit') .'</th> <th>' . _('Price Our Units') .' ('.$_SESSION['PO'.$identifier]->CurrCode. ')</th> <th>' . _('Unit Conversion Factor') . '</th> - <th>' . _('Quantity Supplier Units') . '</th> + <th>' . _('Order Quantity') . '<br />' . _('Supplier Units') . '</th> <th>' . _('Supplier Unit') . '</th> - <th>' . _('Price Supp Units') . ' ('.$_SESSION['PO'.$identifier]->CurrCode. ')</th> - <th>' . _('Subtotal') .' ('.$_SESSION['PO'.$identifier]->CurrCode. ')</th> + <th>' . _('Order Price') . '<br />' . _('Supp Units') . ' ('.$_SESSION['PO'.$identifier]->CurrCode. ')</th> + <th>' . _('Sub-Total') .' ('.$_SESSION['PO'.$identifier]->CurrCode. ')</th> <th>' . _('Deliver By') .'</th> </tr>'; @@ -749,7 +670,6 @@ echo '<td>' . $POLine->StockID . '</td> <td>' . $POLine->ItemDescription . '</td> - <td><input type="text" class="number" name="NetWeight' . $POLine->LineNo . '" size="8" value="' . $POLine->NetWeight . '"></td> <td class="number">' . number_format($POLine->Quantity,$POLine->DecimalPlaces) . '</td> <td>' . $POLine->Units . '</td> <td class="number">' . $DisplayPrice . '</td> @@ -759,7 +679,7 @@ <td><input type="text" class="number" name="SuppPrice' . $POLine->LineNo . '" size="10" value="' .number_format(($POLine->Price *$POLine->ConversionFactor),2) .'"></td> <td class="number">' . $DisplayLineTotal . '</td> <td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'].'" name="ReqDelDate' . $POLine->LineNo.'" size="10" value="' .$POLine->ReqDelDate .'"></td> - <td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . 'identifier='.$identifier. '&Delete=' . $POLine->LineNo . '">' . _('Delete') . '</a></td></tr>'; + <td><a href="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier. '&Delete=' . $POLine->LineNo . '">' . _('Delete') . '</a></td></tr>'; $_SESSION['PO'.$identifier]->Total = $_SESSION['PO'.$identifier]->Total + $LineTotal; } } @@ -777,14 +697,15 @@ if (isset($_POST['NonStockOrder'])) { - echo '<br /><table class=selection><tr><td>' . _('Item Description') . '</td>'; + echo '<br /><table class="selection"><tr> + <td>' . _('Item Description') . '</td>'; echo '<td><input type=text name=ItemDescription size=40></td></tr>'; echo '<tr><td>' . _('General Ledger Code') . '</td>'; echo '<td><select name="GLCode">'; - $sql='SELECT accountcode, + $sql="SELECT accountcode, accountname FROM chartmaster - ORDER BY accountcode ASC'; + ORDER BY accountcode ASC"; $result=DB_query($sql, $db); while ($myrow=DB_fetch_array($result)) { @@ -793,7 +714,7 @@ echo '</select></td></tr>'; echo '<tr><td>'._('OR Asset ID'). '</td> <td><select name="AssetID">'; - $AssetsResult = DB_query('SELECT assetid, description, datepurchased FROM fixedassets ORDER BY assetid DESC',$db); + $AssetsResult = DB_query("SELECT assetid, description, datepurchased FROM fixedassets ORDER BY assetid DESC",$db); echo '<option selected value="Not an Asset">' . _('Not an Asset') . '</option>'; while ($AssetRow = DB_fetch_array($AssetsResult)){ if ($AssetRow['datepurchased']=='0000-00-00'){ @@ -831,42 +752,26 @@ $sql = "SELECT stockmaster.stockid, stockmaster.description, - stockmaster.units, - purchdata.conversionfactor, - unitsofmeasure.unitname + stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - LEFT JOIN purchdata - ON stockmaster.stockid=purchdata.stockid - LEFT JOIN unitsofmeasure - ON unitsofmeasure.unitid=purchdata.suppliersuom WHERE stockmaster.mbflag<>'D' AND stockmaster.mbflag<>'K' AND stockmaster.mbflag<>'G' AND stockmaster.discontinued<>1 AND stockmaster.description " . LIKE . " '" . $SearchString ."' - AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' - OR purchdata.supplierno IS NULL) ORDER BY stockmaster.stockid LIMIT " .$_SESSION['DefaultDisplayRecordsMax']; } else { $sql = "SELECT stockmaster.stockid, stockmaster.description, - stockmaster.units, - purchdata.conversionfactor, - unitsofmeasure.unitname + stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - LEFT JOIN purchdata - ON stockmaster.stockid=purchdata.stockid - LEFT JOIN unitsofmeasure - ON unitsofmeasure.unitid=purchdata.suppliersuom WHERE stockmaster.mbflag<>'D' AND stockmaster.mbflag<>'K' AND stockmaster.mbflag<>'G' AND stockmaster.discontinued<>1 - AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' - OR purchdata.supplierno IS NULL) AND stockmaster.description " . LIKE . " '". $SearchString ."' AND stockmaster.categoryid='" . $_POST['StockCat'] . "' ORDER BY stockmaster.stockid @@ -880,42 +785,26 @@ if ($_POST['StockCat']=='All'){ $sql = "SELECT stockmaster.stockid, stockmaster.description, - stockmaster.units, - purchdata.conversionfactor, - unitsofmeasure.unitname + stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - LEFT JOIN purchdata - ON stockmaster.stockid=purchdata.stockid - LEFT JOIN unitsofmeasure - ON unitsofmeasure.unitid=purchdata.suppliersuom WHERE stockmaster.mbflag<>'D' AND stockmaster.mbflag<>'K' AND stockmaster.mbflag<>'G' AND stockmaster.discontinued<>1 - AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' - OR purchdata.supplierno IS NULL) AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' ORDER BY stockmaster.stockid LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; } else { $sql = "SELECT stockmaster.stockid, stockmaster.description, - stockmaster.units, - purchdata.conversionfactor, - unitsofmeasure.unitname + stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - LEFT JOIN purchdata - ON stockmaster.stockid=purchdata.stockid - LEFT JOIN unitsofmeasure - ON unitsofmeasure.unitid=purchdata.suppliersuom WHERE stockmaster.mbflag<>'D' AND stockmaster.mbflag<>'K' AND stockmaster.mbflag<>'G' and stockmaster.discontinued<>1 - AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' - OR purchdata.supplierno IS NULL) AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' AND stockmaster.categoryid='" . $_POST['StockCat'] . "' ORDER BY stockmaster.stockid @@ -926,41 +815,25 @@ if ($_POST['StockCat']=='All'){ $sql = "SELECT stockmaster.stockid, stockmaster.description, - stockmaster.units, - purchdata.conversionfactor, - unitsofmeasure.unitname + stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - LEFT JOIN purchdata - ON stockmaster.stockid=purchdata.stockid - LEFT JOIN unitsofmeasure - ON unitsofmeasure.unitid=purchdata.suppliersuom WHERE stockmaster.mbflag<>'D' AND stockmaster.mbflag<>'K' AND stockmaster.mbflag<>'G' AND stockmaster.discontinued<>1 - AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' - OR purchdata.supplierno IS NULL) ORDER BY stockmaster.stockid LIMIT " . $_SESSION['DefaultDisplayRecordsMax']; } else { $sql = "SELECT stockmaster.stockid, stockmaster.description, - stockmaster.units, - purchdata.conversionfactor, - unitsofmeasure.unitname + stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - LEFT JOIN purchdata - ON stockmaster.stockid=purchdata.stockid - LEFT JOIN unitsofmeasure - ON unitsofmeasure.unitid=purchdata.suppliersuom WHERE stockmaster.mbflag<>'D' AND stockmaster.mbflag<>'K' AND stockmaster.mbflag<>'G' AND stockmaster.discontinued<>1 - AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' - OR purchdata.supplierno IS NULL) AND stockmaster.categoryid='" . $_POST['StockCat'] . "' ORDER BY stockmaster.stockid LIMIT " . $_SESSION['DefaultDisplayRecordsMax']; @@ -994,11 +867,16 @@ $DbgMsg = _('The SQL used to retrieve the category details but failed was'); $result1 = DB_query($sql,$db,$ErrMsg,$DbgMsg); - echo '<table class=selection><tr><th colspan=3><font size=3 color=blue>'. _('Search For Stock Items') . '</th>'; + echo '<table class=selection> + <tr> + <th colspan=3><font size=3 color=blue>'. _('Search For Stock Items') . '</th>'; - echo ':</font></tr><tr><td><select name="StockCat">'; + echo ':</font> + </tr> + <tr><td><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>'; @@ -1019,16 +897,17 @@ } echo '</select></td> - <td>' . _('Enter text extracts in the description') . ":</td> - <td><input type='text' name='Keywords' size=20 maxlength=25 value='" . $_POST['Keywords'] . "'></td></tr> + <td>' . _('Enter text extracts in the description') . ':</td> + <td><input type="text" name="Keywords" size=20 maxlength=25 value="' . $_POST['Keywords'] . '"></td></tr> <tr><td></td> - <td><font size=3><b>" . _('OR') . ' </b></font>' . _('Enter extract of the Stock Code') . - ":</td> - <td><input type='text' name='StockCode' size=15 maxlength=18 value='" . $_POST['StockCode'] . "'></td> + <td><font size=3><b>' . _('OR') . ' </b></font>' . _('Enter extract of the Stock Code') . ':</td> + <td><input type="text" name="StockCode" size=15 maxlength=18 value="' . $_POST['StockCode'] . '"></td> </tr> <tr><td></td> - <td><font size=3><b>" . _('OR') . ' </b></font><a target="_blank" href="'.$rootpath.'/Stocks.php?">' . _('Create a New Stock Item') . '</a></td></tr> - </table><br /> + <td><font size=3><b>' . _('OR') . ' </b></font><a target="_blank" href="'.$rootpath.'/Stocks.php">' . _('Create a New Stock Item') . '</a></td></tr> + </table> + <br /> + <div class="centre"><input type="submit" name="Search" value="' . _('Search Now') . '"> <input type="submit" name="NonStockOrder" value="' . _('Order a non stock item') . '"> </div><br />'; @@ -1070,9 +949,19 @@ $ImageSource = '<i>'._('No Image').'</i>'; } - if (strlen($myrow['unitname'])>0) { - $OrderUnits=$myrow['unitname']; - $ConversionFactor =$myrow['conversionfactor']; + /*Get conversion factor and supplier units if any */ + $sql = "SELECT purchdata.conversionfactor, + purchdata.suppliersuom + FROM purchdata + WHERE purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID . "' + AND purchdata.stockid='" . $myrow['stockid'] . "'"; + $ErrMsg = _('Could not retrieve the purchasing data for the item'); + $PurchDataResult = DB_query($sql,$db,$ErrMsg); + + if (DB_num_rows($PurchDataResult)>0) { + $PurchDataRow = DB_fetch_array($PurchDataResult); + $OrderUnits=$PurchDataRow['suppliersuom']; + $ConversionFactor =$PurchDataRow['conversionfactor']; } else { $OrderUnits=$myrow['units']; $ConversionFactor =1; Modified: trunk/PO_PDFPurchOrder.php =================================================================== --- trunk/PO_PDFPurchOrder.php 2011-04-18 00:09:23 UTC (rev 4553) +++ trunk/PO_PDFPurchOrder.php 2011-04-18 07:49:36 UTC (rev 4554) @@ -1,6 +1,7 @@ <?php + /* $Id$*/ -//$PageSecurity = 2; + include('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); include('includes/DefinePOClass.php'); @@ -69,31 +70,31 @@ $ErrMsg = _('There was a problem retrieving the purchase order header details for Order Number'). ' ' . $OrderNo . ' ' . _('from the database'); $sql = "SELECT purchorders.supplierno, - suppliers.suppname, - suppliers.address1, - suppliers.address2, - suppliers.address3, - suppliers.address4, - purchorders.comments, - purchorders.orddate, - purchorders.rate, - purchorders.dateprinted, - purchorders.deladd1, - purchorders.deladd2, - purchorders.deladd3, - purchorders.deladd4, - purchorders.deladd5, - purchorders.deladd6, - purchorders.allowprint, - purchorders.requisitionno, - purchorders.initiator, - purchorders.paymentterms, - suppliers.currcode, - purchorders.status, - purchorders.stat_comment - FROM purchorders INNER JOIN suppliers - ON purchorders.supplierno = suppliers.supplierid - WHERE purchorders.orderno='" . $OrderNo ."'"; + suppliers.suppname, + suppliers.address1, + suppliers.address2, + suppliers.address3, + suppliers.address4, + purchorders.comments, + purchorders.orddate, + purchorders.rate, + purchorders.dateprinted, + purchorders.deladd1, + purchorders.deladd2, + purchorders.deladd3, + purchorders.deladd4, + purchorders.deladd5, + purchorders.deladd6, + purchorders.allowprint, + purchorders.requisitionno, + purchorders.initiator, + purchorders.paymentterms, + suppliers.currcode, + purchorders.status, + purchorders.stat_comment + FROM purchorders INNER JOIN suppliers + ON purchorders.supplierno = suppliers.supplierid + WHERE purchorders.orderno='" . $OrderNo ."'"; $result=DB_query($sql,$db, $ErrMsg); if (DB_num_rows($result)==0){ /*There is no order header returned */ $title = _('Print Purchase Order Error'); @@ -101,16 +102,16 @@ echo '<div class="centre"><br /><br /><br />'; prnMsg( _('Unable to Locate Purchase Order Number') . ' : ' . $OrderNo . ' ', 'error'); echo '<br /> - <br /> - <br /> - <table class="table_index"> - <tr><td class="menu_group_item"> - <li><a href="'. $rootpath . '/PO_SelectOSPurchOrder.php?'.SID .'">' . _('Outstanding Purchase Orders') . '</a></li> - <li><a href="'. $rootpath . '/PO_SelectPurchOrder.php?'. SID .'">' . _('Purchase Order Inquiry') . '</a></li> - </td> - </tr> - </table> - </div><br /><br /><br />'; + <br /> + <br /> + <table class="table_index"> + <tr><td class="menu_group_item"> + <li><a href="'. $rootpath . '/PO_SelectOSPurchOrder.php?'.SID .'">' . _('Outstanding Purchase Orders') . '</a></li> + <li><a href="'. $rootpath . '/PO_SelectPurchOrder.php?'. SID .'">' . _('Purchase Order Inquiry') . '</a></li> + </td> + </tr> + </table> + </div><br /><br /><br />'; include('includes/footer.inc'); exit(); } elseif (DB_num_rows($result)==1){ /*There is only one order header returned (as it should be!)*/ @@ -192,17 +193,17 @@ $ErrMsg = _('There was a problem retrieving the line details for order number') . ' ' . $OrderNo . ' ' . _('from the database'); $sql = "SELECT itemcode, - deliverydate, - itemdescription, - unitprice, - suppliersunit, - quantityord, - decimalplaces, - conversionfactor, - suppliers_partno - FROM purchorderdetails LEFT JOIN stockmaster - ON purchorderdetails.itemcode=stockmaster.stockid - WHERE orderno ='" . $OrderNo ."'"; + deliverydate, + itemdescription, + unitprice, + suppliersunit, + quantityord, + decimalplaces, + conversionfactor, + suppliers_partno + FROM purchorderdetails LEFT JOIN stockmaster + ON purchorderdetails.itemcode=stockmaster.stockid + WHERE orderno ='" . $OrderNo ."'"; $result=DB_query($sql,$db); } if ($OrderNo=='Preview' or DB_num_rows($result)>0){ @@ -210,7 +211,8 @@ include('includes/PO_PDFOrderPageHeader.inc'); $YPos=$Page_Height - $FormDesign->Data->y; $OrderTotal = 0; - while ((isset($OrderNo) and $OrderNo=='Preview') or (isset($result) and $POLine=DB_fetch_array($result))) { + while ((isset($OrderNo) and $OrderNo=='Preview') + OR (isset($result) and $POLine=DB_fetch_array($result))) { /* If we are previewing the order then fill the * order line with dummy data */ if ($OrderNo=='Preview') { @@ -306,33 +308,33 @@ $StatusComment = date($_SESSION['DefaultDateFormat']) .' - ' . _('Printed by') . '<a href="mailto:'.$_SESSION['UserEmail'] .'">'.$_SESSION['UsersRealName']. '</a><br />' . $POHeader['stat_comment']; $sql = "UPDATE purchorders SET allowprint = 0, - dateprinted = '" . Date('Y-m-d') . "', - status = 'Printed', - stat_comment = '" . $StatusComment . "' - WHERE purchorders.orderno = '" . $OrderNo."'"; + dateprinted = '" . Date('Y-m-d') . "', + status = 'Printed', + stat_comment = '" . $StatusComment . "' + WHERE purchorders.orderno = '" . $OrderNo."'"; $result = DB_query($sql,$db); } } /* There was enough info to either print or email the purchase order */ else { /*the user has just gone into the page need to ask the question whether to print the order or email it to the supplier */ include ('includes/header.inc'); - echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if ($ViewingOnly==1){ - echo '<input type=hidden name="ViewingOnly" VALUE=1>'; + echo '<input type=hidden name="ViewingOnly" value=1>'; } echo '<br /><br />'; - echo '<input type=hidden name="OrderNo" VALUE="'. $OrderNo. '">'; + echo '<input type=hidden name="OrderNo" value="'. $OrderNo. '">'; echo '<table><tr><td>'. _('Print or Email the Order'). '</td><td> <select name="PrintOrEmail">'; if (!isset($_POST['PrintOrEmail'])){ $_POST['PrintOrEmail'] = 'Print'; } if ($_POST['PrintOrEmail']=='Print'){ - echo '<option selected VALUE="Print">'. _('Print'); - echo '<option VALUE="Email">' . _('Email'); + echo '<option selected value="Print">'. _('Print'); + echo '<option value="Email">' . _('Email'); } else { - echo '<option VALUE="Print">'. _('Print'); - echo '<option selected VALUE="Email">'. _('Email'); + echo '<option value="Print">'. _('Print'); + echo '<option selected value="Email">'. _('Email'); } echo '</select></td></tr>'; echo '<tr><td>'. _('Show Amounts on the Order'). '</td><td> @@ -341,29 +343,29 @@ $_POST['ShowAmounts'] = 'Yes'; } if ($_POST['ShowAmounts']=='Yes'){ - echo '<option selected VALUE="Yes">'. _('Yes'); - echo '<option VALUE="No">' . _('No'); + echo '<option selected value="Yes">'. _('Yes'); + echo '<option value="No">' . _('No'); } else { - echo '<option VALUE="Yes">'. _('Yes'); - echo '<option selected VALUE="No">'. _('No'); + echo '<option value="Yes">'. _('Yes'); + echo '<option selected value="No">'. _('No'); } echo '</select></td></tr>'; if ($_POST['PrintOrEmail']=='Email'){ $ErrMsg = _('There was a problem retrieving the contact details for the supplier'); $SQL = "SELECT suppliercontacts.contact, - suppliercontacts.email - FROM suppliercontacts INNER JOIN purchorders - ON suppliercontacts.supplierid=purchorders.supplierno - WHERE purchorders.orderno='".$OrderNo."'"; + suppliercontacts.email + FROM suppliercontacts INNER JOIN purchorders + ON suppliercontacts.supplierid=purchorders.supplierno + WHERE purchorders.orderno='".$OrderNo."'"; $ContactsResult=DB_query($SQL,$db, $ErrMsg); if (DB_num_rows($ContactsResult)>0){ echo '<tr><td>'. _('Email to') .':</td><td><select name="EmailTo">'; while ($ContactDetails = DB_fetch_array($ContactsResult)){ if (strlen($ContactDetails['email'])>2 AND strpos($ContactDetails['email'],'@')>0){ if ($_POST['EmailTo']==$ContactDetails['email']){ - echo '<option selected VALUE="' . $ContactDetails['email'] . '">' . $ContactDetails['Contact'] . ' - ' . $ContactDetails['email'] . '</option>'; + echo '<option selected value="' . $ContactDetails['email'] . '">' . $ContactDetails['Contact'] . ' - ' . $ContactDetails['email'] . '</option>'; } else { - echo '<option VALUE="' . $ContactDetails['email'] . '">' . $ContactDetails['contact'] . ' - ' . $ContactDetails['email'] . '</option>'; + echo '<option value="' . $ContactDetails['email'] . '">' . $ContactDetails['contact'] . ' - ' . $ContactDetails['email'] . '</option>'; } } } @@ -377,7 +379,7 @@ } else { echo '</table>'; } - echo '<br /><div class="centre"><input type=submit name="DoIt" VALUE="' . _('OK') . '"></div>'; + echo '<br /><div class="centre"><input type=submit name="DoIt" value="' . _('OK') . '"></div>'; echo '</form>'; include('includes/footer.inc'); } Modified: trunk/PurchData.php =================================================================== --- trunk/PurchData.php 2011-04-18 00:09:23 UTC (rev 4553) +++ trunk/PurchData.php 2011-04-18 07:49:36 UTC (rev 4554) @@ -32,34 +32,42 @@ } if ((isset($_POST['AddRecord']) OR isset($_POST['UpdateRecord'])) AND isset($SupplierID)) { /*Validate Inputs */ - $InputError = 0; /*Start assuming the best */ - if ($StockID == '' OR !isset($StockID)) { - $InputError = 1; - prnMsg(_('There is no stock item set up enter the stock code or select a stock item using the search page'), 'error'); - } - if (!is_numeric($_POST['Price'])) { - $InputError = 1; - unset($_POST['Price']); - prnMsg(_('The price entered was not numeric and a number is expected. No changes have been made to the database'), 'error'); - } - if ($_POST['Price'] == 0) { - prnMsg(_('The price entered is zero') . ' ' . _('Is this intentional?'), 'warn'); - } - if (!is_numeric($_POST['LeadTime'])) { - $InputError = 1; - unset($_POST['LeadTime']); - prnMsg(_('The lead time entered was not numeric a number of days is expected no changes have been made to the database'), 'error'); - } - if (!is_numeric($_POST['MinOrderQty'])) { - $InputError = 1; - unset($_POST['MinOrderQty']); - prnMsg(_('The minimum order quantity was not numeric and a number is expected no changes have been made to the database'), 'error'); - } - if (!is_numeric($_POST['ConversionFactor'])) { - $InputError = 1; - unset($_POST['ConversionFactor']); - prnMsg(_('The conversion factor entered was not numeric') . ' (' . _('a number is expected') . '). ' . _('The conversion factor is the number which the price must be divided by to get the unit price in our unit of measure') . '. <br />' . _('E.g.') . ' ' . _('The supplier sells an item by the tonne and we hold stock by the kg') . '. ' . _('The suppliers price must be divided by 1000 to get to our cost per kg') . '. ' . _('The conversion factor to enter is 1000') . '. <br /><br />' . _('No changes will be made to the database'), 'error'); - } + $InputError = 0; /*Start assuming the best */ + if ($StockID == '' OR !isset($StockID)) { + $InputError = 1; + prnMsg(_('There is no stock item set up enter the stock code or select a stock item using the search page'), 'error'); + } + if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['Price'])))) { + $InputError = 1; + unset($_POST['Price']); + prnMsg(_('The price entered was not numeric and a number is expected. No changes have been made to the database'), 'error'); + } else { + $_POST['Price'] = doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['Price'])); + } + if ($_POST['Price'] == 0) { + prnMsg(_('The price entered is zero') . ' ' . _('Is this intentional?'), 'warn'); + } + if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['LeadTime'])))) { + $InputError = 1; + unset($_POST['LeadTime']); + prnMsg(_('The lead time entered was not numeric a number of days is expected no changes have been made to the database'), 'error'); + } else { + $_POST['LeadTime'] = doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['LeadTime'])); + } + if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['MinOrderQty'])))) { + $InputError = 1; + unset($_POST['MinOrderQty']); + prnMsg(_('The minimum order quantity was not numeric and a number is expected no changes have been made to the database'), 'error'); + } else { + $_POST['MinOrderQty'] =doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['MinOrderQty'])); + } + if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['ConversionFactor'])))) { + $InputError = 1; + unset($_POST['ConversionFactor']); + prnMsg(_('The conversion factor entered was not numeric') . ' (' . _('a number is expected') . '). ' . _('The conversion factor is the number which the price must be divided by to get the unit price in our unit of measure') . '. <br />' . _('E.g.') . ' ' . _('The supplier sells an item by the tonne and we hold stock by the kg') . '. ' . _('The suppliers price must be divided by 1000 to get to our cost per kg') . '. ' . _('The conversion factor to enter is 1000') . '. <br /><br />' . _('No changes will be made to the database'), 'error'); + } else { + $_POST['ConversionFactor'] =doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['ConversionFactor'])); + } if ($InputError == 0 AND isset($_POST['AddRecord'])) { $sql = "INSERT INTO purchdata (supplierno, stockid, @@ -137,23 +145,21 @@ if (!isset($_GET['Edit'])) { echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . ' ' . _('For Stock Code') . ' - ' . $StockID . '</p><br />'; $sql = "SELECT purchdata.supplierno, - suppliers.suppname, - purchdata.price, - suppliers.currcode, - purchdata.effectivefrom, - unitsofmeasure.unitname, - purchdata.supplierdescription, - purchdata.leadtime, - purchdata.suppliers_partno, - purchdata.minorderqty, - purchdata.preferred, - purchdata.conversionfactor - FROM purchdata INNER JOIN suppliers - ON purchdata.supplierno=suppliers.supplierid - LEFT JOIN unitsofmeasure - ON purchdata.suppliersuom=unitsofmeasure.unitid - WHERE purchdata.stockid = '" . $StockID . "' - ORDER BY purchdata.effectivefrom DESC"; + suppliers.suppname, + purchdata.price, + suppliers.currcode, + purchdata.effectivefrom, + purchdata.suppliersuom, + purchdata.supplierdescription, + purchdata.leadtime, + purchdata.suppliers_partno, + purchdata.minorderqty, + purchdata.preferred, + purchdata.conversionfactor + FROM purchdata INNER JOIN suppliers + ON purchdata.supplierno=suppliers.supplierid + WHERE purchdata.stockid = '" . $StockID . "' + ORDER BY purchdata.effectivefrom DESC"; $ErrMsg = _('The supplier purchasing details for the selected part could not be retrieved because'); $PurchDataResult = DB_query($sql, $db, $ErrMsg); if (DB_num_rows($PurchDataResult) == 0 and $StockID != '') { @@ -206,7 +212,7 @@ </tr>", $myrow['suppname'], number_format($myrow['price'], 3), - $myrow['unitname'], + $myrow['suppliersuom'], $myrow['conversionfactor'], number_format($myrow['price']/$myrow['conversionfactor'],2), $myrow['currcode'], @@ -260,7 +266,7 @@ echo '<td>' . _('Text in Supplier') . ' <b>' . _('CODE') . '</b>:</font></td>'; echo '<td><input type="Text" name="SupplierCode" size=15 maxlength=18></td>'; echo '</tr></table><br />'; - echo '<div class="centre"><input type=submit name="SearchSupplier" VALUE="' . _('Find Suppliers Now') . '"></div></form>'; + echo '<div class="centre"><input type=submit name="SearchSupplier" value="' . _('Find Suppliers Now') . '"></div></form>'; include ('includes/footer.inc'); exit; }; @@ -347,13 +353,20 @@ echo '<tr class="OddTableRows">'; $k++; } - printf("<td><font size=1><input type=submit name='SupplierID' VALUE='%s'</font></td> - <td><font size=1>%s</font></td> - <td><font size=1>%s</font></td> - <td><font size=1>%s</font></td> - <td><font size=1>%s</font></td> - <td><font size=1>%s</font></td> - </tr>", $myrow['supplierid'], $myrow['suppname'], $myrow['currcode'], $myrow['address1'], $myrow['address2'], $myrow['address3']); + printf('<td><font size=1><input type="submit" name="SupplierID" value="%s"</font></td> + <td><font size=1>%s</font></td> + <td><font size=1>%s</font></td> + <td><font size=1>%s</font></td> + <td><font size=1>%s</font></td> + <td><font size=1>%s</font></td> + </tr>', + $myrow['supplierid'], + $myrow['suppname'], + $myrow['currcode'], + $myrow['address1'], + $myrow['address2'], + $myrow['address3']); + echo '<input type=hidden name=StockID value="' . $StockID . '">'; echo '<input type=hidden name=StockUOM value="' . $StockUOM . '">'; @@ -405,17 +418,18 @@ $_POST['SupplierCode'] = $myrow['suppliers_partno']; $StockUOM=$myrow['units']; } - 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'] . '" />'; if (!isset($SupplierID)) { $SupplierID = ''; } if (isset($_GET['Edit'])) { echo '<tr><td>' . _('Supplier Name') . ':</td> - <td><input type=hidden name="SupplierID" VALUE="' . $SupplierID . '">' . $SupplierID . ' - ' . $SuppName . '<input type=hidden name="WasEffectiveFrom" VALUE="' . $myrow['effectivefrom'] . '"></td></tr>'; + <td><input type=hidden name="SupplierID" value="' . $SupplierID . '">' . $SupplierID . ' - ' . $SuppName . '<input type=hidden name="WasEffectiveFrom" value="' . $myrow['effectivefrom'] . '"></td></tr>'; } else { echo '<tr><td>' . _('Supplier Name') . ':</td> - <input type=hidden name="SupplierID" maxlength=10 size=11 VALUE="' . $SupplierID . '">'; + <input type=hidden name="SupplierID" maxlength=10 size=11 value="' . $SupplierID . '">'; if ($SupplierID!='') { echo '<td>'.$SuppName; } @@ -426,7 +440,7 @@ } echo '</td></tr>'; } - echo '<td><input type=hidden name="StockID" maxlength=10 size=11 VALUE="' . $StockID . '">'; + echo '<td><input type=hidden name="StockID" maxlength=10 size=11 value="' . $StockID . '">'; if (!isset($CurrCode)) { $CurrCode = ''; } @@ -449,57 +463,48 @@ $_POST['MinOrderQty'] = '1'; } echo '<tr><td>' . _('Currency') . ':</td> - <td><input type=hidden name="CurrCode" . VALUE="' . $CurrCode . '">' . $CurrCode . '</td></tr>'; + <td><input type=hidden name="CurrCode" . value="' . $CurrCode . '">' . $CurrCode . '</td></tr>'; echo '<tr><td>' . _('Price') . ' (' . _('in Supplier Currency') . '):</td> - <td><input type="text" class="number" name="Price" maxlength=12 size=12 VALUE=' . number_format($_POST['Price'], $myrow['decimalplaces'] ,'.','') . '></td></tr>'; + <td><input type="text" class="number" name="Price" maxlength=12 size=12 value=' . number_format($_POST['Price'], $myrow['decimalplaces']) . '></td></tr>'; echo '<tr><td>' . _('Date Updated') . ':</td> - <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="EffectiveFrom" maxlength=10 size=11 VALUE="' . $_POST['EffectiveFrom'] . '"></td></tr>'; + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="EffectiveFrom" maxlength=10 size=11 value="' . $_POST['EffectiveFrom'] . '"></td></tr>'; echo '<tr><td>' . _('Our Unit of Measure') . ':</td>'; if (isset($SupplierID)) { echo '<td>' . $StockUOM . '</td></tr>'; } echo '<tr><td>' . _('Suppliers Unit of Measure') . ':</td>'; - echo '<td><select name="SuppliersUOM">'; - $sql = 'SELECT * FROM unitsofmeasure'; - $result = DB_query($sql, $db); - while ($myrow = DB_fetch_array($result)) { - if ($_POST['SuppliersUOM'] == $myrow['unitid']) { - echo '<option selected value="' . $myrow['unitid'] . '">' . $myrow['unitname'] . '</option>'; - } else { - echo '<option value="' . $myrow['unitid'] . '">' . $myrow['unitname'] . '</option>'; - } - } - echo '</td></tr>'; + echo '<td><input type="text" name="SuppliersUOM" size="20" maxlength="20" value ="' . $_POST['SuppliersUOM'] . '"/>'; + echo '</td></tr>'; if (!isset($_POST['ConversionFactor']) OR $_POST['ConversionFactor'] == "") { $_POST['ConversionFactor'] = 1; } echo '<tr><td>' . _('Conversion Factor (to our UOM)') . ':</td> - <td><input type=text class=number name="ConversionFactor" maxlength=12 size=12 VALUE=' . $_POST['ConversionFactor'] . '></td></tr>'; + <td><input type=text class=number name="ConversionFactor" maxlength=12 size=12 value=' . $_POST['ConversionFactor'] . '></td></tr>'; echo '<tr><td>' . _('Supplier Stock Code') . ':</td> - <td><input type=text name="SupplierCode" maxlength=15 size=15 VALUE="' . $_POST['SupplierCode'] . '"></td></tr>'; + <td><input type=text name="SupplierCode" maxlength=15 size=15 value="' . $_POST['SupplierCode'] . '"></td></tr>'; echo '<tr><td>' . _('MinOrderQty') . ':</td> - <td><input type=text class=number name="MinOrderQty" maxlength=15 size=15 VALUE="' . $_POST['MinOrderQty'] . '"></td></tr>'; + <td><input type=text class=number name="MinOrderQty" maxlength=15 size=15 value="' . $_POST['MinOrderQty'] . '"></td></tr>'; echo '<tr><td>' . _('Supplier Stock Description') . ':</td> - <td><input type=text name="SupplierDescription" maxlength=50 size=51 VALUE="' . $_POST['SupplierDescription'] . '"></td></tr>'; + <td><input type=text name="SupplierDescription" maxlength=50 size=51 value="' . $_POST['SupplierDescription'] . '"></td></tr>'; if (!isset($_POST['LeadTime']) OR $_POST['LeadTime'] == "") { $_POST['LeadTime'] = 1; } echo '<tr><td>' . _('Lead Time') . ' (' . _('in days from date of order') . '):</td> - <td><input type=text class=number name="LeadTime" maxlength=4 size=5 VALUE=' . $_POST['LeadTime'] . '></td></tr>'; + <td><input type=text class=number name="LeadTime" maxlength=4 size=5 value=' . $_POST['LeadTime'] . '></td></tr>'; echo '<tr><td>' . _('Preferred Supplier') . ':</td> <td><select name="Preferred">'; if ($_POST['Preferred'] == 1) { - echo '<option selected VALUE=1>' . _('Yes') . '</option>'; - echo '<option VALUE=0>' . _('No') . '</option>'; + echo '<option selected value=1>' . _('Yes') . '</option>'; + echo '<option value=0>' . _('No') . '</option>'; } else { - echo '<option VALUE=1>' . _('Yes') . '</option>'; - echo '<option selected VALUE=0>' . _('No') . '</option>'; + echo '<option value=1>' . _('Yes') . '</option>'; + echo '<option selected value=0>' . _('No') . '</option>'; } echo '</select></td></tr></table><br /><div class="centre">'; if (isset($_GET['Edit'])) { - echo '<input type=submit name="UpdateRecord" VALUE="' . _('Update') . '">'; + echo '<input type=submit name="UpdateRecord" value="' . _('Update') . '">'; } else { - echo '<input type=submit name="AddRecord" VALUE="' . _('Add') . '">'; + echo '<input type=submit name="AddRecord" value="' . _('Add') . '">'; } echo '</div>'; echo '<div class="centre">'; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-04-18 00:09:23 UTC (rev 4553) +++ trunk/doc/Change.log.html 2011-04-18 07:49:36 UTC (rev 4554) @@ -1,6 +1,11 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p /> - +<p /> +<p>18/4/11 - Version 4.03.8 Release +<p> +<p>18/4/11 Phil: Update zh_HK.utf8, pt_BR.utf8, fa_IR.utf8 from launchpad translations</p> +<p>18/4/11 Phil: Changed PurchData.php back to now have free form text entry of unit of measure - as suggested by Brian May - think it works better this way</p> +<p>18/4/11 Phil: Removed redundant fields that are not used anywhere from DefinePOClass and the various function to add lines to purchase orders and to update purhcase order lines - netweight, cuft, kgs, itemno, total_quantity etc. all this data can be retrieved without duplication in purchorderdetails</p> <p>16/4/11 Phil: Tim's changes in launchpad fork to 4663 - xhtml syntax fixes</p> <p>15/4/11 Phil: Copy Exson's traditional Chinese back to zh_HK.utf8</p> <p>11/4/11 Ricard: new pcAuthorizeExpenses.php that shows the current balance of the tab to the authorizer. Before the authorizer did not see this information.</p> Modified: trunk/includes/ConnectDB.inc =================================================================== --- trunk/includes/ConnectDB.inc 2011-04-18 00:09:23 UTC (rev 4553) +++ trunk/includes/ConnectDB.inc 2011-04-18 07:49:36 UTC (rev 4554) @@ -4,7 +4,7 @@ * this value is saved in the $_SESSION['Versionumber'] when includes/GetConfig.php is run * if VersionNumber is < $Version then the DB update script is run */ -$Version='4.03.7'; //must update manually every time there is a DB change +$Version='4.03.8'; //must update manually every time there is a DB change require_once ($PathPrefix .'includes/MiscFunctions.php'); Modified: trunk/includes/DefinePOClass.php =================================================================== --- trunk/includes/DefinePOClass.php 2011-04-18 00:09:23 UTC (rev 4553) +++ trunk/includes/DefinePOClass.php 2011-04-18 07:49:36 UTC (rev 4554) @@ -73,19 +73,10 @@ $QtyRecd=0, $GLActName='', $DecimalPlaces=2, - $ItemNo, $SuppliersUnit, $ConversionFactor=1, $LeadTime=1, $Suppliers_PartNo='', - $SubTotal_Amount=0, - $Package=0, - $PcUnit=0, - $NetWeight=0, - $KGs=0, - $CuFt=0, - $Total_Quantity=0, - $Total_Amount=0, $AssetID=0){ if ($Qty!=0 && isset($Qty)){ @@ -107,19 +98,10 @@ $QtyRecd, $GLActName, $DecimalPlaces, - $ItemNo, $SuppliersUnit, $ConversionFactor, $LeadTime, $Suppliers_PartNo, - $SubTotal_Amount, - $Package, - $PcUnit, - $NetWeight, - $KGs, - $CuFt, - $Total_Quantity, - $Total_Amount, $AssetID); $this->LinesOnOrder++; Return 1; @@ -136,19 +118,9 @@ $ReqDelDate, $ShiptRef, $JobRef , - $ItemNo, $SuppliersUnit, $ConversionFactor, - $Suppliers_PartNo, - $SubTotal_Amount, - $Package, - $PcUnit, - $NetWeight, - $KGs, - $CuFt, - $Total_Quantity, - $Total_Amount, - $SuppUOM){ + $Suppliers_PartNo){ $this->LineItems[$LineNo]->ItemDescription = $ItemDescription; $this->LineItems[$LineNo]->Quantity = $Qty; @@ -158,19 +130,9 @@ $this->LineItems[$LineNo]->ReqDelDate = $ReqDelDate; $this->LineItems[$LineNo]->ShiptRef = $ShiptRef; $this->LineItems[$LineNo]->JobRef = $JobRef; - $this->LineItems[$LineNo]->ItemNo = $ItemNo; $this->LineItems[$LineNo]->SuppliersUnit = $SuppliersUnit; $this->LineItems[$LineNo]->ConversionFactor = $ConversionFactor; $this->LineItems[$LineNo]->Suppliers_PartNo = $Suppliers_PartNo; - $this->LineItems[$LineNo]->Subtotal_Amount = $SubTotal_Amount; - $this->LineItems[$LineNo]->Package = $Package; - $this->LineItems[$LineNo]->PcUnit = $PcUnit; - $this->LineItems[$LineNo]->NetWeight = $NetWeight; - $this->LineItems[$LineNo]->KGs = $KGs; - $this->LineItems[$LineNo]->CuFt = $CuFt; - $this->LineItems[$LineNo]->Total_Quantity = $Total_Quantity; - $this->LineItems[$LineNo]->Total_Amount = $Total_Amount; - $this->LineItems[$LineNo]->SuppUOM = $SuppUOM; } function remove_from_order(&$LineNo){ @@ -248,19 +210,10 @@ var $ShiptRef; var $Completed; Var $JobRef; - Var $ItemNo; var $ConversionFactor; var $SuppliersUnit; Var $Suppliers_PartNo; - Var $SubTotal_Amount; Var $LeadTime; - Var $Package; - Var $PcUnit; - Var $NetWeight; - Var $KGs; - Var $CuFt; - Var $Total_Quantity; - Var $Total_Amount; Var $ReceiveQty; //this receipt of stock Var $Deleted; Var $Controlled; @@ -285,19 +238,10 @@ $QtyRecd, $GLActName, $DecimalPlaces, - $ItemNo, $SuppliersUnit, $ConversionFactor, - $Suppliers_PartNo, - $SubTotal_Amount, $LeadTime, - $Package, - $PcUnit, - $NetWeight, - $KGs, - $CuFt, - $Total_Quantity, - $Total_Amount, + $Suppliers_PartNo, $AssetID) { /* Constructor function to add a new LineDetail object with passed params */ @@ -315,18 +259,10 @@ $this->QtyInv = $QtyInv; $this->GLCode = $GLCode; $this->JobRef = $JobRef; - $this->ItemNo = $ItemNo; $this->SuppliersUnit = $SuppliersUnit; $this->ConversionFactor = $ConversionFactor; $this->Suppliers_PartNo = $Suppliers_PartNo; - $this->Subtotal_Amount = $SubTotal_Amount; $this->LeadTime = $LeadTime; - $this->PcUnit = $PcUnit; - $this->NetWeight = $NetWeight; - $this->KGs = $KGs; - $this->CuFt = $CuFt; - $this->Total_Quantity = $Total_Quantity; - $this->Total_Amount = $Total_Amount; if (is_numeric($ShiptRef)){ $this->ShiptRef = $ShiptRef; } else { Modified: trunk/includes/PO_ReadInOrder.inc =================================================================== --- trunk/includes/PO_ReadInOrder.inc 2011-04-18 00:09:23 UTC (rev 4553) +++ trunk/includes/PO_ReadInOrder.inc 2011-04-18 07:49:36 UTC (rev 4554) @@ -140,18 +140,9 @@ purchorderdetails.completed, purchorderdetails.jobref, purchorderdetails.stdcostunit, - purchorderdetails.itemno, stockmaster.controlled, stockmaster.serialised, stockmaster.decimalplaces, - purchorderdetails.subtotal_amount, - purchorderdetails.package, - purchorderdetails.pcunit, - purchorderdetails.netweight, - purchorderdetails.kgs, - purchorderdetails.cuft, - purchorderdetails.total_quantity, - purchorderdetails.total_amount, purchorderdetails.assetid, purchorderdetails.conversionfactor, purchorderdetails.suppliersunit, @@ -208,19 +199,10 @@ $myrow['quantityrecd'], $myrow['accountname'], $myrow['decimalplaces'], - $myrow['itemno'], $myrow['suppliersunit'], $myrow['conversionfactor'], + 1, $myrow['suppliers_partno'], - $myrow['subtotal_amount'], - 0, - $myrow['package'], - $myrow['pcunit'], - $myrow['netweight'], - $myrow['kgs'], - $myrow['cuft'], - $myrow['total_quantity'], - $myrow['total_amount'], $myrow['assetid'] ); $_SESSION['PO'.$identifier]->LineItems[$_SESSION['PO'.$identifier]->LinesOnOrder]->PODetailRec = $myrow['podetailitem']; Modified: trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Modified: trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po 2011-04-18 00:09:23 UTC (rev 4553) +++ trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po 2011-04-18 07:49:36 UTC (rev 4554) @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: webERP 3.08\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-... [truncated message content] |
From: <dai...@us...> - 2011-04-18 07:49:50
|
Revision: 4554 http://web-erp.svn.sourceforge.net/web-erp/?rev=4554&view=rev Author: daintree Date: 2011-04-18 07:49:36 +0000 (Mon, 18 Apr 2011) Log Message: ----------- pre 4.03.8 Modified Paths: -------------- trunk/PO_Header.php trunk/PO_Items.php trunk/PO_PDFPurchOrder.php trunk/PurchData.php trunk/doc/Change.log.html trunk/includes/ConnectDB.inc trunk/includes/DefinePOClass.php trunk/includes/PO_ReadInOrder.inc trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.mo trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po trunk/locale/de_DE.utf8/LC_MESSAGES/messages.mo trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po trunk/locale/el_GR.utf8/LC_MESSAGES/messages.mo trunk/locale/el_GR.utf8/LC_MESSAGES/messages.po trunk/locale/en_GB.utf8/LC_MESSAGES/messages.pot trunk/locale/en_US.utf8/LC_MESSAGES/messages.mo trunk/locale/en_US.utf8/LC_MESSAGES/messages.po trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po trunk/locale/et_EE.utf8/LC_MESSAGES/messages.mo trunk/locale/et_EE.utf8/LC_MESSAGES/messages.po trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.mo trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.po trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.mo trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.po trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.mo trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.po trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.mo trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.po trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.mo trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.po trunk/locale/id_ID.utf8/LC_MESSAGES/messages.mo trunk/locale/id_ID.utf8/LC_MESSAGES/messages.po trunk/locale/it_IT.utf8/LC_MESSAGES/messages.mo trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.mo trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.po trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.mo trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.po trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.mo trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.po trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.mo trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.po trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.po trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.po trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.mo trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.po trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.mo trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.po trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.mo trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.po trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.mo trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.po trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.mo trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.po trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.mo trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.po trunk/locale/vi_VN.utf8/LC_MESSAGES/messages.mo trunk/locale/vi_VN.utf8/LC_MESSAGES/messages.po trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.po trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.po trunk/sql/mysql/upgrade3.11.1-4.00.sql trunk/sql/mysql/weberp-demo.sql trunk/sql/mysql/weberp-new.sql Modified: trunk/PO_Header.php =================================================================== --- trunk/PO_Header.php 2011-04-18 00:09:23 UTC (rev 4553) +++ trunk/PO_Header.php 2011-04-18 07:49:36 UTC (rev 4554) @@ -228,7 +228,7 @@ $_POST['RePrint'] = 0; } - echo "<meta http-equiv='Refresh' content='0; url=" . $rootpath . '/PO_Items.php?identifier='.$identifier. "'>"; + echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/PO_Items.php?identifier='.$identifier. '">'; echo '<p>'; prnMsg(_('You should automatically be forwarded to the entry of the purchase order line items page') . '. ' . _('If this does not happen') . ' (' . _('if the browser does not support META Refresh') . ') ' . @@ -613,6 +613,7 @@ purchdata.suppliersuom, purchdata.suppliers_partno, purchdata.conversionfactor, + purchdata.leadtime, stockcategory.stockact FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid @@ -626,6 +627,9 @@ if (!isset($PurchItemRow['conversionfactor'])) { $PurchItemRow['conversionfactor']=1; } + if (!isset($PurchItemRow['leadtime'])) { + $PurchItemRow['leadtime']=1; + } $_SESSION['PO'.$identifier]->add_to_order( 1, $Purch_Item, @@ -644,18 +648,10 @@ 0, '', $PurchItemRow['decimalplaces'], - $Purch_Item, $PurchItemRow['suppliersuom'], $PurchItemRow['conversionfactor'], - $PurchItemRow['suppliers_partno'], - $Qty*$PurchItemRow['price'], - '', - 0, - 0, - 0, - 0, - $Qty, - $Qty*$PurchItemRow['price']); + $PurchItemRow['leadtime'], + $PurchItemRow['suppliers_partno'] ); echo "<meta http-equiv='Refresh' content='0; url=" . $rootpath . '/PO_Items.php?identifier='.$identifier. "'>"; } Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2011-04-18 00:09:23 UTC (rev 4553) +++ trunk/PO_Items.php 2011-04-18 07:49:36 UTC (rev 4554) @@ -49,7 +49,6 @@ } else { //ok to update the PO object variables $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->Price=(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['SuppPrice'.$POLine->LineNo]))/$_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor); } - $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->NetWeight=$_POST['NetWeight'.$POLine->LineNo]; $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ReqDelDate=$_POST['ReqDelDate'.$POLine->LineNo]; } } @@ -202,57 +201,39 @@ foreach ($_SESSION['PO'.$identifier]->LineItems as $POLine) { if ($POLine->Deleted==False) { $sql = "INSERT INTO purchorderdetails ( orderno, - itemcode, - deliverydate, - itemdescription, - glcode, - unitprice, - quantityord, - shiptref, - jobref, - itemno, - suppliersunit, - suppliers_partno, - subtotal_amount, - package, - pcunit, - netweight, - kgs, - cuft, - total_quantity, - total_amount, - assetid, - conversionfactor ) - VALUES ( - '" . $_SESSION['PO'.$identifier]->OrderNo . "', - '" . $POLine->StockID . "', - '" . FormatDateForSQL($POLine->ReqDelDate) . "', - '" . $POLine->ItemDescription . "', - '" . $POLine->GLCode . "', - '" . $POLine->Price . "', - '" . $POLine->Quantity . "', - '" . $POLine->ShiptRef . "', - '" . $POLine->JobRef . "', - '" . $POLine->ItemNo . "', - '" . $POLine->SuppliersUnit . "', - '" . $POLine->Suppliers_PartNo . "', - '" . $POLine->SubTotal_Amount . "', - '" . $POLine->Package . "', - '" . $POLine->PcUnit . "', - '" . $POLine->NetWeight . "', - '" . $POLine->KGs . "', - '" . $POLine->CuFt . "', - '" . $POLine->Total_Quantity . "', - '" . $POLine->Total_Amount . "', - '" . $POLine->AssetID . "', - '" . $POLine->ConversionFactor . "')"; + itemcode, + deliverydate, + itemdescription, + glcode, + unitprice, + quantityord, + shiptref, + jobref, + suppliersunit, + suppliers_partno, + assetid, + conversionfactor ) + VALUES ( + '" . $_SESSION['PO'.$identifier]->OrderNo . "', + '" . $POLine->StockID . "', + '" . FormatDateForSQL($POLine->ReqDelDate) . "', + '" . $POLine->ItemDescription . "', + '" . $POLine->GLCode . "', + '" . $POLine->Price . "', + '" . $POLine->Quantity . "', + '" . $POLine->ShiptRef . "', + '" . $POLine->JobRef . "', + '" . $POLine->SuppliersUnit . "', + '" . $POLine->Suppliers_PartNo . "', + '" . $POLine->AssetID . "', + '" . $POLine->ConversionFactor . "')"; $ErrMsg =_('One of the purchase order detail records could not be inserted into the database because'); $DbgMsg =_('The SQL statement used to insert the purchase order detail record and failed was'); $result =DB_query($sql,$db,$ErrMsg,$DbgMsg,true); } } /* end of the loop round the detail line items on the order */ - echo '<p>'; + echo '<p />'; prnMsg(_('Purchase Order') . ' ' . $_SESSION['PO'.$identifier]->OrderNo . ' ' . _('on') . ' ' . $_SESSION['PO'.$identifier]->SupplierName . ' ' . _('has been created'),'success'); } else { /*its an existing order need to update the old order info */ @@ -315,17 +296,8 @@ quantityord, shiptref, jobref, - itemno, suppliersunit, suppliers_partno, - subtotal_amount, - package, - pcunit, - netweight, - kgs, - cuft, - total_quantity, - total_amount, assetid, conversionfactor) VALUES ( @@ -338,17 +310,8 @@ '" . $POLine->Quantity . "', '" . $POLine->ShiptRef . "', '" . $POLine->JobRef . "', - '" . $POLine->ItemNo . "', '" . $POLine->SuppliersUnit . "', '" . $POLine->Suppliers_PartNo . "', - '" . $POLine->SubTotal_Amount . "', - '" . $POLine->Package . "', - '" . $POLine->PcUnit . "', - '" . $POLine->NetWeight . "', - '" . $POLine->KGs . "', - '" . $POLine->CuFt . "', - '" . $POLine->Total_Quantity . "', - '" . $POLine->Total_Amount . "', '" . $POLine->AssetID . "', '" . $POLine->ConversionFactor . "')"; @@ -362,17 +325,8 @@ quantityord='" . $POLine->Quantity . "', shiptref='" . $POLine->ShiptRef . "', jobref='" . $POLine->JobRef . "', - itemno='" . $POLine->ItemNo . "', suppliersunit='" . $POLine->SuppliersUnit . "', suppliers_partno='" . $POLine->Suppliers_PartNo . "', - subtotal_amount='" . $POLine->SubTotal_Amount . "', - package='" . $POLine->Package . "', - pcunit='" . $POLine->PcUnit . "', - netweight='" . $POLine->NetWeight . "', - kgs='" . $POLine->KGs . "', - cuft='" . $POLine->CuFt . "', - total_quantity='" . $POLine->Total_Quantity . "', - total_amount='" . $POLine->Total_Amount . "', completed=1, assetid='" . $POLine->AssetID . "', conversionfactor = '" . $POLine->ConversionFactor . "' @@ -386,17 +340,8 @@ quantityord='" . $POLine->Quantity . "', shiptref='" . $POLine->ShiptRef . "', jobref='" . $POLine->JobRef . "', - itemno='" . $POLine->ItemNo . "', suppliersunit='" . $POLine->SuppliersUnit . "', suppliers_partno='" . $POLine->Suppliers_PartNo . "', - subtotal_amount='" . $POLine->SubTotal_Amount . "', - package='" . $POLine->Package . "', - pcunit='" . $POLine->PcUnit . "', - netweight='" . $POLine->NetWeight . "', - kgs='" . $POLine->KGs . "', - cuft='" . $POLine->CuFt . "', - total_quantity='" . $POLine->Total_Quantity . "', - total_amount='" . $POLine->Total_Amount . "', assetid='" . $POLine->AssetID . "', conversionfactor = '" . $POLine->ConversionFactor . "' WHERE podetailitem='" . $POLine->PODetailRec . "'"; @@ -540,19 +485,9 @@ 0, $GLAccountName, 2, - '', $_POST['SuppliersUnit'], 1, '', - '', - ($_POST['Qty']*$_POST['Price']), - '', - '', - '', - '', - '', - $_POST['Qty'], - ($_POST['Qty']*$_POST['Price']), $_POST['AssetID']); include ('includes/PO_UnsetFormVbls.php'); } @@ -592,8 +527,6 @@ stockid, units, decimalplaces, - kgs, - netweight, stockact, accountname FROM stockmaster INNER JOIN stockcategory @@ -612,12 +545,10 @@ conversionfactor, supplierdescription, suppliersuom, - unitname, suppliers_partno, leadtime, MAX(purchdata.effectivefrom) AS latesteffectivefrom - FROM purchdata LEFT JOIN unitsofmeasure - ON purchdata.suppliersuom=unitsofmeasure.unitid + FROM purchdata WHERE purchdata.supplierno = '" . $_SESSION['PO'.$identifier]->SupplierID . "' AND purchdata.effectivefrom <='" . Date('Y-m-d') . "' AND purchdata.stockid = '". $ItemCode . "' @@ -625,7 +556,6 @@ purchdata.conversionfactor, purchdata.supplierdescription, purchdata.suppliersuom, - unitsofmeasure.unitname, purchdata.suppliers_partno, purchdata.leadtime"; @@ -637,14 +567,14 @@ $PurchPrice = $PurchRow['price']/$PurchRow['conversionfactor']; $ConversionFactor = $PurchRow['conversionfactor']; $SupplierDescription = $PurchRow['suppliers_partno'] .' - ' . $PurchRow['supplierdescription']; - $SuppliersUnitOfMeasure = $PurchRow['unitname']; + $SuppliersUnitOfMeasure = $PurchRow['suppliersuom']; $SuppliersPartNo = $PurchRow['suppliers_partno']; $LeadTime = $PurchRow['leadtime']; } else { // no purchasing data setup $PurchPrice = 0; $ConversionFactor = 1; $SupplierDescription = $ItemRow['description']; - $SuppliersUnitOfMeasure = $ItemRow['units']; + $SuppliersUnitOfMeasure = $ItemRow['unitname']; $SuppliersPartNo = ''; $LeadTime = 1; } @@ -666,19 +596,11 @@ 0, $Itemrow['accountname'], $ItemRow['decimalplaces'], - $ItemCode, $SuppliersUnitOfMeasure, $ConversionFactor, $LeadTime, - $SuppliersPartNo, - $Quantity*$PurchPrice, - '', - 0, - $ItemRow['netweight'], - $ItemRow['kgs'], - '', - $Quantity, - $Quantity*$PurchPrice ); + $SuppliersPartNo + ); } else { //no rows returned by the SQL to get the item prnMsg (_('The item code') . ' ' . $ItemCode . ' ' . _('does not exist in the database and therefore cannot be added to the order'),'error'); if ($debug==1){ @@ -711,15 +633,14 @@ echo '<tr> <th>' . _('Item Code') . '</th> <th>' . _('Description') . '</th> - <th>' . _('Weight') . '</th> <th>' . _('Quantity Our Units') . '</th> <th>' . _('Our Unit') .'</th> <th>' . _('Price Our Units') .' ('.$_SESSION['PO'.$identifier]->CurrCode. ')</th> <th>' . _('Unit Conversion Factor') . '</th> - <th>' . _('Quantity Supplier Units') . '</th> + <th>' . _('Order Quantity') . '<br />' . _('Supplier Units') . '</th> <th>' . _('Supplier Unit') . '</th> - <th>' . _('Price Supp Units') . ' ('.$_SESSION['PO'.$identifier]->CurrCode. ')</th> - <th>' . _('Subtotal') .' ('.$_SESSION['PO'.$identifier]->CurrCode. ')</th> + <th>' . _('Order Price') . '<br />' . _('Supp Units') . ' ('.$_SESSION['PO'.$identifier]->CurrCode. ')</th> + <th>' . _('Sub-Total') .' ('.$_SESSION['PO'.$identifier]->CurrCode. ')</th> <th>' . _('Deliver By') .'</th> </tr>'; @@ -749,7 +670,6 @@ echo '<td>' . $POLine->StockID . '</td> <td>' . $POLine->ItemDescription . '</td> - <td><input type="text" class="number" name="NetWeight' . $POLine->LineNo . '" size="8" value="' . $POLine->NetWeight . '"></td> <td class="number">' . number_format($POLine->Quantity,$POLine->DecimalPlaces) . '</td> <td>' . $POLine->Units . '</td> <td class="number">' . $DisplayPrice . '</td> @@ -759,7 +679,7 @@ <td><input type="text" class="number" name="SuppPrice' . $POLine->LineNo . '" size="10" value="' .number_format(($POLine->Price *$POLine->ConversionFactor),2) .'"></td> <td class="number">' . $DisplayLineTotal . '</td> <td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'].'" name="ReqDelDate' . $POLine->LineNo.'" size="10" value="' .$POLine->ReqDelDate .'"></td> - <td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . 'identifier='.$identifier. '&Delete=' . $POLine->LineNo . '">' . _('Delete') . '</a></td></tr>'; + <td><a href="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier. '&Delete=' . $POLine->LineNo . '">' . _('Delete') . '</a></td></tr>'; $_SESSION['PO'.$identifier]->Total = $_SESSION['PO'.$identifier]->Total + $LineTotal; } } @@ -777,14 +697,15 @@ if (isset($_POST['NonStockOrder'])) { - echo '<br /><table class=selection><tr><td>' . _('Item Description') . '</td>'; + echo '<br /><table class="selection"><tr> + <td>' . _('Item Description') . '</td>'; echo '<td><input type=text name=ItemDescription size=40></td></tr>'; echo '<tr><td>' . _('General Ledger Code') . '</td>'; echo '<td><select name="GLCode">'; - $sql='SELECT accountcode, + $sql="SELECT accountcode, accountname FROM chartmaster - ORDER BY accountcode ASC'; + ORDER BY accountcode ASC"; $result=DB_query($sql, $db); while ($myrow=DB_fetch_array($result)) { @@ -793,7 +714,7 @@ echo '</select></td></tr>'; echo '<tr><td>'._('OR Asset ID'). '</td> <td><select name="AssetID">'; - $AssetsResult = DB_query('SELECT assetid, description, datepurchased FROM fixedassets ORDER BY assetid DESC',$db); + $AssetsResult = DB_query("SELECT assetid, description, datepurchased FROM fixedassets ORDER BY assetid DESC",$db); echo '<option selected value="Not an Asset">' . _('Not an Asset') . '</option>'; while ($AssetRow = DB_fetch_array($AssetsResult)){ if ($AssetRow['datepurchased']=='0000-00-00'){ @@ -831,42 +752,26 @@ $sql = "SELECT stockmaster.stockid, stockmaster.description, - stockmaster.units, - purchdata.conversionfactor, - unitsofmeasure.unitname + stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - LEFT JOIN purchdata - ON stockmaster.stockid=purchdata.stockid - LEFT JOIN unitsofmeasure - ON unitsofmeasure.unitid=purchdata.suppliersuom WHERE stockmaster.mbflag<>'D' AND stockmaster.mbflag<>'K' AND stockmaster.mbflag<>'G' AND stockmaster.discontinued<>1 AND stockmaster.description " . LIKE . " '" . $SearchString ."' - AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' - OR purchdata.supplierno IS NULL) ORDER BY stockmaster.stockid LIMIT " .$_SESSION['DefaultDisplayRecordsMax']; } else { $sql = "SELECT stockmaster.stockid, stockmaster.description, - stockmaster.units, - purchdata.conversionfactor, - unitsofmeasure.unitname + stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - LEFT JOIN purchdata - ON stockmaster.stockid=purchdata.stockid - LEFT JOIN unitsofmeasure - ON unitsofmeasure.unitid=purchdata.suppliersuom WHERE stockmaster.mbflag<>'D' AND stockmaster.mbflag<>'K' AND stockmaster.mbflag<>'G' AND stockmaster.discontinued<>1 - AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' - OR purchdata.supplierno IS NULL) AND stockmaster.description " . LIKE . " '". $SearchString ."' AND stockmaster.categoryid='" . $_POST['StockCat'] . "' ORDER BY stockmaster.stockid @@ -880,42 +785,26 @@ if ($_POST['StockCat']=='All'){ $sql = "SELECT stockmaster.stockid, stockmaster.description, - stockmaster.units, - purchdata.conversionfactor, - unitsofmeasure.unitname + stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - LEFT JOIN purchdata - ON stockmaster.stockid=purchdata.stockid - LEFT JOIN unitsofmeasure - ON unitsofmeasure.unitid=purchdata.suppliersuom WHERE stockmaster.mbflag<>'D' AND stockmaster.mbflag<>'K' AND stockmaster.mbflag<>'G' AND stockmaster.discontinued<>1 - AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' - OR purchdata.supplierno IS NULL) AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' ORDER BY stockmaster.stockid LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; } else { $sql = "SELECT stockmaster.stockid, stockmaster.description, - stockmaster.units, - purchdata.conversionfactor, - unitsofmeasure.unitname + stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - LEFT JOIN purchdata - ON stockmaster.stockid=purchdata.stockid - LEFT JOIN unitsofmeasure - ON unitsofmeasure.unitid=purchdata.suppliersuom WHERE stockmaster.mbflag<>'D' AND stockmaster.mbflag<>'K' AND stockmaster.mbflag<>'G' and stockmaster.discontinued<>1 - AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' - OR purchdata.supplierno IS NULL) AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' AND stockmaster.categoryid='" . $_POST['StockCat'] . "' ORDER BY stockmaster.stockid @@ -926,41 +815,25 @@ if ($_POST['StockCat']=='All'){ $sql = "SELECT stockmaster.stockid, stockmaster.description, - stockmaster.units, - purchdata.conversionfactor, - unitsofmeasure.unitname + stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - LEFT JOIN purchdata - ON stockmaster.stockid=purchdata.stockid - LEFT JOIN unitsofmeasure - ON unitsofmeasure.unitid=purchdata.suppliersuom WHERE stockmaster.mbflag<>'D' AND stockmaster.mbflag<>'K' AND stockmaster.mbflag<>'G' AND stockmaster.discontinued<>1 - AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' - OR purchdata.supplierno IS NULL) ORDER BY stockmaster.stockid LIMIT " . $_SESSION['DefaultDisplayRecordsMax']; } else { $sql = "SELECT stockmaster.stockid, stockmaster.description, - stockmaster.units, - purchdata.conversionfactor, - unitsofmeasure.unitname + stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - LEFT JOIN purchdata - ON stockmaster.stockid=purchdata.stockid - LEFT JOIN unitsofmeasure - ON unitsofmeasure.unitid=purchdata.suppliersuom WHERE stockmaster.mbflag<>'D' AND stockmaster.mbflag<>'K' AND stockmaster.mbflag<>'G' AND stockmaster.discontinued<>1 - AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' - OR purchdata.supplierno IS NULL) AND stockmaster.categoryid='" . $_POST['StockCat'] . "' ORDER BY stockmaster.stockid LIMIT " . $_SESSION['DefaultDisplayRecordsMax']; @@ -994,11 +867,16 @@ $DbgMsg = _('The SQL used to retrieve the category details but failed was'); $result1 = DB_query($sql,$db,$ErrMsg,$DbgMsg); - echo '<table class=selection><tr><th colspan=3><font size=3 color=blue>'. _('Search For Stock Items') . '</th>'; + echo '<table class=selection> + <tr> + <th colspan=3><font size=3 color=blue>'. _('Search For Stock Items') . '</th>'; - echo ':</font></tr><tr><td><select name="StockCat">'; + echo ':</font> + </tr> + <tr><td><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>'; @@ -1019,16 +897,17 @@ } echo '</select></td> - <td>' . _('Enter text extracts in the description') . ":</td> - <td><input type='text' name='Keywords' size=20 maxlength=25 value='" . $_POST['Keywords'] . "'></td></tr> + <td>' . _('Enter text extracts in the description') . ':</td> + <td><input type="text" name="Keywords" size=20 maxlength=25 value="' . $_POST['Keywords'] . '"></td></tr> <tr><td></td> - <td><font size=3><b>" . _('OR') . ' </b></font>' . _('Enter extract of the Stock Code') . - ":</td> - <td><input type='text' name='StockCode' size=15 maxlength=18 value='" . $_POST['StockCode'] . "'></td> + <td><font size=3><b>' . _('OR') . ' </b></font>' . _('Enter extract of the Stock Code') . ':</td> + <td><input type="text" name="StockCode" size=15 maxlength=18 value="' . $_POST['StockCode'] . '"></td> </tr> <tr><td></td> - <td><font size=3><b>" . _('OR') . ' </b></font><a target="_blank" href="'.$rootpath.'/Stocks.php?">' . _('Create a New Stock Item') . '</a></td></tr> - </table><br /> + <td><font size=3><b>' . _('OR') . ' </b></font><a target="_blank" href="'.$rootpath.'/Stocks.php">' . _('Create a New Stock Item') . '</a></td></tr> + </table> + <br /> + <div class="centre"><input type="submit" name="Search" value="' . _('Search Now') . '"> <input type="submit" name="NonStockOrder" value="' . _('Order a non stock item') . '"> </div><br />'; @@ -1070,9 +949,19 @@ $ImageSource = '<i>'._('No Image').'</i>'; } - if (strlen($myrow['unitname'])>0) { - $OrderUnits=$myrow['unitname']; - $ConversionFactor =$myrow['conversionfactor']; + /*Get conversion factor and supplier units if any */ + $sql = "SELECT purchdata.conversionfactor, + purchdata.suppliersuom + FROM purchdata + WHERE purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID . "' + AND purchdata.stockid='" . $myrow['stockid'] . "'"; + $ErrMsg = _('Could not retrieve the purchasing data for the item'); + $PurchDataResult = DB_query($sql,$db,$ErrMsg); + + if (DB_num_rows($PurchDataResult)>0) { + $PurchDataRow = DB_fetch_array($PurchDataResult); + $OrderUnits=$PurchDataRow['suppliersuom']; + $ConversionFactor =$PurchDataRow['conversionfactor']; } else { $OrderUnits=$myrow['units']; $ConversionFactor =1; Modified: trunk/PO_PDFPurchOrder.php =================================================================== --- trunk/PO_PDFPurchOrder.php 2011-04-18 00:09:23 UTC (rev 4553) +++ trunk/PO_PDFPurchOrder.php 2011-04-18 07:49:36 UTC (rev 4554) @@ -1,6 +1,7 @@ <?php + /* $Id$*/ -//$PageSecurity = 2; + include('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); include('includes/DefinePOClass.php'); @@ -69,31 +70,31 @@ $ErrMsg = _('There was a problem retrieving the purchase order header details for Order Number'). ' ' . $OrderNo . ' ' . _('from the database'); $sql = "SELECT purchorders.supplierno, - suppliers.suppname, - suppliers.address1, - suppliers.address2, - suppliers.address3, - suppliers.address4, - purchorders.comments, - purchorders.orddate, - purchorders.rate, - purchorders.dateprinted, - purchorders.deladd1, - purchorders.deladd2, - purchorders.deladd3, - purchorders.deladd4, - purchorders.deladd5, - purchorders.deladd6, - purchorders.allowprint, - purchorders.requisitionno, - purchorders.initiator, - purchorders.paymentterms, - suppliers.currcode, - purchorders.status, - purchorders.stat_comment - FROM purchorders INNER JOIN suppliers - ON purchorders.supplierno = suppliers.supplierid - WHERE purchorders.orderno='" . $OrderNo ."'"; + suppliers.suppname, + suppliers.address1, + suppliers.address2, + suppliers.address3, + suppliers.address4, + purchorders.comments, + purchorders.orddate, + purchorders.rate, + purchorders.dateprinted, + purchorders.deladd1, + purchorders.deladd2, + purchorders.deladd3, + purchorders.deladd4, + purchorders.deladd5, + purchorders.deladd6, + purchorders.allowprint, + purchorders.requisitionno, + purchorders.initiator, + purchorders.paymentterms, + suppliers.currcode, + purchorders.status, + purchorders.stat_comment + FROM purchorders INNER JOIN suppliers + ON purchorders.supplierno = suppliers.supplierid + WHERE purchorders.orderno='" . $OrderNo ."'"; $result=DB_query($sql,$db, $ErrMsg); if (DB_num_rows($result)==0){ /*There is no order header returned */ $title = _('Print Purchase Order Error'); @@ -101,16 +102,16 @@ echo '<div class="centre"><br /><br /><br />'; prnMsg( _('Unable to Locate Purchase Order Number') . ' : ' . $OrderNo . ' ', 'error'); echo '<br /> - <br /> - <br /> - <table class="table_index"> - <tr><td class="menu_group_item"> - <li><a href="'. $rootpath . '/PO_SelectOSPurchOrder.php?'.SID .'">' . _('Outstanding Purchase Orders') . '</a></li> - <li><a href="'. $rootpath . '/PO_SelectPurchOrder.php?'. SID .'">' . _('Purchase Order Inquiry') . '</a></li> - </td> - </tr> - </table> - </div><br /><br /><br />'; + <br /> + <br /> + <table class="table_index"> + <tr><td class="menu_group_item"> + <li><a href="'. $rootpath . '/PO_SelectOSPurchOrder.php?'.SID .'">' . _('Outstanding Purchase Orders') . '</a></li> + <li><a href="'. $rootpath . '/PO_SelectPurchOrder.php?'. SID .'">' . _('Purchase Order Inquiry') . '</a></li> + </td> + </tr> + </table> + </div><br /><br /><br />'; include('includes/footer.inc'); exit(); } elseif (DB_num_rows($result)==1){ /*There is only one order header returned (as it should be!)*/ @@ -192,17 +193,17 @@ $ErrMsg = _('There was a problem retrieving the line details for order number') . ' ' . $OrderNo . ' ' . _('from the database'); $sql = "SELECT itemcode, - deliverydate, - itemdescription, - unitprice, - suppliersunit, - quantityord, - decimalplaces, - conversionfactor, - suppliers_partno - FROM purchorderdetails LEFT JOIN stockmaster - ON purchorderdetails.itemcode=stockmaster.stockid - WHERE orderno ='" . $OrderNo ."'"; + deliverydate, + itemdescription, + unitprice, + suppliersunit, + quantityord, + decimalplaces, + conversionfactor, + suppliers_partno + FROM purchorderdetails LEFT JOIN stockmaster + ON purchorderdetails.itemcode=stockmaster.stockid + WHERE orderno ='" . $OrderNo ."'"; $result=DB_query($sql,$db); } if ($OrderNo=='Preview' or DB_num_rows($result)>0){ @@ -210,7 +211,8 @@ include('includes/PO_PDFOrderPageHeader.inc'); $YPos=$Page_Height - $FormDesign->Data->y; $OrderTotal = 0; - while ((isset($OrderNo) and $OrderNo=='Preview') or (isset($result) and $POLine=DB_fetch_array($result))) { + while ((isset($OrderNo) and $OrderNo=='Preview') + OR (isset($result) and $POLine=DB_fetch_array($result))) { /* If we are previewing the order then fill the * order line with dummy data */ if ($OrderNo=='Preview') { @@ -306,33 +308,33 @@ $StatusComment = date($_SESSION['DefaultDateFormat']) .' - ' . _('Printed by') . '<a href="mailto:'.$_SESSION['UserEmail'] .'">'.$_SESSION['UsersRealName']. '</a><br />' . $POHeader['stat_comment']; $sql = "UPDATE purchorders SET allowprint = 0, - dateprinted = '" . Date('Y-m-d') . "', - status = 'Printed', - stat_comment = '" . $StatusComment . "' - WHERE purchorders.orderno = '" . $OrderNo."'"; + dateprinted = '" . Date('Y-m-d') . "', + status = 'Printed', + stat_comment = '" . $StatusComment . "' + WHERE purchorders.orderno = '" . $OrderNo."'"; $result = DB_query($sql,$db); } } /* There was enough info to either print or email the purchase order */ else { /*the user has just gone into the page need to ask the question whether to print the order or email it to the supplier */ include ('includes/header.inc'); - echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if ($ViewingOnly==1){ - echo '<input type=hidden name="ViewingOnly" VALUE=1>'; + echo '<input type=hidden name="ViewingOnly" value=1>'; } echo '<br /><br />'; - echo '<input type=hidden name="OrderNo" VALUE="'. $OrderNo. '">'; + echo '<input type=hidden name="OrderNo" value="'. $OrderNo. '">'; echo '<table><tr><td>'. _('Print or Email the Order'). '</td><td> <select name="PrintOrEmail">'; if (!isset($_POST['PrintOrEmail'])){ $_POST['PrintOrEmail'] = 'Print'; } if ($_POST['PrintOrEmail']=='Print'){ - echo '<option selected VALUE="Print">'. _('Print'); - echo '<option VALUE="Email">' . _('Email'); + echo '<option selected value="Print">'. _('Print'); + echo '<option value="Email">' . _('Email'); } else { - echo '<option VALUE="Print">'. _('Print'); - echo '<option selected VALUE="Email">'. _('Email'); + echo '<option value="Print">'. _('Print'); + echo '<option selected value="Email">'. _('Email'); } echo '</select></td></tr>'; echo '<tr><td>'. _('Show Amounts on the Order'). '</td><td> @@ -341,29 +343,29 @@ $_POST['ShowAmounts'] = 'Yes'; } if ($_POST['ShowAmounts']=='Yes'){ - echo '<option selected VALUE="Yes">'. _('Yes'); - echo '<option VALUE="No">' . _('No'); + echo '<option selected value="Yes">'. _('Yes'); + echo '<option value="No">' . _('No'); } else { - echo '<option VALUE="Yes">'. _('Yes'); - echo '<option selected VALUE="No">'. _('No'); + echo '<option value="Yes">'. _('Yes'); + echo '<option selected value="No">'. _('No'); } echo '</select></td></tr>'; if ($_POST['PrintOrEmail']=='Email'){ $ErrMsg = _('There was a problem retrieving the contact details for the supplier'); $SQL = "SELECT suppliercontacts.contact, - suppliercontacts.email - FROM suppliercontacts INNER JOIN purchorders - ON suppliercontacts.supplierid=purchorders.supplierno - WHERE purchorders.orderno='".$OrderNo."'"; + suppliercontacts.email + FROM suppliercontacts INNER JOIN purchorders + ON suppliercontacts.supplierid=purchorders.supplierno + WHERE purchorders.orderno='".$OrderNo."'"; $ContactsResult=DB_query($SQL,$db, $ErrMsg); if (DB_num_rows($ContactsResult)>0){ echo '<tr><td>'. _('Email to') .':</td><td><select name="EmailTo">'; while ($ContactDetails = DB_fetch_array($ContactsResult)){ if (strlen($ContactDetails['email'])>2 AND strpos($ContactDetails['email'],'@')>0){ if ($_POST['EmailTo']==$ContactDetails['email']){ - echo '<option selected VALUE="' . $ContactDetails['email'] . '">' . $ContactDetails['Contact'] . ' - ' . $ContactDetails['email'] . '</option>'; + echo '<option selected value="' . $ContactDetails['email'] . '">' . $ContactDetails['Contact'] . ' - ' . $ContactDetails['email'] . '</option>'; } else { - echo '<option VALUE="' . $ContactDetails['email'] . '">' . $ContactDetails['contact'] . ' - ' . $ContactDetails['email'] . '</option>'; + echo '<option value="' . $ContactDetails['email'] . '">' . $ContactDetails['contact'] . ' - ' . $ContactDetails['email'] . '</option>'; } } } @@ -377,7 +379,7 @@ } else { echo '</table>'; } - echo '<br /><div class="centre"><input type=submit name="DoIt" VALUE="' . _('OK') . '"></div>'; + echo '<br /><div class="centre"><input type=submit name="DoIt" value="' . _('OK') . '"></div>'; echo '</form>'; include('includes/footer.inc'); } Modified: trunk/PurchData.php =================================================================== --- trunk/PurchData.php 2011-04-18 00:09:23 UTC (rev 4553) +++ trunk/PurchData.php 2011-04-18 07:49:36 UTC (rev 4554) @@ -32,34 +32,42 @@ } if ((isset($_POST['AddRecord']) OR isset($_POST['UpdateRecord'])) AND isset($SupplierID)) { /*Validate Inputs */ - $InputError = 0; /*Start assuming the best */ - if ($StockID == '' OR !isset($StockID)) { - $InputError = 1; - prnMsg(_('There is no stock item set up enter the stock code or select a stock item using the search page'), 'error'); - } - if (!is_numeric($_POST['Price'])) { - $InputError = 1; - unset($_POST['Price']); - prnMsg(_('The price entered was not numeric and a number is expected. No changes have been made to the database'), 'error'); - } - if ($_POST['Price'] == 0) { - prnMsg(_('The price entered is zero') . ' ' . _('Is this intentional?'), 'warn'); - } - if (!is_numeric($_POST['LeadTime'])) { - $InputError = 1; - unset($_POST['LeadTime']); - prnMsg(_('The lead time entered was not numeric a number of days is expected no changes have been made to the database'), 'error'); - } - if (!is_numeric($_POST['MinOrderQty'])) { - $InputError = 1; - unset($_POST['MinOrderQty']); - prnMsg(_('The minimum order quantity was not numeric and a number is expected no changes have been made to the database'), 'error'); - } - if (!is_numeric($_POST['ConversionFactor'])) { - $InputError = 1; - unset($_POST['ConversionFactor']); - prnMsg(_('The conversion factor entered was not numeric') . ' (' . _('a number is expected') . '). ' . _('The conversion factor is the number which the price must be divided by to get the unit price in our unit of measure') . '. <br />' . _('E.g.') . ' ' . _('The supplier sells an item by the tonne and we hold stock by the kg') . '. ' . _('The suppliers price must be divided by 1000 to get to our cost per kg') . '. ' . _('The conversion factor to enter is 1000') . '. <br /><br />' . _('No changes will be made to the database'), 'error'); - } + $InputError = 0; /*Start assuming the best */ + if ($StockID == '' OR !isset($StockID)) { + $InputError = 1; + prnMsg(_('There is no stock item set up enter the stock code or select a stock item using the search page'), 'error'); + } + if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['Price'])))) { + $InputError = 1; + unset($_POST['Price']); + prnMsg(_('The price entered was not numeric and a number is expected. No changes have been made to the database'), 'error'); + } else { + $_POST['Price'] = doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['Price'])); + } + if ($_POST['Price'] == 0) { + prnMsg(_('The price entered is zero') . ' ' . _('Is this intentional?'), 'warn'); + } + if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['LeadTime'])))) { + $InputError = 1; + unset($_POST['LeadTime']); + prnMsg(_('The lead time entered was not numeric a number of days is expected no changes have been made to the database'), 'error'); + } else { + $_POST['LeadTime'] = doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['LeadTime'])); + } + if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['MinOrderQty'])))) { + $InputError = 1; + unset($_POST['MinOrderQty']); + prnMsg(_('The minimum order quantity was not numeric and a number is expected no changes have been made to the database'), 'error'); + } else { + $_POST['MinOrderQty'] =doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['MinOrderQty'])); + } + if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['ConversionFactor'])))) { + $InputError = 1; + unset($_POST['ConversionFactor']); + prnMsg(_('The conversion factor entered was not numeric') . ' (' . _('a number is expected') . '). ' . _('The conversion factor is the number which the price must be divided by to get the unit price in our unit of measure') . '. <br />' . _('E.g.') . ' ' . _('The supplier sells an item by the tonne and we hold stock by the kg') . '. ' . _('The suppliers price must be divided by 1000 to get to our cost per kg') . '. ' . _('The conversion factor to enter is 1000') . '. <br /><br />' . _('No changes will be made to the database'), 'error'); + } else { + $_POST['ConversionFactor'] =doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['ConversionFactor'])); + } if ($InputError == 0 AND isset($_POST['AddRecord'])) { $sql = "INSERT INTO purchdata (supplierno, stockid, @@ -137,23 +145,21 @@ if (!isset($_GET['Edit'])) { echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . ' ' . _('For Stock Code') . ' - ' . $StockID . '</p><br />'; $sql = "SELECT purchdata.supplierno, - suppliers.suppname, - purchdata.price, - suppliers.currcode, - purchdata.effectivefrom, - unitsofmeasure.unitname, - purchdata.supplierdescription, - purchdata.leadtime, - purchdata.suppliers_partno, - purchdata.minorderqty, - purchdata.preferred, - purchdata.conversionfactor - FROM purchdata INNER JOIN suppliers - ON purchdata.supplierno=suppliers.supplierid - LEFT JOIN unitsofmeasure - ON purchdata.suppliersuom=unitsofmeasure.unitid - WHERE purchdata.stockid = '" . $StockID . "' - ORDER BY purchdata.effectivefrom DESC"; + suppliers.suppname, + purchdata.price, + suppliers.currcode, + purchdata.effectivefrom, + purchdata.suppliersuom, + purchdata.supplierdescription, + purchdata.leadtime, + purchdata.suppliers_partno, + purchdata.minorderqty, + purchdata.preferred, + purchdata.conversionfactor + FROM purchdata INNER JOIN suppliers + ON purchdata.supplierno=suppliers.supplierid + WHERE purchdata.stockid = '" . $StockID . "' + ORDER BY purchdata.effectivefrom DESC"; $ErrMsg = _('The supplier purchasing details for the selected part could not be retrieved because'); $PurchDataResult = DB_query($sql, $db, $ErrMsg); if (DB_num_rows($PurchDataResult) == 0 and $StockID != '') { @@ -206,7 +212,7 @@ </tr>", $myrow['suppname'], number_format($myrow['price'], 3), - $myrow['unitname'], + $myrow['suppliersuom'], $myrow['conversionfactor'], number_format($myrow['price']/$myrow['conversionfactor'],2), $myrow['currcode'], @@ -260,7 +266,7 @@ echo '<td>' . _('Text in Supplier') . ' <b>' . _('CODE') . '</b>:</font></td>'; echo '<td><input type="Text" name="SupplierCode" size=15 maxlength=18></td>'; echo '</tr></table><br />'; - echo '<div class="centre"><input type=submit name="SearchSupplier" VALUE="' . _('Find Suppliers Now') . '"></div></form>'; + echo '<div class="centre"><input type=submit name="SearchSupplier" value="' . _('Find Suppliers Now') . '"></div></form>'; include ('includes/footer.inc'); exit; }; @@ -347,13 +353,20 @@ echo '<tr class="OddTableRows">'; $k++; } - printf("<td><font size=1><input type=submit name='SupplierID' VALUE='%s'</font></td> - <td><font size=1>%s</font></td> - <td><font size=1>%s</font></td> - <td><font size=1>%s</font></td> - <td><font size=1>%s</font></td> - <td><font size=1>%s</font></td> - </tr>", $myrow['supplierid'], $myrow['suppname'], $myrow['currcode'], $myrow['address1'], $myrow['address2'], $myrow['address3']); + printf('<td><font size=1><input type="submit" name="SupplierID" value="%s"</font></td> + <td><font size=1>%s</font></td> + <td><font size=1>%s</font></td> + <td><font size=1>%s</font></td> + <td><font size=1>%s</font></td> + <td><font size=1>%s</font></td> + </tr>', + $myrow['supplierid'], + $myrow['suppname'], + $myrow['currcode'], + $myrow['address1'], + $myrow['address2'], + $myrow['address3']); + echo '<input type=hidden name=StockID value="' . $StockID . '">'; echo '<input type=hidden name=StockUOM value="' . $StockUOM . '">'; @@ -405,17 +418,18 @@ $_POST['SupplierCode'] = $myrow['suppliers_partno']; $StockUOM=$myrow['units']; } - 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'] . '" />'; if (!isset($SupplierID)) { $SupplierID = ''; } if (isset($_GET['Edit'])) { echo '<tr><td>' . _('Supplier Name') . ':</td> - <td><input type=hidden name="SupplierID" VALUE="' . $SupplierID . '">' . $SupplierID . ' - ' . $SuppName . '<input type=hidden name="WasEffectiveFrom" VALUE="' . $myrow['effectivefrom'] . '"></td></tr>'; + <td><input type=hidden name="SupplierID" value="' . $SupplierID . '">' . $SupplierID . ' - ' . $SuppName . '<input type=hidden name="WasEffectiveFrom" value="' . $myrow['effectivefrom'] . '"></td></tr>'; } else { echo '<tr><td>' . _('Supplier Name') . ':</td> - <input type=hidden name="SupplierID" maxlength=10 size=11 VALUE="' . $SupplierID . '">'; + <input type=hidden name="SupplierID" maxlength=10 size=11 value="' . $SupplierID . '">'; if ($SupplierID!='') { echo '<td>'.$SuppName; } @@ -426,7 +440,7 @@ } echo '</td></tr>'; } - echo '<td><input type=hidden name="StockID" maxlength=10 size=11 VALUE="' . $StockID . '">'; + echo '<td><input type=hidden name="StockID" maxlength=10 size=11 value="' . $StockID . '">'; if (!isset($CurrCode)) { $CurrCode = ''; } @@ -449,57 +463,48 @@ $_POST['MinOrderQty'] = '1'; } echo '<tr><td>' . _('Currency') . ':</td> - <td><input type=hidden name="CurrCode" . VALUE="' . $CurrCode . '">' . $CurrCode . '</td></tr>'; + <td><input type=hidden name="CurrCode" . value="' . $CurrCode . '">' . $CurrCode . '</td></tr>'; echo '<tr><td>' . _('Price') . ' (' . _('in Supplier Currency') . '):</td> - <td><input type="text" class="number" name="Price" maxlength=12 size=12 VALUE=' . number_format($_POST['Price'], $myrow['decimalplaces'] ,'.','') . '></td></tr>'; + <td><input type="text" class="number" name="Price" maxlength=12 size=12 value=' . number_format($_POST['Price'], $myrow['decimalplaces']) . '></td></tr>'; echo '<tr><td>' . _('Date Updated') . ':</td> - <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="EffectiveFrom" maxlength=10 size=11 VALUE="' . $_POST['EffectiveFrom'] . '"></td></tr>'; + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="EffectiveFrom" maxlength=10 size=11 value="' . $_POST['EffectiveFrom'] . '"></td></tr>'; echo '<tr><td>' . _('Our Unit of Measure') . ':</td>'; if (isset($SupplierID)) { echo '<td>' . $StockUOM . '</td></tr>'; } echo '<tr><td>' . _('Suppliers Unit of Measure') . ':</td>'; - echo '<td><select name="SuppliersUOM">'; - $sql = 'SELECT * FROM unitsofmeasure'; - $result = DB_query($sql, $db); - while ($myrow = DB_fetch_array($result)) { - if ($_POST['SuppliersUOM'] == $myrow['unitid']) { - echo '<option selected value="' . $myrow['unitid'] . '">' . $myrow['unitname'] . '</option>'; - } else { - echo '<option value="' . $myrow['unitid'] . '">' . $myrow['unitname'] . '</option>'; - } - } - echo '</td></tr>'; + echo '<td><input type="text" name="SuppliersUOM" size="20" maxlength="20" value ="' . $_POST['SuppliersUOM'] . '"/>'; + echo '</td></tr>'; if (!isset($_POST['ConversionFactor']) OR $_POST['ConversionFactor'] == "") { $_POST['ConversionFactor'] = 1; } echo '<tr><td>' . _('Conversion Factor (to our UOM)') . ':</td> - <td><input type=text class=number name="ConversionFactor" maxlength=12 size=12 VALUE=' . $_POST['ConversionFactor'] . '></td></tr>'; + <td><input type=text class=number name="ConversionFactor" maxlength=12 size=12 value=' . $_POST['ConversionFactor'] . '></td></tr>'; echo '<tr><td>' . _('Supplier Stock Code') . ':</td> - <td><input type=text name="SupplierCode" maxlength=15 size=15 VALUE="' . $_POST['SupplierCode'] . '"></td></tr>'; + <td><input type=text name="SupplierCode" maxlength=15 size=15 value="' . $_POST['SupplierCode'] . '"></td></tr>'; echo '<tr><td>' . _('MinOrderQty') . ':</td> - <td><input type=text class=number name="MinOrderQty" maxlength=15 size=15 VALUE="' . $_POST['MinOrderQty'] . '"></td></tr>'; + <td><input type=text class=number name="MinOrderQty" maxlength=15 size=15 value="' . $_POST['MinOrderQty'] . '"></td></tr>'; echo '<tr><td>' . _('Supplier Stock Description') . ':</td> - <td><input type=text name="SupplierDescription" maxlength=50 size=51 VALUE="' . $_POST['SupplierDescription'] . '"></td></tr>'; + <td><input type=text name="SupplierDescription" maxlength=50 size=51 value="' . $_POST['SupplierDescription'] . '"></td></tr>'; if (!isset($_POST['LeadTime']) OR $_POST['LeadTime'] == "") { $_POST['LeadTime'] = 1; } echo '<tr><td>' . _('Lead Time') . ' (' . _('in days from date of order') . '):</td> - <td><input type=text class=number name="LeadTime" maxlength=4 size=5 VALUE=' . $_POST['LeadTime'] . '></td></tr>'; + <td><input type=text class=number name="LeadTime" maxlength=4 size=5 value=' . $_POST['LeadTime'] . '></td></tr>'; echo '<tr><td>' . _('Preferred Supplier') . ':</td> <td><select name="Preferred">'; if ($_POST['Preferred'] == 1) { - echo '<option selected VALUE=1>' . _('Yes') . '</option>'; - echo '<option VALUE=0>' . _('No') . '</option>'; + echo '<option selected value=1>' . _('Yes') . '</option>'; + echo '<option value=0>' . _('No') . '</option>'; } else { - echo '<option VALUE=1>' . _('Yes') . '</option>'; - echo '<option selected VALUE=0>' . _('No') . '</option>'; + echo '<option value=1>' . _('Yes') . '</option>'; + echo '<option selected value=0>' . _('No') . '</option>'; } echo '</select></td></tr></table><br /><div class="centre">'; if (isset($_GET['Edit'])) { - echo '<input type=submit name="UpdateRecord" VALUE="' . _('Update') . '">'; + echo '<input type=submit name="UpdateRecord" value="' . _('Update') . '">'; } else { - echo '<input type=submit name="AddRecord" VALUE="' . _('Add') . '">'; + echo '<input type=submit name="AddRecord" value="' . _('Add') . '">'; } echo '</div>'; echo '<div class="centre">'; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-04-18 00:09:23 UTC (rev 4553) +++ trunk/doc/Change.log.html 2011-04-18 07:49:36 UTC (rev 4554) @@ -1,6 +1,11 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p /> - +<p /> +<p>18/4/11 - Version 4.03.8 Release +<p> +<p>18/4/11 Phil: Update zh_HK.utf8, pt_BR.utf8, fa_IR.utf8 from launchpad translations</p> +<p>18/4/11 Phil: Changed PurchData.php back to now have free form text entry of unit of measure - as suggested by Brian May - think it works better this way</p> +<p>18/4/11 Phil: Removed redundant fields that are not used anywhere from DefinePOClass and the various function to add lines to purchase orders and to update purhcase order lines - netweight, cuft, kgs, itemno, total_quantity etc. all this data can be retrieved without duplication in purchorderdetails</p> <p>16/4/11 Phil: Tim's changes in launchpad fork to 4663 - xhtml syntax fixes</p> <p>15/4/11 Phil: Copy Exson's traditional Chinese back to zh_HK.utf8</p> <p>11/4/11 Ricard: new pcAuthorizeExpenses.php that shows the current balance of the tab to the authorizer. Before the authorizer did not see this information.</p> Modified: trunk/includes/ConnectDB.inc =================================================================== --- trunk/includes/ConnectDB.inc 2011-04-18 00:09:23 UTC (rev 4553) +++ trunk/includes/ConnectDB.inc 2011-04-18 07:49:36 UTC (rev 4554) @@ -4,7 +4,7 @@ * this value is saved in the $_SESSION['Versionumber'] when includes/GetConfig.php is run * if VersionNumber is < $Version then the DB update script is run */ -$Version='4.03.7'; //must update manually every time there is a DB change +$Version='4.03.8'; //must update manually every time there is a DB change require_once ($PathPrefix .'includes/MiscFunctions.php'); Modified: trunk/includes/DefinePOClass.php =================================================================== --- trunk/includes/DefinePOClass.php 2011-04-18 00:09:23 UTC (rev 4553) +++ trunk/includes/DefinePOClass.php 2011-04-18 07:49:36 UTC (rev 4554) @@ -73,19 +73,10 @@ $QtyRecd=0, $GLActName='', $DecimalPlaces=2, - $ItemNo, $SuppliersUnit, $ConversionFactor=1, $LeadTime=1, $Suppliers_PartNo='', - $SubTotal_Amount=0, - $Package=0, - $PcUnit=0, - $NetWeight=0, - $KGs=0, - $CuFt=0, - $Total_Quantity=0, - $Total_Amount=0, $AssetID=0){ if ($Qty!=0 && isset($Qty)){ @@ -107,19 +98,10 @@ $QtyRecd, $GLActName, $DecimalPlaces, - $ItemNo, $SuppliersUnit, $ConversionFactor, $LeadTime, $Suppliers_PartNo, - $SubTotal_Amount, - $Package, - $PcUnit, - $NetWeight, - $KGs, - $CuFt, - $Total_Quantity, - $Total_Amount, $AssetID); $this->LinesOnOrder++; Return 1; @@ -136,19 +118,9 @@ $ReqDelDate, $ShiptRef, $JobRef , - $ItemNo, $SuppliersUnit, $ConversionFactor, - $Suppliers_PartNo, - $SubTotal_Amount, - $Package, - $PcUnit, - $NetWeight, - $KGs, - $CuFt, - $Total_Quantity, - $Total_Amount, - $SuppUOM){ + $Suppliers_PartNo){ $this->LineItems[$LineNo]->ItemDescription = $ItemDescription; $this->LineItems[$LineNo]->Quantity = $Qty; @@ -158,19 +130,9 @@ $this->LineItems[$LineNo]->ReqDelDate = $ReqDelDate; $this->LineItems[$LineNo]->ShiptRef = $ShiptRef; $this->LineItems[$LineNo]->JobRef = $JobRef; - $this->LineItems[$LineNo]->ItemNo = $ItemNo; $this->LineItems[$LineNo]->SuppliersUnit = $SuppliersUnit; $this->LineItems[$LineNo]->ConversionFactor = $ConversionFactor; $this->LineItems[$LineNo]->Suppliers_PartNo = $Suppliers_PartNo; - $this->LineItems[$LineNo]->Subtotal_Amount = $SubTotal_Amount; - $this->LineItems[$LineNo]->Package = $Package; - $this->LineItems[$LineNo]->PcUnit = $PcUnit; - $this->LineItems[$LineNo]->NetWeight = $NetWeight; - $this->LineItems[$LineNo]->KGs = $KGs; - $this->LineItems[$LineNo]->CuFt = $CuFt; - $this->LineItems[$LineNo]->Total_Quantity = $Total_Quantity; - $this->LineItems[$LineNo]->Total_Amount = $Total_Amount; - $this->LineItems[$LineNo]->SuppUOM = $SuppUOM; } function remove_from_order(&$LineNo){ @@ -248,19 +210,10 @@ var $ShiptRef; var $Completed; Var $JobRef; - Var $ItemNo; var $ConversionFactor; var $SuppliersUnit; Var $Suppliers_PartNo; - Var $SubTotal_Amount; Var $LeadTime; - Var $Package; - Var $PcUnit; - Var $NetWeight; - Var $KGs; - Var $CuFt; - Var $Total_Quantity; - Var $Total_Amount; Var $ReceiveQty; //this receipt of stock Var $Deleted; Var $Controlled; @@ -285,19 +238,10 @@ $QtyRecd, $GLActName, $DecimalPlaces, - $ItemNo, $SuppliersUnit, $ConversionFactor, - $Suppliers_PartNo, - $SubTotal_Amount, $LeadTime, - $Package, - $PcUnit, - $NetWeight, - $KGs, - $CuFt, - $Total_Quantity, - $Total_Amount, + $Suppliers_PartNo, $AssetID) { /* Constructor function to add a new LineDetail object with passed params */ @@ -315,18 +259,10 @@ $this->QtyInv = $QtyInv; $this->GLCode = $GLCode; $this->JobRef = $JobRef; - $this->ItemNo = $ItemNo; $this->SuppliersUnit = $SuppliersUnit; $this->ConversionFactor = $ConversionFactor; $this->Suppliers_PartNo = $Suppliers_PartNo; - $this->Subtotal_Amount = $SubTotal_Amount; $this->LeadTime = $LeadTime; - $this->PcUnit = $PcUnit; - $this->NetWeight = $NetWeight; - $this->KGs = $KGs; - $this->CuFt = $CuFt; - $this->Total_Quantity = $Total_Quantity; - $this->Total_Amount = $Total_Amount; if (is_numeric($ShiptRef)){ $this->ShiptRef = $ShiptRef; } else { Modified: trunk/includes/PO_ReadInOrder.inc =================================================================== --- trunk/includes/PO_ReadInOrder.inc 2011-04-18 00:09:23 UTC (rev 4553) +++ trunk/includes/PO_ReadInOrder.inc 2011-04-18 07:49:36 UTC (rev 4554) @@ -140,18 +140,9 @@ purchorderdetails.completed, purchorderdetails.jobref, purchorderdetails.stdcostunit, - purchorderdetails.itemno, stockmaster.controlled, stockmaster.serialised, stockmaster.decimalplaces, - purchorderdetails.subtotal_amount, - purchorderdetails.package, - purchorderdetails.pcunit, - purchorderdetails.netweight, - purchorderdetails.kgs, - purchorderdetails.cuft, - purchorderdetails.total_quantity, - purchorderdetails.total_amount, purchorderdetails.assetid, purchorderdetails.conversionfactor, purchorderdetails.suppliersunit, @@ -208,19 +199,10 @@ $myrow['quantityrecd'], $myrow['accountname'], $myrow['decimalplaces'], - $myrow['itemno'], $myrow['suppliersunit'], $myrow['conversionfactor'], + 1, $myrow['suppliers_partno'], - $myrow['subtotal_amount'], - 0, - $myrow['package'], - $myrow['pcunit'], - $myrow['netweight'], - $myrow['kgs'], - $myrow['cuft'], - $myrow['total_quantity'], - $myrow['total_amount'], $myrow['assetid'] ); $_SESSION['PO'.$identifier]->LineItems[$_SESSION['PO'.$identifier]->LinesOnOrder]->PODetailRec = $myrow['podetailitem']; Modified: trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Modified: trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po 2011-04-18 00:09:23 UTC (rev 4553) +++ trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po 2011-04-18 07:49:36 UTC (rev 4554) @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: webERP 3.08\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-... [truncated message content] |
From: <dai...@us...> - 2011-04-19 10:18:59
|
Revision: 4555 http://web-erp.svn.sourceforge.net/web-erp/?rev=4555&view=rev Author: daintree Date: 2011-04-19 10:18:49 +0000 (Tue, 19 Apr 2011) Log Message: ----------- more quoting xhtml sql Modified Paths: -------------- trunk/DebtorsAtPeriodEnd.php trunk/DeliveryDetails.php trunk/DiscountCategories.php trunk/DiscountMatrix.php trunk/EDIMessageFormat.php trunk/EmailCustTrans.php trunk/ExchangeRateTrend.php trunk/FixedAssetCategories.php trunk/GLAccountInquiry.php trunk/GLBalanceSheet.php trunk/GLBudgets.php trunk/GLTags.php trunk/GLTrialBalance.php trunk/GoodsReceived.php trunk/InventoryQuantities.php trunk/InventoryValuation.php trunk/Locations.php trunk/MRPReschedules.php trunk/OutstandingGRNs.php trunk/geo_displaymap_customers.php trunk/geo_displaymap_suppliers.php trunk/includes/ConnectDB_mysqli.inc trunk/includes/PDFInventoryValnPageHeader.inc trunk/locale/en_GB.utf8/LC_MESSAGES/messages.pot trunk/sql/mysql/upgrade3.11.1-4.00.sql trunk/sql/mysql/weberp-demo.sql trunk/sql/mysql/weberp-new.sql Modified: trunk/DebtorsAtPeriodEnd.php =================================================================== --- trunk/DebtorsAtPeriodEnd.php 2011-04-18 07:49:36 UTC (rev 4554) +++ trunk/DebtorsAtPeriodEnd.php 2011-04-19 10:18:49 UTC (rev 4555) @@ -1,9 +1,7 @@ <?php -//$PageSecurity = 2; /* $Id$*/ -/* $Revision: 1.16 $ */ include('includes/session.inc'); if (isset($_POST['PrintPDF']) @@ -58,9 +56,9 @@ $title = _('Customer Balances') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg(_('The customer 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; @@ -70,7 +68,7 @@ $title = _('Customer Balances') . ' - ' . _('Problem Report'); include('includes/header.inc'); prnMsg(_('The customer details listing has no clients to report on'),'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>'; include('includes/footer.inc'); exit; } @@ -115,22 +113,10 @@ $LeftOvers = $pdf->addTextWrap(50,$YPos,160,$FontSize,_('Total balances'),'left'); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayTotBalance,'right'); - /* UldisN - $buf = $pdf->output(); - $len = strlen($buf); + + $pdf->OutputD($_SESSION['DatabaseName'] . '_DebtorBals_' . date('Y-m-d').'.pdf'); + $pdf->__destruct(); - header('Content-type: application/pdf'); - header("Content-Length: ".$len); - header('Content-Disposition: inline; filename=DebtorBals.pdf'); - header('Expires: 0'); - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header('Pragma: public'); - - $pdf->stream(); - */ - $pdf->OutputD($_SESSION['DatabaseName'] . '_DebtorBals_' . date('Y-m-d').'.pdf');//UldisN - $pdf->__destruct(); //UldisN - } else { /*The option to print PDF was not hit */ $title=_('Debtor Balances'); @@ -142,29 +128,33 @@ /*if $FromCriteria is not set then show a form to allow input */ - 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 Customer Code') .":</font></td><td><input tabindex=1 Type=text maxlength=6 size=7 name=FromCriteria value='1'></td></tr>"; - echo '<tr><td>' . _('To Customer Code') . ":</td><td><input tabindex=2 Type=text maxlength=6 size=7 name=ToCriteria value='zzzzzz'></td></tr>"; + echo '<tr><td>' . _('From Customer Code') .':</font></td> + <td><input tabindex=1 Type=text maxlength=6 size=7 name="FromCriteria" value="1"></td> + </tr>'; + echo '<tr><td>' . _('To Customer Code') . ':</td> + <td><input tabindex=2 type="text" maxlength=6 size=7 name="ToCriteria" value="zzzzzz"></td></tr>'; - echo '<tr><td>' . _('Balances As At') . ":</td><td><select tabindex=3 Name='PeriodEnd'>"; + echo '<tr><td>' . _('Balances As At') . ':</td> + <td><select tabindex=3 name="PeriodEnd">'; - $sql = 'SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC'; + $sql = "SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC"; $Periods = DB_query($sql,$db,_('Could not retrieve period data because'),_('The SQL that failed to get the period data was')); while ($myrow = DB_fetch_array($Periods,$db)){ - echo '<option VALUE=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']); + echo '<option value=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } } echo '</select></td></tr>'; + echo '</table> + <br /><div class="centre"><input tabindex=5 type=submit name="PrintPDF" value="' . _('Print PDF') . '"></div>'; - - echo "</table><br><div class='centre'><input tabindex=5 type=Submit Name='PrintPDF' Value='" . _('Print PDF') . "'></div>"; - include('includes/footer.inc'); } /*end of else not PrintPDF */ Modified: trunk/DeliveryDetails.php =================================================================== --- trunk/DeliveryDetails.php 2011-04-18 07:49:36 UTC (rev 4554) +++ trunk/DeliveryDetails.php 2011-04-19 10:18:49 UTC (rev 4555) @@ -10,7 +10,6 @@ /* Session started in header.inc for password checking the session will contain the details of the order from the Cart class object. The details of the order come from SelectOrderItems.php */ -//$PageSecurity=1; include('includes/session.inc'); $title = _('Order Delivery Details'); include('includes/header.inc'); @@ -644,35 +643,35 @@ WHERE orderno='" .$_SESSION['ExistingOrder'] . "'", $db,$ErrMsg,$DbgMsg,true); $ErrMsg = _('Could not insert the contract bill of materials'); $InsContractBOM = DB_query("INSERT INTO bom (parent, - component, - workcentreadded, - loccode, - effectiveafter, - effectiveto) - SELECT contractref, - stockid, - workcentreadded, - '" . $_SESSION['Items'.$identifier]->Location ."', - '" . Date('Y-m-d') . "', - '2037-12-31' - FROM contractbom - WHERE contractref='" . $ContractRow['contractref'] . "'",$db,$ErrMsg,$DbgMsg); + component, + workcentreadded, + loccode, + effectiveafter, + effectiveto) + SELECT contractref, + stockid, + workcentreadded, + '" . $_SESSION['Items'.$identifier]->Location ."', + '" . Date('Y-m-d') . "', + '2037-12-31' + FROM contractbom + WHERE contractref='" . $ContractRow['contractref'] . "'",$db,$ErrMsg,$DbgMsg); $ErrMsg = _('Unable to insert a new work order for the sales order item'); $InsWOResult = DB_query("INSERT INTO workorders (wo, - loccode, - requiredby, - startdate) - VALUES ('" . $WONo . "', - '" . $_SESSION['Items'.$identifier]->Location ."', - '" . $ContractRow['requireddate'] . "', - '" . Date('Y-m-d'). "')", - $db,$ErrMsg,$DbgMsg); + loccode, + requiredby, + startdate) + VALUES ('" . $WONo . "', + '" . $_SESSION['Items'.$identifier]->Location ."', + '" . $ContractRow['requireddate'] . "', + '" . Date('Y-m-d'). "')", + $db,$ErrMsg,$DbgMsg); //Need to get the latest BOM to roll up cost but also add the contract other requirements $CostResult = DB_query("SELECT SUM((materialcost+labourcost+overheadcost)*contractbom.quantity) AS cost - FROM stockmaster INNER JOIN contractbom - ON stockmaster.stockid=contractbom.stockid - WHERE contractbom.contractref='" . $ContractRow['contractref'] . "'", + FROM stockmaster INNER JOIN contractbom + ON stockmaster.stockid=contractbom.stockid + WHERE contractbom.contractref='" . $ContractRow['contractref'] . "'", $db); $CostRow = DB_fetch_row($CostResult); if (is_null($CostRow[0]) OR $CostRow[0]==0){ @@ -682,8 +681,8 @@ $Cost = $CostRow[0]; //cost of contract BOM } $CostResult = DB_query("SELECT SUM(costperunit*quantity) AS cost - FROM contractreqts - WHERE contractreqts.contractref='" . $ContractRow['contractref'] . "'", + FROM contractreqts + WHERE contractreqts.contractref='" . $ContractRow['contractref'] . "'", $db); $CostRow = DB_fetch_row($CostResult); //add other requirements cost to cost of contract BOM @@ -750,13 +749,13 @@ } $LineItemsSQL = "UPDATE salesorderdetails SET unitprice='" . $StockItem->Price . "', - quantity='" . $StockItem->Quantity . "', - discountpercent='" . floatval($StockItem->DiscountPercent) . "', - completed='" . $Completed . "', - poline='" . $StockItem->POLine . "', - itemdue='" . FormatDateForSQL($StockItem->ItemDue) . "' - WHERE salesorderdetails.orderno='" . $_SESSION['ExistingOrder'] . "' - AND salesorderdetails.orderlineno='" . $StockItem->LineNumber . "'"; + quantity='" . $StockItem->Quantity . "', + discountpercent='" . floatval($StockItem->DiscountPercent) . "', + completed='" . $Completed . "', + poline='" . $StockItem->POLine . "', + itemdue='" . FormatDateForSQL($StockItem->ItemDue) . "' + WHERE salesorderdetails.orderno='" . $_SESSION['ExistingOrder'] . "' + AND salesorderdetails.orderlineno='" . $StockItem->LineNumber . "'"; $DbgMsg = _('The SQL that was used to modify the order line and failed was'); $ErrMsg = _('The updated order line cannot be modified because'); @@ -771,10 +770,24 @@ prnMsg(_('Order Number') .' ' . $_SESSION['ExistingOrder'] . ' ' . _('has been updated'),'success'); - echo '<br /><table class=selection><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td><a href="' . $rootpath . '/PrintCustOrder.php?identifier='.$identifier . '&TransNo=' . $_SESSION['ExistingOrder'] . '">'. _('Print packing slip - pre-printed stationery') .'</a></td></tr>'; - echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td><a target="_blank" href="' . $rootpath . '/PrintCustOrder_generic.php?identifier='.$identifier . '&TransNo=' . $_SESSION['ExistingOrder'] . '">'. _('Print packing slip') . ' (' . _('Laser') . ')' .'</a></td></tr>'; - echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Invoice') . '" alt=""></td><td><a href="' . $rootpath .'/ConfirmDispatch_Invoice.php?identifier='.$identifier . '&OrderNumber=' . $_SESSION['ExistingOrder'] . '">'. _('Confirm Order Delivery Quantities and Produce Invoice') .'</a></td></tr>'; - echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Order') . '" alt=""></td><td><a href="' . $rootpath .'/SelectSalesOrder.php?identifier='.$identifier . '">'. _('Select A Different Order') .'</a></td></tr></table>'; + echo '<br /> + <table class="selection"> + <tr> + <td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td><td><a href="' . $rootpath . '/PrintCustOrder.php?identifier='.$identifier . '&TransNo=' . $_SESSION['ExistingOrder'] . '">'. _('Print packing slip - pre-printed stationery') .'</a></td> + </tr>'; + echo '<tr> + <td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt=""></td> + <td><a target="_blank" href="' . $rootpath . '/PrintCustOrder_generic.php?identifier='.$identifier . '&TransNo=' . $_SESSION['ExistingOrder'] . '">'. _('Print packing slip') . ' (' . _('Laser') . ')' .'</a></td> + </tr>'; + echo '<tr> + <td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Invoice') . '" alt=""></td> + <td><a href="' . $rootpath .'/ConfirmDispatch_Invoice.php?identifier='.$identifier . '&OrderNumber=' . $_SESSION['ExistingOrder'] . '">'. _('Confirm Order Delivery Quantities and Produce Invoice') .'</a></td> + </tr>'; + echo '<tr> + <td><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Order') . '" alt=""></td> + <td><a href="' . $rootpath .'/SelectSalesOrder.php?identifier='.$identifier . '">'. _('Select A Different Order') .'</a></td> + </tr> + </table>'; include('includes/footer.inc'); exit; } @@ -786,7 +799,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Delivery') . '" alt="" />' . ' ' . _('Delivery Details'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" />' . ' ' . _('Customer Code') . ' :<b> ' . $_SESSION['Items'.$identifier]->DebtorNo; echo '</b> ' . _('Customer Name') . ' :<b> ' . $_SESSION['Items'.$identifier]->CustomerName . '</p>'; -//echo '<font size=4><b>'. _('Customer') .' : ' . $_SESSION['Items'.$identifier]->CustomerName . '</b></font>'; + echo '<form action="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -942,14 +955,14 @@ $ErrMsg = _('The stock locations could not be retrieved'); $DbgMsg = _('SQL used to retrieve the stock locations was') . ':'; -$StkLocsResult = DB_query('SELECT locationname,loccode - FROM locations',$db, $ErrMsg, $DbgMsg); +$StkLocsResult = DB_query("SELECT locationname,loccode + FROM locations",$db, $ErrMsg, $DbgMsg); while ($myrow=DB_fetch_row($StkLocsResult)){ if ($_SESSION['Items'.$identifier]->Location==$myrow[1]){ - echo '<option selected value="'.$myrow[1].'">'.$myrow[0]; + echo '<option selected value="' . $myrow[1] . '">' . $myrow[0] . '</option>'; } else { - echo '<option value="'.$myrow[1].'">'.$myrow[0]; + echo '<option value="'.$myrow[1].'">'.$myrow[0] . '</option>'; } } @@ -1031,75 +1044,68 @@ /* This field will control whether or not to display the company logo and address on the packlist */ - echo '<tr><td>' . _('Packlist Type') . ':</td><td><select name="DeliverBlind">'; - for ($p = 1; $p <= 2; $p++) { - echo '<option value=' . $p; - if ($p == $_SESSION['Items'.$identifier]->DeliverBlind) { - echo ' selected>'; - } else { - echo '>'; - } - switch ($p) { - case 2: - echo _('Hide Company Details/Logo'); - break; - default: - echo _('Show Company Details/Logo'); - break; - } - } + echo '<tr><td>' . _('Packlist Type') . ':</td> + <td><select name="DeliverBlind">'; + + if ($_SESSION['Items'.$identifier]->DeliverBlind ==2){ + echo '<option value="1">' . _('Show Company Details/Logo') . '</option>'; + echo '<option selected value="2">' . _('Hide Company Details/Logo') . '</option>'; + } else { + echo '<option selected value="1">' . _('Show Company Details/Logo') . '</option>'; + echo '<option value="2">' . _('Hide Company Details/Logo') . '</option>'; + } echo '</select></td></tr>'; if (isset($_SESSION['PrintedPackingSlip']) and $_SESSION['PrintedPackingSlip']==1){ echo '<tr> <td>'. _('Reprint packing slip') .':</td> - <td><select name="ReprintPackingSlip">'; - echo '<option value=0>' . _('Yes'); - echo '<option selected value=1>' . _('No'); + <td><select name="ReprintPackingSlip">'; + echo '<option value=0>' . _('Yes') . '</option>'; + echo '<option selected value=1>' . _('No') . '</option>'; echo '</select> '. _('Last printed') .': ' . ConvertSQLDate($_SESSION['DatePackingSlipPrinted']) . '</td></tr>'; - } else { - echo '<input type=hidden name="ReprintPackingSlip" value=0>'; - } echo '<tr><td>'. _('Charge Freight Cost inc tax') .':</td>'; -echo '<td><input type=text class=number size=10 maxlength=12 name="FreightCost" VALUE=' . $_SESSION['Items'.$identifier]->FreightCost . '></td>'; +echo '<td><input type=text class="number" size=10 maxlength=12 name="FreightCost" value="' . $_SESSION['Items'.$identifier]->FreightCost . '"></td>'; if ($_SESSION['DoFreightCalc']==true){ - echo '<td><input type=submit name="Update" VALUE="' . _('Recalc Freight Cost') . '"></td></tr>'; + echo '<td><input type=submit name="Update" value="' . _('Recalc Freight Cost') . '"></td></tr>'; } if ((!isset($_POST['ShipVia']) OR $_POST['ShipVia']=='') AND isset($_SESSION['Items'.$identifier]->ShipVia)){ $_POST['ShipVia'] = $_SESSION['Items'.$identifier]->ShipVia; } -echo '<tr><td>'. _('Freight/Shipper Method') .':</td><td><select name="ShipVia">'; +echo '<tr><td>'. _('Freight/Shipper Method') .':</td> + <td><select name="ShipVia">'; + $ErrMsg = _('The shipper details could not be retrieved'); $DbgMsg = _('SQL used to retrieve the shipper details was') . ':'; -$sql = 'SELECT shipper_id, shippername - FROM shippers'; + +$sql = "SELECT shipper_id, shippername FROM shippers"; $ShipperResults = DB_query($sql,$db,$ErrMsg,$DbgMsg); while ($myrow=DB_fetch_array($ShipperResults)){ if ($myrow['shipper_id']==$_POST['ShipVia']){ - echo '<option selected value=' . $myrow['shipper_id'] . '>' . $myrow['shippername']; + echo '<option selected value=' . $myrow['shipper_id'] . '>' . $myrow['shippername'] . '</option>'; }else { - echo '<option value=' . $myrow['shipper_id'] . '>' . $myrow['shippername']; + echo '<option value=' . $myrow['shipper_id'] . '>' . $myrow['shippername'] . '</option>'; } } echo '</select></td></tr>'; -echo '<tr><td>'. _('Quotation Only') .':</td><td><select name="Quotation">'; +echo '<tr><td>'. _('Quotation Only') .':</td> + <td><select name="Quotation">'; if ($_SESSION['Items'.$identifier]->Quotation==1){ - echo '<option selected value=1>' . _('Yes'); - echo '<option value=0>' . _('No'); + echo '<option selected value=1>' . _('Yes') . '</option>'; + echo '<option value=0>' . _('No') . '</option>'; } else { - echo '<option VALUE=1>' . _('Yes'); - echo '<option selected VALUE=0>' . _('No'); + echo '<option value=1>' . _('Yes') . '</option>'; + echo '<option selected value=0>' . _('No') . '</option>'; } echo '</select></td></tr>'; @@ -1110,9 +1116,9 @@ if ($_SESSION['ExistingOrder']==0){ echo '<br /><br /><input type=submit name="ProcessOrder" value="' . _('Place Order') . '">'; - echo '<br /><br /><input type=submit name="MakeRecurringOrder" VALUE="' . _('Create Recurring Order') . '">'; + echo '<br /><br /><input type=submit name="MakeRecurringOrder" value="' . _('Create Recurring Order') . '">'; } else { - echo '<br /><input type=submit name="ProcessOrder" VALUE="' . _('Commit Order Changes') . '">'; + echo '<br /><input type=submit name="ProcessOrder" value="' . _('Commit Order Changes') . '">'; } echo '</div></form>'; Modified: trunk/DiscountCategories.php =================================================================== --- trunk/DiscountCategories.php 2011-04-18 07:49:36 UTC (rev 4554) +++ trunk/DiscountCategories.php 2011-04-19 10:18:49 UTC (rev 4555) @@ -1,9 +1,7 @@ <?php -/* $Revision: 1.10 $ */ + /* $Id$*/ -//$PageSecurity = 11; - include('includes/session.inc'); $title = _('Discount Categories Maintenance'); @@ -15,7 +13,7 @@ $_POST['StockID']=$_POST['stockID']; } elseif (isset($_GET['StockID'])) { $_POST['StockID']=$_GET['StockID']; - $_POST['chooseoption']=1; + $_POST['ChooseOption']=1; $_POST['selectchoice']=1; } @@ -42,7 +40,7 @@ if ($InputError !=1) { $sql = "UPDATE stockmaster SET discountcategory='" . $_POST['DiscountCategory'] . "' - WHERE stockid='" . strtoupper($_POST['StockID']) . "'"; + WHERE stockid='" . strtoupper($_POST['StockID']) . "'"; $result = DB_query($sql,$db, _('The discount category') . ' ' . $_POST['DiscountCategory'] . ' ' . _('record for') . ' ' . strtoupper($_POST['StockID']) . ' ' . _('could not be updated because')); @@ -58,8 +56,8 @@ $sql="UPDATE stockmaster SET discountcategory='' WHERE stockid='" . trim(strtoupper($_GET['StockID'])) ."'"; $result = DB_query($sql,$db); prnMsg( _('The stock master record has been updated to no discount category'),'success'); - echo '<br>'; -} elseif (isset($_POST['submitcategory'])) { + echo '<br />'; +} elseif (isset($_POST['SubmitCategory'])) { $sql="UPDATE stockmaster SET discountcategory='".$_POST['DiscountCategory']."' WHERE categoryid='".$_POST['stockcategory']."'"; @@ -67,7 +65,7 @@ } if (isset($_POST['selectchoice'])) { - echo "<form name='update' method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<form name="update" method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; $sql = "SELECT DISTINCT discountcategory FROM stockmaster WHERE discountcategory <>''"; @@ -79,31 +77,37 @@ while ($myrow = DB_fetch_array($result)){ if ($myrow['discountcategory']==$_POST['DiscCat']){ - echo "<option selected value='" . $myrow['discountcategory'] . "'>" . $myrow['discountcategory']; + echo '<option selected value="' . $myrow['discountcategory'] . '">' . $myrow['discountcategory'] . '</option>'; } else { - echo "<option value='" . $myrow['discountcategory'] . "'>" . $myrow['discountcategory']; + echo '<option value="' . $myrow['discountcategory'] . '">' . $myrow['discountcategory'] . '</option>'; } echo '</option>'; } echo '</select></td>'; - echo '<td><input type="submit" name="select" value="'._('Select').'"></td></tr></table><br>'; + echo '<td><input type="submit" name="select" value="'._('Select').'"></td></tr></table><br />'; } - 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 '<input type="hidden" name="chooseoption" value="'.$_POST['chooseoption'].'">'; + echo '<input type="hidden" name="ChooseOption" value="'.$_POST['ChooseOption'].'">'; echo '<input type="hidden" name="selectchoice" value="'.$_POST['selectchoice'].'">'; - if (isset($_POST['chooseoption']) and $_POST['chooseoption']==1) { - echo '<table class=selection><tr><td>'. _('Discount Category Code') .':</td><td>'; + if (isset($_POST['ChooseOption']) and $_POST['ChooseOption']==1) { + echo '<table class="selection"><tr><td>'. _('Discount Category Code') .':</td><td>'; if (isset($_POST['DiscCat'])) { - echo "<input type='text' name='DiscountCategory' maxlength=2 size=2 value='" . $_POST['DiscCat'] . - "'></td><td>"._('OR')."</td><td></td><td>"._('OR')."</td></tr>"; + echo '<input type="text" name="DiscountCategory" maxlength=2 size=2 value="' . $_POST['DiscCat'] .'"></td> + <td>'._('OR') . '</td> + <td></td> + <td>'._('OR').'</td> + </tr>'; } else { - echo "<input type='text' name='DiscountCategory' maxlength=2 size=2></td><td>". - _('OR')."</td><td></td><td>"._('OR')."</td></tr>"; + echo '<input type="text" name="DiscountCategory" maxlength=2 size=2></td> + <td>' ._('OR') . '</td> + <td></td> + <td>'._('OR') . '</td> + </tr>'; } if (!isset($_POST['StockID'])) { @@ -115,46 +119,53 @@ if (!isset($_POST['PartDesc'])) { $_POST['PartDesc']=''; } - echo '<tr><td>'. _('Enter Stock Code') .":</td><td><input type='text' name='StockID' size=20 maxlength=20 - value='".$_POST['StockID']."'></td> - <td>"._('Partial code').":</td><td><input type='text' name='PartID' size=10 maxlength=10 value='".$_POST['PartID']."'></td> - <td>"._('Partial description').":</td><td><input type='text' name='PartDesc' size=10 value='".$_POST['PartDesc']."' maxlength=10></td> - <td><input type='Submit' name='search' value='". _('Search') ."'></td></tr>"; + echo '<tr><td>'. _('Enter Stock Code') .':</td> + <td><input type="text" name="StockID" size=20 maxlength=20 value="' . $_POST['StockID'] . '"></td> + <td>'._('Partial code') . ':</td> + <td><input type="text" name="PartID" size=10 maxlength=10 value="' . $_POST['PartID'] . '"></td> + <td>' . _('Partial description') . ':</td> + <td><input type="text" name="PartDesc" size=10 value="' . $_POST['PartDesc'] .'" maxlength=10></td> + <td><input type="submit" name="search" value="' . _('Search') .'"></td></tr>'; echo '</table>'; - echo "<br><div class='centre'><input type='Submit' name='submit' value='". _('Update Item') ."'></div>"; + echo '<br /><div class="centre"><input type="submit" name="submit" value="'. _('Update Item') .'"></div>'; if (isset($_POST['search'])) { if ($_POST['PartID']!='' and $_POST['PartDesc']=='') - $sql="SELECT stockid, description FROM stockmaster WHERE stockid LIKE '%".$_POST['PartID']."%'"; + $sql="SELECT stockid, description FROM stockmaster + WHERE stockid " . LIKE . " '%".$_POST['PartID']."%'"; if ($_POST['PartID']=='' and $_POST['PartDesc']!='') - $sql="SELECT stockid, description FROM stockmaster WHERE description LIKE '%".$_POST['PartDesc']."%'"; + $sql="SELECT stockid, description FROM stockmaster + WHERE description " . LIKE . " '%".$_POST['PartDesc']."%'"; if ($_POST['PartID']!='' and $_POST['PartDesc']!='') - $sql="SELECT stockid, description FROM stockmaster WHERE stockid LIKE '%".$_POST['PartID']."%' and - description LIKE '%".$_POST['PartDesc']."%'"; + $sql="SELECT stockid, description FROM stockmaster + WHERE stockid " . LIKE . " '%".$_POST['PartID']."%' + AND description " . LIKE . " '%".$_POST['PartDesc']."%'"; $result=DB_query($sql,$db); if (!isset($_POST['stockID'])) { - echo _('Select a part code').':<br>'; + echo _('Select a part code').':<br />'; while ($myrow=DB_fetch_array($result)) { - echo '<input type="submit" name="stockID" value="'.$myrow['stockid'].'"><br>'; + echo '<input type="submit" name="stockID" value="'.$myrow['stockid'].'" /><br />'; } } } } else { - echo '<table class=selection><tr><td>'._('Assign discount category').'</td>'; - echo '<td><input type="text" name="DiscountCategory" maxlength=2 size=2></td>'; + echo '<table class=selection> + <tr> + <td>'._('Assign discount category').'</td>'; + echo '<td><input type="text" name="DiscountCategory" maxlength=2 size=2 /></td>'; echo '<td>'._('to all items in stock category').'</td>'; - $sql = 'SELECT categoryid, + $sql = "SELECT categoryid, categorydescription - FROM stockcategory'; + FROM stockcategory"; $result = DB_query($sql, $db); echo '<td><select name="stockcategory">'; while ($myrow=DB_fetch_array($result)) { echo '<option value="'.$myrow['categoryid'].'">'.$myrow['categorydescription'].'</option>'; } echo '</select></td></tr></table>'; - echo "<br><div class='centre'><input type='Submit' name='submitcategory' value='". _('Update Items') ."'></div>"; + echo '<br /><div class="centre"><input type="submit" name="SubmitCategory" value="'. _('Update Items') .'"></div>'; } echo '</form>'; @@ -182,10 +193,10 @@ $result = DB_query($sql,$db); - echo '<br><table class=selection>'; - echo "<tr> - <th>". _('Discount Category') ."</th> - <th>". _('Item') .'</th></tr>'; + echo '<br /><table class="selection">'; + echo '<tr> + <th>'. _('Discount Category') .'</th> + <th>'. _('Item') .'</th></tr>'; $k=0; //row colour counter @@ -197,16 +208,16 @@ echo '<tr class="OddTableRows">'; $k=1; } - $DeleteURL = $_SERVER['PHP_SELF'] . '?' . SID . '&Delete=yes&StockID=' . $myrow['stockid'] . '&DiscountCategory=' . $myrow['discountcategory']; + $DeleteURL = $_SERVER['PHP_SELF'] . '?Delete=yes&StockID=' . $myrow['stockid'] . '&DiscountCategory=' . $myrow['discountcategory']; - printf("<td>%s</td> - <td>%s - %s</td> - <td><a href='%s'>". _('Delete') .'</td> - </tr>', - $myrow['discountcategory'], - $myrow['stockid'], - $myrow['description'], - $DeleteURL); + printf('<td>%s</td> + <td>%s - %s</td> + <td><a href="%s">'. _('Delete') .'</td> + </tr>', + $myrow['discountcategory'], + $myrow['stockid'], + $myrow['description'], + $DeleteURL); } @@ -214,20 +225,22 @@ } else { /* $_POST['DiscCat'] ==0 */ - echo '</div><br>'; + echo '</div><br />'; prnMsg( _('There are currently no discount categories defined') . '. ' . _('Enter a two character abbreviation for the discount category and the stock code to which this category will apply to. Discount rules can then be applied to this discount category'),'info'); } } if (!isset($_POST['selectchoice'])) { - echo "<form method='post' name='choose' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<form method="post" name="choose" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class=selection>'; + echo '<table class="selection">'; echo '<tr><td>'._('Update discount category for').'</td>'; - echo '<td><select name="chooseoption" onChange="ReloadForm(choose.selectchoice)">'; + echo '<td><select name="ChooseOption" onChange="ReloadForm(choose.selectchoice)">'; echo '<option value="1">'._('a single stock item').'</option>'; echo '<option value="2">'._('a complete stock category').'</option>'; - echo '</select></td></tr></table><br>'; + echo '</select></td></tr> + </table> + <br />'; echo '<div class="centre"><input type="submit" name="selectchoice" value="'._('Select').'"></div>'; } Modified: trunk/DiscountMatrix.php =================================================================== --- trunk/DiscountMatrix.php 2011-04-18 07:49:36 UTC (rev 4554) +++ trunk/DiscountMatrix.php 2011-04-19 10:18:49 UTC (rev 4555) @@ -1,13 +1,11 @@ <?php -/* $Revision: 1.9 $ */ + /* $Id$*/ -//$PageSecurity = 11; include('includes/session.inc'); $title = _('Discount Matrix Maintenance'); include('includes/header.inc'); - if (isset($Errors)) { unset($Errors); } @@ -64,7 +62,7 @@ $result = DB_query($sql,$db); prnMsg( _('The discount matrix record has been added'),'success'); - echo '<br>'; + echo '<br />'; unset($_POST['DiscountCategory']); unset($_POST['SalesType']); unset($_POST['QuantityBreak']); @@ -80,30 +78,30 @@ $result = DB_query($sql,$db); prnMsg( _('The discount matrix record has been deleted'),'success'); - echo '<br>'; + echo '<br />'; } -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>'; +echo '<table class="selection">'; -$sql = 'SELECT typeabbrev, +$sql = "SELECT typeabbrev, sales_type - FROM salestypes'; + FROM salestypes"; $result = DB_query($sql, $db); echo '<tr><td>' . _('Customer Price List') . ' (' . _('Sales Type') . '):</td><td>'; -echo "<select tabindex=1 name='SalesType'>"; +echo '<select tabindex=1 name="SalesType">'; while ($myrow = DB_fetch_array($result)){ if (isset($_POST['SalesType']) and $myrow['typeabbrev']==$_POST['SalesType']){ - echo "<option selected value='" . $myrow['typeabbrev'] . "'>" . $myrow['sales_type']; + echo '<option selected value="' . $myrow['typeabbrev'] . '">' . $myrow['sales_type'] . '</option>'; } else { - echo "<option value='" . $myrow['typeabbrev'] . "'>" . $myrow['sales_type']; + echo '<option value="' . $myrow['typeabbrev'] . '">' . $myrow['sales_type'] . '</option>'; } } @@ -118,29 +116,26 @@ while ($myrow = DB_fetch_array($result)){ if ($myrow['discountcategory']==$_POST['DiscCat']){ - echo "<option selected value='" . $myrow['discountcategory'] . "'>" . $myrow['discountcategory']; + echo '<option selected value="' . $myrow['discountcategory'] . '">' . $myrow['discountcategory'] . '</option>'; } else { - echo "<option value='" . $myrow['discountcategory'] . "'>" . $myrow['discountcategory']; + echo '<option value="' . $myrow['discountcategory'] . '">' . $myrow['discountcategory'] . '</option>'; } - echo '</option>'; } echo '</select></td>'; } else { echo '<input type="hidden" name="DiscountCategory" value="">'; } -echo '<tr><td>' . _('Quantity Break') . ":</td><td><input class='number' tabindex=3 " - . (in_array('QuantityBreak',$Errors) ? "class='inputerror'" : "") - ." type='text' name='QuantityBreak' size=10 maxlength=10></td></tr>"; +echo '<tr><td>' . _('Quantity Break') . '</td> + <td><input class="number" tabindex=3 ' . (in_array('QuantityBreak',$Errors) ? 'class="inputerror"' : '') .' type="text" name="QuantityBreak" size=10 maxlength=10></td></tr>'; -echo '<tr><td>' . _('Discount Rate') . " (%):</td><td><input class='number' tabindex=4 " - . (in_array('DiscountRate',$Errors) ? "class='inputerror'" : "") . - "type='text' name='DiscountRate' size=11 maxlength=14></td></tr>"; -echo '</table><br>'; +echo '<tr><td>' . _('Discount Rate') . ' (%):</td> + <td><input class="number" tabindex=4 ' . (in_array('DiscountRate',$Errors) ? 'class="inputerror"' : '') . 'type="text" name="DiscountRate" size=11 maxlength=14></td></tr>'; +echo '</table><br />'; -echo "<div class='centre'><input tabindex=5 type='submit' name='submit' value='" . _('Enter Information') . "'></div><br>"; +echo '<div class="centre"><input tabindex=5 type="submit" name="submit" value="' . _('Enter Information') . '"></div><br />'; -$sql = 'SELECT sales_type, +$sql = "SELECT sales_type, salestype, discountcategory, quantitybreak, @@ -149,15 +144,15 @@ ON discountmatrix.salestype=salestypes.typeabbrev ORDER BY salestype, discountcategory, - quantitybreak'; + quantitybreak"; $result = DB_query($sql,$db); echo '<table class=selection>'; -echo "<tr><th>" . _('Sales Type') . "</th> - <th>" . _('Discount Category') . "</th> - <th>" . _('Quantity Break') . "</th> - <th>" . _('Discount Rate') . ' %' . "</th></tr>"; +echo '<tr><th>' . _('Sales Type') . '</th> + <th>' . _('Discount Category') . '</th> + <th>' . _('Quantity Break') . '</th> + <th>' . _('Discount Rate') . ' %' . '</th></tr>'; $k=0; //row colour counter @@ -169,13 +164,13 @@ echo '<tr class="OddTableRows">'; $k=1; } - $DeleteURL = $_SERVER['PHP_SELF'] . '?' . SID . '&Delete=yes&SalesType=' . $myrow['salestype'] . '&DiscountCategory=' . $myrow['discountcategory'] . '&QuantityBreak=' . $myrow['quantitybreak']; + $DeleteURL = $_SERVER['PHP_SELF'] . '?Delete=yes&SalesType=' . $myrow['salestype'] . '&DiscountCategory=' . $myrow['discountcategory'] . '&QuantityBreak=' . $myrow['quantitybreak']; - printf("<td>%s</td> + printf('<td>%s</td> <td>%s</td> - <td class='number'>%s</td> - <td class='number'>%s</td> - <td><a href='%s'>" . _('Delete') . '</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td><a href="%s">' . _('Delete') . '</td> </tr>', $myrow['sales_type'], $myrow['discountcategory'], Modified: trunk/EDIMessageFormat.php =================================================================== --- trunk/EDIMessageFormat.php 2011-04-18 07:49:36 UTC (rev 4554) +++ trunk/EDIMessageFormat.php 2011-04-19 10:18:49 UTC (rev 4555) @@ -97,7 +97,7 @@ prnMsg($msg,'success'); } -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 border=0 width=100%> @@ -124,12 +124,12 @@ $result = DB_query($sql,$db); echo '<table class=selection>'; - echo '<tr><th colspan=5><font size=3>' . _('Definition of') . ' ' . $MessageType . ' ' . _('for') . ' ' . $PartnerCode."</font></th></tr>"; - $TableHeader = "<tr> - <th>" . _('Section') . "</th> - <th>" . _('Sequence') . "</th> - <th>" . _('Format String') . "</th> - </tr>"; + echo '<tr><th colspan=5><font size=3>' . _('Definition of') . ' ' . $MessageType . ' ' . _('for') . ' ' . $PartnerCode.'</font></th></tr>'; + $TableHeader = '<tr> + <th>' . _('Section') . '</th> + <th>' . _('Sequence') . '</th> + <th>' . _('Format String') . '</th> + </tr>'; echo $TableHeader; $k=0; //row colour counter @@ -144,12 +144,12 @@ } - printf("<td>%s</td> + printf('<td>%s</td> <td class=number>%s</td> <td>%s</td> - <td><a href=\"%s&SelectedMessageLine=%s\">" . _('Edit') . "</a></td> - <td><a href=\"%s&delete=%s\">" . _('Delete') . "</a></td> - </tr>", + <td><a href="%s&SelectedMessageLine=%s">' . _('Edit') . '</a></td> + <td><a href="%s&delete=%s">' . _('Delete') . '</a></td> + </tr>', $myrow[1], $myrow[2], $myrow[3], @@ -161,8 +161,8 @@ } //END WHILE LIST LOOP echo '</table><p>'; if (DB_num_rows($result)==0){ - echo "<div class='centre'><input tabindex=1 type=submit name='NewEDIInvMsg' value='" . - _('Create New EDI Invoice Message From Default Template') . "'></div><br>"; + echo '<div class="centre"><input tabindex=1 type=submit name="NewEDIInvMsg" value="' . + _('Create New EDI Invoice Message From Default Template') . '"></div><br>'; } } //end of ifs SelectedLine is not set @@ -188,14 +188,14 @@ $_POST['SequenceNo'] = $myrow['sequenceno']; $_POST['LineText'] = $myrow['linetext']; - echo "<div class='centre'><a href='" . $_SERVER['PHP_SELF'] . '?' . SID . 'MessageType=INVOIC&PartnerCode=' . $myrow['partnercode'] . "'>" . _('Review Message Lines') . '</a></div>'; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?MessageType=INVOIC&PartnerCode=' . $myrow['partnercode'] . '">' . _('Review Message Lines') . '</a></div>'; - echo "<input type=hidden name='SelectedMessageLine' VALUE='" . $SelectedMessageLine . "'>"; - echo "<input type=hidden name='MessageType' VALUE='" . $myrow['messagetype'] . "'>"; - echo "<input type=hidden name='PartnerCode' VALUE='" . $myrow['partnercode'] . "'>"; + echo '<input type=hidden name="SelectedMessageLine" VALUE="' . $SelectedMessageLine . '">'; + echo '<input type=hidden name="MessageType" VALUE="' . $myrow['messagetype'] . '">'; + echo '<input type=hidden name="PartnerCode" VALUE="' . $myrow['partnercode'] . '">'; } else { //end of if $SelectedMessageLine only do the else when a new record is being entered - echo "<input type=hidden name='MessageType' VALUE='" . $MessageType . "'>"; - echo "<input type=hidden name='PartnerCode' VALUE='" . $PartnerCode . "'>"; + echo '<input type=hidden name="MessageType" VALUE="' . $MessageType . '">'; + echo '<input type=hidden name="PartnerCode" VALUE="' . $PartnerCode . '">'; } echo '<table class=selection>'; @@ -209,20 +209,20 @@ echo '<select tabindex=2 name="Section">'; if ($_POST['Section']=='Heading') { - echo "<option selected VALUE='Heading'>" . _('Heading') . '</option>'; + echo '<option selected VALUE="Heading">' . _('Heading') . '</option>'; } else { - echo "<option value='Heading'>" . _('Heading') . '</option>'; + echo '<option value="Heading">' . _('Heading') . '</option>'; } if (isset($_POST['Section']) and $_POST['Section']=='Detail') { - echo "<option selected VALUE='Detail'>" . _('Detail') . '</option>'; + echo '<option selected VALUE="Detail">' . _('Detail') . '</option>'; } else { - echo "<option value='Detail'>" . _('Detail') . '</option>'; + echo '<option value="Detail">' . _('Detail') . '</option>'; } if (isset($_POST['Section']) and $_POST['Section']=='Summary') { - echo "<option selected VALUE='Summary'>" . _('Summary') . '</option>'; + echo '<option selected VALUE="Summary">' . _('Summary') . '</option>'; } else { - echo "<option value='Summary'>" . _('Summary') . '</option>'; + echo '<option value="Summary">' . _('Summary') . '</option>'; } echo '</select>'; @@ -234,20 +234,20 @@ echo '</td></tr>'; echo '<tr><td>Sequence Number:</td>'; -echo "<td><input tabindex=3 type=text name=SequenceNo size=3 maxlength=3 value=".$_POST['SequenceNo'].">"; -echo "</td></tr>"; -echo "<tr><td>" . _('Line Text') . ':' ."</td>"; -echo "<td>"; -echo "<input tabindex=4 type='Text' name='LineText' size=50 maxlength=50 VALUE=".$_POST['LineText'] .">"; -echo "</td></tr>"; -echo "</table><br>"; +echo '<td><input tabindex=3 type=text name=SequenceNo size=3 maxlength=3 value='.$_POST['SequenceNo'].'>'; +echo '</td></tr>'; +echo '<tr><td>' . _('Line Text') . ':' .'</td>'; +echo '<td>'; +echo '<input tabindex=4 type="Text" name="LineText" size=50 maxlength=50 VALUE='.$_POST['LineText'] .'>'; +echo '</td></tr>'; +echo '</table><br>'; if (isset($_GET['SelectedMessageLine'])) { - echo "<div class='centre'><input tabindex=5 type='submit' name='update' value='". _('Update Information'). "'></div>"; + echo '<div class="centre"><input tabindex=5 type="submit" name="update" value="'. _('Update Information'). '"></div>'; } else { - echo "<div class='centre'><input tabindex=5 type='submit' name='submit' value='". _('Enter Information'). "'></div>"; + echo '<div class="centre"><input tabindex=5 type="submit" name="submit" value="'. _('Enter Information'). '"></div>'; } -echo "</form>"; +echo '</form>'; include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/EmailCustTrans.php =================================================================== --- trunk/EmailCustTrans.php 2011-04-18 07:49:36 UTC (rev 4554) +++ trunk/EmailCustTrans.php 2011-04-19 10:18:49 UTC (rev 4555) @@ -37,13 +37,13 @@ include ('includes/header.inc'); -echo "<form action='" . $_SERVER['PHP_SELF'] . '?' . SID . "' method=post>"; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo "<input type=hidden name='TransNo' VALUE=" . $_GET['FromTransNo'] . ">"; -echo "<input type=hidden name='InvOrCredit' VALUE=" . $_GET['InvOrCredit'] . '>'; +echo '<input type=hidden name="TransNo" VALUE="' . $_GET['FromTransNo'] . '">'; +echo '<input type=hidden name="InvOrCredit" VALUE="' . $_GET['InvOrCredit'] . '>'; -echo '<p><table>'; +echo '<br /><table>'; $SQL = "SELECT email FROM custbranch INNER JOIN debtortrans @@ -62,11 +62,11 @@ $EmailAddress =''; } -echo '<tr><td>' . _('Email') . ' ' . $_GET['InvOrCredit'] . ' ' . _('number') . ' ' . $_GET['FromTransNo'] . ' ' . _('to') . ":</td> - <td><input type=TEXT name='EmailAddr' maxlength=60 size=60 VALUE='" . $EmailAddress . "'</td> - </table>"; +echo '<tr><td>' . _('Email') . ' ' . $_GET['InvOrCredit'] . ' ' . _('number') . ' ' . $_GET['FromTransNo'] . ' ' . _('to') . ':</td> + <td><input type=TEXT name="EmailAddr" maxlength=60 size=60 VALUE="' . $EmailAddress . '"></td> + </table>'; -echo "<br><div class='centre'><input type=submit name='DoIt' VALUE='" . _('OK') . "'>"; +echo '<br><div class="centre"><input type=submit name="DoIt" VALUE="' . _('OK') . '">'; echo '</div></form>'; include ('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/ExchangeRateTrend.php =================================================================== --- trunk/ExchangeRateTrend.php 2011-04-18 07:49:36 UTC (rev 4554) +++ trunk/ExchangeRateTrend.php 2011-04-19 10:18:49 UTC (rev 4555) @@ -23,7 +23,7 @@ // SHOW OUR MAIN INPUT FORM // ************************ - echo "<form method='post' name=update action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<form method="post" name=update action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<div class="centre"><p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('View Currency Trend') . '" alt="" />' . ' ' . _('View Currency Trend') . '</p>'; @@ -40,9 +40,9 @@ while ($myrow=DB_fetch_array($result)) { if ($myrow['currabrev']!=$_SESSION['CompanyRecord']['currencydefault']){ if ( $CurrencyToShow==$myrow['currabrev'] ) { - echo '<option selected value=' . $myrow['currabrev'] . '>' . $myrow['country'] . ' ' . $myrow['currency'] . ' (' . $myrow['currabrev'] . ')'; + echo '<option selected value=' . $myrow['currabrev'] . '>' . $myrow['country'] . ' ' . $myrow['currency'] . ' (' . $myrow['currabrev'] . ')'. '</option>'; } else { - echo '<option value=' . $myrow['currabrev'] . '>' . $myrow['country'] . ' ' . $myrow['currency'] . ' (' . $myrow['currabrev'] . ')'; + echo '<option value=' . $myrow['currabrev'] . '>' . $myrow['country'] . ' ' . $myrow['currency'] . ' (' . $myrow['currabrev'] . ')'. '</option>'; } } } Modified: trunk/FixedAssetCategories.php =================================================================== --- trunk/FixedAssetCategories.php 2011-04-18 07:49:36 UTC (rev 4554) +++ trunk/FixedAssetCategories.php 2011-04-19 10:18:49 UTC (rev 4555) @@ -154,7 +154,7 @@ FROM fixedassetcategories'; $result = DB_query($sql,$db); - echo "<br /><table class=selection>\n"; + echo '<br /><table class=selection>'; echo '<tr><th>' . _('Cat Code') . '</th> <th>' . _('Description') . '</th> <th>' . _('Cost GL') . '</th> @@ -172,15 +172,15 @@ echo '<tr class="OddTableRows">'; $k=1; } - printf("<td>%s</td> + printf('<td>%s</td> <td>%s</td> - <td class=\"number\">%s</td> - <td class=\"number\">%s</td> - <td class=\"number\">%s</td> - <td class=\"number\">%s</td> - <td><a href=\"%sSelectedCategory=%s\">" . _('Edit') . "</td> - <td><a href=\"%sSelectedCategory=%s&delete=yes\" onclick=\"return confirm('" . _('Are you sure you wish to delete this fixed asset category? Additional checks will be performed before actual deletion to ensure data integrity is not compromised.') . "');\">" . _('Delete') . "</td> - </tr>", + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td><a href="%sSelectedCategory=%s">' . _('Edit') . '</td> + <td><a href="%sSelectedCategory=%s&delete=yes" onclick="return confirm("' . _('Are you sure you wish to delete this fixed asset category? Additional checks will be performed before actual deletion to ensure data integrity is not compromised.') . '");">' . _('Delete') . '</td> + </tr>', $myrow['categoryid'], $myrow['categorydescription'], $myrow['costact'], @@ -199,7 +199,7 @@ //end of ifs and buts! if (isset($SelectedCategory)) { - echo "<br /><div class='centre'><a href='" . $_SERVER['PHP_SELF'] . '?' . SID . ">" ._('Show All Fixed Asset Categories') . "</a></div>"; + echo '<br /><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' ._('Show All Fixed Asset Categories') . '</a></div>'; } echo '<form name="CategoryForm" method="post" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '">'; @@ -273,11 +273,10 @@ while ($myrow = DB_fetch_array($BSAccountsResult)){ if (isset($_POST['CostAct']) and $myrow['accountcode']==$_POST['CostAct']) { - echo '<option selected value='; + echo '<option selected value='.$myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')</option>'; } else { - echo '<option value='; + echo '<option value='.$myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')</option>'; } - echo $myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')'; } //end while loop echo '</select></td></tr>'; @@ -286,11 +285,10 @@ while ($myrow = DB_fetch_array($PnLAccountsResult)) { if (isset($_POST['DepnAct']) and $myrow['accountcode']==$_POST['DepnAct']) { - echo '<option selected value='; + echo '<option selected value='.$myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')</option>'; } else { - echo '<option value='; + echo '<option value='.$myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')</option>'; } - echo $myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')</option>'; } //end while loop echo '</select></td></tr>'; @@ -298,11 +296,10 @@ echo '<tr><td>' . _('Profit or Loss on Disposal GL Code:') . '</td><td><select name="DisposalAct">'; while ($myrow = DB_fetch_array($PnLAccountsResult)) { if (isset($_POST['DisposalAct']) and $myrow['accountcode']==$_POST['DisposalAct']) { - echo '<option selected value='; + echo '<option selected value='.$myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } else { - echo '<option value='; + echo '<option value='.$myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } - echo $myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } //end while loop echo '</select></td></tr>'; @@ -313,11 +310,10 @@ while ($myrow = DB_fetch_array($BSAccountsResult)) { if (isset($_POST['AccumDepnAct']) and $myrow['accountcode']==$_POST['AccumDepnAct']) { - echo '<option selected value='; + echo '<option selected value='.$myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } else { - echo '<option value='; + echo '<option value='.$myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } - echo $myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } //end while loop Modified: trunk/GLAccountInquiry.php =================================================================== --- trunk/GLAccountInquiry.php 2011-04-18 07:49:36 UTC (rev 4554) +++ trunk/GLAccountInquiry.php 2011-04-19 10:18:49 UTC (rev 4555) @@ -25,14 +25,14 @@ echo '<div class="page_help_text">' . _('Use the keyboard Shift key to select multiple periods') . '</div><br>'; -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'] . '" />'; /*Dates in SQL format for the last day of last month*/ $DefaultPeriodDate = Date ('Y-m-d', Mktime(0,0,0,Date('m'),0,Date('Y'))); /*Show a form to allow input of criteria for TB to show */ -echo '<table class=selection><tr><td>'._('Account').":</td><td><select Name='Account'>"; +echo '<table class=selection><tr><td>'._('Account').':</td><td><select Name="Account">'; $sql = "SELECT accountcode, accountname FROM chartmaster ORDER BY accountcode"; $Account = DB_query($sql,$db); while ($myrow=DB_fetch_array($Account,$db)){ @@ -55,7 +55,7 @@ $result=DB_query($SQL,$db); echo '<option value=0>0 - '._('All tags'); while ($myrow=DB_fetch_array($result)){ - if (isset($_POST['tag']) and $_POST['tag']==$myrow["tagref"]){ + if (isset($_POST['tag']) and $_POST['tag']==$myrow['tagref']){ echo '<option selected value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription']; } else { echo '<option value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription']; @@ -75,8 +75,8 @@ echo '<option value=' . $myrow['periodno'] . '>' . _(MonthAndYearFromSQLDate($myrow['lastdate_in_period'])); } } -echo "</select></td></tr><table>"; -echo "<p><div class='centre'><input type=submit name='Show' value='"._('Show Account Transactions')."'></div></form>"; +echo '</select></td></tr><table>'; +echo '<p><div class="centre"><input type=submit name="Show" value="'._('Show Account Transactions').'"></div></form>'; /* End of the Form rest of script is what happens if the show button is hit*/ @@ -148,16 +148,16 @@ echo '<br><table class=selection>'; echo '<tr><th colspan=8><b>' ._('Transactions for account').' '.$SelectedAccount. ' - '. $SelectedAccountName.'</b></th></tr>'; - $TableHeader = "<tr> - <th>" . _('Type') . "</th> - <th>" . _('Number') . "</th> - <th>" . _('Date') . "</th> - <th>" . _('Debit') . "</th> - <th>" . _('Credit') . "</th> - <th>" . _('Narrative') . "</th> - <th>" . _('Balance') . "</th> - <th>" . _('Tag') . "</th> - </tr>"; + $TableHeader = '<tr> + <th>' . _('Type') . '</th> + <th>' . _('Number') . '</th> + <th>' . _('Date') . '</th> + <th>' . _('Debit') . '</th> + <th>' . _('Credit') . '</th> + <th>' . _('Narrative') . '</th> + <th>' . _('Balance') . '</th> + <th>' . _('Tag') . '</th> + </tr>'; echo $TableHeader; @@ -179,15 +179,15 @@ $RunningTotal =$ChartDetailRow['bfwd']; if ($RunningTotal < 0 ){ //its a credit balance b/fwd - echo "<tr bgcolor='#FDFEEF'> - <td colspan=3><b>" . _('Brought Forward Balance') . '</b><td> + echo '<tr bgcolor="#FDFEEF"> + <td colspan=3><b>' . _('Brought Forward Balance') . '</b><td> </td></td> <td class=number><b>' . number_format(-$RunningTotal,2) . '</b></td> <td></td> </tr>'; } else { //its a debit balance b/fwd - echo "<tr bgcolor='#FDFEEF'> - <td colspan=3><b>" . _('Brought Forward Balance') . '</b></td> + echo '<tr bgcolor="#FDFEEF"> + <td colspan=3><b>' . _('Brought Forward Balance') . '</b></td> <td class=number><b>' . number_format($RunningTotal,2) . '</b></td> <td colspan=2></td> </tr>'; @@ -215,8 +215,8 @@ $ChartDetailsResult = DB_query($sql,$db,$ErrMsg); $ChartDetailRow = DB_fetch_array($ChartDetailsResult); - echo "<tr bgcolor='#FDFEEF'> - <td colspan=3><b>" . _('Total for period') . ' ' . $PeriodNo . '</b></td>'; + echo '<tr bgcolor="#FDFEEF"> + <td colspan=3><b>' . _('Total for period') . ' ' . $PeriodNo . '</b></td>'; if ($PeriodTotal < 0 ){ //its a credit balance b/fwd if ($PandLAccount==True) { $RunningTotal = 0; @@ -271,15 +271,15 @@ if ($tagrow['tagdescription']=='') { $tagrow['tagdescription']=_('None'); } - printf("<td>%s</td> - <td class=number><a href='%s'>%s</a></td> + printf('<td>%s</td> + <td class=number><a href="%s">%s</a></td> <td>%s</td> <td class=number>%s</td> <td class=number>%s</td> <td>%s</td> <td class=number><b>%s</b></td> <td>%s</td> - </tr>", + </tr>', $myrow['typename'], $URL_to_TransDetail, $myrow['typeno'], @@ -292,7 +292,7 @@ } - echo "<tr bgcolor='#FDFEEF'><td colspan=3><b>"; + echo '<tr bgcolor="#FDFEEF"><td colspan=3><b>'; if ($PandLAccount==True){ echo _('Total Period Movement'); } else { /*its a balance sheet account*/ Modified: trunk/GLBalanceSheet.php =================================================================== --- trunk/GLBalanceSheet.php 2011-04-18 07:49:36 UTC (rev 4554) +++ trunk/GLBalanceSheet.php 2011-04-19 10:18:49 UTC (rev 4555) @@ -24,9 +24,9 @@ . _('The balance sheet has three parts: assets, liabilities and ownership equity. The main categories of assets are listed first and are followed by the liabilities. The difference between the assets and the liabilities is known as equity or the net assets or the net worth or capital of the company and according to the accounting equation, net worth must equal assets minus liabilities.') . '<br>' . _('webERP is an "accrual" based system (not a "cash based" system). Accrual systems include items when they are invoiced to the customer, and when expenses are owed based on the supplier invoice date.') . '</div>'; - 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"><tr><td>'._('Select the balance date').":</td><td><select Name='BalancePeriodEnd'>"; + echo '<p><table class="selection"><tr><td>'._('Select the balance date').':</td><td><select Name="BalancePeriodEnd">'; $periodno=GetPeriod(Date($_SESSION['DefaultDateFormat']), $db); $sql = "SELECT lastdate_in_period FROM periods WHERE periodno='".$periodno . "'"; @@ -47,15 +47,15 @@ echo '</select></td></tr>'; - echo '<tr><td>'._('Detail Or Summary').":</td><td><select Name='Detail'>"; - echo "<option selected VALUE='Summary'>"._('Summary'); - echo "<option selected VALUE='Detailed'>"._('All Accounts'); + echo '<tr><td>'._('Detail Or Summary').':</td><td><select Name="Detail">'; + echo '<option selected VALUE="Summary">'._('Summary') . '</option>'; + echo '<option selected VALUE="Detailed">'._('All Accounts') . '</option>'; echo '</select></td></tr>'; echo '</table>'; - echo "<br><div class='centre'><input type=submit Name='ShowBalanceSheet' Value='"._('Show on Screen (HTML)')."'</div>"; - echo "<br><div class='centre'><input type=submit Name='PrintPDF' Value='"._('Produce PDF Report')."'></div>"; + echo '<br><div class="centre"><input type=submit Name="ShowBalanceSheet" Value="'._('Show on Screen (HTML)').'"></div>'; + echo '<br><div class="centre"><input type=submit Name="PrintPDF" Value="'._('Produce PDF Report').'"></div>'; /*Now do the posting while the user is thinking about the period to select */ include ('includes/GLPostings.inc'); @@ -301,9 +301,9 @@ exit; } else { include('includes/header.inc'); - 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 "<input type=hidden name='BalancePeriodEnd' VALUE=" . $_POST['BalancePeriodEnd'] . '>'; + echo '<input type=hidden name="BalancePeriodEnd" VALUE="' . $_POST['BalancePeriodEnd'] . '">'; $RetainedEarningsAct = $_SESSION['CompanyRecord']['retainedearnings']; @@ -354,17 +354,17 @@ _('Balance Sheet as at') . ' ' . $BalanceDate .'</b></font></div></th></tr>'; if ($_POST['Detail']=='Detailed'){ - $TableHeader = "<tr> - <th>"._('Account')."</td> - <th>"._('Account Name')."</td> + $TableHeader = '<tr> + <th>'._('Account').'</td> + <th>'._('Account Name').'</td> <th colspan=2>$BalanceDate</th> - <th colspan=2>"._('Last Year').'</th> + <th colspan=2>'._('Last Year').'</th> </tr>'; } else { /*summary */ - $TableHeader = "<tr> + $TableHeader = '<tr> <th colspan=2></th> <th colspan=2>$BalanceDate</th> - <th colspan=2>"._('Last Year').'</th> + <th colspan=2>'._('Last Year').'</th> </tr>'; } @@ -533,7 +533,7 @@ $k++; } - $ActEnquiryURL = "<a href='$rootpath/GLAccountInquiry.php?" . SID . "Period=" . $_POST['BalancePeriodEnd'] . '&Account=' . $myrow['accountcode'] . "'>" . $myrow['accountcode'] . '<a>'; + $ActEnquiryURL = '<a href="' . $rootpath . '/GLAccountInquiry.php?Period=' . $_POST['BalancePeriodEnd'] . '&Account=' . $myrow['accountcode'] . '">' . $myrow['accountcode'] . '</a>'; $PrintString = '<td>%s</td> <td>%s</td> @@ -658,7 +658,7 @@ </tr>'; echo '</table>'; - echo "<br><div class='centre'><input type=submit Name='SelectADifferentPeriod' Value='"._('Select A Different Balance Date')."'></div>"; + echo '<br><div class="centre"><input type=submit Name="SelectADifferentPeriod" Value="'._('Select A Different Balance Date').'"></div>'; } echo '</form>'; Modified: trunk/GLBudgets.php =================================================================== --- trunk/GLBudgets.php 2011-04-18 07:49:36 UTC (rev 4554) +++ trunk/GLBudgets.php 2011-04-19 10:18:49 UTC (rev 4555) @@ -24,7 +24,7 @@ prnMsg(_('Budget updated successfully'), 'success'); } -//If an account hasn't been selected then select one here. +//If an account has not been selected then select one here. echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p>'; echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post" name="selectaccount">'; echo '<input type="hidden" name="F... [truncated message content] |