Thread: [Weberp-svn] SF.net SVN: weberp:[4839] trunk (Page 3)
Brought to you by:
sotandeka,
tim_schofield
From: <tim...@us...> - 2011-03-24 11:15:48
|
Revision: 4839 http://weberp.svn.sourceforge.net/weberp/?rev=4839&view=rev Author: tim_schofield Date: 2011-03-24 11:15:41 +0000 (Thu, 24 Mar 2011) Log Message: ----------- Phil: Corrections to Top Items report Modified Paths: -------------- trunk/PDFTopItems.php trunk/TopItems.php Modified: trunk/PDFTopItems.php =================================================================== --- trunk/PDFTopItems.php 2011-03-24 11:13:03 UTC (rev 4838) +++ trunk/PDFTopItems.php 2011-03-24 11:15:41 UTC (rev 4839) @@ -1,7 +1,7 @@ <?php /* $Revision: 1.2 $ */ -/* $Id$*/ -//$PageSecurity = 2; +/* $Id: PDFTopItems.php 4495 2011-02-22 09:45:01Z daintree $*/ + include ('includes/session.inc'); include ('includes/PDFStarter.php'); $FontSize = 10; @@ -10,79 +10,78 @@ $line_height = 12; include ('includes/PDFTopItemsHeader.inc'); $FontSize = 10; -$FromDate = FormatDateForSQL(DateAdd(Date($_SESSION['DefaultDateFormat']),'d', -$_POST['NumberOfDays'])); +$FromDate = FormatDateForSQL(DateAdd(Date($_SESSION['DefaultDateFormat']),'d', -$_GET['NumberOfDays'])); //the situation if the location and customer type selected "All" -if (($_GET["location"] == "All") and ($_GET["customers"] == "All")) { +if (($_GET['Location'] == 'All') and ($_GET['Customers'] == 'All')) { $SQL = "SELECT salesorderdetails.stkcode, - SUM(salesorderdetails.qtyinvoiced) TotalInvoiced, - SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS ValueSales, + SUM(salesorderdetails.qtyinvoiced) totalinvoiced, + SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS valuesales, stockmaster.description, stockmaster.units FROM salesorderdetails, salesorders, debtorsmaster,stockmaster WHERE salesorderdetails.orderno = salesorders.orderno AND salesorderdetails.stkcode = stockmaster.stockid AND salesorders.debtorno = debtorsmaster.debtorno - AND salesorderdetails.ActualDispatchDate >='" . $FromDate . "' + AND salesorderdetails.actualdispatchdate >='" . $FromDate . "' GROUP BY salesorderdetails.stkcode - ORDER BY '" . $_GET['order'] . "' DESC - LIMIT 0," . $_GET['NumberOfTopItems'] . ""; + ORDER BY '" . $_GET['Sequence'] . "' DESC + LIMIT " . $_GET['NumberOfTopItems'] ; } else { //the situation if only location type selected "All" - if ($_GET["location"] == "All") { + if ($_GET['Location'] == 'All') { $SQL = "SELECT salesorderdetails.stkcode, - SUM(salesorderdetails.qtyinvoiced) TotalInvoiced, - SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS ValueSales, + SUM(salesorderdetails.qtyinvoiced) totalinvoiced, + SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS valuesales, stockmaster.description, stockmaster.units FROM salesorderdetails, salesorders, debtorsmaster,stockmaster WHERE salesorderdetails.orderno = salesorders.orderno AND salesorderdetails.stkcode = stockmaster.stockid AND salesorders.debtorno = debtorsmaster.debtorno - AND debtorsmaster.typeid = '" . $_GET["customers"] . "' - AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' + AND debtorsmaster.typeid = '" . $_GET['Customers'] . "' + AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' GROUP BY salesorderdetails.stkcode - ORDER BY '" . $_GET['order'] . "' DESC - LIMIT 0," . $_GET['NumberOfTopItems'] . ""; + ORDER BY '" . $_GET['Sequence'] . "' DESC + LIMIT " . $_GET['NumberOfTopItems']; } else { //the situation if the customer type selected "All" - if ($_GET["customers"] == "All") { - $SQL = " - SELECT salesorderdetails.stkcode, - SUM(salesorderdetails.qtyinvoiced) TotalInvoiced, - SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS ValueSales, + if ($_GET['Customers'] == 'All') { + $SQL = "SELECT salesorderdetails.stkcode, + SUM(salesorderdetails.qtyinvoiced) totalinvoiced, + SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS valuesales, stockmaster.description, stockmaster.units FROM salesorderdetails, salesorders, debtorsmaster,stockmaster WHERE salesorderdetails.orderno = salesorders.orderno AND salesorderdetails.stkcode = stockmaster.stockid AND salesorders.debtorno = debtorsmaster.debtorno - AND salesorders.fromstkloc = '" . $_GET['location'] . "' - AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' + AND salesorders.fromstkloc = '" . $_GET['Location'] . "' + AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' GROUP BY salesorderdetails.stkcode - ORDER BY '" . $_GET['order'] . "' DESC - LIMIT 0," . $_GET['NumberOfTopItems'] . ""; + ORDER BY '" . $_GET['Sequence'] . "' DESC + LIMIT 0," . $_GET['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, + $SQL = "SELECT salesorderdetails.stkcode, + SUM(salesorderdetails.qtyinvoiced) totalinvoiced, + SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS valuesales, stockmaster.description, stockmaster.units FROM salesorderdetails, salesorders, debtorsmaster,stockmaster WHERE salesorderdetails.orderno = salesorders.orderno AND salesorderdetails.stkcode = stockmaster.stockid AND salesorders.debtorno = debtorsmaster.debtorno - AND salesorders.fromstkloc = '" . $_GET['location'] . "' - AND debtorsmaster.typeid = '" . $_GET['customers'] . "' - AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' + AND salesorders.fromstkloc = '" . $_GET['Location'] . "' + AND debtorsmaster.typeid = '" . $_GET['Customers'] . "' + AND salesorderdetails.actualdispatchdate >= '" . $FromDate . "' GROUP BY salesorderdetails.stkcode - ORDER BY '" . $_GET['order'] . "' DESC - LIMIT 0," . $_GET['NumberOfTopItems'] . ""; + ORDER BY '" . $_GET['Sequence'] . "' DESC + LIMIT " . $_GET['NumberOfTopItems']; } } } $result = DB_query($SQL, $db); + $YPos = $YPos - 6; while ($myrow = DB_fetch_array($result)) { //find the quantity onhand item @@ -91,18 +90,12 @@ WHERE stockid='" . $myrow['0'] . "'"; $oh = db_query($sqloh, $db); $ohRow = db_fetch_row($oh); - $OnHand = $ohRow[0]; - $ValueSales = number_format($myrow['2'], 2); - $Code = $myrow['0']; //stkcode - $Desc = $myrow['3']; //desc - $TotalInvoice = $myrow['1']; //total invoice here - $Unit = $myrow['4']; //unit - $LeftOvers = $pdf->addTextWrap($Left_Margin + 1, $YPos, 300 - $Left_Margin, $FontSize, $Code); - $LeftOvers = $pdf->addTextWrap($Left_Margin + 100, $YPos, 270 - $Left_Margin, $FontSize, $Desc); - $LeftOvers = $pdf->addTextWrap($Left_Margin + 330, $YPos, 30, $FontSize, $TotalInvoice, 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin + 370, $YPos, 300 - $Left_Margin, $FontSize, $Unit, 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin + 400, $YPos, 70, $FontSize, $ValueSales, 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin + 490, $YPos, 30, $FontSize, $OnHand, 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin + 1, $YPos, 300 - $Left_Margin, $FontSize, $myrow['stkcode']); + $LeftOvers = $pdf->addTextWrap($Left_Margin + 100, $YPos, 270 - $Left_Margin, $FontSize, $myrow['description']); + $LeftOvers = $pdf->addTextWrap($Left_Margin + 330, $YPos, 30, $FontSize, $myrow['totalinvoiced'], 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin + 370, $YPos, 300 - $Left_Margin, $FontSize, $myrow['units'], 'left'); + $LeftOvers = $pdf->addTextWrap($Left_Margin + 400, $YPos, 70, $FontSize, number_format($myrow['valuesales'], 2), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin + 490, $YPos, 30, $FontSize, $ohRow[0], 'right'); if (strlen($LeftOvers) > 1) { $LeftOvers = $pdf->addTextWrap($Left_Margin + 1 + 94, $YPos - $line_height, 270, $FontSize, $LeftOvers, 'left'); $YPos-= $line_height; @@ -122,7 +115,7 @@ $title = _('Print Price List Error'); include ('includes/header.inc'); prnMsg(_('There were no records returned '), '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; } else { Modified: trunk/TopItems.php =================================================================== --- trunk/TopItems.php 2011-03-24 11:13:03 UTC (rev 4838) +++ trunk/TopItems.php 2011-03-24 11:15:41 UTC (rev 4839) @@ -7,41 +7,41 @@ $title = _('Top Items Searching'); include ('includes/header.inc'); //check if input already -if (!isset($_POST['search'])) { - +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 '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; 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'); + echo '<option value="All">' . _('All') . '</option>'; while ($myrow = DB_fetch_array($result)) { - echo "<option VALUE='" . $myrow['loccode'] . "'>" . $myrow['loccode'] . " - " . $myrow['locationname']; + echo "<option VALUE='" . $myrow['loccode'] . "'>" . $myrow['loccode'] . " - " . $myrow['locationname'] . '</option>'; } - echo "</select></td></tr>"; + 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, + $sql = 'SELECT typename, typeid - FROM debtortype"; + FROM debtortype'; $result = DB_query($sql, $db); - echo "<option value='All'>" . _('All'); + echo "<option value='All'>" . _('All') . '</option>'; while ($myrow = DB_fetch_array($result)) { - echo "<option VALUE='" . $myrow['typeid'] . "'>" . $myrow['typename']; + echo "<option VALUE='" . $myrow['typeid'] . "'>" . $myrow['typename'] . '</option>'; } - echo "</select></td> - </tr>"; + echo '</select></td> + </tr>'; //view order by list to display 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') . ''; + <td><select name="Sequence">'; + echo ' <option value="TotalInvoiced">' . _('Total Pieces') . ''; + echo ' <option value="ValueSales">' . _('Value of Sales') . ''; echo ' </select></td> </tr>'; //View number of days @@ -57,14 +57,16 @@ <td></td> <td></td> </tr> - </form></table>'; - echo '<br /><div class=centre><input tabindex=5 name="search" type=submit value="' . _('Search') . '"></div>'; + </table> + <br /><div class=centre> + <input tabindex=5 type=submit name="Search" value="' . _('Search') . '"> + </div></form>'; } else { // everything below here to view NumberOfTopItems items sale on selected location $FromDate = FormatDateForSQL(DateAdd(Date($_SESSION['DefaultDateFormat']),'d', -$_POST['NumberOfDays'])); //the situation if the location and customer type selected "All" if (($_POST['Location'] == 'All') and ($_POST['Customers'] == 'All')) { - + $SQL = "SELECT salesorderdetails.stkcode, SUM(salesorderdetails.qtyinvoiced) TotalInvoiced, SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS ValueSales, @@ -78,7 +80,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'] . ""; @@ -149,31 +151,32 @@ } } $result = DB_query($SQL, $db); + echo '<p class="page_title_text" align="center"><strong>' . _('Top Sales Items List') . '</strong></p>'; - echo "<form action=PDFTopItems.php method='GET'><table class='selection'>"; + echo '<form action="PDFTopItems.php" method="GET"><table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - $TableHeader = '<tr><th><strong>' . _('#') . '</strong></th> - <th><strong>' . _('Code') . '</strong></th> - <th><strong>' . _('Description') . '</strong></th> - <th><strong>' . _('Total Invoiced') . '</strong></th> - <th><strong>' . _('Units') . '</strong></th> - <th><strong>' . _('Value Sales') . '</strong></th> - <th><strong>' . _('On Hand') . '</strong></th>'; + $TableHeader = '<tr><th>' . _('#') . '</th> + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Total Invoiced') . '</th> + <th>' . _('Units') . '</th> + <th>' . _('Value Sales') . '</th> + <th>' . _('On Hand') . '</th>'; echo $TableHeader; 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['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" /> '; $k = 0; //row colour counter $i = 1; while ($myrow = DB_fetch_array($result)) { //find the quantity onhand item $sqloh = "SELECT sum(quantity)as qty - FROM `locstock` - WHERE stockid='" . $myrow['0'] . "'"; + FROM `locstock` + WHERE stockid='" . $myrow['0'] . "'"; $oh = db_query($sqloh, $db); $ohRow = db_fetch_row($oh); if ($k == 1) { @@ -190,19 +193,20 @@ <td>%s</td> <td class="number">%s</td> <td class="number">%s</td> - </tr>', $i, $myrow['0'], $myrow['3'], $myrow['1'], //total invoice here - $myrow['4'], //unit - number_format($myrow['2']/$myrow['5'],2), //value sales here - number_format($ohRow[0], $myrow['7']) //on hand - ); - $i+= 1; + </tr>', + $i, + $myrow['0'], + $myrow['3'], + $myrow['1'], //total invoice here + $myrow['4'], //unit + number_format($myrow['2']/$myrow['5'],2), //value sales here + number_format($ohRow[0], $myrow['7']) //on hand + ); + $i++; } echo '</table>'; - // echo '<td style="text-align:center" colspan=6><a href="javascript:history.go(-1)" title="Return to previous page"><input type=Button Name="Back" Value="' . _('Back') . '"></a></font>   '; echo '<br /><div class="centre"><input type=Submit Name="PrintPDF" Value="' . _('Print To PDF') . '"></div>'; echo '</form>'; - //end of the else statement - } 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: <tim...@us...> - 2011-03-27 13:40:26
|
Revision: 4912 http://weberp.svn.sourceforge.net/weberp/?rev=4912&view=rev Author: tim_schofield Date: 2011-03-27 13:40:20 +0000 (Sun, 27 Mar 2011) Log Message: ----------- Add field in www_users for whether a user can create tenders Modified Paths: -------------- trunk/WWW_Users.php trunk/includes/session.inc Added Paths: ----------- trunk/sql/mysql/updates/74.php Modified: trunk/WWW_Users.php =================================================================== --- trunk/WWW_Users.php 2011-03-27 13:37:33 UTC (rev 4911) +++ trunk/WWW_Users.php 2011-03-27 13:40:20 UTC (rev 4912) @@ -136,6 +136,7 @@ salesman='" . $_POST['Salesman'] . "', pagesize='" . $_POST['PageSize'] . "', fullaccess='" . $_POST['Access'] . "', + cancreatetender='" . $_POST['CanCreateTender'] . "', theme='" . $_POST['Theme'] . "', language ='" . $_POST['UserLanguage'] . "', defaultlocation='" . $_POST['DefaultLocation'] ."', @@ -158,6 +159,7 @@ email, pagesize, fullaccess, + cancreatetender, defaultlocation, modulesallowed, displayrecordsmax, @@ -175,11 +177,12 @@ '" . $_POST['Email'] ."', '" . $_POST['PageSize'] ."', '" . $_POST['Access'] . "', + '" . $_POST['CanCreateTender'] . "', '" . $_POST['DefaultLocation'] ."', '" . $ModulesAllowed . "', '" . $_SESSION['DefaultDisplayRecordsMax'] . "', '" . $_POST['Theme'] . "', - '". $_POST['UserLanguage'] ."', + '" . $_POST['UserLanguage'] ."', '" . $_POST['PDFLanguage'] . "')"; prnMsg( _('A new user record has been inserted'), 'success' ); } @@ -201,6 +204,7 @@ unset($_POST['Password']); unset($_POST['PageSize']); unset($_POST['Access']); + unset($_POST['CanCreateTender']); unset($_POST['DefaultLocation']); unset($_POST['ModulesAllowed']); unset($_POST['Blocked']); @@ -250,6 +254,7 @@ salesman, lastvisitdate, fullaccess, + cancreatetender, pagesize, theme, language @@ -267,6 +272,7 @@ <th>" . _('Salesperson') . "</th> <th>" . _('Last Visit') . "</th> <th>" . _('Security Role') ."</th> + <th>" . _('Can Create Tender') ."</th> <th>" . _('Report Size') ."</th> <th>" . _('Theme') ."</th> <th>" . _('Language') ."</th> @@ -274,7 +280,7 @@ $k=0; //row colour counter - while ($myrow = DB_fetch_row($result)) { + while ($myrow = DB_fetch_array($result)) { if ($k==1){ echo '<tr class="EvenTableRows">'; $k=0; @@ -290,7 +296,11 @@ } /*The SecurityHeadings array is defined in config.php */ - + if ($myrow['cancreatetender']==0) { + $CanCreateTender=_('No'); + } else { + $CanCreateTender=_('Yes'); + } printf("<td>%s</td> <td>%s</td> <td>%s</td> @@ -304,26 +314,28 @@ <td>%s</td> <td>%s</td> <td>%s</td> + <td>%s</td> <td><a href=\"%s&SelectedUser=%s\">" . _('Edit') . "</a></td> <td><a href=\"%s&SelectedUser=%s&delete=1\">" . _('Delete') . "</a></td> </tr>", - $myrow[0], - $myrow[1], - $myrow[2], - $myrow[3], - $myrow[4], - $myrow[5], - $myrow[6], - $myrow[7], + $myrow['userid'], + $myrow['realname'], + $myrow['phone'], + $myrow['email'], + $myrow['customerid'], + $myrow['branchcode'], + $myrow['supplierid'], + $myrow['salesman'], $LastVisitDate, - $SecurityRoles[($myrow[9])], - $myrow[10], - $myrow[11], - $myrow[12], + $SecurityRoles[($myrow['fullaccess'])], + $CanCreateTender, + $myrow['pagesize'], + $myrow['theme'], + $myrow['language'], $_SERVER['PHP_SELF'] . "?" . SID, - $myrow[0], + $myrow['userid'], $_SERVER['PHP_SELF'] . "?" . SID, - $myrow[0]); + $myrow['userid']); } //END WHILE LIST LOOP echo '</table><br>'; @@ -351,6 +363,7 @@ salesman, pagesize, fullaccess, + cancreatetender, defaultlocation, modulesallowed, blocked, @@ -373,6 +386,7 @@ $_POST['Salesman'] = $myrow['salesman']; $_POST['PageSize'] = $myrow['pagesize']; $_POST['Access'] = $myrow['fullaccess']; + $_POST['CanCreateTender'] = $myrow['cancreatetender']; $_POST['DefaultLocation'] = $myrow['defaultlocation']; $_POST['ModulesAllowed'] = $myrow['modulesallowed']; $_POST['Theme'] = $myrow['theme']; @@ -436,6 +450,19 @@ } } echo '</select></td></tr>'; +echo '<tr><td>' . _('User Can Create Tenders') . ':</td><td><select name="CanCreateTender">'; + +if ($_POST['CanCreateTender']==0){ + echo '<option selected value=0>' . _('No') . '</option>'; + echo '<option value=1>' . _('Yes') . '</option>'; +} else { + echo '<option selected value=1>' . _('Yes') . '</option>'; + echo '<option value=0>' . _('No') . '</option>'; +} +echo '</select></td></tr>'; + + +echo '</select></td></tr>'; echo '<input type="hidden" name="ID" value="'.$_SESSION['UserID'].'">'; echo '<tr><td>' . _('Default Location') . ':</td> Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2011-03-27 13:37:33 UTC (rev 4911) +++ trunk/includes/session.inc 2011-03-27 13:40:20 UTC (rev 4912) @@ -13,7 +13,7 @@ header('Location:' . $rootpath . '/install/index.php'); } include($PathPrefix . 'config.php'); -$DBVersion=73; +$DBVersion=74; if (isset($SessionSavePath)){ session_save_path($SessionSavePath); } Added: trunk/sql/mysql/updates/74.php =================================================================== --- trunk/sql/mysql/updates/74.php (rev 0) +++ trunk/sql/mysql/updates/74.php 2011-03-27 13:40:20 UTC (rev 4912) @@ -0,0 +1,13 @@ +<?php + +/* Add extra field into www_users setting whether a user + * can create a tender. 0=No 1=Yes + */ + +AddColumn('cancreatetender', 'www_users', 'tinyint(1)', 'NOT NULL', '0', 'fullaccess', $db); + +$sql="UPDATE www_users SET cancreatetender=0"; + +UpdateDBNo(74, $db); + +?> \ 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: <tim...@us...> - 2011-03-27 13:40:41
|
Revision: 4913 http://weberp.svn.sourceforge.net/weberp/?rev=4913&view=rev Author: tim_schofield Date: 2011-03-27 13:40:35 +0000 (Sun, 27 Mar 2011) Log Message: ----------- Check if the user has authority to create a tender Modified Paths: -------------- trunk/SupplierTenderCreate.php trunk/includes/UserLogin.php Modified: trunk/SupplierTenderCreate.php =================================================================== --- trunk/SupplierTenderCreate.php 2011-03-27 13:40:20 UTC (rev 4912) +++ trunk/SupplierTenderCreate.php 2011-03-27 13:40:35 UTC (rev 4913) @@ -13,6 +13,17 @@ unset($_SESSION['tender']); } +if (isset($_GET['New']) and $_SESSION['CanCreateTender']==0) { + $title = _('Authorisation Problem'); + include('includes/header.inc'); + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . + $title . '" alt=""> '.$title . '</p>'; + prnMsg( _('You do not have authority to create supplier tenders for this company.') . '<br />' . + _('Please see your system administrator'), 'warn'); + include('includes/footer.inc'); + exit; +} + $ShowTender = 0; if (isset($_GET['ID'])) { Modified: trunk/includes/UserLogin.php =================================================================== --- trunk/includes/UserLogin.php 2011-03-27 13:40:20 UTC (rev 4912) +++ trunk/includes/UserLogin.php 2011-03-27 13:40:35 UTC (rev 4913) @@ -63,6 +63,7 @@ $_SESSION['UserID'] = $myrow['userid']; $_SESSION['AttemptsCounter'] = 0; $_SESSION['AccessLevel'] = $myrow['fullaccess']; + $_SESSION['CanCreateTender'] = $myrow['cancreatetender']; $_SESSION['CustomerID'] = $myrow['customerid']; $_SESSION['UserBranch'] = $myrow['branchcode']; $_SESSION['DefaultPageSize'] = $myrow['pagesize']; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-03-27 13:42:22
|
Revision: 4922 http://weberp.svn.sourceforge.net/weberp/?rev=4922&view=rev Author: tim_schofield Date: 2011-03-27 13:42:15 +0000 (Sun, 27 Mar 2011) Log Message: ----------- Phil Add facility to create a purchase order directly from the select sales order screen Modified Paths: -------------- trunk/SelectSalesOrder.php trunk/includes/session.inc Added Paths: ----------- trunk/sql/mysql/updates/75.php Modified: trunk/SelectSalesOrder.php =================================================================== --- trunk/SelectSalesOrder.php 2011-03-27 13:41:56 UTC (rev 4921) +++ trunk/SelectSalesOrder.php 2011-03-27 13:42:15 UTC (rev 4922) @@ -1,13 +1,315 @@ <?php -/* $Id$*/ +/* $Id: SelectSalesOrder.php 4514 2011-03-18 22:51:07Z daintree $*/ -//$PageSecurity = 2; - include('includes/session.inc'); $title = _('Search Outstanding Sales Orders'); include('includes/header.inc'); +include('includes/SQL_CommonFunctions.inc'); +if (isset($_POST['PlacePO'])){ /*user hit button to place PO for selected orders */ + + /*Note the button would not have been displayed if the user had no authority to create purchase orders */ + $OrdersToPlacePOFor = ''; + for ($i=1;$i<count($_POST);$i++){ + if (isset($_POST['PlacePO_' . $i])) { //checkboxes only set if they are checked + if ($OrdersToPlacePOFor==''){ + $OrdersToPlacePOFor .= ' orderno=' . $_POST['OrderNo_PO_'.$i]; + } else { + $OrdersToPlacePOFor .= ' OR orderno=' . $_POST['OrderNo_PO_'.$i]; + } + } + } + if (strlen($OrdersToPlacePOFor)==''){ + prnMsg(_('There were no sales orders checked to place purchase orders for. No purchase orders will be created.'),'info'); + } else { + /* Now build SQL of items to purchase with purchasing data and preferred suppliers - sorted by preferred supplier */ + $sql = "SELECT purchdata.supplierno, + purchdata.stockid, + purchdata.price, + purchdata.suppliers_partno, + purchdata.supplierdescription, + purchdata.conversionfactor, + purchdata.leadtime, + purchdata.suppliersuom, + stockmaster.kgs, + stockmaster.volume, + stockcategory.stockact, + SUM(salesorderdetails.quantity-salesorderdetails.qtyinvoiced) AS orderqty + FROM purchdata INNER JOIN salesorderdetails ON + purchdata.stockid = salesorderdetails.stkcode + INNER JOIN stockmaster ON + purchdata.stockid = stockmaster.stockid + INNER JOIN stockcategory ON + stockmaster.categoryid = stockcategory.categoryid + WHERE purchdata.preferred=1 + AND purchdata.effectivefrom <='" . Date('Y-m-d') . "' + AND (" . $OrdersToPlacePOFor . ") + GROUP BY purchdata.supplierno, + purchdata.stockid, + purchdata.price, + purchdata.suppliers_partno, + purchdata.supplierdescription, + purchdata.conversionfactor, + purchdata.leadtime, + purchdata.suppliersuom, + stockmaster.kgs, + stockmaster.volume, + stockcategory.stockact + ORDER BY purchdata.supplierno, + purchdata.stockid"; + $ErrMsg = _('Unable to retrieve the items on the selected orders for creating purchase orders for'); + $ItemResult = DB_query($sql,$db,$ErrMsg); + + if (DB_num_rows($ItemResult)==0){ + prnMsg(_('There might be no supplier purchasing data set up for any items on the selected sales order(s). No purchase orders have been created'),'warn'); + } else { + /*Now get the default delivery address details from the users default stock location */ + $sql = "SELECT locationname, + deladd1, + deladd2, + deladd3, + deladd4, + deladd5, + deladd6, + tel, + contact + FROM locations + WHERE loccode = '" .$_SESSION['UserStockLocation'] . "'"; + $ErrMsg = _('The delivery address for the order could not be obtained from the user default stock location'); + $DelAddResult = DB_query($sql, $db,$ErrMsg); + $DelAddRow = DB_fetch_array($DelAddResult); + + $SupplierID = ''; + + if (IsEmailAddress($_SESSION['UserEmail'])){ + $UserDetails = ' <a href="mailto:' . $_SESSION['UserEmail'] . '">' . $_SESSION['UsersRealName']. '</a>'; + } else { + $UserDetails = ' ' . $_SESSION['UsersRealName'] . ' '; + } + + while ($ItemRow = DB_fetch_array($ItemResult)){ + + if ($SupplierID != $ItemRow['supplierno']){ + /* This order item is purchased from a different supplier so need to finish off the authorisation of the previous order and start a new order */ + + if ($SupplierID !='' AND $_SESSION['AutoAuthorisePO']==1) { + /* if an order is/has been created already and the supplier of this item has changed - so need to finish off the order */ + //if the user has authority to authorise the PO then it should be created as authorised + $AuthSQL ="SELECT authlevel + FROM purchorderauth + WHERE userid='".$_SESSION['UserID']."' + AND currabrev='".$SuppRow['currcode']."'"; + + $AuthResult=DB_query($AuthSQL,$db); + $AuthRow=DB_fetch_array($AuthResult); + if ($AuthRow['authlevel']=''){ + $AuthRow['authlevel'] = 0; + } + + if (DB_num_rows($AuthResult) > 0 AND $AuthRow['authlevel'] > $Order_Value) { //user has authority to authrorise as well as create the order + $StatusComment = date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created and Authorised by') . ' ' . $UserDetails . ' - '._('Auto created from sales orders') .'<br />'; + $ErrMsg = _('Could not update purchase order status to Authorised'); + $Debug = _('The SQL that failed was'); + $result = DB_query("UPDATE purchorders SET allowprint=1, + status='Authorised', + stat_comment='" . $StatusComment . "' + WHERE orderno='" . $PO_OrderNo . "'", + $db,$ErrMsg,$DbgMsg,true); + } else { // no authority to authorise this order + if (DB_num_rows($AuthResult) ==0){ + $AuthMessage = _('Your authority to approve purchase orders in') . ' ' .$SuppRow['currcode'] . ' ' . _('has not yet been set up') . '<br />'; + } else { + $AuthMessage = _('You can only authorise up to').' '.$SuppRow['currcode'].' '.$AuthRow['authlevel'].'.<br />'; + } + + prnMsg( _('You do not have permission to authorise this purchase order').'.<br />'. _('This order is for').' '. + $SuppRow['currcode'] . ' '. $Order_Value .'. '. + $AuthMessage . _('If you think this is a mistake please contact the systems administrator') . '<br />'. + _('The order has been created with a status of pending and will require authorisation'), 'warn'); + } + } //end of authorisation status settings + + if ($SupplierID !=''){ //then we have just added a purchase order + echo '<p />'; + prnMsg(_('Purchase Order') . ' ' . $PO_OrderNo . ' ' . _('on') . ' ' . $SupplierID . ' ' . _('has been created'),'success'); + DB_Txn_Commit($db); + } + + /*Starting a new purchase order with a different supplier */ + $result = DB_Txn_Begin($db); + + $PO_OrderNo = GetNextTransNo(18, $db); //get the next PO number + + $SupplierID = $ItemRow['supplierno']; + $Order_Value =0; + /*Now get all the required details for the supplier */ + $sql = "SELECT address1, + address2, + address3, + address4, + address5, + address6, + telephone, + paymentterms, + currcode, + rate + FROM suppliers INNER JOIN currencies + ON suppliers.currcode = currencies.currabrev + WHERE supplierid='" . $SupplierID . "'"; + + $ErrMsg = _('Could not get the supplier information for the order'); + $SuppResult = DB_query($sql, $db, $ErrMsg); + $SuppRow = DB_fetch_array($SuppResult); + + $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created by') . ' ' . $UserDetails . ' - '._('Auto created from sales orders') .'<br />'; + /*Insert to purchase order header record */ + $sql = "INSERT INTO purchorders ( orderno, + supplierno, + orddate, + rate, + initiator, + intostocklocation, + deladd1, + deladd2, + deladd3, + deladd4, + deladd5, + deladd6, + tel, + suppdeladdress1, + suppdeladdress2, + suppdeladdress3, + suppdeladdress4, + suppdeladdress5, + suppdeladdress6, + supptel, + version, + revised, + deliveryby, + status, + stat_comment, + deliverydate, + paymentterms, + allowprint) + VALUES( '" . $PO_OrderNo . "', + '" . $SupplierID . "', + '" . Date('Y-m-d') . "', + '" . $SuppRow['rate'] . "', + '" . $_SESSION['UsersRealName'] . "', + '" . $_SESSION['UserStockLocation'] . "', + '" . $DelAddRow['locationname'] . "', + '" . $DelAddRow['deladd1'] . "', + '" . $DelAddRow['deladd2'] . "', + '" . $DelAddRow['deladd3'] . "', + '" . $DelAddRow['deladd4'] . "', + '" . $DelAddRow['deladd5'] . ' ' . $DelAddRow['deladd6'] . "', + '" . $DelAddRow['tel'] . "', + '" . $SuppRow['address1'] . "', + '" . $SuppRow['address2'] . "', + '" . $SuppRow['address3'] . "', + '" . $SuppRow['address4'] . "', + '" . $SuppRow['address5'] . "', + '" . $SuppRow['address6'] . "', + '" . $SuppRow['telephone'] . "', + '1.0', + '" . Date('Y-m-d') . "', + '" . $_SESSION['Default_Shipper'] . "', + 'Pending', + '" . $StatusComment . "', + '" . Date('Y-m-d') . "', + '" . $SuppRow['paymentterms'] . "', + 0)"; + + $ErrMsg = _('The purchase order header record could not be inserted into the database because'); + $DbgMsg = _('The SQL statement used to insert the purchase order header record and failed was'); + $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); + } //end if it's a new supplier and PO to create + + /*reminder we are in a loop of the total of each item to place a purchase order for based on a selection of sales orders */ + $DeliveryDate = DateAdd(Date($_SESSION['DefaultDateFormat']),'d',$ItemRow['leadtime']); + $sql = "INSERT INTO purchorderdetails ( orderno, + itemcode, + deliverydate, + itemdescription, + glcode, + unitprice, + quantityord, + uom, + suppliers_partno, + gw, + cuft, + conversionfactor ) + VALUES ('" . $PO_OrderNo . "', + '" . $ItemRow['stockid'] . "', + '" . FormatDateForSQL($DeliveryDate) . "', + '" . $ItemRow['suppliers_partno'] . ' ' . $ItemRow['supplierdescription'] . "', + '" . $ItemRow['stockact'] . "', + '" . $ItemRow['price'] . "', + '" . $ItemRow['orderqty'] . "', + '" . $ItemRow['suppliersuom'] . "', + '" . $ItemRow['suppliers_partno'] . "', + '" . $ItemRow['kgs'] . "', + '" . $ItemRow['volume'] . "', + '" . $ItemRow['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); + $Order_Value += ($ItemRow['price']*$ItemRow['orderqty']); + } /* end of the loop round the items on the sales order that we wish to place purchase orders for */ + + + /* The last line to be purchase ordered was reach so there will be an order which is not yet completed in progress now to completed it */ + + if ($SupplierID !='') { + //if the user has authority to authorise the PO then it should be created as authorised + $AuthSQL ="SELECT authlevel + FROM purchorderauth + WHERE userid='".$_SESSION['UserID']."' + AND currabrev='".$SuppRow['currcode']."'"; + + $AuthResult=DB_query($AuthSQL,$db); + $AuthRow=DB_fetch_array($AuthResult); + if ($AuthRow['authlevel']=''){ + $AuthRow['authlevel'] = 0; + } + + if (DB_num_rows($AuthResult) > 0 AND $AuthRow['authlevel'] > $Order_Value) { //user has authority to authrorise as well as create the order + $StatusComment = date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created and Authorised by') . $UserDetails . ' - '._('Auto created from sales orders') .'<br />'; + $ErrMsg = _('Could not update purchase order status to Authorised'); + $Debug = _('The SQL that failed was'); + $result = DB_query("UPDATE purchorders SET allowprint=1, + status='Authorised', + stat_comment='" . $StatusComment . "' + WHERE orderno='" . $PO_OrderNo . "'", + $db,$ErrMsg,$DbgMsg,true); + } else { // no authority to authorise this order + if (DB_num_rows($AuthResult) ==0){ + $AuthMessage = _('Your authority to approve purchase orders in') . ' ' .$SuppRow['currcode'] . ' ' . _('has not yet been set up') . '<br />'; + } else { + $AuthMessage = _('You can only authorise up to').' '.$SuppRow['currcode'].' '.$AuthRow['authlevel'].'.<br />'; + } + + prnMsg( _('You do not have permission to authorise this purchase order').'.<br />'. _('This order is for').' '. $SuppRow['currcode'] . ' '. $Order_Value .'. '. $AuthMessage . _('If you think this is a mistake please contact the systems administrator') . '<br />'. _('The order has been created with a status of pending and will require authorisation'), 'warn'); + } + } //end of authorisation status settings + + if ($SupplierID !=''){ //then we have just added a purchase order irrespective of autoauthorise status + echo '<p>'; + prnMsg(_('Purchase Order') . ' ' . $PO_OrderNo . ' ' . _('on') . ' ' . $SupplierID . ' ' . _('has been created'),'success'); + DB_Txn_Commit($db); + } + $result = DB_query("UPDATE salesorders SET poplaced=1 WHERE " . $OrdersToPlacePOFor,$db); + }/*There were items that had purchasing data set up to create POs for */ + } /* there were sales orders checked to place POs for */ +}/*end of purchase order creation code */ +/* ******************************************************************************************* */ + + + +/*To the sales order selection form */ + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Sales') . '" alt="" />' . ' ' . _('Outstanding Sales Orders') . '</p> '; echo '<form action=' . $_SERVER['PHP_SELF'] .'?' .SID . ' method=post>'; @@ -118,21 +420,21 @@ 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); while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_POST['StockLocation'])){ if ($myrow['loccode'] == $_POST['StockLocation']){ - 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>'; } } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ - 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>'; } } @@ -152,28 +454,27 @@ } echo '</select> </td><td>'; - echo "<input type=submit name='SearchOrders' VALUE='" . _('Search') . "'></td>"; + echo '<input type=submit name="SearchOrders" VALUE="' . _('Search') . '"></td>'; echo ' <td><a href="' . $rootpath . '/SelectOrderItems.php?' . SID . '&NewOrder=Yes">' . _('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); - echo "</font>"; - echo "<br /><table class=selection>"; + echo '<br /><table class="selection">'; echo '<tr><th colspan=6><font size=3 color=navy>' . _('To search for sales orders for a specific part use the part selection facilities below'); echo '</th></tr>'; - echo "<tr> - <td><font size=1>" . _('Select a stock category') . ":</font> - <select name='StockCat'>"; + echo '<tr> + <td><font size="1">' . _('Select a stock category') . ':</font> + <select name="StockCat">'; while ($myrow1 = DB_fetch_array($result1)) { - echo "<option VALUE='". $myrow1['categoryid'] . "'>" . $myrow1['categorydescription']; + echo '<option value="'. $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>'; } echo '</select> @@ -191,12 +492,12 @@ if (isset($StockItemsResult) and DB_num_rows($StockItemsResult)>0) { echo '<table cellpadding=2 colspan=7 class=selection>'; - $TableHeader = "<tr> - <th>" . _('Code') . "</th> - <th>" . _('Description') . "</th> - <th>" . _('On Hand') . "</th> - <th>" . _('Units') . "</th> - </tr>"; + $TableHeader = '<tr> + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('On Hand') . '</th> + <th>' . _('Units') . '</th> + </tr>'; echo $TableHeader; $j = 1; @@ -238,7 +539,7 @@ else { //figure out the SQL required from the inputs available - if (isset($_POST['Quotations']) and $_POST['Quotations']=='Orders_Only'){ + if (isset($_POST['Quotations']) AND $_POST['Quotations']=='Orders_Only'){ $Quotations = 0; } else { $Quotations =1; @@ -255,16 +556,18 @@ salesorders.deliverydate, salesorders.deliverto, salesorders.printedpackingslip, - SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)) AS ordervalue - FROM salesorders, - salesorderdetails, - debtorsmaster, - custbranch - WHERE salesorders.orderno = salesorderdetails.orderno - AND salesorders.branchcode = custbranch.branchcode - AND salesorders.debtorno = debtorsmaster.debtorno - AND debtorsmaster.debtorno = custbranch.debtorno - AND salesorderdetails.completed=0 + salesorders.poplaced, + SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)/currencies.rate) AS ordervalue + FROM salesorders INNER JOIN salesorderdetails + ON salesorders.orderno = salesorderdetails.orderno + INNER JOIN debtorsmaster + ON salesorders.debtorno = debtorsmaster.debtorno + INNER JOIN custbranch + ON debtorsmaster.debtorno = custbranch.debtorno + AND salesorders.branchcode = custbranch.branchcode + INNER JOIN currencies + ON debtorsmaster.currcode = currencies.currabrev + WHERE salesorderdetails.completed=0 AND salesorders.orderno=". $_REQUEST['OrderNumber'] ." AND salesorders.quotation =" .$Quotations . " GROUP BY salesorders.orderno, @@ -274,7 +577,8 @@ salesorders.orddate, salesorders.deliverydate, salesorders.deliverto, - salesorders.printedpackingslip + salesorders.printedpackingslip, + salesorders.poplaced ORDER BY salesorders.orderno"; } else { /* $DateAfterCriteria = FormatDateforSQL($OrdersAfterDate); */ @@ -289,17 +593,19 @@ salesorders.orddate, salesorders.deliverydate, salesorders.deliverto, - salesorders.printedpackingslip, - salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent) AS ordervalue - FROM salesorders, - salesorderdetails, - debtorsmaster, - custbranch - WHERE salesorders.orderno = salesorderdetails.orderno - AND salesorders.debtorno = debtorsmaster.debtorno - AND debtorsmaster.debtorno = custbranch.debtorno - AND salesorders.branchcode = custbranch.branchcode - AND salesorderdetails.completed=0 + salesorders.printedpackingslip, + salesorders.poplaced, + salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)/currencies.rate AS ordervalue + FROM salesorders INNER JOIN salesorderdetails + ON salesorders.orderno = salesorderdetails.orderno + INNER JOIN debtorsmaster + ON salesorders.debtorno = debtorsmaster.debtorno + INNER JOIN custbranch + ON debtorsmaster.debtorno = custbranch.debtorno + AND salesorders.branchcode = custbranch.branchcode + INNER JOIN currencies + ON debtorsmaster.currcode = currencies.currabrev + WHERE salesorderdetails.completed=0 AND salesorders.quotation =" .$Quotations . " AND salesorderdetails.stkcode='". $_REQUEST['SelectedStockItem'] ."' AND salesorders.debtorno='" . $_REQUEST['SelectedCustomer'] ."' @@ -314,17 +620,20 @@ salesorders.customerref, salesorders.orddate, salesorders.deliverto, - salesorders.printedpackingslip, - salesorders.deliverydate, SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)) AS ordervalue - FROM salesorders, - salesorderdetails, - debtorsmaster, - custbranch - WHERE salesorders.orderno = salesorderdetails.orderno - AND salesorders.debtorno = debtorsmaster.debtorno - AND debtorsmaster.debtorno = custbranch.debtorno - AND salesorders.branchcode = custbranch.branchcode - AND salesorders.quotation =" .$Quotations . " + salesorders.printedpackingslip, + salesorders.poplaced, + salesorders.deliverydate, + SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)/currencies.rate) AS ordervalue + FROM salesorders INNER JOIN salesorderdetails + ON salesorders.orderno = salesorderdetails.orderno + INNER JOIN debtorsmaster + ON salesorders.debtorno = debtorsmaster.debtorno + INNER JOIN custbranch + ON debtorsmaster.debtorno = custbranch.debtorno + AND salesorders.branchcode = custbranch.branchcode + INNER JOIN currencies + ON debtorsmaster.currcode = currencies.currabrev + WHERE salesorders.quotation =" .$Quotations . " AND salesorderdetails.completed=0 AND salesorders.debtorno='" . $_REQUEST['SelectedCustomer'] . "' AND salesorders.fromstkloc = '". $_POST['StockLocation'] . "' @@ -335,7 +644,8 @@ salesorders.customerref, salesorders.orddate, salesorders.deliverto, - salesorders.deliverydate + salesorders.deliverydate, + salesorders.poplaced ORDER BY salesorders.orderno"; } @@ -348,16 +658,19 @@ salesorders.orddate, salesorders.deliverto, salesorders.printedpackingslip, - salesorders.deliverydate, SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)) AS ordervalue - FROM salesorders, - salesorderdetails, - debtorsmaster, - custbranch - WHERE salesorders.orderno = salesorderdetails.orderno - AND salesorders.debtorno = debtorsmaster.debtorno - AND debtorsmaster.debtorno = custbranch.debtorno - AND salesorders.branchcode = custbranch.branchcode - AND salesorderdetails.completed=0 + salesorders.poplaced, + salesorders.deliverydate, + SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)/currencies.rate) AS ordervalue + FROM salesorders INNER JOIN salesorderdetails + ON salesorders.orderno = salesorderdetails.orderno + INNER JOIN debtorsmaster + ON salesorders.debtorno = debtorsmaster.debtorno + INNER JOIN custbranch + ON debtorsmaster.debtorno = custbranch.debtorno + AND salesorders.branchcode = custbranch.branchcode + INNER JOIN currencies + ON debtorsmaster.currcode = currencies.currabrev + WHERE salesorderdetails.completed=0 AND salesorders.quotation =" .$Quotations . " AND salesorderdetails.stkcode='". $_REQUEST['SelectedStockItem'] . "' AND salesorders.fromstkloc = '". $_POST['StockLocation'] . "' @@ -367,6 +680,7 @@ salesorders.customerref, salesorders.orddate, salesorders.deliverto, + salesorders.poplaced, salesorders.deliverydate, salesorders.printedpackingslip ORDER BY salesorders.orderno"; @@ -378,17 +692,19 @@ salesorders.orddate, salesorders.deliverto, salesorders.deliverydate, - salesorders.printedpackingslip, - SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)) AS ordervalue - FROM salesorders, - salesorderdetails, - debtorsmaster, - custbranch - WHERE salesorders.orderno = salesorderdetails.orderno - AND salesorders.debtorno = debtorsmaster.debtorno - AND debtorsmaster.debtorno = custbranch.debtorno - AND salesorders.branchcode = custbranch.branchcode - AND salesorderdetails.completed=0 + salesorders.printedpackingslip, + salesorders.poplaced, + SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)/currencies.rate) AS ordervalue + FROM salesorders INNER JOIN salesorderdetails + ON salesorders.orderno = salesorderdetails.orderno + INNER JOIN debtorsmaster + ON salesorders.debtorno = debtorsmaster.debtorno + INNER JOIN custbranch + ON debtorsmaster.debtorno = custbranch.debtorno + AND salesorders.branchcode = custbranch.branchcode + INNER JOIN currencies + ON debtorsmaster.currcode = currencies.currabrev + WHERE salesorderdetails.completed=0 AND salesorders.quotation =" .$Quotations . " AND salesorders.fromstkloc = '". $_POST['StockLocation'] . "' GROUP BY salesorders.orderno, @@ -398,7 +714,8 @@ salesorders.orddate, salesorders.deliverto, salesorders.deliverydate, - salesorders.printedpackingslip + salesorders.printedpackingslip, + salesorders.poplaced ORDER BY salesorders.orderno"; } @@ -410,38 +727,55 @@ /*show a table of the orders returned by the SQL */ if (DB_num_rows($SalesOrdersResult)>0) { - echo '<table cellpadding=2 colspan=7 width=95% class=selection>'; - if (isset($_POST['Quotations']) and $_POST['Quotations']=='Orders_Only'){ - $tableheader = "<tr> - <th>" . _('Modify') . "</th> - <th>" . _('Invoice') . "</th> - <th>" . _('Dispatch Note') . "</th> - <th>" . _('Sales Order') . "</th> - <th>" . _('Customer') . "</th> - <th>" . _('Branch') . "</th> - <th>" . _('Cust Order') . " #</th> - <th>" . _('Order Date') . "</th> - <th>" . _('Req Del Date') . "</th> - <th>" . _('Delivery To') . "</th> - <th>" . _('Order Total') . "</th></tr>"; - } else { - $tableheader = "<tr> - <th>" . _('Modify') . "</th> - <th>" . _('Print Quote') . "</th> - <th>" . _('Customer') . "</th> - <th>" . _('Branch') . "</th> - <th>" . _('Cust Ref') . " #</th> - <th>" . _('Quote Date') . "</th> - <th>" . _('Req Del Date') . "</th> - <th>" . _('Delivery To') . "</th> - <th>" . _('Quote Total') . "</th></tr>"; + /* Get users authority to place POs */ + $AuthSQL="SELECT cancreate + FROM purchorderauth + WHERE userid='". $_SESSION['UserID'] . "'"; + + /*we don't know what currency these orders might be in but if no authority at all then don't show option*/ + $AuthResult=DB_query($AuthSQL,$db); + $AuthRow=DB_fetch_array($AuthResult); + + echo '<table cellpadding=2 colspan=7 width=95% class=selection>'; + + if (isset($_POST['Quotations']) AND $_POST['Quotations']=='Orders_Only'){ + $tableheader = '<tr> + <th>' . _('Modify') . '</th> + <th>' . _('Invoice') . '</th> + <th>' . _('Dispatch Note') . '</th> + <th>' . _('Customer') . '</th> + <th>' . _('Branch') . '</th> + <th>' . _('Cust Order') . ' #</th> + <th>' . _('Order Date') . '</th> + <th>' . _('Req Del Date') . '</th> + <th>' . _('Delivery To') . '</th> + <th>' . _('Order Total') . '<br />' . $_SESSION['CompanyRecord']['currencydefault'] . '</th>'; + if ($AuthRow['cancreate']==0){ //If cancreate==0 then this means the user can create orders hmmm!! + $tableheader .= '<th>' . _('Place PO') . '</th></tr>'; + } else { + $tableheader .= '</tr>'; + } + } else { /* displaying only quotations */ + $tableheader = '<tr> + <th>' . _('Modify') . '</th> + <th>' . _('Print Quote') . '</th> + <th>' . _('Customer') . '</th> + <th>' . _('Branch') . '</th> + <th>' . _('Cust Ref') . ' #</th> + <th>' . _('Quote Date') . '</th> + <th>' . _('Req Del Date') . '</th> + <th>' . _('Delivery To') . '</th> + <th>' . _('Quote Total') . '<br />' . $_SESSION['CompanyRecord']['currencydefault'] . '</th></tr>'; } echo $tableheader; - } - $j = 1; + + $i = 1; + $j = 1; $k=0; //row colour counter + $OrdersTotal =0; + while ($myrow=DB_fetch_array($SalesOrdersResult)) { @@ -453,84 +787,123 @@ $k++; } - $ModifyPage = $rootpath . "/SelectOrderItems.php?" . SID . '&ModifyOrderNumber=' . $myrow['orderno']; - $Confirm_Invoice = $rootpath . '/ConfirmDispatch_Invoice.php?' . SID . '&OrderNumber=' .$myrow['orderno']; + $ModifyPage = $rootpath . '/SelectOrderItems.php?ModifyOrderNumber=' . $myrow['orderno']; + $Confirm_Invoice = $rootpath . '/ConfirmDispatch_Invoice.php?OrderNumber=' .$myrow['orderno']; - if ($_SESSION['PackNoteFormat']==1){ /*Laser printed A4 default */ - $PrintDispatchNote = $rootpath . '/PrintCustOrder_generic.php?' . SID . '&TransNo=' . $myrow['orderno']; - } else { /*pre-printed stationery default */ - $PrintDispatchNote = $rootpath . '/PrintCustOrder.php?' . SID . '&TransNo=' . $myrow['orderno']; - } - $PrintSalesOrder = $rootpath . '/PrintSalesOrder_generic.php?' . SID . '&TransNo=' . $myrow['orderno']; - $PrintQuotation = $rootpath . '/PDFQuotation.php?' . SID . '&QuotationNo=' . $myrow['orderno']; - $FormatedDelDate = ConvertSQLDate($myrow['deliverydate']); - $FormatedOrderDate = ConvertSQLDate($myrow['orddate']); - $FormatedOrderValue = number_format($myrow['ordervalue'],2); + if ($_SESSION['PackNoteFormat']==1){ /*Laser printed A4 default */ + $PrintDispatchNote = $rootpath . '/PrintCustOrder_generic.php?TransNo=' . $myrow['orderno']; + } else { /*pre-printed stationery default */ + $PrintDispatchNote = $rootpath . '/PrintCustOrder.php?TransNo=' . $myrow['orderno']; + } + $PrintQuotation = $rootpath . '/PDFQuotation.php?QuotationNo=' . $myrow['orderno']; + $FormatedDelDate = ConvertSQLDate($myrow['deliverydate']); + $FormatedOrderDate = ConvertSQLDate($myrow['orddate']); + $FormatedOrderValue = number_format($myrow['ordervalue'],2); - if ($myrow['printedpackingslip']==0) { - $PrintText = _('Print'); - } else { - $PrintText = _('Reprint'); + if ($myrow['printedpackingslip']==0) { + $PrintText = _('Print'); + } else { + $PrintText = _('Reprint'); + } + + if ($_POST['Quotations']=='Orders_Only'){ + + /*Check authority to create POs if user has authority then show the check boxes to select sales orders to place POs for otherwise don't provide this option */ + if ($AuthRow['cancreate']==0 AND $myrow['poplaced']==0){ //cancreate==0 if the user can create POs and not already placed + printf("<td><a href='%s'>%s</a></td> + <td><a href='%s'>" . _('Invoice') . "</a></td> + <td><a target='_blank' href='%s'>" . $PrintText . " <IMG SRC='" .$rootpath."/css/".$theme."/images/pdf.png' title='" . _('Click for PDF') . "'></a></td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td class=number>%s</td> + <td><input type=checkbox name=PlacePO_%s value><input type=hidden name=OrderNo_PO_%s value=%s></td> + </tr>", + $ModifyPage, + $myrow['orderno'], + $Confirm_Invoice, + $PrintDispatchNote, + $myrow['name'], + $myrow['brname'], + $myrow['customerref'], + $FormatedOrderDate, + $FormatedDelDate, + $myrow['deliverto'], + $FormatedOrderValue, + $i, + $i, + $myrow['orderno']); + } else { /*User is not authorised to create POs so don't even show the option */ + printf("<td><a href='%s'>%s</a></td> + <td><a href='%s'>" . _('Invoice') . "</a></td> + <td><a target='_blank' href='%s'>" . $PrintText . " <IMG SRC='" .$rootpath."/css/".$theme."/images/pdf.png' title='" . _('Click for PDF') . "'></a></td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td class=number>%s</td> + </tr>", + $ModifyPage, + $myrow['orderno'], + $Confirm_Invoice, + $PrintDispatchNote, + $myrow['name'], + $myrow['brname'], + $myrow['customerref'], + $FormatedOrderDate, + $FormatedDelDate, + $myrow['deliverto'], + $FormatedOrderValue); + } + + } else { /*must be quotes only */ + printf("<td><a href='%s'>%s</a></td> + <td><a href='%s'>" . $PrintText . "</a></td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td class=number>%s</td> + </tr>", + $ModifyPage, + $myrow['orderno'], + $PrintQuotation, + $myrow['name'], + $myrow['brname'], + $myrow['customerref'], + $FormatedOrderDate, + $FormatedDelDate, + $myrow['deliverto'], + $FormatedOrderValue); + } + $i++; + $j++; + $OrdersTotal += $myrow['ordervalue']; + if ($j == 12){ + $j=1; + echo $tableheader; + } + //end of page full new headings if + }//end while loop through orders to display + if ($_POST['Quotations']=='Orders_Only' AND $AuthRow['cancreate']==0){ //cancreate==0 means can create POs + echo '<tr><td colspan="8"><td><td colspan="2" class="number"><input type="submit" name="PlacePO" value="' . _('Place') . "\n" . _('PO') . '" onclick="return confirm(\'' . _('This will create purchase orders for all the items on the checked sales orders above, based on the preferred supplier purchasing data held in the system. Are You Absolutely Sure?') . '\');"></td</tr>'; } - + echo '<tr><td colspan="9" class="number">'; if ($_POST['Quotations']=='Orders_Only'){ - printf("<td><a href='%s'>%s</a></td> - <td><a href='%s'>" . _('Invoice') . "</a></td> - <td><a target='_blank' href='%s'>" . $PrintText . " <IMG SRC='" .$rootpath."/css/".$theme."/images/pdf.png' title='" . _('Click for PDF') . "'></a></td> - <td><a target='_blank' href='%s'>" . $PrintText . " <IMG SRC='" .$rootpath."/css/".$theme."/images/pdf.png' title='" . _('Click for PDF') . "'></a></td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td class=number>%s</td> - </tr>", - $ModifyPage, - $myrow['orderno'], - $Confirm_Invoice, - $PrintDispatchNote, - $PrintSalesOrder, - $myrow['name'], - $myrow['brname'], - $myrow['customerref'], - $FormatedOrderDate, - $FormatedDelDate, - $myrow['deliverto'], - $FormatedOrderValue); - } else { /*must be quotes only */ - printf("<td><a href='%s'>%s</a></td> - <td><a href='%s'>" . $PrintText . "</a></td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td class=number>%s</td> - </tr>", - $ModifyPage, - $myrow['orderno'], - $PrintQuotation, - $myrow['name'], - $myrow['brname'], - $myrow['customerref'], - $FormatedOrderDate, - $FormatedDelDate, - $myrow['deliverto'], - $FormatedOrderValue); + echo '<b>' . _('Total Order(s) Value in'); + } else { + echo '<b>' . _('Total Quotation(s) Value in'); } - - $j++; - if ($j == 12){ - $j=1; - echo $tableheader; - } - //end of page full new headings if - } - //end of while loop - - echo '</table>'; + echo ' ' . $_SESSION['CompanyRecord']['currencydefault'] . ' :</b></td><td class="number"><b>' . number_format($OrdersTotal,2) . '</b></td></tr> + </table>'; + } //end if there are some orders to show } ?> Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2011-03-27 13:41:56 UTC (rev 4921) +++ trunk/includes/session.inc 2011-03-27 13:42:15 UTC (rev 4922) @@ -13,7 +13,7 @@ header('Location:' . $rootpath . '/install/index.php'); } include($PathPrefix . 'config.php'); -$DBVersion=74; +$DBVersion=75; if (isset($SessionSavePath)){ session_save_path($SessionSavePath); } Added: trunk/sql/mysql/updates/75.php =================================================================== --- trunk/sql/mysql/updates/75.php (rev 0) +++ trunk/sql/mysql/updates/75.php 2011-03-27 13:42:15 UTC (rev 4922) @@ -0,0 +1,7 @@ +<?php + +AddColumn('poplaced', 'salesorders', 'tinyint(1)', 'NOT NULL', '0', 'quotation', $db); + +UpdateDBNo(75, $db); + +?> \ 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: <tim...@us...> - 2011-03-27 13:43:06
|
Revision: 4926 http://weberp.svn.sourceforge.net/weberp/?rev=4926&view=rev Author: tim_schofield Date: 2011-03-27 13:43:00 +0000 (Sun, 27 Mar 2011) Log Message: ----------- Exson fix all htmlentities to use ENTQUOTES, UTF-8 option so other character sets work with it Modified Paths: -------------- trunk/AccountGroups.php trunk/Contracts.php trunk/GLJournal.php trunk/PageSecurity.php Modified: trunk/AccountGroups.php =================================================================== --- trunk/AccountGroups.php 2011-03-27 13:42:46 UTC (rev 4925) +++ trunk/AccountGroups.php 2011-03-27 13:43:00 UTC (rev 4926) @@ -257,13 +257,13 @@ break; } //end of switch statement - echo '<td>' . htmlentities($myrow[0]) . '</td> + echo '<td>' . htmlentities($myrow[0], ENT_QUOTES,'UTF-8') . '</td> <td>' . $myrow[1] . '</td> <td>' . $myrow[2] . '</td> <td>' . $PandLText . '</td> <td>' . $myrow[4] . '</td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&SelectedAccountGroup=' . htmlentities($myrow[0]) . '">' . _('Edit') . '</a></td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&SelectedAccountGroup=' . htmlentities($myrow[0]) . '&delete=1">' . _('Delete') .'</a></td></tr>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&SelectedAccountGroup=' . htmlentities($myrow[0], ENT_QUOTES,'UTF-8') . '">' . _('Edit') . '</a></td>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&SelectedAccountGroup=' . htmlentities($myrow[0], ENT_QUOTES,'UTF-8') . '&delete=1">' . _('Delete') .'</a></td></tr>'; } //END WHILE LIST LOOP echo '</table>'; @@ -353,9 +353,9 @@ while ( $grouprow = DB_fetch_array($groupresult) ) { if (isset($_POST['ParentGroupName']) and $_POST['ParentGroupName']==$grouprow['groupname']) { - echo '<option selected="selected" value="'.htmlentities($grouprow['groupname']).'">' .htmlentities($grouprow['groupname']).'</option>'; + echo '<option selected="selected" value="'.htmlentities($grouprow['groupname']).'">' .htmlentities($grouprow['groupname'], ENT_QUOTES,'UTF-8').'</option>'; } else { - echo '<option value="'.htmlentities($grouprow['groupname']).'">' .htmlentities($grouprow['groupname']).'</option>'; + echo '<option value="'.htmlentities($grouprow['groupname']).'">' .htmlentities($grouprow['groupname'], ENT_QUOTES,'UTF-8').'</option>'; } } echo '</select>'; Modified: trunk/Contracts.php =================================================================== --- trunk/Contracts.php 2011-03-27 13:42:46 UTC (rev 4925) +++ trunk/Contracts.php 2011-03-27 13:43:00 UTC (rev 4926) @@ -790,14 +790,14 @@ $k=1; } if ($LastCustomer != $myrow['name']) { - echo '<td>'.htmlentities($myrow['name']).'</td>'; + echo '<td>'.htmlentities($myrow['name'], ENT_QUOTES,'UTF-8')).'</td>'; } else { echo '<td></td>'; } - echo '<td><input tabindex="'.number_format($j+5).'" type="submit" name="Submit'.$j.'" value="'.htmlentities($myrow['brname']).'" /></td> + echo '<td><input tabindex="'.number_format($j+5).'" type="submit" name="Submit'.$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'].'" /> - <td>'.htmlentities($myrow['contactname']).'</td> + <td>'.htmlentities($myrow['contactname'], ENT_QUOTES,'UTF-8')).'</td> <td>'.$myrow['phoneno'].'</td> <td>'.$myrow['faxno'].'</td> </tr>'; Modified: trunk/GLJournal.php =================================================================== --- trunk/GLJournal.php 2011-03-27 13:42:46 UTC (rev 4925) +++ trunk/GLJournal.php 2011-03-27 13:43:00 UTC (rev 4926) @@ -249,175 +249,172 @@ $_SESSION['JournalDetail']->JnlDate = Date($_SESSION['DefaultDateFormat'],mktime(0,0,0,date('m'),0,date('Y'))); } - echo '<table><tr> - <td colspan="5"><table class="selection"><tr><td>'._('Date to Process Journal').":</td> - <td><input type='text' class='date' alt='".$_SESSION['DefaultDateFormat']."' name='JournalProcessDate' maxlength='10' size='11' value='" . - $_SESSION['JournalDetail']->JnlDate . "' /></td>"; - echo '<td>' . _('Type') . ':</td> - <td><select name="JournalType">'; +echo '<table><tr> + <td colspan="5"><table class="selection"><tr><td>'._('Date to Process Journal').":</td> + <td><input type='text' class='date' alt='".$_SESSION['DefaultDateFormat']."' name='JournalProcessDate' maxlength='10' size='11' value='" . + $_SESSION['JournalDetail']->JnlDate . "' /></td>"; +echo '<td>' . _('Type') . ':</td> + <td><select name="JournalType">'; - if ($_POST['JournalType'] == 'Reversing'){ - echo "<option selected='True' value = 'Reversing'>" . _('Reversing')."</option>"; - echo "<option value = 'Normal'>" . _('Normal')."</option>"; - } else { - echo "<option value = 'Reversing'>" . _('Reversing')."</option>"; - echo "<option selected='True' value = 'Normal'>" . _('Normal')."</option>"; - } +if ($_POST['JournalType'] == 'Reversing'){ + echo "<option selected='True' value = 'Reversing'>" . _('Reversing')."</option>"; + echo "<option value = 'Normal'>" . _('Normal')."</option>"; +} else { + echo "<option value = 'Reversing'>" . _('Reversing')."</option>"; + echo "<option selected='True' value = 'Normal'>" . _('Normal')."</option>"; +} - echo '</select></td> - </tr> - </table>'; - /* close off the table in the first column */ +echo '</select></td> + </tr> + </table>'; +/* close off the table in the first column */ - echo '<br />'; - echo '<table class="selection" width="70%">'; - /* Set upthe form for the transaction entry for a GL Payment Analysis item */ +echo '<br />'; +echo '<table class="selection" width="70%">'; +/* Set upthe form for the transaction entry for a GL Payment Analysis item */ - echo '<tr><th colspan="3"><div class="centre"><font size="3" color="blue"><b>' . _('Journal Line Entry') . '</b></font></div></th></tr>'; +echo '<tr><th colspan="3"><div class="centre"><font size="3" color="blue"><b>' . _('Journal Line Entry') . '</b></font></div></th></tr>'; - /*now set up a GLCode field to select from avaialble GL accounts */ - echo '<tr><th>' . _('GL Tag') . '</th>'; - echo '<th>' . _('GL Account Code') . '</th>'; - echo '<th>' . _('Select GL Account') . '</th></tr>'; +/*now set up a GLCode field to select from avaialble GL accounts */ +echo '<tr><th>' . _('GL Tag') . '</th>'; +echo '<th>' . _('GL Account Code') . '</th>'; +echo '<th>' . _('Select GL Account') . '</th></tr>'; /* Set upthe form for the transaction entry for a GL Payment Analysis item */ - //Select the tag - echo '<tr><td><select name="tag">'; +//Select the tag +echo '<tr><td><select name="tag">'; - $SQL = "SELECT tagref, - tagdescription - FROM tags - ORDER BY tagref"; +$SQL = "SELECT tagref, + tagdescription + FROM tags + ORDER BY tagref"; - $result=DB_query($SQL,$db); - echo '<option value="0">0 - None</option>'; - while ($myrow=DB_fetch_array($result)){ - if (isset($_POST['tag']) and $_POST['tag']==$myrow['tagref']){ - echo '<option selected value="' . $myrow['tagref'] . '">' . $myrow['tagref'].' - ' .$myrow['tagdescription']."</option>"; - } else { - echo '<option value="' . $myrow['tagref'] . '">' . $myrow['tagref'].' - ' .$myrow['tagdescription']."</option>"; - } +$result=DB_query($SQL,$db); +echo '<option value="0">0 - None</option>'; +while ($myrow=DB_fetch_array($result)){ + if (isset($_POST['tag']) and $_POST['tag']==$myrow['tagref']){ + echo '<option selected value="' . $myrow['tagref'] . '">' . $myrow['tagref'].' - ' .$myrow['tagdescription']."</option>"; + } else { + echo '<option value="' . $myrow['tagref'] . '">' . $myrow['tagref'].' - ' .$myrow['tagdescription']."</option>"; } - echo '</select></td>'; +} +echo '</select></td>'; // End select tag - if (!isset($_POST['GLManualCode'])) { - $_POST['GLManualCode']=''; - } - echo '<td><input class="number" type="text" Name="GLManualCode" Maxlength="12" size="12" onChange="inArray(this.value, GLCode.options,'. - "'".'The account code '."'".'+ this.value+ '."'".' doesnt exist'."'".')"' . - ' value="'. $_POST['GLManualCode'] .'" /></td>'; +if (!isset($_POST['GLManualCode'])) { + $_POST['GLManualCode']=''; +} +echo '<td><input class="number" type="text" Name="GLManualCode" Maxlength="12" size="12" onChange="inArray(this.value, GLCode.options,'. + "'".'The account code '."'".'+ this.value+ '."'".' doesnt exist'."'".')"' . + ' value="'. $_POST['GLManualCode'] .'" /></td>'; - $sql="SELECT accountcode, - accountname - FROM chartmaster - ORDER BY accountcode"; +$sql="SELECT accountcode, + accountname + FROM chartmaster + ORDER BY accountcode"; - $result=DB_query($sql, $db); - echo '<td><select name="GLCode" onChange="return assignComboToInput(this,'.'GLManualCode'.')">'; - echo '<option value="">' . _('Select a general ledger account code') . '</option>'; - while ($myrow=DB_fetch_array($result)){ - if (isset($_POST['tag']) and $_POST['tag']==$myrow['accountcode']){ - echo '<option selected value="' . $myrow['accountcode'] . '">' . $myrow['accountcode'].' - ' .htmlentities($myrow['accountname'])."</option>"; - } else { - echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['accountcode'].' - ' .htmlentities($myrow['accountname'])."</option>"; - } +$result=DB_query($sql, $db); +echo '<td><select name="GLCode" onChange="return assignComboToInput(this,'.'GLManualCode'.')">'; +echo '<option value="">' . _('Select a general ledger account code') . '</option>'; +while ($myrow=DB_fetch_array($result)){ + if (isset($_POST['tag']) and $_POST['tag']==$myrow['accountcode']){ + echo '<option selected value="' . $myrow['accountcode'] . '">' . $myrow['accountcode'].' - ' .htmlentities($myrow['accountname'], ENT_QUOTES,'UTF-8'))."</option>"; + } else { + echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['accountcode'].' - ' .htmlentities($myrow['accountname'], ENT_QUOTES,'UTF-8'))."</option>"; } - echo '</select></td>'; +} +echo '</select></td>'; - if (!isset($_POST['GLNarrative'])) { - $_POST['GLNarrative'] = ''; - } - if (!isset($_POST['Credit'])) { - $_POST['Credit'] = ''; - } - if (!isset($_POST['Debit'])) { - $_POST['Debit'] = ''; - } +if (!isset($_POST['GLNarrative'])) { + $_POST['GLNarrative'] = ''; +} +if (!isset($_POST['Credit'])) { + $_POST['Credit'] = ''; +} +if (!isset($_POST['Debit'])) { + $_POST['Debit'] = ''; +} - echo '</tr><tr><th>' . _('Debit') . "</th>".'<td><input type="text" class="number" Name = "Debit" ' . - 'onChange="eitherOr(this, '.'Credit'.')"'. - ' Maxlength="12" size="10" value="' . $_POST['Debit'] . '" /></td>'; - echo '</tr><tr><th>' . _('Credit') . "</th>".'<td><input type="text" class="number" Name = "Credit" ' . - 'onChange="eitherOr(this, '.'Debit'.')"'. - ' Maxlength="12" size="10" value="' . $_POST['Credit'] . '" /></td>'; - echo '</tr><tr><td></td><td></td><th>'. _('Narrative'). '</th>'; - echo '</tr><tr><th></th><th>' . _('GL Narrative') . "</th>"; +echo '</tr><tr><th>' . _('Debit') . "</th>".'<td><input type="text" class="number" Name = "Debit" ' . + 'onChange="eitherOr(this, '.'Credit'.')"'. + ' Maxlength="12" size="10" value="' . $_POST['Debit'] . '" /></td>'; +echo '</tr><tr><th>' . _('Credit') . "</th>".'<td><input type="text" class="number" Name = "Credit" ' . + 'onChange="eitherOr(this, '.'Debit'.')"'. + ' Maxlength="12" size="10" value="' . $_POST['Credit'] . '" /></td>'; +echo '</tr><tr><td></td><td></td><th>'. _('Narrative'). '</th>'; +echo '</tr><tr><th></th><th>' . _('GL Narrative') . "</th>"; - echo '<td><input type="text" name="GLNarrative" maxlength="100" size="100" value="' . $_POST['GLNarrative'] . '" /></td>'; +echo '<td><input type="text" name="GLNarrative" maxlength="100" size="100" value="' . $_POST['GLNarrative'] . '" /></td>'; - echo '</tr></table><br />'; /*Close the main table */ - echo "<div class='centre'><input type='submit' name='Process' value='" . _('Accept') . "' /></div><br /><br />"; +echo '</tr></table><br />'; /*Close the main table */ +echo "<div class='centre'><input type='submit' name='Process' value='" . _('Accept') . "' /></div><br /><br />"; - echo "<table class='selection' width='85%'>"; +echo "<table class='selection' width='85%'>"; - echo '<tr><th colspan="6"><div class="centre"><font size="3" color="blue"><b>' . _('Journal Summary') . '</b></font></div></th></tr>'; - echo "<tr> - <th>"._('GL Tag')."</th> - <th>"._('GL Account')."</th> - <th>"._('Debit')."</th> - <th>"._('Credit')."</th> - <th>"._('Narrative').'</th></tr>'; +echo '<tr><th colspan="6"><div class="centre"><font size="3" color="blue"><b>' . _('Journal Summary') . '</b></font></div></th></tr>'; +echo "<tr> + <th>"._('GL Tag')."</th> + <th>"._('GL Account')."</th> + <th>"._('Debit')."</th> + <th>"._('Credit')."</th> + <th>"._('Narrative').'</th></tr>'; - $debittotal=0; - $credittotal=0; - $j=0; +$debittotal=0; +$credittotal=0; +$j=0; - foreach ($_SESSION['JournalDetail']->GLEntries as $JournalItem) { - if ($j==1) { - echo '<tr class="OddTableRows">'; - $j=0; - } else { - echo '<tr class="EvenTableRows">'; - $j++; - } - $sql="SELECT tagdescription - FROM tags - WHERE tagref='".$JournalItem->tag . "'"; - $result=DB_query($sql, $db); - $myrow=DB_fetch_row($result); - if ($JournalItem->tag==0) { - $tagdescription='None'; - } else { - $tagdescription=$myrow[0]; - } - echo "<td>" . $JournalItem->tag . ' - ' . $tagdescription . "</td>"; - echo "<td>" . $JournalItem->GLCode . ' - ' . $JournalItem->GLActName . "</td>"; - if($JournalItem->Amount>0) - { - echo "<td class='number'>" . number_format($JournalItem->Amount,2) . '</td><td></td>'; - $debittotal=$debittotal+$JournalItem->Amount; - } - elseif($JournalItem->Amount<0) - { - $credit=(-1 * $JournalItem->Amount); - echo "<td></td> - <td class='number'>" . number_format($credit,2) . '</td>'; - $credittotal=$credittotal+$credit; - } +foreach ($_SESSION['JournalDetail']->GLEntries as $JournalItem) { + if ($j==1) { + echo '<tr class="OddTableRows">'; + $j=0; + } else { + echo '<tr class="EvenTableRows">'; + $j++; + } + $sql="SELECT tagdescription + FROM tags + WHERE tagref='".$JournalItem->tag . "'"; + $result=DB_query($sql, $db); + $myrow=DB_fetch_row($result); + if ($JournalItem->tag==0) { + $tagdescription='None'; + } else { + $tagdescription=$myrow[0]; + } + echo "<td>" . $JournalItem->tag . ' - ' . $tagdescription . "</td>"; + echo "<td>" . $JournalItem->GLCode . ' - ' . $JournalItem->GLActName . "</td>"; + if($JournalItem->Amount>0) { + echo "<td class='number'>" . number_format($JournalItem->Amount,2) . '</td><td></td>'; + $debittotal=$debittotal+$JournalItem->Amount; + } elseif($JournalItem->Amount<0) { + $credit=(-1 * $JournalItem->Amount); + echo "<td></td> + <td class='number'>" . number_format($credit,2) . '</td>'; + $credittotal=$credittotal+$credit; + } - echo '<td>' . $JournalItem->Narrative . "</td> - <td><a href='" . $_SERVER['PHP_SELF'] . '?' . SID . '&Delete=' . $JournalItem->ID . "'>"._('Delete').'</a></td> - </tr>'; - } + echo '<td>' . $JournalItem->Narrative . "</td> + <td><a href='" . $_SERVER['PHP_SELF'] . '?' . SID . '&Delete=' . $JournalItem->ID . "'>"._('Delete').'</a></td> + </tr>'; +} - echo '<tr class="EvenTableRows"><td></td> - <td class="number"><b> Total </b></td> - <td class="number"><b>' . number_format($debittotal,2) . '</b></td> - <td class="number"><b>' . number_format($credittotal,2) . '</b></td></tr>'; - if ($debittotal!=$credittotal) { - echo '<td align="center" style="background-color: #fddbdb"><b>Required to balance - </b>' . - number_format(abs($debittotal-$credittotal),2); - } - if ($debittotal>$credittotal) { - echo ' Credit</td></tr>'; - } else if ($debittotal<$credittotal) { - echo ' Debit</td></tr>'; - } - echo '</table>'; +echo '<tr class="EvenTableRows"><td></td> + <td class="number"><b> Total </b></td> + <td class="number"><b>' . number_format($debittotal,2) . '</b></td> + <td class="number"><b>' . number_format($credittotal,2) . '</b></td></tr>'; +if ($debittotal!=$credittotal) { + echo '<td align="center" style="background-color: #fddbdb"><b>Required to balance - </b>' . + number_format(abs($debittotal-$credittotal),2); +} +if ($debittotal>$credittotal) { + echo ' Credit</td></tr>'; +} else if ($debittotal<$credittotal) { + echo ' Debit</td></tr>'; +} +echo '</table>'; if (ABS($_SESSION['JournalDetail']->JournalTotal)<0.001 AND $_SESSION['JournalDetail']->GLItemCounter > 0){ echo "<br /><br /><div class='centre'><input type='submit' name='CommitBatch' value='"._('Accept and Process Journal')."' /></div>"; Modified: trunk/PageSecurity.php =================================================================== --- trunk/PageSecurity.php 2011-03-27 13:42:46 UTC (rev 4925) +++ trunk/PageSecurity.php 2011-03-27 13:43:00 UTC (rev 4926) @@ -39,9 +39,9 @@ echo '<td><select name="'.$myrow['script'].'">'; while ($mytokenrow=DB_fetch_array($TokenResult)) { if ($mytokenrow['tokenid']==$myrow['security']) { - echo '<option selected="True" value="'.$mytokenrow['tokenid'].'">'.htmlentities($mytokenrow['tokenname']).'</option>'; + echo '<option selected="True" value="'.$mytokenrow['tokenid'].'">'.htmlentities($mytokenrow['tokenname'], ENT_QUOTES,'UTF-8').'</option>'; } else { - echo '<option value="'.$mytokenrow['tokenid'].'">'.htmlentities($mytokenrow['tokenname']).'</option>'; + echo '<option value="'.$mytokenrow['tokenid'].'">'.htmlentities($mytokenrow['tokenname'], ENT_QUOTES,'UTF-8').'</option>'; } } echo '</select></td></tr>'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-03-27 20:50:30
|
Revision: 4960 http://weberp.svn.sourceforge.net/weberp/?rev=4960&view=rev Author: tim_schofield Date: 2011-03-27 20:50:24 +0000 (Sun, 27 Mar 2011) Log Message: ----------- Create extra field in payment methods so that individual payment methods can use pre printed stationery Modified Paths: -------------- trunk/PaymentMethods.php trunk/Payments.php trunk/includes/session.inc Added Paths: ----------- trunk/sql/mysql/updates/76.php Modified: trunk/PaymentMethods.php =================================================================== --- trunk/PaymentMethods.php 2011-03-27 19:54:41 UTC (rev 4959) +++ trunk/PaymentMethods.php 2011-03-27 20:50:24 UTC (rev 4960) @@ -72,7 +72,8 @@ $sql = "UPDATE paymentmethods SET paymentname='" . $_POST['MethodName'] . "', paymenttype = '" . $_POST['ForPayment'] . "', - receipttype = '" . $_POST['ForReceipt'] . "' + receipttype = '" . $_POST['ForReceipt'] . "', + forpreprint = '" . $_POST['ForPreprint']. "' WHERE paymentname LIKE '".$OldName."'"; /* lets leave well alone existing entries @@ -103,11 +104,13 @@ $sql = "INSERT INTO paymentmethods ( paymentname, paymenttype, - receipttype) + receipttype, + forpreprint) VALUES ( '" . $_POST['MethodName'] ."', '" . $_POST['ForPayment'] ."', '" . $_POST['ForReceipt'] ."' + '" . $_POST['ForPreprint'] ."' )"; } $msg = _('Record inserted'); @@ -124,6 +127,7 @@ unset ($_POST['MethodName']); unset ($_POST['ForPayment']); unset ($_POST['ForReceipt']); + unset ($_POST['ForPreprint']); } elseif (isset($_GET['delete'])) { //the link to delete a selected record was clicked instead of the submit button @@ -174,7 +178,8 @@ $sql = "SELECT paymentid, paymentname, paymenttype, - receipttype + receipttype, + forpreprint FROM paymentmethods ORDER BY paymentid"; @@ -186,6 +191,7 @@ <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 @@ -202,6 +208,7 @@ echo '<td>' . $myrow['paymentname'] . '</td>'; echo '<td>' . ($myrow['paymenttype'] ? _('Yes') : _('No')) . '</td>'; echo '<td>' . ($myrow['receipttype'] ? _('Yes') : _('No')) . '</td>'; + echo '<td>' . ($myrow['forpreprint'] ? _('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 '</tr>'; @@ -228,7 +235,8 @@ $sql = "SELECT paymentid, paymentname, paymenttype, - receipttype + receipttype, + forpreprint FROM paymentmethods WHERE paymentid='" . $SelectedPaymentID . "'"; @@ -243,6 +251,7 @@ $_POST['MethodName'] = $myrow['paymentname']; $_POST['ForPayment'] = $myrow['paymenttype']; $_POST['ForReceipt'] = $myrow['receipttype']; + $_POST['ForPreprint'] = $myrow['forpreprint']; echo "<input type=hidden name='SelectedPaymentID' VALUE='" . $_POST['MethodID'] . "'>"; echo "<table class=selection>"; @@ -252,6 +261,7 @@ $_POST['MethodName']=''; $_POST['ForPayment'] = 1; // Default is use for payment $_POST['ForReceipt'] = 1; // Default is use for receipts + $_POST['ForPreprint'] = 0; // Default is use for receipts echo "<table class=selection>"; } echo "<tr> @@ -270,6 +280,12 @@ echo "<option".($_POST['ForReceipt'] ? ' selected' : '') ." VALUE='1'>" . _('Yes'); echo "<option".($_POST['ForReceipt'] ? '' : ' selected') ." VALUE='0'>" . _('No'); echo "</select></td></tr>"; + echo "<tr> + <td>" . _('Use Pre-printed Stationery') . ':' . "</td> + <td><select name='ForPreprint'>"; + echo "<option".($_POST['ForPreprint'] ? ' selected' : '') ." VALUE='1'>" . _('Yes'); + echo "<option".($_POST['ForPreprint'] ? '' : ' selected') ." VALUE='0'>" . _('No'); + echo "</select></td></tr>"; echo '</table>'; Modified: trunk/Payments.php =================================================================== --- trunk/Payments.php 2011-03-27 19:54:41 UTC (rev 4959) +++ trunk/Payments.php 2011-03-27 20:50:24 UTC (rev 4960) @@ -247,11 +247,16 @@ $PeriodNo = GetPeriod($_SESSION['PaymentDetail']->DatePaid,$db); + $sql="SELECT forpreprint + 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>'; Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2011-03-27 19:54:41 UTC (rev 4959) +++ trunk/includes/session.inc 2011-03-27 20:50:24 UTC (rev 4960) @@ -13,7 +13,7 @@ header('Location:' . $rootpath . '/install/index.php'); } include($PathPrefix . 'config.php'); -$DBVersion=75; +$DBVersion=76; if (isset($SessionSavePath)){ session_save_path($SessionSavePath); } Added: trunk/sql/mysql/updates/76.php =================================================================== --- trunk/sql/mysql/updates/76.php (rev 0) +++ trunk/sql/mysql/updates/76.php 2011-03-27 20:50:24 UTC (rev 4960) @@ -0,0 +1,7 @@ +<?php + +AddColumn('forpreprint', 'paymentmethods', 'tinyint(1)', 'NOT NULL', '0', 'receipttype', $db); + +UpdateDBNo(76, $db); + +?> \ 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: <tim...@us...> - 2011-03-28 13:50:37
|
Revision: 4966 http://weberp.svn.sourceforge.net/weberp/?rev=4966&view=rev Author: tim_schofield Date: 2011-03-28 13:50:30 +0000 (Mon, 28 Mar 2011) Log Message: ----------- Add an extra report for stock transactions over a period rather than just one day Modified Paths: -------------- trunk/index.php Added Paths: ----------- trunk/PDFPeriodStockTransListing.php trunk/includes/PDFPeriodStockTransListingPageHeader.inc Added: trunk/PDFPeriodStockTransListing.php =================================================================== --- trunk/PDFPeriodStockTransListing.php (rev 0) +++ trunk/PDFPeriodStockTransListing.php 2011-03-28 13:50:30 UTC (rev 4966) @@ -0,0 +1,192 @@ +<?php + +/* $Id$*/ + +/* $Revision: 1.13 $ */ + +$PageSecurity = 3; +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>'; + 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>'; + + $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'); + 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']; + } else { + echo "<option VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + } + } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ + echo "<option selected VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + $_POST['StockLocation']=$myrow['loccode']; + } else { + echo "<option VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + } + } + 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 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['FromDate'] . ' ' . $_POST['ToDate']); +$line_height=12; +$PageNumber = 1; + +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; + +/* 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 Added: trunk/includes/PDFPeriodStockTransListingPageHeader.inc =================================================================== --- trunk/includes/PDFPeriodStockTransListingPageHeader.inc (rev 0) +++ trunk/includes/PDFPeriodStockTransListingPageHeader.inc 2011-03-28 13:50:30 UTC (rev 4966) @@ -0,0 +1,79 @@ +<?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 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 Modified: trunk/index.php =================================================================== --- trunk/index.php 2011-03-28 13:33:06 UTC (rev 4965) +++ trunk/index.php 2011-03-28 13:50:30 UTC (rev 4966) @@ -720,6 +720,11 @@ </tr> <tr> <td class="menu_group_item"> + <?php echo '<p>• <a href="' . $rootpath . '/PDFPeriodStockTransListing.php?">' . _('Period Stock Transaction Listing') . '</a></p>'; ?> + </td> + </tr> + <tr> + <td class="menu_group_item"> <?php echo '<p>• <a href="' . $rootpath . '/PDFStockTransfer.php">' . _('Stock Transfer Note') . '</a></p>'; ?> </td> </tr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-03-28 15:43:08
|
Revision: 4968 http://weberp.svn.sourceforge.net/weberp/?rev=4968&view=rev Author: tim_schofield Date: 2011-03-28 15:43:02 +0000 (Mon, 28 Mar 2011) Log Message: ----------- Remove redundant report Removed Paths: ------------- trunk/PDFStockTransListing.php trunk/includes/PDFStockTransListingPageHeader.inc Deleted: trunk/PDFStockTransListing.php =================================================================== --- trunk/PDFStockTransListing.php 2011-03-28 15:42:42 UTC (rev 4967) +++ trunk/PDFStockTransListing.php 2011-03-28 15:43:02 UTC (rev 4968) @@ -1,188 +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>'; - - $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'); - 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']; - } else { - echo "<option VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname']; - } - } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ - echo "<option selected VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname']; - $_POST['StockLocation']=$myrow['loccode']; - } else { - echo "<option VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname']; - } - } - 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['Date'])."'"; -} 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['Date'])."' - 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 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 Deleted: trunk/includes/PDFStockTransListingPageHeader.inc =================================================================== --- trunk/includes/PDFStockTransListingPageHeader.inc 2011-03-28 15:42:42 UTC (rev 4967) +++ trunk/includes/PDFStockTransListingPageHeader.inc 2011-03-28 15:43:02 UTC (rev 4968) @@ -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 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-03-28 15:59:57
|
Revision: 4970 http://weberp.svn.sourceforge.net/weberp/?rev=4970&view=rev Author: tim_schofield Date: 2011-03-28 15:59:49 +0000 (Mon, 28 Mar 2011) Log Message: ----------- Improvements to the period stock transactions listing report Modified Paths: -------------- trunk/PDFPeriodStockTransListing.php trunk/includes/PDFPeriodStockTransListingPageHeader.inc Modified: trunk/PDFPeriodStockTransListing.php =================================================================== --- trunk/PDFPeriodStockTransListing.php 2011-03-28 15:46:38 UTC (rev 4969) +++ trunk/PDFPeriodStockTransListing.php 2011-03-28 15:59:49 UTC (rev 4970) @@ -136,7 +136,8 @@ $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'); + 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; } Modified: trunk/includes/PDFPeriodStockTransListingPageHeader.inc =================================================================== --- trunk/includes/PDFPeriodStockTransListingPageHeader.inc 2011-03-28 15:46:38 UTC (rev 4969) +++ trunk/includes/PDFPeriodStockTransListingPageHeader.inc 2011-03-28 15:59:49 UTC (rev 4970) @@ -38,7 +38,8 @@ $YPos += 30; $pdf->addText($XPos, $YPos,$FontSize, $_SESSION['CompanyRecord']['coyname']); $FontSize=12; -$pdf->addText($XPos, $YPos-20,$FontSize, $TransType . ' ' ._('dated from') . ' ' . $_POST['FromDate'] . ' ' . _('to') . ' ' . $_POST['ToDate']); +$YPos -=30; +$pdf->addText($XPos, $YPos,$FontSize, $TransType . ' ' ._('dated from') . ' ' . $_POST['FromDate'] . ' ' . _('to') . ' ' . $_POST['ToDate']); $XPos = $Page_Width-$Right_Margin-50; $YPos -=30; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-03-28 19:37:09
|
Revision: 4975 http://weberp.svn.sourceforge.net/weberp/?rev=4975&view=rev Author: tim_schofield Date: 2011-03-28 19:37:03 +0000 (Mon, 28 Mar 2011) Log Message: ----------- Include the purchase order number in the GRN table Modified Paths: -------------- trunk/GoodsReceived.php trunk/includes/session.inc Added Paths: ----------- trunk/sql/mysql/updates/77.php Modified: trunk/GoodsReceived.php =================================================================== --- trunk/GoodsReceived.php 2011-03-28 19:02:47 UTC (rev 4974) +++ trunk/GoodsReceived.php 2011-03-28 19:37:03 UTC (rev 4975) @@ -418,6 +418,7 @@ /*Need to insert a GRN item */ $SQL = "INSERT INTO grns (grnbatch, + orderno, podetailitem, itemcode, itemdescription, @@ -426,6 +427,7 @@ supplierid, stdcostunit) VALUES ('" . $GRN . "', + '" . $_SESSION['PO']->OrderNo . "', '" . $OrderLine->PODetailRec . "', '" . $OrderLine->StockID . "', '" . $OrderLine->ItemDescription . "', Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2011-03-28 19:02:47 UTC (rev 4974) +++ trunk/includes/session.inc 2011-03-28 19:37:03 UTC (rev 4975) @@ -13,7 +13,7 @@ header('Location:' . $rootpath . '/install/index.php'); } include($PathPrefix . 'config.php'); -$DBVersion=76; +$DBVersion=77; if (isset($SessionSavePath)){ session_save_path($SessionSavePath); } Added: trunk/sql/mysql/updates/77.php =================================================================== --- trunk/sql/mysql/updates/77.php (rev 0) +++ trunk/sql/mysql/updates/77.php 2011-03-28 19:37:03 UTC (rev 4975) @@ -0,0 +1,7 @@ +<?php + +AddColumn('orderno', 'grns', 'int(11)', 'NOT NULL', '0', 'grnno', $db); + +UpdateDBNo(77, $db); + +?> \ 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: <tim...@us...> - 2011-03-29 15:30:12
|
Revision: 4978 http://weberp.svn.sourceforge.net/weberp/?rev=4978&view=rev Author: tim_schofield Date: 2011-03-29 15:30:06 +0000 (Tue, 29 Mar 2011) Log Message: ----------- Add in Purchase order number field to the grn Modified Paths: -------------- trunk/includes/session.inc trunk/index.php Added Paths: ----------- trunk/sql/mysql/updates/78.php Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2011-03-29 15:29:47 UTC (rev 4977) +++ trunk/includes/session.inc 2011-03-29 15:30:06 UTC (rev 4978) @@ -13,7 +13,7 @@ header('Location:' . $rootpath . '/install/index.php'); } include($PathPrefix . 'config.php'); -$DBVersion=77; +$DBVersion=78; if (isset($SessionSavePath)){ session_save_path($SessionSavePath); } Modified: trunk/index.php =================================================================== --- trunk/index.php 2011-03-29 15:29:47 UTC (rev 4977) +++ trunk/index.php 2011-03-29 15:30:06 UTC (rev 4978) @@ -634,6 +634,11 @@ </tr> <tr> <td class="menu_group_item"> + <?php echo '<p>• <a href="' . $rootpath . '/ReprintGRN.php?' . sid . '">' . _('Reprint GRN') . '</a></p>'; ?> + </td> + </tr> + <tr> + <td class="menu_group_item"> <?php echo '<p>• <a href="' . $rootpath . "/StockMovements.php?" . sid . '">' . _('Inventory Item Movements') . '</a></p>'; ?> </td> </tr> Added: trunk/sql/mysql/updates/78.php =================================================================== --- trunk/sql/mysql/updates/78.php (rev 0) +++ trunk/sql/mysql/updates/78.php 2011-03-29 15:30:06 UTC (rev 4978) @@ -0,0 +1,11 @@ +<?php + +/* Include the new script for printing quotations in Portrait + */ + +InsertRecord('pagesecurity', array('script', 'security'), array('PDFPeriodStockTransListing.php',3), array('script', 'security'), array('PDFPeriodStockTransListing.php',3), $db); +InsertRecord('pagesecurity', array('script', 'security'), array('ReprintGRN.php',11), array('script', 'security'), array('ReprintGRN.php',11), $db); + +UpdateDBNo(78, $db); + +?> \ 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: <tim...@us...> - 2011-03-29 16:16:45
|
Revision: 4979 http://weberp.svn.sourceforge.net/weberp/?rev=4979&view=rev Author: tim_schofield Date: 2011-03-29 16:16:39 +0000 (Tue, 29 Mar 2011) Log Message: ----------- Change field name nw to the more meaningful netweight Modified Paths: -------------- trunk/PO_Items.php trunk/includes/DefinePOClass.php trunk/includes/PO_ReadInOrder.inc trunk/includes/session.inc Added Paths: ----------- trunk/sql/mysql/updates/79.php Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2011-03-29 15:30:06 UTC (rev 4978) +++ trunk/PO_Items.php 2011-03-29 16:16:39 UTC (rev 4979) @@ -63,7 +63,7 @@ $_POST['ConversionFactor'] = $myrow['conversionfactor']; $_POST['Package'] = $myrow['pkg_type']; $_POST['uom'] = $myrow['suppliersuom']; - $_POST['nw'] = $myrow['netweight']; + $_POST['NetWeight'] = $myrow['netweight']; $_POST['gw'] = $myrow['kgs']; $_POST['CuFt'] = $myrow['volume']; $_POST['MinimumOrderQty'] = $myrow['minorderqty']; @@ -74,7 +74,7 @@ if ($POLine->Deleted==False) { $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->Quantity=$_POST['Qty'.$POLine->LineNo]; $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->Price=$_POST['Price'.$POLine->LineNo]; - $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->nw=$_POST['nw'.$POLine->LineNo]; + $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->NetWeight=$_POST['NetWeight'.$POLine->LineNo]; $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ReqDelDate=$_POST['ReqDelDate'.$POLine->LineNo]; } } @@ -197,7 +197,7 @@ subtotal_amount, package, pcunit, - nw, + netweight, gw, cuft, total_quantity, @@ -220,7 +220,7 @@ '" . $POLine->SubTotal_Amount . "', '" . $POLine->Package . "', '" . $POLine->PcUnit . "', - '" . $POLine->nw . "', + '" . $POLine->NetWeight . "', '" . $POLine->gw . "', '" . $POLine->CuFt . "', '" . $POLine->Total_Quantity . "', @@ -301,7 +301,7 @@ subtotal_amount, package, pcunit, - nw, + netweight, gw, cuft, total_quantity, @@ -324,7 +324,7 @@ '" . $POLine->SubTotal_Amount . "', '" . $POLine->Package . "', '" . $POLine->PcUnit . "', - '" . $POLine->nw . "', + '" . $POLine->NetWeight . "', '" . $POLine->gw . "', '" . $POLine->CuFt . "', '" . $POLine->Total_Quantity . "', @@ -348,7 +348,7 @@ subtotal_amount='" . $POLine->SubTotal_Amount . "', package='" . $POLine->Package . "', pcunit='" . $POLine->PcUnit . "', - nw='" . $POLine->nw . "', + netweight='" . $POLine->NetWeight . "', gw='" . $POLine->gw . "', cuft='" . $POLine->CuFt . "', total_quantity='" . $POLine->Total_Quantity . "', @@ -372,7 +372,7 @@ subtotal_amount='" . $POLine->SubTotal_Amount . "', package='" . $POLine->Package . "', pcunit='" . $POLine->PcUnit . "', - nw='" . $POLine->nw . "', + netweight='" . $POLine->NetWeight . "', gw='" . $POLine->gw . "', cuft='" . $POLine->CuFt . "', total_quantity='" . $POLine->Total_Quantity . "', @@ -608,7 +608,7 @@ $_POST['Qty']*$_POST['Price'], $_POST['Package'], $_POST['PcUnit'], - $_POST['nw'], + $_POST['NetWeight'], $_POST['gw'], $_POST['CuFt'], $_POST['Qty'], @@ -724,7 +724,7 @@ $_POST['SubTotal_Amount'], $_POST['Package'], $_POST['PcUnit'], - $_POST['nw'], + $_POST['NetWeight'], $_POST['gw'], $_POST['CuFt'], $_POST['Total_Quantity'], @@ -970,7 +970,7 @@ <td>' . $POLine->ItemDescription . '</td> <td><input type="text" class="number" name="Qty' . $POLine->LineNo .'" size="11" value="' . $DisplayQuantity . '"></td> <td>' . $Uom . '</td> - <td><input type="text" class="number" name="nw' . $POLine->LineNo . '" size="11" value="' . $POLine->nw . '"></td> + <td><input type="text" class="number" name="NetWeight' . $POLine->LineNo . '" size="11" value="' . $POLine->NetWeight . '"></td> <td><input type="text" class="number" name="Price' . $POLine->LineNo . '" size="11" value="' .$DisplayPrice.'"></td> <td class="number">' . $DisplayLineTotal . '</td> <td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'].'" name="ReqDelDate' . $POLine->LineNo.'" size="11" value="' .$POLine->ReqDelDate .'"></td> Modified: trunk/includes/DefinePOClass.php =================================================================== --- trunk/includes/DefinePOClass.php 2011-03-29 15:30:06 UTC (rev 4978) +++ trunk/includes/DefinePOClass.php 2011-03-29 16:16:39 UTC (rev 4979) @@ -89,7 +89,7 @@ $SubTotal_Amount=0, $Package=0, $PcUnit=0, - $nw=0, + $NetWeight=0, $gw=0, $CuFt=0, $Total_Quantity=0, @@ -123,7 +123,7 @@ $SubTotal_Amount, $Package, $PcUnit, - $nw, + $NetWeight, $gw, $CuFt, $Total_Quantity, @@ -151,7 +151,7 @@ $SubTotal_Amount, $Package, $PcUnit, - $nw, + $NetWeight, $gw, $CuFt, $Total_Quantity, @@ -172,7 +172,7 @@ $this->LineItems[$LineNo]->Subtotal_Amount = $SubTotal_Amount; $this->LineItems[$LineNo]->Package = $Package; $this->LineItems[$LineNo]->PcUnit = $PcUnit; - $this->LineItems[$LineNo]->nw = $nw; + $this->LineItems[$LineNo]->NetWeight = $NetWeight; $this->LineItems[$LineNo]->gw = $gw; $this->LineItems[$LineNo]->CuFt = $CuFt; $this->LineItems[$LineNo]->Total_Quantity = $Total_Quantity; @@ -242,7 +242,7 @@ Var $LeadTime; Var $Package; Var $PcUnit; - Var $nw; + Var $NetWeight; Var $gw; Var $CuFt; Var $Total_Quantity; @@ -279,7 +279,7 @@ $LeadTime, $Package, $PcUnit, - $nw, + $NetWeight, $gw, $CuFt, $Total_Quantity, @@ -308,7 +308,7 @@ $this->Subtotal_Amount = $SubTotal_Amount; $this->LeadTime = $LeadTime; $this->PcUnit = $PcUnit; - $this->nw = $nw; + $this->NetWeight = $NetWeight; $this->gw = $gw; $this->CuFt = $CuFt; $this->Total_Quantity = $Total_Quantity; Modified: trunk/includes/PO_ReadInOrder.inc =================================================================== --- trunk/includes/PO_ReadInOrder.inc 2011-03-29 15:30:06 UTC (rev 4978) +++ trunk/includes/PO_ReadInOrder.inc 2011-03-29 16:16:39 UTC (rev 4979) @@ -147,7 +147,7 @@ subtotal_amount, package, pcunit, - nw, + netweight, gw, cuft, total_quantity, @@ -239,7 +239,7 @@ 0, $myrow['package'], $myrow['pcunit'], - $myrow['nw'], + $myrow['netweight'], $myrow['gw'], $myrow['cuft'], $myrow['total_quantity'], Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2011-03-29 15:30:06 UTC (rev 4978) +++ trunk/includes/session.inc 2011-03-29 16:16:39 UTC (rev 4979) @@ -13,7 +13,7 @@ header('Location:' . $rootpath . '/install/index.php'); } include($PathPrefix . 'config.php'); -$DBVersion=78; +$DBVersion=79; if (isset($SessionSavePath)){ session_save_path($SessionSavePath); } Added: trunk/sql/mysql/updates/79.php =================================================================== --- trunk/sql/mysql/updates/79.php (rev 0) +++ trunk/sql/mysql/updates/79.php 2011-03-29 16:16:39 UTC (rev 4979) @@ -0,0 +1,8 @@ +<?php + + +ChangeColumnName('nw', 'purchorderdetails', 'varchar(50)', 'NOT NULL', '0', 'netweight', $db); + +UpdateDBNo(79, $db); + +?> \ 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: <tim...@us...> - 2011-03-31 13:48:58
|
Revision: 5001 http://weberp.svn.sourceforge.net/weberp/?rev=5001&view=rev Author: tim_schofield Date: 2011-03-31 13:48:52 +0000 (Thu, 31 Mar 2011) Log Message: ----------- Show error messages if the update failed Modified Paths: -------------- trunk/PricesByCost.php trunk/build/syntax_check.sh Modified: trunk/PricesByCost.php =================================================================== --- trunk/PricesByCost.php 2011-03-31 13:27:33 UTC (rev 5000) +++ trunk/PricesByCost.php 2011-03-31 13:48:52 UTC (rev 5001) @@ -47,7 +47,6 @@ if ($_POST['submit'] == 'Update') { //Update Prices $PriceCounter =0; - echo $_POST['Counter'].'x'; while ($PriceCounter < $_POST['Counter']) { if (!isset($_POST['DebtorNo_' . $PriceCounter])) { $_POST['DebtorNo_' . $PriceCounter]=''; @@ -75,7 +74,11 @@ AND prices.conversionfactor ='" . $_POST['ConversionFactor_' . $PriceCounter] . "' AND prices.startdate<='" . date('Y-m-d') . "'"; $ResultUpdate = DB_query($SQLUpdate, $db); - prnMsg( _('The price for') . ' ' . $_POST['StockID_' . $PriceCounter] . ' ' . _('has been updated in the database'), 'success'); + if (DB_error_no($db)==0) { + prnMsg( _('The price for') . ' ' . $_POST['StockID_' . $PriceCounter] . ' ' . _('has been updated in the database'), 'success'); + } else { + prnMsg( _('The price for') . ' ' . $_POST['StockID_' . $PriceCounter] . ' ' . _('could not be updated'), 'error'); + } echo '<br />'; } else { //we need to add a new price from today @@ -103,7 +106,11 @@ '" . $_POST['ConversionFactor_' . $PriceCounter] . "' )"; $ResultInsert = DB_query($SQLInsert, $db); - prnMsg( _('The price for') . ' ' . $_POST['StockID_' . $PriceCounter] . ' ' . _('has been inserted in the database'), 'success'); + if (DB_error_no($db)==0) { + prnMsg( _('The price for') . ' ' . $_POST['StockID_' . $PriceCounter] . ' ' . _('has been inserted in the database'), 'success'); + } else { + prnMsg( _('The price for') . ' ' . $_POST['StockID_' . $PriceCounter] . ' ' . _('could not be inserted'), 'error'); + } echo '<br />'; } $PriceCounter++; Modified: trunk/build/syntax_check.sh =================================================================== --- trunk/build/syntax_check.sh 2011-03-31 13:27:33 UTC (rev 5000) +++ trunk/build/syntax_check.sh 2011-03-31 13:48:52 UTC (rev 5001) @@ -1,6 +1,6 @@ #!/bin/bash -ROOT_DIR=~/workbench/weberp-bzr/web-erp/trunk +ROOT_DIR=$PWD cd $ROOT_DIR for f in `find . -name "*.php"` do This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-04-02 19:12:18
|
Revision: 5049 http://weberp.svn.sourceforge.net/weberp/?rev=5049&view=rev Author: tim_schofield Date: 2011-04-02 19:12:12 +0000 (Sat, 02 Apr 2011) Log Message: ----------- sql quoting changes Modified Paths: -------------- trunk/locale/zh_CN.utf8/Manual/ManualAPIFunctions.php trunk/sql/mysql/weberp-demo.sql trunk/sql/mysql/weberp-new.sql Modified: trunk/locale/zh_CN.utf8/Manual/ManualAPIFunctions.php =================================================================== --- trunk/locale/zh_CN.utf8/Manual/ManualAPIFunctions.php 2011-04-02 19:01:10 UTC (rev 5048) +++ trunk/locale/zh_CN.utf8/Manual/ManualAPIFunctions.php 2011-04-02 19:12:12 UTC (rev 5049) @@ -19,7 +19,7 @@ echo '<body>'; $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/sql/mysql/weberp-demo.sql =================================================================== --- trunk/sql/mysql/weberp-demo.sql 2011-04-02 19:01:10 UTC (rev 5048) +++ trunk/sql/mysql/weberp-demo.sql 2011-04-02 19:12:12 UTC (rev 5049) @@ -111,16 +111,6 @@ /*!40101 SET character_set_client = @saved_cs_client */; -- --- Dumping data for table `audittrail` --- - -LOCK TABLES `audittrail` WRITE; -/*!40000 ALTER TABLE `audittrail` DISABLE KEYS */; -INSERT INTO `audittrail` VALUES ('2011-01-20 16:58:26','admin','UPDATE currencies SET\n rate=\'0.6210704557167\'\n WHERE currabrev=\'GBP\''),('2011-01-20 16:58:26','admin','UPDATE currencies SET\n rate=\'0.7362143856291\'\n WHERE currabrev=\'EUR\''),('2011-01-20 16:58:26','admin','UPDATE currencies SET\n rate=\'0.94772877862033\'\n WHERE currabrev=\'CHF\''),('2011-01-20 16:58:26','admin','UPDATE currencies SET\n rate=\'0.99182802031952\'\n WHERE currabrev=\'USD\''),('2011-01-20 16:58:26','admin','UPDATE config SET confvalue = \'2011-01-20\' WHERE confname=\'UpdateCurrencyRatesDaily\''),('2011-01-20 17:01:26','admin','UPDATE config SET confvalue=\'61\' WHERE confname=\'DBUpdateNumber\''),('2011-01-20 17:03:40','admin','UPDATE config SET confvalue=\'61\' WHERE confname=\'DBUpdateNumber\''),('2011-01-20 17:06:02','admin','UPDATE config SET confvalue = \'4.0\' WHERE confname=\'VersionNumber\''),('2011-01-20 17:06:02','admin','UPDATE config SET confvalue=\'61\' WHERE confname=\'DBUpdateNumber\''); -/*!40000 ALTER TABLE `audittrail` ENABLE KEYS */; -UNLOCK TABLES; - --- -- Table structure for table `bankaccounts` -- Modified: trunk/sql/mysql/weberp-new.sql =================================================================== --- trunk/sql/mysql/weberp-new.sql 2011-04-02 19:01:10 UTC (rev 5048) +++ trunk/sql/mysql/weberp-new.sql 2011-04-02 19:12:12 UTC (rev 5049) @@ -110,16 +110,6 @@ /*!40101 SET character_set_client = @saved_cs_client */; -- --- Dumping data for table `audittrail` --- - -LOCK TABLES `audittrail` WRITE; -/*!40000 ALTER TABLE `audittrail` DISABLE KEYS */; -INSERT INTO `audittrail` VALUES ('2011-01-20 17:11:08','admin','UPDATE config SET confvalue = \'4.0\' WHERE confname=\'VersionNumber\''),('2011-01-20 17:11:08','admin','UPDATE config SET confvalue=\'61\' WHERE confname=\'DBUpdateNumber\''); -/*!40000 ALTER TABLE `audittrail` ENABLE KEYS */; -UNLOCK TABLES; - --- -- Table structure for table `bankaccounts` -- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-04-04 18:09:07
|
Revision: 5076 http://weberp.svn.sourceforge.net/weberp/?rev=5076&view=rev Author: tim_schofield Date: 2011-04-04 18:09:01 +0000 (Mon, 04 Apr 2011) Log Message: ----------- Correct quoting for html entities Modified Paths: -------------- trunk/CustomerAllocations.php trunk/Tax.php Modified: trunk/CustomerAllocations.php =================================================================== --- trunk/CustomerAllocations.php 2011-04-04 16:00:53 UTC (rev 5075) +++ trunk/CustomerAllocations.php 2011-04-04 18:09:01 UTC (rev 5076) @@ -337,9 +337,9 @@ if (isset($_POST['AllocTrans'])) { // Page called with trans number - echo "<form action='" . $_SERVER['PHP_SELF'] . '?' . SID . "' method=post>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" 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 @@ -391,26 +391,26 @@ $balance+=$YetToAlloc; 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>'; if (ABS($AllocnItem->AllocAmt-$YetToAlloc) < 0.01) { - echo ' value=' . True . '>'; + echo '<input tabindex="'.$j.'" type="checkbox" name="All"' . $Counter . '" value=' . True . '>'; } else { - echo '>'; + echo '<input tabindex="'.$j.'" type="checkbox" name="All"' . $Counter . '">'; } $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> + 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> Modified: trunk/Tax.php =================================================================== --- trunk/Tax.php 2011-04-04 16:00:53 UTC (rev 5075) +++ trunk/Tax.php 2011-04-04 18:09:01 UTC (rev 5076) @@ -283,7 +283,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,7 +298,7 @@ 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> @@ -318,8 +318,8 @@ '</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); @@ -341,17 +341,17 @@ 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 */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-04-05 18:46:40
|
Revision: 5094 http://weberp.svn.sourceforge.net/weberp/?rev=5094&view=rev Author: tim_schofield Date: 2011-04-05 18:46:34 +0000 (Tue, 05 Apr 2011) Log Message: ----------- Phil: SQL fixing quotes - not many, fixing gettext a few strings Modified Paths: -------------- trunk/PurchData.php trunk/StockReorderLevel.php Modified: trunk/PurchData.php =================================================================== --- trunk/PurchData.php 2011-04-05 18:09:49 UTC (rev 5093) +++ trunk/PurchData.php 2011-04-05 18:46:34 UTC (rev 5094) @@ -348,7 +348,7 @@ echo '<tr class="OddTableRows">'; $k++; } - printf('<td><font size=1><input type=submit name='SupplierID' value='%s'</font></td> + 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> Modified: trunk/StockReorderLevel.php =================================================================== --- trunk/StockReorderLevel.php 2011-04-05 18:09:49 UTC (rev 5093) +++ trunk/StockReorderLevel.php 2011-04-05 18:46:34 UTC (rev 5094) @@ -2,8 +2,6 @@ /* $Id$*/ -//$PageSecurity = 4; - include('includes/session.inc'); $title = _('Stock Re-Order Level Maintenance'); include('includes/header.inc'); @@ -14,42 +12,45 @@ $StockID = trim(strtoupper($_POST['StockID'])); } -echo "<a href='" . $rootpath . '/SelectProduct.php?' . SID . "'>" . _('Back to Items') . '</a>'; +echo '<a href="' . $rootpath . '/SelectProduct.php">' . _('Back to Items') . '</a>'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . -'" alt="" /><b>' . $title. '</b></p>'; + '" alt="" /><b>' . $title. '</b></p>'; -$result = DB_query("SELECT description, units FROM stockmaster WHERE stockid='$StockID'", $db); +$result = DB_query("SELECT description, units FROM stockmaster WHERE stockid='" . $StockID . "'", $db); $myrow = DB_fetch_row($result); -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'] . '" />'; $sql = "SELECT locstock.loccode, - locations.locationname, - locstock.quantity, - locstock.reorderlevel - FROM locstock, - locations - WHERE locstock.loccode=locations.loccode - AND locstock.stockid = '" . $StockID . "' - ORDER BY locstock.loccode"; + locations.locationname, + locstock.quantity, + locstock.reorderlevel, + stockmaster.decimalplaces + FROM locstock + INNER JOIN locations + ON locstock.loccode=locations.loccode + INNER JOIN stockmaster + ON locstock.stockid=stockmaster.stockid + WHERE locstock.stockid = '" . $StockID . "' + ORDER BY locstock.loccode"; $ErrMsg = _('The stock held at each location cannot be retrieved because'); $DbgMsg = _('The SQL that failed was'); $LocStockResult = DB_query($sql, $db, $ErrMsg, $DbgMsg); -echo "<table cellpadding=2 class=selection>"; -echo '<tr><th colspan=3>'._('Stock Code') . ":<input type=TEXT name='StockID' size=21 VALUE='$StockID' maxlength=20>"; -echo " <input type=submit name='Show' VALUE='" . _('Show Re-Order Levels') . "'></th></tr>"; +echo '<table cellpadding=2 class=selection>'; +echo '<tr><th colspan=3>'._('Stock Code') . ':<input type=TEXT name="StockID" size=21 VALUE="' . $StockID . '" maxlength=20>'; +echo '<input type=submit name="Show" VALUE="' . _('Show Re-Order Levels') . '"></th></tr>'; echo '<tr><th colspan=3><font color=BLUE size=3><b>' . $StockID . ' - ' . $myrow[0] . '</b> (' . _('In Units of') . ' ' . $myrow[1] . ')</font></th></tr>'; -$TableHeader = "<tr> - <th>" . _('Location') . "</th> - <th>" . _('Quantity On Hand') . "</th> - <th>" . _('Re-Order Level') . "</th> - </tr>"; +$TableHeader = '<tr> + <th>' . _('Location') . '</th> + <th>' . _('Quantity On Hand') . '</th> + <th>' . _('Re-Order Level') . '</th> + </tr>'; echo $TableHeader; $j = 1; @@ -75,11 +76,11 @@ } - printf("<td>%s</td> + printf('<td>%s</td> <td class=number>%s</td> - <td><input type=text class='number' name=%s maxlength=10 size=10 VALUE=%s></td>", + <td><input type=text class="number" name=%s maxlength=10 size=10 VALUE=%s></td>', $myrow['locationname'], - number_format($myrow['quantity'],StockDecimalPlaces($StockID, $db)), + number_format($myrow['quantity'], $myrow['decimalplaces']), $myrow['loccode'], $myrow['reorderlevel']); $j++; @@ -91,11 +92,11 @@ } //end of while loop -echo "</table><br /><div class='centre'><input type=submit name='UpdateData' VALUE='" . _('Update') . "'><br /><br />"; -echo "<a href='$rootpath/StockMovements.php?" . SID . "&StockID=$StockID'>" . _('Show Stock Movements') . '</a>'; -echo "<br><a href='$rootpath/StockUsage.php?" . SID . "&StockID=$StockID'>" . _('Show Stock Usage') . '</a>'; -echo "<br><a href='$rootpath/SelectSalesOrder.php?" . SID . "&SelectedStockItem=$StockID'>" . _('Search Outstanding Sales Orders') . '</a>'; -echo "<br><a href='$rootpath/SelectCompletedOrder.php?" . SID . "&SelectedStockItem=$StockID'>" . _('Search Completed Sales Orders') . '</a>'; +echo '</table><br /><div class="centre"><input type=submit name="UpdateData" VALUE="' . _('Update') . '"><br /><br />'; +echo '<a href="' . $rootpath . '/StockMovements.php?' . SID . '&StockID=$StockID">' . _('Show Stock Movements') . '</a>'; +echo '<br /><a href="' . $rootpath . '/StockUsage.php?' . SID . '&StockID=$StockID">' . _('Show Stock Usage') . '</a>'; +echo '<br /><a href="' . $rootpath . '/SelectSalesOrder.php?' . SID . '&SelectedStockItem=$StockID">' . _('Search Outstanding Sales Orders') . '</a>'; +echo '<br /><a href="' . $rootpath . '/SelectCompletedOrder.php?' . SID . '&SelectedStockItem=$StockID">' . _('Search Completed Sales Orders') . '</a>'; echo '</div></form>'; include('includes/footer.inc'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-04-08 11:09:48
|
Revision: 5125 http://weberp.svn.sourceforge.net/weberp/?rev=5125&view=rev Author: tim_schofield Date: 2011-04-08 11:09:42 +0000 (Fri, 08 Apr 2011) Log Message: ----------- Phil: More SQL quoting and xhtml fixes Modified Paths: -------------- trunk/PO_AuthorisationLevels.php trunk/PO_Header.php Modified: trunk/PO_AuthorisationLevels.php =================================================================== --- trunk/PO_AuthorisationLevels.php 2011-04-08 11:07:13 UTC (rev 5124) +++ trunk/PO_AuthorisationLevels.php 2011-04-08 11:09:42 UTC (rev 5125) @@ -2,8 +2,6 @@ /* $Id$*/ -//$PageSecurity=15; - include('includes/session.inc'); $title = _('Purchase Order Authorisation Maintenance'); @@ -16,23 +14,23 @@ $OffHold=1; $AuthLevel=0; if (isset($_POST['Submit'])) { - if (isset($_POST['cancreate']) and $_POST['cancreate']=='on') { - $cancreate=0; + if (isset($_POST['CanCreate']) and $_POST['CanCreate']=='on') { + $CanCreate=0; } else { - $cancreate=1; + $CanCreate=1; } - if (isset($_POST['offhold']) and $_POST['offhold']=='on') { - $offhold=0; + if (isset($_POST['OffHold']) and $_POST['OffHold']=='on') { + $OffHold=0; } else { - $offhold=1; + $OffHold=1; } - if ($_POST['authlevel']=='') { - $_POST['authlevel']=0; + if ($_POST['AuthLevel']=='') { + $_POST['AuthLevel']=0; } $sql="SELECT COUNT(*) FROM purchorderauth - WHERE userid='".$_POST['userid']."' - AND currabrev='".$_POST['currabrev']."'"; + WHERE userid='".$_POST['UserID']."' + AND currabrev='".$_POST['CurrCode']."'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); if ($myrow[0]==0) { @@ -43,11 +41,11 @@ offhold, authlevel) VALUES( - '".$_POST['userid']."', - '".$_POST['currabrev']."', - '".$cancreate."', - '".$offhold."', - '".$_POST['authlevel']."')"; + '".$_POST['UserID']."', + '".$_POST['CurrCode']."', + '".$CanCreate."', + '".$OffHold."', + '".$_POST['AuthLevel']."')"; $ErrMsg = _('The authentication details cannot be inserted because'); $Result=DB_query($sql,$db,$ErrMsg); } else { @@ -57,22 +55,22 @@ } if (isset($_POST['Update'])) { - if (isset($_POST['cancreate']) and $_POST['cancreate']=='on') { - $cancreate=0; + if (isset($_POST['CanCreate']) and $_POST['CanCreate']=='on') { + $CanCreate=0; } else { - $cancreate=1; + $CanCreate=1; } - if (isset($_POST['offhold']) and $_POST['offhold']=='on') { - $offhold=0; + if (isset($_POST['OffHold']) and $_POST['OffHold']=='on') { + $OffHold=0; } else { - $offhold=1; + $OffHold=1; } $sql="UPDATE purchorderauth SET - cancreate='".$cancreate."', - offhold='".$offhold."', - authlevel='".$_POST['authlevel']."' - WHERE userid='".$_POST['userid']."' - AND currabrev='".$_POST['currabrev']."'"; + cancreate='".$CanCreate."', + offhold='".$OffHold."', + authlevel='".$_POST['AuthLevel']."' + WHERE userid='".$_POST['UserID']."' + AND currabrev='".$_POST['CurrCode']."'"; $ErrMsg = _('The authentication details cannot be updated because'); $Result=DB_query($sql,$db,$ErrMsg); @@ -129,38 +127,38 @@ while ($myrow=DB_fetch_array($Result)) { if ($myrow['cancreate']==0) { - $cancreate=_('Yes'); + $CanCreate=_('Yes'); } else { - $cancreate=_('No'); + $CanCreate=_('No'); } if ($myrow['offhold']==0) { - $offhold=_('Yes'); + $OffHold=_('Yes'); } else { - $offhold=_('No'); + $OffHold=_('No'); } echo '<tr><td>'.$myrow['userid'].'</td>'; echo '<td>'.$myrow['realname'].'</td>'; echo '<td>'.$myrow['currency'].'</td>'; - echo '<td>'.$cancreate.'</td>'; - echo '<td>'.$offhold.'</td>'; + echo '<td>'.$CanCreate.'</td>'; + echo '<td>'.$OffHold.'</td>'; echo '<td class="number">'.number_format($myrow['authlevel'],2).'</td>'; - echo '<td><a href="'.$rootpath.'/PO_AuthorisationLevels.php?' . SID . 'Edit=Yes&UserID=' . $myrow['userid'] . + echo '<td><a href="'.$rootpath.'/PO_AuthorisationLevels.php?Edit=Yes&UserID=' . $myrow['userid'] . '&Currency='.$myrow['currabrev'].'">'._('Edit').'</td>'; - echo '<td><a href="'.$rootpath.'/PO_AuthorisationLevels.php?' . SID . 'Delete=Yes&UserID=' . $myrow['userid'] . + echo '<td><a href="'.$rootpath.'/PO_AuthorisationLevels.php?Delete=Yes&UserID=' . $myrow['userid'] . '&Currency='.$myrow['currabrev'].'">'._('Delete').'</td></tr>'; } echo '</table><br><br>'; -echo "<form action='" . $_SERVER['PHP_SELF'] . '?' . SID . "' method=post name='form1'>"; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post" name="form1">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<table class=selection>'; +echo '<table class="selection">'; if (isset($_GET['Edit'])) { echo '<tr><td>'._('User ID').'</td><td>'.$UserID.'</td></tr>'; - echo '<input type=hidden name=userid value="'.$UserID.'"'; + echo '<input type="hidden" name="UserID" value="'.$UserID.'" />'; } else { - echo '<tr><td>'._('User ID').'</td><td><select name=userid>'; + echo '<tr><td>'._('User ID').'</td><td><select name="UserID">'; $usersql="SELECT userid FROM www_users"; $userresult=DB_query($usersql,$db); while ($myrow=DB_fetch_array($userresult)) { @@ -178,9 +176,9 @@ $currencyresult=DB_query($currencysql,$db); $myrow=DB_fetch_array($currencyresult); echo '<tr><td>'._('Currency').'</td><td>'.$myrow['currency'].'</td></tr>'; - echo '<input type=hidden name=currabrev value="'.$Currency.'"'; + echo '<input type="hidden" name="CurrCode" value="'.$Currency.'">'; } else { - echo '<tr><td>'._('Currency').'</td><td><select name=currabrev>'; + echo '<tr><td>'._('Currency').'</td><td><select name="CurrCode">'; $currencysql="SELECT currabrev,currency FROM currencies"; $currencyresult=DB_query($currencysql,$db); while ($myrow=DB_fetch_array($currencyresult)) { @@ -195,26 +193,26 @@ echo '<tr><td>'._('User can create orders').'</td>'; if ($CanCreate==1) { - echo '<td><input type=checkbox name=cancreate></td></tr>'; + echo '<td><input type="checkbox" name="CanCreate"></td></tr>'; } else { - echo '<td><input type=checkbox checked name=cancreate></td></tr>'; + echo '<td><input type="checkbox" checked name="CanCreate"></td></tr>'; } echo '<tr><td>'._('User can release invoices').'</td>'; if ($OffHold==1) { - echo '<td><input type=checkbox name=offhold></td></tr>'; + echo '<td><input type="checkbox" name="OffHold"></td></tr>'; } else { - echo '<td><input type=checkbox checked name=offhold></td></tr>'; + echo '<td><input type="checkbox" checked name="OffHold"></td></tr>'; } echo '<tr><td>'._('User can authorise orders up to :').'</td>'; -echo '<td><input type=input name=authlevel size=11 class=number value='.$AuthLevel.'></td</tr>'; +echo '<td><input type="input" name="AuthLevel" size="11" class="number" value="'.$AuthLevel.'" /></td></tr>'; echo '</table>'; if (isset($_GET['Edit'])) { - echo '<br><div class="centre"><input type=submit name="Update" value="'._('Update Information').'"></div></form>'; + echo '<br /><div class="centre"><input type="submit" name="Update" value="'._('Update Information').'"></div></form>'; } else { - echo '<br><div class="centre"><input type=submit name="Submit" value="'._('Enter Information').'"></div></form>'; + echo '<br /><div class="centre"><input type="submit" name="Submit" value="'._('Enter Information').'"></div></form>'; } include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/PO_Header.php =================================================================== --- trunk/PO_Header.php 2011-04-08 11:07:13 UTC (rev 5124) +++ trunk/PO_Header.php 2011-04-08 11:09:42 UTC (rev 5125) @@ -234,11 +234,11 @@ $_POST['RePrint'] = 0; } - echo "<meta http-equiv='Refresh' content='0; url=" . $rootpath . '/PO_Items.php?' . SID . 'identifier='.$identifier. "'>"; + echo '<meta http-equiv="Refresh" content="0; url="' . $rootpath . '/PO_Items.php?' . SID . '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') . ') ' . - "<a href='$rootpath/PO_Items.php?" . SID. 'identifier='.$identifier . "'>" . _('click here') . '</a> ' . _('to continue'),'info'); + '<a href="$rootpath/PO_Items.php?identifier='.$identifier . '">' . _('click here') . '</a> ' . _('to continue'),'info'); include('includes/footer.inc'); exit; } /* end of if isset _POST'EnterLines' */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-04-08 19:30:07
|
Revision: 5137 http://weberp.svn.sourceforge.net/weberp/?rev=5137&view=rev Author: tim_schofield Date: 2011-04-08 19:30:01 +0000 (Fri, 08 Apr 2011) Log Message: ----------- Phil: More SQL quoting and xhtml fixes Modified Paths: -------------- trunk/SelectCreditItems.php trunk/build/syntax_check.sh Modified: trunk/SelectCreditItems.php =================================================================== --- trunk/SelectCreditItems.php 2011-04-08 19:11:28 UTC (rev 5136) +++ trunk/SelectCreditItems.php 2011-04-08 19:30:01 UTC (rev 5137) @@ -5,8 +5,6 @@ /*The credit selection screen uses the Cart class used for the making up orders some of the variable names refer to order - please think credit when you read order */ -//$PageSecurity = 3; - include('includes/DefineCartClass.php'); include('includes/DefineSerialItems.php'); /* Session started in session.inc for password checking and authorisation level check */ @@ -81,7 +79,7 @@ custbranch.branchcode FROM custbranch WHERE custbranch.brname " . LIKE ." '".$SearchString."' - AND custbranch.disabletrans=0"; + AND custbranch.disabletrans='0'"; } elseif (strlen($_POST['CustCode'])>0){ @@ -94,7 +92,7 @@ custbranch.branchcode FROM custbranch WHERE custbranch.branchcode " . LIKE . " '%" . $_POST['CustCode'] . "%' - AND custbranch.disabletrans=0"; + AND custbranch.disabletrans='0'"; } $ErrMsg = _('Customer branch records requested cannot be retrieved because'); @@ -219,12 +217,12 @@ echo '<br /><table cellpadding=2 colspan=7 class=selection>'; $TableHeader = '<tr> - <th>' . _('Code') . '</th> - <th>' . _('Branch') . '</th> - <th>' . _('Contact') . '</th> - <th>' . _('Phone') . '</th> - <th>' . _('Fax') . '</th> - </tr>'; + <th>' . _('Code') . '</th> + <th>' . _('Branch') . '</th> + <th>' . _('Contact') . '</th> + <th>' . _('Phone') . '</th> + <th>' . _('Fax') . '</th> + </tr>'; echo $TableHeader; @@ -241,18 +239,18 @@ $k=1; } - printf("<td><font size=1><input type=submit name='Select' VALUE='%s - %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['debtorno'], - $myrow['branchcode'], - $myrow['brname'], - $myrow['contactname'], - $myrow['phoneno'], - $myrow['faxno']); + printf('<td><font size=1><input type=submit name="Select" VALUE="%s - %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['debtorno'], + $myrow['branchcode'], + $myrow['brname'], + $myrow['contactname'], + $myrow['phoneno'], + $myrow['faxno']); //end of page full new headings if } @@ -289,7 +287,7 @@ FROM stockmaster, stockcategory WHERE stockmaster.categoryid=stockcategory.categoryid AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.description " . LIKE . "'$SearchString' + AND stockmaster.description " . LIKE . "'" . $SearchString . "' GROUP BY stockmaster.stockid, stockmaster.description, stockmaster.units @@ -302,7 +300,7 @@ stockcategory WHERE stockmaster.categoryid=stockcategory.categoryid AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.description " . LIKE . "'$SearchString' + AND stockmaster.description " . LIKE . "'" . $SearchString . "' AND stockmaster.categoryid='" . $_POST['StockCat'] . "' GROUP BY stockmaster.stockid, stockmaster.description, @@ -387,7 +385,7 @@ /*Always do the stuff below if not looking for a customerid Set up the form for the credit note display and entry*/ - echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; + echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -452,8 +450,8 @@ $NewItemQty, $myrow['description'], GetPrice ($_POST['NewItem'], - $_SESSION['CreditItems']->DebtorNo, - $_SESSION['CreditItems']->Branch, $db), + $_SESSION['CreditItems']->DebtorNo, + $_SESSION['CreditItems']->Branch, $db), 0, $myrow['units'], $myrow['volume'], @@ -645,8 +643,7 @@ /* This is where the credit note as selected should be displayed reflecting any deletions or insertions*/ - echo ' - <table cellpadding=2 colspan=7 class=selection> + echo '<table cellpadding=2 colspan=7 class=selection> <tr> <th>' . _('Item Code') . '</th> <th>' . _('Item Description') . '</th> @@ -811,12 +808,12 @@ echo '<tr> - <td colspan=7 class=number>' . _('Credit Totals') . "</td> - <td class=number><b>$DisplayTotal</b></td> + <td colspan=7 class=number>' . _('Credit Totals') . '</td> + <td class=number><b>' . $DisplayTotal . '</b></td> <td colspan=2></td> - <td class=number><b>" . number_format($TaxTotal,2) . "</td> - <td class=number><b>" . number_format($TaxTotal+($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost),2) . "</b></td> - </tr></table>"; + <td class=number><b>' . number_format($TaxTotal,2) . '</td> + <td class=number><b>' . number_format($TaxTotal+($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost),2) . '</b></td> + </tr></table>'; /*Now show options for the credit note */ @@ -980,10 +977,10 @@ $k++; } - printf("<td><font size=1><input type=submit name='NewItem' VALUE='%s'></font></td> + printf('<td><font size=1><input type=submit name="NewItem" VALUE="%s"></font></td> <td><font size=1>%s</font></td> <td><font size=1>%s</font></td> - <td>%s</td></tr>", + <td>%s</td></tr>', $myrow['stockid'], $myrow['description'], $myrow['units'], @@ -1456,7 +1453,7 @@ /*end of its a return of stock */ } elseif ($_POST['CreditType']=='WriteOff'){ /*its a stock write off */ - if ($CreditLine->MBflag=="B" OR $CreditLine->MBflag=="M"){ + if ($CreditLine->MBflag=='B' OR $CreditLine->MBflag=='M'){ /* Insert stock movements for the item being written off - with unit cost */ $SQL = "INSERT INTO stockmoves ( @@ -1951,18 +1948,17 @@ } } /*end of if Sales and GL integrated */ - $SQL='COMMIT'; - $Result = DB_query($SQL,$db); + DB_Txn_Commit($db); unset($_SESSION['CreditItems']->LineItems); unset($_SESSION['CreditItems']); echo _('Credit Note number') . ' ' . $CreditNo . ' ' . _('processed') . '<br>'; - echo '<a target="_blank" href="' . $rootpath . '/PrintCustTrans.php?' . SID . '&FromTransNo=' . $CreditNo . '&InvOrCredit=Credit">' . _('Show this Credit Note on screen') . '</a><br>'; + echo '<a target="_blank" href="' . $rootpath . '/PrintCustTrans.php?FromTransNo=' . $CreditNo . '&InvOrCredit=Credit">' . _('Show this Credit Note on screen') . '</a><br>'; if ($_SESSION['InvoicePortraitFormat']==0){ - echo '<a href="' . $rootpath . '/PrintCustTrans.php?' . SID . '&FromTransNo=' . $CreditNo . '&InvOrCredit=Credit&PrintPDF=True">' . _('Print this Credit Note') . '</a>'; + echo '<a href="' . $rootpath . '/PrintCustTrans.php?FromTransNo=' . $CreditNo . '&InvOrCredit=Credit&PrintPDF=True">' . _('Print this Credit Note') . '</a>'; } else { - echo '<a href="' . $rootpath . '/PrintCustTransPortrait.php?' . SID . '&FromTransNo=' . $CreditNo . '&InvOrCredit=Credit&PrintPDF=True">' . _('Print this Credit Note') . '</a>'; + echo '<a href="' . $rootpath . '/PrintCustTransPortrait.php?FromTransNo=' . $CreditNo . '&InvOrCredit=Credit&PrintPDF=True">' . _('Print this Credit Note') . '</a>'; } echo '<p><a href="' . $rootpath . '/SelectCreditItems.php">' . _('Enter Another Credit Note') . '</a>'; Modified: trunk/build/syntax_check.sh =================================================================== --- trunk/build/syntax_check.sh 2011-04-08 19:11:28 UTC (rev 5136) +++ trunk/build/syntax_check.sh 2011-04-08 19:30:01 UTC (rev 5137) @@ -9,7 +9,7 @@ newname=`echo $f | cut -c3-` filename="$ROOT_DIR/$newname" - output=`php5 -l $filename 2>/dev/null` + output=`php5 -l $filename` if [ $? != 0 ] then echo $filename @@ -24,7 +24,7 @@ newname=`echo $f | cut -c3-` filename="$ROOT_DIR/$newname" - output=`php5 -l $filename 2>/dev/null` + output=`php5 -l $filename` if [ $? != 0 ] then echo $filename This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-04-08 19:49:20
|
Revision: 5139 http://weberp.svn.sourceforge.net/weberp/?rev=5139&view=rev Author: tim_schofield Date: 2011-04-08 19:49:14 +0000 (Fri, 08 Apr 2011) Log Message: ----------- Phil: More SQL quoting and xhtml fixes Modified Paths: -------------- trunk/SMTPServer.php trunk/Z_Upgrade_3.11-4.00.php Modified: trunk/SMTPServer.php =================================================================== --- trunk/SMTPServer.php 2011-04-08 19:31:29 UTC (rev 5138) +++ trunk/SMTPServer.php 2011-04-08 19:49:14 UTC (rev 5139) @@ -1,7 +1,5 @@ <?php -//$PageSecurity =15; - include('includes/session.inc'); $title = _('SMTP Server details'); @@ -25,17 +23,17 @@ } $sql="SELECT id, - host, - port, - heloaddress, - username, - password, - timeout, - auth - FROM emailsettings"; + host, + port, + heloaddress, + username, + password, + timeout, + auth + FROM emailsettings"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); -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 '<tr><td>'._('Server Host Name').'</td> Modified: trunk/Z_Upgrade_3.11-4.00.php =================================================================== --- trunk/Z_Upgrade_3.11-4.00.php 2011-04-08 19:31:29 UTC (rev 5138) +++ trunk/Z_Upgrade_3.11-4.00.php 2011-04-08 19:49:14 UTC (rev 5139) @@ -9,9 +9,9 @@ if (empty($_POST['DoUpgrade'])){ prnMsg(_('This script will run perform any modifications to the database since v 3.11 required to allow the additional functionality in version 4.00 scripts'),'info'); - echo "<p><form method='post' action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>"; + echo '<p><form method="post" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<div class="centre"?><input type=submit name=DoUpgrade VALUE="' . _('Perform Upgrade') . '"></div>'; + echo '<div class="centre"><input type=submit name=DoUpgrade VALUE="' . _('Perform Upgrade') . '"></div>'; echo '</form>'; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-04-08 20:15:42
|
Revision: 5141 http://weberp.svn.sourceforge.net/weberp/?rev=5141&view=rev Author: tim_schofield Date: 2011-04-08 20:15:36 +0000 (Fri, 08 Apr 2011) Log Message: ----------- Phil: More SQL quoting and xhtml fixes Modified Paths: -------------- trunk/SelectSalesOrder.php trunk/SelectWorkOrder.php Modified: trunk/SelectSalesOrder.php =================================================================== --- trunk/SelectSalesOrder.php 2011-04-08 20:14:05 UTC (rev 5140) +++ trunk/SelectSalesOrder.php 2011-04-08 20:15:36 UTC (rev 5141) @@ -14,9 +14,9 @@ for ($i=1;$i<count($_POST);$i++){ if (isset($_POST['PlacePO_' . $i])) { //checkboxes only set if they are checked if ($OrdersToPlacePOFor==''){ - $OrdersToPlacePOFor .= ' orderno=' . $_POST['OrderNo_PO_'.$i]; + $OrdersToPlacePOFor .= " orderno=" . $_POST['OrderNo_PO_'.$i]; } else { - $OrdersToPlacePOFor .= ' OR orderno=' . $_POST['OrderNo_PO_'.$i]; + $OrdersToPlacePOFor .= " OR orderno=" . $_POST['OrderNo_PO_'.$i]; } } } @@ -97,9 +97,9 @@ /* if an order is/has been created already and the supplier of this item has changed - so need to finish off the order */ //if the user has authority to authorise the PO then it should be created as authorised $AuthSQL ="SELECT authlevel - FROM purchorderauth - WHERE userid='".$_SESSION['UserID']."' - AND currabrev='".$SuppRow['currcode']."'"; + FROM purchorderauth + WHERE userid='".$_SESSION['UserID']."' + AND currabrev='".$SuppRow['currcode']."'"; $AuthResult=DB_query($AuthSQL,$db); $AuthRow=DB_fetch_array($AuthResult); @@ -280,9 +280,9 @@ $ErrMsg = _('Could not update purchase order status to Authorised'); $Debug = _('The SQL that failed was'); $result = DB_query("UPDATE purchorders SET allowprint=1, - status='Authorised', - stat_comment='" . $StatusComment . "' - WHERE orderno='" . $PO_OrderNo . "'", + status='Authorised', + stat_comment='" . $StatusComment . "' + WHERE orderno='" . $PO_OrderNo . "'", $db,$ErrMsg,$DbgMsg,true); } else { // no authority to authorise this order if (DB_num_rows($AuthResult) ==0){ Modified: trunk/SelectWorkOrder.php =================================================================== --- trunk/SelectWorkOrder.php 2011-04-08 20:14:05 UTC (rev 5140) +++ trunk/SelectWorkOrder.php 2011-04-08 20:15:36 UTC (rev 5141) @@ -9,21 +9,21 @@ include('includes/header.inc'); 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'] .'?' .SID . ' method=post>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($_POST['ResetPart'])){ - unset($_REQUEST['SelectedStockItem']); + unset($_REQUEST['SelectedStockItem']); } if (isset($_REQUEST['WO']) AND $_REQUEST['WO']!='') { $_REQUEST['WO'] = trim($_REQUEST['WO']); if (!is_numeric($_REQUEST['WO'])){ - prnMsg(_('The work order number entered MUST be numeric'),'warn'); - unset ($_REQUEST['WO']); - include('includes/footer.inc'); - exit; + prnMsg(_('The work order number entered MUST be numeric'),'warn'); + unset ($_REQUEST['WO']); + include('includes/footer.inc'); + exit; } else { echo _('Work Order Number') . ' - ' . $_REQUEST['WO']; } @@ -106,9 +106,9 @@ if (!isset($_REQUEST['WO']) or ($_REQUEST['WO']=='')){ echo '<table class=selection><tr><td>'; if (isset($_REQUEST['SelectedStockItem'])) { - echo _('For the item') . ': ' . $_REQUEST['SelectedStockItem'] . ' ' . _('and') . " <input type=hidden name='SelectedStockItem' value='" . $_REQUEST['SelectedStockItem'] . "'>"; + echo _('For the item') . ': ' . $_REQUEST['SelectedStockItem'] . ' ' . _('and') . ' <input type=hidden name="SelectedStockItem" value="' . $_REQUEST['SelectedStockItem'] . '">'; } - echo _('Work Order number') . ": <input type=text name='WO' MAXLENGTH =8 size=9>  " . _('Processing at') . ":<select name='StockLocation'> "; + echo _('Work Order number') . ': <input type=text name="WO" MAXLENGTH =8 size=9>  ' . _('Processing at') . ':<select name="StockLocation"> '; $sql = "SELECT loccode, locationname FROM locations"; @@ -117,14 +117,14 @@ while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_POST['StockLocation'])){ if ($myrow['loccode'] == $_POST['StockLocation']){ - 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>'; } } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ - 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>'; } } @@ -136,16 +136,16 @@ } if ($_POST['ClosedOrOpen']=='Closed_Only'){ - echo '<option selected value="Closed_Only">' . _('Closed Work Orders Only'); - echo '<option value="Open_Only">' . _('Open Work Orders Only'); + echo '<option selected value="Closed_Only">' . _('Closed Work Orders Only') . '</option>'; + echo '<option value="Open_Only">' . _('Open Work Orders Only') . '</option>'; } else { - echo '<option value="Closed_Only">' . _('Closed Work Orders Only'); - echo '<option selected value="Open_Only">' . _('Open Work Orders Only'); + echo '<option value="Closed_Only">' . _('Closed Work Orders Only') . '</option>'; + echo '<option selected value="Open_Only">' . _('Open Work Orders Only') . '</option>'; } echo '</select>   '; - echo "<input type=submit name='SearchOrders' value='" . _('Search') . "'>"; - echo ' <a href="' . $rootpath . '/WorkOrderEntry.php?' . SID . '">' . _('New Work Order') . '</a></td></tr></table><br />'; + echo '<input type=submit name="SearchOrders" value="' . _('Search') . '">'; + echo ' <a href="' . $rootpath . '/WorkOrderEntry.php">' . _('New Work Order') . '</a></td></tr></table><br />'; } $SQL="SELECT categoryid, @@ -155,37 +155,38 @@ $result1 = DB_query($SQL,$db); - echo "<table class=selection> - <tr><th colspan=6><font size=3 color=navy>" . _('To search for work orders for a specific item use the item selection facilities below') . "</font></th></tr> + echo '<table class=selection> + <tr><th colspan=6><font size=3 color=navy>' . _('To search for work orders for a specific item use the item selection facilities below') . '</font></th></tr> <tr> - <td><font size=1>" . _('Select a stock category') . ":</font> - <select name='StockCat'>"; + <td><font size=1>' . _('Select a stock category') . ':</font> + <select name="StockCat">'; while ($myrow1 = DB_fetch_array($result1)) { - echo "<option value='". $myrow1['categoryid'] . "'>" . $myrow1['categorydescription']; + echo '<option value="'. $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>'; } echo '</select> - <td><font size=1>' . _('Enter text extract(s) in the description') . ":</font></td> - <td><input type='Text' name='Keywords' size=20 maxlength=25></td> + <td><font size=1>' . _('Enter text extract(s) in the description') . ':</font></td> + <td><input type="Text" name="Keywords" size=20 maxlength=25></td> </tr> <tr><td></td> - <td><font size=3><b>" . _('OR') . ' </b></font><font size=1>' . _('Enter extract of the Stock Code') . "</b>:</font></td> - <td><input type='Text' name='StockCode' size=15 maxlength=18></td> + <td><font size=3><b>' . _('OR') . ' </b></font><font size=1>' . _('Enter extract of the Stock Code') . '</b>:</font></td> + <td><input type="Text" name="StockCode" size=15 maxlength=18></td> </tr> - </table><br />"; - echo "<div class=centre><input type=submit name='SearchParts' value='" . _('Search Items Now') . "'> - <input type=submit name='ResetPart' value='" . _('Show All') . "'></div>"; + </table><br />'; + echo '<div class=centre><input type=submit name="SearchParts" value="' . _('Search Items Now') . '"> + <input type=submit name="ResetPart" value="' . _('Show All') . '"></div>'; +} if (isset($StockItemsResult)) { echo '<br /><table cellpadding=2 colspan=7 class=selection>'; - $TableHeader = "<tr> - <th>" . _('Code') . "</th> - <th>" . _('Description') . "</th> - <th>" . _('On Hand') . "</th> - <th>" . _('Units') . "</th> - </tr>"; + $TableHeader = '<tr> + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('On Hand') . '</th> + <th>' . _('Units') . '</th> + </tr>'; echo $TableHeader; $j = 1; @@ -201,11 +202,11 @@ $k++; } - printf("<td><input type=submit name='SelectedStockItem' value='%s'</td> + printf('<td><input type=submit name="SelectedStockItem" value="%s" /></td> <td>%s</td> <td class=number>%s</td> <td>%s</td> - </tr>", + </tr>', $myrow['stockid'], $myrow['description'], $myrow['qoh'], @@ -293,18 +294,18 @@ echo '<br /><table cellpadding=2 colspan=7 width=95% class=selection>'; - $tableheader = "<tr> - <th>" . _('Modify') . "</th> - <th>" . _('Status') . "</th> - <th>" . _('Receive') . "</th> - <th>" . _('Issue To') . "</th> - <th>" . _('Costing') . "</th> - <th>" . _('Item') . "</th> - <th>" . _('Quantity Required') . "</th> - <th>" . _('Quantity Received') . "</th> - <th>" . _('Quantity Outstanding') . "</th> - <th>" . _('Required Date') . "</th> - </tr>"; + $tableheader = '<tr> + <th>' . _('Modify') . '</th> + <th>' . _('Status') . '</th> + <th>' . _('Receive') . '</th> + <th>' . _('Issue To') . '</th> + <th>' . _('Costing') . '</th> + <th>' . _('Item') . '</th> + <th>' . _('Quantity Required') . '</th> + <th>' . _('Quantity Received') . '</th> + <th>' . _('Quantity Outstanding') . '</th> + <th>' . _('Required Date') . '</th> + </tr>'; echo $tableheader; } @@ -320,26 +321,26 @@ $k++; } - $ModifyPage = $rootpath . "/WorkOrderEntry.php?" . SID . '&WO=' . $myrow['wo']; - $Status_WO = $rootpath . '/WorkOrderStatus.php?' . SID . '&WO=' .$myrow['wo'] . '&StockID=' . $myrow['stockid']; - $Receive_WO = $rootpath . '/WorkOrderReceive.php?' . SID . '&WO=' .$myrow['wo'] . '&StockID=' . $myrow['stockid']; - $Issue_WO = $rootpath . '/WorkOrderIssue.php?' . SID . '&WO=' .$myrow['wo'] . '&StockID=' . $myrow['stockid']; - $Costing_WO =$rootpath . '/WorkOrderCosting.php?' . SID . '&WO=' .$myrow['wo']; + $ModifyPage = $rootpath . '/WorkOrderEntry.php?WO=' . $myrow['wo']; + $Status_WO = $rootpath . '/WorkOrderStatus.php?WO=' .$myrow['wo'] . '&StockID=' . $myrow['stockid']; + $Receive_WO = $rootpath . '/WorkOrderReceive.php?WO=' .$myrow['wo'] . '&StockID=' . $myrow['stockid']; + $Issue_WO = $rootpath . '/WorkOrderIssue.php?WO=' .$myrow['wo'] . '&StockID=' . $myrow['stockid']; + $Costing_WO =$rootpath . '/WorkOrderCosting.php?WO=' .$myrow['wo']; $FormatedRequiredByDate = ConvertSQLDate($myrow['requiredby']); - printf("<td><a href='%s'>%s</a></td> - <td><a href='%s'>" . _('Status') . "</a></td> - <td><a href='%s'>" . _('Receive') . "</a></td> - <td><a href='%s'>" . _('Issue To') . "</a></td> - <td><a href='%s'>" . _('Costing') . "</a></td> + printf('<td><a href="%s">%s</a></td> + <td><a href="%s">' . _('Status') . '</a></td> + <td><a href="%s">' . _('Receive') . '</a></td> + <td><a href="%s">' . _('Issue To') . '</a></td> + <td><a href="%s">' . _('Costing') . '</a></td> <td>%s - %s</td> <td class=number>%s</td> <td class=number>%s</td> <td class=number>%s</td> <td>%s</td> - </tr>", + </tr>', $ModifyPage, $myrow['wo'], $Status_WO, @@ -365,12 +366,9 @@ echo '</table>'; } -echo "<script>defaultControl(document.forms[0].WO);</script>"; +echo '<script>defaultControl(document.forms[0].WO);</script>'; -?> -</form> +echo '</form>'; -<?php } - 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: <tim...@us...> - 2011-04-08 21:15:30
|
Revision: 5142 http://weberp.svn.sourceforge.net/weberp/?rev=5142&view=rev Author: tim_schofield Date: 2011-04-08 21:15:24 +0000 (Fri, 08 Apr 2011) Log Message: ----------- Ensure the script aborts gracefully if no labels setup Modified Paths: -------------- trunk/PDFPrintLabel.php trunk/includes/DefineLabelClass.php Modified: trunk/PDFPrintLabel.php =================================================================== --- trunk/PDFPrintLabel.php 2011-04-08 20:15:36 UTC (rev 5141) +++ trunk/PDFPrintLabel.php 2011-04-08 21:15:24 UTC (rev 5142) @@ -17,7 +17,6 @@ // 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') ); } @@ -119,15 +118,15 @@ <input type="submit" name="PDFTest" value="'. _('Print labels with borders') .'"></div>'; $iTxt=0; - echo '<script type="text/javascript"> + echo "<script type=\"text/javascript\"> function setAll(all) { - var x=document.getElementById("form1"); + var x=document.getElementById('form1'); for (var i=0;i<x.length;i++) { - if (x.elements[i].id==\'item\'); + if (x.elements[i].id=='item'); x.elements[i].checked=all.checked; } } - </script>'; + </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/includes/DefineLabelClass.php =================================================================== --- trunk/includes/DefineLabelClass.php 2011-04-08 20:15:36 UTC (rev 5141) +++ trunk/includes/DefineLabelClass.php 2011-04-08 21:15:24 UTC (rev 5142) @@ -1,13 +1,13 @@ <?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, +$GlobalTags = array('id'=>array('desc'=> _('Label id'), + 'type'=>'t', + 'sz'=>8, 'maxsz'=>12), // text 'description'=>array('desc'=>_('Description'), 'type'=>'t', @@ -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; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-04-09 10:47:36
|
Revision: 5147 http://weberp.svn.sourceforge.net/weberp/?rev=5147&view=rev Author: tim_schofield Date: 2011-04-09 10:47:30 +0000 (Sat, 09 Apr 2011) Log Message: ----------- XHTML corrections and other fixes Modified Paths: -------------- trunk/Stocks.php trunk/WOSerialNos.php trunk/includes/SQL_CommonFunctions.inc Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2011-04-09 08:51:26 UTC (rev 5146) +++ trunk/Stocks.php 2011-04-09 10:47:30 UTC (rev 5147) @@ -1029,8 +1029,8 @@ echo '<input type="hidden" name="PropType' . $PropertyCounter .'" value=' . $PropertyRow['controltype'] . '>'; echo '</td></tr>'; $PropertyCounter++; - unset($StockID); } //end loop round properties for the item category +unset($StockID); echo '</table><br>'; echo '<input type="hidden" name="PropertyCounter" value=' . $PropertyCounter . '>'; Modified: trunk/WOSerialNos.php =================================================================== --- trunk/WOSerialNos.php 2011-04-09 08:51:26 UTC (rev 5146) +++ trunk/WOSerialNos.php 2011-04-09 10:47:30 UTC (rev 5147) @@ -50,6 +50,7 @@ } else { DB_Txn_Begin($db); /*Process the additional controlled items into woserialnos and update the quantity on the work order order in woitems*/ + $InputError=false; $sql = "INSERT INTO woserialnos (stockid, wo, qualitytext, @@ -58,7 +59,7 @@ $ValueLine = " ('" . $StockID . "', '" . $WO . "', '' , - "; + '"; for ($i=0;$i<$_POST['NumberToAdd'];$i++){ $NextItemNumber = $NextSerialNo + $i; $result = DB_query("SELECT serialno FROM woserialnos @@ -229,7 +230,7 @@ echo '<input type="hidden" name="Serialised" value="' . $Serialised . '">'; echo '<input type="hidden" name="NextSerialNo" value="' . $NextSerialNo . '">'; -echo '<table>'; +echo '<table class="selection">'; if ($Serialised==1 AND $NextSerialNo>0){ echo '<tr><td>' . _('Add A Number of New Serial Numbers'); @@ -256,8 +257,7 @@ } echo '<td><input type="submit" name="AddControlledItems" value="' . _('Add') . '"></td></tr> - </table>'; -echo '<hr>'; + </table><br />'; $sql = "SELECT serialno, quantity, @@ -272,7 +272,7 @@ if (DB_num_rows($WOSerialNoResult)==0){ prnMsg(_('There are no serial items or batches yet defined for this work order item. Create new items first'),'info'); } else { - echo '<table>'; + echo '<br /><table class="selection">'; if ($Serialised==1){ $Header = '<tr><th>' . _('Serial No') . '</th><th>' . _('Notes') . '</th></tr>'; } else { @@ -291,13 +291,13 @@ echo '<tr><td><input type="text" name="Reference' . $i .'" value="' . $WOSNRow['serialno'] . '"></td>'; echo '<input type="hidden" name="OldReference' . $i . '" value="' . $WOSNRow['serialno'] . '">'; if ($Serialised==0){ - echo '<td><input type="text" name="Quantity' . $i .'" value="' . $WOSNRow['quantity'] . '"</td>'; + echo '<td><input type="text" name="Quantity' . $i .'" value="' . $WOSNRow['quantity'] . '" /></td>'; echo '<input type="hidden" name="OldQuantity' . $i . '" value="' . $WOSNRow['quantity'] . '">'; } else { echo '<input type="hidden" name="Quantity' . $i . '" value="1">'; } echo '<td><textarea name="Notes' . $i .'" cols=60 rows=3>' . $WOSNRow['qualitytext'] .'</textarea></td>'; - echo '<td><a href="' . $_SESSION['PHP_SELF'] . '?' . SID . '&Delete=1&Reference=' . $WOSNRow['serialno'] . '&Quantity=' . $WOSNRow['quantity'] . '&WO=' . $WO . '&StockID=' . $StockID . '&Description=' . $Description . '&Serialised=' . $Serialised . '&NextSerialNo=' . $NextSerialNo . '">' . _('Delete') . '</td></tr>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?Delete=1&Reference=' . $WOSNRow['serialno'] . '&Quantity=' . $WOSNRow['quantity'] . '&WO=' . $WO . '&StockID=' . $StockID . '&Description=' . $Description . '&Serialised=' . $Serialised . '&NextSerialNo=' . $NextSerialNo . '">' . _('Delete') . '</td></tr>'; $i++; $j++; } @@ -307,14 +307,14 @@ if ($Serialised==0){ echo '<tr><td align="center" colspan=3>'; } else { - echo '<tr><td align="center" colspan=2>'; + echo '<tr><td style="text-align: center" colspan=2>'; } echo '<input type="submit" name="UpdateItems" value="' . _('Update') . '"></td></tr>'; echo '</table>'; } //end of if there are woserialno items defined -echo '<p/><a href="' . $rootpath . '/WorkOrderEntry.php?' . SID . '&WO=' . $WO . '">' . _('Back To Work Order') . ' ' . $WO .'</a>'; +echo '<br /><div class="centre"><a href="' . $rootpath . '/WorkOrderEntry.php?WO=' . $WO . '">' . _('Back To Work Order') . ' ' . $WO .'</a></div>'; echo '</form>'; include('includes/footer.inc'); Modified: trunk/includes/SQL_CommonFunctions.inc =================================================================== --- trunk/includes/SQL_CommonFunctions.inc 2011-04-09 08:51:26 UTC (rev 5146) +++ trunk/includes/SQL_CommonFunctions.inc 2011-04-09 10:47:30 UTC (rev 5147) @@ -46,7 +46,7 @@ materialuseagevarac, wipact FROM stockmaster - LEFT JOIN stockcategory + INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid AND stockmaster.stockid = '" . $StockID . "'"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-04-09 16:03:17
|
Revision: 5153 http://weberp.svn.sourceforge.net/weberp/?rev=5153&view=rev Author: tim_schofield Date: 2011-04-09 16:03:10 +0000 (Sat, 09 Apr 2011) Log Message: ----------- XHTML updates and quoting changes Modified Paths: -------------- trunk/TaxProvinces.php trunk/UnitsOfMeasure.php trunk/UpgradeDatabase.php trunk/UserSettings.php trunk/WWW_Users.php trunk/WorkOrderCosting.php trunk/WorkOrderIssue.php trunk/WorkOrderStatus.php trunk/Z_CheckDebtorsControl.php trunk/Z_RePostGLFromPeriod.php trunk/Z_UpdateChartDetailsBFwd.php trunk/Z_Upgrade_3.10-3.11.php trunk/Z_poEditLangModule.php Removed Paths: ------------- trunk/xmlrpc/debugger/ trunk/xmlrpc/demo/ trunk/xmlrpc/test/ Modified: trunk/TaxProvinces.php =================================================================== --- trunk/TaxProvinces.php 2011-04-09 16:01:08 UTC (rev 5152) +++ trunk/TaxProvinces.php 2011-04-09 16:03:10 UTC (rev 5153) @@ -27,9 +27,9 @@ //first off validate inputs sensible - if (strpos($_POST['TaxProvinceName'],'&')>0 OR strpos($_POST['TaxProvinceName'],"'")>0) { + if (ContainsIllegalCharacters($_POST['TaxProvinceName'])) { $InputError = 1; - prnMsg( _('The tax province name cannot contain the character') . " '&' " . _('or the character') ." '",'error'); + prnMsg( _('The tax province name contains illegal characters') ,'error'); } if (trim($_POST['TaxProvinceName']) == '') { $InputError = 1; @@ -158,10 +158,10 @@ $ErrMsg = _('Could not get tax categories because'); $result = DB_query($sql,$db,$ErrMsg); - echo "<table class=selection> + echo '<table class=selection> <tr> - <th>" . _('Tax Provinces') . "</th> - </tr>"; + <th>' . _('Tax Provinces') . '</th> + </tr>'; $k=0; //row colour counter while ($myrow = DB_fetch_row($result)) { @@ -185,14 +185,14 @@ if (isset($SelectedTaxProvince)) { - echo '<div class="centre"><a href=' . $_SERVER['PHP_SELF'] . '?' . SID .'>' . _('Review Tax Provinces') . '</a></div>'; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Review Tax Provinces') . '</a></div>'; } echo '<p>'; 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($SelectedTaxProvince)) { @@ -212,18 +212,18 @@ $_POST['TaxProvinceName'] = $myrow['taxprovincename']; - echo "<input type=hidden name='SelectedTaxProvince' VALUE='" . $myrow['taxprovinceid'] . "'>"; - echo "<table class=selection>"; + echo '<input type=hidden name="SelectedTaxProvince" VALUE="' . $myrow['taxprovinceid'] . '">'; + echo '<table class=selection>'; } } else { $_POST['TaxProvinceName']=''; - echo "<table class=selection>"; + echo '<table class=selection>'; } - echo "<tr> - <td>" . _('Tax Province Name') . ':' . "</td> - <td><input type='Text' name='TaxProvinceName' size=30 maxlength=30 value='" . $_POST['TaxProvinceName'] . "'></td> - </tr>"; + echo '<tr> + <td>' . _('Tax Province Name') . ':' . '</td> + <td><input type="Text" name="TaxProvinceName" size=30 maxlength=30 value="' . $_POST['TaxProvinceName'] . '"></td> + </tr>'; echo '</table>'; echo '<br /><div class="centre"><input type=Submit name=submit value=' . _('Enter Information') . '></div>'; @@ -232,10 +232,10 @@ } //end if record deleted no point displaying form to add record -echo '<div class="centre"'; -echo '<br><a href="' . $rootpath . '/TaxAuthorities.php?' . SID . '">' . _('Edit/Review Tax Authorities') . '</a>'; -echo '<br><a href="' . $rootpath . '/TaxGroups.php?' . SID . '">' . _('Edit/Review Tax Groupings') . '</a>'; -echo '<br><a href="' . $rootpath . '/TaxCategories.php?' . SID . '">' . _('Edit/Review Tax Categories') . '</a>'; +echo '<div class="centre">'; +echo '<br /><a href="' . $rootpath . '/TaxAuthorities.php">' . _('Edit/Review Tax Authorities') . '</a>'; +echo '<br /><a href="' . $rootpath . '/TaxGroups.php">' . _('Edit/Review Tax Groupings') . '</a>'; +echo '<br /><a href="' . $rootpath . '/TaxCategories.php">' . _('Edit/Review Tax Categories') . '</a>'; echo '</div>'; include('includes/footer.inc'); Modified: trunk/UnitsOfMeasure.php =================================================================== --- trunk/UnitsOfMeasure.php 2011-04-09 16:01:08 UTC (rev 5152) +++ trunk/UnitsOfMeasure.php 2011-04-09 16:03:10 UTC (rev 5153) @@ -25,9 +25,9 @@ //first off validate inputs sensible - if (strpos($_POST['MeasureName'],'&')>0 OR strpos($_POST['MeasureName'],"'")>0) { + if (ContainsIllegalCharacters($_POST['MeasureName'])) { $InputError = 1; - prnMsg( _('The unit of measure cannot contain the character') . " '&' " . _('or the character') ." '",'error'); + prnMsg( _('The unit of measure name contains illegal characters') ,'error'); } if (trim($_POST['MeasureName']) == '') { $InputError = 1; @@ -205,7 +205,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($SelectedMeasureID)) { Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2011-04-09 16:01:08 UTC (rev 5152) +++ trunk/UpgradeDatabase.php 2011-04-09 16:03:10 UTC (rev 5153) @@ -8,11 +8,11 @@ include('includes/header.inc'); if (!isset($_POST['DoUpgrade'])){ - - prnMsg(_('This script will run perform any modifications to the database required to allow the additional functionality in later scripts'),'info'); + + prnMsg(_('This script will run perform any modifications to the database required to allow the additional functionality in later scripts'),'info'); echo '<p><form method="post" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - + if (!isset($_SESSION['VersionNumber'])){ prnMsg(_('The webERP code is version') . ' ' . $Version . ' ' . _('and the database version is not actually recorded at this version'),'info'); echo '<table><tr><td>' . _('Select the version you are upgrading from:') . '</td> @@ -44,14 +44,14 @@ } if (isset($_POST['DoUpgrade'])){ - + if ($dbType=='mysql' OR $dbType =='mysqli'){ - + /* First do a backup */ $BackupFile = $PathPrefix . './companies/' . $_SESSION['DatabaseName'] .'/' . _('Backup') . '_' . Date('Y-m-d-H-i-s') . '.sql.gz'; - $Command = 'mysqldump --opt -h' . $host . ' -u' . $dbuser . ' -p' . $dbpassword . ' ' . $_SESSION['DatabaseName'] . '| gzip > ' . $BackupFile; + $Command = 'mysqldump --opt -h' . $host . ' -u' . $dbuser . ' -p' . $dbpassword . ' ' . $_SESSION['DatabaseName'] . "| gzip > " . $BackupFile; system($Command); - + /*this could be a weighty file attachment!! */ include('includes/htmlMimeMail.php'); $mail = new htmlMimeMail(); @@ -61,16 +61,16 @@ $mail->setSubject(_('Database Backup')); $mail->setFrom($_SESSION['CompanyRecord']['coyname'] . '<' . $_SESSION['CompanyRecord']['email'] . '>'); $result = $mail->send(array('"' . $_SESSION['UsersRealName'] . '" <' . $_SESSION['UserEmail'] . '>')); - + prnMsg(_('A backup of the database has been taken and emailed to you'), 'info'); unlink($BackupFile); // would be a security issue to leave it there for all to download/see - + if ($_POST['OldVersion']=='Manual') { prnMsg(_('No datbase updates have been done as you selected to apply these manually - upgrade SQL scripts are under sql/mysql/ directory in the distribution'),'info'); } else { //we are into automatically applying database upgrades - + prnMsg(_('If there are any failures then please check with your system administrator. Please read all notes carefully to ensure they are expected'),'info'); - switch ($_POST['OldVersion']) { + switch ($_POST['OldVersion']) { //since there are no "break" statements subsequent upgrade scripts will be added to the array case '3.00': $SQLScripts[] = './sql/mysql/upgrade3.00-3.01.sql'; @@ -100,15 +100,15 @@ if(isset($_SESSION['VersionNumber']) AND strcmp($_SESSION['VersionNumber'],'4.04')<0) { /* VersionNumber is set to '4.04' when upgrade3.11.1-4.00.sql is run */ $SQLScripts[] = './sql/mysql/upgrade3.11.1-4.00.sql'; } - } + } } else { //dbType is not mysql or mysqli prnMsg(_('Only mysql upgrades are performed seamlessly at this time. Your database will need to be manually updated'),'info'); } - + $result = DB_IgnoreForeignKeys($db); foreach ($SQLScripts AS $SQLScriptFile) { - + $SQLEntries = file($SQLScriptFile); $ScriptFileEntries = sizeof($SQLEntries); $sql =''; @@ -117,16 +117,16 @@ <tr><th colspan=2>' . _('Applying') . ' ' . $SQLScriptFile . '</th></tr>'; for ($i=0; $i<=$ScriptFileEntries; $i++) { - + $SQLEntries[$i] = trim($SQLEntries[$i]); if (substr($SQLEntries[$i], 0, 2) != '--' AND substr($SQLEntries[$i], 0, 3) != 'USE' AND strstr($SQLEntries[$i],'/*')==FALSE AND strlen($SQLEntries[$i])>1){ - + $sql .= ' ' . $SQLEntries[$i]; - + //check if this line kicks off a function definition - pg chokes otherwise if (substr($SQLEntries[$i],0,15) == 'CREATE FUNCTION'){ $InAFunction = true; Modified: trunk/UserSettings.php =================================================================== --- trunk/UserSettings.php 2011-04-09 16:01:08 UTC (rev 5152) +++ trunk/UserSettings.php 2011-04-09 16:03:10 UTC (rev 5153) @@ -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']=='') { @@ -111,17 +111,17 @@ echo '<tr><td>' . _('User Name') . ':</td><td>'; echo $_SESSION['UsersRealName'] . '</td> - <input type="hidden" name="RealName" VALUE="'.$_SESSION['UsersRealName'].'"<td></tr>'; + <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">'; $Languages = scandir('locale/', 0); @@ -145,8 +145,8 @@ echo '<tr> - <td>' . _('Theme') . ":</td> - <td><select name='Theme'>"; + <td>' . _('Theme') . ':</td> + <td><select name="Theme">'; $ThemeDirectory = dir('css/'); @@ -170,11 +170,11 @@ $_POST['pass']=''; } echo '</select></td></tr> - <tr><td>' . _('New Password') . ":</td> - <td><input type='password' name='pass' size=20 value='" . $_POST['pass'] . "'></td></tr> - <tr><td>" . _('Confirm Password') . ":</td> - <td><input type='password' name='passcheck' size=20 value='" . $_POST['passcheck'] . "'></td></tr> - <tr><td colspan=2 align='center'><i>" . _('If you leave the password boxes empty your password will not change') . '</i></td></tr> + <tr><td>' . _('New Password') . ':</td> + <td><input type="password" name="pass" size=20 value="' . $_POST['pass'] . '"></td></tr> + <tr><td>' . _('Confirm Password') . ':</td> + <td><input type="password" name="passcheck" size=20 value="' . $_POST['passcheck'] . '"></td></tr> + <tr><td colspan=2 align="center"><i>' . _('If you leave the password boxes empty your password will not change') . '</i></td></tr> <tr><td>' . _('Email') . ':</td>'; $sql = "SELECT email from www_users WHERE userid = '" . $_SESSION['UserID'] . "'"; @@ -184,7 +184,7 @@ $_POST['email'] = $myrow['email']; } -echo "<td><input type=text name='email' size=40 value='" . $_POST['email'] . "'></td></tr>"; +echo '<td><input type=text name="email" size=40 value="' . $_POST['email'] . '"></td></tr>'; if (!isset($_POST['PDFLanguage'])){ $_POST['PDFLanguage']=$_SESSION['PDFLanguage']; @@ -198,8 +198,8 @@ echo '<option value=' . $i .'>' . $PDFLanguages[$i]. '</option>'; } } -echo "</select></td></tr></table> - <br /><div class='centre'><input type='Submit' name='Modify' value=" . _('Modify') . '></div> +echo '</select></td></tr></table> + <br /><div class="centre"><input type="Submit" name="Modify" value="' . _('Modify') . '"></div> </form>'; include('includes/footer.inc'); Modified: trunk/WWW_Users.php =================================================================== --- trunk/WWW_Users.php 2011-04-09 16:01:08 UTC (rev 5152) +++ trunk/WWW_Users.php 2011-04-09 16:03:10 UTC (rev 5153) @@ -64,7 +64,7 @@ prnMsg(_('The user ID entered must be at least 4 characters long'),'error'); } elseif (ContainsIllegalCharacters($_POST['UserID'])) { $InputError = 1; - prnMsg(_('User names cannot contain any of the following characters') . " - ' & + \" \\ " . _('or a space'),'error'); + prnMsg(_('User names cannot contain any of the following characters') . " - \' & + \" \\ " . _('or a space'),'error'); } elseif (strlen($_POST['Password'])<5){ if (!$SelectedUser){ $InputError = 1; Modified: trunk/WorkOrderCosting.php =================================================================== --- trunk/WorkOrderCosting.php 2011-04-09 16:01:08 UTC (rev 5152) +++ trunk/WorkOrderCosting.php 2011-04-09 16:03:10 UTC (rev 5153) @@ -222,7 +222,7 @@ } -//Now need to run through the issues to the work order that weren't in the requirements +//Now need to run through the issues to the work order that werent in the requirements $sql = "SELECT stockmoves.stockid, stockmaster.description, Modified: trunk/WorkOrderIssue.php =================================================================== --- trunk/WorkOrderIssue.php 2011-04-09 16:01:08 UTC (rev 5152) +++ trunk/WorkOrderIssue.php 2011-04-09 16:03:10 UTC (rev 5153) @@ -19,7 +19,7 @@ echo '<a href="'. $rootpath . '/WorkOrderCosting.php?' . SID . '&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'; + _('Search') . '" alt="" />' . ' ' . $title.'</p>'; echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -548,9 +548,9 @@ 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>'; @@ -615,18 +615,18 @@ 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>'; } } ?> @@ -686,11 +686,11 @@ } $IssueLink = $_SERVER['PHP_SELF'] . '?' . SID . '&WO=' . $_POST['WO'] . '&StockID=' . $_POST['StockID'] . '&IssueItem=' . $myrow['stockid'] . '&FromLocation=' . $_POST['FromLocation']; - printf("<td><font size=1>%s</font></td> + printf('<td><font size=1>%s</font></td> <td><font size=1>%s</font></td> <td><font size=1>%s</font></td> <td>%s</td> - <td><font size=1><a href='%s'>" + <td><font size=1><a href="%s">' . _('Add to Work Order') . '</a></font></td> </tr>', $myrow['stockid'], Modified: trunk/WorkOrderStatus.php =================================================================== --- trunk/WorkOrderStatus.php 2011-04-09 16:01:08 UTC (rev 5152) +++ trunk/WorkOrderStatus.php 2011-04-09 16:03:10 UTC (rev 5153) @@ -40,7 +40,7 @@ echo '<a href="'. $rootpath . '/WorkOrderCosting.php?' . SID . '&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 '<table cellpadding=2 class=selection> <tr><td class="label">' . _('Issue to work order') . ':</td><td>' . $_REQUEST['WO'] .'</td><td class="label">' . _('Item') . ':</td><td>' . $_REQUEST['StockID'] . ' - ' . $WORow['description'] . '</td></tr> Modified: trunk/Z_CheckDebtorsControl.php =================================================================== --- trunk/Z_CheckDebtorsControl.php 2011-04-09 16:01:08 UTC (rev 5152) +++ trunk/Z_CheckDebtorsControl.php 2011-04-09 16:03:10 UTC (rev 5153) @@ -13,7 +13,7 @@ // Page Border echo '<table border=1 width=100%><tr><td bgcolor="#FFFFFF">'; - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<form method="post" action=' . $_SERVER['PHP_SELF'] . '?' . SID . '>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; // Context Navigation and Title Modified: trunk/Z_RePostGLFromPeriod.php =================================================================== --- trunk/Z_RePostGLFromPeriod.php 2011-04-09 16:01:08 UTC (rev 5152) +++ trunk/Z_RePostGLFromPeriod.php 2011-04-09 16:03:10 UTC (rev 5153) @@ -32,8 +32,8 @@ </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 + 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 */ Modified: trunk/Z_UpdateChartDetailsBFwd.php =================================================================== --- trunk/Z_UpdateChartDetailsBFwd.php 2011-04-09 16:01:08 UTC (rev 5152) +++ trunk/Z_UpdateChartDetailsBFwd.php 2011-04-09 16:03:10 UTC (rev 5153) @@ -8,7 +8,7 @@ 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 ($_POST['FromPeriod'] > $_POST['ToPeriod']){ Modified: trunk/Z_Upgrade_3.10-3.11.php =================================================================== --- trunk/Z_Upgrade_3.10-3.11.php 2011-04-09 16:01:08 UTC (rev 5152) +++ trunk/Z_Upgrade_3.10-3.11.php 2011-04-09 16:03:10 UTC (rev 5153) @@ -9,9 +9,9 @@ if (empty($_POST['DoUpgrade'])){ prnMsg(_('This script will run perform any modifications to the database since v 3.10 required to allow the additional functionality in version 3.11 scripts'),'info'); - 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'] . '" />'; - echo '<div class="centre"?><input type=submit name=DoUpgrade VALUE="' . _('Perform Upgrade') . '"></div>'; + echo '<div class="centre"><input type=submit name=DoUpgrade VALUE="' . _('Perform Upgrade') . '" /></div>'; echo '</form>'; } Modified: trunk/Z_poEditLangModule.php =================================================================== --- trunk/Z_poEditLangModule.php 2011-04-09 16:01:08 UTC (rev 5152) +++ trunk/Z_poEditLangModule.php 2011-04-09 16:03:10 UTC (rev 5153) @@ -128,7 +128,7 @@ echo '<br>'; echo '<form method="post" action=' . $_SERVER['PHP_SELF'] . '?' . SID . '>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '</div'; + echo '</div>'; echo '<table>'; echo '<tr><th ALIGN="center">' . _('Language File for') . ' "' . $_POST['language'] . '"</th></tr>'; echo '<tr><td ALIGN="center">' . _('Module') . ' "' . $_POST['module'] . '"</td></tr>'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-04-09 17:51:02
|
Revision: 5156 http://weberp.svn.sourceforge.net/weberp/?rev=5156&view=rev Author: tim_schofield Date: 2011-04-09 17:50:56 +0000 (Sat, 09 Apr 2011) Log Message: ----------- Correctly deal with batches and serial numbers on stock transfers Modified Paths: -------------- trunk/PDFStockTransfer.php trunk/StockTransferControlled.php trunk/StockTransfers.php trunk/includes/DefineStockTransfers.php trunk/includes/OutputSerialItems.php trunk/index.php Modified: trunk/PDFStockTransfer.php =================================================================== --- trunk/PDFStockTransfer.php 2011-04-09 16:20:03 UTC (rev 5155) +++ trunk/PDFStockTransfer.php 2011-04-09 17:50:56 UTC (rev 5156) @@ -75,7 +75,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']; Modified: trunk/StockTransferControlled.php =================================================================== --- trunk/StockTransferControlled.php 2011-04-09 16:20:03 UTC (rev 5155) +++ trunk/StockTransferControlled.php 2011-04-09 17:50:56 UTC (rev 5156) @@ -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-09 16:20:03 UTC (rev 5155) +++ trunk/StockTransfers.php 2011-04-09 17:50:56 UTC (rev 5156) @@ -12,9 +12,13 @@ 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) { @@ -27,7 +31,7 @@ $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); echo '<table class=selection><tr><th>'._('Stock Code').'</th><th>'._('Stock Description').'</th></tr>'; 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></tr>'; + echo '<tr><td>'.$myrow[0].'</td><td>'.$myrow[1].'</td><td><a href="StockTransfers.php?StockID='.$myrow[0].'&Description='.$myrow[1].'&NewTransfer=Yes">Transfer</a></tr>'; } echo '</table>'; include('includes/footer.inc'); @@ -39,6 +43,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']; } @@ -69,22 +74,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], + $myrow = DB_fetch_array($result); + $_SESSION['Transfer']->TransferItem[0] = new LineItem ( + trim(strtoupper($_POST['StockID'])), + $myrow['description'], $_POST['Quantity'], - $myrow[1], - $myrow[4], - $myrow[5], - $myrow[6]); + $myrow['units'], + $myrow['controlled'], + $myrow['serialised'], + $myrow['perishable'], + $myrow['decimalplaces']); $_SESSION['Transfer']->TransferItem[0]->StandardCost = $myrow[3]; @@ -403,16 +410,6 @@ } -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>'; @@ -443,7 +440,7 @@ } 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>'; } @@ -458,7 +455,7 @@ } else { echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; } - } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ + } elseif ($myrow['loccode']==$_SESSION['UserStockLocation'] and isset($_SESSION['Transfer'])){ echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; $_SESSION['Transfer']->StockLocationFrom=$myrow['loccode']; } else { @@ -473,13 +470,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']; } else { echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; } - } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ + } elseif ($myrow['loccode']==$_SESSION['UserStockLocation'] and isset($_SESSION['Transfer'])){ echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; $_SESSION['Transfer']->StockLocationTo=$myrow['loccode']; } else { @@ -489,20 +486,18 @@ echo '</select></td></tr>'; - 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?' . SID . '">' . $_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>"; +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']; @@ -512,11 +507,13 @@ $StockID=''; } -echo '<br><a href="'.$rootpath.'/StockStatus.php?' . SID . '&StockID=' . $StockID . '">'._('Show Stock Status').'</a>'; -echo '<br><a href="'.$rootpath.'/StockMovements.php?' . SID . '&StockID=' . $StockID . '">'._('Show Movements').'</a>'; -echo '<br><a href="'.$rootpath.'/StockUsage.php?' . SID . '&StockID=' . $StockID . '&StockLocation=' . $_SESSION['Transfer']->StockLocationFrom . '">' . _('Show Stock Usage') . '</a>'; -echo '<br><a href="'.$rootpath.'/SelectSalesOrder.php?' . SID . '&SelectedStockItem=' . $StockID . '&StockLocation=' . $_SESSION['Transfer']->StockLocationFrom . '">' . _('Search Outstanding Sales Orders') . '</a>'; -echo '<br><a href="'.$rootpath.'/SelectCompletedOrder.php?' . SID . '&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 . '">' . _('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'); Modified: trunk/includes/DefineStockTransfers.php =================================================================== --- trunk/includes/DefineStockTransfers.php 2011-04-09 16:20:03 UTC (rev 5155) +++ trunk/includes/DefineStockTransfers.php 2011-04-09 17:50:56 UTC (rev 5156) @@ -39,6 +39,7 @@ Var $PartUnit; var $Controlled; var $Serialised; + var $Perishable; Var $DecimalPlaces; var $SerialItems; /*array to hold controlled items*/ //Constructor @@ -48,6 +49,7 @@ $PartUnit, $Controlled, $Serialised, + $Perishable, $DecimalPlaces){ $this->StockID = $StockID; @@ -55,6 +57,7 @@ $this->PartUnit = $PartUnit; $this->Controlled = $Controlled; $this->Serialised = $Serialised; + $this->Perishable = $Perishable; $this->DecimalPlaces = $DecimalPlaces; $this->ShipQty = $Quantity; if ($this->Controlled==1){ @@ -65,4 +68,4 @@ $this->SerialItems = array(); } } -?> +?> \ No newline at end of file Modified: trunk/includes/OutputSerialItems.php =================================================================== --- trunk/includes/OutputSerialItems.php 2011-04-09 16:20:03 UTC (rev 5155) +++ trunk/includes/OutputSerialItems.php 2011-04-09 17:50:56 UTC (rev 5156) @@ -114,7 +114,7 @@ /*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; @@ -161,12 +161,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-09 16:20:03 UTC (rev 5155) +++ trunk/index.php 2011-04-09 17:50:56 UTC (rev 5156) @@ -600,7 +600,7 @@ </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> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-04-09 19:41:40
|
Revision: 5158 http://weberp.svn.sourceforge.net/weberp/?rev=5158&view=rev Author: tim_schofield Date: 2011-04-09 19:41:34 +0000 (Sat, 09 Apr 2011) Log Message: ----------- Correctly deal with batches and serial numbers on stock transfers Modified Paths: -------------- trunk/StockTransfers.php trunk/includes/OutputSerialItems.php Modified: trunk/StockTransfers.php =================================================================== --- trunk/StockTransfers.php 2011-04-09 17:56:41 UTC (rev 5157) +++ trunk/StockTransfers.php 2011-04-09 19:41:34 UTC (rev 5158) @@ -225,7 +225,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 . "'"; @@ -238,10 +239,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'); @@ -337,7 +340,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 . "'"; @@ -350,10 +354,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'); Modified: trunk/includes/OutputSerialItems.php =================================================================== --- trunk/includes/OutputSerialItems.php 2011-04-09 17:56:41 UTC (rev 5157) +++ trunk/includes/OutputSerialItems.php 2011-04-09 19:41:34 UTC (rev 5158) @@ -94,9 +94,8 @@ echo '<td class=number>' . number_format($Bundle->BundleQty, $LineItem->DecimalPlaces) . '</td>'; 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>'; - + $LineItem->SerialItems[]=$Bundle; $TotalQuantity += $Bundle->BundleQty; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |