Thread: [Weberp-svn] SF.net SVN: weberp:[8286] trunk (Page 9)
Brought to you by:
sotandeka,
tim_schofield
From: <tim...@us...> - 2011-10-15 09:43:01
|
Revision: 8286 http://weberp.svn.sourceforge.net/weberp/?rev=8286&view=rev Author: tim_schofield Date: 2011-10-15 09:42:55 +0000 (Sat, 15 Oct 2011) Log Message: ----------- Add stock requset authorisation script to menus Modified Paths: -------------- trunk/InternalStockRequestAuthorisation.php trunk/includes/session.inc trunk/index.php Added Paths: ----------- trunk/sql/mysql/updates/99.php Modified: trunk/InternalStockRequestAuthorisation.php =================================================================== --- trunk/InternalStockRequestAuthorisation.php 2011-10-15 09:42:37 UTC (rev 8285) +++ trunk/InternalStockRequestAuthorisation.php 2011-10-15 09:42:55 UTC (rev 8286) @@ -1,7 +1,7 @@ <?php /* $Id$*/ -$PageSecurity=1; + include('includes/session.inc'); $title = _('Authorise Internal Stock Requests'); Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2011-10-15 09:42:37 UTC (rev 8285) +++ trunk/includes/session.inc 2011-10-15 09:42:55 UTC (rev 8286) @@ -13,7 +13,7 @@ header('Location:' . $rootpath . '/install/index.php'); } include($PathPrefix . 'config.php'); -$DBVersion=98; +$DBVersion=99; if (isset($SessionSavePath)){ session_save_path($SessionSavePath); } Modified: trunk/index.php =================================================================== --- trunk/index.php 2011-10-15 09:42:37 UTC (rev 8285) +++ trunk/index.php 2011-10-15 09:42:55 UTC (rev 8286) @@ -194,7 +194,8 @@ _('Inventory Adjustments'), _('Reverse Goods Received'), _('Enter Stock Counts'), - _('Create a New Internal Stock Request') + _('Create a New Internal Stock Request'), + _('Authorise Internal Stock Requests') ); $MenuItems['stock']['Transactions']['URL'] = array ('/PO_SelectOSPurchOrder.php', '/StockLocTransfer.php', @@ -203,7 +204,8 @@ '/StockAdjustments.php?NewAdjustment=Yes', '/ReverseGRN.php', '/StockCounts.php', - '/InternalStockRequest.php?New=Yes' + '/InternalStockRequest.php?New=Yes', + '/InternalStockRequestAuthorisation.php' ); $MenuItems['stock']['Reports']['Caption'] = array (_('Serial Item Research Tool'), Added: trunk/sql/mysql/updates/99.php =================================================================== --- trunk/sql/mysql/updates/99.php (rev 0) +++ trunk/sql/mysql/updates/99.php 2011-10-15 09:42:55 UTC (rev 8286) @@ -0,0 +1,10 @@ +<?php + +/* Include the new script for printing quotations in Portrait + */ + +InsertRecord('pagesecurity', array('script', 'security'), array('InternalStockRequestAuthorisation.php',1), array('script', 'security'), array('InternalStockRequestAuthorisation.php',1), $db); + +UpdateDBNo(99, $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-10-17 11:26:59
|
Revision: 8287 http://weberp.svn.sourceforge.net/weberp/?rev=8287&view=rev Author: tim_schofield Date: 2011-10-17 11:26:49 +0000 (Mon, 17 Oct 2011) Log Message: ----------- Ricard: PcExpenses.php PcAuthorizeExpense.php now uses GL tags Modified Paths: -------------- trunk/PcAuthorizeExpenses.php trunk/PcExpenses.php trunk/includes/session.inc Added Paths: ----------- trunk/sql/mysql/updates/100.php Modified: trunk/PcAuthorizeExpenses.php =================================================================== --- trunk/PcAuthorizeExpenses.php 2011-10-15 09:42:55 UTC (rev 8286) +++ trunk/PcAuthorizeExpenses.php 2011-10-17 11:26:49 UTC (rev 8287) @@ -2,7 +2,7 @@ /* $Revision: 1.0 $ */ include('includes/session.inc'); -$title = _('Authorization of Petty Cash Expenses'); +$title = _('Authorisation of Petty Cash Expenses'); include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); @@ -37,7 +37,7 @@ if ($SelectedTabs=='') { $InputError = 1; - prnMsg('<br />' . _('You Must First Select a Petty Cash Tab To Authorise'),'error'); + prnMsg( _('You Must First Select a Petty Cash Tab To Authorise'),'error'); $Errors[$i] = 'TabSelect'; $i++; unset($SelectedTabs); @@ -58,10 +58,10 @@ if (isset($SelectedTabs)) { echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Petty Cash') . '" alt="" />' . - _('Authorization Of Petty Cash Expenses ') . ''.$SelectedTabs.'</p>'; + _('Authorisation Of Petty Cash Expenses ') . ''.$SelectedTabs.'</p>'; } else { echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Petty Cash') . '" alt="" />' . - _('Authorization Of Petty Cash Expenses ') . '</p>'; + _('Authorisation Of Petty Cash Expenses ') . '</p>'; } if (isset($_POST['submit']) or isset($_POST['update']) OR isset($SelectedTabs) OR isset ($_POST['GO'])) { @@ -138,12 +138,14 @@ $type = 1; $Amount = -$Amount; $AccountFrom = $myrow['glaccountpcash']; - $SQLAccExp = "SELECT glaccount + $SQLAccExp = "SELECT glaccount, + tag FROM pcexpenses WHERE codeexpense = '".$myrow['codeexpense']."'"; $ResultAccExp = DB_query($SQLAccExp,$db); $myrowAccExp = DB_fetch_array($ResultAccExp); $AccountTo = $myrowAccExp['glaccount']; + $TagTo = $myrowAccExp['tag']; } //get typeno @@ -178,7 +180,7 @@ '".-$Amount."', 0, '', - 0)"; + '".$TagTo."')"; $ResultFrom = DB_Query($sqlFrom, $db, '', '', true); @@ -206,7 +208,7 @@ '".$Amount."', 0, '', - 0)"; + '".$TagTo."')"; $ResultTo = DB_Query($sqlTo, $db, '', '', true); Modified: trunk/PcExpenses.php =================================================================== --- trunk/PcExpenses.php 2011-10-15 09:42:55 UTC (rev 8286) +++ trunk/PcExpenses.php 2011-10-17 11:26:49 UTC (rev 8287) @@ -19,6 +19,7 @@ unset($_POST['codeexpense']); unset($_POST['description']); unset($_POST['glaccount']); + unset($_POST['Tag']); } if (isset($Errors)) { @@ -84,8 +85,9 @@ if (isset($SelectedExpense) AND $InputError !=1) { $sql = "UPDATE pcexpenses - SET description = '" . $_POST['description'] . "', - glaccount = '" . $_POST['glaccount'] . "' + SET description = '" . $_POST['description'] . "', + glaccount = '" . $_POST['glaccount'] . "', + tag = '" . $_POST['Tag'] . "' WHERE codeexpense = '" . $SelectedExpense . "'"; $msg = _('The Expenses type') . ' ' . $SelectedExpense . ' ' . _('has been updated'); @@ -109,10 +111,13 @@ $sql = "INSERT INTO pcexpenses (codeexpense, - description,glaccount) + description, + glaccount, + tag) VALUES ('" . $_POST['codeexpense'] . "', '" . $_POST['description'] . "', - '" . $_POST['glaccount'] . "')"; + '" . $_POST['glaccount'] . "', + '" . $_POST['Tag'] . "')"; $msg = _('Expense ') . ' ' . $_POST['codeexpense'] . ' ' . _('has been created'); $checkSql = "SELECT count(codeexpense) @@ -132,6 +137,7 @@ unset($_POST['codeexpense']); unset($_POST['description']); unset($_POST['glaccount']); + unset($_POST['Tag']); } } elseif ( isset($_GET['delete']) ) { @@ -173,7 +179,8 @@ $sql = "SELECT codeexpense, description, - glaccount + glaccount, + tag FROM pcexpenses"; $result = DB_query($sql,$db); @@ -183,6 +190,7 @@ <th>' . _('Description') . '</th> <th>' . _('Account Code') . '</th> <th>' . _('Account Description') . '</th> + <th>' . _('Tag') . '</th> </tr>'; $k=0; //row colour counter @@ -203,19 +211,29 @@ $ResultDes = DB_query($sqldesc,$db); $Description=DB_fetch_array($ResultDes); + $SqlDescTag="SELECT tagdescription + FROM tags + WHERE tagref='". $myrow[3] . "'"; + + $ResultDesTag = DB_query($SqlDescTag,$db); + $DescriptionTag=DB_fetch_array($ResultDesTag); + + printf('<td>%s</td> <td>%s</td> <td class="number">%s</td> <td>%s</td> - <td><a href="%s?SelectedExpense=%s">' . _('Edit') . '</td> - <td><a href="%s?SelectedExpense=%s&delete=yes" onclick="return confirm("' . _('Are you sure you wish to delete this expense code and all the details it may have set up?') .'");">' . _('Delete') . '</td> - </tr>', - $myrow['codeexpense'], - $myrow['description'], - $myrow['glaccount'], - $Description[0], - $_SERVER['PHP_SELF'], htmlentities($myrow['codeexpense'], ENT_QUOTES,'UTF-8'), - $_SERVER['PHP_SELF'], $myrow['codeexpense']); + <td>%s</td> + <td><a href="%sSelectedExpense=%s">' . _('Edit') . '</td> + <td><a href="%sSelectedExpense=%s&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this expense code and all the details it may have set up?') . '\');">' . _('Delete') . '</td> + </tr>', + $myrow[0], + $myrow[1], + $myrow[2], + $Description['accountname'], + $DescriptionTag['tagdesciption'], + $_SERVER['PHP_SELF'] . '?', $myrow[0], + $_SERVER['PHP_SELF'] . '?', $myrow[0]); } //END WHILE LIST LOOP echo '</table>'; @@ -238,7 +256,8 @@ $sql = "SELECT codeexpense, description, - glaccount + glaccount, + tag FROM pcexpenses WHERE codeexpense='" . $SelectedExpense . "'"; @@ -248,6 +267,7 @@ $_POST['codeexpense'] = $myrow['codeexpense']; $_POST['description'] = $myrow['description']; $_POST['glaccount'] = $myrow['glaccount']; + $_POST['Tag'] = $myrow['tag']; echo '<input type="hidden" name="SelectedExpense" value="' . $SelectedExpense . '" />'; echo '<input type="hidden" name="codeexpense" value="' . $_POST['codeexpense']. '" />'; @@ -274,7 +294,9 @@ } echo '<tr><td>' . _('Description') . ':</td><td><input type="text" name="description" size="50" maxlength="49" value="' . $_POST['description'] . '" /></td></tr>'; - echo '<tr><td>' . _('Account Code') . ':</td><td><select name="glaccount">'; + echo '<tr> + <td>' . _('Account Code') . ':</td> + <td><select name="glaccount">'; DB_free_result($result); $SQL = "SELECT accountcode, @@ -294,6 +316,29 @@ echo '</select></td></tr>'; + //Select the tag + DB_free_result($result); + echo '<tr> + <td>' . _('Tag') . ':</td> + <td><select name="Tag">'; + + $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>'; + } + } + echo '</select></td>'; + // End select tag + echo '</td></tr></table>'; // close main table echo '<br /><div class="centre"><input type="submit" name="submit" value="' . _('Accept') . '" /> Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2011-10-15 09:42:55 UTC (rev 8286) +++ trunk/includes/session.inc 2011-10-17 11:26:49 UTC (rev 8287) @@ -13,7 +13,7 @@ header('Location:' . $rootpath . '/install/index.php'); } include($PathPrefix . 'config.php'); -$DBVersion=99; +$DBVersion=100; if (isset($SessionSavePath)){ session_save_path($SessionSavePath); } Added: trunk/sql/mysql/updates/100.php =================================================================== --- trunk/sql/mysql/updates/100.php (rev 0) +++ trunk/sql/mysql/updates/100.php 2011-10-17 11:26:49 UTC (rev 8287) @@ -0,0 +1,11 @@ +<?php + +/* Include the new script for printing quotations in Portrait + */ + + +AddColumn('tag', 'pcexpenses', 'TINYINT( 4 )', 'not null', 0, 'glaccount', $db); + +UpdateDBNo(100, $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-10-17 11:27:13
|
Revision: 8288 http://weberp.svn.sourceforge.net/weberp/?rev=8288&view=rev Author: tim_schofield Date: 2011-10-17 11:27:03 +0000 (Mon, 17 Oct 2011) Log Message: ----------- Correction to field name Modified Paths: -------------- trunk/InternalStockRequest.php trunk/InternalStockRequestAuthorisation.php Modified: trunk/InternalStockRequest.php =================================================================== --- trunk/InternalStockRequest.php 2011-10-17 11:26:49 UTC (rev 8287) +++ trunk/InternalStockRequest.php 2011-10-17 11:27:03 UTC (rev 8288) @@ -90,7 +90,7 @@ foreach ($_SESSION['Request']->LineItems as $LineItems) { $LineSQL="INSERT INTO stockrequestitems (dispatchitemsid, dispatchid, - itemid, + stockid, quantity, decimalplaces, uom) Modified: trunk/InternalStockRequestAuthorisation.php =================================================================== --- trunk/InternalStockRequestAuthorisation.php 2011-10-17 11:26:49 UTC (rev 8287) +++ trunk/InternalStockRequestAuthorisation.php 2011-10-17 11:27:03 UTC (rev 8288) @@ -70,7 +70,7 @@ echo '<td><input type="checkbox" name="status'.$myrow['dispatchid'].'" /></td>'; echo '</tr>'; $linesql="SELECT stockrequestitems.dispatchitemsid, - stockrequestitems.itemid, + stockrequestitems.stockid, stockrequestitems.decimalplaces, stockrequestitems.uom, stockmaster.description, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-10-23 09:13:13
|
Revision: 8293 http://weberp.svn.sourceforge.net/weberp/?rev=8293&view=rev Author: tim_schofield Date: 2011-10-23 09:13:07 +0000 (Sun, 23 Oct 2011) Log Message: ----------- Additional database changes needed to fulfill internal stock requests Modified Paths: -------------- trunk/includes/session.inc Added Paths: ----------- trunk/sql/mysql/updates/101.php Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2011-10-23 06:07:47 UTC (rev 8292) +++ trunk/includes/session.inc 2011-10-23 09:13:07 UTC (rev 8293) @@ -13,7 +13,7 @@ header('Location:' . $rootpath . '/install/index.php'); } include($PathPrefix . 'config.php'); -$DBVersion=100; +$DBVersion=101; if (isset($SessionSavePath)){ session_save_path($SessionSavePath); } Added: trunk/sql/mysql/updates/101.php =================================================================== --- trunk/sql/mysql/updates/101.php (rev 0) +++ trunk/sql/mysql/updates/101.php 2011-10-23 09:13:07 UTC (rev 8293) @@ -0,0 +1,15 @@ +<?php + +/* Include the new script for printing quotations in Portrait + */ + + +AddColumn('completed', 'stockrequestitems', 'TINYINT( 4 )', 'not null', 0, 'uom', $db); +AddColumn('closed', 'stockrequest', 'TINYINT( 4 )', 'not null', 0, 'authorised', $db); +AddColumn('qtydelivered', 'stockrequestitems', 'INT( 11 )', 'not null', 0, 'quantity', $db); + +InsertRecord('pagesecurity', array('script', 'security'), array('InternalStockRequestFulfill.php',1), array('script', 'security'), array('InternalStockRequestFulfill.php',1), $db); + +UpdateDBNo(101, $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-10-28 10:43:03
|
Revision: 8300 http://weberp.svn.sourceforge.net/weberp/?rev=8300&view=rev Author: tim_schofield Date: 2011-10-28 10:42:57 +0000 (Fri, 28 Oct 2011) Log Message: ----------- Show numbers in correct formatting for the users locale Modified Paths: -------------- trunk/ContractBOM.php trunk/ContractOtherReqts.php trunk/Contracts.php trunk/includes/DefineContractClass.php Modified: trunk/ContractBOM.php =================================================================== --- trunk/ContractBOM.php 2011-10-28 10:40:35 UTC (rev 8299) +++ trunk/ContractBOM.php 2011-10-28 10:42:57 UTC (rev 8300) @@ -28,7 +28,7 @@ //this is the same as deleting the line - so delete it $_SESSION['Contract'.$identifier]->Remove_ContractComponent($ContractComponent->ComponentID); } else { - $_SESSION['Contract'.$identifier]->ContractBOM[$ContractComponent->ComponentID]->Quantity=$_POST['Qty'.$ContractComponent->ComponentID]; + $_SESSION['Contract'.$identifier]->ContractBOM[$ContractComponent->ComponentID]->Quantity=filter_number_input($_POST['Qty'.$ContractComponent->ComponentID]); } } // end loop around the items on the contract BOM } // end if the contract is not currently committed to by the customer @@ -167,9 +167,10 @@ if (isset($_POST['NewItem'])){ /* NewItem is set from the part selection list as the part code selected */ /* take the form entries and enter the data from the form into the PurchOrder class variable */ foreach ($_POST as $key => $value) { - if (mb_substr($key, 0, 3)=='qty') { - $ItemCode=mb_substr($key, 3, mb_strlen($key)-3); - $Quantity=$value; + if (mb_substr($key, 0, 7)=='StockID') { + $Index=mb_substr($key, 7); + $ItemCode=$value; + $Quantity=filter_number_input($_POST['qty'.$Index]); $AlreadyOnThisBOM = 0; if (count($_SESSION['Contract'.$identifier]->ContractBOM)!=0){ @@ -203,7 +204,7 @@ $_SESSION['Contract'.$identifier]->Add_To_ContractBOM ($ItemCode, $myrow['description'], - $DefaultWorkCentre, + $_SESSION['Contract'.$identifier]->DefaultWorkCentre, $Quantity, /* Qty */ $myrow['unitcost'], $myrow['units']); @@ -251,7 +252,7 @@ $LineTotal = $ContractComponent->Quantity * $ContractComponent->ItemCost; - $DisplayLineTotal = number_format($LineTotal,2); + $DisplayLineTotal = locale_money_format($LineTotal,$_SESSION['Contract'.$identifier]->CurrCode); if ($k==1){ echo '<tr class="EvenTableRows">'; @@ -263,15 +264,15 @@ echo '<td>' . $ContractComponent->StockID . '</td> <td>' . $ContractComponent->ItemDescription . '</td> - <td><input type="text" class="number" name="Qty' . $ContractComponent->ComponentID . '" size="11" value="' . $ContractComponent->Quantity . '" /></td> + <td><input type="text" class="number" name="Qty' . $ContractComponent->ComponentID . '" size="11" value="' . locale_number_format($ContractComponent->Quantity, $ContractComponent->DecimalPlaces) . '" /></td> <td>' . $ContractComponent->UOM . '</td> - <td class="number">' . $ContractComponent->ItemCost . '</td> + <td class="number">' . locale_number_format($ContractComponent->ItemCost,4) . '</td> <td class="number">' . $DisplayLineTotal . '</td> <td><a href="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier. '&Delete=' . $ContractComponent->ComponentID . '">' . _('Delete') . '</a></td></tr>'; $TotalCost += $LineTotal; } - $DisplayTotal = number_format($TotalCost,2); + $DisplayTotal = locale_money_format($TotalCost,$_SESSION['Contract'.$identifier]->CurrCode); echo '<tr><td colspan="6" class="number">' . _('Total Cost') . '</td><td class="number"><b>' . $DisplayTotal . '</b></td></tr></table>'; echo '<br /><div class="centre"><input type="submit" name="UpdateLines" value="' . _('Update Lines') . '" />'; echo '<input type="submit" name="BackToHeader" value="' . _('Back To Contract Header') . '" /></div>'; @@ -345,7 +346,7 @@ </tr>'; echo $TableHeader; - $j = 1; + $Index = 1; $k=0; //row colour counter while ($myrow=DB_fetch_array($SearchResult)) { @@ -369,13 +370,15 @@ <td>'.$myrow['description'].'</td> <td>'.$myrow['units'] . '</td> <td>'.$ImageSource.'</td> - <td><input class="number" type="text" size="6" value="0" name="qty'.$myrow['stockid'].'" /></td> + <td><input class="number" type="text" size="6" value="0" name="qty'.$Index.'" /></td> + <td><input type="hidden" value="'.$myrow['stockid'].'" name="StockID'.$Index.'" /></td> </tr>'; $PartsDisplayed++; if ($PartsDisplayed == $Maximum_Number_Of_Parts_To_Show){ break; } + $Index++; #end of page full new headings if } #end of while loop @@ -390,8 +393,6 @@ echo '<br /><div class="centre"><input type="submit" name="NewItem" value="' . _('Add to Contract Bill Of Material') .'" /></div>'; }#end if SearchResults to show -echo '<hr />'; - echo '</form>'; include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/ContractOtherReqts.php =================================================================== --- trunk/ContractOtherReqts.php 2011-10-28 10:40:35 UTC (rev 8299) +++ trunk/ContractOtherReqts.php 2011-10-28 10:42:57 UTC (rev 8300) @@ -28,8 +28,8 @@ //this is the same as deleting the line - so delete it $_SESSION['Contract'.$identifier]->Remove_ContractRequirement($ContractComponentID); } else { - $_SESSION['Contract'.$identifier]->ContractReqts[$ContractComponentID]->Quantity=$_POST['Qty'.$ContractComponentID]; - $_SESSION['Contract'.$identifier]->ContractReqts[$ContractComponentID]->CostPerUnit=$_POST['CostPerUnit'.$ContractComponentID]; + $_SESSION['Contract'.$identifier]->ContractReqts[$ContractComponentID]->Quantity=filter_number_input($_POST['Qty'.$ContractComponentID]); + $_SESSION['Contract'.$identifier]->ContractReqts[$ContractComponentID]->CostPerUnit=filter_currency_input($_POST['CostPerUnit'.$ContractComponentID]); $_SESSION['Contract'.$identifier]->ContractReqts[$ContractComponentID]->Requirement=$_POST['Requirement'.$ContractComponentID]; } } // end loop around the items on the contract requirements array @@ -55,18 +55,18 @@ } if (isset($_POST['EnterNewRequirement'])){ $InputError = false; - if (!is_numeric($_POST['Quantity'])){ + if (!is_numeric(filter_number_input($_POST['Quantity']))){ prnMsg(_('The quantity of the new requirement is expected to be numeric'),'error'); $InputError = true; } - if (!is_numeric($_POST['CostPerUnit'])){ + if (!is_numeric(filter_currency_input($_POST['CostPerUnit']))){ prnMsg(_('The cost per unit of the new requirement is expected to be numeric'),'error'); $InputError = true; } if (!$InputError){ $_SESSION['Contract'.$identifier]->Add_To_ContractRequirements ($_POST['RequirementDescription'], - $_POST['Quantity'], - $_POST['CostPerUnit']); + filter_number_input($_POST['Quantity']), + filter_currency_input($_POST['CostPerUnit'])); unset($_POST['RequirementDescription']); unset($_POST['Quantity']); unset($_POST['CostPerUnit']); @@ -102,7 +102,7 @@ $LineTotal = $ContractComponent->Quantity * $ContractComponent->CostPerUnit; - $DisplayLineTotal = number_format($LineTotal,2); + $DisplayLineTotal = locale_money_format($LineTotal,$_SESSION['Contract'.$identifier]->CurrCode); if ($k==1){ echo '<tr class="EvenTableRows">'; @@ -113,14 +113,14 @@ } echo '<td><textarea name="Requirement' . $ContractReqtID . '" cols="30" rows="3">' . $ContractComponent->Requirement . '</textarea></td> - <td><input type="text" class="number" name="Qty' . $ContractReqtID . '" size="11" value="' . $ContractComponent->Quantity . '" /></td> - <td><input type="text" class="number" name="CostPerUnit' . $ContractReqtID . '" size="11" value="' . $ContractComponent->CostPerUnit . '" /></td> + <td><input type="text" class="number" name="Qty' . $ContractReqtID . '" size="11" value="' . locale_number_format($ContractComponent->Quantity,2) . '" /></td> + <td><input type="text" class="number" name="CostPerUnit' . $ContractReqtID . '" size="11" value="' . locale_money_format($ContractComponent->CostPerUnit,$_SESSION['Contract'.$identifier]->CurrCode) . '" /></td> <td class="number">' . $DisplayLineTotal . '</td> <td><a href="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier. '&Delete=' . $ContractReqtID . '">' . _('Delete') . '</a></td></tr>'; $TotalCost += $LineTotal; } - $DisplayTotal = number_format($TotalCost,2); + $DisplayTotal = locale_money_format($TotalCost,$_SESSION['Contract'.$identifier]->CurrCode); echo '<tr><td colspan="4" class="number">' . _('Total Other Requirements Cost') . '</td><td class="number"><b>' . $DisplayTotal . '</b></td></tr></table>'; echo '<br /><div class="centre"><input type="submit" name="UpdateLines" value="' . _('Update Other Requirements Lines') . '" />'; echo ' <input type="submit" name="BackToHeader" value="' . _('Back To Contract Header') . '" /></div>'; Modified: trunk/Contracts.php =================================================================== --- trunk/Contracts.php 2011-10-28 10:40:35 UTC (rev 8299) +++ trunk/Contracts.php 2011-10-28 10:42:57 UTC (rev 8300) @@ -67,9 +67,10 @@ $_SESSION['Contract'.$identifier]->CategoryID = $_POST['CategoryID']; $_SESSION['Contract'.$identifier]->LocCode = $_POST['LocCode']; $_SESSION['Contract'.$identifier]->RequiredDate = $_POST['RequiredDate']; - $_SESSION['Contract'.$identifier]->Margin = $_POST['Margin']; + $_SESSION['Contract'.$identifier]->Margin = filter_number_input($_POST['Margin']); $_SESSION['Contract'.$identifier]->CustomerRef = $_POST['CustomerRef']; - $_SESSION['Contract'.$identifier]->ExRate = $_POST['ExRate']; + $_SESSION['Contract'.$identifier]->ExRate = filter_number_input($_POST['ExRate']); + $_SESSION['Contract'.$identifier]->DefaultWorkCentre = $_POST['DefaultWorkCentre']; /*User hit the button to enter line items - @@ -258,10 +259,10 @@ $_SESSION['Contract'.$identifier]->CategoryID = $_POST['CategoryID']; $_SESSION['Contract'.$identifier]->LocCode = $_POST['LocCode']; $_SESSION['Contract'.$identifier]->RequiredDate = $_POST['RequiredDate']; - $_SESSION['Contract'.$identifier]->Margin = $_POST['Margin']; + $_SESSION['Contract'.$identifier]->Margin = filter_number_input($_POST['Margin']); $_SESSION['Contract'.$identifier]->Status = $_POST['Status']; $_SESSION['Contract'.$identifier]->CustomerRef = $_POST['CustomerRef']; - $_SESSION['Contract'.$identifier]->ExRate = $_POST['ExRate']; + $_SESSION['Contract'.$identifier]->ExRate = filter_number_input($_POST['ExRate']); /*Get the first work centre for the users location - until we set this up properly */ $result = DB_query("SELECT code FROM workcentres WHERE location='" . $_SESSION['Contract'.$identifier]->LocCode ."'",$db); @@ -793,7 +794,7 @@ } else { echo '<td></td>'; } - echo '<td><input tabindex="'.number_format($j+5).'" type="submit" name="Submit'.$j.'" value="'.htmlentities($myrow['brname'], ENT_QUOTES,'UTF-8').'" /></td> + echo '<td><input 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'], ENT_QUOTES,'UTF-8').'</td> @@ -872,7 +873,30 @@ } echo '</select></td></tr>'; + echo '<tr><td>' . _('Default Work Centre') . ': </td><td>'; + echo '<select name="DefaultWorkCentre">'; + $sql = "SELECT code, description FROM workcentres"; + $result = DB_query($sql,$db); + + if (DB_num_rows($result)==0){ + prnMsg( _('There are no work centres set up yet') . '. ' . _('Please use the link below to set up work centres'),'warn'); + echo '<br /><a href="'.$rootpath.'/WorkCentres.php">' . _('Work Centre Maintenance') . '</a>'; + include('includes/footer.inc'); + exit; + } + + while ($myrow = DB_fetch_array($result)) { + if (isset($_POST['DefaultWorkCentre']) and $myrow['code']==$_POST['DefaultWorkCentre']) { + echo '<option selected="True" value="'.$myrow['code'] . '">' . $myrow['description'] . '</option>'; + } else { + echo '<option value="'.$myrow['code'] . '">' . $myrow['description'] . '</option>'; + } + } //end while loop + + DB_free_result($result); + + echo '</select></td></tr>'; echo '<tr><td>' . _('Contract Description'); echo ':</td><td><textarea name="ContractDescription" style="width:100%" rows="5">' . $_SESSION['Contract'.$identifier]->ContractDescription . '</textarea></td></tr>'; @@ -888,11 +912,11 @@ if (!isset($_SESSION['Contract'.$identifier]->Margin)){ $_SESSION['Contract'.$identifier]->Margin =50; } - echo '<tr><td>' . _('Gross Profit') . ' %:</td><td><input type="text" name="Margin" size="4" maxlength="4" value="' . $_SESSION['Contract'.$identifier]->Margin . '" /></td></tr>'; + echo '<tr><td>' . _('Gross Profit') . ' %:</td><td><input class="number" type="text" name="Margin" size="6" maxlength="6" value="' . locale_number_format($_SESSION['Contract'.$identifier]->Margin, 2) . '" /></td></tr>'; if ($_SESSION['CompanyRecord']['currencydefault'] != $_SESSION['Contract'.$identifier]->CurrCode){ echo '<tr><td>' . $_SESSION['Contract'.$identifier]->CurrCode . ' ' . _('Exchange Rate') . ':</td> - <td><input type="text" name="ExRate" size="10" maxlength="10" value="' . $_SESSION['Contract'.$identifier]->ExRate . '" /></td></tr>'; + <td><input class="number" type="text" name="ExRate" size="10" maxlength="10" value="' . locale_number_format($_SESSION['Contract'.$identifier]->ExRate, 4) . '" /></td></tr>'; } else { echo '<input type="hidden" name="ExRate" value="' . $_SESSION['Contract'.$identifier]->ExRate . '" />'; } @@ -933,14 +957,14 @@ foreach ($_SESSION['Contract'.$identifier]->ContractBOM as $Component) { echo '<tr><td>' . $Component->StockID . '</td> <td>' . $Component->ItemDescription . '</td> - <td class="number">' . $Component->Quantity . '</td> + <td class="number">' . locale_number_format($Component->Quantity, $Component->DecimalPlaces) . '</td> <td>' . $Component->UOM . '</td> - <td class="number">' . number_format($Component->ItemCost,2) . '</td> - <td class="number">' . number_format(($Component->ItemCost * $Component->Quantity),2) . '</td> + <td class="number">' . locale_money_format($Component->ItemCost,$_SESSION['Contract'.$identifier]->CurrCode) . '</td> + <td class="number">' . locale_money_format(($Component->ItemCost * $Component->Quantity),$_SESSION['Contract'.$identifier]->CurrCode) . '</td> </tr>'; $ContractBOMCost += ($Component->ItemCost * $Component->Quantity); } - echo '<tr><th colspan="5"><b>' . _('Total stock cost') . '</b></th><th class="number"><b>' . number_format($ContractBOMCost,2) . '</b></th></tr>'; + echo '<tr><th colspan="5"><b>' . _('Total stock cost') . '</b></th><th class="number"><b>' . locale_money_format($ContractBOMCost,$_SESSION['Contract'.$identifier]->CurrCode) . '</b></th></tr>'; } else { //there are no items set up against this contract echo '<tr><td colspan="6"><i>' . _('None Entered') . '</i></td></tr>'; } @@ -955,19 +979,19 @@ <th>' . _('Total Cost') . '</th></tr>'; foreach ($_SESSION['Contract'.$identifier]->ContractReqts as $Requirement) { echo '<tr><td>' . $Requirement->Requirement . '</td> - <td class="number">' . $Requirement->Quantity . '</td> - <td class="number">' . $Requirement->CostPerUnit . '</td> - <td class="number">' . number_format(($Requirement->CostPerUnit * $Requirement->Quantity),2) . '</td> + <td class="number">' . locale_number_format($Requirement->Quantity,2) . '</td> + <td class="number">' . locale_money_format($Requirement->CostPerUnit, $_SESSION['Contract'.$identifier]->CurrCode) . '</td> + <td class="number">' . locale_money_format(($Requirement->CostPerUnit * $Requirement->Quantity),$_SESSION['Contract'.$identifier]->CurrCode) . '</td> </tr>'; $ContractReqtsCost += ($Requirement->CostPerUnit * $Requirement->Quantity); } - echo '<tr><th colspan="3"><b>' . _('Total other costs') . '</b></th><th class="number"><b>' . number_format($ContractReqtsCost,2) . '</b></th></tr>'; + echo '<tr><th colspan="3"><b>' . _('Total other costs') . '</b></th><th class="number"><b>' . locale_money_format($ContractReqtsCost,$_SESSION['Contract'.$identifier]->CurrCode) . '</b></th></tr>'; } else { //there are no items set up against this contract echo '<tr><td colspan="4"><i>' . _('None Entered') . '</i></td></tr>'; } echo '</table></td></tr></table>'; echo '<br />'; - echo'<table class="selection"><tr><th>' . _('Total Contract Cost') . '</th><th class="number">' . number_format(($ContractBOMCost+$ContractReqtsCost),2) . '</th><th>' . _('Contract Price') . '</th><th class="number">' . number_format(($ContractBOMCost+$ContractReqtsCost)*((100+$_SESSION['Contract'.$identifier]->Margin)/100),2) . '</th></tr></table>'; + echo'<table class="selection"><tr><th>' . _('Total Contract Cost') . '</th><th class="number">' . locale_money_format(($ContractBOMCost+$ContractReqtsCost),$_SESSION['Contract'.$identifier]->CurrCode) . '</th><th>' . _('Contract Price') . '</th><th class="number">' . locale_money_format(($ContractBOMCost+$ContractReqtsCost)*((100+$_SESSION['Contract'.$identifier]->Margin)/100),$_SESSION['Contract'.$identifier]->CurrCode) . '</th></tr></table>'; echo'<p></p>'; echo '<div class="centre"><input type="submit" name="EnterContractBOM" value="' . _('Enter Items Required') . '" /> Modified: trunk/includes/DefineContractClass.php =================================================================== --- trunk/includes/DefineContractClass.php 2011-10-28 10:40:35 UTC (rev 8299) +++ trunk/includes/DefineContractClass.php 2011-10-28 10:42:57 UTC (rev 8300) @@ -24,6 +24,7 @@ var $ExRate; /*the rate of exchange between customer currency and company functional currency used when quoting */ var $BOMComponentCounter; var $RequirementsCounter; + var $DefaultWorkCentre; var $ContractBOM; /*array of stockid components required for the contract */ var $ContractReqts; /*array of other items required for the contract */ @@ -95,6 +96,7 @@ var $Quantity; var $ItemCost; var $UOM; + var $DecimalPlaces; function ContractComponent ($ComponentID, $StockID, @@ -104,6 +106,7 @@ $ItemCost, $UOM){ /* Constructor function to add a new Contract Component object with passed params */ + global $db; $this->ComponentID = $ComponentID; $this->StockID = $StockID; $this->ItemDescription = $ItemDescription; @@ -111,6 +114,11 @@ $this->Quantity = $Quantity; $this->ItemCost= $ItemCost; $this->UOM = $UOM; + + $SQL="SELECT decimalplaces FROM stockmaster WHERE stockid='".$StockID."'"; + $result=DB_query($SQL, $db); + $myrow=DB_fetch_array($result); + $this->DecimalPlaces=$myrow['decimalplaces']; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-11-07 07:57:39
|
Revision: 8317 http://weberp.svn.sourceforge.net/weberp/?rev=8317&view=rev Author: tim_schofield Date: 2011-11-07 07:57:32 +0000 (Mon, 07 Nov 2011) Log Message: ----------- Fix for apostrophe in item description Modified Paths: -------------- trunk/PO_Items.php trunk/includes/DefinePOClass.php Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2011-11-03 12:20:30 UTC (rev 8316) +++ trunk/PO_Items.php 2011-11-07 07:57:32 UTC (rev 8317) @@ -954,7 +954,7 @@ $Uom=$POLine->UOM; echo '<input type="hidden" name="ConversionFactor" value="'.$POLine->ConversionFactor.'" />'; echo '<td>' . $POLine->StockID . '</td> - <td>' . $POLine->ItemDescription . '</td> + <td>' . $POLine->GetItemDescription() . '</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="NetWeight' . $POLine->LineNo . '" size="11" value="' . locale_number_format($POLine->NetWeight,4) . '" /></td> Modified: trunk/includes/DefinePOClass.php =================================================================== --- trunk/includes/DefinePOClass.php 2011-11-03 12:20:30 UTC (rev 8316) +++ trunk/includes/DefinePOClass.php 2011-11-07 07:57:32 UTC (rev 8317) @@ -292,7 +292,7 @@ $this->Controlled = $Controlled; $this->Serialised = $Serialised; $this->DecimalPlaces=$DecimalPlaces; - $this->ItemDescription = $ItemDescr; + $this->ItemDescription = DB_escape_string($ItemDescr); $this->Quantity = $Qty; $this->ReqDelDate = $ReqDelDate; $this->Price = $Price; @@ -327,5 +327,9 @@ $this->SerialItemsValid=false; $this->AssetID= $AssetID; } + + function GetItemDescription() { + return stripslashes($this->ItemDescription); + } } ?> \ 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-11-20 16:30:29
|
Revision: 8327 http://weberp.svn.sourceforge.net/weberp/?rev=8327&view=rev Author: tim_schofield Date: 2011-11-20 16:30:22 +0000 (Sun, 20 Nov 2011) Log Message: ----------- James Murray: Link to picture of part on the goods received page Modified Paths: -------------- trunk/GoodsReceived.php Removed Paths: ------------- trunk/companies/weberpdemo/part_pics/PHIS01.jpg Modified: trunk/GoodsReceived.php =================================================================== --- trunk/GoodsReceived.php 2011-11-20 14:32:23 UTC (rev 8326) +++ trunk/GoodsReceived.php 2011-11-20 16:30:22 UTC (rev 8327) @@ -157,8 +157,13 @@ } //Now Display LineItem - echo '<td>' . $LnItm->StockID . '</td>'; - echo '<td>' . $LnItm->ItemDescription . '</td>'; + if (file_exists($_SESSION['part_pics_dir'] . '/' . $LnItm->StockID . '.jpg')) { + echo '<td><a href="' . $rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $LnItm->StockID . '.jpg" target="_blank">'. $LnItm->StockID . '</a><br /></td>'; + } else { + echo '<td>'. $LnItm->StockID . '</td>'; + } + + echo '<td>' . stripslashes($LnItm->ItemDescription) . '</td>'; echo '<td class="number">' . $DisplayQtyOrd . '</td>'; echo '<td>' . $LnItm->SuppUOM . '</td>'; echo '<td class="number">' . $DisplayQtyRec . '</td>'; Deleted: trunk/companies/weberpdemo/part_pics/PHIS01.jpg =================================================================== --- trunk/companies/weberpdemo/part_pics/PHIS01.jpg 2011-11-20 14:32:23 UTC (rev 8326) +++ trunk/companies/weberpdemo/part_pics/PHIS01.jpg 2011-11-20 16:30:22 UTC (rev 8327) @@ -1,8 +0,0 @@ -\xFF\xD8\xFF\xE0 |
From: <tim...@us...> - 2011-11-25 16:24:07
|
Revision: 8338 http://weberp.svn.sourceforge.net/weberp/?rev=8338&view=rev Author: tim_schofield Date: 2011-11-25 16:24:01 +0000 (Fri, 25 Nov 2011) Log Message: ----------- Correct gettext() functions Modified Paths: -------------- trunk/PDFRemittanceAdvice.php trunk/css/aguapop/default.css Modified: trunk/PDFRemittanceAdvice.php =================================================================== --- trunk/PDFRemittanceAdvice.php 2011-11-25 14:06:42 UTC (rev 8337) +++ trunk/PDFRemittanceAdvice.php 2011-11-25 16:24:01 UTC (rev 8338) @@ -44,7 +44,7 @@ include('includes/PDFStarter.php'); $pdf->addInfo('Title',_('Remmitance Advice')); - $pdf->addInfo('Subject',_('Remittance Advice') . ' - ' . _('suppliers from') . ' ' . $_POST['FromCriteria'] . ' to ' . $_POST['ToCriteria'] . ' ' . _('and Paid On') . ' ' . $_POST['PaymentDate']); + $pdf->addInfo('Subject',_('Remittance Advice') . ' - ' . _('suppliers from') . ' ' . $_POST['FromCriteria'] . ' ' . _('to') . ' ' . $_POST['ToCriteria'] . ' ' . _('and Paid On') . ' ' . $_POST['PaymentDate']); $line_height=12; Modified: trunk/css/aguapop/default.css =================================================================== --- trunk/css/aguapop/default.css 2011-11-25 14:06:42 UTC (rev 8337) +++ trunk/css/aguapop/default.css 2011-11-25 16:24:01 UTC (rev 8338) @@ -29,8 +29,8 @@ padding: 36px 0px 0px 0px;/*fred: limiting the body will keep the elements from wandering on full page views and distorting the looks. It should still work on netbooks with 1024x600 resolution.*/ font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 9px; - - + + } img { @@ -204,7 +204,7 @@ font.header_title { font-size: 14px; font-weight: bold; - + } #topMenu { @@ -460,11 +460,11 @@ } .main_menu_selected a{ - + } .main_menu_selected a:hover{ - + } span.main_menu_nolink { @@ -621,7 +621,7 @@ #footer { background: url(images/footer.png) bottom no-repeat; - width: 99%; + width: 960px; margin-left: 0px; padding-bottom: 13px; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-11-27 12:11:21
|
Revision: 8358 http://weberp.svn.sourceforge.net/weberp/?rev=8358&view=rev Author: tim_schofield Date: 2011-11-27 12:11:15 +0000 (Sun, 27 Nov 2011) Log Message: ----------- New Top sellers inquiry script Modified Paths: -------------- trunk/includes/session.inc trunk/index.php Added Paths: ----------- trunk/SalesTopItemsInquiry.php trunk/sql/mysql/updates/102.php Added: trunk/SalesTopItemsInquiry.php =================================================================== --- trunk/SalesTopItemsInquiry.php (rev 0) +++ trunk/SalesTopItemsInquiry.php 2011-11-27 12:11:15 UTC (rev 8358) @@ -0,0 +1,276 @@ +<?php + +/* $Id: SalesTopItemsInquiry.php 4261 2010-12-22 15:56:50Z $*/ + +include('includes/session.inc'); +$title = _('Top Sales Inquiry'); +include('includes/header.inc'); +include('includes/DefineCartClass.php'); + +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Sales Inquiry') . '" alt="" />' . ' ' . _('Top Sales Items Inquiry') . '</p>'; +echo '<div class="page_help_text">' . _('Select the parameters for the report') . '</div><br />'; + +if (!isset($_POST['DateRange'])){ + /* then assume report is for This Month - maybe wrong to do this but hey better than reporting an error?*/ + $_POST['DateRange']='ThisMonth'; +} + +echo '<form name="form1" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">'; +echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + +echo '<table cellpadding="2" class="selection"> + <tr><td valign="top"> + <table>'; + +echo '<tr> + <th colspan="2" class="centre">' . _('Date Selection') . '</th> + </tr> + <tr> + <td>' . _('Custom Range') . ':</td> + <td><input type="radio" name="DateRange" value="Custom" '; +if ($_POST['DateRange']=='Custom'){ + echo 'checked'; +} +echo ' onChange="ReloadForm(form1.ShowSales)" /></td> + </tr> + <tr> + <td>' . _('This Week') . ':</td> + <td><input type="radio" name="DateRange" value="ThisWeek" '; +if ($_POST['DateRange']=='ThisWeek'){ + echo 'checked'; +} +echo ' onChange="ReloadForm(form1.ShowSales)" /></td> + </tr> + <tr> + <td>' . _('This Month') . ':</td> + <td><input type="radio" name="DateRange" value="ThisMonth" '; +if ($_POST['DateRange']=='ThisMonth'){ + echo 'checked'; +} +echo ' onChange="ReloadForm(form1.ShowSales)" /></td> + </tr> + <tr> + <td>' . _('This Quarter') . ':</td> + <td><input type="radio" name="DateRange" value="ThisQuarter" '; +if ($_POST['DateRange']=='ThisQuarter'){ + echo 'checked'; +} +echo ' onChange="ReloadForm(form1.ShowSales)" /></td> + </tr>'; +if ($_POST['DateRange']=='Custom'){ + if (!isset($_POST['FromDate'])){ + unset($_POST['ShowSales']); + $_POST['FromDate'] = Date($_SESSION['DefaultDateFormat'],mktime(1,1,1,Date('m')-12,Date('d')+1,Date('Y'))); + $_POST['ToDate'] = Date($_SESSION['DefaultDateFormat']); + } + echo '<tr> + <td>' . _('Date From') . ':</td> + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="FromDate" maxlength="10" size="11" value="' . $_POST['FromDate'] . '" /></td> + </tr>'; + echo '<tr> + <td>' . _('Date To') . ':</td> + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="ToDate" maxlength="10" size="11" value="' . $_POST['ToDate'] . '" /></td> + </tr>'; +} +echo '</table></td> + <td valign=top> + <table>'; //new sub table to set parameters for order of display + + +if (!isset($_POST['OrderBy'])){ //default to order by net sales + $_POST['OrderBy']='NetSales'; +} +echo '<tr><th colspan="2" class="centre">' . _('Display') . '</th> + </tr> + <tr> + <td>' . _('Order By Net Sales') . ':</td> + <td><input type="radio" name="OrderBy" value="NetSales" '; +if ($_POST['OrderBy']=='NetSales'){ + echo 'checked'; +} +echo ' /></td> + </tr> + <tr> + <td>' . _('Order By Quantity') . ':</td> + <td><input type="radio" name="OrderBy" value="Quantity" '; +if ($_POST['OrderBy']=='Quantity'){ + echo 'checked'; +} +if (!isset($_POST['NoToDisplay'])){ + $_POST['NoToDisplay']=20; +} +echo ' /></td> + </tr> + <tr> + <td>' . _('Number to Display') . ':</td> + <td><input type="text class="number" name="NoToDisplay" size="4" maxlength="4" value="' . $_POST['NoToDisplay'] .'" ></td> + </tr> + </table> + </td></tr> + </table>'; + + +echo '<br /><div class="centre"><input tabindex=4 type=submit name="ShowSales" value="' . _('Show Sales') . '">'; +echo '</form></div>'; +echo '<br />'; + +if (isset($_POST['ShowSales'])){ + $InputError=0; //assume no input errors now test for errors + if ($_POST['DateRange']=='Custom'){ + if (!Is_Date($_POST['FromDate'])){ + $InputError = 1; + prnMsg(_('The date entered for the from date is not in the appropriate format. Dates must be entered in the format') . ' ' . $_SESSION['DefaultDateFormat'], 'error'); + } + if (!Is_Date($_POST['ToDate'])){ + $InputError = 1; + prnMsg(_('The date entered for the to date is not in the appropriate format. Dates must be entered in the format') . ' ' . $_SESSION['DefaultDateFormat'], 'error'); + } + if (Date1GreaterThanDate2($_POST['FromDate'],$_POST['ToDate'])){ + $InputError = 1; + prnMsg(_('The from date is expected to be a date prior to the to date. Please review the selected date range'),'error'); + } + } + switch ($_POST['DateRange']) { + case 'ThisWeek': + $FromDate = date('Y-m-d',mktime(0,0,0,date('m'),date('d')-date('w')+1,date('Y'))); + $ToDate = date('Y-m-d'); + break; + case 'ThisMonth': + $FromDate = date('Y-m-d',mktime(0,0,0,date('m'),1,date('Y'))); + $ToDate = date('Y-m-d'); + break; + case 'ThisQuarter': + switch (date('m')) { + case 1: + case 2: + case 3: + $QuarterStartMonth=1; + break; + case 4: + case 5: + case 6: + $QuarterStartMonth=4; + break; + case 7: + case 8: + case 9: + $QuarterStartMonth=7; + break; + default: + $QuarterStartMonth=10; + } + $FromDate = date('Y-m-d',mktime(0,0,0,$QuarterStartMonth,1,date('Y'))); + $ToDate = date('Y-m-d'); + break; + case 'Custom': + $FromDate = FormatDateForSQL($_POST['FromDate']); + $ToDate = FormatDateForSQL($_POST['ToDate']); + } + $sql = "SELECT stockmaster.stockid, + stockmaster.description, + stockcategory.categorydescription, + SUM(CASE WHEN stockmoves.type=10 + OR stockmoves.type=11 THEN + -qty + ELSE 0 END) as salesquantity, + SUM(CASE WHEN stockmoves.type=10 THEN + price*(1-discountpercent)* -qty + ELSE 0 END) as salesvalue, + SUM(CASE WHEN stockmoves.type=11 THEN + price*(1-discountpercent)* (-qty) + ELSE 0 END) as returnvalue, + SUM(CASE WHEN stockmoves.type=11 + OR stockmoves.type=10 THEN + price*(1-discountpercent)* (-qty) + ELSE 0 END) as netsalesvalue, + SUM((standardcost * -qty)) as cost + FROM stockmoves INNER JOIN stockmaster + ON stockmoves.stockid=stockmaster.stockid + INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE (stockmoves.type=10 or stockmoves.type=11) + AND show_on_inv_crds =1 + AND trandate>='" . $FromDate . "' + AND trandate<='" . $ToDate . "' + GROUP BY stockmaster.stockid, + stockmaster.description, + stockcategory.categorydescription "; + + if ($_POST['OrderBy']=='NetSales'){ + $sql .= " ORDER BY netsalesvalue DESC "; + } else { + $sql .= " ORDER BY salesquantity DESC "; + } + if (is_numeric($_POST['NoToDisplay'])){ + if ($_POST['NoToDisplay'] > 0){ + $sql .= " LIMIT " . $_POST['NoToDisplay']; + } + } + + $ErrMsg = _('The sales data could not be retrieved because') . ' - ' . DB_error_msg($db); + $SalesResult = DB_query($sql,$db,$ErrMsg); + + + echo '<table cellpadding=2 class="selection">'; + + echo'<tr> + <th>' . _('Rank') . '</th> + <th>' . _('Item') . '</th> + <th>' . _('Category') . '</th> + <th>' . _('Sales Value') . '</th> + <th>' . _('Refunds') . '</th> + <th>' . _('Net Sales') . '</th> + <th>' . _('Sales') .'<br />' . _('Quantity') . '</th> + </tr>'; + + $CumulativeTotalSales = 0; + $CumulativeTotalRefunds = 0; + $CumulativeTotalNetSales = 0; + $CumulativeTotalQuantity = 0; + $i=1; + $k=0; + while ($SalesRow=DB_fetch_array($SalesResult)) { + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k=1; + } + + echo '<td>' . $i . '</td> + <td>' . $SalesRow['stockid'] . ' - ' . $SalesRow['description'] . '</td> + <td>' . $SalesRow['categorydescription'] . '</td> + <td class="number">' . locale_number_format($SalesRow['salesvalue'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($SalesRow['returnvalue'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($SalesRow['netsalesvalue'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($SalesRow['salesquantity'],'Variable') . '</td> + </tr>'; + $i++; + + $CumulativeTotalSales += $SalesRow['salesvalue']; + $CumulativeTotalRefunds += $SalesRow['returnvalue']; + $CumulativeTotalNetSales += ($SalesRow['salesvalue']+$SalesRow['returnvalue']); + $CumulativeTotalQuantity += $SalesRow['salesquantity']; + + } //loop around category sales for the period + + if ($k==1){ + echo '<tr class="EvenTableRows"><td colspan="8"><hr></td></tr>'; + echo '<tr class="OddTableRows">'; + } else { + echo '<tr class="OddTableRows"><td colspan="8"><hr></td></tr>'; + echo '<tr class="EvenTableRows">'; + } + echo '<td class="number" colspan="3">' . _('GRAND Total') . '</td> + <td class="number">' . locale_number_format($CumulativeTotalSales,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($CumulativeTotalRefunds,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($CumulativeTotalNetSales,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($CumulativeTotalQuantity,'Variable') . '</td> + </tr>'; + + echo '</table>'; + +} //end of if user hit show sales +include('includes/footer.inc'); +?> \ No newline at end of file Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2011-11-27 12:11:00 UTC (rev 8357) +++ trunk/includes/session.inc 2011-11-27 12:11:15 UTC (rev 8358) @@ -13,7 +13,7 @@ header('Location:' . $rootpath . '/install/index.php'); } include($PathPrefix . 'config.php'); -$DBVersion=101; +$DBVersion=102; if (isset($SessionSavePath)){ session_save_path($SessionSavePath); } Modified: trunk/index.php =================================================================== --- trunk/index.php 2011-11-27 12:11:00 UTC (rev 8357) +++ trunk/index.php 2011-11-27 12:11:15 UTC (rev 8358) @@ -53,6 +53,7 @@ _('Order Status Report'), _('Orders Invoiced Reports'), _('Daily Sales Inquiry'), + _('Top Sellers Inquiry'), _('Order Delivery Differences Report'), _('Delivery In Full On Time (DIFOT) Report'), _('Sales Order Detail Or Summary Inquiries'), @@ -65,6 +66,7 @@ '/PDFOrderStatus.php', '/PDFOrdersInvoiced.php', '/DailySalesInquiry.php', + '/SalesTopItemsInquiry.php', '/PDFDeliveryDifferences.php', '/PDFDIFOT.php', '/SalesInquiry.php', Added: trunk/sql/mysql/updates/102.php =================================================================== --- trunk/sql/mysql/updates/102.php (rev 0) +++ trunk/sql/mysql/updates/102.php 2011-11-27 12:11:15 UTC (rev 8358) @@ -0,0 +1,10 @@ +<?php + +/* Include the new script for printing quotations in Portrait + */ + +InsertRecord('pagesecurity', array('script', 'security'), array('SalesTopItemsInquiry.php',1), array('script', 'security'), array('SalesTopItemsInquiry.php',1), $db); + +UpdateDBNo(102, $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-11-27 12:11:35
|
Revision: 8359 http://weberp.svn.sourceforge.net/weberp/?rev=8359&view=rev Author: tim_schofield Date: 2011-11-27 12:11:28 +0000 (Sun, 27 Nov 2011) Log Message: ----------- New sales inquiry by sales category script Modified Paths: -------------- trunk/includes/session.inc trunk/index.php Added Paths: ----------- trunk/SalesCategoryPeriodInquiry.php trunk/sql/mysql/updates/103.php Added: trunk/SalesCategoryPeriodInquiry.php =================================================================== --- trunk/SalesCategoryPeriodInquiry.php (rev 0) +++ trunk/SalesCategoryPeriodInquiry.php 2011-11-27 12:11:28 UTC (rev 8359) @@ -0,0 +1,220 @@ +<?php + +/* $Id: SalesCategoryPeriodInquiry.php 4261 2010-12-22 15:56:50Z $*/ + +include('includes/session.inc'); +$title = _('Sales Category Report'); +include('includes/header.inc'); +include('includes/DefineCartClass.php'); + +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Sales Report') . '" alt="" />' . ' ' . _('Sales Category Report') . '</p>'; +echo '<div class="page_help_text">' . _('Select the parameters for the report') . '</div><br />'; + +if (!isset($_POST['DateRange'])){ + /* then assume report is for This Month - maybe wrong to do this but hey better than reporting an error?*/ + $_POST['DateRange']='ThisMonth'; +} + +echo '<form name="form1" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">'; +echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + +echo '<table cellpadding=2 class="selection">'; + +echo '<tr><th colspan="2" class="centre">' . _('Date Selection') . '</th> + </tr> + <tr> + <td>' . _('Custom Range') . ':</td> + <td><input type="radio" name="DateRange" value="Custom" '; +if ($_POST['DateRange']=='Custom'){ + echo 'checked'; +} +echo ' onChange="ReloadForm(form1.ShowSales)" /></td> + </tr> + <tr> + <td>' . _('This Week') . ':</td> + <td><input type="radio" name="DateRange" value="ThisWeek" '; +if ($_POST['DateRange']=='ThisWeek'){ + echo 'checked'; +} +echo ' onChange="ReloadForm(form1.ShowSales)" /></td> + </tr> + <tr> + <td>' . _('This Month') . ':</td> + <td><input type="radio" name="DateRange" value="ThisMonth" '; +if ($_POST['DateRange']=='ThisMonth'){ + echo 'checked'; +} +echo ' onChange="ReloadForm(form1.ShowSales)" /></td> + </tr> + <tr> + <td>' . _('This Quarter') . ':</td> + <td><input type="radio" name="DateRange" value="ThisQuarter" '; +if ($_POST['DateRange']=='ThisQuarter'){ + echo 'checked'; +} +echo ' onChange="ReloadForm(form1.ShowSales)" /></td> + </tr>'; +if ($_POST['DateRange']=='Custom'){ + if (!isset($_POST['FromDate'])){ + unset($_POST['ShowSales']); + $_POST['FromDate'] = Date($_SESSION['DefaultDateFormat'],mktime(1,1,1,Date('m')-12,Date('d')+1,Date('Y'))); + $_POST['ToDate'] = Date($_SESSION['DefaultDateFormat']); + } + echo '<tr> + <td>' . _('Date From') . ':</td> + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="FromDate" maxlength="10" size="11" value="' . $_POST['FromDate'] . '" /></td> + </tr>'; + echo '<tr> + <td>' . _('Date To') . ':</td> + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="ToDate" maxlength="10" size="11" value="' . $_POST['ToDate'] . '" /></td> + </tr>'; +} +echo '</table>'; + + +echo '<br /><div class="centre"><input tabindex=4 type="submit" name="ShowSales" value="' . _('Show Sales') . '" />'; +echo '</form></div>'; +echo '<br />'; + + +if (isset($_POST['ShowSales'])){ + $InputError=0; //assume no input errors now test for errors + if ($_POST['DateRange']=='Custom'){ + if (!Is_Date($_POST['FromDate'])){ + $InputError = 1; + prnMsg(_('The date entered for the from date is not in the appropriate format. Dates must be entered in the format') . ' ' . $_SESSION['DefaultDateFormat'], 'error'); + } + if (!Is_Date($_POST['ToDate'])){ + $InputError = 1; + prnMsg(_('The date entered for the to date is not in the appropriate format. Dates must be entered in the format') . ' ' . $_SESSION['DefaultDateFormat'], 'error'); + } + if (Date1GreaterThanDate2($_POST['FromDate'],$_POST['ToDate'])){ + $InputError = 1; + prnMsg(_('The from date is expected to be a date prior to the to date. Please review the selected date range'),'error'); + } + } + switch ($_POST['DateRange']) { + case 'ThisWeek': + $FromDate = date('Y-m-d',mktime(0,0,0,date('m'),date('d')-date('w')+1,date('Y'))); + $ToDate = date('Y-m-d'); + break; + case 'ThisMonth': + $FromDate = date('Y-m-d',mktime(0,0,0,date('m'),1,date('Y'))); + $ToDate = date('Y-m-d'); + break; + case 'ThisQuarter': + switch (date('m')) { + case 1: + case 2: + case 3: + $QuarterStartMonth=1; + break; + case 4: + case 5: + case 6: + $QuarterStartMonth=4; + break; + case 7: + case 8: + case 9: + $QuarterStartMonth=7; + break; + default: + $QuarterStartMonth=10; + } + $FromDate = date('Y-m-d',mktime(0,0,0,$QuarterStartMonth,1,date('Y'))); + $ToDate = date('Y-m-d'); + break; + case 'Custom': + $FromDate = FormatDateForSQL($_POST['FromDate']); + $ToDate = FormatDateForSQL($_POST['ToDate']); + } + $sql = "SELECT stockmaster.categoryid, + stockcategory.categorydescription, + SUM(CASE WHEN stockmoves.type=10 THEN + price*(1-discountpercent)* -qty + ELSE 0 END) as salesvalue, + SUM(CASE WHEN stockmoves.type=11 THEN + price*(1-discountpercent)* (-qty) + ELSE 0 END) as returnvalue, + SUM(CASE WHEN stockmoves.type=11 + OR stockmoves.type=10 THEN + price*(1-discountpercent)* (-qty) + ELSE 0 END) as netsalesvalue, + SUM((standardcost * -qty)) as cost + FROM stockmoves INNER JOIN stockmaster + ON stockmoves.stockid=stockmaster.stockid + INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE (stockmoves.type=10 or stockmoves.type=11) + AND show_on_inv_crds =1 + AND trandate>='" . $FromDate . "' + AND trandate<='" . $ToDate . "' + GROUP BY stockmaster.categoryid + ORDER BY netsalesvalue DESC"; + + $ErrMsg = _('The sales data could not be retrieved because') . ' - ' . DB_error_msg($db); + $SalesResult = DB_query($sql,$db,$ErrMsg); + + echo '<table cellpadding=2 class="selection">'; + + echo'<tr> + <th>' . _('Category') . '</th> + <th>' . _('Total Sales') . '</th> + <th>' . _('Refunds') . '</th> + <th>' . _('Net Sales') . '</th> + <th>' . _('Cost of Sales') . '</th> + <th>' . _('Gross Profit') . '</th> + </tr>'; + + $CumulativeTotalSales = 0; + $CumulativeTotalRefunds = 0; + $CumulativeTotalNetSales = 0; + $CumulativeTotalCost = 0; + $CumulativeTotalGP = 0; + + $k=0; + while ($SalesRow=DB_fetch_array($SalesResult)) { + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k=1; + } + + echo '<td>' . $SalesRow['categoryid'] . ' - ' . $SalesRow['categorydescription'] . '</td> + <td class="number">' . locale_number_format($SalesRow['salesvalue'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($SalesRow['returnvalue'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($SalesRow['salesvalue']+$SalesRow['returnvalue'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($SalesRow['cost'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format(($SalesRow['salesvalue']+$SalesRow['returnvalue']-$SalesRow['cost']),$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + </tr>'; + + $CumulativeTotalSales += $SalesRow['salesvalue']; + $CumulativeTotalRefunds += $SalesRow['returnvalue']; + $CumulativeTotalNetSales += ($SalesRow['salesvalue']+$SalesRow['returnvalue']); + $CumulativeTotalCost += $SalesRow['cost']; + $CumulativeTotalGP += ($SalesRow['salesvalue']+$SalesRow['returnvalue']-$SalesRow['cost']); + } //loop around category sales for the period + + if ($k==1){ + echo '<tr class="EvenTableRows"><td colspan="8"><hr></td></tr>'; + echo '<tr class="OddTableRows">'; + } else { + echo '<tr class="OddTableRows"><td colspan="8"><hr></td></tr>'; + echo '<tr class="EvenTableRows">'; + } + echo '<td class="number">' . _('GRAND Total') . '</td> + <td class="number">' . locale_number_format($CumulativeTotalSales,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($CumulativeTotalRefunds,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($CumulativeTotalNetSales,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($CumulativeTotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($CumulativeTotalGP,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + </tr>'; + + echo '</table>'; + +} //end of if user hit show sales +include('includes/footer.inc'); +?> \ No newline at end of file Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2011-11-27 12:11:15 UTC (rev 8358) +++ trunk/includes/session.inc 2011-11-27 12:11:28 UTC (rev 8359) @@ -13,7 +13,7 @@ header('Location:' . $rootpath . '/install/index.php'); } include($PathPrefix . 'config.php'); -$DBVersion=102; +$DBVersion=103; if (isset($SessionSavePath)){ session_save_path($SessionSavePath); } Modified: trunk/index.php =================================================================== --- trunk/index.php 2011-11-27 12:11:15 UTC (rev 8358) +++ trunk/index.php 2011-11-27 12:11:28 UTC (rev 8359) @@ -53,6 +53,7 @@ _('Order Status Report'), _('Orders Invoiced Reports'), _('Daily Sales Inquiry'), + _('Sales By Category Inquiry'), _('Top Sellers Inquiry'), _('Order Delivery Differences Report'), _('Delivery In Full On Time (DIFOT) Report'), @@ -66,6 +67,7 @@ '/PDFOrderStatus.php', '/PDFOrdersInvoiced.php', '/DailySalesInquiry.php', + '/SalesCategoryPeriodInquiry.php', '/SalesTopItemsInquiry.php', '/PDFDeliveryDifferences.php', '/PDFDIFOT.php', Added: trunk/sql/mysql/updates/103.php =================================================================== --- trunk/sql/mysql/updates/103.php (rev 0) +++ trunk/sql/mysql/updates/103.php 2011-11-27 12:11:28 UTC (rev 8359) @@ -0,0 +1,10 @@ +<?php + +/* Include the new script for printing quotations in Portrait + */ + +InsertRecord('pagesecurity', array('script', 'security'), array('SalesCategoryPeriodInquiry.php',1), array('script', 'security'), array('SalesCategoryPeriodInquiry.php',1), $db); + +UpdateDBNo(103, $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-11-27 12:11:49
|
Revision: 8360 http://weberp.svn.sourceforge.net/weberp/?rev=8360&view=rev Author: tim_schofield Date: 2011-11-27 12:11:42 +0000 (Sun, 27 Nov 2011) Log Message: ----------- New sales inquiry by sales type script Modified Paths: -------------- trunk/includes/session.inc trunk/index.php Added Paths: ----------- trunk/SalesByTypePeriodInquiry.php trunk/sql/mysql/updates/104.php Added: trunk/SalesByTypePeriodInquiry.php =================================================================== --- trunk/SalesByTypePeriodInquiry.php (rev 0) +++ trunk/SalesByTypePeriodInquiry.php 2011-11-27 12:11:42 UTC (rev 8360) @@ -0,0 +1,567 @@ +<?php + +/* $Id: SalesByTypePeriodInquiry.php 4261 2010-12-22 15:56:50Z tim_schofield $*/ + +include('includes/session.inc'); +$title = _('Sales Report'); +include('includes/header.inc'); +include('includes/DefineCartClass.php'); + +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Sales Report') . '" alt="" />' . ' ' . _('Sales Report') . '</p>'; +echo '<div class="page_help_text">' . _('Select the parameters for the report') . '</div><br />'; + +if (!isset($_POST['DisplayData'])){ + /* then assume to display daily - maybe wrong to do this but hey better than reporting an error?*/ + $_POST['DisplayData']='Weekly'; +} +if (!isset($_POST['DateRange'])){ + /* then assume report is for This Month - maybe wrong to do this but hey better than reporting an error?*/ + $_POST['DateRange']='ThisMonth'; +} + +echo '<form name="Form1" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">'; +echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + +echo '<table cellpadding=2 class="selection"> + <tr><td valign=top> + <table>'; + +echo '<tr><th colspan="2" class="centre">' . _('Date Selection') . '</th> + </tr> + <tr> + <td>' . _('Custom Range') . ':</td> + <td><input type="radio" name="DateRange" value="Custom" '; +if ($_POST['DateRange']=='Custom'){ + echo 'checked'; +} +echo ' onChange="ReloadForm(Form1.ShowSales)"/></td> + </tr> + <tr> + <td>' . _('This Week') . ':</td> + <td><input type="radio" name="DateRange" value="ThisWeek" '; +if ($_POST['DateRange']=='ThisWeek'){ + echo 'checked'; +} +echo ' onChange="ReloadForm(Form1.ShowSales)" /></td> + </tr> + <tr> + <td>' . _('This Month') . ':</td> + <td><input type="radio" name="DateRange" value="ThisMonth" '; +if ($_POST['DateRange']=='ThisMonth'){ + echo 'checked'; +} +echo ' onChange="ReloadForm(Form1.ShowSales)" /></td> + </tr> + <tr> + <td>' . _('This Quarter') . ':</td> + <td><input type="radio" name="DateRange" value="ThisQuarter" '; +if ($_POST['DateRange']=='ThisQuarter'){ + echo 'checked'; +} +echo ' onChange="ReloadForm(Form1.ShowSales)" /></td> + </tr>'; +if ($_POST['DateRange']=='Custom'){ + if (!isset($_POST['ToDate'])){ + $_POST['FromDate'] = Date($_SESSION['DefaultDateFormat'],mktime(1,1,1,Date('m')-12,Date('d')+1,Date('Y'))); + $_POST['ToDate'] = Date($_SESSION['DefaultDateFormat']); + } + echo '<tr> + <td>' . _('Date From') . ':</td> + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="FromDate" maxlength="10" size="11" value="' . $_POST['FromDate'] . '" /></td> + </tr>'; + echo '<tr> + <td>' . _('Date To') . ':</td> + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="ToDate" maxlength="10" size="11" value="' . $_POST['ToDate'] . '" /></td> + </tr>'; +} +echo '</table> + </td><td valign="top"> + <table>'; + +echo '<tr><th colspan="2" class="centre">' . _('Display Data') . '</th> + </tr> + <tr> + <td>' . _('Daily') . ':</td> + <td><input type="radio" name="DisplayData" value="Daily" '; +if ($_POST['DisplayData']=='Daily'){ + echo 'checked'; +} +echo ' onChange="ReloadForm(Form1.ShowSales)" /></td> + </tr> + <tr> + <td>' . _('Weekly') . ':</td> + <td><input type="radio" name="DisplayData" value="Weekly" '; +if ($_POST['DisplayData']=='Weekly'){ + echo 'checked'; +} +echo ' onChange="ReloadForm(Form1.ShowSales)" /></td> + </tr> + <tr> + <td>' . _('Monthly') . ':</td> + <td><input type="radio" name="DisplayData" value="Monthly" '; +if ($_POST['DisplayData']=='Monthly'){ + echo 'checked'; +} +echo ' onChange="ReloadForm(Form1.ShowSales)" /></td> + </tr> + <tr> + <td>' . _('Quarterly') . ':</td> + <td><input type="radio" name="DisplayData" value="Quarterly" '; +if ($_POST['DisplayData']=='Quarterly'){ + echo 'checked'; +} +echo ' onChange="ReloadForm(Form1.ShowSales)" /></td> + </tr>'; +echo '</table> + </td></tr> + </table>'; + + +echo '<br /> + <div class="centre"> + <input tabindex="4" type="submit" name="ShowSales" value="' . _('Show Sales') . '" /> + </div> + </form> + <br />'; + +if ($_POST['DateRange']=='Custom' AND !isset($_POST['FromDate']) AND !isset($_POST['ToDate'])){ + //Don't run the report until custom dates entered + unset($_POST['ShowSales']); +} + +if (isset($_POST['ShowSales'])){ + $InputError=0; //assume no input errors now test for errors + if ($_POST['DateRange']=='Custom'){ + if (!Is_Date($_POST['FromDate'])){ + $InputError = 1; + prnMsg(_('The date entered for the from date is not in the appropriate format. Dates must be entered in the format') . ' ' . $_SESSION['DefaultDateFormat'], 'error'); + } + if (!Is_Date($_POST['ToDate'])){ + $InputError = 1; + prnMsg(_('The date entered for the to date is not in the appropriate format. Dates must be entered in the format') . ' ' . $_SESSION['DefaultDateFormat'], 'error'); + } + if (Date1GreaterThanDate2($_POST['FromDate'],$_POST['ToDate'])){ + $InputError = 1; + prnMsg(_('The from date is expected to be a date prior to the to date. Please review the selected date range'),'error'); + } + } + switch ($_POST['DateRange']) { + case 'ThisWeek': + $FromDate = date('Y-m-d',mktime(0,0,0,date('m'),date('d')-date('w')+1,date('Y'))); + $ToDate = date('Y-m-d'); + break; + case 'ThisMonth': + $FromDate = date('Y-m-d',mktime(0,0,0,date('m'),1,date('Y'))); + $ToDate = date('Y-m-d'); + break; + case 'ThisQuarter': + switch (date('m')) { + case 1: + case 2: + case 3: + $QuarterStartMonth=1; + break; + case 4: + case 5: + case 6: + $QuarterStartMonth=4; + break; + case 7: + case 8: + case 9: + $QuarterStartMonth=7; + break; + default: + $QuarterStartMonth=10; + } + $FromDate = date('Y-m-d',mktime(0,0,0,$QuarterStartMonth,1,date('Y'))); + $ToDate = date('Y-m-d'); + break; + case 'Custom': + $FromDate = FormatDateForSQL($_POST['FromDate']); + $ToDate = FormatDateForSQL($_POST['ToDate']); + } + switch ($_POST['DisplayData']) { + case 'Daily': + $sql = "SELECT debtortrans.trandate, + debtortrans.tpe, + SUM(CASE WHEN stockmoves.type=10 THEN + price*(1-discountpercent)* -qty + ELSE 0 END) + as salesvalue, + SUM(CASE WHEN stockmoves.type=10 THEN + 1 ELSE 0 END) + as nooforders, + SUM(CASE WHEN stockmoves.type=11 THEN + price*(1-discountpercent)* (-qty) + ELSE 0 END) + as returnvalue, + SUM((standardcost * -qty)) as cost + FROM stockmoves + INNER JOIN custbranch + ON stockmoves.debtorno=custbranch.debtorno + AND stockmoves.branchcode=custbranch.branchcode + INNER JOIN debtortrans + ON stockmoves.type=debtortrans.type + AND stockmoves.transno=debtortrans.transno + WHERE (stockmoves.type=10 or stockmoves.type=11) + AND show_on_inv_crds =1 + AND debtortrans.trandate>='" . $FromDate . "' + AND debtortrans.trandate<='" . $ToDate . "' + GROUP BY debtortrans.trandate, + tpe + ORDER BY debtortrans.trandate, + tpe"; + + break; + case 'Weekly': + $sql = "SELECT WEEKOFYEAR(debtortrans.trandate) as week_no, + YEAR(debtortrans.trandate) as transyear, + debtortrans.tpe, + SUM(CASE WHEN stockmoves.type=10 THEN + price*(1-discountpercent)* -qty + ELSE 0 END) + as salesvalue, + SUM(CASE WHEN stockmoves.type=10 THEN + 1 ELSE 0 END) + as nooforders, + SUM(CASE WHEN stockmoves.type=11 THEN + price*(1-discountpercent)* (-qty) + ELSE 0 END) + as returnvalue, + SUM((standardcost * -qty)) as cost + FROM stockmoves + INNER JOIN custbranch + ON stockmoves.debtorno=custbranch.debtorno + AND stockmoves.branchcode=custbranch.branchcode + INNER JOIN debtortrans + ON stockmoves.type=debtortrans.type + AND stockmoves.transno=debtortrans.transno + WHERE (stockmoves.type=10 or stockmoves.type=11) + AND show_on_inv_crds =1 + AND debtortrans.trandate>='" . $FromDate . "' + AND debtortrans.trandate<='" . $ToDate . "' + GROUP BY week_no, + transyear, + tpe + ORDER BY transyear, + week_no, + tpe"; + + break; + case 'Monthly': + $sql = "SELECT MONTH(debtortrans.trandate) as month_no, + MONTHNAME(debtortrans.trandate) as month_name, + YEAR(debtortrans.trandate) as transyear, + debtortrans.tpe, + SUM(CASE WHEN stockmoves.type=10 THEN + price*(1-discountpercent)* -qty + ELSE 0 END) + as salesvalue, + SUM(CASE WHEN stockmoves.type=10 THEN + 1 ELSE 0 END) + as nooforders, + SUM(CASE WHEN stockmoves.type=11 THEN + price*(1-discountpercent)* (-qty) + ELSE 0 END) + as returnvalue, + SUM((standardcost * -qty)) as cost + FROM stockmoves + INNER JOIN custbranch + ON stockmoves.debtorno=custbranch.debtorno + AND stockmoves.branchcode=custbranch.branchcode + INNER JOIN debtortrans + ON stockmoves.type=debtortrans.type + AND stockmoves.transno=debtortrans.transno + WHERE (stockmoves.type=10 or stockmoves.type=11) + AND show_on_inv_crds =1 + AND debtortrans.trandate>='" . $FromDate . "' + AND debtortrans.trandate<='" . $ToDate . "' + GROUP BY month_no, + month_name, + transyear, + debtortrans.tpe + ORDER BY transyear, + month_no, + tpe"; + + break; + case 'Quarterly': + $sql = "SELECT QUARTER(debtortrans.trandate) as quarter_no, + YEAR(debtortrans.trandate) as transyear, + debtortrans.tpe, + SUM(CASE WHEN stockmoves.type=10 THEN + price*(1-discountpercent)* -qty + ELSE 0 END) + as salesvalue, + SUM(CASE WHEN stockmoves.type=10 THEN + 1 ELSE 0 END) + as nooforders, + SUM(CASE WHEN stockmoves.type=11 THEN + price*(1-discountpercent)* (-qty) + ELSE 0 END) + as returnvalue, + SUM((standardcost * -qty)) as cost + FROM stockmoves + INNER JOIN custbranch + ON stockmoves.debtorno=custbranch.debtorno + AND stockmoves.branchcode=custbranch.branchcode + INNER JOIN debtortrans + ON stockmoves.type=debtortrans.type + AND stockmoves.transno=debtortrans.transno + WHERE (stockmoves.type=10 or stockmoves.type=11) + AND show_on_inv_crds =1 + AND debtortrans.trandate>='" . $FromDate . "' + AND debtortrans.trandate<='" . $ToDate . "' + GROUP BY quarter_no, + transyear, + tpe + ORDER BY transyear, + quarter_no, + tpe"; + + break; + } + + $ErrMsg = _('The sales data could not be retrieved because') . ' - ' . DB_error_msg($db); + $SalesResult = DB_query($sql,$db,$ErrMsg); + + + echo '<table cellpadding=2 class="selection">'; + + echo'<tr> + <th>' . _('Period') . '</th> + <th>' . _('Sales') . '<br />' . _('Type') . '</th> + <th>' . _('No Orders') . '</th> + <th>' . _('Total Sales') . '</th> + <th>' . _('Refunds') . '</th> + <th>' . _('Net Sales') . '</th> + <th>' . _('Cost of Sales') . '</th> + <th>' . _('Gross Profit') . '</th> + </tr>'; + + $CumulativeTotalSales = 0; + $CumulativeTotalOrders = 0; + $CumulativeTotalRefunds = 0; + $CumulativeTotalNetSales = 0; + $CumulativeTotalCost = 0; + $CumulativeTotalGP = 0; + + $PrdTotalOrders =0; + $PrdTotalSales=0; + $PrdTotalRefunds=0; + $PrdTotalNetSales=0; + $PrdTotalCost=0; + $PrdTotalGP=0; + + $PeriodHeadingDone = false; + $LastPeriodHeading = 'First Run Through'; + $k=0; + while ($SalesRow=DB_fetch_array($SalesResult)) { + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k=1; + } + switch ($_POST['DisplayData']){ + case 'Daily': + if ($LastPeriodHeading != ConvertSQLDate($SalesRow['trandate'])) { + $PeriodHeadingDone=false; + if ($LastPeriodHeading != 'First Run Through'){ //print the footer for the period + echo '<td colspan="2" class="number">' . _('Total') . '-' . $LastPeriodHeading . '</td> + <td class="number">' . $PrdTotalOrders . '</td> + <td class="number">' . locale_number_format($PrdTotalSales,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($PrdTotalRefunds,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($PrdTotalNetSales,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($PrdTotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($PrdTotalGP,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + </tr>'; + if ($k==1){ + echo '<tr class="EvenTableRows"><td colspan="8"><hr></td></tr>'; + echo '<tr class="OddTableRows">'; + } else { + echo '<tr class="OddTableRows"><td colspan="8"><hr></td></tr>'; + echo '<tr class="EvenTableRows">'; + } + $PrdTotalOrders =0; + $PrdTotalSales=0; + $PrdTotalRefunds=0; + $PrdTotalNetSales=0; + $PrdTotalCost=0; + $PrdTotalGP=0; + } + } + if (! $PeriodHeadingDone){ + echo '<td>' . ConvertSQLDate($SalesRow['trandate']) . '</td>'; + $LastPeriodHeading = ConvertSQLDate($SalesRow['trandate']); + $PeriodHeadingDone = true; + } else { + echo '<td></td>'; + } + break; + case 'Weekly': + if ($LastPeriodHeading != _('wk'). '-' . $SalesRow['week_no'] . ' ' . $SalesRow['transyear']) { + $PeriodHeadingDone=false; + if ($LastPeriodHeading != 'First Run Through'){ + echo '<td colspan="2" class="number">' . _('Total') . '-' . $LastPeriodHeading . '</td> + <td class="number">' . $PrdTotalOrders . '</td> + <td class="number">' . locale_number_format($PrdTotalSales,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($PrdTotalRefunds,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($PrdTotalNetSales,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($PrdTotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($PrdTotalGP,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + </tr>'; + if ($k==1){ + echo '<tr class="EvenTableRows"><td colspan="8"><hr></td></tr>'; + echo '<tr class="OddTableRows">'; + } else { + echo '<tr class="OddTableRows"><td colspan="8"><hr></td></tr>'; + echo '<tr class="EvenTableRows">'; + } + $PrdTotalOrders =0; + $PrdTotalSales=0; + $PrdTotalRefunds=0; + $PrdTotalNetSales=0; + $PrdTotalCost=0; + $PrdTotalGP=0; + } + } + if (! $PeriodHeadingDone){ + echo '<td>' . _('wk'). '-' . $SalesRow['week_no'] . ' ' . $SalesRow['transyear'] . '</td>'; + $LastPeriodHeading = _('wk'). '-' . $SalesRow['week_no'] . ' ' . $SalesRow['transyear']; + $PeriodHeadingDone = true; + } else { + echo '<td></td>'; + } + break; + case 'Monthly': + if ($LastPeriodHeading != $SalesRow['month_name'] . ' ' . $SalesRow['transyear']) { + $PeriodHeadingDone=false; + if ($LastPeriodHeading != 'First Run Through'){ + echo '<td colspan="2" class="number">' . _('Total') . '-' . $LastPeriodHeading . '</td> + <td class="number">' . $PrdTotalOrders . '</td> + <td class="number">' . locale_number_format($PrdTotalSales,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($PrdTotalRefunds,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($PrdTotalNetSales,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($PrdTotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($PrdTotalGP,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + </tr>'; + if ($k==1){ + echo '<tr class="EvenTableRows"><td colspan="8"><hr></td></tr>'; + echo '<tr class="OddTableRows">'; + } else { + echo '<tr class="OddTableRows"><td colspan="8"><hr></td></tr>'; + echo '<tr class="EvenTableRows">'; + } + $PrdTotalOrders =0; + $PrdTotalSales=0; + $PrdTotalRefunds=0; + $PrdTotalNetSales=0; + $PrdTotalCost=0; + $PrdTotalGP=0; + } + } + if (! $PeriodHeadingDone){ + echo '<td>' . $SalesRow['month_name'] . ' ' . $SalesRow['transyear'] . '</td>'; + $LastPeriodHeading = $SalesRow['month_name'] . ' ' . $SalesRow['transyear']; + $PeriodHeadingDone = true; + } else { + echo '<td></td>'; + } + break; + case 'Quarterly': + if ($LastPeriodHeading != _('Qtr'). '-' . $SalesRow['quarter_no'] . ' ' . $SalesRow['transyear']) { + $PeriodHeadingDone=false; + if ($LastPeriodHeading != 'First Run Through'){ + echo '<td colspan="2" class="number">' . _('Total') . '-'. $LastPeriodHeading . '</td> + <td class="number">' . $PrdTotalOrders . '</td> + <td class="number">' . locale_number_format($PrdTotalSales,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($PrdTotalRefunds,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($PrdTotalNetSales,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($PrdTotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($PrdTotalGP,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + </tr>'; + if ($k==1){ + echo '<tr class="EvenTableRows"><td colspan="8"><hr></td></tr>'; + echo '<tr class="OddTableRows">'; + } else { + echo '<tr class="OddTableRows"><td colspan="8"><hr></td></tr>'; + echo '<tr class="EvenTableRows">'; + } + $PrdTotalOrders =0; + $PrdTotalSales=0; + $PrdTotalRefunds=0; + $PrdTotalNetSales=0; + $PrdTotalCost=0; + $PrdTotalGP=0; + } + } + if (! $PeriodHeadingDone){ + echo '<td>' . _('Qtr'). '-' . $SalesRow['quarter_no'] . ' ' . $SalesRow['transyear'] . '</td>'; + $LastPeriodHeading = _('Qtr'). '-' . $SalesRow['quarter_no'] . ' ' . $SalesRow['transyear']; + $PeriodHeadingDone = true; + } else { + echo '<td></td>'; + } + break; + } + echo '<td>' . $SalesRow['tpe'] . '</td> + <td class="number">' . $SalesRow['nooforders'] . '</td> + <td class="number">' . locale_number_format($SalesRow['salesvalue'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($SalesRow['returnvalue'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($SalesRow['salesvalue']+$SalesRow['returnvalue'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($SalesRow['cost'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format(($SalesRow['salesvalue']+$SalesRow['returnvalue']-$SalesRow['cost']),$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + </tr>'; + $PrdTotalOrders +=$SalesRow['nooforders']; + $PrdTotalSales += $SalesRow['salesvalue']; + $PrdTotalRefunds += $SalesRow['returnvalue']; + $PrdTotalNetSales += ($SalesRow['salesvalue']+$SalesRow['returnvalue']); + $PrdTotalCost += $SalesRow['cost']; + $PrdTotalGP += ($SalesRow['salesvalue']+$SalesRow['returnvalue']-$SalesRow['cost']); + + $CumulativeTotalSales += $SalesRow['salesvalue']; + $CumulativeTotalOrders = $SalesRow['nooforders']; + $CumulativeTotalRefunds += $SalesRow['returnvalue']; + $CumulativeTotalNetSales += ($SalesRow['salesvalue']+$SalesRow['returnvalue']); + $CumulativeTotalCost += $SalesRow['cost']; + $CumulativeTotalGP += ($SalesRow['salesvalue']+$SalesRow['returnvalue']-$SalesRow['cost']); + } + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k=1; + } + echo '<td colspan="2" class="number">' . _('Total') . ' ' . $LastPeriodHeading . '</td> + <td class="number">' . $PrdTotalOrders . '</td> + <td class="number">' . locale_number_format($PrdTotalSales,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($PrdTotalRefunds,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($PrdTotalNetSales,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($PrdTotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($PrdTotalGP,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + </tr>'; + if ($k==1){ + echo '<tr class="EvenTableRows"><td colspan="8"><hr></td></tr>'; + echo '<tr class="OddTableRows">'; + } else { + echo '<tr class="OddTableRows"><td colspan="8"><hr></td></tr>'; + echo '<tr class="EvenTableRows">'; + } + echo '<td colspan="2" class="number">' . _('GRAND Total') . '</td> + <td class="number">' . $CumulativeTotalOrders . '</td> + <td class="number">' . locale_number_format($CumulativeTotalSales,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($CumulativeTotalRefunds,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($CumulativeTotalNetSales,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($CumulativeTotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($CumulativeTotalGP,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + </tr>'; + + echo '</table>'; + +} //end of if user hit show sales +include('includes/footer.inc'); +?> \ No newline at end of file Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2011-11-27 12:11:28 UTC (rev 8359) +++ trunk/includes/session.inc 2011-11-27 12:11:42 UTC (rev 8360) @@ -13,7 +13,7 @@ header('Location:' . $rootpath . '/install/index.php'); } include($PathPrefix . 'config.php'); -$DBVersion=103; +$DBVersion=104; if (isset($SessionSavePath)){ session_save_path($SessionSavePath); } Modified: trunk/index.php =================================================================== --- trunk/index.php 2011-11-27 12:11:28 UTC (rev 8359) +++ trunk/index.php 2011-11-27 12:11:42 UTC (rev 8360) @@ -53,6 +53,7 @@ _('Order Status Report'), _('Orders Invoiced Reports'), _('Daily Sales Inquiry'), + _('Sales By Sales Type Inquiry'), _('Sales By Category Inquiry'), _('Top Sellers Inquiry'), _('Order Delivery Differences Report'), @@ -67,6 +68,7 @@ '/PDFOrderStatus.php', '/PDFOrdersInvoiced.php', '/DailySalesInquiry.php', + '/SalesByTypePeriodInquiry.php', '/SalesCategoryPeriodInquiry.php', '/SalesTopItemsInquiry.php', '/PDFDeliveryDifferences.php', Added: trunk/sql/mysql/updates/104.php =================================================================== --- trunk/sql/mysql/updates/104.php (rev 0) +++ trunk/sql/mysql/updates/104.php 2011-11-27 12:11:42 UTC (rev 8360) @@ -0,0 +1,10 @@ +<?php + +/* Include the new script for printing quotations in Portrait + */ + +InsertRecord('pagesecurity', array('script', 'security'), array('SalesByTypePeriodInquiry.php',1), array('script', 'security'), array('SalesByTypePeriodInquiry.php',1), $db); + +UpdateDBNo(104, $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-11-27 13:32:02
|
Revision: 8363 http://weberp.svn.sourceforge.net/weberp/?rev=8363&view=rev Author: tim_schofield Date: 2011-11-27 13:31:56 +0000 (Sun, 27 Nov 2011) Log Message: ----------- Corrections to HTML Modified Paths: -------------- trunk/SalesCategoryPeriodInquiry.php trunk/SalesTopItemsInquiry.php Modified: trunk/SalesCategoryPeriodInquiry.php =================================================================== --- trunk/SalesCategoryPeriodInquiry.php 2011-11-27 13:31:46 UTC (rev 8362) +++ trunk/SalesCategoryPeriodInquiry.php 2011-11-27 13:31:56 UTC (rev 8363) @@ -80,7 +80,7 @@ echo '<br /><div class="centre"><input tabindex="4" type="submit" name="ShowSales" value="' . _('Show Sales') . '" />'; -echo '</form></div>'; +echo '</div></form>'; echo '<br />'; Modified: trunk/SalesTopItemsInquiry.php =================================================================== --- trunk/SalesTopItemsInquiry.php 2011-11-27 13:31:46 UTC (rev 8362) +++ trunk/SalesTopItemsInquiry.php 2011-11-27 13:31:56 UTC (rev 8363) @@ -21,41 +21,48 @@ echo '<table cellpadding="2" class="selection"> <tr><td valign="top"> <table>'; - + echo '<tr> <th colspan="2" class="centre">' . _('Date Selection') . '</th> </tr> <tr> - <td>' . _('Custom Range') . ':</td> - <td><input type="radio" name="DateRange" value="Custom" '; -if ($_POST['DateRange']=='Custom'){ - echo 'checked'; + <td>' . _('Custom Range') . ':</td>'; +if ($_POST['DateRange']=='Custom') { + echo '<td><input type="radio" name="DateRange" value="Custom" checked="True" onChange="ReloadForm(form1.ShowSales)" />'; +} else { + echo '<td><input type="radio" name="DateRange" value="Custom" onChange="ReloadForm(form1.ShowSales)" />'; } -echo ' onChange="ReloadForm(form1.ShowSales)" /></td> +echo '</td> </tr> <tr> <td>' . _('This Week') . ':</td> - <td><input type="radio" name="DateRange" value="ThisWeek" '; -if ($_POST['DateRange']=='ThisWeek'){ - echo 'checked'; + <td>'; +if ($_POST['DateRange']=='ThisWeek') { + echo '<input type="radio" name="DateRange" value="ThisWeek" checked="True" onChange="ReloadForm(form1.ShowSales)" />'; +} else { + echo '<input type="radio" name="DateRange" value="ThisWeek" onChange="ReloadForm(form1.ShowSales)" />'; } -echo ' onChange="ReloadForm(form1.ShowSales)" /></td> +echo '</td> </tr> <tr> <td>' . _('This Month') . ':</td> - <td><input type="radio" name="DateRange" value="ThisMonth" '; -if ($_POST['DateRange']=='ThisMonth'){ - echo 'checked'; + <td>'; +if ($_POST['DateRange']=='ThisMonth') { + echo '<input type="radio" name="DateRange" value="ThisMonth" checked="True" onChange="ReloadForm(form1.ShowSales)" />'; +} else { + echo '<input type="radio" name="DateRange" value="ThisMonth" onChange="ReloadForm(form1.ShowSales)" />'; } -echo ' onChange="ReloadForm(form1.ShowSales)" /></td> +echo '</td> </tr> <tr> <td>' . _('This Quarter') . ':</td> - <td><input type="radio" name="DateRange" value="ThisQuarter" '; -if ($_POST['DateRange']=='ThisQuarter'){ - echo 'checked'; + <td>'; +if ($_POST['DateRange']=='ThisQuarter') { + echo '<input type="radio" name="DateRange" value="ThisQuarter" checked="True" onChange="ReloadForm(form1.ShowSales)" />'; +} else { + echo '<input type="radio" name="DateRange" value="ThisQuarter" onChange="ReloadForm(form1.ShowSales)" />'; } -echo ' onChange="ReloadForm(form1.ShowSales)" /></td> +echo '</td> </tr>'; if ($_POST['DateRange']=='Custom'){ if (!isset($_POST['FromDate'])){ @@ -73,7 +80,7 @@ </tr>'; } echo '</table></td> - <td valign=top> + <td valign="top"> <table>'; //new sub table to set parameters for order of display @@ -84,34 +91,38 @@ </tr> <tr> <td>' . _('Order By Net Sales') . ':</td> - <td><input type="radio" name="OrderBy" value="NetSales" '; -if ($_POST['OrderBy']=='NetSales'){ - echo 'checked'; + <td>'; +if ($_POST['OrderBy']=='NetSales') { + echo '<input type="radio" name="OrderBy" value="NetSales" checked="True" />'; +} else { + echo '<input type="radio" name="OrderBy" value="NetSales" />'; } -echo ' /></td> +echo '</td> </tr> <tr> <td>' . _('Order By Quantity') . ':</td> - <td><input type="radio" name="OrderBy" value="Quantity" '; -if ($_POST['OrderBy']=='Quantity'){ - echo 'checked'; + <td>'; +if ($_POST['OrderBy']=='Quantity') { + echo '<input type="radio" name="OrderBy" value="Quantity" checked="True" />'; +} else { + echo '<input type="radio" name="OrderBy" value="Quantity" />'; } if (!isset($_POST['NoToDisplay'])){ $_POST['NoToDisplay']=20; } -echo ' /></td> +echo '</td> </tr> <tr> <td>' . _('Number to Display') . ':</td> - <td><input type="text class="number" name="NoToDisplay" size="4" maxlength="4" value="' . $_POST['NoToDisplay'] .'" ></td> + <td><input type="text class="number" name="NoToDisplay" size="4" maxlength="4" value="' . $_POST['NoToDisplay'] .'" /></td> </tr> </table> </td></tr> </table>'; -echo '<br /><div class="centre"><input tabindex=4 type=submit name="ShowSales" value="' . _('Show Sales') . '">'; -echo '</form></div>'; +echo '<br /><div class="centre"><input tabindex="4" type="submit" name="ShowSales" value="' . _('Show Sales') . '" />'; +echo '</div></form>'; echo '<br />'; if (isset($_POST['ShowSales'])){ @@ -169,25 +180,25 @@ $sql = "SELECT stockmaster.stockid, stockmaster.description, stockcategory.categorydescription, - SUM(CASE WHEN stockmoves.type=10 - OR stockmoves.type=11 THEN + SUM(CASE WHEN stockmoves.type=10 + OR stockmoves.type=11 THEN -qty ELSE 0 END) as salesquantity, - SUM(CASE WHEN stockmoves.type=10 THEN + SUM(CASE WHEN stockmoves.type=10 THEN price*(1-discountpercent)* -qty ELSE 0 END) as salesvalue, - SUM(CASE WHEN stockmoves.type=11 THEN + SUM(CASE WHEN stockmoves.type=11 THEN price*(1-discountpercent)* (-qty) ELSE 0 END) as returnvalue, - SUM(CASE WHEN stockmoves.type=11 - OR stockmoves.type=10 THEN + SUM(CASE WHEN stockmoves.type=11 + OR stockmoves.type=10 THEN price*(1-discountpercent)* (-qty) ELSE 0 END) as netsalesvalue, SUM((standardcost * -qty)) as cost FROM stockmoves INNER JOIN stockmaster - ON stockmoves.stockid=stockmaster.stockid - INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid + ON stockmoves.stockid=stockmaster.stockid + INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid WHERE (stockmoves.type=10 or stockmoves.type=11) AND show_on_inv_crds =1 AND trandate>='" . $FromDate . "' @@ -195,7 +206,7 @@ GROUP BY stockmaster.stockid, stockmaster.description, stockcategory.categorydescription "; - + if ($_POST['OrderBy']=='NetSales'){ $sql .= " ORDER BY netsalesvalue DESC "; } else { @@ -206,13 +217,13 @@ $sql .= " LIMIT " . $_POST['NoToDisplay']; } } - + $ErrMsg = _('The sales data could not be retrieved because') . ' - ' . DB_error_msg($db); $SalesResult = DB_query($sql,$db,$ErrMsg); - + echo '<table cellpadding=2 class="selection">'; - + echo'<tr> <th>' . _('Rank') . '</th> <th>' . _('Item') . '</th> @@ -222,7 +233,7 @@ <th>' . _('Net Sales') . '</th> <th>' . _('Sales') .'<br />' . _('Quantity') . '</th> </tr>'; - + $CumulativeTotalSales = 0; $CumulativeTotalRefunds = 0; $CumulativeTotalNetSales = 0; @@ -237,7 +248,7 @@ echo '<tr class="OddTableRows">'; $k=1; } - + echo '<td>' . $i . '</td> <td>' . $SalesRow['stockid'] . ' - ' . $SalesRow['description'] . '</td> <td>' . $SalesRow['categorydescription'] . '</td> @@ -247,19 +258,19 @@ <td class="number">' . locale_number_format($SalesRow['salesquantity'],'Variable') . '</td> </tr>'; $i++; - + $CumulativeTotalSales += $SalesRow['salesvalue']; $CumulativeTotalRefunds += $SalesRow['returnvalue']; $CumulativeTotalNetSales += ($SalesRow['salesvalue']+$SalesRow['returnvalue']); $CumulativeTotalQuantity += $SalesRow['salesquantity']; } //loop around category sales for the period - + if ($k==1){ - echo '<tr class="EvenTableRows"><td colspan="8"><hr></td></tr>'; + echo '<tr class="EvenTableRows"><td colspan="8"><hr /></td></tr>'; echo '<tr class="OddTableRows">'; } else { - echo '<tr class="OddTableRows"><td colspan="8"><hr></td></tr>'; + echo '<tr class="OddTableRows"><td colspan="8"><hr /></td></tr>'; echo '<tr class="EvenTableRows">'; } echo '<td class="number" colspan="3">' . _('GRAND Total') . '</td> @@ -268,7 +279,7 @@ <td class="number">' . locale_number_format($CumulativeTotalNetSales,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number">' . locale_number_format($CumulativeTotalQuantity,'Variable') . '</td> </tr>'; - + echo '</table>'; } //end of if user hit show sales This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-11-28 16:46:25
|
Revision: 8367 http://weberp.svn.sourceforge.net/weberp/?rev=8367&view=rev Author: tim_schofield Date: 2011-11-28 16:46:18 +0000 (Mon, 28 Nov 2011) Log Message: ----------- Check that variable is set before trying to check its value Modified Paths: -------------- trunk/PrintCustTrans.php trunk/includes/footer.inc Modified: trunk/PrintCustTrans.php =================================================================== --- trunk/PrintCustTrans.php 2011-11-28 16:46:04 UTC (rev 8366) +++ trunk/PrintCustTrans.php 2011-11-28 16:46:18 UTC (rev 8367) @@ -166,7 +166,7 @@ AND debtortrans.debtorno=custbranch.debtorno AND debtortrans.branchcode=custbranch.branchcode AND custbranch.salesman=salesman.salesmancode"; - if ($_POST['PrintEDI'] == 'No') { + if (isset($_POST['PrintEDI']) and $_POST['PrintEDI'] == 'No') $sql = $sql . ' AND debtorsmaster.ediinvoices=0'; } } // end else Modified: trunk/includes/footer.inc =================================================================== --- trunk/includes/footer.inc 2011-11-28 16:46:04 UTC (rev 8366) +++ trunk/includes/footer.inc 2011-11-28 16:46:18 UTC (rev 8367) @@ -12,7 +12,7 @@ echo '</td></tr>'; -echo '<tr><td colspan="3" class="footer">webERP v' . $_SESSION['VersionNumber'] . ' ' . _('Copyright') . ' © web-erp.org - '.date('Y').'</td></tr>'; +echo '<tr><td colspan="3" class="footer">webERP v' . $_SESSION['VersionNumber'] . ' ' . _('Copyright') . ' © web-erp.org - 2007-'.date('Y').'</td></tr>'; // if(http_file_exists('http://sflogo.sourceforge.net/sflogo.php')) { // echo '<tr><td class="footer"><a href="https://sourceforge.net/projects/weberp"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=391629&type=12" width="120" height="30" border="0" alt="Get webERP web-based ERP Accounting at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a></td></tr>'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-12-24 22:42:37
|
Revision: 8375 http://weberp.svn.sourceforge.net/weberp/?rev=8375&view=rev Author: tim_schofield Date: 2011-12-24 22:42:31 +0000 (Sat, 24 Dec 2011) Log Message: ----------- Fix for multiple orders some inserted and some updated at the same time Modified Paths: -------------- trunk/PO_Header.php trunk/PO_Items.php trunk/includes/PO_ReadInOrder.inc Modified: trunk/PO_Header.php =================================================================== --- trunk/PO_Header.php 2011-12-24 22:42:17 UTC (rev 8374) +++ trunk/PO_Header.php 2011-12-24 22:42:31 UTC (rev 8375) @@ -39,7 +39,7 @@ if (isset($_GET['NewOrder']) and isset($_SESSION['PO'.$identifier])){ unset($_SESSION['PO'.$identifier]); - $_SESSION['ExistingOrder']=0; + $_SESSION['ExistingOrder'.$identifier]=0; } if (isset($_POST['Select']) and empty($_POST['SupplierContact'])) { @@ -111,7 +111,7 @@ if ($_POST['Status'] == 'Rejected' OR $_POST['Status'] == 'Cancelled' ) { - if(!isset($_SESSION['ExistingOrder']) OR $_SESSION['ExistingOrder']!=0) { + if(!isset($_SESSION['ExistingOrder'.$identifier]) OR $_SESSION['ExistingOrder'.$identifier]!=0) { /* need to check that not already dispatched or invoiced by the supplier */ if($_SESSION['PO'.$identifier]->Any_Already_Received()==1){ $OKToUpdateStatus =0; //not ok to update the status @@ -162,7 +162,7 @@ $SQL = "UPDATE purchorders SET status='" . $_POST['Status']. "', stat_comment='" . $_SESSION['PO'.$identifier]->StatComments ."', allowprint='".$AllowPrint."' - WHERE purchorders.orderno ='" . $_SESSION['ExistingOrder'] ."'"; + WHERE purchorders.orderno ='" . $_SESSION['ExistingOrder'.$identifier] ."'"; $ErrMsg = _('The order status could not be updated because'); $UpdateResult=DB_query($SQL,$db,$ErrMsg); @@ -175,7 +175,7 @@ /* * initialise a new order */ - $_SESSION['ExistingOrder']=0; + $_SESSION['ExistingOrder'.$identifier]=0; unset($_SESSION['PO'.$identifier]); /* initialise new class object */ $_SESSION['PO'.$identifier] = new PurchOrder; @@ -275,7 +275,7 @@ * is where the details of the order are either updated or * inserted depending on the value of ExistingOrder */ - $_SESSION['ExistingOrder']=0; + $_SESSION['ExistingOrder'.$identifier]=0; $_SESSION['PO'.$identifier] = new PurchOrder; $_SESSION['PO'.$identifier]->AllowPrintPO = 1; /*Of course cos the order aint even started !!*/ $_SESSION['PO'.$identifier]->GLLink = $_SESSION['CompanyRecord']['gllink_stock']; @@ -606,7 +606,7 @@ ' . $_SESSION['PO'.$identifier]->SupplierName . ' - ' . _('All amounts stated in') . ' ' . $_SESSION['PO'.$identifier]->CurrCode . '<br />'; - if ($_SESSION['ExistingOrder']) { + if ($_SESSION['ExistingOrder'.$identifier]) { echo _(' Modify Purchase Order Number') . ' ' . $_SESSION['PO'.$identifier]->OrderNo; echo '</p>'; } @@ -730,7 +730,7 @@ //sub table starts echo '<table class="selection" width="100%">'; echo '<tr><td>' . _('PO Date') . ':</td><td>'; - if ($_SESSION['ExistingOrder']!=0){ + if ($_SESSION['ExistingOrder'.$identifier]!=0){ echo ConvertSQLDate($_SESSION['PO'.$identifier]->Orig_OrderDate); } else { /* DefaultDateFormat defined in config.php */ @@ -791,13 +791,13 @@ </select></td>'; echo '<td><input type="submit" name="AllowRePrint" value="Update" /></td></tr>'; } elseif ($Printed) { - echo '<tr><td colspan="2"><a target="_blank" href="' . $rootpath . '/PO_PDFPurchOrder.php?OrderNo=' . $_SESSION['ExistingOrder'] . '&identifier='.$identifier. '">' . _('Reprint Now') . '</a></td></tr>'; + echo '<tr><td colspan="2"><a target="_blank" href="' . $rootpath . '/PO_PDFPurchOrder.php?OrderNo=' . $_SESSION['ExistingOrder'.$identifier] . '&identifier='.$identifier. '">' . _('Reprint Now') . '</a></td></tr>'; } echo '</table>'; echo '<td style="width:50%" valign="top"><table class="selection" width="100%">'; - if($_SESSION['ExistingOrder'] != 0 and $_SESSION['PO'.$identifier]->Status == PurchOrder::STATUS_PRINTED){ + if($_SESSION['ExistingOrder'.$identifier] != 0 and $_SESSION['PO'.$identifier]->Status == PurchOrder::STATUS_PRINTED){ echo '<tr><td><a href="' .$rootpath . '/GoodsReceived.php?&PONumber=' . $_SESSION['PO'.$identifier]->OrderNo . '&identifier='.$identifier.'">'._('Receive this order').'</a></td></tr>'; } Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2011-12-24 22:42:17 UTC (rev 8374) +++ trunk/PO_Items.php 2011-12-24 22:42:31 UTC (rev 8375) @@ -100,7 +100,7 @@ $result = DB_Txn_Begin($db); - if ($_SESSION['ExistingOrder']==0){ /*its a new order to be inserted */ + if ($_SESSION['ExistingOrder'.$identifier]==0){ /*its a new order to be inserted */ $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created by') . ' <a href="mailto:'. $_SESSION['UserEmail'] .'">'.$_SESSION['PO'.$identifier]->Initiator. '</a> - '.$_SESSION['PO'.$identifier]->StatusMessage.'<br />'; Modified: trunk/includes/PO_ReadInOrder.inc =================================================================== --- trunk/includes/PO_ReadInOrder.inc 2011-12-24 22:42:17 UTC (rev 8374) +++ trunk/includes/PO_ReadInOrder.inc 2011-12-24 22:42:31 UTC (rev 8375) @@ -7,7 +7,7 @@ unset ($_SESSION['PO'.$identifier]); } - $_SESSION['ExistingOrder']=$_GET['ModifyOrderNumber']; + $_SESSION['ExistingOrder'.$identifier]=$_GET['ModifyOrderNumber']; $_SESSION['RequireSupplierSelection'] = 0; $_SESSION['PO'.$identifier] = new PurchOrder; @@ -97,7 +97,7 @@ $_SESSION['PO'.$identifier]->Status = $myrow['status']; $_SESSION['PO'.$identifier]->StatComments = $myrow['stat_comment']; $_SESSION['PO'.$identifier]->DeliveryDate = ConvertSQLDate($myrow['deliverydate']); - $_SESSION['ExistingOrder'] = $_SESSION['PO'.$identifier]->OrderNo; + $_SESSION['ExistingOrder'.$identifier] = $_SESSION['PO'.$identifier]->OrderNo; $_SESSION['PO'.$identifier]->PaymentTerms= $myrow['paymentterms']; $supplierSQL = "SELECT suppliers.supplierid, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-12-24 22:42:54
|
Revision: 8376 http://weberp.svn.sourceforge.net/weberp/?rev=8376&view=rev Author: tim_schofield Date: 2011-12-24 22:42:48 +0000 (Sat, 24 Dec 2011) Log Message: ----------- Fix for multiple orders some inserted and some updated at the same time Modified Paths: -------------- trunk/DeliveryDetails.php trunk/SelectOrderItems.php trunk/includes/DefineCartClass.php trunk/includes/SelectOrderItems_IntoCart.inc Modified: trunk/DeliveryDetails.php =================================================================== --- trunk/DeliveryDetails.php 2011-12-24 22:42:31 UTC (rev 8375) +++ trunk/DeliveryDetails.php 2011-12-24 22:42:48 UTC (rev 8376) @@ -313,7 +313,7 @@ } #end if else freight charge not altered } #end if process order -if (isset($OK_to_PROCESS) and $OK_to_PROCESS == 1 and $_SESSION['ExistingOrder']==0){ +if (isset($OK_to_PROCESS) and $OK_to_PROCESS == 1 and $_SESSION['ExistingOrder'.$identifier]==0){ /* finally write the order header to the database and then the order line details */ @@ -648,7 +648,7 @@ include('includes/footer.inc'); exit; -} elseif (isset($OK_to_PROCESS) and $OK_to_PROCESS == 1 and $_SESSION['ExistingOrder']!=0){ +} elseif (isset($OK_to_PROCESS) and $OK_to_PROCESS == 1 and $_SESSION['ExistingOrder'.$identifier]!=0){ /* update the order header then update the old order line details and insert the new lines */ @@ -662,7 +662,7 @@ if ($_SESSION['Items'.$identifier]->Quotation==0) { //now its being changed? to an order $ContractResult = DB_query("SELECT contractref, requireddate - FROM contracts WHERE orderno='" . $_SESSION['ExistingOrder'] ."' + FROM contracts WHERE orderno='" . $_SESSION['ExistingOrder'.$identifier] ."' AND status=1",$db); if (DB_num_rows($ContractResult)==1){ //then it is a contract quotation being changed to an order $ContractRow = DB_fetch_array($ContractResult); @@ -671,7 +671,7 @@ $DbgMsg = _('The SQL that failed to update the contract status was'); $UpdContractResult=DB_query("UPDATE contracts SET status=2, wo='" . $WONo . "' - WHERE orderno='" .$_SESSION['ExistingOrder'] . "'", $db,$ErrMsg,$DbgMsg,true); + WHERE orderno='" .$_SESSION['ExistingOrder'.$identifier] . "'", $db,$ErrMsg,$DbgMsg,true); $ErrMsg = _('Could not insert the contract bill of materials'); $InsContractBOM = DB_query("INSERT INTO bom (parent, component, @@ -763,7 +763,7 @@ printedpackingslip = '" . $_POST['ReprintPackingSlip'] . "', quotation = '" . $_SESSION['Items'.$identifier]->Quotation . "', deliverblind = '" . $_SESSION['Items'.$identifier]->DeliverBlind . "' - WHERE salesorders.orderno='" . $_SESSION['ExistingOrder'] ."'"; + WHERE salesorders.orderno='" . $_SESSION['ExistingOrder'.$identifier] ."'"; $DbgMsg = _('The SQL that was used to update the order and failed was'); $ErrMsg = _('The order cannot be updated because'); @@ -786,7 +786,7 @@ completed='" . $Completed . "', poline='" . $StockItem->POLine . "', itemdue='" . FormatDateForSQL($StockItem->ItemDue) . "' - WHERE salesorderdetails.orderno='" . $_SESSION['ExistingOrder'] . "' + WHERE salesorderdetails.orderno='" . $_SESSION['ExistingOrder'.$identifier] . "' AND salesorderdetails.orderlineno='" . $StockItem->LineNumber . "'"; $DbgMsg = _('The SQL that was used to modify the order line and failed was'); @@ -810,11 +810,11 @@ unset($_SESSION['Items'.$identifier]->LineItems); unset($_SESSION['Items'.$identifier]); - prnMsg(_('Order Number') .' ' . $_SESSION['ExistingOrder'] . ' ' . _('has been updated'),'success'); + prnMsg(_('Order Number') .' ' . $_SESSION['ExistingOrder'.$identifier] . ' ' . _('has been updated'),'success'); - echo '<br /><table class="selection"><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="" /></td><td><a href="' . $rootpath . '/PrintCustOrder.php?identifier='.$identifier . '&TransNo=' . $_SESSION['ExistingOrder'] . '">'. _('Print packing slip - pre-printed stationery') .'</a></td></tr>'; - echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="" /></td><td><a target="_blank" href="' . $rootpath . '/PrintCustOrder_generic.php?identifier='.$identifier . '&TransNo=' . $_SESSION['ExistingOrder'] . '">'. _('Print packing slip') . ' (' . _('Laser') . ')' .'</a></td></tr>'; - echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Invoice') . '" alt="" /></td><td><a href="' . $rootpath .'/ConfirmDispatch_Invoice.php?identifier='.$identifier . '&OrderNumber=' . $_SESSION['ExistingOrder'] . '">'. _('Confirm Order Delivery Quantities and Produce Invoice') .'</a></td></tr>'; + echo '<br /><table class="selection"><tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="" /></td><td><a href="' . $rootpath . '/PrintCustOrder.php?identifier='.$identifier . '&TransNo=' . $_SESSION['ExistingOrder'.$identifier] . '">'. _('Print packing slip - pre-printed stationery') .'</a></td></tr>'; + echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="" /></td><td><a target="_blank" href="' . $rootpath . '/PrintCustOrder_generic.php?identifier='.$identifier . '&TransNo=' . $_SESSION['ExistingOrder'.$identifier] . '">'. _('Print packing slip') . ' (' . _('Laser') . ')' .'</a></td></tr>'; + echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Invoice') . '" alt="" /></td><td><a href="' . $rootpath .'/ConfirmDispatch_Invoice.php?identifier='.$identifier . '&OrderNumber=' . $_SESSION['ExistingOrder'.$identifier] . '">'. _('Confirm Order Delivery Quantities and Produce Invoice') .'</a></td></tr>'; echo '<tr><td><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Order') . '" alt="" /></td><td><a href="' . $rootpath .'/SelectSalesOrder.php?identifier='.$identifier . '">'. _('Select A Different Order') .'</a></td></tr></table>'; include('includes/footer.inc'); exit; @@ -1152,7 +1152,7 @@ echo '<br /><div class="centre"><input type="submit" name="BackToLineDetails" value="' . _('Modify Order Lines') . '" /><br />'; -if ($_SESSION['ExistingOrder']==0){ +if ($_SESSION['ExistingOrder'.$identifier]==0){ echo '<br /><br /><input type="submit" name="ProcessOrder" value="' . _('Place Order') . '" />'; echo '<br /><br /><input type="submit" name="MakeRecurringOrder" value="' . _('Create Recurring Order') . '" />'; } else { Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-12-24 22:42:31 UTC (rev 8375) +++ trunk/SelectOrderItems.php 2011-12-24 22:42:48 UTC (rev 8376) @@ -58,7 +58,7 @@ unset ($_SESSION['Items'.$identifier]); } - $_SESSION['ExistingOrder']=0; + $_SESSION['ExistingOrder'.$identifier]=0; $_SESSION['Items'.$identifier] = new cart; if (count($_SESSION['AllowedPageSecurityTokens'])==1){ //its a customer logon @@ -80,7 +80,7 @@ unset ($_SESSION['Items'.$identifier]->LineItems); unset ($_SESSION['Items'.$identifier]); } - $_SESSION['ExistingOrder']=$_GET['ModifyOrderNumber']; + $_SESSION['ExistingOrder'.$identifier]=$_GET['ModifyOrderNumber']; $_SESSION['RequireCustomerSelection'] = 0; $_SESSION['Items'.$identifier] = new cart; @@ -292,7 +292,7 @@ set to 1. The delivery check screen is where the details of the order are either updated or inserted depending on the value of ExistingOrder */ - $_SESSION['ExistingOrder']=0; + $_SESSION['ExistingOrder'.$identifier]=0; $_SESSION['Items'.$identifier] = new cart; $_SESSION['PrintedPackingSlip'] =0; /*Of course cos the order aint even started !!*/ @@ -717,11 +717,11 @@ if (isset($_POST['CancelOrder'])) { $OK_to_delete=1; //assume this in the first instance - if($_SESSION['ExistingOrder']!=0) { //need to check that not already dispatched + if($_SESSION['ExistingOrder'.$identifier]!=0) { //need to check that not already dispatched $sql = "SELECT qtyinvoiced FROM salesorderdetails - WHERE orderno='" . $_SESSION['ExistingOrder'] . "' + WHERE orderno='" . $_SESSION['ExistingOrder'.$identifier] . "' AND qtyinvoiced>0"; $InvQties = DB_query($sql,$db); @@ -735,17 +735,17 @@ } if ($OK_to_delete==1){ - if($_SESSION['ExistingOrder']!=0){ + if($_SESSION['ExistingOrder'.$identifier]!=0){ - $SQL = "DELETE FROM salesorderdetails WHERE salesorderdetails.orderno ='" . $_SESSION['ExistingOrder'] . "'"; + $SQL = "DELETE FROM salesorderdetails WHERE salesorderdetails.orderno ='" . $_SESSION['ExistingOrder'.$identifier] . "'"; $ErrMsg =_('The order detail lines could not be deleted because'); $DelResult=DB_query($SQL,$db,$ErrMsg); - $SQL = "DELETE FROM salesorders WHERE salesorders.orderno='" . $_SESSION['ExistingOrder'] . "'"; + $SQL = "DELETE FROM salesorders WHERE salesorders.orderno='" . $_SESSION['ExistingOrder'.$identifier] . "'"; $ErrMsg = _('The order header could not be deleted because'); $DelResult=DB_query($SQL,$db,$ErrMsg); - $_SESSION['ExistingOrder']=0; + $_SESSION['ExistingOrder'.$identifier]=0; } unset($_SESSION['Items'.$identifier]->LineItems); @@ -1156,6 +1156,11 @@ //Attempt to default the due date to something sensible? $_POST['ItemDue_' . $OrderLine->LineNumber] = DateAdd (Date($_SESSION['DefaultDateFormat']),'d', $_SESSION['Items'.$identifier]->DeliveryDays); } + if (isset($_POST['OverrideDiscount_' . $OrderLine->LineNumber])) { + $_POST['OverrideDiscount_' . $OrderLine->LineNumber]= 1; + } else { + $_POST['OverrideDiscount_' . $OrderLine->LineNumber]= 0; + } if ($Quantity<0 OR $Price <0 OR $DiscountPercentage >100 OR $DiscountPercentage <0){ prnMsg(_('The item could not be updated because you are attempting to set the quantity ordered to less than 0 or the price less than 0 or the discount more than 100% or less than 0%'),'warn'); } elseif($_SESSION['Items'.$identifier]->Some_Already_Delivered($OrderLine->LineNumber)!=0 AND $_SESSION['Items'.$identifier]->LineItems[$OrderLine->LineNumber]->Price != $Price) { @@ -1172,6 +1177,7 @@ OR $OrderLine->Narrative != $Narrative OR $OrderLine->ItemDue != $_POST['ItemDue_' . $OrderLine->LineNumber] OR $OrderLine->POLine != $_POST['POLine_' . $OrderLine->LineNumber] + OR $OrderLine->OverrideDiscount != $_POST['OverrideDiscount_' . $OrderLine->LineNumber] OR isset($PropertiesArray)) { $_SESSION['Items'.$identifier]->update_cart_item($OrderLine->LineNumber, $Quantity, @@ -1179,6 +1185,7 @@ $_POST['Units_' . $OrderLine->LineNumber], $_POST['ConversionFactor_' . $OrderLine->LineNumber], ($DiscountPercentage/100), + $_POST['OverrideDiscount_' . $OrderLine->LineNumber], $Narrative, 'Yes', /*Update DB */ $_POST['ItemDue_' . $OrderLine->LineNumber], @@ -1314,12 +1321,15 @@ AND discountcategory ='" . $OrderLine->DiscCat . "' AND quantitybreak <" . $QuantityOfDiscCat,$db); $myrow = DB_fetch_row($result); - if ($myrow[0]!=0){ /* need to update the lines affected */ - foreach ($_SESSION['Items'.$identifier]->LineItems as $StkItems_2) { - /* add up total quantity of all lines of this DiscCat */ - if ($StkItems_2->DiscCat==$OrderLine->DiscCat AND $StkItems_2->DiscountPercent == 0){ - $_SESSION['Items'.$identifier]->LineItems[$StkItems_2->LineNumber]->DiscountPercent = $myrow[0]; - } + if ($myrow[0] == NULL){ + $DiscountMatrixRate = 0; + } else { + $DiscountMatrixRate = $myrow[0]; + } + foreach ($_SESSION['Items'.$identifier]->LineItems as $StkItems_2) { + /* add up total quantity of all lines of this DiscCat */ + if ($StkItems_2->DiscCat==$OrderLine->DiscCat){ + $_SESSION['Items'.$identifier]->LineItems[$StkItems_2->LineNumber]->DiscountPercent = $myrow[0]; } } } @@ -1344,7 +1354,7 @@ <th>' . _('Price') . '</th>'; if (in_array(2,$_SESSION['AllowedPageSecurityTokens'])){ - echo '<th>' . _('Discount') . '</th> + echo '<th colspan="1">' . _('Discount') . '</th> <th>' . _('GP %') . '</th>'; } echo '<th>' . _('Total') . '</th> @@ -1396,8 +1406,13 @@ if (in_array(2,$_SESSION['AllowedPageSecurityTokens'])){ /*OK to display with discount if it is an internal user with appropriate permissions */ echo '<td><input class="number" type="text" name="Price_' . $OrderLine->LineNumber . '" size="16" maxlength="16" value="' . locale_money_format($OrderLine->Price, $_SESSION['Items'.$identifier]->DefaultCurrency) . '" /></td> - <td><input class="number" type="text" name="Discount_' . $OrderLine->LineNumber . '" size="5" maxlength="4" value="' . locale_number_format($OrderLine->DiscountPercent * 100, 2) . '" />%</td> - <td><input class="number" type="text" name="GPPercent_' . $OrderLine->LineNumber . '" size="8" maxlength="40" value="' . locale_number_format($OrderLine->GPPercent,2) . '" /></td>'; + <td><input class="number" type="text" name="Discount_' . $OrderLine->LineNumber . '" size="7" maxlength="6" value="' . locale_number_format($OrderLine->DiscountPercent * 100, 2) . '" />%'; + if ( $OrderLine->OverrideDiscount==1) { + echo '<input type="checkbox" checked="True" name="OverrideDiscount_' . $OrderLine->LineNumber . '" />'._('Override').'</td>'; + } else { + echo '<input type="checkbox" name="OverrideDiscount_' . $OrderLine->LineNumber . '" />'._('Override').'</td>'; + } + echo '<td><input class="number" type="text" name="GPPercent_' . $OrderLine->LineNumber . '" size="8" maxlength="40" value="' . locale_number_format($OrderLine->GPPercent,2) . '" /></td>'; } else { echo '<td class="number">' . $OrderLine->Price . '</td><td></td>'; echo '<input type="hidden" name="Price_' . $OrderLine->LineNumber . '" value="' . $OrderLine->Price . '" />'; Modified: trunk/includes/DefineCartClass.php =================================================================== --- trunk/includes/DefineCartClass.php 2011-12-24 22:42:31 UTC (rev 8375) +++ trunk/includes/DefineCartClass.php 2011-12-24 22:42:48 UTC (rev 8376) @@ -83,6 +83,7 @@ $ActDispatchDate=NULL, $QtyInvoiced=0, $DiscCat='', + $DiscOverride=0, $Controlled=0, $Serialised=0, $DecimalPlaces=0, @@ -116,6 +117,7 @@ $Qty, $Price, $Disc, + $DiscOverride, $Units, $ConversionFactor, $Volume, @@ -161,7 +163,7 @@ itemdue, poline) VALUES('" . $this->LineCounter . "', - '" . $_SESSION['ExistingOrder'] . "', + '" . $_SESSION['ExistingOrder'.$identifier] . "', '" . trim(mb_strtoupper($StockID)) ."', '" . $Qty . "', '" . $Price . "', @@ -187,13 +189,14 @@ $Units, $ConversionFactor=1, $Disc, + $DiscOverride, $Narrative, $UpdateDB='No', $ItemDue, $POLine, $GPPercent, $ItemProperties=array()){ - +echo $DiscOverride.'xxx'; if ($Qty>0){ $this->LineItems[$UpdateLineNumber]->Quantity = $Qty; } @@ -201,6 +204,7 @@ $this->LineItems[$UpdateLineNumber]->Units = $Units; $this->LineItems[$UpdateLineNumber]->ConversionFactor = $ConversionFactor; $this->LineItems[$UpdateLineNumber]->DiscountPercent = $Disc; + $this->LineItems[$UpdateLineNumber]->OverrideDiscount = $DiscOverride; $this->LineItems[$UpdateLineNumber]->Narrative = $Narrative; $this->LineItems[$UpdateLineNumber]->ItemDue = $ItemDue; $this->LineItems[$UpdateLineNumber]->POLine = $POLine; @@ -216,7 +220,7 @@ narrative ='" . DB_escape_string($Narrative) . "', itemdue = '" . FormatDateForSQL($ItemDue) . "', poline = '" . DB_escape_string($POLine) . "' - WHERE orderno='" . $_SESSION['ExistingOrder'] . "' + WHERE orderno='" . $_SESSION['ExistingOrder'.$identifier] . "' AND orderlineno='" . $UpdateLineNumber . "'" , $db , _('The order line number') . ' ' . $UpdateLineNumber . ' ' . _('could not be updated')); @@ -234,20 +238,20 @@ if ($this->Some_Already_Delivered($LineNumber)==0){ /* nothing has been delivered, delete it. */ $result = DB_query("DELETE FROM salesorderdetails - WHERE orderno='" . $_SESSION['ExistingOrder'] . "' + WHERE orderno='" . $_SESSION['ExistingOrder'.$identifier] . "' AND orderlineno='" . $LineNumber . "'", $db, _('The order line could not be deleted because') ); - prnMsg( _('Deleted Line Number'). ' ' . $LineNumber . ' ' . _('from existing Order Number').' ' . $_SESSION['ExistingOrder'], 'success'); + prnMsg( _('Deleted Line Number'). ' ' . $LineNumber . ' ' . _('from existing Order Number').' ' . $_SESSION['ExistingOrder'.$identifier], 'success'); } else { /* something has been delivered. Clear the remaining Qty and Mark Completed */ $result = DB_query("UPDATE salesorderdetails SET quantity=qtyinvoiced, completed=1 - WHERE orderno='".$_SESSION['ExistingOrder']."' AND orderlineno='" . $LineNumber . "'" , + WHERE orderno='".$_SESSION['ExistingOrder'.$identifier]."' AND orderlineno='" . $LineNumber . "'" , $db, _('The order line could not be updated as completed because') ); - prnMsg(_('Removed Remaining Quantity and set Line Number '). ' ' . $LineNumber . ' ' . _('as Completed for existing Order Number').' ' . $_SESSION['ExistingOrder'], 'success'); + prnMsg(_('Removed Remaining Quantity and set Line Number '). ' ' . $LineNumber . ' ' . _('as Completed for existing Order Number').' ' . $_SESSION['ExistingOrder'.$identifier], 'success'); } } /* Since we need to check the LineItem above and might affect the DB, don't unset until after DB is updates occur */ @@ -429,6 +433,7 @@ var $Quantity; var $Price; var $DiscountPercent; + var $OverrideDiscount; var $Units; var $ConversionFactor; var $Volume; @@ -462,6 +467,7 @@ $Qty, $Prc, $DiscPercent, + $DiscOverride, $Units, $ConversionFactor, $Volume, @@ -491,6 +497,7 @@ $this->Quantity = $Qty; $this->Price = $Prc; $this->DiscountPercent = $DiscPercent; + $this->DiscountOverride = $DiscOverride; $this->Units = $Units; $this->ConversionFactor = $ConversionFactor; $this->Volume = $Volume; Modified: trunk/includes/SelectOrderItems_IntoCart.inc =================================================================== --- trunk/includes/SelectOrderItems_IntoCart.inc 2011-12-24 22:42:31 UTC (rev 8375) +++ trunk/includes/SelectOrderItems_IntoCart.inc 2011-12-24 22:42:48 UTC (rev 8376) @@ -77,9 +77,9 @@ /*these checks above ensure that the item has a cost if the config.php variable AllowSalesOfZeroCostItems is set to false */ - if ($_SESSION['ExistingOrder']!=0){ + if ($_SESSION['ExistingOrder'.$identifier]!=0){ $UpdateDB = 'Yes'; - $result = DB_query("SELECT MAX(orderlineno) AS newlineno FROM salesorderdetails WHERE orderno='" . $_SESSION['ExistingOrder'] . "'",$db); + $result = DB_query("SELECT MAX(orderlineno) AS newlineno FROM salesorderdetails WHERE orderno='" . $_SESSION['ExistingOrder'.$identifier] . "'",$db); $MaxNumRow = DB_fetch_row($result); if ($MaxNumRow[0] != "" and $MaxNumRow[0] > 0) { $NewLineNo = $MaxNumRow[0]+1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-01-09 11:37:56
|
Revision: 8416 http://weberp.svn.sourceforge.net/weberp/?rev=8416&view=rev Author: tim_schofield Date: 2012-01-09 11:37:46 +0000 (Mon, 09 Jan 2012) Log Message: ----------- Correctly add the cheque number and the narrative to the banktrans record and show them both in the daily bank transactionsa record Modified Paths: -------------- trunk/DailyBankTransactions.php trunk/Payments.php Modified: trunk/DailyBankTransactions.php =================================================================== --- trunk/DailyBankTransactions.php 2012-01-09 11:37:32 UTC (rev 8415) +++ trunk/DailyBankTransactions.php 2012-01-09 11:37:46 UTC (rev 8416) @@ -68,6 +68,7 @@ banktrans.banktranstype, banktrans.transdate, banktrans.ref, + banktrans.chequeno, bankaccounts.bankaccountname, systypes.typename, systypes.typeid @@ -87,12 +88,13 @@ $BankDetailRow = DB_fetch_array($BankResult); echo '<table class="selection"> <tr> - <th colspan="8"><font size="3" color="blue">' . _('Account Transactions For').' '.$BankDetailRow['bankaccountname'].' '._('Between').' '.$_POST['FromTransDate'] . ' ' . _('and') . ' ' . $_POST['ToTransDate'] . '</font></th> + <th colspan="9"><font size="3" color="blue">' . _('Account Transactions For').' '.$BankDetailRow['bankaccountname'].' '._('Between').' '.$_POST['FromTransDate'] . ' ' . _('and') . ' ' . $_POST['ToTransDate'] . '</font></th> </tr>'; echo '<tr> <th>' . _('Date') . '</th> <th>'._('Transaction type').'</th> <th>'._('Type').'</th> + <th>'._('Cheque/Voucher No').'</th> <th>'._('Reference').'</th> <th>'._('Amount in').' '.$BankDetailRow['currcode'].'</th> <th>'._('Running Total').' '.$BankDetailRow['currcode'].'</th> @@ -112,6 +114,7 @@ <td>'. ConvertSQLDate($myrow['transdate']) . '</td> <td>'.$myrow['typename'].'</td> <td>'.$myrow['banktranstype'].'</td> + <td>'.$myrow['chequeno'].'</td> <td>'.$myrow['ref'].'</td> <td class="number">'.locale_money_format($myrow['amount'],$myrow['currcode']).'</td> <td class="number">'.locale_money_format($AccountCurrTotal,$myrow['currcode']).'</td> Modified: trunk/Payments.php =================================================================== --- trunk/Payments.php 2012-01-09 11:37:32 UTC (rev 8415) +++ trunk/Payments.php 2012-01-09 11:37:46 UTC (rev 8416) @@ -181,7 +181,6 @@ } } - if (isset($_POST['Narrative']) AND $_POST['Narrative']!=''){ $_SESSION['PaymentDetail']->Narrative=$_POST['Narrative']; } @@ -199,6 +198,13 @@ $_SESSION['PaymentDetail']->Discount=0; } } +if (isset($_POST['cheque']) AND $_POST['cheque']!=''){ + $_SESSION['PaymentDetail']->cheque=$_POST['cheque']; +} else { + if (!isset($_SESSION['PaymentDetail']->cheque)) { + $_SESSION['PaymentDetail']->cheque=''; + } +} if (isset($_POST['CommitBatch'])){ @@ -381,6 +387,7 @@ type, bankact, ref, + chequeno, exrate, functionalexrate, transdate, @@ -392,6 +399,7 @@ '" . $PaymentItem->GLCode . "', '" . substr(_('Act Transfer From ') . $_SESSION['PaymentDetail']->Account . ' - ' . $PaymentItem->Narrative,0,50) . "', " . ((filter_number_input($_SESSION['PaymentDetail']->ExRate)."*".filter_number_input($_SESSION['PaymentDetail']->FunctionalExRate))."/".filter_number_input($TrfToBankExRate)). ", + '" . $PaymentItem->cheque . "', '" . $TrfToBankExRate . "', '" . FormatDateForSQL($_SESSION['PaymentDetail']->DatePaid) . "', '" . $_SESSION['PaymentDetail']->Paymenttype . "', @@ -527,6 +535,7 @@ type, bankact, ref, + chequeno, exrate, functionalexrate, transdate, @@ -537,6 +546,7 @@ '" . $Transtype . "', '" . $_SESSION['PaymentDetail']->Account . "', '" . $_SESSION['PaymentDetail']->Narrative . "', + '" . $_SESSION['PaymentDetail']->cheque . "', '" . filter_number_input($_SESSION['PaymentDetail']->ExRate) . "', '" . filter_number_input($_SESSION['PaymentDetail']->FunctionalExRate) . "', '" . FormatDateForSQL($_SESSION['PaymentDetail']->DatePaid) . "', @@ -554,6 +564,7 @@ type, bankact, ref, + chequeno, exrate, functionalexrate, transdate, @@ -563,7 +574,8 @@ $SQL= $SQL . "VALUES ('" . $TransNo . "', '" . $Transtype . "', '" . $_SESSION['PaymentDetail']->Account . "', - '" . $_SESSION['PaymentDetail']->Narrative . "', + '" . $PaymentItem->Narrative . "', + '" . $_SESSION['PaymentDetail']->cheque . "', '" . filter_number_input($_SESSION['PaymentDetail']->ExRate) . "', '" . filter_number_input($_SESSION['PaymentDetail']->FunctionalExRate) . "', '" . FormatDateForSQL($_SESSION['PaymentDetail']->DatePaid) . "', @@ -589,6 +601,7 @@ unset($_POST['Paymenttype']); unset($_POST['Currency']); unset($_POST['Narrative']); + unset($_POST['cheque']); unset($_POST['Amount']); unset($_POST['Discount']); unset($_SESSION['PaymentDetail']->GLItems); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-01-17 10:31:50
|
Revision: 8464 http://weberp.svn.sourceforge.net/weberp/?rev=8464&view=rev Author: tim_schofield Date: 2012-01-17 10:31:39 +0000 (Tue, 17 Jan 2012) Log Message: ----------- Move menu items array to a new file Modified Paths: -------------- trunk/index.php Added Paths: ----------- trunk/includes/IndexArray.php Added: trunk/includes/IndexArray.php =================================================================== --- trunk/includes/IndexArray.php (rev 0) +++ trunk/includes/IndexArray.php 2012-01-17 10:31:39 UTC (rev 8464) @@ -0,0 +1,523 @@ +<?php +$ModuleLink = array('orders', 'AR', 'AP', 'PO', 'stock', 'manuf', 'GL', 'FA', 'PC', 'system'); +$ReportList = array('orders'=>'ord', + 'AR'=>'ar', + 'AP'=>'ap', + 'PO'=>'prch', + 'stock'=>'inv', + 'manuf'=>'man', + 'GL'=>'gl', + 'FA'=>'fa', + 'PC'=>'pc', + 'system'=>'sys' + ); + +/*The headings showing on the tabs accross the main index used also in WWW_Users for defining what should be visible to the user */ +$ModuleList = array(_('Sales'), + _('Receivables'), + _('Payables'), + _('Purchases'), + _('Inventory'), + _('Manufacturing'), + _('General Ledger'), + _('Asset Manager'), + _('Petty Cash'), + _('Setup')); + +$MenuItems['orders']['Transactions']['Caption'] = array( _('Enter An Order or Quotation'), + _('Enter Counter Sales'), + _('Print Picking Lists'), + _('Outstanding Sales Orders/Quotations'), + _('Special Order'), + _('Recurring Order Template'), + _('Process Recurring Orders') + ); +$MenuItems['orders']['Transactions']['URL'] = array( '/SelectOrderItems.php?NewOrder=Yes', + '/CounterSales.php', + '/PDFPickingList.php', + '/SelectSalesOrder.php', + '/SpecialOrder.php', + '/SelectRecurringSalesOrder.php', + '/RecurringSalesOrdersProcess.php' + ); + +$MenuItems['orders']['Reports']['Caption'] = array( _('Order Inquiry'), + _('Print Price Lists'), + _('Order Status Report'), + _('Orders Invoiced Reports'), + _('Daily Sales Inquiry'), + _('Sales By Sales Type Inquiry'), + _('Sales By Category Inquiry'), + _('Top Sellers Inquiry'), + _('Order Delivery Differences Report'), + _('Delivery In Full On Time (DIFOT) Report'), + _('Sales Order Detail Or Summary Inquiries'), + _('Top Sales Items Report'), + _('Sales With Low Gross Profit Report') + ); + +$MenuItems['orders']['Reports']['URL'] = array( '/SelectCompletedOrder.php', + '/PDFPriceList.php', + '/PDFOrderStatus.php', + '/PDFOrdersInvoiced.php', + '/DailySalesInquiry.php', + '/SalesByTypePeriodInquiry.php', + '/SalesCategoryPeriodInquiry.php', + '/SalesTopItemsInquiry.php', + '/PDFDeliveryDifferences.php', + '/PDFDIFOT.php', + '/SalesInquiry.php', + '/TopItems.php', + '/PDFLowGP.php' + ); + +$MenuItems['orders']['Maintenance']['Caption'] = array( _('Select Contract'), + _('Create Contract') + ); + +$MenuItems['orders']['Maintenance']['URL'] = array( '/SelectContract.php', + '/Contracts.php' + ); + +$MenuItems['AR']['Transactions']['Caption'] = array (_('Select Order to Invoice'), + _('Create A Credit Note'), + _('Enter Receipts'), + _('Allocate Receipts or Credit Notes') + ); +$MenuItems['AR']['Transactions']['URL'] = array ('/SelectSalesOrder.php', + '/SelectCreditItems.php?NewCredit=Yes', + '/CustomerReceipt.php?NewReceipt=Yes&Type=Customer', + '/CustomerAllocations.php' + ); + +$MenuItems['AR']['Reports']['Caption'] = array (_('Where Allocated Inquiry'), + _('Print Invoices or Credit Notes'), + _('Print Statements'), + _('Sales Analysis Reports'), + _('Aged Customer Balances/Overdues Report'), + _('Re-Print A Deposit Listing'), + _('Debtor Balances At A Prior Month End'), + _('Customer Listing By Area/Salesperson'), + _('Sales Graphs'), + _('List Daily Transactions'), + _('Customer Transaction Inquiries') + ); + +$MenuItems['AR']['Reports']['URL'] = array ('/CustWhereAlloc.php', + '/PrintCustTrans.php', + '/PrintCustStatements.php', + '/SalesAnalRepts.php', + '/AgedDebtors.php', + '/PDFBankingSummary.php', + '/DebtorsAtPeriodEnd.php', + '/PDFCustomerList.php', + '/SalesGraph.php', + '/PDFCustTransListing.php', + '/CustomerTransInquiry.php' + ); + +$MenuItems['AR']['Maintenance']['Caption'] = array (_('Add Customer'), + _('Customers') + ); +$MenuItems['AR']['Maintenance']['URL'] = array ('/Customers.php', + '/SelectCustomer.php' + ); + +$MenuItems['AP']['Transactions']['Caption'] = array (_('Select Supplier'), + _('Supplier Allocations') + ); +$MenuItems['AP']['Transactions']['URL'] = array ('/SelectSupplier.php', + '/SupplierAllocations.php' + ); + +$MenuItems['AP']['Reports']['Caption'] = array (_('Aged Supplier Report'), + _('Payment Run Report'), + _('Remittance Advices'), + _('Outstanding GRNs Report'), + _('Supplier Balances At A Prior Month End'), + _('List Daily Transactions'), + _('Supplier Transaction Inquiries') + ); + +$MenuItems['AP']['Reports']['URL'] = array ('/AgedSuppliers.php', + '/SuppPaymentRun.php', + '/PDFRemittanceAdvice.php', + '/OutstandingGRNs.php', + '/SupplierBalsAtPeriodEnd.php', + '/PDFSuppTransListing.php', + '/SupplierTransInquiry.php' + ); + +$MenuItems['AP']['Maintenance']['Caption'] = array (_('Add Supplier'), + _('Maintain Factor Companies') + ); +$MenuItems['AP']['Maintenance']['URL'] = array ('/Suppliers.php', + '/Factors.php' + ); + +$MenuItems['PO']['Transactions']['Caption'] = array (_('Purchase Orders'), + _('Add Purchase Order'), + _('Create a New Tender'), + _('Edit Existing Tenders'), + _('Process Tenders and Offers'), + _('Orders to Authorise'), + _('Shipment Entry'), + _('Select A Shipment') + ); +$MenuItems['PO']['Transactions']['URL'] = array ('/PO_SelectOSPurchOrder.php', + '/PO_Header.php?NewOrder=Yes', + '/SupplierTenderCreate.php?New=Yes', + '/SupplierTenderCreate.php?Edit=Yes', + '/OffersReceived.php', + '/PO_AuthoriseMyOrders.php', + '/SelectSupplier.php', + '/Shipt_Select.php' + ); + +$MenuItems['PO']['Reports']['Caption'] = array (_('Purchase Order Inquiry'), + _('Purchase Order Detail Or Summary Inquiries') + ); + +$MenuItems['PO']['Reports']['URL'] = array ('/PO_SelectPurchOrder.php', + '/POReport.php' + ); + +$MenuItems['PO']['Maintenance']['Caption'] = array ( + ); +$MenuItems['PO']['Maintenance']['URL'] = array ( + ); +$MenuItems['stock']['Transactions']['Caption'] = array (_('Receive Purchase Orders'), + _('Bulk Inventory Transfer') . ' - ' . _('Dispatch'), + _('Bulk Inventory Transfer') . ' - ' . _('Receive'), + _('Inventory Location Transfers'), + _('Inventory Adjustments'), + _('Reverse Goods Received'), + _('Enter Stock Counts'), + _('Create a New Internal Stock Request'), + _('Authorise Internal Stock Requests'), + _('Fulfill Internal Stock Requests') + ); +$MenuItems['stock']['Transactions']['URL'] = array ('/PO_SelectOSPurchOrder.php', + '/StockLocTransfer.php', + '/StockLocTransferReceive.php', + '/StockTransfers.php?New=Yes', + '/StockAdjustments.php?NewAdjustment=Yes', + '/ReverseGRN.php', + '/StockCounts.php', + '/InternalStockRequest.php?New=Yes', + '/InternalStockRequestAuthorisation.php', + '/InternalStockRequestFulfill.php' + ); + +$MenuItems['stock']['Reports']['Caption'] = array (_('Serial Item Research Tool'), + _('Print Price Labels'), + _('Reprint GRN'), + _('Inventory Item Movements'), + _('Inventory Item Status'), + _('Inventory Item Usage'), + _('Inventory Quantities'), + _('Reorder Level'), + _('Stock Dispatch'), + _('Inventory Valuation Report'), + _('Inventory Planning Report'), + _('Inventory Planning Based On Preferred Supplier Data'), + _('Inventory Stock Check Sheets'), + _('Make Inventory Quantities CSV'), + _('Compare Counts Vs Stock Check Data'), + _('All Inventory Movements By Location/Date'), + _('List Inventory Status By Location/Category'), + _('Historical Stock Quantity By Location/Category'), + _('List Negative Stocks'), + _('Period Stock Transaction Listing'), + _('Stock Transfer Note') + ); + +$MenuItems['stock']['Reports']['URL'] = array ('/StockSerialItemResearch.php', + '/PDFPrintLabel.php', + '/ReprintGRN.php', + '/StockMovements.php', + '/StockStatus.php', + '/StockUsage.php', + '/InventoryQuantities.php', + '/ReorderLevel.php', + '/StockDispatch.php', + '/InventoryValuation.php', + '/InventoryPlanning.php', + '/InventoryPlanningPrefSupplier.php', + '/StockCheck.php', + '/StockQties_csv.php', + '/PDFStockCheckComparison.php', + '/StockLocMovements.php', + '/StockLocStatus.php', + '/StockQuantityByDate.php', + '/PDFStockNegatives.php', + '/PDFPeriodStockTransListing.php', + '/PDFStockTransfer.php' + ); + +$MenuItems['stock']['Maintenance']['Caption'] = array (_('Add A New Item'), + _('Select An Item'), + _('Sales Category Maintenance'), + _('Add or Update Prices Based On Costs'), + _('View or Update Prices Based On Costs'), + _('Reorder Level By Category/Location'), + _('Item Manufacturers') + ); +$MenuItems['stock']['Maintenance']['URL'] = array ('/Stocks.php', + '/SelectProduct.php', + '/SalesCategories.php', + '/PricesBasedOnMarkUp.php', + '/PricesByCost.php', + '/ReorderLevelLocation.php', + '/Manufacturers.php' + ); + +$MenuItems['manuf']['Transactions']['Caption'] = array (_('Work Order Entry'), + _('Select A Work Order') + ); +$MenuItems['manuf']['Transactions']['URL'] = array ('/WorkOrderEntry.php', + '/SelectWorkOrder.php' + ); + +$MenuItems['manuf']['Reports']['Caption'] = array (_('Costed Bill Of Material Inquiry'), + _('Where Used Inquiry'), + _('Indented Bill Of Material Listing'), + _('List Components Required'), + _('Indented Where Used Listing'), + _('MRP'), + _('MRP Shortages'), + _('MRP Suggested Purchase Orders'), + _('MRP Suggested Work Orders'), + _('MRP Reschedules Required') + ); + +$MenuItems['manuf']['Reports']['URL'] = array ('/BOMInquiry.php', + '/WhereUsedInquiry.php', + '/BOMIndented.php', + '/BOMExtendedQty.php', + '/BOMIndentedReverse.php', + '/MRPReport.php', + '/MRPShortages.php', + '/MRPPlannedPurchaseOrders.php', + '/MRPPlannedWorkOrders.php', + '/MRPReschedules.php' + ); + +$MenuItems['manuf']['Maintenance']['Caption'] = array (_('Work Centre'), + _('Bills Of Material'), + _('Master Schedule'), + _('Auto Create Master Schedule'), + _('MRP Calculation') + ); + +$MenuItems['manuf']['Maintenance']['URL'] = array ('/WorkCentres.php', + '/BOMs.php', + '/MRPDemands.php', + '/MRPCreateDemands.php', + '/MRP.php' + ); + +$MenuItems['GL']['Transactions']['Caption'] = array (_('Bank Account Payments Entry'), + _('Bank Account Receipts Entry'), + _('Journal Entry'), + _('Bank Account Payments Matching'), + _('Bank Account Receipts Matching') + ); + +$MenuItems['GL']['Transactions']['URL'] = array ('/Payments.php?NewPayment=Yes', + '/CustomerReceipt.php?NewReceipt=Yes&Type=GL', + '/GLJournal.php?NewJournal=Yes', + '/BankMatching.php?Type=Payments', + '/BankMatching.php?Type=Receipts' + ); + +$MenuItems['GL']['Reports']['Caption'] = array (_('Trial Balance'), + _('Account Inquiry'), + _('Account Listing'), + _('Account Listing to CSV File'), + _('General Ledger Journal Inquiry'), + _('Bank Account Reconciliation Statement'), + _('Cheque Payments Listing'), + _('Daily Bank Transactions'), + _('Profit and Loss Statement'), + _('Balance Sheet'), + _('Tag Reports'), + _('Tax Reports') + ); + +$MenuItems['GL']['Reports']['URL'] = array ('/GLTrialBalance.php', + '/SelectGLAccount.php', + '/GLAccountReport.php', + '/GLAccountCSV.php', + '/GLJournalInquiry.php', + '/BankReconciliation.php', + '/PDFChequeListing.php', + '/DailyBankTransactions.php', + '/GLProfit_Loss.php', + '/GLBalanceSheet.php', + '/GLTagProfit_Loss.php', + '/Tax.php' + ); + +$MenuItems['GL']['Maintenance']['Caption'] = array (_('GL Account'), + _('GL Budgets'), + _('Account Groups'), + _('Account Sections'), + _('GL Tags') + ); + +$MenuItems['GL']['Maintenance']['URL'] = array ('/GLAccounts.php', + '/GLBudgets.php', + '/AccountGroups.php', + '/AccountSections.php', + '/GLTags.php' + ); + +$MenuItems['FA']['Transactions']['Caption'] = array (_('Add a new Asset'), + _('Select an Asset'), + _('Change Asset Location'), + _('Depreciation Journal') + ); + +$MenuItems['FA']['Transactions']['URL'] = array ('/FixedAssetItems.php', + '/SelectAsset.php', + '/FixedAssetTransfer.php', + '/FixedAssetDepreciation.php' + ); + +$MenuItems['FA']['Reports']['Caption'] = array (_('Asset Register'), + ); + +$MenuItems['FA']['Reports']['URL'] = array ('/FixedAssetRegister.php', + ); + +$MenuItems['FA']['Maintenance']['Caption'] = array (_('Asset Categories Maintenance'), + _('Add or Maintain Asset Locations') + ); + +$MenuItems['FA']['Maintenance']['URL'] = array ('/FixedAssetCategories.php', + '/FixedAssetLocations.php' + ); + +$MenuItems['PC']['Transactions']['Caption'] = array (_('Assign Cash to PC Tab'), + _('Claim Expenses From PC Tab'), + _('Expenses Authorisation') + ); + +$MenuItems['PC']['Transactions']['URL'] = array ('/PcAssignCashToTab.php', + '/PcClaimExpensesFromTab.php', + '/PcAuthorizeExpenses.php' + ); + +$MenuItems['PC']['Reports']['Caption'] = array (_('PC Tab General Report'), + ); + +$MenuItems['PC']['Reports']['URL'] = array ('/PcReportTab.php', + ); + +$MenuItems['PC']['Maintenance']['Caption'] = array (_('Types of PC Tabs'), + _('PC Tabs'), + _('PC Expenses'), + _('Expenses for Type of PC Tab') + ); + +$MenuItems['PC']['Maintenance']['URL'] = array ('/PcTypeTabs.php', + '/PcTabs.php', + '/PcExpenses.php', + '/PcExpensesTypeTab.php' + ); + +$MenuItems['system']['Transactions']['Caption'] = array (_('Company Preferences'), + _('Configuration Settings'), + _('User Maintenance'), + _('Maintain Security Tokens'), + _('Role Permissions'), + _('Page Security Settings'), + _('Bank Accounts'), + _('Currency Maintenance'), + _('Tax Authorities and Rates Maintenance'), + _('Tax Group Maintenance'), + _('Dispatch Tax Province Maintenance'), + _('Tax Category Maintenance'), + _('List Periods Defined'), + _('Report Builder Tool'), + _('View Audit Trail'), + _('Geocode Setup'), + _('Form Layout Editor'), + _('Label Templates Maintenance'), + _('SMTP Server Details') + ); + +$MenuItems['system']['Transactions']['URL'] = array ('/CompanyPreferences.php', + '/SystemParameters.php', + '/WWW_Users.php', + '/SecurityTokens.php', + '/WWW_Access.php', + '/PageSecurity.php', + '/BankAccounts.php', + '/Currencies.php', + '/TaxAuthorities.php', + '/TaxGroups.php', + '/TaxProvinces.php', + '/TaxCategories.php', + '/PeriodsInquiry.php', + '/reportwriter/admin/ReportCreator.php', + '/AuditTrail.php', + '/GeocodeSetup.php', + '/FormDesigner.php', + '/Labels.php', + '/SMTPServer.php' + ); + +$MenuItems['system']['Reports']['Caption'] = array (_('Sales Types'), + _('Customer Types'), + _('Supplier Types'), + _('Credit Status'), + _('Payment Terms'), + _('Set Purchase Order Authorisation levels'), + _('Payment Methods'), + _('Sales People'), + _('Sales Areas'), + _('Shippers'), + _('Sales GL Interface Postings'), + _('COGS GL Interface Postings'), + _('Freight Costs Maintenance'), + _('Discount Matrix') + ); + +$MenuItems['system']['Reports']['URL'] = array ('/SalesTypes.php', + '/CustomerTypes.php', + '/SupplierTypes.php', + '/CreditStatus.php', + '/PaymentTerms.php', + '/PO_AuthorisationLevels.php', + '/PaymentMethods.php', + '/SalesPeople.php', + '/Areas.php', + '/Shippers.php', + '/SalesGLPostings.php', + '/COGSGLPostings.php', + '/FreightCosts.php', + '/DiscountMatrix.php' + ); + +$MenuItems['system']['Maintenance']['Caption'] = array (_('Inventory Categories Maintenance'), + _('Inventory Locations Maintenance'), + _('Discount Category Maintenance'), + _('Units of Measure'), + _('MRP Available Production Days'), + _('MRP Demand Types'), + _('Create and Manage Database Backups'), + _('Maintain Internal Departments') + ); + +$MenuItems['system']['Maintenance']['URL'] = array ('/StockCategories.php', + '/Locations.php', + '/DiscountCategories.php', + '/UnitsOfMeasure.php', + '/MRPCalendar.php', + '/MRPDemandTypes.php', + '/BackupDatabase.php', + '/Departments.php' + ); +?> \ No newline at end of file Modified: trunk/index.php =================================================================== --- trunk/index.php 2012-01-13 22:27:08 UTC (rev 8463) +++ trunk/index.php 2012-01-17 10:31:39 UTC (rev 8464) @@ -6,528 +6,8 @@ include('includes/header.inc'); /*The module link codes are hard coded in a switch statement below to determine the options to show for each tab */ -$ModuleLink = array('orders', 'AR', 'AP', 'PO', 'stock', 'manuf', 'GL', 'FA', 'PC', 'system'); -$ReportList = array('orders'=>'ord', - 'AR'=>'ar', - 'AP'=>'ap', - 'PO'=>'prch', - 'stock'=>'inv', - 'manuf'=>'man', - 'GL'=>'gl', - 'FA'=>'fa', - 'PC'=>'pc', - 'system'=>'sys' - ); +include('includes/IndexArray.php'); -/*The headings showing on the tabs accross the main index used also in WWW_Users for defining what should be visible to the user */ -$ModuleList = array(_('Sales'), - _('Receivables'), - _('Payables'), - _('Purchases'), - _('Inventory'), - _('Manufacturing'), - _('General Ledger'), - _('Asset Manager'), - _('Petty Cash'), - _('Setup')); - -$MenuItems['orders']['Transactions']['Caption'] = array( _('Enter An Order or Quotation'), - _('Enter Counter Sales'), - _('Print Picking Lists'), - _('Outstanding Sales Orders/Quotations'), - _('Special Order'), - _('Recurring Order Template'), - _('Process Recurring Orders') - ); -$MenuItems['orders']['Transactions']['URL'] = array( '/SelectOrderItems.php?NewOrder=Yes', - '/CounterSales.php', - '/PDFPickingList.php', - '/SelectSalesOrder.php', - '/SpecialOrder.php', - '/SelectRecurringSalesOrder.php', - '/RecurringSalesOrdersProcess.php' - ); - -$MenuItems['orders']['Reports']['Caption'] = array( _('Order Inquiry'), - _('Print Price Lists'), - _('Order Status Report'), - _('Orders Invoiced Reports'), - _('Daily Sales Inquiry'), - _('Sales By Sales Type Inquiry'), - _('Sales By Category Inquiry'), - _('Top Sellers Inquiry'), - _('Order Delivery Differences Report'), - _('Delivery In Full On Time (DIFOT) Report'), - _('Sales Order Detail Or Summary Inquiries'), - _('Top Sales Items Report'), - _('Sales With Low Gross Profit Report') - ); - -$MenuItems['orders']['Reports']['URL'] = array( '/SelectCompletedOrder.php', - '/PDFPriceList.php', - '/PDFOrderStatus.php', - '/PDFOrdersInvoiced.php', - '/DailySalesInquiry.php', - '/SalesByTypePeriodInquiry.php', - '/SalesCategoryPeriodInquiry.php', - '/SalesTopItemsInquiry.php', - '/PDFDeliveryDifferences.php', - '/PDFDIFOT.php', - '/SalesInquiry.php', - '/TopItems.php', - '/PDFLowGP.php' - ); - -$MenuItems['orders']['Maintenance']['Caption'] = array( _('Select Contract'), - _('Create Contract') - ); - -$MenuItems['orders']['Maintenance']['URL'] = array( '/SelectContract.php', - '/Contracts.php' - ); - -$MenuItems['AR']['Transactions']['Caption'] = array (_('Select Order to Invoice'), - _('Create A Credit Note'), - _('Enter Receipts'), - _('Allocate Receipts or Credit Notes') - ); -$MenuItems['AR']['Transactions']['URL'] = array ('/SelectSalesOrder.php', - '/SelectCreditItems.php?NewCredit=Yes', - '/CustomerReceipt.php?NewReceipt=Yes&Type=Customer', - '/CustomerAllocations.php' - ); - -$MenuItems['AR']['Reports']['Caption'] = array (_('Where Allocated Inquiry'), - _('Print Invoices or Credit Notes'), - _('Print Statements'), - _('Sales Analysis Reports'), - _('Aged Customer Balances/Overdues Report'), - _('Re-Print A Deposit Listing'), - _('Debtor Balances At A Prior Month End'), - _('Customer Listing By Area/Salesperson'), - _('Sales Graphs'), - _('List Daily Transactions'), - _('Customer Transaction Inquiries') - ); - -$MenuItems['AR']['Reports']['URL'] = array ('/CustWhereAlloc.php', - '/PrintCustTrans.php', - '/PrintCustStatements.php', - '/SalesAnalRepts.php', - '/AgedDebtors.php', - '/PDFBankingSummary.php', - '/DebtorsAtPeriodEnd.php', - '/PDFCustomerList.php', - '/SalesGraph.php', - '/PDFCustTransListing.php', - '/CustomerTransInquiry.php' - ); - -$MenuItems['AR']['Maintenance']['Caption'] = array (_('Add Customer'), - _('Customers') - ); -$MenuItems['AR']['Maintenance']['URL'] = array ('/Customers.php', - '/SelectCustomer.php' - ); - -$MenuItems['AP']['Transactions']['Caption'] = array (_('Select Supplier'), - _('Supplier Allocations') - ); -$MenuItems['AP']['Transactions']['URL'] = array ('/SelectSupplier.php', - '/SupplierAllocations.php' - ); - -$MenuItems['AP']['Reports']['Caption'] = array (_('Aged Supplier Report'), - _('Payment Run Report'), - _('Remittance Advices'), - _('Outstanding GRNs Report'), - _('Supplier Balances At A Prior Month End'), - _('List Daily Transactions'), - _('Supplier Transaction Inquiries') - ); - -$MenuItems['AP']['Reports']['URL'] = array ('/AgedSuppliers.php', - '/SuppPaymentRun.php', - '/PDFRemittanceAdvice.php', - '/OutstandingGRNs.php', - '/SupplierBalsAtPeriodEnd.php', - '/PDFSuppTransListing.php', - '/SupplierTransInquiry.php' - ); - -$MenuItems['AP']['Maintenance']['Caption'] = array (_('Add Supplier'), - _('Maintain Factor Companies') - ); -$MenuItems['AP']['Maintenance']['URL'] = array ('/Suppliers.php', - '/Factors.php' - ); - -$MenuItems['PO']['Transactions']['Caption'] = array (_('Purchase Orders'), - _('Add Purchase Order'), - _('Create a New Tender'), - _('Edit Existing Tenders'), - _('Process Tenders and Offers'), - _('Orders to Authorise'), - _('Shipment Entry'), - _('Select A Shipment') - ); -$MenuItems['PO']['Transactions']['URL'] = array ('/PO_SelectOSPurchOrder.php', - '/PO_Header.php?NewOrder=Yes', - '/SupplierTenderCreate.php?New=Yes', - '/SupplierTenderCreate.php?Edit=Yes', - '/OffersReceived.php', - '/PO_AuthoriseMyOrders.php', - '/SelectSupplier.php', - '/Shipt_Select.php' - ); - -$MenuItems['PO']['Reports']['Caption'] = array (_('Purchase Order Inquiry'), - _('Purchase Order Detail Or Summary Inquiries') - ); - -$MenuItems['PO']['Reports']['URL'] = array ('/PO_SelectPurchOrder.php', - '/POReport.php' - ); - -$MenuItems['PO']['Maintenance']['Caption'] = array ( - ); -$MenuItems['PO']['Maintenance']['URL'] = array ( - ); -$MenuItems['stock']['Transactions']['Caption'] = array (_('Receive Purchase Orders'), - _('Bulk Inventory Transfer') . ' - ' . _('Dispatch'), - _('Bulk Inventory Transfer') . ' - ' . _('Receive'), - _('Inventory Location Transfers'), - _('Inventory Adjustments'), - _('Reverse Goods Received'), - _('Enter Stock Counts'), - _('Create a New Internal Stock Request'), - _('Authorise Internal Stock Requests'), - _('Fulfill Internal Stock Requests') - ); -$MenuItems['stock']['Transactions']['URL'] = array ('/PO_SelectOSPurchOrder.php', - '/StockLocTransfer.php', - '/StockLocTransferReceive.php', - '/StockTransfers.php?New=Yes', - '/StockAdjustments.php?NewAdjustment=Yes', - '/ReverseGRN.php', - '/StockCounts.php', - '/InternalStockRequest.php?New=Yes', - '/InternalStockRequestAuthorisation.php', - '/InternalStockRequestFulfill.php' - ); - -$MenuItems['stock']['Reports']['Caption'] = array (_('Serial Item Research Tool'), - _('Print Price Labels'), - _('Reprint GRN'), - _('Inventory Item Movements'), - _('Inventory Item Status'), - _('Inventory Item Usage'), - _('Inventory Quantities'), - _('Reorder Level'), - _('Stock Dispatch'), - _('Inventory Valuation Report'), - _('Inventory Planning Report'), - _('Inventory Planning Based On Preferred Supplier Data'), - _('Inventory Stock Check Sheets'), - _('Make Inventory Quantities CSV'), - _('Compare Counts Vs Stock Check Data'), - _('All Inventory Movements By Location/Date'), - _('List Inventory Status By Location/Category'), - _('Historical Stock Quantity By Location/Category'), - _('List Negative Stocks'), - _('Period Stock Transaction Listing'), - _('Stock Transfer Note') - ); - -$MenuItems['stock']['Reports']['URL'] = array ('/StockSerialItemResearch.php', - '/PDFPrintLabel.php', - '/ReprintGRN.php', - '/StockMovements.php', - '/StockStatus.php', - '/StockUsage.php', - '/InventoryQuantities.php', - '/ReorderLevel.php', - '/StockDispatch.php', - '/InventoryValuation.php', - '/InventoryPlanning.php', - '/InventoryPlanningPrefSupplier.php', - '/StockCheck.php', - '/StockQties_csv.php', - '/PDFStockCheckComparison.php', - '/StockLocMovements.php', - '/StockLocStatus.php', - '/StockQuantityByDate.php', - '/PDFStockNegatives.php', - '/PDFPeriodStockTransListing.php', - '/PDFStockTransfer.php' - ); - -$MenuItems['stock']['Maintenance']['Caption'] = array (_('Add A New Item'), - _('Select An Item'), - _('Sales Category Maintenance'), - _('Add or Update Prices Based On Costs'), - _('View or Update Prices Based On Costs'), - _('Reorder Level By Category/Location'), - _('Item Manufacturers') - ); -$MenuItems['stock']['Maintenance']['URL'] = array ('/Stocks.php', - '/SelectProduct.php', - '/SalesCategories.php', - '/PricesBasedOnMarkUp.php', - '/PricesByCost.php', - '/ReorderLevelLocation.php', - '/Manufacturers.php' - ); - -$MenuItems['manuf']['Transactions']['Caption'] = array (_('Work Order Entry'), - _('Select A Work Order') - ); -$MenuItems['manuf']['Transactions']['URL'] = array ('/WorkOrderEntry.php', - '/SelectWorkOrder.php' - ); - -$MenuItems['manuf']['Reports']['Caption'] = array (_('Costed Bill Of Material Inquiry'), - _('Where Used Inquiry'), - _('Indented Bill Of Material Listing'), - _('List Components Required'), - _('Indented Where Used Listing'), - _('MRP'), - _('MRP Shortages'), - _('MRP Suggested Purchase Orders'), - _('MRP Suggested Work Orders'), - _('MRP Reschedules Required') - ); - -$MenuItems['manuf']['Reports']['URL'] = array ('/BOMInquiry.php', - '/WhereUsedInquiry.php', - '/BOMIndented.php', - '/BOMExtendedQty.php', - '/BOMIndentedReverse.php', - '/MRPReport.php', - '/MRPShortages.php', - '/MRPPlannedPurchaseOrders.php', - '/MRPPlannedWorkOrders.php', - '/MRPReschedules.php' - ); - -$MenuItems['manuf']['Maintenance']['Caption'] = array (_('Work Centre'), - _('Bills Of Material'), - _('Master Schedule'), - _('Auto Create Master Schedule'), - _('MRP Calculation') - ); - -$MenuItems['manuf']['Maintenance']['URL'] = array ('/WorkCentres.php', - '/BOMs.php', - '/MRPDemands.php', - '/MRPCreateDemands.php', - '/MRP.php' - ); - -$MenuItems['GL']['Transactions']['Caption'] = array (_('Bank Account Payments Entry'), - _('Bank Account Receipts Entry'), - _('Journal Entry'), - _('Bank Account Payments Matching'), - _('Bank Account Receipts Matching') - ); - -$MenuItems['GL']['Transactions']['URL'] = array ('/Payments.php?NewPayment=Yes', - '/CustomerReceipt.php?NewReceipt=Yes&Type=GL', - '/GLJournal.php?NewJournal=Yes', - '/BankMatching.php?Type=Payments', - '/BankMatching.php?Type=Receipts' - ); - -$MenuItems['GL']['Reports']['Caption'] = array (_('Trial Balance'), - _('Account Inquiry'), - _('Account Listing'), - _('Account Listing to CSV File'), - _('General Ledger Journal Inquiry'), - _('Bank Account Reconciliation Statement'), - _('Cheque Payments Listing'), - _('Daily Bank Transactions'), - _('Profit and Loss Statement'), - _('Balance Sheet'), - _('Tag Reports'), - _('Tax Reports') - ); - -$MenuItems['GL']['Reports']['URL'] = array ('/GLTrialBalance.php', - '/SelectGLAccount.php', - '/GLAccountReport.php', - '/GLAccountCSV.php', - '/GLJournalInquiry.php', - '/BankReconciliation.php', - '/PDFChequeListing.php', - '/DailyBankTransactions.php', - '/GLProfit_Loss.php', - '/GLBalanceSheet.php', - '/GLTagProfit_Loss.php', - '/Tax.php' - ); - -$MenuItems['GL']['Maintenance']['Caption'] = array (_('GL Account'), - _('GL Budgets'), - _('Account Groups'), - _('Account Sections'), - _('GL Tags') - ); - -$MenuItems['GL']['Maintenance']['URL'] = array ('/GLAccounts.php', - '/GLBudgets.php', - '/AccountGroups.php', - '/AccountSections.php', - '/GLTags.php' - ); - -$MenuItems['FA']['Transactions']['Caption'] = array (_('Add a new Asset'), - _('Select an Asset'), - _('Change Asset Location'), - _('Depreciation Journal') - ); - -$MenuItems['FA']['Transactions']['URL'] = array ('/FixedAssetItems.php', - '/SelectAsset.php', - '/FixedAssetTransfer.php', - '/FixedAssetDepreciation.php' - ); - -$MenuItems['FA']['Reports']['Caption'] = array (_('Asset Register'), - ); - -$MenuItems['FA']['Reports']['URL'] = array ('/FixedAssetRegister.php', - ); - -$MenuItems['FA']['Maintenance']['Caption'] = array (_('Asset Categories Maintenance'), - _('Add or Maintain Asset Locations') - ); - -$MenuItems['FA']['Maintenance']['URL'] = array ('/FixedAssetCategories.php', - '/FixedAssetLocations.php' - ); - -$MenuItems['PC']['Transactions']['Caption'] = array (_('Assign Cash to PC Tab'), - _('Claim Expenses From PC Tab'), - _('Expenses Authorisation') - ); - -$MenuItems['PC']['Transactions']['URL'] = array ('/PcAssignCashToTab.php', - '/PcClaimExpensesFromTab.php', - '/PcAuthorizeExpenses.php' - ); - -$MenuItems['PC']['Reports']['Caption'] = array (_('PC Tab General Report'), - ); - -$MenuItems['PC']['Reports']['URL'] = array ('/PcReportTab.php', - ); - -$MenuItems['PC']['Maintenance']['Caption'] = array (_('Types of PC Tabs'), - _('PC Tabs'), - _('PC Expenses'), - _('Expenses for Type of PC Tab') - ); - -$MenuItems['PC']['Maintenance']['URL'] = array ('/PcTypeTabs.php', - '/PcTabs.php', - '/PcExpenses.php', - '/PcExpensesTypeTab.php' - ); - -$MenuItems['system']['Transactions']['Caption'] = array (_('Company Preferences'), - _('Configuration Settings'), - _('User Maintenance'), - _('Maintain Security Tokens'), - _('Role Permissions'), - _('Page Security Settings'), - _('Bank Accounts'), - _('Currency Maintenance'), - _('Tax Authorities and Rates Maintenance'), - _('Tax Group Maintenance'), - _('Dispatch Tax Province Maintenance'), - _('Tax Category Maintenance'), - _('List Periods Defined'), - _('Report Builder Tool'), - _('View Audit Trail'), - _('Geocode Setup'), - _('Form Layout Editor'), - _('Label Templates Maintenance'), - _('SMTP Server Details') - ); - -$MenuItems['system']['Transactions']['URL'] = array ('/CompanyPreferences.php', - '/SystemParameters.php', - '/WWW_Users.php', - '/SecurityTokens.php', - '/WWW_Access.php', - '/PageSecurity.php', - '/BankAccounts.php', - '/Currencies.php', - '/TaxAuthorities.php', - '/TaxGroups.php', - '/TaxProvinces.php', - '/TaxCategories.php', - '/PeriodsInquiry.php', - '/reportwriter/admin/ReportCreator.php', - '/AuditTrail.php', - '/GeocodeSetup.php', - '/FormDesigner.php', - '/Labels.php', - '/SMTPServer.php' - ); - -$MenuItems['system']['Reports']['Caption'] = array (_('Sales Types'), - _('Customer Types'), - _('Supplier Types'), - _('Credit Status'), - _('Payment Terms'), - _('Set Purchase Order Authorisation levels'), - _('Payment Methods'), - _('Sales People'), - _('Sales Areas'), - _('Shippers'), - _('Sales GL Interface Postings'), - _('COGS GL Interface Postings'), - _('Freight Costs Maintenance'), - _('Discount Matrix') - ); - -$MenuItems['system']['Reports']['URL'] = array ('/SalesTypes.php', - '/CustomerTypes.php', - '/SupplierTypes.php', - '/CreditStatus.php', - '/PaymentTerms.php', - '/PO_AuthorisationLevels.php', - '/PaymentMethods.php', - '/SalesPeople.php', - '/Areas.php', - '/Shippers.php', - '/SalesGLPostings.php', - '/COGSGLPostings.php', - '/FreightCosts.php', - '/DiscountMatrix.php' - ); - -$MenuItems['system']['Maintenance']['Caption'] = array (_('Inventory Categories Maintenance'), - _('Inventory Locations Maintenance'), - _('Discount Category Maintenance'), - _('Units of Measure'), - _('MRP Available Production Days'), - _('MRP Demand Types'), - _('Create and Manage Database Backups'), - _('Maintain Internal Departments') - ); - -$MenuItems['system']['Maintenance']['URL'] = array ('/StockCategories.php', - '/Locations.php', - '/DiscountCategories.php', - '/UnitsOfMeasure.php', - '/MRPCalendar.php', - '/MRPDemandTypes.php', - '/BackupDatabase.php', - '/Departments.php' - ); - if (isset($SupplierLogin) and $SupplierLogin==1){ echo '<table class="table_index"> <tr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-01-18 14:50:34
|
Revision: 8468 http://weberp.svn.sourceforge.net/weberp/?rev=8468&view=rev Author: tim_schofield Date: 2012-01-18 14:50:28 +0000 (Wed, 18 Jan 2012) Log Message: ----------- Fix mistakes in adding items into the cart class Modified Paths: -------------- trunk/ConfirmDispatch_Invoice.php trunk/includes/DefineCartClass.php trunk/includes/SelectOrderItems_IntoCart.inc Modified: trunk/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2012-01-18 10:38:31 UTC (rev 8467) +++ trunk/ConfirmDispatch_Invoice.php 2012-01-18 14:50:28 UTC (rev 8468) @@ -171,6 +171,7 @@ $myrow['actualdispatchdate'], $myrow['qtyinvoiced'], $myrow['discountcategory'], + 0, // Discount override $myrow['controlled'], $myrow['serialised'], $myrow['decimalplaces'], Modified: trunk/includes/DefineCartClass.php =================================================================== --- trunk/includes/DefineCartClass.php 2012-01-18 10:38:31 UTC (rev 8467) +++ trunk/includes/DefineCartClass.php 2012-01-18 14:50:28 UTC (rev 8468) @@ -106,10 +106,11 @@ if ($Price<0){ /*madness check - use a credit note to give money away!*/ $Price=0; } + if ($LineNumber==-1) { + $LineNumber = $this->LineCounter; + } - $LineNumber = $this->LineCounter; - $this->LineItems[$LineNumber] = new LineDetails($LineNumber, $StockID, $Descr, Modified: trunk/includes/SelectOrderItems_IntoCart.inc =================================================================== --- trunk/includes/SelectOrderItems_IntoCart.inc 2012-01-18 10:38:31 UTC (rev 8467) +++ trunk/includes/SelectOrderItems_IntoCart.inc 2012-01-18 14:50:28 UTC (rev 8468) @@ -146,6 +146,7 @@ NULL, /*Actual Dispatch Date */ 0, /*Qty Invoiced */ $myItemRow['discountcategory'], + 0, //Discount override $myItemRow['controlled'], /*Controlled - dont care */ $myItemRow['serialised'], /* need to know for autocreation wos */ $myItemRow['decimalplaces'], This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-01-22 10:17:56
|
Revision: 8475 http://weberp.svn.sourceforge.net/weberp/?rev=8475&view=rev Author: tim_schofield Date: 2012-01-22 10:17:50 +0000 (Sun, 22 Jan 2012) Log Message: ----------- Fix bug when saving an offer update Modified Paths: -------------- trunk/SupplierTenders.php trunk/includes/DefineOfferClass.php Modified: trunk/SupplierTenders.php =================================================================== --- trunk/SupplierTenders.php 2012-01-22 10:08:27 UTC (rev 8474) +++ trunk/SupplierTenders.php 2012-01-22 10:17:50 UTC (rev 8475) @@ -209,11 +209,11 @@ if (isset($_POST['Update'])) { foreach ($_POST as $key => $value) { - if (mb_substr($key,0,3)=='qty') { + if (mb_substr($key,0,3)=='Qty') { $LineNo=mb_substr($key,3); $Quantity=$value; } - if (mb_substr($key,0,5)=='price') { + if (mb_substr($key,0,5)=='Price') { $Price=$value; } if (mb_substr($key,0,10)=='expirydate') { @@ -237,11 +237,11 @@ if (isset($_POST['Save'])) { foreach ($_POST as $key => $value) { - if (mb_substr($key,0,3)=='qty') { + if (mb_substr($key,0,3)=='Qty') { $LineNo=mb_substr($key,3); $Quantity=$value; } - if (mb_substr($key,0,5)=='price') { + if (mb_substr($key,0,5)=='Price') { $Price=$value; } if (mb_substr($key,0,10)=='expirydate') { Modified: trunk/includes/DefineOfferClass.php =================================================================== --- trunk/includes/DefineOfferClass.php 2012-01-22 10:08:27 UTC (rev 8474) +++ trunk/includes/DefineOfferClass.php 2012-01-22 10:17:50 UTC (rev 8475) @@ -108,21 +108,21 @@ } } } else { - foreach ($_SESSION['offer']->LineItems as $LineItems) { + foreach ($this->LineItems as $LineItem) { $sql="UPDATE offers SET - quantity='".$LineItems->Quantity."', - price='".$LineItems->Price."', - expirydate='".FormatDateForSQL($LineItems->ExpiryDate)."' - WHERE offerid='".$LineItems->LineNo . "'"; + quantity='".$LineItem->Quantity."', + price='".$LineItem->Price."', + expirydate='".FormatDateForSQL($LineItem->ExpiryDate)."' + WHERE offerid='".$LineItem->LineNo . "'"; $ErrMsg = _('The suppliers offer could not be updated on the database because'); $DbgMsg = _('The SQL statement used to update the suppliers offer record and failed was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); if (DB_error_no($db)==0) { - prnMsg( _('The offer for').' '.$LineItems->StockID.' '._('has been updated in the database'), 'success'); - $this->OfferMailText .= $LineItems->Quantity.' '.$LineItems->Units.' '._('of').' '.$LineItems->StockID.' '._('at a price of'). - ' '.$this->CurrCode.$LineItems->Price."\n"; + prnMsg( _('The offer for').' '.$LineItem->StockID.' '._('has been updated in the database'), 'success'); + $this->OfferMailText .= $LineItem->Quantity.' '.$LineItem->Units.' '._('of').' '.$LineItem->StockID.' '._('at a price of'). + ' '.$this->CurrCode.$LineItem->Price."\n"; } else { - prnMsg( _('The offer for').' '.$LineItems->StockID.' '._('could not be updated in the database'), 'error'); + prnMsg( _('The offer for').' '.$LineItem->StockID.' '._('could not be updated in the database'), '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...> - 2012-01-30 12:57:03
|
Revision: 8486 http://weberp.svn.sourceforge.net/weberp/?rev=8486&view=rev Author: tim_schofield Date: 2012-01-30 12:56:55 +0000 (Mon, 30 Jan 2012) Log Message: ----------- Add in facility for separate issueing GL account for each stock category Modified Paths: -------------- trunk/InternalStockRequestFulfill.php trunk/StockCategories.php trunk/includes/SQL_CommonFunctions.inc trunk/includes/session.inc Added Paths: ----------- trunk/sql/mysql/updates/105.php Modified: trunk/InternalStockRequestFulfill.php =================================================================== --- trunk/InternalStockRequestFulfill.php 2012-01-29 20:48:00 UTC (rev 8485) +++ trunk/InternalStockRequestFulfill.php 2012-01-30 12:56:55 UTC (rev 8486) @@ -120,7 +120,7 @@ '" .$AdjustmentNumber . "', '" . $SQLAdjustmentDate . "', '" . $PeriodNo . "', - '" . $StockGLCodes['adjglact'] . "', + '" . $StockGLCodes['issueglact'] . "', '" . $StandardCost * -($Quantity) . "', '" . $Narrative . "', '" . $Tag . "' Modified: trunk/StockCategories.php =================================================================== --- trunk/StockCategories.php 2012-01-29 20:48:00 UTC (rev 8485) +++ trunk/StockCategories.php 2012-01-30 12:56:55 UTC (rev 8486) @@ -73,6 +73,7 @@ categorydescription = '" . $_POST['CategoryDescription'] . "', stockact = " . $_POST['StockAct'] . ", adjglact = " . $_POST['AdjGLAct'] . ", + issueglact = " . $_POST['IssueGLAct'] . ", purchpricevaract = " . $_POST['PurchPriceVarAct'] . ", materialuseagevarac = " . $_POST['MaterialUseageVarAc'] . ", wipact = " . $_POST['WIPAct'] . " @@ -142,6 +143,7 @@ categorydescription, stockact, adjglact, + issueglact, purchpricevaract, materialuseagevarac, wipact) @@ -151,6 +153,7 @@ '" . $_POST['CategoryDescription'] . "', " . $_POST['StockAct'] . ", " . $_POST['AdjGLAct'] . ", + " . $_POST['IssueGLAct'] . ", " . $_POST['PurchPriceVarAct'] . ", " . $_POST['MaterialUseageVarAc'] . ", " . $_POST['WIPAct'] . ")"; @@ -165,6 +168,7 @@ unset($_POST['CategoryDescription']); unset($_POST['StockAct']); unset($_POST['AdjGLAct']); + unset($_POST['IssueGLAct']); unset($_POST['PurchPriceVarAct']); unset($_POST['MaterialUseageVarAc']); unset($_POST['WIPAct']); @@ -216,6 +220,7 @@ stocktype, stockact, adjglact, + issueglact, purchpricevaract, materialuseagevarac, wipact @@ -228,6 +233,7 @@ <th>' . _('Type') . '</th> <th>' . _('Stock GL') . '</th> <th>' . _('Adjts GL') . '</th> + <th>' . _('Issues GL') . '</th> <th>' . _('Price Var GL') . '</th> <th>' . _('Usage Var GL') . '</th> <th>' . _('WIP GL') . '</th></tr>'; @@ -250,6 +256,7 @@ <td class="number">%s</td> <td class="number">%s</td> <td class="number">%s</td> + <td class="number">%s</td> <td><a href="%sSelectedCategory=%s">' . _('Edit') . '</td> <td><a href="%sSelectedCategory=%s&delete=yes" onclick="return confirm("' . _('Are you sure you wish to delete this stock category? Additional checks will be performed before actual deletion to ensure data integrity is not compromised.') . '");">' . _('Delete') . '</td> </tr>', @@ -258,6 +265,7 @@ $myrow['stocktype'], $myrow['stockact'], $myrow['adjglact'], + $myrow['issueglact'], $myrow['purchpricevaract'], $myrow['materialuseagevarac'], $myrow['wipact'], @@ -272,221 +280,238 @@ //end of ifs and buts! -?> +echo '<br />'; -<br /> -<?php -if (isset($SelectedCategory)) { ?> - <div class='centre'><a href="<?php echo $_SERVER['PHP_SELF'];?>"><?php echo _('Show All Stock Categories'); ?></a></div> -<?php } ?> +if (isset($SelectedCategory)) { + echo '<a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" >' . _('Show All Stock Categories') . '</a></div>'; +} -<br /> +echo '<br />'; -<?php +echo '<form name="CategoryForm" method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; +echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; +if (isset($SelectedCategory)) { + //editing an existing stock category + if (!isset($_POST['UpdateTypes'])) { + $sql = "SELECT categoryid, + stocktype, + categorydescription, + stockact, + adjglact, + issueglact, + purchpricevaract, + materialuseagevarac, + wipact + FROM stockcategory + WHERE categoryid='" . $SelectedCategory . "'"; - echo '<form name="CategoryForm" method="post" action="' . $_SERVER['PHP_SELF'] . '">'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + $result = DB_query($sql, $db); + $myrow = DB_fetch_array($result); - if (isset($SelectedCategory)) { - //editing an existing stock category - if (!isset($_POST['UpdateTypes'])) { - $sql = "SELECT categoryid, - stocktype, - categorydescription, - stockact, - adjglact, - purchpricevaract, - materialuseagevarac, - wipact - FROM stockcategory - WHERE categoryid='" . $SelectedCategory . "'"; + $_POST['CategoryID'] = $myrow['categoryid']; + $_POST['StockType'] = $myrow['stocktype']; + $_POST['CategoryDescription'] = $myrow['categorydescription']; + $_POST['StockAct'] = $myrow['stockact']; + $_POST['AdjGLAct'] = $myrow['adjglact']; + $_POST['IssueGLAct'] = $myrow['issueglact']; + $_POST['PurchPriceVarAct'] = $myrow['purchpricevaract']; + $_POST['MaterialUseageVarAc'] = $myrow['materialuseagevarac']; + $_POST['WIPAct'] = $myrow['wipact']; + } + echo '<input type="hidden" name="SelectedCategory" value="' . $SelectedCategory . '" />'; + echo '<input type="hidden" name="CategoryID" value="' . $_POST['CategoryID'] . '" />'; + echo '<table class="selection"><tr><td>' . _('Category Code') . ':</td><td>' . $_POST['CategoryID'] . '</td></tr>'; - $result = DB_query($sql, $db); - $myrow = DB_fetch_array($result); +} else { //end of if $SelectedCategory only do the else when a new record is being entered + if (!isset($_POST['CategoryID'])) { + $_POST['CategoryID'] = ''; + } + echo '<table class="selection"><tr><td>' . _('Category Code') . ':</td> + <td><input type="text" name="CategoryID" size="7" maxlength="6" value="' . $_POST['CategoryID'] . '" /></td></tr>'; +} - $_POST['CategoryID'] = $myrow['categoryid']; - $_POST['StockType'] = $myrow['stocktype']; - $_POST['CategoryDescription'] = $myrow['categorydescription']; - $_POST['StockAct'] = $myrow['stockact']; - $_POST['AdjGLAct'] = $myrow['adjglact']; - $_POST['PurchPriceVarAct'] = $myrow['purchpricevaract']; - $_POST['MaterialUseageVarAc'] = $myrow['materialuseagevarac']; - $_POST['WIPAct'] = $myrow['wipact']; - } - echo '<input type="hidden" name="SelectedCategory" value="' . $SelectedCategory . '" />'; - echo '<input type="hidden" name="CategoryID" value="' . $_POST['CategoryID'] . '" />'; - echo '<table class="selection"><tr><td>' . _('Category Code') . ':</td><td>' . $_POST['CategoryID'] . '</td></tr>'; +//SQL to poulate account selection boxes +$sql = "SELECT accountcode, + accountname + FROM chartmaster + LEFT JOIN accountgroups + ON chartmaster.group_=accountgroups.groupname + WHERE accountgroups.pandl=0 + ORDER BY accountcode"; - } else { //end of if $SelectedCategory only do the else when a new record is being entered - if (!isset($_POST['CategoryID'])) { - $_POST['CategoryID'] = ''; - } - echo '<table class="selection"><tr><td>' . _('Category Code') . ':</td> - <td><input type="text" name="CategoryID" size="7" maxlength="6" value="' . $_POST['CategoryID'] . '" /></td></tr>'; - } +$BSAccountsResult = DB_query($sql,$db); - //SQL to poulate account selection boxes - $sql = "SELECT accountcode, - accountname - FROM chartmaster, - accountgroups - WHERE chartmaster.group_=accountgroups.groupname and - accountgroups.pandl=0 - ORDER BY accountcode"; +$sql = "SELECT accountcode, + accountname + FROM chartmaster + LEFT JOIN accountgroups + ON chartmaster.group_=accountgroups.groupname + WHERE accountgroups.pandl=1 + ORDER BY accountcode"; - $BSAccountsResult = DB_query($sql,$db); +$PnLAccountsResult = DB_query($sql,$db); - $sql = "SELECT accountcode, - accountname - FROM chartmaster, - accountgroups - WHERE chartmaster.group_=accountgroups.groupname and - accountgroups.pandl!=0 - ORDER BY accountcode"; +if (!isset($_POST['CategoryDescription'])) { + $_POST['CategoryDescription'] = ''; +} - $PnLAccountsResult = DB_query($sql,$db); +echo '<tr> + <td>' . _('Category Description') . ':</td> + <td><input type="text" name="CategoryDescription" size="22" maxlength="20" value="' . $_POST['CategoryDescription'] . '" /></td> + </tr>'; - if (!isset($_POST['CategoryDescription'])) { - $_POST['CategoryDescription'] = ''; - } - echo '<tr><td>' . _('Category Description') . ':</td> - <td><input type="text" name="CategoryDescription" size="22" maxlength="20" value="' . $_POST['CategoryDescription'] . '" /></td></tr>'; +echo '<tr> + <td>' . _('Stock Type') . ':</td> + <td><select name="StockType" onChange="ReloadForm(CategoryForm.UpdateTypes)" >'; +if (isset($_POST['StockType']) and $_POST['StockType']=='F') { + echo '<option selected="True" value="F">' . _('Finished Goods') . '</option>'; +} else { + echo '<option value="F">' . _('Finished Goods') . '</option>'; +} +if (isset($_POST['StockType']) and $_POST['StockType']=='M') { + echo '<option selected="True" value="M">' . _('Raw Materials') . '</option>'; +} else { + echo '<option value="M">' . _('Raw Materials') . '</option>'; +} +if (isset($_POST['StockType']) and $_POST['StockType']=='D') { + echo '<option selected="True" value="D">' . _('Dummy Item - (No Movements)') . '</option>'; +} else { + echo '<option value="D">' . _('Dummy Item - (No Movements)') . '</option>'; +} +if (isset($_POST['StockType']) and $_POST['StockType']=='L') { + echo '<option selected="True" value="L">' . _('Labour') . '</option>'; +} else { + echo '<option value="L">' . _('Labour') . '</option>'; +} +echo '</select></td></tr>'; - echo '<tr><td>' . _('Stock Type') . ':</td> - <td><select name="StockType" onChange="ReloadForm(CategoryForm.UpdateTypes)" >'; - if (isset($_POST['StockType']) and $_POST['StockType']=='F') { - echo '<option selected="True" value="F">' . _('Finished Goods') . '</option>'; - } else { - echo '<option value="F">' . _('Finished Goods') . '</option>'; - } - if (isset($_POST['StockType']) and $_POST['StockType']=='M') { - echo '<option selected="True" value="M">' . _('Raw Materials') . '</option>'; - } else { - echo '<option value="M">' . _('Raw Materials') . '</option>'; - } - if (isset($_POST['StockType']) and $_POST['StockType']=='D') { - echo '<option selected="True" value="D">' . _('Dummy Item - (No Movements)') . '</option>'; - } else { - echo '<option value="D">' . _('Dummy Item - (No Movements)') . '</option>'; - } - if (isset($_POST['StockType']) and $_POST['StockType']=='L') { - echo '<option selected="True" value="L">' . _('Labour') . '</option>'; - } else { - echo '<option value="L">' . _('Labour') . '</option>'; - } +echo '<input type="submit" name="UpdateTypes" style="visibility:hidden;width:1px" value="Not Seen" />'; +if (isset($_POST['StockType']) and $_POST['StockType']=='L') { + $Result = $PnLAccountsResult; + echo '<tr><td>' . _('Recovery GL Code'); +} else { + $Result = $BSAccountsResult; + echo '<tr><td>' . _('Stock GL Code'); +} +echo ':</td><td><select name="StockAct">'; - echo '</select></td></tr>'; +while ($myrow = DB_fetch_array($Result)){ - echo '<input type="submit" name="UpdateTypes" style="visibility:hidden;width:1px" value="Not Seen" />'; - if (isset($_POST['StockType']) and $_POST['StockType']=='L') { - $Result = $PnLAccountsResult; - echo '<tr><td>' . _('Recovery GL Code'); + if (isset($_POST['StockAct']) and $myrow['accountcode']==$_POST['StockAct']) { + echo '<option selected="True" value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } else { - $Result = $BSAccountsResult; - echo '<tr><td>' . _('Stock GL Code'); + echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } - echo ':</td><td><select name="StockAct">'; +} //end while loop +DB_data_seek($PnLAccountsResult,0); +DB_data_seek($BSAccountsResult,0); +echo '</select></td></tr>'; - while ($myrow = DB_fetch_array($Result)){ +echo '<tr><td>' . _('WIP GL Code') . ':</td><td><select name="WIPAct">'; - if (isset($_POST['StockAct']) and $myrow['accountcode']==$_POST['StockAct']) { - echo '<option selected="True" value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; - } else { - echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; - } - } //end while loop - DB_data_seek($PnLAccountsResult,0); - DB_data_seek($BSAccountsResult,0); - echo '</select></td></tr>'; +while ($myrow = DB_fetch_array($BSAccountsResult)) { - echo '<tr><td>' . _('WIP GL Code') . ':</td><td><select name="WIPAct">'; + if (isset($_POST['WIPAct']) and $myrow['accountcode']==$_POST['WIPAct']) { + echo '<option selected="True" value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; + } else { + echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; + } - while ($myrow = DB_fetch_array($BSAccountsResult)) { +} //end while loop +echo '</select></td></tr>'; +DB_data_seek($BSAccountsResult,0); - if (isset($_POST['WIPAct']) and $myrow['accountcode']==$_POST['WIPAct']) { - echo '<option selected="True" value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; - } else { - echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; - } +echo '<tr> + <td>' . _('Stock Adjustments GL Code') . ':</td> + <td><select name="AdjGLAct">'; - } //end while loop - echo '</select></td></tr>'; - DB_data_seek($BSAccountsResult,0); +while ($myrow = DB_fetch_array($PnLAccountsResult)) { + if (isset($_POST['AdjGLAct']) and $myrow['accountcode']==$_POST['AdjGLAct']) { + echo '<option selected="True" value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; + } else { + echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; + } - echo '<tr><td>' . _('Stock Adjustments GL Code') . ':</td> - <td><select name="AdjGLAct">'; +} //end while loop +DB_data_seek($PnLAccountsResult,0); +echo '</select></td></tr>'; - while ($myrow = DB_fetch_array($PnLAccountsResult)) { - if (isset($_POST['AdjGLAct']) and $myrow['accountcode']==$_POST['AdjGLAct']) { - echo '<option selected="True" value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; - } else { - echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; - } +echo '<tr> + <td>' . _('Internal Stock Issues GL Code') . ':</td> + <td><select name="IssueGLAct">'; - } //end while loop - DB_data_seek($PnLAccountsResult,0); - echo '</select></td></tr>'; +while ($myrow = DB_fetch_array($PnLAccountsResult)) { + if (isset($_POST['IssueGLAct']) and $myrow['accountcode']==$_POST['IssueGLAct']) { + echo '<option selected="True" value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; + } else { + echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; + } - echo '<tr><td>' . _('Price Variance GL Code') . ':</td> - <td><select name="PurchPriceVarAct">'; +} //end while loop +DB_data_seek($PnLAccountsResult,0); +echo '</select></td></tr>'; - while ($myrow = DB_fetch_array($PnLAccountsResult)) { - if (isset($_POST['PurchPriceVarAct']) and $myrow['accountcode']==$_POST['PurchPriceVarAct']) { - echo '<option selected="True" value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; - } else { - echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; - } +echo '<tr> + <td>' . _('Price Variance GL Code') . ':</td> + <td><select name="PurchPriceVarAct">'; - } //end while loop - DB_data_seek($PnLAccountsResult,0); - - echo '</select></td></tr><tr><td>'; - if (isset($_POST['StockType']) and $_POST['StockType']=='L') { - echo _('Labour Efficiency Variance GL Code'); +while ($myrow = DB_fetch_array($PnLAccountsResult)) { + if (isset($_POST['PurchPriceVarAct']) and $myrow['accountcode']==$_POST['PurchPriceVarAct']) { + echo '<option selected="True" value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } else { - echo _('Usage Variance GL Code'); + echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } - echo ':</td><td><select name="MaterialUseageVarAc">'; - while ($myrow = DB_fetch_array($PnLAccountsResult)) { - if (isset($_POST['MaterialUseageVarAc']) and $myrow['accountcode']==$_POST['MaterialUseageVarAc']) { - echo '<option selected="True" value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; - } else { - echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; - } +} //end while loop +DB_data_seek($PnLAccountsResult,0); - } //end while loop - DB_free_result($PnLAccountsResult); - echo '</select></td></tr> - </table>'; - if (!isset($SelectedCategory)) { - $SelectedCategory=''; +echo '</select></td></tr><tr><td>'; +if (isset($_POST['StockType']) and $_POST['StockType']=='L') { + echo _('Labour Efficiency Variance GL Code'); +} else { + echo _('Usage Variance GL Code'); +} +echo ':</td><td><select name="MaterialUseageVarAc">'; + +while ($myrow = DB_fetch_array($PnLAccountsResult)) { + if (isset($_POST['MaterialUseageVarAc']) and $myrow['accountcode']==$_POST['MaterialUseageVarAc']) { + echo '<option selected="True" value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; + } else { + echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } - if (isset($SelectedCategory)) { - //editing an existing stock category - $sql = "SELECT stkcatpropid, - label, - controltype, - defaultvalue, - numericvalue, - minimumvalue, - maximumvalue, - reqatsalesorder - FROM stockcatproperties - WHERE categoryid='" . $SelectedCategory . "' - ORDER BY stkcatpropid"; +} //end while loop +DB_free_result($PnLAccountsResult); +echo '</select></td></tr> + </table>'; +if (!isset($SelectedCategory)) { + $SelectedCategory=''; +} +if (isset($SelectedCategory)) { + //editing an existing stock category - $result = DB_query($sql, $db); + $sql = "SELECT stkcatpropid, + label, + controltype, + defaultvalue, + numericvalue, + minimumvalue, + maximumvalue, + reqatsalesorder + FROM stockcatproperties + WHERE categoryid='" . $SelectedCategory . "' + ORDER BY stkcatpropid"; + $result = DB_query($sql, $db); + /* echo '<br />Number of rows returned by the sql = ' . DB_num_rows($result) . '<br />The SQL was:<br />' . $sql; */ - echo '<br /><table class="selection">'; - $TableHeader = '<tr><th>' . _('Property Label') . '</th> + echo '<br /><table class="selection">'; + $TableHeader = '<tr><th>' . _('Property Label') . '</th> <th>' . _('Control Type') . '</th> <th>' . _('Default Value') . '</th> <th>' . _('Numeric Value') . '</th> @@ -494,90 +519,87 @@ <th>' . _('Maximum Value') . '</th> <th>' . _('Require in SO') . '</th> </tr>'; - echo $TableHeader; - $PropertyCounter =0; - $HeadingCounter =0; - while ($myrow = DB_fetch_array($result)) { - if ($HeadingCounter>15){ - echo $TableHeader; - $HeadingCounter=0; - } else { - $HeadingCounter++; - } - echo '<input type="hidden" name="PropID' . $PropertyCounter .'" value="' . $myrow['stkcatpropid'] . '" />'; - echo '<tr><td><input type="text" name="PropLabel' . $PropertyCounter . '" size="50" maxlength="100" value="' . $myrow['label'] . '" /></td> - <td><select name="PropControlType' . $PropertyCounter . '">'; - if ($myrow['controltype']==0){ - echo '<option selected="True" value="0">' . _('Text Box') . '</option>'; - } else { - echo '<option value="0">' . _('Text Box') . '</option>'; - } - if ($myrow['controltype']==1){ - echo '<option selected="True" value="1">' . _('Select Box') . '</option>'; - } else { - echo '<option value="1">' . _('Select Box') . '</option>'; - } - if ($myrow['controltype']==2){ - echo '<option selected="True" value="2">' . _('Check Box') . '</option>'; - } else { - echo '<option value="2">' . _('Check Box') . '</option>'; - } - if ($myrow['controltype']==3){ - echo '<option selected="True" value="3">' . _('Date Box') . '</option>'; - } else { - echo '<option value="3">' . _('Date Box') . '</option>'; - } + echo $TableHeader; + $PropertyCounter =0; + $HeadingCounter =0; + while ($myrow = DB_fetch_array($result)) { + if ($HeadingCounter>15){ + echo $TableHeader; + $HeadingCounter=0; + } else { + $HeadingCounter++; + } + echo '<input type="hidden" name="PropID' . $PropertyCounter .'" value="' . $myrow['stkcatpropid'] . '" />'; + echo '<tr><td><input type="text" name="PropLabel' . $PropertyCounter . '" size="50" maxlength="100" value="' . $myrow['label'] . '" /></td> + <td><select name="PropControlType' . $PropertyCounter . '">'; + if ($myrow['controltype']==0){ + echo '<option selected="True" value="0">' . _('Text Box') . '</option>'; + } else { + echo '<option value="0">' . _('Text Box') . '</option>'; + } + if ($myrow['controltype']==1){ + echo '<option selected="True" value="1">' . _('Select Box') . '</option>'; + } else { + echo '<option value="1">' . _('Select Box') . '</option>'; + } + if ($myrow['controltype']==2){ + echo '<option selected="True" value="2">' . _('Check Box') . '</option>'; + } else { + echo '<option value="2">' . _('Check Box') . '</option>'; + } + if ($myrow['controltype']==3){ + echo '<option selected="True" value="3">' . _('Date Box') . '</option>'; + } else { + echo '<option value="3">' . _('Date Box') . '</option>'; + } - echo '</select></td> + echo '</select></td> <td><input type="text" name="PropDefault' . $PropertyCounter . '" value="' . $myrow['defaultvalue'] . '" /></td>'; - if ($myrow['numericvalue']==1){ - echo '<td><input type="checkbox" name="PropNumeric' . $PropertyCounter . '" checked="True" />'; - } else { - echo '<td><input type="checkbox" name="PropNumeric' . $PropertyCounter . '" />'; - } + if ($myrow['numericvalue']==1){ + echo '<td><input type="checkbox" name="PropNumeric' . $PropertyCounter . '" checked="True" />'; + } else { + echo '<td><input type="checkbox" name="PropNumeric' . $PropertyCounter . '" />'; + } - echo '</td> - <td><input type="text" name="PropMinimum' . $PropertyCounter . '" value="' . $myrow['minimumvalue'] . '" /></td> - <td><input type="text" name="PropMaximum' . $PropertyCounter . '" value="' . $myrow['maximumvalue'] . '" /></td>'; + echo '</td> + <td><input type="text" name="PropMinimum' . $PropertyCounter . '" value="' . $myrow['minimumvalue'] . '" /></td> + <td><input type="text" name="PropMaximum' . $PropertyCounter . '" value="' . $myrow['maximumvalue'] . '" /></td>'; - if ($myrow['reqatsalesorder']==1){ - echo '<td align="center"><input type="checkbox" name="PropReqSO' . $PropertyCounter .'" checked="True" />'; - } else { - echo '<td align="center"><input type="checkbox" name="PropReqSO' . $PropertyCounter .'" />'; - } + if ($myrow['reqatsalesorder']==1){ + echo '<td align="center"><input type="checkbox" name="PropReqSO' . $PropertyCounter .'" checked="True" />'; + } else { + echo '<td align="center"><input type="checkbox" name="PropReqSO' . $PropertyCounter .'" />'; + } - echo '</td> - <td><a href="' . $_SERVER['PHP_SELF'] . '?DeleteProperty=' . $myrow['stkcatpropid'] .'&SelectedCategory=' . $SelectedCategory . '" onclick=\'return confirm("' . _('Are you sure you wish to delete this property? All properties of this type set up for stock items will also be deleted.') . '");\'>' . _('Delete') . '</td></tr>'; + echo '</td> + <td><a href="' . $_SERVER['PHP_SELF'] . '?DeleteProperty=' . $myrow['stkcatpropid'] .'&SelectedCategory=' . $SelectedCategory . '" onclick=\'return confirm("' . _('Are you sure you wish to delete this property? All properties of this type set up for stock items will also be deleted.') . '");\'>' . _('Delete') . '</td></tr>'; - $PropertyCounter++; - } //end loop around defined properties for this category - echo '<input type="hidden" name="PropID' . $PropertyCounter .'" value="NewProperty" />'; - echo '<tr><td><input type="text" name="PropLabel' . $PropertyCounter . '" size="50" maxlength="100" /></td> - <td><select name="PropControlType' . $PropertyCounter . '">'; - echo '<option selected="True" value="0">' . _('Text Box') . '</option>'; - echo '<option value="1">' . _('Select Box') . '</option>'; - echo '<option value="2">' . _('Check Box') . '</option>'; - echo '<option value="3">' . _('Date Box') . '</option>'; - echo '</select></td> - <td><input type="text" name="PropDefault' . $PropertyCounter . '" /></td> - <td><input type="checkbox" name="PropNumeric' . $PropertyCounter . '" /></td> - <td><input type="text" name="PropMinimum' . $PropertyCounter . '" /></td> - <td><input type="text" name="PropMaximum' . $PropertyCounter . '" /></td> - <td align="center"><input type="checkbox" name="PropReqSO' . $PropertyCounter .'" /></td></tr>'; - echo '</table>'; - echo '<input type="hidden" name="PropertyCounter" value="' . $PropertyCounter . '" />'; + $PropertyCounter++; + } //end loop around defined properties for this category + echo '<input type="hidden" name="PropID' . $PropertyCounter .'" value="NewProperty" />'; + echo '<tr><td><input type="text" name="PropLabel' . $PropertyCounter . '" size="50" maxlength="100" /></td> + <td><select name="PropControlType' . $PropertyCounter . '">'; + echo '<option selected="True" value="0">' . _('Text Box') . '</option>'; + echo '<option value="1">' . _('Select Box') . '</option>'; + echo '<option value="2">' . _('Check Box') . '</option>'; + echo '<option value="3">' . _('Date Box') . '</option>'; + echo '</select></td> + <td><input type="text" name="PropDefault' . $PropertyCounter . '" /></td> + <td><input type="checkbox" name="PropNumeric' . $PropertyCounter . '" /></td> + <td><input type="text" name="PropMinimum' . $PropertyCounter . '" /></td> + <td><input type="text" name="PropMaximum' . $PropertyCounter . '" /></td> + <td align="center"><input type="checkbox" name="PropReqSO' . $PropertyCounter .'" /></td></tr>'; + echo '</table>'; + echo '<input type="hidden" name="PropertyCounter" value="' . $PropertyCounter . '" />'; - } /* end if there is a category selected */ +} /* end if there is a category selected */ - echo '<br /><div class="centre"><input type="submit" name="submit" value="' . _('Enter Information') . '" /></div>'; +echo '<br /><div class="centre"><input type="submit" name="submit" value="' . _('Enter Information') . '" /></div>'; +echo '</form>'; - echo '</form>'; - - - include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/includes/SQL_CommonFunctions.inc =================================================================== --- trunk/includes/SQL_CommonFunctions.inc 2012-01-29 20:48:00 UTC (rev 8485) +++ trunk/includes/SQL_CommonFunctions.inc 2012-01-30 12:56:55 UTC (rev 8486) @@ -42,6 +42,7 @@ /*Gets the GL Codes relevant to the stock item account from the stock category record */ $QuerySQL = "SELECT stockact, adjglact, + issueglact, purchpricevaract, materialuseagevarac, wipact Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2012-01-29 20:48:00 UTC (rev 8485) +++ trunk/includes/session.inc 2012-01-30 12:56:55 UTC (rev 8486) @@ -13,7 +13,7 @@ header('Location:' . $rootpath . '/install/index.php'); } include($PathPrefix . 'config.php'); -$DBVersion=104; +$DBVersion=105; if (isset($SessionSavePath)){ session_save_path($SessionSavePath); } Added: trunk/sql/mysql/updates/105.php =================================================================== --- trunk/sql/mysql/updates/105.php (rev 0) +++ trunk/sql/mysql/updates/105.php 2012-01-30 12:56:55 UTC (rev 8486) @@ -0,0 +1,14 @@ +<?php + +/* Include the new script for printing quotations in Portrait + */ + +AddColumn('issueglact', 'stockcategory', 'INT( 11 )', 'not null', 0, 'adjglact', $db); + +$sql="UPDATE stockcategory + SET issueglact=adjglact"; +$result=DB_query($sql, $db); + +UpdateDBNo(105, $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...> - 2012-02-10 11:41:16
|
Revision: 8494 http://weberp.svn.sourceforge.net/weberp/?rev=8494&view=rev Author: tim_schofield Date: 2012-02-10 11:40:59 +0000 (Fri, 10 Feb 2012) Log Message: ----------- Filter any html characters passed in the URL Modified Paths: -------------- trunk/AccountGroups.php trunk/AccountSections.php trunk/AddCustomerContacts.php trunk/AddCustomerNotes.php trunk/AddCustomerTypeNotes.php trunk/AgedDebtors.php trunk/AgedSuppliers.php trunk/Areas.php trunk/AuditTrail.php trunk/BOMExtendedQty.php trunk/BOMIndented.php trunk/BOMIndentedReverse.php trunk/BOMInquiry.php trunk/BOMListing.php trunk/BOMs.php trunk/BackupDatabase.php trunk/BankAccounts.php trunk/BankMatching.php trunk/BankReconciliation.php trunk/COGSGLPostings.php trunk/CompanyPreferences.php trunk/ConfirmDispatch_Invoice.php trunk/ContractBOM.php trunk/ContractCosting.php trunk/ContractOtherReqts.php trunk/Contracts.php trunk/CounterSales.php trunk/CreditStatus.php trunk/Credit_Invoice.php trunk/Currencies.php trunk/CustEDISetup.php trunk/CustLoginSetup.php trunk/CustWhereAlloc.php trunk/CustomerAllocations.php trunk/CustomerBranches.php trunk/CustomerInquiry.php trunk/CustomerReceipt.php trunk/CustomerTransInquiry.php trunk/CustomerTypes.php trunk/Customers.php trunk/DailyBankTransactions.php trunk/DailySalesInquiry.php trunk/DebtorsAtPeriodEnd.php trunk/DeliveryDetails.php trunk/Departments.php trunk/DiscountCategories.php trunk/DiscountMatrix.php trunk/EDIMessageFormat.php trunk/EmailCustTrans.php trunk/ExchangeRateTrend.php trunk/FTP_RadioBeacon.php trunk/Factors.php trunk/FixedAssetCategories.php trunk/FixedAssetDepreciation.php trunk/FixedAssetItems.php trunk/FixedAssetLocations.php trunk/FixedAssetRegister.php trunk/FixedAssetTransfer.php trunk/FormDesigner.php trunk/FreightCosts.php trunk/GLAccountCSV.php trunk/GLAccountInquiry.php trunk/GLAccountReport.php trunk/GLAccounts.php trunk/GLBalanceSheet.php trunk/GLBudgets.php trunk/GLJournal.php trunk/GLJournalInquiry.php trunk/GLProfit_Loss.php trunk/GLTagProfit_Loss.php trunk/GLTags.php trunk/GLTrialBalance.php trunk/GeocodeSetup.php trunk/GoodsReceived.php trunk/InternalStockRequest.php trunk/InternalStockRequestAuthorisation.php trunk/InternalStockRequestFulfill.php trunk/InventoryPlanning.php trunk/InventoryPlanningPrefSupplier.php trunk/InventoryQuantities.php trunk/InventoryValuation.php trunk/Labels.php trunk/Locations.php trunk/MRP.php trunk/MRPCalendar.php trunk/MRPCreateDemands.php trunk/MRPDemandTypes.php trunk/MRPDemands.php trunk/MRPPlannedPurchaseOrders.php trunk/MRPPlannedWorkOrders.php trunk/MRPReport.php trunk/MRPReschedules.php trunk/MRPShortages.php trunk/Manufacturers.php trunk/OffersReceived.php trunk/OutstandingGRNs.php trunk/PDFBankingSummary.php trunk/PDFChequeListing.php trunk/PDFCustTransListing.php trunk/PDFCustomerList.php trunk/PDFDIFOT.php trunk/PDFDeliveryDifferences.php trunk/PDFLowGP.php trunk/PDFOrderStatus.php trunk/PDFOrdersInvoiced.php trunk/PDFPeriodStockTransListing.php trunk/PDFPickingList.php trunk/PDFPriceList.php trunk/PDFPrintLabel.php trunk/PDFRemittanceAdvice.php trunk/PDFStockCheckComparison.php trunk/PDFStockLocTransfer.php trunk/PDFStockTransfer.php trunk/PDFStockTransfer_departments.php trunk/PDFSuppTransListing.php trunk/POReport.php trunk/PO_AuthorisationLevels.php trunk/PO_AuthoriseMyOrders.php trunk/PO_Header.php trunk/PO_Items.php trunk/PO_PDFPurchOrder.php trunk/PO_SelectOSPurchOrder.php trunk/PO_SelectPurchOrder.php trunk/PageSecurity.php trunk/PaymentMethods.php trunk/PaymentTerms.php trunk/Payments.php trunk/PcAssignCashToTab.php trunk/PcAuthorizeExpenses.php trunk/PcClaimExpensesFromTab.php trunk/PcExpenses.php trunk/PcExpensesTypeTab.php trunk/PcReportTab.php trunk/PcTabs.php trunk/PcTypeTabs.php trunk/Prices.php trunk/PricesBasedOnMarkUp.php trunk/PricesByCost.php trunk/Prices_Customer.php trunk/PrintCustStatements.php trunk/PrintCustTrans.php trunk/PrintCustTransPortrait.php trunk/PurchData.php trunk/RecurringSalesOrders.php trunk/ReorderLevel.php trunk/ReorderLevelLocation.php trunk/ReprintGRN.php trunk/ReverseGRN.php trunk/SMTPServer.php trunk/SalesAnalReptCols.php trunk/SalesAnalRepts.php trunk/SalesCategories.php trunk/SalesGLPostings.php trunk/SalesGraph.php trunk/SalesInquiry.php trunk/SalesPeople.php trunk/SalesTypes.php trunk/SecurityTokens.php trunk/SelectCompletedOrder.php trunk/SelectContract.php trunk/SelectCreditItems.php trunk/SelectCustomer.php trunk/SelectGLAccount.php trunk/SelectOrderItems.php trunk/SelectProduct.php trunk/SelectRecurringSalesOrder.php trunk/SelectSalesOrder.php trunk/SelectSupplier.php trunk/SelectWorkOrder.php trunk/ShipmentCosting.php trunk/Shipments.php trunk/Shippers.php trunk/Shipt_Select.php trunk/SpecialOrder.php trunk/StockAdjustments.php trunk/StockCategories.php trunk/StockCheck.php trunk/StockCostUpdate.php trunk/StockCounts.php trunk/StockDispatch.php trunk/StockLocMovements.php trunk/StockLocStatus.php trunk/StockLocTransfer.php trunk/StockLocTransferReceive.php trunk/StockMovements.php trunk/StockQuantityByDate.php trunk/StockReorderLevel.php trunk/StockSerialItemResearch.php trunk/StockStatus.php trunk/StockTransfers.php trunk/StockUsage.php trunk/Stocks.php trunk/SuppContractChgs.php trunk/SuppCreditGRNs.php trunk/SuppFixedAssetChgs.php trunk/SuppInvGRNs.php trunk/SuppPaymentRun.php trunk/SuppPriceList.php trunk/SuppShiptChgs.php trunk/SuppTransGLAnalysis.php trunk/SupplierAllocations.php trunk/SupplierBalsAtPeriodEnd.php trunk/SupplierContacts.php trunk/SupplierCredit.php trunk/SupplierInquiry.php trunk/SupplierInvoice.php trunk/SupplierTenders.php trunk/SupplierTransInquiry.php trunk/SupplierTypes.php trunk/Suppliers.php trunk/SystemParameters.php trunk/Tax.php trunk/TaxAuthorities.php trunk/TaxAuthorityRates.php trunk/TaxCategories.php trunk/TaxGroups.php trunk/TaxProvinces.php trunk/TopItems.php trunk/UnitsOfMeasure.php trunk/UpgradeDatabase.php trunk/UserSettings.php trunk/WOSerialNos.php trunk/WWW_Access.php trunk/WWW_Users.php trunk/WhereUsedInquiry.php trunk/WorkCentres.php trunk/WorkOrderCosting.php trunk/WorkOrderEntry.php trunk/WorkOrderIssue.php trunk/WorkOrderReceive.php trunk/Z_BottomUpCosts.php trunk/Z_ChangeBranchCode.php trunk/Z_ChangeCustomerCode.php trunk/Z_ChangeStockCategory.php trunk/Z_ChangeStockCode.php trunk/Z_ChangeSupplierCode.php trunk/Z_CheckDebtorsControl.php trunk/Z_CreateCompanyTemplateFile.php trunk/Z_DataExport.php trunk/Z_DeleteSalesTransActions.php trunk/Z_ImportChartOfAccounts.php trunk/Z_ImportGLAccountGroups.php trunk/Z_ImportGLAccountSections.php trunk/Z_ImportPartCodes.php trunk/Z_MakeNewCompany.php trunk/Z_ReApplyCostToSA.php trunk/Z_RePostGLFromPeriod.php trunk/Z_ReverseSuppPaymentRun.php trunk/Z_UpdateChartDetailsBFwd.php trunk/Z_Upgrade3.10.php trunk/Z_UpgradeDatabase.php trunk/Z_Upgrade_3.04-3.05.php trunk/Z_Upgrade_3.05-3.06.php trunk/Z_Upgrade_3.07-3.08.php trunk/Z_Upgrade_3.08-3.09.php trunk/Z_Upgrade_3.09-3.10.php trunk/Z_Upgrade_3.10-3.11.php trunk/Z_Upgrade_3.11-4.00.php trunk/Z_poAddLanguage.php trunk/Z_poEditLangHeader.php trunk/Z_poEditLangModule.php trunk/Z_poEditLangRemaining.php trunk/Z_poRebuildDefault.php trunk/api/api_session.inc trunk/config.distrib.php trunk/doc/Manual/ManualContents.php trunk/doc/Manual/ManualGettingStarted.html trunk/includes/InputSerialItems.php trunk/includes/InputSerialItemsExisting.php trunk/includes/InputSerialItemsKeyed.php trunk/includes/InputSerialItemsSequential.php trunk/includes/Login.php trunk/includes/OutputSerialItems.php trunk/includes/session.inc trunk/includes/tcpdf/config/tcpdf_config.php trunk/includes/tcpdf/config/tcpdf_config_alt.php trunk/index.php trunk/install/save.php trunk/locale/de_DE.utf8/Manual/ManualContents.php trunk/locale/de_DE.utf8/Manual/ManualGettingStarted.html trunk/locale/zh_CN.utf8/Manual/ManualContents.php trunk/locale/zh_CN.utf8/Manual/ManualGettingStarted.html trunk/locale/zh_HK.utf8/Manual/ManualContents.php trunk/locale/zh_HK.utf8/Manual/ManualGettingStarted.html Modified: trunk/AccountGroups.php =================================================================== --- trunk/AccountGroups.php 2012-02-06 12:57:23 UTC (rev 8493) +++ trunk/AccountGroups.php 2012-02-10 11:40:59 UTC (rev 8494) @@ -262,8 +262,8 @@ <td>' . $myrow[2] . '</td> <td>' . $PandLText . '</td> <td>' . $myrow[4] . '</td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedAccountGroup=' . htmlentities($myrow[0], ENT_QUOTES,'UTF-8') . '">' . _('Edit') . '</a></td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedAccountGroup=' . htmlentities($myrow[0], ENT_QUOTES,'UTF-8') . '&delete=1">' . _('Delete') .'</a></td></tr>'; + echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?SelectedAccountGroup=' . htmlentities($myrow[0], ENT_QUOTES,'UTF-8') . '">' . _('Edit') . '</a></td>'; + echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?SelectedAccountGroup=' . htmlentities($myrow[0], ENT_QUOTES,'UTF-8') . '&delete=1">' . _('Delete') .'</a></td></tr>'; } //END WHILE LIST LOOP echo '</table>'; @@ -271,12 +271,12 @@ if (isset($_POST['SelectedAccountGroup']) OR isset($_GET['SelectedAccountGroup'])) { - echo '<br /><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Review Account Groups') . '</a></div>'; + echo '<br /><div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">' . _('Review Account Groups') . '</a></div>'; } if (! isset($_GET['delete'])) { - echo '<br /><form method="post" id="AccountGroups" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<br /><form method="post" id="AccountGroups" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; Modified: trunk/AccountSections.php =================================================================== --- trunk/AccountSections.php 2012-02-06 12:57:23 UTC (rev 8493) +++ trunk/AccountSections.php 2012-02-10 11:40:59 UTC (rev 8494) @@ -192,11 +192,11 @@ } echo '<td>' . $myrow[0] . '</td><td>' . $myrow[1] . '</td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedSectionID=' . $myrow[0] . '">' . _('Edit') . '</a></td>'; + echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?SelectedSectionID=' . $myrow[0] . '">' . _('Edit') . '</a></td>'; if ( $myrow[0] == '1' or $myrow[0] == '2' ) { echo '<td><b>'._('Restricted').'</b></td>'; } else { - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedSectionID=' . $myrow[0] . '&delete=1">' . _('Delete') .'</a></td>'; + echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?SelectedSectionID=' . $myrow[0] . '&delete=1">' . _('Delete') .'</a></td>'; } echo '</tr>'; } //END WHILE LIST LOOP @@ -205,12 +205,12 @@ if (isset($_POST['SelectedSectionID']) or isset($_GET['SelectedSectionID'])) { - echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Review Account Sections') . '</a></div>'; + echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">' . _('Review Account Sections') . '</a></div>'; } if (! isset($_GET['delete'])) { - echo '<form method="post" name="AccountSections" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<form method="post" name="AccountSections" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($_GET['SelectedSectionID'])) { Modified: trunk/AddCustomerContacts.php =================================================================== --- trunk/AddCustomerContacts.php 2012-02-06 12:57:23 UTC (rev 8493) +++ trunk/AddCustomerContacts.php 2012-02-10 11:40:59 UTC (rev 8494) @@ -142,10 +142,10 @@ $myrow['role'], $myrow['phoneno'], $myrow['notes'], - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?', $myrow['contid'], $myrow['debtorno'], - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?', $myrow['contid'], $myrow['debtorno']); @@ -154,14 +154,14 @@ echo '</table>'; } if (isset($Id)) { ?> - <div class="centre"><a href="<?php echo $_SERVER['PHP_SELF'] . '?DebtorNo='.$DebtorNo;?>"><?=_('Review all contacts for this Customer')?></a></div> + <div class="centre"><a href="<?php echo htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?DebtorNo='.$DebtorNo;?>"><?=_('Review all contacts for this Customer')?></a></div> <?php } ?> <br /> <?php if (!isset($_GET['delete'])) { - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . 'DebtorNo='.$DebtorNo.'">'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . 'DebtorNo='.$DebtorNo.'">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($Id)) { Modified: trunk/AddCustomerNotes.php =================================================================== --- trunk/AddCustomerNotes.php 2012-02-06 12:57:23 UTC (rev 8493) +++ trunk/AddCustomerNotes.php 2012-02-10 11:40:59 UTC (rev 8494) @@ -136,10 +136,10 @@ $myrow['note'], $myrow['href'], $myrow['priority'], - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?', $myrow['noteid'], $myrow['debtorno'], - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?', $myrow['noteid'], $myrow['debtorno']); @@ -148,13 +148,13 @@ echo '</table>'; } if (isset($Id)) { - echo '<div class="centre"><a href="'.$_SERVER['PHP_SELF'] . '?DebtorNo='.$DebtorNo.'"><?='._('Review all notes for this Customer').'</a></div>'; + echo '<div class="centre"><a href="'.htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?DebtorNo='.$DebtorNo.'"><?='._('Review all notes for this Customer').'</a></div>'; } echo '<br />'; if (!isset($_GET['delete'])) { - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?DebtorNo='.$DebtorNo.'">'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?DebtorNo='.$DebtorNo.'">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($Id)) { Modified: trunk/AddCustomerTypeNotes.php =================================================================== --- trunk/AddCustomerTypeNotes.php 2012-02-06 12:57:23 UTC (rev 8493) +++ trunk/AddCustomerTypeNotes.php 2012-02-10 11:40:59 UTC (rev 8494) @@ -132,10 +132,10 @@ $myrow['note'], $myrow['href'], $myrow['priority'], - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?', $myrow['noteid'], $myrow['typeid'], - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?', $myrow['noteid'], $myrow['typeid']); @@ -144,14 +144,14 @@ echo '</table>'; } if (isset($Id)) { ?> - <div class="cantre"><a href="<?php echo $_SERVER['PHP_SELF'] . '?DebtorType='.$DebtorType;?>"><?=_('Review all notes for this Customer Type')?></a></div> + <div class="cantre"><a href="<?php echo htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?DebtorType='.$DebtorType;?>"><?=_('Review all notes for this Customer Type')?></a></div> <?php } ?> <br /> <?php if (!isset($_GET['delete'])) { - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?DebtorType='.$DebtorType.'">'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?DebtorType='.$DebtorType.'">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($Id)) { Modified: trunk/AgedDebtors.php =================================================================== --- trunk/AgedDebtors.php 2012-02-06 12:57:23 UTC (rev 8493) +++ trunk/AgedDebtors.php 2012-02-10 11:40:59 UTC (rev 8494) @@ -469,7 +469,7 @@ /*if $FromCriteria is not set then show a form to allow input */ - echo '<form action=' . $_SERVER['PHP_SELF'] . ' method="post"><table>'; + echo '<form action=' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . ' method="post"><table>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<tr><td>' . _('From Customer Code') . ':' . '</font></td><td><input tabindex="1" type="text" maxlength="6" size="7" name="FromCriteria" value="0" /></td></tr>'; Modified: trunk/AgedSuppliers.php =================================================================== --- trunk/AgedSuppliers.php 2012-02-06 12:57:23 UTC (rev 8493) +++ trunk/AgedSuppliers.php 2012-02-10 11:40:59 UTC (rev 8494) @@ -278,7 +278,7 @@ /*if $FromCriteria is not set then show a form to allow input */ - echo '<form sction="' . $_SERVER['PHP_SELF'] . '" method="post">'; + echo '<form sction="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table><tr><td>' . _('From Supplier Code') . ':</font></td> Modified: trunk/Areas.php =================================================================== --- trunk/Areas.php 2012-02-06 12:57:23 UTC (rev 8493) +++ trunk/Areas.php 2012-02-10 11:40:59 UTC (rev 8494) @@ -162,8 +162,8 @@ } echo '<td>' . $myrow['areacode'] . '</td> <td>' . $myrow['areadescription'] . '</td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedArea=' . $myrow['areacode'] . '">' . _('Edit') . '</a></td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedArea=' . $myrow['areacode'] . '&delete=yes">' . _('Delete') . '</a></td>'; + echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?SelectedArea=' . $myrow['areacode'] . '">' . _('Edit') . '</a></td>'; + echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?SelectedArea=' . $myrow['areacode'] . '&delete=yes">' . _('Delete') . '</a></td>'; echo '<td><a href="SelectCustomer.php?Area=' . $myrow['areacode'] . '">' . _('View Customers from this Area') . '</a></td>'; } //END WHILE LIST LOOP @@ -173,13 +173,13 @@ //end of ifs and buts! if (isset($SelectedArea)) { - echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Review Areas Defined') . '</a></div>'; + echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">' . _('Review Areas Defined') . '</a></div>'; } if (!isset($_GET['delete'])) { - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '"><br />'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '"><br />'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedArea)) { Modified: trunk/AuditTrail.php =================================================================== --- trunk/AuditTrail.php 2012-02-06 12:57:23 UTC (rev 8493) +++ trunk/AuditTrail.php 2012-02-10 11:40:59 UTC (rev 8494) @@ -34,7 +34,7 @@ // Get list of users $UserResult = DB_query("SELECT userid FROM www_users",$db); -echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; +echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="selection">'; Modified: trunk/BOMExtendedQty.php =================================================================== --- trunk/BOMExtendedQty.php 2012-02-06 12:57:23 UTC (rev 8493) +++ trunk/BOMExtendedQty.php 2012-02-10 11:40:59 UTC (rev 8494) @@ -271,7 +271,7 @@ include('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; - echo '<br /><br /><form action=' . $_SERVER['PHP_SELF'] . ' method="post"><table class="selection">'; + echo '<br /><br /><form action=' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . ' method="post"><table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<tr><td>' . _('Part') . ':</td><td><input type ="text" name="Part" size="20" />'; echo '<tr><td>' . _('Quantity') . ':</td><td><input type="text" class="number" name="Quantity" size="4" />'; Modified: trunk/BOMIndented.php =================================================================== --- trunk/BOMIndented.php 2012-02-06 12:57:23 UTC (rev 8493) +++ trunk/BOMIndented.php 2012-02-10 11:40:59 UTC (rev 8494) @@ -252,7 +252,7 @@ include('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; - echo '<br /><br /><form action=' . $_SERVER['PHP_SELF'] . ' method="post"><table class="selection">'; + echo '<br /><br /><form action=' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . ' method="post"><table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<tr><td>' . _('Part') . ':</td>'; echo '<td><input type ="text" name="Part" size="20" />'; Modified: trunk/BOMIndentedReverse.php =================================================================== --- trunk/BOMIndentedReverse.php 2012-02-06 12:57:23 UTC (rev 8493) +++ trunk/BOMIndentedReverse.php 2012-02-10 11:40:59 UTC (rev 8494) @@ -246,7 +246,7 @@ include('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; - echo '<br /><br /><form action=' . $_SERVER['PHP_SELF'] . ' method="post"><table class="selection">'; + echo '<br /><br /><form action=' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . ' method="post"><table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<tr><td>' . _('Part') . ':</td>'; echo '<td><input type ="text" name="Part" size="20" />'; Modified: trunk/BOMInquiry.php =================================================================== --- trunk/BOMInquiry.php 2012-02-06 12:57:23 UTC (rev 8493) +++ trunk/BOMInquiry.php 2012-02-10 11:40:59 UTC (rev 8494) @@ -13,7 +13,7 @@ } if (!isset($_POST['StockID'])) { - echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post"> + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post"> <div class="page_help_text">'. _('Select a manufactured part') . ' (' . _('or Assembly or Kit part') . ') ' . _('to view the costed bill of materials') . '.' . '<br /><font size="1">' . _('Parts must be defined in the stock item entry') . '/' . _('modification screen as manufactured') . Modified: trunk/BOMListing.php =================================================================== --- trunk/BOMListing.php 2012-02-06 12:57:23 UTC (rev 8493) +++ trunk/BOMListing.php 2012-02-10 11:40:59 UTC (rev 8494) @@ -114,7 +114,7 @@ /*if $FromCriteria is not set then show a form to allow input */ - echo '<form action=' . $_SERVER['PHP_SELF'] . ' method="post">'; + echo '<form action=' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . ' method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="selection"> Modified: trunk/BOMs.php =================================================================== --- trunk/BOMs.php 2012-02-06 12:57:23 UTC (rev 8493) +++ trunk/BOMs.php 2012-02-10 11:40:59 UTC (rev 8494) @@ -117,7 +117,7 @@ $DrillID=''; } else { $DrillText = '<a href="%s&Select=%s">' . _('Drill Down'); - $DrillLink = $_SERVER['PHP_SELF'] . '?'; + $DrillLink = htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?'; $DrillID=$myrow[0]; } if ($ParentMBflag!='M' AND $ParentMBflag!='G'){ @@ -159,12 +159,12 @@ ConvertSQLDate($myrow[6]), $AutoIssue, $QuantityOnHand, - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?', $Parent, $myrow[0], $DrillLink, $DrillID, - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?', $Parent, $myrow[0], $UltimateParent); @@ -413,7 +413,7 @@ break; } - echo '<br /><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Select a Different BOM') . '</a></div><br />'; + echo '<br /><div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">' . _('Select a Different BOM') . '</a></div><br />'; echo '<table class="selection">'; // Display Manufatured Parent Items $sql = "SELECT bom.parent, @@ -432,7 +432,7 @@ if( DB_num_rows($result) > 0 ) { echo '<tr><td><div class="centre">'._('Manufactured parent items').' : '; while ($myrow = DB_fetch_array($result)){ - echo (($ix)?', ':'').'<a href="'.$_SERVER['PHP_SELF'] . '?Select='.$myrow['parent'].'">'. + echo (($ix)?', ':'').'<a href="'.htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?Select='.$myrow['parent'].'">'. $myrow['description'].' ('.$myrow['parent'].')</a>'; $ix++; } //end while loop @@ -453,7 +453,7 @@ echo (($reqnl)?'<br />':'').'<tr><td><div class="centre">'._('Assembly parent items').' : '; $ix = 0; while ($myrow = DB_fetch_array($result)){ - echo (($ix)?', ':'').'<a href="'.$_SERVER['PHP_SELF'] . '?Select='.$myrow['parent'].'">'. + echo (($ix)?', ':'').'<a href="'.htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?Select='.$myrow['parent'].'">'. $myrow['description'].' ('.$myrow['parent'].')</a>'; $ix++; } //end while loop @@ -473,7 +473,7 @@ echo (($reqnl)?'<br />':'').'<tr><td><div class="centre">'._('Kit sets').' : '; $ix = 0; while ($myrow = DB_fetch_array($result)){ - echo (($ix)?', ':'').'<a href="'.$_SERVER['PHP_SELF'] . '?Select='.$myrow['parent'].'">'. + echo (($ix)?', ':'').'<a href="'.htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?Select='.$myrow['parent'].'">'. $myrow['description'].' ('.$myrow['parent'].')</a>'; $ix++; } //end while loop @@ -493,7 +493,7 @@ echo (($reqnl)?'<br />':'').'<tr><td><div class="centre">'._('Phantom').' : '; $ix = 0; while ($myrow = DB_fetch_array($result)){ - echo (($ix)?', ':'').'<a href="'.$_SERVER['PHP_SELF'] . '?Select='.$myrow['parent'].'">'. + echo (($ix)?', ':'').'<a href="'.htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?Select='.$myrow['parent'].'">'. $myrow['description'].' ('.$myrow['parent'].')</a>'; $ix++; } //end while loop @@ -548,7 +548,7 @@ if (! isset($_GET['delete'])) { - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?Select=' . $SelectedParent .'">'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?Select=' . $SelectedParent .'">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($_GET['SelectedComponent']) and $InputError !=1) { @@ -783,7 +783,7 @@ if (!isset($SelectedParent)) { echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . '</p>'; - echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">' . + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post">' . '<div class="page_help_text">'. _('Select a manufactured part') . ' (' . _('or Assembly or Kit part') . ') ' . _('to maintain the bill of material for using the options below') . '.' . '<br /><font size="1">' . _('Parts must be defined in the stock item entry') . '/' . _('modification screen as manufactured') . Modified: trunk/BackupDatabase.php =================================================================== --- trunk/BackupDatabase.php 2012-02-06 12:57:23 UTC (rev 8493) +++ trunk/BackupDatabase.php 2012-02-10 11:40:59 UTC (rev 8494) @@ -42,7 +42,7 @@ prnMsg(_('Once you have downloaded the database backup file to your local machine you should use the link below to delete it - backup files can consume a lot of space on your hosting account and will accumulate if not deleted - they also contain sensitive information which would otherwise be available for others to download!'),'info'); echo '<br /> <br /> - <div class="centre"><a href="'. $_SERVER['PHP_SELF'] . '?BackupFile=' .$BackupFile .'">' . _('Delete the backup file off the server') . '</a></div>'; + <div class="centre"><a href="'. htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?BackupFile=' .$BackupFile .'">' . _('Delete the backup file off the server') . '</a></div>'; } else { prnMsg(_('There was some problem producing a backup using mysqldump. Normally this relates to a permissions issue - the web-server user must have permission to write to the companies directory'),'error'); } Modified: trunk/BankAccounts.php =================================================================== --- trunk/BankAccounts.php 2012-02-06 12:57:23 UTC (rev 8493) +++ trunk/BankAccounts.php 2012-02-10 11:40:59 UTC (rev 8494) @@ -232,9 +232,9 @@ $myrow[5], $myrow[6], $defacc, - $_SERVER['PHP_SELF'], + htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), $myrow[0], - $_SERVER['PHP_SELF'], + htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), $myrow[0]); } @@ -246,11 +246,11 @@ if (isset($SelectedBankAccount)) { echo '<br />'; - echo '<div class="centre"><p><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Show All Bank Accounts Defined') . '</a></p></div>'; + echo '<div class="centre"><p><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">' . _('Show All Bank Accounts Defined') . '</a></p></div>'; echo '<br />'; } -echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; +echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedBankAccount) AND !isset($_GET['delete'])) { Modified: trunk/BankMatching.php =================================================================== --- trunk/BankMatching.php 2012-02-06 12:57:23 UTC (rev 8493) +++ trunk/BankMatching.php 2012-02-10 11:40:59 UTC (rev 8494) @@ -78,7 +78,7 @@ echo '<div class="page_help_text">' . _('Use this screen to match webERP Receipts and Payments to your Bank Statement. Check your bank statement and click the check-box when you find the matching transaction.') . '</div><br />'; -echo '<form action="'. $_SERVER['PHP_SELF'] . '" method="post">'; +echo '<form action="'. htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<input type="hidden" name="Type" value="' . $Type . '" />'; Modified: trunk/BankReconciliation.php =================================================================== --- trunk/BankReconciliation.php 2012-02-06 12:57:23 UTC (rev 8493) +++ trunk/BankReconciliation.php 2012-02-10 11:40:59 UTC (rev 8494) @@ -8,7 +8,7 @@ include('includes/header.inc'); -echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; +echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; Modified: trunk/COGSGLPostings.php =================================================================== --- trunk/COGSGLPostings.php 2012-02-06 12:57:23 UTC (rev 8493) +++ trunk/COGSGLPostings.php 2012-02-10 11:40:59 UTC (rev 8494) @@ -113,9 +113,9 @@ $myrow[2], $myrow[3], $myrow[4], - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?', $myrow[0], - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?', $myrow[0]); }//end while echo '</table>'; @@ -217,9 +217,9 @@ $myrow[2], $myrow[3], $myrow[4], - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?', $myrow[0], - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?', $myrow[0]); }//END WHILE LIST LOOP @@ -229,12 +229,12 @@ //end of ifs and buts! if (isset($SelectedCOGSPostingID)) { - echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] .'">' . _('Show all cost of sales posting records') . '</a></div>'; + echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') .'">' . _('Show all cost of sales posting records') . '</a></div>'; } echo '<br />'; -echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; +echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedCOGSPostingID)) { Modified: trunk/CompanyPreferences.php =================================================================== --- trunk/CompanyPreferences.php 2012-02-06 12:57:23 UTC (rev 8493) +++ trunk/CompanyPreferences.php 2012-02-10 11:40:59 UTC (rev 8494) @@ -155,7 +155,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; -echo '<form method="post" action=' . $_SERVER['PHP_SELF'] . '>'; +echo '<form method="post" action=' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="selection">'; Modified: trunk/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2012-02-06 12:57:23 UTC (rev 8493) +++ trunk/ConfirmDispatch_Invoice.php 2012-02-10 11:40:59 UTC (rev 8494) @@ -263,7 +263,7 @@ </table> <br />'; -echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; +echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; /*************************************************************** Modified: trunk/ContractBOM.php =================================================================== --- trunk/ContractBOM.php 2012-02-06 12:57:23 UTC (rev 8493) +++ trunk/ContractBOM.php 2012-02-10 11:40:59 UTC (rev 8494) @@ -223,7 +223,7 @@ /* This is where the order as selected should be displayed reflecting any deletions or insertions*/ -echo '<form name="ContractBOMForm" action="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier. '" method="post">'; +echo '<form name="ContractBOMForm" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?identifier='.$identifier. '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (count($_SESSION['Contract'.$identifier]->ContractBOM)>0){ @@ -268,7 +268,7 @@ <td>' . $ContractComponent->UOM . '</td> <td class="number">' . locale_number_format($ContractComponent->ItemCost,4) . '</td> <td class="number">' . $DisplayLineTotal . '</td> - <td><a href="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier. '&Delete=' . $ContractComponent->ComponentID . '">' . _('Delete') . '</a></td></tr>'; + <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?identifier='.$identifier. '&Delete=' . $ContractComponent->ComponentID . '">' . _('Delete') . '</a></td></tr>'; $TotalCost += $LineTotal; } Modified: trunk/ContractCosting.php =================================================================== --- trunk/ContractCosting.php 2012-02-06 12:57:23 UTC (rev 8493) +++ trunk/ContractCosting.php 2012-02-10 11:40:59 UTC (rev 8494) @@ -406,7 +406,7 @@ if ($_SESSION['Contract'.$identifier]->Status ==2){//the contract is an order being processed now - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?SelectedContract=' . $_SESSION['Contract'.$identifier]->ContractRef . '&identifier=' . $identifier . '">'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?SelectedContract=' . $_SESSION['Contract'.$identifier]->ContractRef . '&identifier=' . $identifier . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<br /><div class="centre"><input type="submit" name="CloseContract" value="' . _('Close Contract') . '" onclick="return confirm(\'' . _('Closing the contract will prevent further stock being issued to it and charges being made against it. Variances will be taken to the profit and loss account. Are You Sure?') . '\');" /></div>'; echo '</form>'; Modified: trunk/ContractOtherReqts.php =================================================================== --- trunk/ContractOtherReqts.php 2012-02-06 12:57:23 UTC (rev 8493) +++ trunk/ContractOtherReqts.php 2012-02-10 11:40:59 UTC (rev 8494) @@ -75,7 +75,7 @@ /* This is where the other requirement as entered/modified should be displayed reflecting any deletions or insertions*/ -echo '<form name="ContractReqtsForm" action="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier. '" method="post">'; +echo '<form name="ContractReqtsForm" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?identifier='.$identifier. '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/contract.png" title="' ._('Contract Other Requirements') . '" alt="" /> ' . _('Contract Other Requirements') . ' - ' . $_SESSION['Contract'.$identifier]->CustomerName.'</p>'; @@ -116,7 +116,7 @@ <td><input type="text" class="number" name="Qty' . $ContractReqtID . '" size="11" value="' . locale_number_format($ContractComponent->Quantity,2) . '" /></td> <td><input type="text" class="number" name="CostPerUnit' . $ContractReqtID . '" size="11" value="' . locale_money_format($ContractComponent->CostPerUnit,$_SESSION['Contract'.$identifier]->CurrCode) . '" /></td> <td class="number">' . $DisplayLineTotal . '</td> - <td><a href="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier. '&Delete=' . $ContractReqtID . '">' . _('Delete') . '</a></td></tr>'; + <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?identifier='.$identifier. '&Delete=' . $ContractReqtID . '">' . _('Delete') . '</a></td></tr>'; $TotalCost += $LineTotal; } Modified: trunk/Contracts.php =================================================================== --- trunk/Contracts.php 2012-02-06 12:57:23 UTC (rev 8493) +++ trunk/Contracts.php 2012-02-10 11:40:59 UTC (rev 8494) @@ -742,7 +742,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/contract.png" title="' . _('Contract') . '" alt="" />' . ' ' . _('Contract: Select Customer') . '</p>'; - echo '<form action="' . $_SERVER['PHP_SELF'] . '?identifier=' . $identifier .'" name="CustomerSelection" method="post">'; + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?identifier=' . $identifier .'" name="CustomerSelection" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table cellpadding="3" colspan="4" class="selection"> @@ -810,7 +810,7 @@ //end if RequireCustomerSelection } else { /*A customer is already selected so get into the contract setup proper */ - echo '<form name="ContractEntry" enctype="multipart/form-data" action="' . $_SERVER['PHP_SELF'] . '?identifier=' . $identifier . '" method="post">'; + echo '<form name="ContractEntry" enctype="multipart/form-data" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?identifier=' . $identifier . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"> Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2012-02-06 12:57:23 UTC (rev 8493) +++ trunk/CounterSales.php 2012-02-10 11:40:59 UTC (rev 8494) @@ -246,7 +246,7 @@ echo '<br /><br />'; prnMsg(_('This sale has been cancelled as requested'),'success'); - echo '<br /><br /><a href="' .$_SERVER['PHP_SELF'] . '">' . _('Start a new Counter Sale') . '</a>'; + echo '<br /><br /><a href="' .htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">' . _('Start a new Counter Sale') . '</a>'; include('includes/footer.inc'); exit; @@ -396,7 +396,7 @@ /* Always do the stuff below */ -echo '<form action="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier . '" name="SelectParts" method="post">'; +echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?identifier='.$identifier . '" name="SelectParts" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; //Get The exchange rate used for GPPercent calculations on adding or amending items @@ -843,7 +843,7 @@ $_SESSION['Items'.$identifier]->TaxGLCodes=$TaxGLCodes; echo '<td class="number">' . locale_money_format($TaxLineTotal ,$_SESSION['Items'.$identifier]->DefaultCurrency) . '</td>'; echo '<td class="number">' . locale_money_format($SubTotal + $TaxLineTotal ,$_SESSION['Items'.$identifier]->DefaultCurrency) . '</td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier . '&Delete=' . $OrderLine->LineNumber . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">' . _('Delete') . '</a></td></tr>'; + echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?identifier='.$identifier . '&Delete=' . $OrderLine->LineNumber . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">' . _('Delete') . '</a></td></tr>'; if ($_SESSION['AllowOrderLineItemNarrative'] == 1){ echo $RowStarter; @@ -2037,7 +2037,7 @@ } else { echo '<img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . '<a target="_blank" href="'.$rootpath.'/PrintCustTransPortrait.php?FromTransNo='.$InvoiceNo.'&InvOrCredit=Invoice&PrintPDF=True">'. _('Print this invoice'). ' (' . _('Portrait') . ')</a><br /><br />'; } - echo '<br /><br /><a href="' .$_SERVER['PHP_SELF'] . '">' . _('Start a new Counter Sale') . '</a></div>'; + echo '<br /><br /><a href="' .htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">' . _('Start a new Counter Sale') . '</a></div>'; } // There were input errors so don't process nuffin @@ -2256,7 +2256,7 @@ if (isset($SearchResult)) { $j = 1; - echo '<form action="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier . '" method="post" name="orderform">'; + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?identifier='.$identifier . '" method="post" name="orderform">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="selection">'; echo '<tr><td><input type="hidden" name="previous" value="'.locale_number_format($Offset-1,0).'" /> Modified: trunk/CreditStatus.php =================================================================== --- trunk/CreditStatus.php 2012-02-06 12:57:23 UTC (rev 8493) +++ trunk/CreditStatus.php 2012-02-10 11:40:59 UTC (rev 8494) @@ -177,9 +177,9 @@ $myrow[0], $myrow[1], $DissallowText, - $_SERVER['PHP_SELF'], + htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), $myrow[0], - $_SERVER['PHP_SELF'], + htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), $myrow[0]); } //END WHILE LIST LOOP @@ -188,12 +188,12 @@ } //end of ifs and buts! if (isset($SelectedReason)) { - echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Show Defined Credit Status Codes') . '</a></div>'; + echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">' . _('Show Defined Credit Status Codes') . '</a></div>'; } if (!isset($_GET['delete'])) { - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedReason) and ($InputError!=1)) { Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2012-02-06 12:57:23 UTC (rev 8493) +++ trunk/Credit_Invoice.php 2012-02-10 11:40:59 UTC (rev 8494) @@ -261,7 +261,7 @@ if (!isset($_POST['ProcessCredit'])) { - echo '<form action="' . $_SERVER['PHP_SELF'] .'" method="post">'; + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') .'" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -382,7 +382,7 @@ echo '<td class="number">' . $DisplayTaxAmount . '</td> <td class="number">' . $DisplayGrossLineTotal . '</td> - <td><a href="'. $_SERVER['PHP_SELF'] . '?Delete=' . $LnItm->LineNumber . '">' . _('Delete') . '</a></td></tr>'; + <td><a href="'. htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?Delete=' . $LnItm->LineNumber . '">' . _('Delete') . '</a></td></tr>'; echo '<tr'.$RowStarter . '><td colspan="12"><textarea tabindex="'.$j.'" name="Narrative_' . $LnItm->LineNumber . '" cols=100% rows=1>' . $LnItm->Narrative . '</textarea><br /><hr></td></tr>'; $j++; Modified: trunk/Currencies.php =================================================================== --- trunk/Currencies.php 2012-02-06 12:57:23 UTC (rev 8493) +++ trunk/Currencies.php 2012-02-10 11:40:59 UTC (rev 8494) @@ -248,10 +248,10 @@ locale_number_format($myrow['decimalplaces'],0), locale_number_format($myrow['rate'],5), locale_number_format(GetCurrencyRate($myrow['currabrev'],$CurrencyRatesArray),5), - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?', $myrow['currabrev'], _('Edit'), - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?', $myrow['currabrev'], _('Delete'), $rootpath, @@ -282,14 +282,14 @@ if (isset($SelectedCurrency)) { - echo '<div class="centre"><a href="' .$_SERVER['PHP_SELF'] . '">'._('Show all currency definitions').'</a></div>'; + echo '<div class="centre"><a href="' .htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">'._('Show all currency definitions').'</a></div>'; } echo '<br />'; if (!isset($_GET['delete'])) { - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedCurrency) AND $SelectedCurrency!='') { Modified: trunk/CustEDISetup.php =================================================================== --- trunk/CustEDISetup.php 2012-02-06 12:57:23 UTC (rev 8493) +++ trunk/CustEDISetup.php 2012-02-10 11:40:59 UTC (rev 8494) @@ -69,7 +69,7 @@ } } -echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; +echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<br /><table class="selection">'; Modified: trunk/CustLoginSetup.php =================================================================== --- trunk/CustLoginSetup.php 2012-02-06 12:57:23 UTC (rev 8493) +++ trunk/CustLoginSetup.php 2012-02-10 11:40:59 UTC (rev 8494) @@ -300,9 +300,9 @@ $myrow[8], $myrow[9], $myrow[10], - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?', $myrow[0], - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?', $myrow[0]); } //END WHILE LIST LOOP @@ -311,10 +311,10 @@ if (isset($SelectedUser)) { - echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] .'">' . _('Review Existing Users') . '</a></div><br />'; + echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') .'">' . _('Review Existing Users') . '</a></div><br />'; } -echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; +echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedUser)) { Modified: trunk/CustWhereAlloc.php =================================================================== --- trunk/CustWhereAlloc.php 2012-02-06 12:57:23 UTC (rev 8493) +++ trunk/CustWhereAlloc.php 2012-02-10 11:40:59 UTC (rev 8494) @@ -6,7 +6,7 @@ $title = _('Customer How Paid Inquiry'); include('includes/header.inc'); -echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; +echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Customer Where Allocated'). '" alt="" />' . $title . '</p>'; Modified: trunk/CustomerAllocations.php =================================================================== --- trunk/CustomerAllocations.php 2012-02-06 12:57:23 UTC (rev 8493) +++ trunk/CustomerAllocations.php 2012-02-10 11:40:59 UTC (rev 8494) @@ -341,7 +341,7 @@ if (isset($_POST['AllocTrans'])) { // Page called with trans number - echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<input type="hidden" name="AllocTrans" value="' . $_POST['AllocTrans'] . '" />'; @@ -480,7 +480,7 @@ <td>' . ConvertSQLDate($myrow['trandate']) . '</td> <td class="number">' . locale_money_format($myrow['total'],$myrow['currcode']) . '</td> <td class="number">' . locale_money_format($myrow['total']-$myrow['alloc'],$myrow['currcode']) . '</td>'; - echo '<td><a href=' . $_SERVER['PHP_SELF']. '?AllocTrans=' . $myrow['id'] . '>' . _('Allocate') . '</a></td></tr>'; + echo '<td><a href=' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'). '?AllocTrans=' . $myrow['id'] . '>' . _('Allocate') . '</a></td></tr>'; } DB_free_result($result); echo '</table><br />'; @@ -519,7 +519,7 @@ $k=0; while ($myrow = DB_fetch_array($result)) { - $allocate = '<a href=' . $_SERVER['PHP_SELF']. '?AllocTrans=' . $myrow['id'] . '>' . _('Allocate') . '</a>'; + $allocate = '<a href=' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'). '?AllocTrans=' . $myrow['id'] . '>' . _('Allocate') . '</a>'; if ( $curDebtor != $myrow['debtorno'] ) { if ( $curTrans > 1 ) { Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2012-02-06 12:57:23 UTC (rev 8493) +++ trunk/CustomerBranches.php 2012-02-10 11:40:59 UTC (rev 8494) @@ -422,11 +422,11 @@ $myrow[8], $myrow[9], ($myrow[11]?_('No'):_('Yes')), - $_SERVER['PHP_SELF'], + htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), $DebtorNo, urlencode($myrow[1]), _('Edit'), - $_SERVER['PHP_SELF'], + htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), $DebtorNo, urlencode($myrow[1]), _('Delete Branch')); @@ -466,7 +466,7 @@ } if (!isset($_GET['delete'])) { - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] .'">'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') .'">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedBranch)) { @@ -542,7 +542,7 @@ echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" />' . ' ' . _('Change Details for Branch'). ' '. $SelectedBranch . '</p>'; if (isset($SelectedBranch)) { - echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?DebtorNo=' . $DebtorNo. '">' . _('Show all branches defined for'). ' '. $DebtorNo . '</a></div>'; + echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?DebtorNo=' . $DebtorNo. '">' . _('Show all branches defined for'). ' '. $DebtorNo . '</a></div>'; } echo '<br /><table class="selection">'; echo '<tr><th colspan="2"><div class="centre"><b>'._('Change Branch').'</b></th></tr>'; Modified: trunk/CustomerInquiry.php =================================================================== --- trunk/CustomerInquiry.php 2012-02-06 12:57:23 UTC (rev 8493) +++ trunk/CustomerInquiry.php 2012-02-10 11:40:59 UTC (rev 8494) @@ -145,7 +145,7 @@ </tr> </table>'; -echo '<br /><div class="centre"><form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; +echo '<br /><div class="centre"><form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo _('Show all transactions after') . ': <input tabindex="1" type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" id="datepicker" name="TransAfterDate" value="' . $_POST['TransAfterDate'] . '" maxlength="10" size="12" />' . ' <input tabindex="2" type="submit" name="Refresh Inquiry" value="' . _('Refresh Inquiry') . '" /></div></form><br />'; Modified: trunk/CustomerReceipt.php =================================================================== --- trunk/CustomerReceipt.php 2012-02-06 12:57:23 UTC (rev 8493) +++ trunk/CustomerReceipt.php 2012-02-10 11:40:59 UTC (rev 8494) @@ -704,7 +704,7 @@ /*set up the form whatever */ -echo '<form action="' . $_SERVER['PHP_SELF'] . '?Type='.$_GET['Type'] . '" method="post" name="form1">'; +echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?Type='.$_GET['Type'] . '" method="post" name="form1">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; /*show the batch header details and the entries in the batch so far */ @@ -864,7 +864,7 @@ <td>' . stripslashes($ReceiptItem->CustomerName) . '</td> <td>'.$ReceiptItem->GLCode.' - '.$myrow['accountname'].'</td> <td>'.$ReceiptItem->Narrative . '</td> - <td><a href="' . $_SERVER['PHP_SELF'] . '?Delete=' . $ReceiptItem->ID . '&Type='.$_GET['Type'].'">' . _('Delete') . '</a></td> + <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?Delete=' . $ReceiptItem->ID . '&Type='.$_GET['Type'].'">' . _('Delete') . '</a></td> </tr>'; $BatchTotal= $BatchTotal + $ReceiptItem->Amount; } Modified: trunk/CustomerTransInquiry.php =================================================================== --- trunk/CustomerTransInquiry.php 2012-02-06 12:57:23 UTC (rev 8493) +++ trunk/CustomerTransInquiry.php 2012-02-10 11:40:59 UTC (rev 8494) @@ -11,7 +11,7 @@ ' ' . _('Transaction Inquiry') . '</p>'; echo '<div class="page_help_text">' . _('Choose which type of transaction to report on.') . '</div><br />'; -echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; +echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table cellpadding="2" class="selection"><tr>'; Modified: trunk/CustomerTypes.php =================================================================== --- trunk/CustomerTypes.php 2012-02-06 12:57:23 UTC (rev 8493) +++ trunk/CustomerTypes.php 2012-02-10 11:40:59 UTC (rev 8494) @@ -204,9 +204,9 @@ </tr>', $myrow[0], $myrow[1], - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?', $myrow[0], - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?', $myrow[0]); } //END WHILE LIST LOOP @@ -216,11 +216,11 @@ //end of ifs and buts! if (isset($SelectedType)) { - echo '<div class="centre"><p><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Show All Types Defined') . '</a></p></div>'; + echo '<div class="centre"><p><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">' . _('Show All Types Defined') . '</a></p></div>'; } if (! isset($_GET['delete'])) { - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<br /><table class="selection">'; //Main table Modified: trunk/Customers.php =================================================================== --- trunk/Customers.php 2012-02-06 12:57:23 UTC (rev 8493) +++ trunk/Customers.php 2012-02-10 11:40:59 UTC (rev 8494) @@ -437,12 +437,12 @@ } if ($SetupErrors>0) { - echo '<br /><div class="centre"><a href="'.$_SERVER['PHP_SELF'] .'" >'._('Click here to continue').'</a></div>'; + echo '<br /><div class="centre"><a href="'.htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') .'" >'._('Click here to continue').'</a></div>'; include('includes/footer.inc'); exit; } - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<input type="hidden" name="New" value="Yes" />'; @@ -602,7 +602,7 @@ //DebtorNo exists - either p... [truncated message content] |
From: <tim...@us...> - 2012-02-10 21:22:29
|
Revision: 8496 http://weberp.svn.sourceforge.net/weberp/?rev=8496&view=rev Author: tim_schofield Date: 2012-02-10 21:22:23 +0000 (Fri, 10 Feb 2012) Log Message: ----------- Move copy BOM script from Admin utilities to main menu Modified Paths: -------------- trunk/includes/IndexArray.php trunk/includes/session.inc Added Paths: ----------- trunk/CopyBOM.php trunk/sql/mysql/updates/106.php Removed Paths: ------------- trunk/Z_CopyBOM.php Copied: trunk/CopyBOM.php (from rev 8494, trunk/Z_CopyBOM.php) =================================================================== --- trunk/CopyBOM.php (rev 0) +++ trunk/CopyBOM.php 2012-02-10 21:22:23 UTC (rev 8496) @@ -0,0 +1,169 @@ +<?php +/** + * Author: Ashish Shukla <gmail.com!wahjava> + * + * Script to duplicate BoMs. + */ +/* $Id$*/ + +$title = _('Copy a BOM to New Item Code'); + +include('includes/session.inc'); + +include('includes/header.inc'); + +include('includes/SQL_CommonFunctions.inc'); + +if(isset($_POST['Submit'])) { + $stkid = $_POST['stkid']; + $type = $_POST['type']; + $newstkid = ''; + + if($type == 'N') { + $newstkid = $_POST['tostkid']; + } else { + $newstkid = $_POST['exstkid']; + } + + $result = DB_query("begin", $db); + + if($type == 'N') { + /* duplicate rows into stockmaster */ + $sql = "INSERT INTO stockmaster + SELECT '".$newstkid."' AS stockid, + categoryid, + description, + longdescription, + units, + mbflag, + lastcurcostdate, + actualcost, + lastcost, + materialcost, + labourcost, + overheadcost, + lowestlevel, + discontinued, + controlled, + eoq, + volume, + kgs, + barcode, + discountcategory, + taxcatid, + serialised, + appendfile, + perishable, + decimalplaces, + nextserialno, + pansize, + shrinkfactor, + netweight + FROM stockmaster + WHERE stockid='".$stkid."';"; + $result = DB_query($sql, $db); + } else { + $sql = "SELECT lastcurcostdate, + actualcost, + lastcost, + materialcost, + labourcost, + overheadcost, + lowestlevel + FROM stockmaster + WHERE stockid='".$stkid."';"; + $result = DB_query($sql, $db); + + $row = DB_fetch_row($result); + + $sql = "UPDATE stockmaster set + lastcurcostdate = '".$row[0]."', + actualcost = ".$row[1].", + lastcost = ".$row[2].", + materialcost = ".$row[3].", + labourcost = ".$row[4].", + overheadcost = ".$row[5].", + lowestlevel = ".$row[6]." + WHERE stockid='".$newstkid."';"; + $result = DB_query($sql, $db); + } + + $sql = "INSERT INTO bom + SELECT '".$newstkid."' AS parent, + component, + workcentreadded, + loccode, + effectiveafter, + effectiveto, + quantity, + autoissue + FROM bom + WHERE parent='".$stkid."';"; + $result = DB_query($sql, $db); + + if($type == 'N') { + $sql = "INSERT INTO locstock + SELECT loccode, + '".$newstkid."' AS stockid, + 0 AS quantity, + reorderlevel + FROM locstock + WHERE stockid='".$stkid."';"; + $result = DB_query($sql, $db); + } + + $result = DB_query('commit', $db); + + UpdateCost($db, $newstkid); + + header('Location: BOMs.php?Select='.$newstkid); +} else { + include('includes/header.inc'); + + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Contract') . '" alt="" />' . ' ' . $title . '</p>'; + + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + + $sql = "SELECT stockid, + description + FROM stockmaster + WHERE stockid IN (SELECT DISTINCT parent FROM bom) + AND mbflag IN ('M', 'A', 'K');"; + $result = DB_query($sql, $db); + + echo '<table class="selection"> + <tr> + <td>' . _('From Stock ID') . '</td>'; + echo '<td><select name="stkid">'; + while($row = DB_fetch_row($result)) { + echo '<option value="'.$row[0].'">'.$row[0].' -- '.$row[1].'</option>'; + } + echo '</select></td> + </tr>'; + echo '<tr> + <td><input type="radio" name="type" value="N" checked="" />' . _(' To New Stock ID') . '</td></td><td>'; + echo '<input type="text" maxlength="20" name="tostkid" /></td></tr>'; + + $sql = "SELECT stockid, + description + FROM stockmaster + WHERE stockid NOT IN (SELECT DISTINCT parent FROM bom) + AND mbflag IN ('M', 'A', 'K');"; + $result = DB_query($sql, $db); + + if (DB_num_rows($result) > 0) { + echo '<tr> + <td><input type="radio" name="type" value="E" />'._('To Existing Stock ID') . '</td><td>'; + echo '<select name="exstkid">'; + while($row = DB_fetch_row($result)) { + echo '<option value="'.$row[0].'">'.$row[0].' -- '.$row[1].'</option>'; + } + echo '</select>'; + } + echo '</table>'; + echo '<br /><div class="centre"><input type="submit" name="Submit" value="Submit" /></div></form>'; + + include('includes/footer.inc'); +} +?> \ No newline at end of file Deleted: trunk/Z_CopyBOM.php =================================================================== --- trunk/Z_CopyBOM.php 2012-02-10 15:17:27 UTC (rev 8495) +++ trunk/Z_CopyBOM.php 2012-02-10 21:22:23 UTC (rev 8496) @@ -1,160 +0,0 @@ -<?php -/** - * Author: Ashish Shukla <gmail.com!wahjava> - * - * Script to duplicate BoMs. - */ -/* $Id$*/ - -include('includes/session.inc'); -include('includes/SQL_CommonFunctions.inc'); - -if(isset($_POST['Submit'])) { - $stkid = $_POST['stkid']; - $type = $_POST['type']; - $newstkid = ''; - - if($type == 'N') { - $newstkid = $_POST['tostkid']; - } else { - $newstkid = $_POST['exstkid']; - } - - $result = DB_query("begin", $db); - - if($type == 'N') { - /* duplicate rows into stockmaster */ - $sql = "INSERT INTO stockmaster - SELECT '".$newstkid."' AS stockid, - categoryid, - description, - longdescription, - units, - mbflag, - lastcurcostdate, - actualcost, - lastcost, - materialcost, - labourcost, - overheadcost, - lowestlevel, - discontinued, - controlled, - eoq, - volume, - kgs, - barcode, - discountcategory, - taxcatid, - serialised, - appendfile, - perishable, - decimalplaces - FROM stockmaster - WHERE stockid='".$stkid."';"; - $result = DB_query($sql, $db); - } else { - $sql = "SELECT lastcurcostdate, - actualcost, - lastcost, - materialcost, - labourcost, - overheadcost, - lowestlevel - FROM stockmaster - WHERE stockid='".$stkid."';"; - $result = DB_query($sql, $db); - - $row = DB_fetch_row($result); - - $sql = "UPDATE stockmaster set - lastcurcostdate = '".$row[0]."', - actualcost = ".$row[1].", - lastcost = ".$row[2].", - materialcost = ".$row[3].", - labourcost = ".$row[4].", - overheadcost = ".$row[5].", - lowestlevel = ".$row[6]." - WHERE stockid='".$newstkid."';"; - $result = DB_query($sql, $db); - } - - $sql = "INSERT INTO bom - SELECT '".$newstkid."' AS parent, - component, - workcentreadded, - loccode, - effectiveafter, - effectiveto, - quantity, - autoissue - FROM bom - WHERE parent='".$stkid."';"; - $result = DB_query($sql, $db); - - if($type == 'N') - { - $sql = "INSERT NTO locstock - SELECT loccode, - '".$newstkid."' AS stockid, - 0 AS quantity, - reorderlevel - FROM locstock - Where stockid='".$stkid."';"; - $result = DB_query($sql, $db); - } - - $result = DB_query('commit', $db); - - UpdateCost($db, $newstkid); - - header('Location: BOMs.php?Select='.$newstkid); - } - - else - { - $title = _('UTILITY PAGE To Copy a BOM'); - include('includes/header.inc'); - - echo '<form method="post" action="Z_CopyBOM.php">'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - - $sql = "SELECT stockid, - description - FROM stockmaster - WHERE stockid IN (SELECT DISTINCT parent FROM bom) - AND mbflag IN ('M', 'A', 'K');"; - $result = DB_query($sql, $db); - - echo '<br />'._('From Stock ID'); - echo ': <select name="stkid">'; - while($row = DB_fetch_row($result)) - { - echo '<option value="'.$row[0].'">'.$row[0].' -- '.$row[1].'</option>'; - } - echo '</select><br /><input type="radio" name="type" value="N" checked="" />'._(' To New Stock ID'); - echo ': <input type="text" maxlength="20" name="tostkid" />'; - - $sql = "SELECT stockid, - description - FROM stockmaster - WHERE stockid NOT IN (SELECT DISTINCT parent FROM bom) - AND mbflag IN ('M', 'A', 'K');"; - $result = DB_query($sql, $db); - - if(DB_num_rows($result) > 0) - { - echo '<br /><input type="radio" name="type" value="E"/>'._('To Existing Stock ID'); - echo ': <select name="exstkid">'; - while($row = DB_fetch_row($result)) - { - echo '<option value="'.$row[0].'">'.$row[0].' -- '.$row[1].'</option>'; - } - echo '</select>'; - } - echo '<br />'; - echo '<input type="submit" name="Submit" value="Submit" /><br />'; - - include('includes/footer.inc'); - } -?> \ No newline at end of file Modified: trunk/includes/IndexArray.php =================================================================== --- trunk/includes/IndexArray.php 2012-02-10 15:17:27 UTC (rev 8495) +++ trunk/includes/IndexArray.php 2012-02-10 21:22:23 UTC (rev 8496) @@ -305,6 +305,7 @@ $MenuItems['manuf']['Maintenance']['Caption'] = array (_('Work Centre'), _('Bills Of Material'), + _('Copy BOM To New Item'), _('Master Schedule'), _('Auto Create Master Schedule'), _('MRP Calculation') @@ -312,6 +313,7 @@ $MenuItems['manuf']['Maintenance']['URL'] = array ('/WorkCentres.php', '/BOMs.php', + '/CopyBOM.php', '/MRPDemands.php', '/MRPCreateDemands.php', '/MRP.php' Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2012-02-10 15:17:27 UTC (rev 8495) +++ trunk/includes/session.inc 2012-02-10 21:22:23 UTC (rev 8496) @@ -13,7 +13,7 @@ header('Location:' . $rootpath . '/install/index.php'); } include($PathPrefix . 'config.php'); -$DBVersion=105; +$DBVersion=106; if (isset($SessionSavePath)){ session_save_path($SessionSavePath); } Added: trunk/sql/mysql/updates/106.php =================================================================== --- trunk/sql/mysql/updates/106.php (rev 0) +++ trunk/sql/mysql/updates/106.php 2012-02-10 21:22:23 UTC (rev 8496) @@ -0,0 +1,10 @@ +<?php + +/* Include the new script for printing quotations in Portrait + */ + +UpdateField('pagesecurity', 'script', 'CopyBOM.php', "script='Z_CopyBOM.php'", $db); + +UpdateDBNo(106, $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: <Tu...@us...> - 2012-02-11 17:18:49
|
Revision: 8498 http://weberp.svn.sourceforge.net/weberp/?rev=8498&view=rev Author: TurboPT Date: 2012-02-11 17:18:40 +0000 (Sat, 11 Feb 2012) Log Message: ----------- 1. Removed invalid attribute colspan where found within table tag elements. 2. Replaced table row bgcolor with the appropriate css class. Modified Paths: -------------- trunk/BOMInquiry.php trunk/BOMs.php trunk/ConfirmDispatch_Invoice.php trunk/ContractBOM.php trunk/ContractOtherReqts.php trunk/Contracts.php trunk/CounterSales.php trunk/Credit_Invoice.php trunk/CustomerInquiry.php trunk/CustomerReceipt.php trunk/DeliveryDetails.php trunk/FTP_RadioBeacon.php trunk/GLCodesInquiry.php trunk/InternalStockRequest.php trunk/MRPDemands.php trunk/MRPReport.php trunk/OrderDetails.php trunk/PO_Header.php trunk/PO_Items.php trunk/PO_OrderDetails.php trunk/PO_SelectOSPurchOrder.php trunk/PO_SelectPurchOrder.php trunk/PaymentAllocations.php trunk/PeriodsInquiry.php trunk/PurchData.php trunk/RecurringSalesOrders.php trunk/ReverseGRN.php trunk/SalesAnalRepts.php trunk/SelectAsset.php trunk/SelectCompletedOrder.php trunk/SelectContract.php trunk/SelectCreditItems.php trunk/SelectCustomer.php trunk/SelectGLAccount.php trunk/SelectOrderItems.php trunk/SelectProduct.php trunk/SelectRecurringSalesOrder.php trunk/SelectSalesOrder.php trunk/SelectSupplier.php trunk/SelectWorkOrder.php trunk/ShipmentCosting.php trunk/Shipments.php trunk/Shipt_Select.php trunk/ShiptsList.php trunk/SpecialOrder.php trunk/SuppCreditGRNs.php trunk/SuppInvGRNs.php trunk/SupplierAllocations.php trunk/SupplierCredit.php trunk/SupplierInquiry.php trunk/SupplierInvoice.php trunk/SupplierTenderCreate.php trunk/SupplierTenders.php trunk/TopItems.php trunk/WorkOrderEntry.php trunk/WorkOrderIssue.php trunk/includes/InputSerialItemsFile.php trunk/includes/InputSerialItemsKeyed.php trunk/includes/OutputSerialItems.php Modified: trunk/BOMInquiry.php =================================================================== --- trunk/BOMInquiry.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/BOMInquiry.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -18,7 +18,7 @@ _('to view the costed bill of materials') . '.' . '<br /><font size="1">' . _('Parts must be defined in the stock item entry') . '/' . _('modification screen as manufactured') . ', ' . _('kits or assemblies to be available for construction of a bill of material').'</div>' - .'</font><br /><table class="selection" cellpadding="3" colspan="4"><tr><td><font size="1">' . _('Enter text extracts in the') . + .'</font><br /><table class="selection" cellpadding="3"><tr><td><font size="1">' . _('Enter text extracts in the') . ' <b>' . _('description') . '</b>:</font></td><td><input tabindex="1" type="text" name="Keywords" size="20" maxlength="25" /></td> <td><font size="3"><b>' . _('OR') . '</b></font></td><td><font size="1">' . _('Enter extract of the') . ' <b>' . _('Stock Code') . '</b>:</font></td><td><input tabindex="2" type="text" name="StockCode" size="15" maxlength="20" /></td> @@ -87,7 +87,7 @@ if (isset($_POST['Search']) and isset($result) AND !isset($SelectedParent)) { - echo '<br /><hr><br /><table class="selection" cellpadding="2" colspan="7">'; + echo '<br /><hr /><br /><table class="selection" cellpadding="2">'; $TableHeader = '<tr><th>' . _('Code') . '</th> <th>' . _('Description') . '</th> <th>' . _('On Hand') . '</th> Modified: trunk/BOMs.php =================================================================== --- trunk/BOMs.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/BOMs.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -788,7 +788,7 @@ _('to maintain the bill of material for using the options below') . '.' . '<br /><font size="1">' . _('Parts must be defined in the stock item entry') . '/' . _('modification screen as manufactured') . ', ' . _('kits or assemblies to be available for construction of a bill of material') .'</div>'. - '</font><br /><table class="selection" cellpadding="3" colspan="4"><tr><td><font size="1">' . _('Enter text extracts in the') . + '</font><br /><table class="selection" cellpadding="3"><tr><td><font size="1">' . _('Enter text extracts in the') . ' <b>' . _('description') . '</b>:</font></td><td><input tabindex="1" type="text" name="Keywords" size="20" maxlength="25" /></td> <td><font size="3"><b>' . _('OR') . '</b></font></td><td><font size="1">' . _('Enter extract of the') . ' <b>' . _('Stock Code') . '</b>:</font></td><td><input tabindex="2" type="text" name="StockCode" size="15" maxlength="18" /></td> @@ -797,7 +797,7 @@ if (isset($_POST['Search']) and isset($result) AND !isset($SelectedParent)) { - echo '<br /><table cellpadding="2" colspan="7" class="selection">'; + echo '<br /><table cellpadding="2" class="selection">'; $TableHeader = '<tr><th>' . _('Code') . '</th> <th>' . _('Description') . '</th> <th>' . _('On Hand') . '</th> Modified: trunk/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/ConfirmDispatch_Invoice.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -269,7 +269,7 @@ /*************************************************************** Line Item Display ***************************************************************/ -echo '<table width="90%" cellpadding="2" colspan="7" class="selection"> +echo '<table width="90%" cellpadding="2" class="selection"> <tr> <th>' . _('Item Code') . '</th> <th>' . _('Item Description' ) . '</th> Modified: trunk/ContractBOM.php =================================================================== --- trunk/ContractBOM.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/ContractBOM.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -335,7 +335,7 @@ if (isset($SearchResult)) { - echo '<table cellpadding="1" colspan="7">'; + echo '<table cellpadding="1">'; $TableHeader = '<tr> <th>' . _('Code') . '</th> Modified: trunk/ContractOtherReqts.php =================================================================== --- trunk/ContractOtherReqts.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/ContractOtherReqts.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -82,7 +82,7 @@ if (count($_SESSION['Contract'.$identifier]->ContractReqts)>0){ - echo '<table cellpadding="2" colspan="7" class="selection">'; + echo '<table cellpadding="2" class="selection">'; if (isset($_SESSION['Contract'.$identifier]->ContractRef)) { echo '<tr><th colspan="5">' . _('Contract Reference:') .' '. $_SESSION['Contract'.$identifier]->ContractRef.'</th></tr>'; Modified: trunk/Contracts.php =================================================================== --- trunk/Contracts.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/Contracts.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -745,7 +745,7 @@ echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?identifier=' . $identifier .'" name="CustomerSelection" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table cellpadding="3" colspan="4" class="selection"> + echo '<table cellpadding="3" class="selection"> <tr> <td><h5>' . _('Part of the Customer Branch Name') . ':</h5></td> <td><input tabindex="1" type="text" name="CustKeywords" size="20" maxlength="25" /></td> Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/CounterSales.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -760,7 +760,7 @@ */ echo '<br /> - <table width="90%" cellpadding="2" colspan="7" class="selection"> + <table width="90%" cellpadding="2" class="selection"> <tr bgcolor="#800000">'; echo '<th>' . _('Item Code') . '</th> <th>' . _('Item Description') . '</th> Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/Credit_Invoice.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -265,7 +265,7 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table cellpadding="2" colspan="7" class="selection"><tr>'; + echo '<table cellpadding="2" class="selection"><tr>'; echo '<tr><th colspan="13">'; echo '<div class="centre"><font color="blue" size="4"><b>' . _('Credit Invoice') . ' ' . $_SESSION['ProcessingCredit'] . '</b> <b>'.' - ' . $_SESSION['CreditItems']->CustomerName . '</b></font> Modified: trunk/CustomerInquiry.php =================================================================== --- trunk/CustomerInquiry.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/CustomerInquiry.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -182,7 +182,7 @@ } /*show a table of the invoices returned by the SQL */ -echo '<table class="selection" cellpadding="2" colspan="7">'; +echo '<table class="selection" cellpadding="2">'; $tableheader = '<tr> <th>' . _('Type') . '</th> Modified: trunk/CustomerReceipt.php =================================================================== --- trunk/CustomerReceipt.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/CustomerReceipt.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -1028,7 +1028,7 @@ echo '<br />'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" />' . ' ' . _('Select a Customer') . '</p>'; - echo '<table cellpadding="3" colspan="4" class="selection">'; + echo '<table cellpadding="3" class="selection">'; echo '<tr><td>' . _('Text in the Customer') . ' ' . '<b>' . _('name') . '</b>:</td>'; echo '<td><input tabindex="9" type="text" name="Keywords" size="15" maxlength="25" /></td>'; echo '<td><font size="3"><b>' . _('OR') . '</b></font></td>'; @@ -1044,7 +1044,7 @@ if (isset($CustomerSearchResult)) { - echo '<table cellpadding="2" colspan="7" class="selection">'; + echo '<table cellpadding="2" class="selection">'; $TableHeader = '<tr><th>' . _('Code') . '</th> <th>' . _('Customer Name') . '</th></tr>'; echo $TableHeader; Modified: trunk/DeliveryDetails.php =================================================================== --- trunk/DeliveryDetails.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/DeliveryDetails.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -907,7 +907,7 @@ /*Display the order without discount */ echo '<div class="centre"><b>' . _('Order Summary') . '</b></div> - <table cellpadding="2" colspan="7" border="1"><tr> + <table cellpadding="2" border="1"><tr> <th>'. _('Item Description') .'</th> <th>'. _('Quantity') .'</th> <th>'. _('Unit') .'</th> Modified: trunk/FTP_RadioBeacon.php =================================================================== --- trunk/FTP_RadioBeacon.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/FTP_RadioBeacon.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -44,7 +44,7 @@ /*show a table of the orders returned by the SQL */ -echo '<table cellpadding="2" colspan="7" width="100%">'; +echo '<table cellpadding="2" width="100%">'; $TableHeader = '<tr> <th>' . _('Modify') . '</td> <th>' . _('Send to') . '<br />' . _('Radio Beacon') . '</td> @@ -64,10 +64,10 @@ $k=0; //row colour counter while ($myrow=DB_fetch_array($SalesOrdersResult)) { if ($k==1){ - echo '<tr bgcolor="#CCCCCC">'; + echo '<tr class="EvenTableRows">'; $k=0; } else { - echo '<tr bgcolor="#EEEEEE">'; + echo '<tr class="OddTableRows">'; $k=1; } Modified: trunk/GLCodesInquiry.php =================================================================== --- trunk/GLCodesInquiry.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/GLCodesInquiry.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -22,7 +22,7 @@ /*show a table of the orders returned by the SQL */ -echo '<table cellpadding="2" colspan="2"> +echo '<table cellpadding="2"> <tr> <th>'._('Group').'</font></th> <th>'._('Code').'</font></th> Modified: trunk/InternalStockRequest.php =================================================================== --- trunk/InternalStockRequest.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/InternalStockRequest.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -477,7 +477,7 @@ // echo '<input type="hidden" name=Search value="Search" />'; echo '<br /></div>'; } - echo '<table cellpadding="2" colspan="7">'; + echo '<table cellpadding="2">'; $tableheader = '<tr> <th>' . _('Code') . '</th> <th>' . _('Description') . '</th> Modified: trunk/MRPDemands.php =================================================================== --- trunk/MRPDemands.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/MRPDemands.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -83,7 +83,7 @@ if (DB_num_rows($result) > 0) { echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table cellpadding="2" colspan="7" class="selection">'; + echo '<table cellpadding="2" class="selection">'; $TableHeader = '<tr><th>' . _('Code') . '</th> <th>' . _('Description') . '</th> </tr>'; @@ -320,7 +320,7 @@ echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (!isset($StockID)) { - echo'</font><table cellpadding="3" colspan="4" class="selection"><tr> + echo'</font><table cellpadding="3" class="selection"><tr> <td><font size="1">' . _('Enter text extracts in the') . ' <b>' . _('description') . '</b>:</font></td> <td><input tabindex="1" type="text" name="Keywords" size="20" maxlength="25" /></td> <td><font size="3"><b>' . _('OR') . '</b></font></td> Modified: trunk/MRPReport.php =================================================================== --- trunk/MRPReport.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/MRPReport.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -731,7 +731,7 @@ // echo '<input type="hidden" name=Search value="Search" />'; echo '<br /></div>'; } - echo '<table cellpadding="2" colspan="7">'; + echo '<table cellpadding="2">'; $tableheader = '<tr> <th>' . _('Code') . '</th> <th>' . _('Description') . '</th> Modified: trunk/OrderDetails.php =================================================================== --- trunk/OrderDetails.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/OrderDetails.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -148,7 +148,7 @@ $OrderTotalVolume = 0; $OrderTotalWeight = 0; - echo '<br /><table cellpadding="2" colspan="9" class="selection">'; + echo '<br /><table cellpadding="2" class="selection">'; echo '<tr><th colspan="9"><font size="3" color="#616161">'._('Order Line Details For Order No').' '.$_GET['OrderNumber'].'</font></th></tr>'; echo '<tr> <th>' . _('Item Code') . '</th> Modified: trunk/PO_Header.php =================================================================== --- trunk/PO_Header.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/PO_Header.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -535,7 +535,7 @@ echo '<input type="hidden" name="SuppliersReturned" value="' . $SuppliersReturned .'" />'; } - echo '<table cellpadding="3" colspan="4" class="selection"> + echo '<table cellpadding="3" class="selection"> <tr> <td><font size="1">' . _('Enter text in the supplier name') . ':</font></td> <td><input type="text" name="Keywords" size="20" maxlength="25" /></td> @@ -551,7 +551,7 @@ if (isset($result_SuppSelect)) { - echo '<br /><table cellpadding="3" colspan="7" class="selection">'; + echo '<br /><table cellpadding="3" class="selection">'; $tableheader = '<tr> <th>' . _('Code') . '</th> @@ -721,7 +721,7 @@ $_POST['PaymentTerms']=$_SESSION['PO'.$identifier]->PaymentTerms; } - echo '<br /><table colspan="1" width="80%"> + echo '<br /><table width="80%"> <tr> <th><font color="blue" size="4"><b>' . _('Order Initiation Details') . '</b></font></th> <th><font color="blue" size="4"><b>' . _('Order Status') . '</b></font></th> Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/PO_Items.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -921,7 +921,7 @@ echo ' ' . _('Purchase Order') .' '. $_SESSION['PO'.$identifier]->OrderNo ; } echo '<br /><b>'._(' Order Summary') . '</b></p>'; - echo '<table cellpadding="2" colspan="7" class="selection">'; + echo '<table cellpadding="2" class="selection">'; echo '<tr> <th>' . _('Item Code') . '</th> <th>' . _('Description') . '</th> @@ -1081,7 +1081,7 @@ if (isset($SearchResult)) { - echo '<table cellpadding="1" colspan="7" class="selection">'; + echo '<table cellpadding="1" class="selection">'; $TableHeader = '<tr> <th>' . _('Code') . '</th> Modified: trunk/PO_OrderDetails.php =================================================================== --- trunk/PO_OrderDetails.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/PO_OrderDetails.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -146,7 +146,7 @@ $LineItemsResult = DB_query($LineItemsSQL,$db, $ErrMsg); -echo '<table colspan="8" class="selection" cellpadding="0">'; +echo '<table class="selection" cellpadding="0">'; echo '<tr><th colspan="8"><font size="3" color="#616161">'. _('Order Line Details'). '</font></th></tr>'; echo '<tr> <th>' . _('Item Code'). '</td> @@ -176,10 +176,10 @@ echo '<tr class="OsRow">'; } else { if ($k==1){ - echo '<tr bgcolor="#CCCCCC">'; + echo '<tr class="EvenTableRows">'; $k=0; } else { - echo '<tr bgcolor="#EEEEEE">'; + echo '<tr class="OddTableRows">'; $k=1; } } Modified: trunk/PO_SelectOSPurchOrder.php =================================================================== --- trunk/PO_SelectOSPurchOrder.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/PO_SelectOSPurchOrder.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -212,7 +212,7 @@ if (isset($StockItemsResult)) { - echo '<table cellpadding="2" colspan="7" class="selection">'; + echo '<table cellpadding="2" class="selection">'; $TableHeader = '<tr><th>' . _('Code') . '</th> <th>' . _('Description') . '</th> <th>' . _('On Hand') . '</th> @@ -437,7 +437,7 @@ /*show a table of the orders returned by the SQL */ - echo '<table cellpadding="2" colspan="7" width="97%" class="selection">'; + echo '<table cellpadding="2" width="97%" class="selection">'; // '</td><td class="tableheader">' . _('Receive') . Modified: trunk/PO_SelectPurchOrder.php =================================================================== --- trunk/PO_SelectPurchOrder.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/PO_SelectPurchOrder.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -179,7 +179,7 @@ echo '<input type="submit" name="ResetPart" value="' . _('Show All') . '" /></div></td></tr>'; echo '</table><br /><br />'; if (isset($StockItemsResult)) { - echo '<table cellpadding="2" colspan="7" class="selection">'; + echo '<table cellpadding="2" class="selection">'; $TableHeader = '<tr><td class="tableheader">' . _('Code') . '</td> <td class="tableheader">' . _('Description') . '</td> <td class="tableheader">' . _('On Hand') . '</td> @@ -191,10 +191,10 @@ $k = 0; //row colour counter while ($myrow = DB_fetch_array($StockItemsResult)) { if ($k == 1) { - echo '<tr bgcolor="#CCCCCC">'; + echo '<tr class="EvenTableRows">'; $k = 0; } else { - echo '<tr bgcolor="#EEEEEE">'; + echo '<tr class="OddTableRows">'; $k = 1; } echo '<td><input type="submit" name="SelectedStockItem" value="' . $myrow['stockid'] . '" /></td> @@ -366,7 +366,7 @@ if (DB_num_rows($PurchOrdersResult) > 0) { /*show a table of the orders returned by the SQL */ - echo '<table cellpadding="2" colspan="7" width="90%" class="selection">'; + echo '<table cellpadding="2" width="90%" class="selection">'; $TableHeader = '<tr><th>' . _('View') . '</th> <th>' . _('Supplier') . '</th> <th>' . _('Currency') . '</th> @@ -381,10 +381,10 @@ $k = 0; //row colour counter while ($myrow = DB_fetch_array($PurchOrdersResult)) { if ($k == 1) { /*alternate bgcolour of row for highlighting */ - echo '<tr bgcolor="#CCCCCC">'; + echo '<tr class="EvenTableRows">'; $k = 0; } else { - echo '<tr bgcolor="#EEEEEE">'; + echo '<tr class="OddTableRows">'; $k++; } $ViewPurchOrder = $rootpath . '/PO_OrderDetails.php?OrderNo=' . $myrow['orderno']; Modified: trunk/PaymentAllocations.php =================================================================== --- trunk/PaymentAllocations.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/PaymentAllocations.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -70,7 +70,7 @@ exit; } -echo '<table cellpadding="2" colspan="7" width="80%" class="selection">'; +echo '<table cellpadding="2" width="80%" class="selection">'; $TableHeader = '<tr> <th>' . _('Supplier Number') . '<br />' . _('Reference') . '</th> <th>' . _('Payment') .'<br />' . _('Reference') . '</th> Modified: trunk/PeriodsInquiry.php =================================================================== --- trunk/PeriodsInquiry.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/PeriodsInquiry.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -31,7 +31,7 @@ echo '<table><tr>'; for ($i=0;$i<2;$i++) { echo '<td>'; - echo '<table cellpadding="2" colspan="2" class="selection">'; + echo '<table cellpadding="2" class="selection">'; echo $TableHeader; $k=0; for ($j=0; $j<$PeriodsInTable;$j++) { @@ -52,7 +52,7 @@ echo '</td>'; } echo '<td>'; -echo '<table cellpadding="2" colspan="2" class="selection">'; +echo '<table cellpadding="2" class="selection">'; echo $TableHeader; $k = 0; //row colour counter while ($myrow=DB_fetch_array($PeriodsResult)) { Modified: trunk/PurchData.php =================================================================== --- trunk/PurchData.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/PurchData.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -261,7 +261,7 @@ } if (!isset($_POST['SearchSupplier'])) { echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post"> - <table cellpadding="3" colspan="4" class="selection"><tr>'; + <table cellpadding="3" class="selection"><tr>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<input type="hidden" name="StockID" value="' . $StockID . '" />'; echo '<td>' . _('Text in the Supplier') . ' <b>' . _('NAME') . '</b>:</font></td>'; @@ -343,7 +343,7 @@ $StockUOM = 'each'; } echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post"> - <table cellpadding="2" colspan="7" class="selection">'; + <table cellpadding="2" class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; $TableHeader = '<tr><th>' . _('Code') . '</th> <th>' . _('Supplier Name') . '</th> Modified: trunk/RecurringSalesOrders.php =================================================================== --- trunk/RecurringSalesOrders.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/RecurringSalesOrders.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -312,7 +312,7 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<table cellpadding="2" colspan="7" class="selection">'; +echo '<table cellpadding="2" class="selection">'; echo '<tr><th colspan="7"><font size="2" color="#616161"><b>'._('Order Line Details').'</b></font></th></tr>'; echo '<tr> <th>'. _('Item Code') .'</th> Modified: trunk/ReverseGRN.php =================================================================== --- trunk/ReverseGRN.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/ReverseGRN.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -378,7 +378,7 @@ prnMsg(_('There are no outstanding goods received yet to be invoiced for') . ' ' . $_POST['SuppName'] . '.<br />' . _('To reverse a GRN that has been invoiced first it must be credited'),'warn'); } else { //there are GRNs to show - echo '<br /><table cellpadding="2" colspan="7" class="selection">'; + echo '<br /><table cellpadding="2" class="selection">'; $TableHeader = '<tr> <th>' . _('GRN') . ' #</th> <th>' . _('Item Code') . '</th> Modified: trunk/SalesAnalRepts.php =================================================================== --- trunk/SalesAnalRepts.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/SalesAnalRepts.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -383,12 +383,12 @@ echo '<input type="hidden" name="SelectedReport" value="'.$SelectedReport.'" />'; echo '<input type="hidden" name="ReportID" value="'.$ReportID.'" />'; - echo '<table width="98%" colspan="4" class="selection"> + echo '<table width="98%" class="selection"> <tr> <th colspan="8"><font size="3 color="blue">' . _('Edit The Selected Report') . '</font></th> </tr>'; } else { - echo '<table width="98%" colspan="4" class="selection"> + echo '<table width="98%" class="selection"> <tr> <th colspan="8"><font size="3" color="blue">' . _('Define A New Report') . '</font></th> </tr>'; Modified: trunk/SelectAsset.php =================================================================== --- trunk/SelectAsset.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/SelectAsset.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -236,7 +236,7 @@ echo '<br /></div>'; } - echo '<table cellpadding="2" colspan="7" class="selection">'; + echo '<table cellpadding="2" class="selection">'; $tableheader = '<tr> <th>' . _('Asset Code') . '</th> <th>' . _('Description') . '</th> Modified: trunk/SelectCompletedOrder.php =================================================================== --- trunk/SelectCompletedOrder.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/SelectCompletedOrder.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -480,7 +480,7 @@ if (isset($StockItemsResult)) { - echo '<br /><table cellpadding="2" colspan="7" class="selection">'; + echo '<br /><table cellpadding="2" class="selection">'; $TableHeadings = '<tr><th>' . _('Code') . '</th>' . '<th>' . _('Description') . '</th>' . @@ -530,7 +530,7 @@ /*show a table of the orders returned by the SQL */ - echo '<br /><table cellpadding="2" colspan="6" width="90%" class="selection">'; + echo '<br /><table cellpadding="2" width="90%" class="selection">'; $tableheader = '<tr><th>' . _('Order') . ' #</th> <th>' . _('Customer') . '</th> Modified: trunk/SelectContract.php =================================================================== --- trunk/SelectContract.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/SelectContract.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -143,7 +143,7 @@ /*show a table of the contracts returned by the SQL */ -echo '<table cellpadding="2" colspan="7" width="98%" class="selection">'; +echo '<table cellpadding="2" width="98%" class="selection">'; $TableHeader = '<tr> <th>' . _('Modify') . '</th> Modified: trunk/SelectCreditItems.php =================================================================== --- trunk/SelectCreditItems.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/SelectCreditItems.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -89,7 +89,7 @@ echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?identifier='.$identifier.'" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Search for Customers').'</p>'; - echo '<table cellpadding="3" colspan="4" class="selection">'; + echo '<table cellpadding="3" class="selection">'; echo '<tr><td colspan="2">' . _('Enter a partial Name') . ':</td><td>'; if (isset($_POST['Keywords'])) { echo '<input type="text" name="Keywords" value="' . $_POST['Keywords'] . '" size="20" maxlength="25" />'; @@ -392,7 +392,7 @@ <input type="submit" name="Next" value="' . _('Next') . '" />'; echo '</div>'; } - echo '<br /><table cellpadding="2" colspan="7" class="selection">'; + echo '<br /><table cellpadding="2" class="selection">'; $TableHeader = '<tr> <th>' . _('Code') . '</th> <th>' . _('Customer Name') . '</th> @@ -942,7 +942,7 @@ } /* This is where the credit note as selected should be displayed reflecting any deletions or insertions*/ - echo '<font color="red"><table cellpadding="2" colspan="7" class="selection"> + echo '<font color="red"><table cellpadding="2" class="selection"> <tr> <th>' . _('Item Code') . '</th> <th>' . _('Item Description') . '</th> Modified: trunk/SelectCustomer.php =================================================================== --- trunk/SelectCustomer.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/SelectCustomer.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -250,7 +250,7 @@ prnMsg($msg, 'info'); } echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Search for Customers').'</p>'; -echo '<table cellpadding="3" colspan="4" class="selection">'; +echo '<table cellpadding="3" class="selection">'; echo '<tr><td colspan="2">' . _('Enter a partial Name') . ':</td><td>'; if (isset($_POST['Keywords'])) { echo '<input type="text" name="Keywords" value="' . $_POST['Keywords'] . '" size="20" maxlength="25" />'; @@ -383,7 +383,7 @@ <input type="submit" name="Next" value="' . _('Next') . '" />'; echo '</div>'; } - echo '<br /><table cellpadding="2" colspan="7" class="selection">'; + echo '<br /><table cellpadding="2" class="selection">'; $TableHeader = '<tr> <th>' . _('Code') . '</th> <th>' . _('Customer Name') . '</th> @@ -469,7 +469,7 @@ echo '<div class="centre">' . _('Mapping is enabled, but no Mapping data to display for this Customer.') . '</div>'; } else { echo '<tr><td colspan="2">'; - echo '<table width="45%" colspan="2" cellpadding="4">'; + echo '<table width="45%" cellpadding="4">'; echo '<tr><th width="33%">' . _('Customer Mapping') . '</th></tr>'; echo '</td><td valign="top">'; /* Mapping */ echo '<div class="centre">' . _('Mapping is enabled, Map will display below.') . '</div>'; @@ -505,7 +505,7 @@ $Total1Result = DB_query($SQL, $db); $row = DB_fetch_array($Total1Result); echo '<tr><td colspan="2">'; - echo '<table width="45%" colspan="2" cellpadding="4" class="selection">'; + echo '<table width="45%" cellpadding="4" class="selection">'; echo '<tr><th width="33%" colspan="3">' . _('Customer Data') . '</th></tr>'; echo '<tr><td valign="top" class="select">'; /* Customer Data */ //echo _('Distance to this customer:') . '<b>TBA</b><br />'; Modified: trunk/SelectGLAccount.php =================================================================== --- trunk/SelectGLAccount.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/SelectGLAccount.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -83,7 +83,7 @@ prnMsg($msg,'info'); } - echo '<table cellpadding="3" colspan="4" class="selection"> + echo '<table cellpadding="3" class="selection"> <tr> <td><font size="1">' . _('Enter extract of text in the Account name') .':</font></td> <td><input type="text" name="Keywords" size="20" maxlength="25" /></td> @@ -98,7 +98,7 @@ if (isset($result) and DB_num_rows($result)>0) { - echo '<br /><table cellpadding="2" colspan="7" class="selection">'; + echo '<br /><table cellpadding="2" class="selection">'; $TableHeader = '<tr><th>' . _('Code') . '</th> <th>' . _('Account Name') . '</th> Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/SelectOrderItems.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -1341,7 +1341,7 @@ /* This is where the order as selected should be displayed reflecting any deletions or insertions*/ echo '<br /> - <table width="90%" cellpadding="2" colspan="7" class="selection"> + <table width="90%" cellpadding="2" class="selection"> <tr bgcolor="#800000">'; if($_SESSION['Items'.$identifier]->DefaultPOLine == 1){ echo '<th>' . _('PO Line') . '</th>'; Modified: trunk/SelectProduct.php =================================================================== --- trunk/SelectProduct.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/SelectProduct.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -474,7 +474,7 @@ echo '</td></tr></table>'; } else { // options (links) to pages. This requires stock id also to be passed. - echo '<table width="90%" colspan="2" cellpadding="4">'; + echo '<table width="90%" cellpadding="4">'; echo '<tr> <th width="33%">' . _('Item Inquiries') . '</th> <th width="33%">' . _('Item Transactions') . '</th> @@ -726,7 +726,7 @@ // echo '<input type="hidden" name=Search value="Search" />'; echo '<br /></div>'; } - echo '<table cellpadding="2" colspan="7">'; + echo '<table cellpadding="2">'; $tableheader = '<tr> <th>' . _('Code') . '</th> <th>' . _('Description') . '</th> Modified: trunk/SelectRecurringSalesOrder.php =================================================================== --- trunk/SelectRecurringSalesOrder.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/SelectRecurringSalesOrder.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -71,7 +71,7 @@ /*show a table of the orders returned by the SQL */ - echo '<br /><table cellpadding="2" colspan="7" width="90%" class="selection">'; + echo '<br /><table cellpadding="2" width="90%" class="selection">'; $tableheader = '<tr> <th>' . _('Modify') . '</th> Modified: trunk/SelectSalesOrder.php =================================================================== --- trunk/SelectSalesOrder.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/SelectSalesOrder.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -570,7 +570,7 @@ if (isset($StockItemsResult) and DB_num_rows($StockItemsResult)>0) { - echo '<table cellpadding="2" colspan="7" class="selection">'; + echo '<table cellpadding="2" class="selection">'; $TableHeader = '<tr> <th>' . _('Code') . '</th> <th>' . _('Description') . '</th> @@ -816,7 +816,7 @@ $AuthResult=DB_query($AuthSQL,$db); $AuthRow=DB_fetch_array($AuthResult); - echo '<table cellpadding="2" colspan="7" width="95%" class="selection">'; + echo '<table cellpadding="2" width="95%" class="selection">'; if (isset($_POST['Quotations']) AND $_POST['Quotations']=='Orders_Only'){ $tableheader = '<tr> Modified: trunk/SelectSupplier.php =================================================================== --- trunk/SelectSupplier.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/SelectSupplier.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -145,7 +145,7 @@ echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Supplier') . '" alt="" />' . ' ' . _('Supplier') . ' : <b>' . stripslashes($_SESSION['SupplierID']) . ' - ' . $SupplierName . '</b> ' . _('has been selected') . '.</p>'; echo '<div class="page_help_text">' . _('Select a menu option to operate using this supplier.') . '</div>'; - echo '<br /><table width=90% colspan="2" cellpadding="4">'; + echo '<br /><table width=90% cellpadding="4">'; echo '<tr> <th width="33%">' . _('Supplier Inquiries') . '</th> <th width="33%">' . _('Supplier Transactions') . '</th> @@ -178,7 +178,7 @@ } else { // Supplier is not selected yet echo '<br />'; - echo '<table width="90%" colspan="2" cellpadding="4">'; + echo '<table width="90%" cellpadding="4">'; echo '<tr> <th width="33%">' . _('Supplier Inquiries') . '</th> <th width="33%">' . _('Supplier Transactions') . '</th> @@ -193,7 +193,7 @@ echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Search for Suppliers') . '</p> - <table cellpadding="3" colspan="4" class="selection"><tr><td>' . _('Enter a partial Name') . ':</font></td><td>'; + <table cellpadding="3" class="selection"><tr><td>' . _('Enter a partial Name') . ':</font></td><td>'; if (isset($_POST['Keywords'])) { echo '<input type="text" name="Keywords" value="' . $_POST['Keywords'] . '" size="20" maxlength="25" />'; } else { @@ -240,7 +240,7 @@ } echo '<input type="hidden" name="Search" value="' . _('Search Now') . '" />'; echo '<br /><br />'; - echo '<br /><table cellpadding="2" colspan="7">'; + echo '<br /><table cellpadding="2">'; $tableheader = '<tr> <th>' . _('Code') . '</th> <th>' . _('Supplier Name') . '</th> @@ -308,7 +308,7 @@ } else { echo '<div class="centre"><br />'; echo '<tr><td colspan="2">'; - echo '<table width="45%" colspan="2" border="2" cellpadding="4">'; + echo '<table width="45%" border="2" cellpadding="4">'; echo '<tr><th width="33%">' . _('Supplier Mapping') . '</th></tr>'; echo '</td><td valign="top">'; /* Mapping */ echo '<div class="centre">' . _('Mapping is enabled, Map will display below.') . '</div>'; @@ -335,7 +335,7 @@ $row = DB_fetch_array($Total1Result); echo '<br />'; echo '<tr><td colspan="2">'; - echo '<table width="45%" colspan="2" cellpadding="4">'; + echo '<table width="45%" cellpadding="4">'; echo '<tr><th width="33%" colspan="2">' . _('Supplier Data') . '</th></tr>'; echo '<tr><td valign="top" class="select">'; /* Supplier Data */ //echo "Distance to this Supplier: <b>TBA</b><br />"; Modified: trunk/SelectWorkOrder.php =================================================================== --- trunk/SelectWorkOrder.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/SelectWorkOrder.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -182,7 +182,7 @@ if (isset($StockItemsResult)) { - echo '<br /><table cellpadding="2" colspan="7" class="selection">'; + echo '<br /><table cellpadding="2" class="selection">'; $TableHeader = '<tr> <th>' . _('Code') . '</th> <th>' . _('Description') . '</th> @@ -293,7 +293,7 @@ /*show a table of the orders returned by the SQL */ if (DB_num_rows($WorkOrdersResult)>0) { - echo '<br /><table cellpadding="2" colspan="7" width="95%" class="selection">'; + echo '<br /><table cellpadding="2" width="95%" class="selection">'; $tableheader = '<tr> Modified: trunk/ShipmentCosting.php =================================================================== --- trunk/ShipmentCosting.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/ShipmentCosting.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -136,7 +136,7 @@ $PeriodNo = GetPeriod(Date($_SESSION['DefaultDateFormat']), $db); } - echo '<br /><table cellpadding="2" colspan="7" class="selection">'; + echo '<br /><table cellpadding="2" class="selection">'; echo '<tr><th colspan="9"><font color="#616161" size="3">' . _('Items on shipment'). '</font></th></tr>'; $TableHeader = '<tr> @@ -472,7 +472,7 @@ echo '</table>'; -echo '<br /><table colspan="2" width="95%"><tr><td valign="top">'; // put this shipment charges side by side in a table (major table 2 cols) +echo '<br /><table width="95%"><tr><td valign="top">'; // put this shipment charges side by side in a table (major table 2 cols) $sql = "SELECT suppliers.suppname, supptrans.suppreference, @@ -498,7 +498,7 @@ $ChargesResult = DB_query($sql,$db); -echo '<table cellpadding="2" colspan="6" class="selection">'; +echo '<table cellpadding="2" class="selection">'; echo '<tr><th colspan="6"><font color="#616161" size="3">' . _('Shipment Charges Against Products'). '</font></th></tr>'; $TableHeader = '<tr> @@ -569,7 +569,7 @@ $ChargesResult = DB_query($sql,$db); -echo '<table cellpadding="2" colspan="5" class="selection">'; +echo '<table cellpadding="2" class="selection">'; echo '<tr><th colspan="6"><font color="#616161" size="3">'._('General Shipment Charges').'</font></th></tr>'; $TableHeader = '<tr> Modified: trunk/Shipments.php =================================================================== --- trunk/Shipments.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/Shipments.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -375,7 +375,7 @@ if (count($_SESSION['Shipment']->LineItems)>0){ /* Always display all shipment lines */ - echo '<br /><table cellpadding="2" colspan="7" class="selection">'; + echo '<br /><table cellpadding="2" class="selection">'; echo '<tr><th colspan="9"><font color="#616161" size="3">'. _('Order Lines On This Shipment'). '</font></th></tr>'; $TableHeader = '<tr> @@ -455,7 +455,7 @@ if (DB_num_rows($result)>0){ - echo '<table cellpadding="2" colspan="7" class="selection">'; + echo '<table cellpadding="2" class="selection">'; echo '<tr><th colspan="7"><font color="#616161" size="3">'. _('Possible Order Lines To Add To This Shipment').'</font></th></tr>'; $TableHeader = '<tr> Modified: trunk/Shipt_Select.php =================================================================== --- trunk/Shipt_Select.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/Shipt_Select.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -175,7 +175,7 @@ if (isset($StockItemsResult)) { - echo '<table cellpadding="2" colspan="7" class="selection">'; + echo '<table cellpadding="2" class="selection">'; $TableHeader = '<tr> <th>'. _('Code').'</th> <th>'. _('Description').'</th> @@ -276,7 +276,7 @@ if (DB_num_rows($ShipmentsResult)>0){ /*show a table of the shipments returned by the SQL */ - echo '<table cellpadding="2" colspan="7" width="95%" class="selection">'; + echo '<table cellpadding="2" width="95%" class="selection">'; $TableHeader = '<tr> <th>'. _('Shipment'). '</th> <th>'. _('Supplier'). '</th> Modified: trunk/ShiptsList.php =================================================================== --- trunk/ShiptsList.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/ShiptsList.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -30,7 +30,7 @@ } /*show a table of the shipments returned by the SQL */ -echo '<table cellpadding="2" colspan="2" class="selection">'; +echo '<table cellpadding="2" class="selection">'; echo '<tr> <th>'. _('Reference'). '</a></th> <th>'. _('Vessel'). '</th> Modified: trunk/SpecialOrder.php =================================================================== --- trunk/SpecialOrder.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/SpecialOrder.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -614,7 +614,7 @@ if (count($_SESSION['SPL'.$identifier]->LineItems)>0){ echo '<div class="centre"><b>' . _('Special Order Summary') . '</b></div>'; - echo '<table class="selection" cellpadding="2" colspan="7" border="1">'; + echo '<table class="selection" cellpadding="2" border="1">'; echo '<tr> <th>' . _('Item Description') . '</th> Modified: trunk/SuppCreditGRNs.php =================================================================== --- trunk/SuppCreditGRNs.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/SuppCreditGRNs.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -148,7 +148,7 @@ echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<br /><table cellpadding="2" colspan="7" class="selection">'; +echo '<br /><table cellpadding="2" class="selection">'; echo '<tr><th colspan="10"><font size="3" color="#616161">' . _('Show Goods Received Since') . ': </font>'; echo '<input type="text" name="Show_Since" maxlength="11" size="12" class="date" alt='.$_SESSION['DefaultDateFormat'].' value="' . $_POST['Show_Since'] . '" /> Modified: trunk/SuppInvGRNs.php =================================================================== --- trunk/SuppInvGRNs.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/SuppInvGRNs.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -278,7 +278,7 @@ echo '<input type="hidden" name="DecimalPlaces" value="' . $GRNTmp->DecimalPlaces . '" />'; } else { if (count( $_SESSION['SuppTransTmp']->GRNs)>0){ /*if there are any outstanding GRNs then */ - echo '<table cellpadding="1" colspan="7" class="selection">'; + echo '<table cellpadding="1" class="selection">'; echo '<tr><th colspan="10"><font size="3" color="#616161">' . _('Goods Received Yet to be Invoiced From') . ' ' . $_SESSION['SuppTrans']->SupplierName.'</font></th></tr>'; $tableheader = '<tr bgcolor=#800000><th>' . _('Select') . '</th> Modified: trunk/SupplierAllocations.php =================================================================== --- trunk/SupplierAllocations.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/SupplierAllocations.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -460,7 +460,7 @@ /*Now display the potential and existing allocations put into the array above */ - echo '<table cellpadding="2" colspan="7" class="selection">'; + echo '<table cellpadding="2" class="selection">'; $TableHeader = '<tr><th>' . _('Type') . '</th> <th>' . _('Trans') . '<br />' . _('Number') . '</th> <th>' . _('Trans') .'<br />' . _('Date') . '</th> Modified: trunk/SupplierCredit.php =================================================================== --- trunk/SupplierCredit.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/SupplierCredit.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -262,7 +262,7 @@ /* everything below here only do if a Supplier is selected fisrt add a header to show who we are making an credit note for */ -echo '<table class="selection" colspan="4"> +echo '<table class="selection"> <tr><th>' . _('Supplier') . '</th> <th>' . _('Currency') . '</th> <th>' . _('Terms') . '</th> Modified: trunk/SupplierInquiry.php =================================================================== --- trunk/SupplierInquiry.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/SupplierInquiry.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -199,7 +199,7 @@ /*show a table of the transactions returned by the SQL */ -echo '<table width="90%" cellpadding="2" colspan="7" class="selection">'; +echo '<table width="90%" cellpadding="2" class="selection">'; $TableHeader = '<tr> <th>' . _('Trans') . ' #' . '</th> <th>' . _('Type') . '</th> Modified: trunk/SupplierInvoice.php =================================================================== --- trunk/SupplierInvoice.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/SupplierInvoice.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -224,7 +224,7 @@ /* everything below here only do if a Supplier is selected fisrt add a header to show who we are making an invoice for */ - echo '<br /><table class="selection" colspan="4"> + echo '<br /><table class="selection"> <tr> <th>' . _('Supplier') . '</th> <th>' . _('Currency') . '</th> Modified: trunk/SupplierTenderCreate.php =================================================================== --- trunk/SupplierTenderCreate.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/SupplierTenderCreate.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -484,7 +484,7 @@ echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'].'?identifier='.$identifier) . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Search for Suppliers') . '</p> - <table cellpadding="3" colspan="4" class="selection"><tr><td>' . _('Enter a partial Name') . ':</td><td>'; + <table cellpadding="3" class="selection"><tr><td>' . _('Enter a partial Name') . ':</td><td>'; if (isset($_POST['Keywords'])) { echo '<input type="text" name="Keywords" value="' . $_POST['Keywords'] . '" size="20" maxlength="25" />'; } else { @@ -535,7 +535,7 @@ } echo '<input type="hidden" name="Search" value="' . _('Search Now') . '" />'; echo '<br /><br />'; - echo '<br /><table cellpadding="2" colspan="7">'; + echo '<br /><table cellpadding="2">'; $tableheader = '<tr> <th>' . _('Code') . '</th> <th>' . _('Supplier Name') . '</th> @@ -744,7 +744,7 @@ if (isset($SearchResult)) { - echo '<table cellpadding="1" colspan="7">'; + echo '<table cellpadding="1">'; $tableheader = '<tr> <th>' . _('Code') . '</th> Modified: trunk/SupplierTenders.php =================================================================== --- trunk/SupplierTenders.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/SupplierTenders.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -625,7 +625,7 @@ if (isset($SearchResult)) { - echo '<table cellpadding="1" colspan="7">'; + echo '<table cellpadding="1">'; $tableheader = '<tr> <th>' . _('Code') . '</th> Modified: trunk/TopItems.php =================================================================== --- trunk/TopItems.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/TopItems.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -18,7 +18,7 @@ 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="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" name="SelectCustomer" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table cellpadding="3" colspan="4" class="selection">'; + echo '<table cellpadding="3" class="selection">'; //to view store location echo '<tr><td width="150">' . _('Select Location') . ' </td><td>:</td><td><select name="Location">'; $sql = "SELECT loccode, Modified: trunk/WorkOrderEntry.php =================================================================== --- trunk/WorkOrderEntry.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/WorkOrderEntry.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -603,7 +603,7 @@ if (DB_num_rows($SearchResult)>1){ - echo '<table cellpadding="2" colspan="7" class="selection">'; + echo '<table cellpadding="2" class="selection">'; $TableHeader = '<tr><th>' . _('Code') . '</th> <th>' . _('Description') . '</th> <th>' . _('Units') . '</th></tr>'; Modified: trunk/WorkOrderIssue.php =================================================================== --- trunk/WorkOrderIssue.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/WorkOrderIssue.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -667,7 +667,7 @@ if (DB_num_rows($SearchResult)>1){ - echo '<br /><table cellpadding="2" colspan="7" class="selection">'; + echo '<br /><table cellpadding="2" class="selection">'; $TableHeader = '<tr><th>' . _('Code') . '</th> <th>' . _('Description') . '</th> <th>' . _('Units') . '</th></tr>'; Modified: trunk/includes/InputSerialItemsFile.php =================================================================== --- trunk/includes/InputSerialItemsFile.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/includes/InputSerialItemsFile.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -34,10 +34,10 @@ //only show 1st 10 lines if ($RowCounter < 10){ if ($k==1){ - echo '<tr bgcolor="#CCCCCC">'; + echo '<tr class="EvenTableRows">'; $k=0; } else { - echo '<tr bgcolor="#EEEEEE">'; + echo '<tr class="OddTableRows">'; $k=1; } Modified: trunk/includes/InputSerialItemsKeyed.php =================================================================== --- trunk/includes/InputSerialItemsKeyed.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/includes/InputSerialItemsKeyed.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -38,10 +38,10 @@ } if ($k==1){ - echo '<tr bgcolor="#CCCCCC">'; + echo '<tr class="EvenTableRows">'; $k=0; } else { - echo '<tr bgcolor="#EEEEEE">'; + echo '<tr class="OddTableRows">'; $k=1; } Modified: trunk/includes/OutputSerialItems.php =================================================================== --- trunk/includes/OutputSerialItems.php 2012-02-10 21:25:23 UTC (rev 8497) +++ trunk/includes/OutputSerialItems.php 2012-02-11 17:18:40 UTC (rev 8498) @@ -79,10 +79,10 @@ } if ($k==1){ - echo '<tr bgcolor="#CCCCCC">'; + echo '<tr class="EvenTableRows">'; $k=0; } else { - echo '<tr bgcolor="#EEEEEE">'; + echo '<tr class="OddTableRows">'; $k=1; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-02-15 16:40:28
|
Revision: 8509 http://weberp.svn.sourceforge.net/weberp/?rev=8509&view=rev Author: tim_schofield Date: 2012-02-15 16:40:17 +0000 (Wed, 15 Feb 2012) Log Message: ----------- New script for creating a copy of a BOM Modified Paths: -------------- trunk/includes/IndexArray.php trunk/includes/session.inc Added Paths: ----------- trunk/sql/mysql/updates/107.php Modified: trunk/includes/IndexArray.php =================================================================== --- trunk/includes/IndexArray.php 2012-02-15 16:40:04 UTC (rev 8508) +++ trunk/includes/IndexArray.php 2012-02-15 16:40:17 UTC (rev 8509) @@ -175,11 +175,13 @@ ); $MenuItems['PO']['Reports']['Caption'] = array (_('Purchase Order Inquiry'), - _('Purchase Order Detail Or Summary Inquiries') + _('Purchase Order Detail Or Summary Inquiries'), + _('Supplier Price List') ); $MenuItems['PO']['Reports']['URL'] = array ('/PO_SelectPurchOrder.php', - '/POReport.php' + '/POReport.php', + '/SuppPriceList.php' ); $MenuItems['PO']['Maintenance']['Caption'] = array ( @@ -279,8 +281,10 @@ '/SelectWorkOrder.php' ); -$MenuItems['manuf']['Reports']['Caption'] = array (_('Costed Bill Of Material Inquiry'), +$MenuItems['manuf']['Reports']['Caption'] = array (_('Select A Work Order'), + _('Costed Bill Of Material Inquiry'), _('Where Used Inquiry'), + _('Bill Of Material Listing'), _('Indented Bill Of Material Listing'), _('List Components Required'), _('Indented Where Used Listing'), @@ -291,8 +295,10 @@ _('MRP Reschedules Required') ); -$MenuItems['manuf']['Reports']['URL'] = array ('/BOMInquiry.php', +$MenuItems['manuf']['Reports']['URL'] = array ('/WorkOrderEntry.php', + '/BOMInquiry.php', '/WhereUsedInquiry.php', + '/BOMListing.php', '/BOMIndented.php', '/BOMExtendedQty.php', '/BOMIndentedReverse.php', Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2012-02-15 16:40:04 UTC (rev 8508) +++ trunk/includes/session.inc 2012-02-15 16:40:17 UTC (rev 8509) @@ -13,7 +13,7 @@ header('Location:' . $rootpath . '/install/index.php'); } include($PathPrefix . 'config.php'); -$DBVersion=106; +$DBVersion=107; if (isset($SessionSavePath)){ session_save_path($SessionSavePath); } @@ -292,7 +292,6 @@ } } - if (in_array(15, $_SESSION['AllowedPageSecurityTokens'])) { /*System administrator login */ $debug = 1; //allow debug messages } else { Added: trunk/sql/mysql/updates/107.php =================================================================== --- trunk/sql/mysql/updates/107.php (rev 0) +++ trunk/sql/mysql/updates/107.php 2012-02-15 16:40:17 UTC (rev 8509) @@ -0,0 +1,10 @@ +<?php + +/* Include the new script for printing quotations in Portrait + */ + +AddColumn('email', 'custcontacts', 'varchar(55)', 'not null', '', 'notes', $db); + +UpdateDBNo(107, $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...> - 2012-02-15 16:43:24
|
Revision: 8516 http://weberp.svn.sourceforge.net/weberp/?rev=8516&view=rev Author: tim_schofield Date: 2012-02-15 16:43:12 +0000 (Wed, 15 Feb 2012) Log Message: ----------- Change to using DB_fetch_array() function Modified Paths: -------------- trunk/SalesAnalReptCols.php trunk/SalesCategories.php trunk/SalesGLPostings.php trunk/SalesGraph.php trunk/SalesPeople.php trunk/SalesTypes.php trunk/SelectCompletedOrder.php trunk/SelectCreditItems.php trunk/SelectGLAccount.php trunk/SelectOrderItems.php trunk/SelectProduct.php trunk/SelectSupplier.php trunk/ShipmentCosting.php trunk/Shipments.php trunk/Shippers.php trunk/SpecialOrder.php trunk/StockAdjustments.php trunk/StockCategories.php trunk/StockCheck.php trunk/StockDispatch.php trunk/StockLocStatus.php trunk/StockLocTransfer.php trunk/StockLocTransferReceive.php trunk/StockMovements.php trunk/StockQties_csv.php trunk/StockReorderLevel.php trunk/StockSerialItemResearch.php trunk/StockSerialItems.php trunk/StockStatus.php trunk/StockTransfers.php trunk/StockUsage.php trunk/StockUsageGraph.php trunk/Stocks.php trunk/SuppLoginSetup.php trunk/SuppPriceList.php trunk/SuppTransGLAnalysis.php trunk/SupplierCredit.php trunk/SupplierInvoice.php trunk/SupplierTenderCreate.php trunk/SupplierTenders.php trunk/SupplierTypes.php trunk/Suppliers.php trunk/SystemParameters.php trunk/Tax.php trunk/TaxAuthorities.php trunk/TaxAuthorityRates.php trunk/TaxCategories.php trunk/TaxGroups.php trunk/TaxProvinces.php trunk/TopItems.php trunk/UnitsOfMeasure.php trunk/WWW_Access.php trunk/WWW_Users.php trunk/WhereUsedInquiry.php trunk/WorkCentres.php trunk/WorkOrderCosting.php trunk/WorkOrderEntry.php trunk/WorkOrderIssue.php trunk/WorkOrderReceive.php trunk/WorkOrderStatus.php trunk/Z_ChangeStockCode.php trunk/Z_CheckDebtorsControl.php trunk/Z_CreateChartDetails.php trunk/Z_CreateCompany.php trunk/Z_DataExport.php trunk/Z_DeleteCreditNote.php trunk/Z_DeleteInvoice.php trunk/Z_DescribeTable.php trunk/Z_ImportFixedAssets.php trunk/Z_ImportStocks.php trunk/Z_ReApplyCostToSA.php trunk/Z_SalesIntegrityCheck.php trunk/Z_UpdateChartDetailsBFwd.php Modified: trunk/SalesAnalReptCols.php =================================================================== --- trunk/SalesAnalReptCols.php 2012-02-15 16:41:19 UTC (rev 8515) +++ trunk/SalesAnalReptCols.php 2012-02-15 16:43:12 UTC (rev 8516) @@ -413,11 +413,11 @@ $sql = "SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC"; $ErrMsg = _('Could not load periods table'); $result = DB_query($sql,$db,$ErrMsg); - while ($PeriodRow = DB_fetch_row($result)){ - if ($_POST['PeriodFrom']==$PeriodRow[0]){ - echo '<option selected="True" value="' . $PeriodRow[0] . '">' . ConvertSQLDate($PeriodRow[1]) . '</option>'; + while ($PeriodRow = DB_fetch_array($result)){ + if ($_POST['PeriodFrom']==$PeriodRow['periodno']){ + echo '<option selected="True" value="' . $PeriodRow['periodno'] . '">' . ConvertSQLDate($PeriodRow['lastdate_in_period']) . '</option>'; } else { - echo '<option value="' . $PeriodRow[0] . '">' . ConvertSQLDate($PeriodRow[1]) . '</option>'; + echo '<option value="' . $PeriodRow['periodno'] . '">' . ConvertSQLDate($PeriodRow['lastdate_in_period']) . '</option>'; } } echo '</select></td></tr>'; @@ -427,11 +427,11 @@ $sql = "SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC"; $ErrMsg = _('Could not load periods table'); $result = DB_query($sql,$db,$ErrMsg); - while ($PeriodRow = DB_fetch_row($result)){ - if ($_POST['PeriodTo']==$PeriodRow[0]){ - echo '<option selected="True" value="' . $PeriodRow[0] . '">' . ConvertSQLDate($PeriodRow[1]) . '</option>'; + while ($PeriodRow = DB_fetch_array($result)){ + if ($_POST['PeriodTo']==$PeriodRow['periodno']){ + echo '<option selected="True" value="' . $PeriodRow['periodno'] . '">' . ConvertSQLDate($PeriodRow['lastdate_in_period']) . '</option>'; } else { - echo '<option value="' . $PeriodRow[0] . '">' . ConvertSQLDate($PeriodRow[1]) . '</option>'; + echo '<option value="' . $PeriodRow['periodno'] . '">' . ConvertSQLDate($PeriodRow['lastdate_in_period']) . '</option>'; } } echo '</select></td></tr>'; Modified: trunk/SalesCategories.php =================================================================== --- trunk/SalesCategories.php 2012-02-15 16:41:19 UTC (rev 8515) +++ trunk/SalesCategories.php 2012-02-15 16:43:12 UTC (rev 8516) @@ -33,7 +33,7 @@ $EditName = ''; } -if (isset($SelectedCategory) AND isset($_FILES['ItemPicture']) AND $_FILES['ItemPicture']['name'] !='') { +if (isset($SelectedCategory) and isset($_FILES['ItemPicture']) and $_FILES['ItemPicture']['name'] !='') { $result = $_FILES['ItemPicture']['error']; $UploadTheFile = 'Yes'; //Assume all is well to start off with @@ -47,7 +47,7 @@ } elseif ( $_FILES['ItemPicture']['size'] > ($_SESSION['MaxImageSize']*1024)) { //File Size Check prnMsg(_('The file size is over the maximum allowed. The maximum size allowed in KB is') . ' ' . $_SESSION['MaxImageSize'],'warn'); $UploadTheFile ='No'; - } elseif ( $_FILES['ItemPicture']['type'] == "text/plain" ) { //File Type Check + } elseif ( $_FILES['ItemPicture']['type'] == 'text/plain' ) { //File Type Check prnMsg( _('Only graphics files can be uploaded'),'warn'); $UploadTheFile ='No'; } elseif (file_exists($filename)){ @@ -119,20 +119,20 @@ // PREVENT DELETES IF DEPENDENT RECORDS IN 'StockMaster' - $sql= "SELECT COUNT(*) FROM salescatprod WHERE salescatid='".$SelectedCategory . "'"; + $sql= "SELECT COUNT(salescatid) AS categories FROM salescatprod WHERE salescatid='".$SelectedCategory . "'"; $result = DB_query($sql,$db); - $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { + $myrow = DB_fetch_array($result); + if ($myrow['categories']>0) { prnMsg(_('Cannot delete this sales category because stock items have been added to this category') . - '<br /> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('items under to this category'),'warn'); + '<br /> ' . _('There are') . ' ' . $myrow['categories'] . ' ' . _('items under to this category'),'warn'); } else { - $sql = "SELECT COUNT(*) FROM salescat WHERE parentcatid='".$SelectedCategory."'"; + $sql = "SELECT COUNT(parentcatid) AS categories FROM salescat WHERE parentcatid='".$SelectedCategory."'"; $result = DB_query($sql,$db); - $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { + $myrow = DB_fetch_array($result); + if ($myrow['categories']>0) { prnMsg(_('Cannot delete this sales category because sub categories have been added to this category') . - '<br /> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('sub categories'),'warn'); + '<br /> ' . _('There are') . ' ' . $myrow['categories'] . ' ' . _('sub categories'),'warn'); } else { $sql="DELETE FROM salescat WHERE salescatid='".$SelectedCategory."'"; $result = DB_query($sql,$db); Modified: trunk/SalesGLPostings.php =================================================================== --- trunk/SalesGLPostings.php 2012-02-15 16:41:19 UTC (rev 8515) +++ trunk/SalesGLPostings.php 2012-02-15 16:43:12 UTC (rev 8516) @@ -37,14 +37,13 @@ /*Selected Sales GL Posting is null cos no item selected on first time round so must be adding a record must be submitting new entries in the new SalesGLPosting form */ /* Verify if item doesn't exists to insert it, otherwise just refreshes the page. */ - $sql = "SELECT count(*) FROM salesglpostings + $sql = "SELECT salestype FROM salesglpostings WHERE area='" . $_POST['Area'] . "' AND stkcat='" . $_POST['StkCat'] . "' AND salestype='" . $_POST['SalesType'] . "'"; $result = DB_query($sql,$db); - $myrow = DB_fetch_row($result); - if ($myrow[0] == 0) { + if (DB_num_rows($result) == 0) { $sql = "INSERT INTO salesglpostings ( salesglcode, discountglcode, @@ -116,7 +115,7 @@ </tr>'; $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; @@ -132,15 +131,15 @@ <td>%s</td> <td><a href="%sSelectedSalesPostingID=%s">' . _('Edit') . '</td> <td><a href="%sSelectedSalesPostingID=%s&delete=yes">'. _('Delete') . '</td></tr>', - $myrow[1], - $myrow[2], - $myrow[3], - $myrow[4], - $myrow[5], + $myrow['area'], + $myrow['stkcat'], + $myrow['salestype'], + $myrow['salesglcode'], + $myrow['discountglcode'], htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?', - $myrow[0], + $myrow['id'], htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?', - $myrow[0]); + $myrow['id']); } } @@ -209,8 +208,8 @@ salesglpostings.area, salesglpostings.stkcat, salesglpostings.salestype, - chart1.accountname, - chart2.accountname + chart1.accountname AS chart1name, + chart2.accountname AS chart2name FROM salesglpostings, chartmaster as chart1, chartmaster as chart2 @@ -229,7 +228,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; @@ -245,15 +244,15 @@ <td>%s</td> <td><a href="%sSelectedSalesPostingID=%s">' . _('Edit') . '</td> <td><a href="%sSelectedSalesPostingID=%s&delete=yes">'. _('Delete') . '</td></tr>', - $myrow[1], - $myrow[2], - $myrow[3], - $myrow[4], - $myrow[5], + $myrow['area'], + $myrow['stkcat'], + $myrow['salestype'], + $myrow['chart1name'], + $myrow['chart2name'], htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?', - $myrow[0], + $myrow['id'], htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?', - $myrow[0]); + $myrow['id']); } //END WHILE LIST LOOP echo '</table>'; Modified: trunk/SalesGraph.php =================================================================== --- trunk/SalesGraph.php 2012-02-15 16:41:19 UTC (rev 8515) +++ trunk/SalesGraph.php 2012-02-15 16:43:12 UTC (rev 8516) @@ -203,16 +203,16 @@ $GraphTitle .= ' ' . _('For All Sales Areas'); } else { $result = DB_query("SELECT areadescription FROM areas WHERE areacode='" . $_POST['SalesArea'] . "'",$db); - $myrow = DB_fetch_row($result); - $GraphTitle .= ' ' . _('For') . ' ' . $myrow[0]; + $myrow = DB_fetch_array($result); + $GraphTitle .= ' ' . _('For') . ' ' . $myrow['areadescription']; $WhereClause .= " area='" . $_POST['SalesArea'] . "' AND"; } if ($_POST['CategoryID']=='All'){ $GraphTitle .= ' ' . _('For All Stock Categories'); } else { $result = DB_query("SELECT categorydescription FROM stockcategory WHERE categoryid='" . $_POST['CategoryID'] . "'",$db); - $myrow = DB_fetch_row($result); - $GraphTitle .= ' ' . _('For') . ' ' . $myrow[0]; + $myrow = DB_fetch_array($result); + $GraphTitle .= ' ' . _('For') . ' ' . $myrow['categorydescription']; $WhereClause .= " stkcategory='" . $_POST['CategoryID'] . "' AND"; } @@ -220,8 +220,8 @@ $GraphTitle .= ' ' . _('For All Salespeople'); } else { $result = DB_query("SELECT salesmanname FROM salesman WHERE salesmancode='" . $_POST['SalesmanCode'] . "'",$db); - $myrow = DB_fetch_row($result); - $GraphTitle .= ' ' . _('For Salesperson:') . ' ' . $myrow[0]; + $myrow = DB_fetch_array($result); + $GraphTitle .= ' ' . _('For Salesperson:') . ' ' . $myrow['salesmanname']; $WhereClause .= " salesperson='" . $_POST['SalesmanCode'] . "' AND"; } Modified: trunk/SalesPeople.php =================================================================== --- trunk/SalesPeople.php 2012-02-15 16:41:19 UTC (rev 8515) +++ trunk/SalesPeople.php 2012-02-15 16:43:12 UTC (rev 8516) @@ -142,18 +142,18 @@ // PREVENT DELETES IF DEPENDENT RECORDS IN 'DebtorsMaster' - $sql= "SELECT COUNT(*) FROM custbranch WHERE custbranch.salesman='".$SelectedSalesPerson."'"; + $sql= "SELECT COUNT(branchcode) AS branches FROM custbranch WHERE custbranch.salesman='".$SelectedSalesPerson."'"; $result = DB_query($sql,$db); - $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { - prnMsg(_('Cannot delete this salesperson because branches are set up referring to them') . ' - ' . _('first alter the branches concerned') . '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('branches that refer to this salesperson'),'error'); + $myrow = DB_fetch_array($result); + if ($myrow['branches']>0) { + prnMsg(_('Cannot delete this salesperson because branches are set up referring to them') . ' - ' . _('first alter the branches concerned') . '<br />' . _('There are') . ' ' . $myrow['branches'] . ' ' . _('branches that refer to this salesperson'),'error'); } else { - $sql= "SELECT COUNT(*) FROM salesanalysis WHERE salesanalysis.salesperson='".$SelectedSalesPerson."'"; + $sql= "SELECT COUNT(salesperson) AS salespeople FROM salesanalysis WHERE salesanalysis.salesperson='".$SelectedSalesPerson."'"; $result = DB_query($sql,$db); - $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { - prnMsg(_('Cannot delete this salesperson because sales analysis records refer to them') , '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('sales analysis records that refer to this salesperson'),'error'); + $myrow = DB_fetch_array($result); + if ($myrow['salespeople']>0) { + prnMsg(_('Cannot delete this salesperson because sales analysis records refer to them') , '<br />' . _('There are') . ' ' . $myrow['salespeople'] . ' ' . _('sales analysis records that refer to this salesperson'),'error'); } else { $sql="DELETE FROM salesman WHERE salesmancode='".$SelectedSalesPerson."'"; @@ -196,7 +196,7 @@ <th>' . _('Comm Rate 2') . '</th> <th>' . _('Current') . '</th></tr>'; $k=0; - while ($myrow=DB_fetch_row($result)) { + while ($myarray=DB_fetch_array($result)) { if ($k==1){ echo '<tr class="EvenTableRows">'; @@ -205,7 +205,7 @@ echo '<tr class="OddTableRows">'; $k++; } - if ($myrow[7] == 1) { + if ($myrow['current'] == 1) { $ActiveText = _('Yes'); } else { $ActiveText = _('No'); @@ -223,18 +223,18 @@ <td><a href="%sSelectedSaleperson=%s">'. _('Edit') . '</a></td> <td><a href="%sSelectedSaleperson=%s&delete=1">' . _('Delete') . '</a></td> </tr>', - $myrow[0], - $myrow[1], - $myrow[2], - $myrow[3], - $myrow[4], - $myrow[5], - $myrow[6], + $myrow['salesmancode'], + $myrow['salesmanname'], + $myrow['smantel'], + $myrow['smanfax'], + $myrow['commissionrate1'], + $myrow['breakpoint'], + $myrow['commissionrate2'], $ActiveText, htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?', - $myrow[0], + $myrow['salesmancode'], htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?', - $myrow[0]); + $myrow['salesmancode']); } //END WHILE LIST LOOP echo '</table><br />'; Modified: trunk/SalesTypes.php =================================================================== --- trunk/SalesTypes.php 2012-02-15 16:41:19 UTC (rev 8515) +++ trunk/SalesTypes.php 2012-02-15 16:43:12 UTC (rev 8516) @@ -63,14 +63,13 @@ // First check the type is not being duplicated - $checkSql = "SELECT count(*) + $checkSql = "SELECT typeabbrev FROM salestypes WHERE typeabbrev = '" . $_POST['TypeAbbrev'] . "'"; $checkresult = DB_query($checkSql,$db); - $checkrow = DB_fetch_row($checkresult); - if ( $checkrow[0] > 0 ) { + if ( DB_num_rows($checkresult) > 0 ) { $InputError = 1; prnMsg( _('The customer/sales/pricelist type ') . $_POST['TypeAbbrev'] . _(' already exist.'),'error'); } else { @@ -83,11 +82,7 @@ VALUES ('" . str_replace(' ', '', $_POST['TypeAbbrev']) . "', '" . $_POST['Sales_Type'] . "')"; - $msg = _('Customer/sales/pricelist type') . ' ' . $_POST["Sales_Type"] . ' ' . _('has been created'); - $checkSql = "SELECT count(typeabbrev) - FROM salestypes"; - $result = DB_query($checkSql, $db); - $row = DB_fetch_row($result); + $msg = _('Customer/sales/pricelist type') . ' ' . $_POST['Sales_Type'] . ' ' . _('has been created'); } } @@ -98,22 +93,16 @@ // Fetch the default price list. - $sql = "SELECT confvalue - FROM config - WHERE confname='DefaultPriceList'"; - $result = DB_query($sql,$db); - $PriceListRow = DB_fetch_row($result); - $DefaultPriceList = $PriceListRow[0]; + $DefaultPriceList = $_SESSION['DefaultPriceList']; // Does it exist - $checkSql = "SELECT count(*) + $checkSql = "SELECT typeabbrev FROM salestypes WHERE typeabbrev = '" . $DefaultPriceList . "'"; $checkresult = DB_query($checkSql,$db); - $checkrow = DB_fetch_row($checkresult); // If it doesnt then update config with newly created one. - if ($checkrow[0] == 0) { + if (DB_num_rows($checkresult) == 0) { $sql = "UPDATE config SET confvalue='".$_POST['TypeAbbrev']."' WHERE confname='DefaultPriceList'"; @@ -133,26 +122,26 @@ // PREVENT DELETES IF DEPENDENT RECORDS IN 'DebtorTrans' // Prevent delete if saletype exist in customer transactions - $sql= "SELECT COUNT(*) + $sql= "SELECT COUNT(id) AS transactions FROM debtortrans WHERE debtortrans.tpe='".$SelectedType."'"; $ErrMsg = _('The number of transactions using this customer/sales/pricelist type could not be retrieved'); $result = DB_query($sql,$db,$ErrMsg); - $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { - prnMsg(_('Cannot delete this sale type because customer transactions have been created using this sales type') . '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('transactions using this sales type code'),'error'); + $myrow = DB_fetch_array($result); + if ($myrow['transactions']>0) { + prnMsg(_('Cannot delete this sale type because customer transactions have been created using this sales type') . '<br />' . _('There are') . ' ' . $myrow['transactions'] . ' ' . _('transactions using this sales type code'),'error'); } else { - $sql = "SELECT COUNT(*) FROM debtorsmaster WHERE salestype='".$SelectedType."'"; + $sql = "SELECT COUNT(debtorno) AS debtors FROM debtorsmaster WHERE salestype='".$SelectedType."'"; $ErrMsg = _('The number of transactions using this Sales Type record could not be retrieved because'); $result = DB_query($sql,$db,$ErrMsg); - $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { - prnMsg (_('Cannot delete this sale type because customers are currently set up to use this sales type') . '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('customers with this sales type code')); + $myrow = DB_fetch_array($result); + if ($myrow['debtors']>0) { + prnMsg (_('Cannot delete this sale type because customers are currently set up to use this sales type') . '<br />' . _('There are') . ' ' . $myrow['debtors'] . ' ' . _('customers with this sales type code')); } else { $sql="DELETE FROM salestypes WHERE typeabbrev='".$SelectedType."'"; Modified: trunk/SelectCompletedOrder.php =================================================================== --- trunk/SelectCompletedOrder.php 2012-02-15 16:41:19 UTC (rev 8515) +++ trunk/SelectCompletedOrder.php 2012-02-15 16:43:12 UTC (rev 8516) @@ -214,8 +214,8 @@ $StockItemsResult = DB_query($SQL,$db,$ErrMsg,$DbgMsg); if (DB_num_rows($StockItemsResult)==1){ - $myrow = DB_fetch_row($StockItemsResult); - $SelectedStockItem = $myrow[0]; + $myrow = DB_fetch_array($StockItemsResult); + $SelectedStockItem = $myrow['stockid']; $_POST['SearchOrders']='True'; unset($StockItemsResult); echo '<br />' . _('For the part') . ': ' . $SelectedStockItem . ' ' . _('and') . ' <input type="hidden" name="SelectedStockItem" value="'.$SelectedStockItem.'" />'; Modified: trunk/SelectCreditItems.php =================================================================== --- trunk/SelectCreditItems.php 2012-02-15 16:41:19 UTC (rev 8515) +++ trunk/SelectCreditItems.php 2012-02-15 16:43:12 UTC (rev 8516) @@ -463,17 +463,17 @@ $DbgMsg = _('The SQL used to retrieve the customer details and failed was'); $result =DB_query($sql,$db,$ErrMsg,$DbgMsg); - $myrow = DB_fetch_row($result); + $myrow = DB_fetch_array($result); $_SESSION['RequireCustomerSelection'] = 0; - $_SESSION['CreditItems'.$identifier]->CustomerName = $myrow[0]; + $_SESSION['CreditItems'.$identifier]->CustomerName = $myrow['name']; /* the sales type determines the price list to be used by default the customer of the user is defaulted from the entry of the userid and password. */ - $_SESSION['CreditItems'.$identifier]->DefaultSalesType = $myrow[1]; - $_SESSION['CreditItems'.$identifier]->DefaultCurrency = $myrow[2]; - $_SESSION['CurrencyRate'] = $myrow[3]; + $_SESSION['CreditItems'.$identifier]->DefaultSalesType = $myrow['salestype']; + $_SESSION['CreditItems'.$identifier]->DefaultCurrency = $myrow['currcode']; + $_SESSION['CurrencyRate'] = $myrow['rate']; /* default the branch information from the customer branches table CustBranch -particularly where the stock will be booked back into. */ @@ -1397,8 +1397,8 @@ $DbgMsg = '<br />' . _('The following SQL to insert the customer credit note was used'); $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg); - if ($myrow = DB_fetch_row($Result)){ - $Area = $myrow[0]; + if ($myrow = DB_fetch_array($Result)){ + $Area = $myrow['area']; } DB_free_result($Result); @@ -1417,7 +1417,7 @@ /*Now Get the next credit note number - function in SQL_CommonFunctions*/ $CreditNo = GetNextTransNo(11, $db); - $SQLCreditDate = Date("Y-m-d"); + $SQLCreditDate = Date('Y-m-d'); $PeriodNo = GetPeriod(Date($_SESSION['DefaultDateFormat']), $db); /*Start an SQL transaction */ @@ -1498,8 +1498,8 @@ $Result = DB_query($SQL, $db); if (DB_num_rows($Result)==1){ - $LocQtyRow = DB_fetch_row($Result); - $QtyOnHandPrior = $LocQtyRow[0]; + $LocQtyRow = DB_fetch_array($Result); + $QtyOnHandPrior = $LocQtyRow['quantity']; } else { /*There must actually be some error this should never happen */ $QtyOnHandPrior = 0; @@ -1652,7 +1652,7 @@ foreach($CreditLine->SerialItems as $Item){ /*1st off check if StockSerialItems already exists */ - $SQL = "SELECT COUNT(*) + $SQL = "SELECT stockid FROM stockserialitems WHERE stockid='" . $CreditLine->StockID . "' AND loccode='" . $_SESSION['CreditItems'.$identifier]->Location . "' @@ -1660,9 +1660,8 @@ $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The existence of the serial stock item record could not be determined because'); $DbgMsg = _('The following SQL to find out if the serial stock item record existed already was used'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); - $myrow = DB_fetch_row($Result); - if ($myrow[0]==0) { + if (DB_num_rows($Result)==0) { /*The StockSerialItem record didnt exist so insert a new record */ $SQL = "INSERT INTO stockserialitems (stockid, @@ -1760,8 +1759,8 @@ $Result = DB_query($SQL, $db); if (DB_num_rows($Result)==1){ - $LocQtyRow = DB_fetch_row($Result); - $QtyOnHandPrior = $LocQtyRow[0]; + $LocQtyRow = DB_fetch_array($Result); + $QtyOnHandPrior = $LocQtyRow['quantity']; } else { /*There must actually be some error this should never happen */ $QtyOnHandPrior = 0; @@ -1943,7 +1942,7 @@ set up. Considered just getting the area and salesman from the branch table but these can alter and the sales analysis needs to reflect the sales made before and after the changes*/ - $SQL="SELECT COUNT(*), + $SQL="SELECT COUNT(*) AS totalrows, salesanalysis.stkcategory, salesanalysis.area, salesanalysis.salesperson @@ -1970,9 +1969,9 @@ $DbgMsg = _('SQL to count the no of sales analysis records'); $Result = DB_query($SQL,$db, $ErrMsg, $DbgMsg, true); - $myrow = DB_fetch_row($Result); + $myrow = DB_fetch_array($Result); - if ($myrow[0]>0){ /*Update the existing record that already exists */ + if ($myrow['totalrows']>0){ /*Update the existing record that already exists */ if ($_POST['CreditType']=='ReverseOverCharge'){ @@ -1981,14 +1980,14 @@ $SQL = "UPDATE salesanalysis SET amt=amt-" . ($CreditLine->Price * $CreditLine->Quantity*$CreditLine->ConversionFactor / $_SESSION['CurrencyRate']) . ", disc=disc-" . ($CreditLine->DiscountPercent * $CreditLine->Price * $CreditLine->Quantity*$CreditLine->ConversionFactor / $_SESSION['CurrencyRate']) . " - WHERE salesanalysis.area='" . $myrow[2] . "' - AND salesanalysis.salesperson='" . $myrow[3] . "' + WHERE salesanalysis.area='" . $myrow['area'] . "' + AND salesanalysis.salesperson='" . $myrow['salesperson'] . "' AND salesanalysis.typeabbrev ='" . $_SESSION['CreditItems'.$identifier]->DefaultSalesType . "' AND salesanalysis.periodno = '" . $PeriodNo . "' AND salesanalysis.cust = '" . $_SESSION['CreditItems'.$identifier]->DebtorNo . "' AND salesanalysis.custbranch = '" . $_SESSION['CreditItems'.$identifier]->Branch . "' AND salesanalysis.stockid = '" . $CreditLine->StockID . "' - AND salesanalysis.stkcategory ='" . $myrow[1] . "' + AND salesanalysis.stkcategory ='" . $myrow['stkcategory'] . "' AND salesanalysis.budgetoractual=1"; } else { @@ -1998,14 +1997,14 @@ cost=cost-" . ($CreditLine->StandardCost * $CreditLine->Quantity*$CreditLine->ConversionFactor) . ", qty=qty-" . $CreditLine->Quantity*$CreditLine->ConversionFactor . ", disc=disc-" . ($CreditLine->DiscountPercent * $CreditLine->Price *$CreditLine->Quantity*$CreditLine->ConversionFactor / $_SESSION['CurrencyRate']) . " - WHERE salesanalysis.area='" . $myrow[2] . "' - AND salesanalysis.salesperson='" . $myrow[3] . "' + WHERE salesanalysis.area='" . $myrow['area'] . "' + AND salesanalysis.salesperson='" . $myrow['salesperson'] . "' AND salesanalysis.typeabbrev ='" . $_SESSION['CreditItems'.$identifier]->DefaultSalesType . "' AND salesanalysis.periodno = '" . $PeriodNo . "' AND salesanalysis.cust = '" . $_SESSION['CreditItems'.$identifier]->DebtorNo . "' AND salesanalysis.custbranch = '" . $_SESSION['CreditItems'.$identifier]->Branch . "' AND salesanalysis.stockid = '" . $CreditLine->StockID . "' - AND salesanalysis.stkcategory ='" . $myrow[1] . "' + AND salesanalysis.stkcategory ='" . $myrow['stkcategory'] . "' AND salesanalysis.budgetoractual=1"; } Modified: trunk/SelectGLAccount.php =================================================================== --- trunk/SelectGLAccount.php 2012-02-15 16:41:19 UTC (rev 8515) +++ trunk/SelectGLAccount.php 2012-02-15 16:43:12 UTC (rev 8516) @@ -13,10 +13,10 @@ if (isset($_POST['Select'])) { $result = DB_query("SELECT accountname FROM chartmaster WHERE accountcode=" . $_POST['Select'],$db); - $myrow = DB_fetch_row($result); + $myrow = DB_fetch_array($result); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Search for General Ledger Accounts') . '</p>'; - echo '<div class="page_help_text">' . _('Account Code') . ' <b>' . $_POST['Select'] . ' - ' . $myrow[0] . ' </b>' . _('has been selected') . '. <br />' . _('Select one of the links below to operate using this Account') . '.</div>'; + echo '<div class="page_help_text">' . _('Account Code') . ' <b>' . $_POST['Select'] . ' - ' . $myrow['accountname'] . ' </b>' . _('has been selected') . '. <br />' . _('Select one of the links below to operate using this Account') . '.</div>'; $AccountID = $_POST['Select']; $_POST['Select'] = NULL; @@ -26,10 +26,10 @@ } elseif (isset($_POST['Search'])){ - if (mb_strlen($_POST['Keywords']>0) AND mb_strlen($_POST['GLCode'])>0) { + if (mb_strlen($_POST['Keywords']>0) and mb_strlen($_POST['GLCode'])>0) { $msg=_('Account name keywords have been used in preference to the account code extract entered'); } - if ($_POST['Keywords']=='' AND $_POST['GLCode']=='') { + if ($_POST['Keywords']=='' and $_POST['GLCode']=='') { $msg=_('At least one Account Name keyword OR an extract of an Account Code must be entered for the search'); } else { If (mb_strlen($_POST['Keywords'])>0) { Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2012-02-15 16:41:19 UTC (rev 8515) +++ trunk/SelectOrderItems.php 2012-02-15 16:43:12 UTC (rev 8516) @@ -183,8 +183,8 @@ FROM currencies WHERE currabrev='" . $_SESSION['Items'.$identifier]->DefaultCurrency . "'",$db); if (DB_num_rows($ExRateResult)>0){ - $ExRateRow = DB_fetch_row($ExRateResult); - $ExRate = $ExRateRow[0]; + $ExRateRow = DB_fetch_array($ExRateResult); + $ExRate = $ExRateRow['rate']; } else { $ExRate =1; } @@ -447,24 +447,24 @@ $DbgMsg = _('The SQL used to retrieve the customer details and failed was') . ':'; $result =DB_query($sql,$db,$ErrMsg,$DbgMsg); - $myrow = DB_fetch_row($result); - if ($myrow[1] != 1){ - if ($myrow[1]==2){ - prnMsg(_('The') . ' ' . $myrow[0] . ' ' . _('account is currently flagged as an account that needs to be watched. Please contact the credit control personnel to discuss'),'warn'); + $myrow = DB_fetch_array($result); + if ($myrow['dissallowinvoices'] != 1){ + if ($myrow['dissallowinvoices']==2){ + prnMsg(_('The') . ' ' . $myrow['name'] . ' ' . _('account is currently flagged as an account that needs to be watched. Please contact the credit control personnel to discuss'),'warn'); } $_SESSION['Items'.$identifier]->DebtorNo=$_POST['Select']; $_SESSION['RequireCustomerSelection']=0; - $_SESSION['Items'.$identifier]->CustomerName = $myrow[0]; + $_SESSION['Items'.$identifier]->CustomerName = $myrow['name']; # the sales type determines the price list to be used by default the customer of the user is # defaulted from the entry of the userid and password. - $_SESSION['Items'.$identifier]->DefaultSalesType = $myrow[2]; - $_SESSION['Items'.$identifier]->SalesTypeName = $myrow[3]; - $_SESSION['Items'.$identifier]->DefaultCurrency = $myrow[4]; - $_SESSION['Items'.$identifier]->DefaultPOLine = $myrow[5]; - $_SESSION['Items'.$identifier]->PaymentTerms = $myrow[6]; + $_SESSION['Items'.$identifier]->DefaultSalesType = $myrow['salestype']; + $_SESSION['Items'.$identifier]->SalesTypeName = $myrow['sales_type']; + $_SESSION['Items'.$identifier]->DefaultCurrency = $myrow['currcode']; + $_SESSION['Items'.$identifier]->DefaultPOLine = $myrow['customerpoline']; + $_SESSION['Items'.$identifier]->PaymentTerms = $myrow['terms']; # the branch was also selected from the customer selection so default the delivery details from the customer branches table CustBranch. The order process will ask for branch details later anyway @@ -506,28 +506,28 @@ } // add echo echo '<br />'; - $myrow = DB_fetch_row($result); - if ($_SESSION['SalesmanLogin']!='' AND $_SESSION['SalesmanLogin']!=$myrow[15]){ + $myrow = DB_fetch_array($result); + if ($_SESSION['SalesmanLogin']!='' and $_SESSION['SalesmanLogin']!=$myrow['salesman']){ prnMsg(_('Your login is only set up for a particular salesperson. This customer has a different salesperson.'),'error'); include('includes/footer.inc'); exit; } - $_SESSION['Items'.$identifier]->DeliverTo = $myrow[0]; - $_SESSION['Items'.$identifier]->DelAdd1 = $myrow[1]; - $_SESSION['Items'.$identifier]->DelAdd2 = $myrow[2]; - $_SESSION['Items'.$identifier]->DelAdd3 = $myrow[3]; - $_SESSION['Items'.$identifier]->DelAdd4 = $myrow[4]; - $_SESSION['Items'.$identifier]->DelAdd5 = $myrow[5]; - $_SESSION['Items'.$identifier]->DelAdd6 = $myrow[6]; - $_SESSION['Items'.$identifier]->PhoneNo = $myrow[7]; - $_SESSION['Items'.$identifier]->Email = $myrow[8]; - $_SESSION['Items'.$identifier]->Location = $myrow[9]; - $_SESSION['Items'.$identifier]->ShipVia = $myrow[10]; - $_SESSION['Items'.$identifier]->DeliverBlind = $myrow[11]; - $_SESSION['Items'.$identifier]->SpecialInstructions = $myrow[12]; - $_SESSION['Items'.$identifier]->DeliveryDays = $myrow[13]; - $_SESSION['Items'.$identifier]->LocationName = $myrow[14]; + $_SESSION['Items'.$identifier]->DeliverTo = $myrow['brname']; + $_SESSION['Items'.$identifier]->DelAdd1 = $myrow['braddress1']; + $_SESSION['Items'.$identifier]->DelAdd2 = $myrow['braddress2']; + $_SESSION['Items'.$identifier]->DelAdd3 = $myrow['braddress3']; + $_SESSION['Items'.$identifier]->DelAdd4 = $myrow['braddress4']; + $_SESSION['Items'.$identifier]->DelAdd5 = $myrow['braddress5']; + $_SESSION['Items'.$identifier]->DelAdd6 = $myrow['braddress6']; + $_SESSION['Items'.$identifier]->PhoneNo = $myrow['phoneno']; + $_SESSION['Items'.$identifier]->Email = $myrow['email']; + $_SESSION['Items'.$identifier]->Location = $myrow['defaultlocation']; + $_SESSION['Items'.$identifier]->ShipVia = $myrow['defaultshipvia']; + $_SESSION['Items'.$identifier]->DeliverBlind = $myrow['deliverblind']; + $_SESSION['Items'.$identifier]->SpecialInstructions = $myrow['specialinstructions']; + $_SESSION['Items'.$identifier]->DeliveryDays = $myrow['estdeliverydays']; + $_SESSION['Items'.$identifier]->LocationName = $myrow['locationname']; if ($_SESSION['Items'.$identifier]->SpecialInstructions) prnMsg($_SESSION['Items'.$identifier]->SpecialInstructions,'warn'); @@ -571,18 +571,18 @@ $DbgMsg = _('SQL used to retrieve the customer details was') . ':<br />' . $sql; $result =DB_query($sql,$db,$ErrMsg,$DbgMsg); - $myrow = DB_fetch_row($result); - if ($myrow[1] == 0){ + $myrow = DB_fetch_array($result); + if ($myrow['dissallowinvoices'] == 0){ - $_SESSION['Items'.$identifier]->CustomerName = $myrow[0]; + $_SESSION['Items'.$identifier]->CustomerName = $myrow['name']; # the sales type determines the price list to be used by default the customer of the user is # defaulted from the entry of the userid and password. - $_SESSION['Items'.$identifier]->DefaultSalesType = $myrow[2]; - $_SESSION['Items'.$identifier]->DefaultCurrency = $myrow[3]; + $_SESSION['Items'.$identifier]->DefaultSalesType = $myrow['salestype']; + $_SESSION['Items'.$identifier]->DefaultCurrency = $myrow['currcode']; $_SESSION['Items'.$identifier]->Branch = $_SESSION['UserBranch']; - $_SESSION['Items'.$identifier]->DefaultPOLine = $myrow[4]; + $_SESSION['Items'.$identifier]->DefaultPOLine = $myrow['customerpoline']; // the branch would be set in the user data so default delivery details as necessary. However, @@ -616,20 +616,20 @@ $DbgMsg = _('SQL used to retrieve the branch details was'); $result =DB_query($sql,$db,$ErrMsg, $DbgMsg); - $myrow = DB_fetch_row($result); - $_SESSION['Items'.$identifier]->DeliverTo = $myrow[0]; - $_SESSION['Items'.$identifier]->DelAdd1 = $myrow[1]; - $_SESSION['Items'.$identifier]->DelAdd2 = $myrow[2]; - $_SESSION['Items'.$identifier]->DelAdd3 = $myrow[3]; - $_SESSION['Items'.$identifier]->DelAdd4 = $myrow[4]; - $_SESSION['Items'.$identifier]->DelAdd5 = $myrow[5]; - $_SESSION['Items'.$identifier]->DelAdd6 = $myrow[6]; - $_SESSION['Items'.$identifier]->PhoneNo = $myrow[7]; - $_SESSION['Items'.$identifier]->Email = $myrow[8]; - $_SESSION['Items'.$identifier]->Location = $myrow[9]; - $_SESSION['Items'.$identifier]->DeliverBlind = $myrow[10]; - $_SESSION['Items'.$identifier]->DeliveryDays = $myrow[11]; - $_SESSION['Items'.$identifier]->LocationName = $myrow[12]; + $myrow = DB_fetch_array($result); + $_SESSION['Items'.$identifier]->DeliverTo = $myrow['brname']; + $_SESSION['Items'.$identifier]->DelAdd1 = $myrow['braddress1']; + $_SESSION['Items'.$identifier]->DelAdd2 = $myrow['braddress2']; + $_SESSION['Items'.$identifier]->DelAdd3 = $myrow['braddress3']; + $_SESSION['Items'.$identifier]->DelAdd4 = $myrow['braddress4']; + $_SESSION['Items'.$identifier]->DelAdd5 = $myrow['braddress5']; + $_SESSION['Items'.$identifier]->DelAdd6 = $myrow['braddress6']; + $_SESSION['Items'.$identifier]->PhoneNo = $myrow['phoneno']; + $_SESSION['Items'.$identifier]->Email = $myrow['email']; + $_SESSION['Items'.$identifier]->Location = $myrow['defaultlocation']; + $_SESSION['Items'.$identifier]->DeliverBlind = $myrow['deliverblind']; + $_SESSION['Items'.$identifier]->DeliveryDays = $myrow['estdeliverydays']; + $_SESSION['Items'.$identifier]->LocationName = $myrow['locationname']; } else { prnMsg(_('Sorry, your account has been put on hold for some reason, please contact the credit control personnel.'),'warn'); include('includes/footer.inc'); @@ -921,8 +921,8 @@ if ($_SESSION['Items'.$identifier]->DefaultCurrency != $_SESSION['CompanyRecord']['currencydefault']){ $ExRateResult = DB_query("SELECT rate FROM currencies WHERE currabrev='" . $_SESSION['Items'.$identifier]->DefaultCurrency . "'",$db); if (DB_num_rows($ExRateResult)>0){ - $ExRateRow = DB_fetch_row($ExRateResult); - $ExRate = $ExRateRow[0]; + $ExRateRow = DB_fetch_array($ExRateResult); + $ExRate = $ExRateRow['rate']; } else { $ExRate =1; } @@ -1321,11 +1321,11 @@ WHERE salestype='" . $_SESSION['Items'.$identifier]->DefaultSalesType . "' AND discountcategory ='" . $OrderLine->DiscCat . "' AND quantitybreak <" . $QuantityOfDiscCat,$db); - $myrow = DB_fetch_row($result); - if ($myrow[0] == NULL){ + $myrow = DB_fetch_array($result); + if ($myrow['discount'] == NULL){ $DiscountMatrixRate = 0; } else { - $DiscountMatrixRate = $myrow[0]; + $DiscountMatrixRate = $myrow['discount']; } foreach ($_SESSION['Items'.$identifier]->LineItems as $StkItems_2) { /* add up total quantity of all lines of this DiscCat */ @@ -1617,9 +1617,9 @@ _('cannot be retrieved because'); $DemandResult = DB_query($sql,$db,$ErrMsg); - $DemandRow = DB_fetch_row($DemandResult); - if ($DemandRow[0] != null){ - $DemandQty = $DemandRow[0]; + $DemandRow = DB_fetch_array($DemandResult); + if ($DemandRow['dem'] != null){ + $DemandQty = $DemandRow['dem']; } else { $DemandQty = 0; } @@ -1634,9 +1634,9 @@ $ErrMsg = _('The order details for this product cannot be retrieved because'); $PurchResult = DB_query($sql,$db,$ErrMsg); - $PurchRow = DB_fetch_row($PurchResult); - if ($PurchRow[0]!=null){ - $PurchQty = $PurchRow[0]; + $PurchRow = DB_fetch_array($PurchResult); + if ($PurchRow['dem']!=null){ + $PurchQty = $PurchRow['dem']; } else { $PurchQty = 0; } @@ -1647,9 +1647,9 @@ WHERE stockid='" . $myrow['stockid'] ."'"; $ErrMsg = _('The order details for this product cannot be retrieved because'); $WoResult = DB_query($sql,$db,$ErrMsg); - $WoRow = DB_fetch_row($WoResult); - if ($WoRow[0]!=null){ - $WoQty = $WoRow[0]; + $WoRow = DB_fetch_array($WoResult); + if ($WoRow['dedm']!=null){ + $WoQty = $WoRow['dedm']; } else { $WoQty = 0; } @@ -1850,9 +1850,9 @@ $ErrMsg = _('The demand for this product from') . ' ' . $_SESSION['Items'.$identifier]->Location . ' ' . _('cannot be retrieved because'); $DemandResult = DB_query($sql,$db,$ErrMsg); - $DemandRow = DB_fetch_row($DemandResult); - if ($DemandRow[0] != null){ - $DemandQty = $DemandRow[0]/$PriceRow['conversionfactor']; + $DemandRow = DB_fetch_array($DemandResult); + if ($DemandRow['dem'] != null){ + $DemandQty = $DemandRow['dem']/$PriceRow['conversionfactor']; } else { $DemandQty = 0; } @@ -1869,9 +1869,9 @@ $ErrMsg = _('The order details for this product cannot be retrieved because'); $PurchResult = DB_query($sql,$db,$ErrMsg); - $PurchRow = DB_fetch_row($PurchResult); - if ($PurchRow[0]!=null){ - $PurchQty = $PurchRow[0]/$PriceRow['conversionfactor']; + $PurchRow = DB_fetch_array($PurchResult); + if ($PurchRow['dem']!=null){ + $PurchQty = $PurchRow['dem']/$PriceRow['conversionfactor']; } else { $PurchQty = 0; } @@ -1883,9 +1883,9 @@ $ErrMsg = _('The order details for this product cannot be retrieved because'); $WoResult = DB_query($sql,$db,$ErrMsg); - $WoRow = DB_fetch_row($WoResult); - if ($WoRow[0]!=null){ - $WoQty = $WoRow[0]; + $WoRow = DB_fetch_array($WoResult); + if ($WoRow['dedm']!=null){ + $WoQty = $WoRow['dedm']; } else { $WoQty = 0; } Modified: trunk/SelectProduct.php =================================================================== --- trunk/SelectProduct.php 2012-02-15 16:41:19 UTC (rev 8515) +++ trunk/SelectProduct.php 2012-02-15 16:43:12 UTC (rev 8516) @@ -138,8 +138,8 @@ WHERE bom.parent='" . $StockID . "' AND bom.effectiveto > '" . Date('Y-m-d') . "' AND bom.effectiveafter < '" . Date('Y-m-d') . "'", $db); - $CostRow = DB_fetch_row($CostResult); - $Cost = $CostRow[0]; + $CostRow = DB_fetch_array($CostResult); + $Cost = $CostRow['cost']; } else { $Cost = $myrow['cost']; } @@ -158,7 +158,7 @@ $GP = _('N/A'); } echo $GP . '%' . '</td></tr>'; - while ($PriceRow = DB_fetch_row($PriceResult)) { + while ($PriceRow = DB_fetch_array($PriceResult)) { $Price = $PriceRow['price']; echo '<tr><td></td> <td class="select">' . $PriceRow['typeabbrev'] . '</td> @@ -182,8 +182,8 @@ WHERE bom.parent='" . $StockID . "' AND bom.effectiveto > '" . Date('Y-m-d') . "' AND bom.effectiveafter < '" . Date('Y-m-d') . "'", $db); - $CostRow = DB_fetch_row($CostResult); - $Cost = $CostRow[0]; + $CostRow = DB_fetch_array($CostResult); + $Cost = $CostRow['cost']; } else { $Cost = $myrow['cost']; } @@ -196,8 +196,8 @@ $CatValResult = DB_query("SELECT categoryid FROM stockmaster WHERE stockid='" . $StockID . "'", $db); - $CatValRow = DB_fetch_row($CatValResult); - $CatValue = $CatValRow[0]; + $CatValRow = DB_fetch_array($CatValResult); + $CatValue = $CatValRow['categoryid']; $sql = "SELECT stkcatpropid, label, controltype, @@ -214,8 +214,8 @@ FROM stockitemproperties WHERE stockid='" . $StockID . "' AND stkcatpropid ='" . $PropertyRow['stkcatpropid']."'", $db); - $PropValRow = DB_fetch_row($PropValResult); - $PropertyValue = $PropValRow[0]; + $PropValRow = DB_fetch_array($PropValResult); + $PropertyValue = $PropValRow['value']; echo '<tr><th align="right">' . $PropertyRow['label'] . ':</th>'; switch ($PropertyRow['controltype']) { case 0; //textbox @@ -257,13 +257,13 @@ break; case 'M': case 'B': - $QOHResult = DB_query("SELECT sum(quantity) + $QOHResult = DB_query("SELECT sum(quantity) AS totalquantity FROM locstock WHERE stockid = '" . $StockID . "'", $db); - $QOHRow = DB_fetch_row($QOHResult); - $QOH = locale_number_format($QOHRow[0], $myrow['decimalplaces']); + $QOHRow = DB_fetch_array($QOHResult); + $QOH = locale_number_format($QOHRow['totalquantity'], $myrow['decimalplaces']); $QOOSQL="SELECT SUM((purchorderdetails.quantityord*purchorderdetails.conversionfactor) - - (purchorderdetails.quantityrecd*purchorderdetails.conversionfactor)) + (purchorderdetails.quantityrecd*purchorderdetails.conversionfactor)) AS qoo FROM purchorders LEFT JOIN purchorderdetails ON purchorders.orderno=purchorderdetails.orderno @@ -276,8 +276,8 @@ if (DB_num_rows($QOOResult) == 0) { $QOO = 0; } else { - $QOORow = DB_fetch_row($QOOResult); - $QOO = $QOORow[0]; + $QOORow = DB_fetch_array($QOOResult); + $QOO = $QOORow['qoo']; } //Also the on work order quantities $sql = "SELECT SUM(woitems.qtyreqd-woitems.qtyrecd) AS qtywo @@ -288,8 +288,8 @@ $ErrMsg = _('The quantity on work orders for this product cannot be retrieved because'); $QOOResult = DB_query($sql, $db, $ErrMsg); if (DB_num_rows($QOOResult) == 1) { - $QOORow = DB_fetch_row($QOOResult); - $QOO+= $QOORow[0]; + $QOORow = DB_fetch_array($QOOResult); + $QOO+= $QOORow['qtywo']; } $QOO = locale_number_format($QOO, $myrow['decimalplaces']); break; @@ -301,8 +301,8 @@ WHERE salesorderdetails.completed=0 AND salesorders.quotation=0 AND salesorderdetails.stkcode='" . $StockID . "'", $db); -$DemRow = DB_fetch_row($DemResult); -$Demand = $DemRow[0]; +$DemRow = DB_fetch_array($DemResult); +$Demand = $DemRow['dem']; $DemAsComponentResult = DB_query("SELECT SUM((salesorderdetails.quantity-salesorderdetails.qtyinvoiced)*bom.quantity) AS dem FROM salesorderdetails, salesorders, @@ -315,8 +315,8 @@ AND stockmaster.stockid=bom.parent AND stockmaster.mbflag='A' AND salesorders.quotation=0", $db); -$DemAsComponentRow = DB_fetch_row($DemAsComponentResult); -$Demand+= $DemAsComponentRow[0]; +$DemAsComponentRow = DB_fetch_array($DemAsComponentResult); +$Demand+= $DemAsComponentRow['dem']; //Also the demand for the item as a component of works orders $sql = "SELECT SUM(qtypu*(woitems.qtyreqd - woitems.qtyrecd)) AS woqtydemo FROM woitems INNER JOIN worequirements @@ -329,8 +329,8 @@ $ErrMsg = _('The workorder component demand for this product cannot be retrieved because'); $DemandResult = DB_query($sql, $db, $ErrMsg); if (DB_num_rows($DemandResult) == 1) { - $DemandRow = DB_fetch_row($DemandResult); - $Demand+= $DemandRow[0]; + $DemandRow = DB_fetch_array($DemandResult); + $Demand+= $DemandRow['woqtydemo']; } echo '<tr><th style="text-align:right;" width="15%">' . _('Quantity On Hand') . ':</th> <td width="17%" class="select">' . $QOH . '</td></tr>'; Modified: trunk/SelectSupplier.php =================================================================== --- trunk/SelectSupplier.php 2012-02-15 16:41:19 UTC (rev 8515) +++ trunk/SelectSupplier.php 2012-02-15 16:43:12 UTC (rev 8516) @@ -123,8 +123,8 @@ } //one of keywords or SupplierCode was more than a zero length string $result = DB_query($SQL, $db); if (DB_num_rows($result) == 1) { - $myrow = DB_fetch_row($result); - $SingleSupplierReturned = $myrow[0]; + $myrow = DB_fetch_array($result); + $SingleSupplierReturned = $myrow['supplierid']; } } //end of if search if (isset($SingleSupplierReturned)) { /*there was only one supplier returned */ @@ -139,8 +139,8 @@ WHERE suppliers.supplierid='" . htmlspecialchars_decode(html_entity_decode(stripslashes($_SESSION['SupplierID']))) . "'"; $SupplierNameResult = DB_query($SQL, $db); if (DB_num_rows($SupplierNameResult) == 1) { - $myrow = DB_fetch_row($SupplierNameResult); - $SupplierName = $myrow[0]; + $myrow = DB_fetch_array($SupplierNameResult); + $SupplierName = $myrow['suppname']; } echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Supplier') . '" alt="" />' . ' ' . _('Supplier') . ' : <b>' . stripslashes($_SESSION['SupplierID']) . ' - ' . $SupplierName . '</b> ' . _('has been selected') . '.</p>'; Modified: trunk/ShipmentCosting.php =================================================================== --- trunk/ShipmentCosting.php 2012-02-15 16:41:19 UTC (rev 8515) +++ trunk/ShipmentCosting.php 2012-02-15 16:43:12 UTC (rev 8516) @@ -65,7 +65,7 @@ $ShipmentCurrency = $HeaderData['currcode']; /*Get the total non-stock item shipment charges */ -$sql = "SELECT SUM(value) +$sql = "SELECT SUM(value) AS totalvalue FROM shipmentcharges WHERE stockid='' AND shiptref ='" . $_GET['SelectedShipment']. "'"; @@ -79,13 +79,13 @@ exit; } -$myrow = DB_fetch_row($GetShiptCostsResult); +$myrow = DB_fetch_array($GetShiptCostsResult); -$TotalCostsToApportion = $myrow[0]; +$TotalCostsToApportion = $myrow['totalvalue']; /*Now Get the total of stock items invoiced against the shipment */ -$sql = "SELECT SUM(value) +$sql = "SELECT SUM(value) AS totalvalue FROM shipmentcharges WHERE stockid<>'' AND shiptref ='" . $_GET['SelectedShipment'] . "'"; @@ -99,9 +99,9 @@ exit; } -$myrow = DB_fetch_row($GetShiptCostsResult); +$myrow = DB_fetch_array($GetShiptCostsResult); -$TotalInvoiceValueOfShipment = $myrow[0]; +$TotalInvoiceValueOfShipment = $myrow['totalvalue']; /*Now get the lines on the shipment */ @@ -173,8 +173,8 @@ WHERE shipmentcharges.stockid ='" . $myrow['itemcode'] . "' AND shipmentcharges.shiptref='" . $_GET['SelectedShipment'] . "'"; $ItemChargesResult = DB_query($sql,$db); - $ItemChargesRow = DB_fetch_row($ItemChargesResult); - $ItemCharges = $ItemChargesRow[0]; + $ItemChargesRow = DB_fetch_array($ItemChargesResult); + $ItemCharges = $ItemChargesRow['invoicedcharges']; if ($TotalInvoiceValueOfShipment>0){ $PortionOfCharges = $TotalCostsToApportion *($ItemCharges/$TotalInvoiceValueOfShipment); @@ -194,12 +194,12 @@ AND purchorderdetails.itemcode = '" . $myrow['itemcode'] . "'"; $StdCostResult = DB_query($sql,$db); - $StdCostRow = DB_fetch_row($StdCostResult); - $CostRecd = $StdCostRow[0]; + $StdCostRow = DB_fetch_array($StdCostResult); + $CostRecd = $StdCostRow['costrecd']; if ($myrow['totqtyrecd']==0) { $StdCostUnit = 0; } else { - $StdCostUnit = $StdCostRow[0]/$myrow['totqtyrecd']; + $StdCostUnit = $StdCostRow['costrecd']/$myrow['totqtyrecd']; } if ($ItemShipmentCost !=0){ @@ -240,12 +240,12 @@ The cost of these items - $ItemShipmentCost */ - $sql ="SELECT SUM(quantity) FROM locstock WHERE stockid='" . $myrow['itemcode'] . "'"; + $sql ="SELECT SUM(quantity) AS totalquantity FROM locstock WHERE stockid='" . $myrow['itemcode'] . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The quantity on hand could not be retrieved from the database'); $DbgMsg = _('The following SQL to retrieve the total stock quantity was used'); $Result = DB_query($sql, $db, $ErrMsg, $DbgMsg); - $QtyRow = DB_fetch_row($Result); - $TotalQuantityOnHand = $QtyRow[0]; + $QtyRow = DB_fetch_array($Result); + $TotalQuantityOnHand = $QtyRow['totalquantity']; /*The cost adjustment is the price variance / the total quantity in stock @@ -386,9 +386,9 @@ if ( $_POST['UpdateCost'] == 'Yes' ){ /*Only ever a standard costing option Weighted average costing implies cost updates taking place automatically */ - $QOHResult = DB_query("SELECT SUM(quantity) FROM locstock WHERE stockid ='" . $myrow['itemcode'] . "'",$db); - $QOHRow = DB_fetch_row($QOHResult); - $QOH=$QOHRow[0]; + $QOHResult = DB_query("SELECT SUM(quantity) AS totalquantity FROM locstock WHERE stockid ='" . $myrow['itemcode'] . "'",$db); + $QOHRow = DB_fetch_array($QOHResult); + $QOH=$QOHRow['totalquantity']; if ($_SESSION['CompanyRecord']['gllink_stock']==1){ $CostUpdateNo = GetNextTransNo(35, $db); Modified: trunk/Shipments.php =================================================================== --- trunk/Shipments.php 2012-02-15 16:41:19 UTC (rev 8515) +++ trunk/Shipments.php 2012-02-15 16:43:12 UTC (rev 8516) @@ -152,11 +152,11 @@ $ErrMsg = _('The supplier details for the shipment could not be retrieved because'); $result = DB_query($sql,$db,$ErrMsg); - $myrow = DB_fetch_row($result); + $myrow = DB_fetch_array($result); $_SESSION['Shipment']->SupplierID = $_SESSION['SupplierID']; - $_SESSION['Shipment']->SupplierName = $myrow[0]; - $_SESSION['Shipment']->CurrCode = $myrow[1]; + $_SESSION['Shipment']->SupplierName = $myrow['suppname']; + $_SESSION['Shipment']->CurrCode = $myrow['currcode']; $_SESSION['Shipment']->ShiptRef = GetNextTransNo (31, $db); } @@ -321,9 +321,9 @@ ON purchorders.orderno=purchorderdetails.orderno and podetailitem = '" . key($_SESSION['Shipment']->LineItems) . "'"; $result = DB_query($sql,$db); - $myrow = DB_fetch_row($result); + $myrow = DB_fetch_array($result); - $_SESSION['Shipment']->StockLocation = $myrow[0]; + $_SESSION['Shipment']->StockLocation = $myrow['intostocklocation']; $_POST['StockLocation']=$_SESSION['Shipment']->StockLocation; } else { Modified: trunk/Shippers.php =================================================================== --- trunk/Shippers.php 2012-02-15 16:41:19 UTC (rev 8515) +++ trunk/Shippers.php 2012-02-15 16:43:12 UTC (rev 8516) @@ -71,26 +71,26 @@ // PREVENT DELETES IF DEPENDENT RECORDS IN 'SalesOrders' - $sql= "SELECT COUNT(*) FROM salesorders WHERE salesorders.shipvia='".$SelectedShipper."'"; + $sql= "SELECT COUNT(orderno) AS totalorders FROM salesorders WHERE salesorders.shipvia='".$SelectedShipper."'"; $result = DB_query($sql,$db); - $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { + $myrow = DB_fetch_array($result); + if (DB_num_rows($result)>0) { $CancelDelete = 1; echo '<br />'; prnMsg( _('Cannot delete this shipper because sales orders have been created using this shipper') . '. ' . _('There are'). ' '. - $myrow[0] . ' '. _('sales orders using this shipper code'), 'error'); + $myrow['totalorders'] . ' '. _('sales orders using this shipper code'), 'error'); } else { // PREVENT DELETES IF DEPENDENT RECORDS IN 'DebtorTrans' - $sql= "SELECT COUNT(*) FROM debtortrans WHERE debtortrans.shipvia='".$SelectedShipper."'"; + $sql= "SELECT COUNT(debtorno) AS totaltrans FROM debtortrans WHERE debtortrans.shipvia='".$SelectedShipper."'"; $result = DB_query($sql,$db); - $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { + $myrow = DB_fetch_array($result); + if (DB_num_rows($result)>0) { $CancelDelete = 1; echo '<br />'; prnMsg( _('Cannot delete this shipper because invoices have been created using this shipping company') . '. ' . _('There are'). ' ' . - $myrow[0] . ' ' . _('invoices created using this shipping company'), 'error'); + $myrow['totaltrans'] . ' ' . _('invoices created using this shipping company'), 'error'); } else { // Prevent deletion if the selected shipping company is the current default shipping company in config.php !! if ($_SESSION['Default_Shipper']==$SelectedShipper) { Modified: trunk/SpecialOrder.php =================================================================== --- trunk/SpecialOrder.php 2012-02-15 16:41:19 UTC (rev 8515) +++ trunk/SpecialOrder.php 2012-02-15 16:43:12 UTC (rev 8516) @@ -397,11 +397,11 @@ $PartAlreadyExists =True; /*assume the worst */ $Counter = 0; - While ($PartAlreadyExists==True) { - $sql = "SELECT COUNT(*) FROM stockmaster WHERE stockid = '" . $PartCode . "'"; + while ($PartAlreadyExists==True) { + $sql = "SELECT stockid FROM stockmaster WHERE stockid = '" . $PartCode . "'"; $PartCountResult = DB_query($sql,$db); - $PartCount = DB_fetch_row($PartCountResult); - if ($PartCount[0]!=0){ + + if (DB_num_rows($PartCountResult)!=0){ $PartAlreadyExists =True; if (mb_strlen($PartCode)==20){ $PartCode = '*' . mb_strtoupper(mb_substr($_SESSION['SPL'.$identifier]->PurchOrderNo,0,13)) . '_' . $SPLLine->LineNo; @@ -444,8 +444,8 @@ $DbgMsg = _('The SQL statement used to get the category information and that failed was'); $result =DB_query($sql,$db,$ErrMsg,$DbgMsg,true); - $StkCatGL=DB_fetch_row($result); - $GLCode = $StkCatGL[0]; + $StkCatGL=DB_fetch_array($result); + $GLCode = $StkCatGL['stockact']; $OrderDate = FormatDateForSQL($SPLLine->ReqDelDate); Modified: trunk/StockAdjustments.php =================================================================== --- trunk/StockAdjustments.php 2012-02-15 16:41:19 UTC (rev 8515) +++ trunk/StockAdjustments.php 2012-02-15 16:43:12 UTC (rev 8516) @@ -60,16 +60,16 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Dispatch') . '" alt="" />' . ' ' . _('Select Item to Adjust') . '</p>'; if (mb_strlen($_POST['StockText'])>0) { - $sql="SELECT stockid, description from stockmaster where description like '%".$_POST['StockText']."%'"; + $sql="SELECT stockid, description FROM stockmaster WHERE description LIKE '%".$_POST['StockText']."%'"; } else { - $sql="SELECT stockid, description from stockmaster where stockid like '%".$_POST['StockCode']."%'"; + $sql="SELECT stockid, description FROM stockmaster WHERE stockid LIKE '%".$_POST['StockCode']."%'"; } $ErrMsg=_('The stock information cannot be retrieved because'); $DbgMsg=_('The SQL to get the stock description was'); $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="StockAdjustments.php?StockID='.$myrow[0].'&Description='.$myrow[1].'">'._('Adjust').'</a></tr>'; + while ($myrow = DB_fetch_array($result)) { + echo '<tr><td>'.$myrow['stockid'].'</td><td>'.$myrow['description'].'</td><td><a href="StockAdjustments.php?StockID='.$myrow['stockid'].'&Description='.$myrow['description'].'">'._('Adjust').'</a></tr>'; } echo '</table>'; include('includes/footer.inc'); @@ -123,8 +123,8 @@ AND loccode= '" . $_SESSION['Adjustment']->StockLocation . "'"; $Result = DB_query($SQL, $db); if (DB_num_rows($Result)==1){ - $LocQtyRow = DB_fetch_row($Result); - $QtyOnHandPrior = $LocQtyRow[0]; + $LocQtyRow = DB_fetch_array($Result); + $QtyOnHandPrior = $LocQtyRow['quantity']; } else { // There must actually be some error this should never happen $QtyOnHandPrior = 0; @@ -169,7 +169,7 @@ The StockSerialMoves as well */ /*First need to check if the serial items already exists or not */ - $SQL = "SELECT COUNT(*) + $SQL = "SELECT stockid FROM stockserialitems WHERE stockid='" . $_SESSION['Adjustment']->StockID . "' @@ -177,9 +177,8 @@ AND serialno='" . $Item->BundleRef . "'"; $ErrMsg = _('Unable to determine if the serial item exists'); $Result = DB_query($SQL,$db,$ErrMsg); - $SerialItemExistsRow = DB_fetch_row($Result); - if ($SerialItemExistsRow[0]==1){ + if (DB_num_rows($Result)==1){ $SQL = "UPDATE stockserialitems SET quantity= quantity + " . $Item->BundleQty . " Modified: trunk/StockCategories.php =================================================================== --- trunk/StockCategories.php 2012-02-15 16:41:19 UTC (rev 8515) +++ trunk/StockCategories.php 2012-02-15 16:43:12 UTC (rev 8516) @@ -179,24 +179,24 @@ // PREVENT DELETES IF DEPENDENT RECORDS IN 'StockMaster' - $sql= "SELECT COUNT(*) FROM stockmaster WHERE stockmaster.categoryid='$SelectedCategory'"; + $sql= "SELECT stockid FROM stockmaster WHERE stockmaster.categoryid='$SelectedCategory'"; $result = DB_query($sql,$db); - $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { + + if (DB_num_rows($result)>0) { prnMsg(_('Cannot delete this stock category because stock items have been created using this stock category') . '<br /> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('items referring to this stock category code'),'warn'); } else { - $sql = "SELECT COUNT(*) FROM salesglpostings WHERE stkcat='$SelectedCategory'"; + $sql = "SELECT stkcat FROM salesglpostings WHERE stkcat='$SelectedCategory'"; $result = DB_query($sql,$db); - $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { + + if (DB_num_rows($result)>0) prnMsg(_('Cannot delete this stock category because it is used by the sales') . ' - ' . _('GL posting interface') . '. ' . _('Delete any records in the Sales GL Interface set up using this stock category first'),'warn'); } else { - $sql = "SELECT COUNT(*) FROM cogsglpostings WHERE stkcat='$SelectedCategory'"; + $sql = "SELECT stkcat FROM cogsglpostings WHERE stkcat='$SelectedCategory'"; $result = DB_query($sql,$db); - $myrow = DB_fetch_row($result); - if ($myrow[0]>0) { + + if (DB_num_rows($result)>0) prnMsg(_('Cannot delete this stock category because it is used by the cost of sales') . ' - ' . _('GL pos... [truncated message content] |