From: <dai...@us...> - 2010-08-15 09:22:17
|
Revision: 3692 http://web-erp.svn.sourceforge.net/web-erp/?rev=3692&view=rev Author: daintree Date: 2010-08-15 09:22:08 +0000 (Sun, 15 Aug 2010) Log Message: ----------- Contract costing work Modified Paths: -------------- trunk/Contracts.php trunk/SelectContract.php trunk/WWW_Users.php trunk/WorkOrderIssue.php trunk/doc/Change.log.html trunk/index.php trunk/sql/mysql/upgrade3.11.1-3.12.sql Added Paths: ----------- trunk/ContractCosting.php trunk/includes/Contract_Readin.php Added: trunk/ContractCosting.php =================================================================== --- trunk/ContractCosting.php (rev 0) +++ trunk/ContractCosting.php 2010-08-15 09:22:08 UTC (rev 3692) @@ -0,0 +1,190 @@ +<?php + +/* $Id: $*/ + +$PageSecurity = 6; +include('includes/DefineContractClass.php'); +include('includes/session.inc'); +$title = _('Contract Costing'); +/* Session started in header.inc for password checking and authorisation level check */ +include('includes/header.inc'); + + +if (empty($_GET['identifier'])) { + $identifier=date('U'); +} else { + $identifier=$_GET['identifier']; +} + +if (!isset($_GET['SelectedContract'])){ + echo '<br>'; + prnMsg( _('This page is expected to be called with the contract reference to show the costing for'), 'error'); + include ('includes/footer.inc'); + exit; +} else { + $ContractRef = $_GET['SelectedContract']; + $_SESSION['Contract'.$identifier] = new Contract; + include('includes/Contract_Readin.php'); +} + +/*Now read in actual usage of stock */ +$sql = "SELECT stockmoves.stockid, + stockmaster.description, + stockmaster.units, + SUM(stockmoves.qty) AS quantity, + SUM(stockmoves.qty*stockmoves.standardcost) AS totalcost + FROM stockmoves INNER JOIN stockmaster + ON stockmoves.stockid=stockmaster.stockid + WHERE stockmoves.type=28 + AND stockmoves.reference='" . $_SESSION['Contract'.$identifier]->WO . "' + GROUP BY stockmoves.stockid, + stockmaster.description, + stockmaster.units"; +$ErrMsg = _('Could not get the inventory issues for this contract because'); +$InventoryIssuesResult = DB_query($sql,$db,$ErrMsg); +$InventoryIssues = array(); +while ($InventoryIssuesRow = DB_fetch_array($InventoryIssuesResult)){ + $InventoryIssues[$InventoryIssuesRow['stockid']]->StockID = $InventoryIssuesRow['stockid']; + $InventoryIssues[$InventoryIssuesRow['stockid']]->Description = $InventoryIssuesRow['description']; + $InventoryIssues[$InventoryIssuesRow['stockid']]->Quantity = $InventoryIssuesRow['quantity']; + $InventoryIssues[$InventoryIssuesRow['stockid']]->TotalCost = $InventoryIssuesRow['totalcost']; + $InventoryIssues[$InventoryIssuesRow['stockid']]->Units = $InventoryIssuesRow['units']; + $InventoryIssues[$InventoryIssuesRow['stockid']]->Matched = 0; +} + +echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/contract.png" title="' . _('Contract') . '" alt=""> + ' . $_SESSION['Contract'.$identifier]->CustomerName . '<br>' . $_SESSION['Contract'.$identifier]->ContractDescription; + +echo '<table> + <tr> + <th colspan=6>' . _('Original Costing') .'</th> + <th colspan=6>' . _('Actual Costs') .'</th></tr> + <tr>'; + +echo '<tr><th colspan=12>' . _('Inventory Required') . '</th></tr>'; + +echo '<tr><th>' . _('Item Code') . '</th> + <th>' . _('Item Description') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Unit') . '</th> + <th>' . _('Unit Cost') . '</th> + <th>' . _('Total Cost') . '</th> + <th>' . _('Item Code') . '</th> + <th>' . _('Item Description') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Unit') . '</th> + <th>' . _('Unit Cost') . '</th> + <th>' . _('Total Cost') . '</th> + </tr>'; +$ContractBOMBudget =0; +$ContractBOMActual = 0; +foreach ($_SESSION['Contract'.$identifier]->ContractBOM as $Component) { + echo '<tr><td>' . $Component->StockID . '</td> + <td>' . $Component->ItemDescription . '</td> + <td class="number">' . $Component->Quantity . '</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>'; + $ContractBOMBudget += ($Component->ItemCost * $Component->Quantity); + if (isset($InventoryIssues[$Component->StockID])){ + $InventoryIssues[$Component->StockID]->Matched=1; + echo '<td colspan=2 align="centre">' . _('Actual usage') . '</td> + <td class="number">' . -$InventoryIssues[$Component->StockID]->Quantity . '</td> + <td>' . $InventoryIssues[$Component->StockID]->Units . '</td> + <td class="number">' . number_format($InventoryIssues[$Component->StockID]->TotalCost/$InventoryIssues[$Component->StockID]->Quantity,2) . '</td> + <td>' . number_format(-$InventoryIssues[$Component->StockID]->TotalCost,2) . '</td></tr>'; + } else { + echo '<td colspan="6"></td></tr>'; + } +} + +foreach ($InventoryIssues as $Component) { //actual inventory components used + $ContractBOMActual -=$Component->TotalCost; + if ($Component->Matched == 0) { //then its a component that wasn't budget for + echo '<tr><td colspan="6"></td> + <td>' . $Component->StockID . '</td> + <td>' . $Component->Description . '</td> + <td class="number">' . -$Component->Quantity . '</td> + <td>' . $Component->Units . '</td> + <td class="number">' . number_format($Component->TotalCost/$Component->Quantity,2) . '</td> + <td class="number">' . number_format(-$Component->TotalCost,2) . '</td></tr>'; + } //end if its a component not originally budget for +} + +echo '<tr><td class="number" colspan="5">' . _('Total Inventory Budgeted Cost') . ':</td> + <td class="number">' . number_format($ContractBOMBudget,2) . '</td> + <td class="number" colspan="5">' . _('Total Inventory Actual Cost') . ':</td> + <td class="number">' . number_format($ContractBOMActual,2) . '</td></tr>'; + +echo '<tr><th colspan="12" align="center">' . _('Other Costs') . '</th></tr>'; + +$OtherReqtsBudget = 0; +//other requirements budget sub-table +echo '<tr><td colspan=6><table> + <tr><th>' . _('Requirement') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Unit Cost') . '</th> + <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> + </tr>'; + $OtherReqtsBudget += ($Requirement->CostPerUnit * $Requirement->Quantity); +} +echo '<tr><th colspan="3" align="right"><b>' . _('Budgeted Other Costs') . '</b></th><th class="number"><b>' . number_format($OtherReqtsBudget,2) . '</b></th></tr> + </table></td>'; + +//Now other requirements actual in a sub table +echo '<td colspan="6"><table> + <tr><th>' . _('Supplier') . '</th> + <th>' . _('Reference') . '</th> + <th>' . _('Date') . '</th> + <th>' . _('Requirement') . '</th> + <th>' . _('Total Cost') . '</th> + <th>' . _('Anticipated') . '</th> + </tr>'; + +/*Now read in the actual other items charged to the contract */ +$sql = "SELECT supptrans.supplierno, + supptrans.suppreference, + supptrans.trandate, + contractcharges.amount, + contractcharges.narrative, + contractcharges.anticipated + FROM supptrans INNER JOIN contractcharges + ON supptrans.type=contractcharges.transtype + AND supptrans.transno=contractcharges.transno + WHERE contractcharges.contractref='" . $ContractRef . "' + ORDER BY contractcharges.anticipated"; +$ErrMsg = _('Could not get the other charges to the contract because'); +$OtherChargesResult = DB_query($sql,$db,$ErrMsg); +$OtherReqtsActual =0; +while ($OtherChargesRow=DB_fetch_array($OtherChargesResult)) { + if ($OtherChargesRow['anticipated']==0){ + $Anticipated = _('No'); + } else { + $Anticipated = _('Yes'); + } + echo '<tr><td>' . $OtherChargesRow['supplierno'] . '</td> + <td>' . $OtherChargesRow['suppreference'] . '</td> + <td>' .ConvertSQLDate($OtherChargesRow['trandate']) . '</td> + <td>' . $OtherChargesRow['narrative'] . '</td> + <td class="number">' . number_format($OtherChargesRow['amount'],2) . '</td> + <td>' . $Anticipated . '</td> + </tr>'; + $OtherReqtsActual +=$OtherChargesRow['amount']; +} +echo '<tr><th colspan="4" align="right"><b>' . _('Actual Other Costs') . '</b></th><th class="number"><b>' . number_format($OtherReqtsActual,2) . '</b></th></tr> + </table></td></tr>'; +echo '<tr><td colspan="5"><b>' . _('Total Budget Contract Cost') . '</b></td> + <td class="number"><b>' . number_format($OtherReqtsBudget+$ContractBOMBudget,2) . '</b></td> + <td colspan="5"><b>' . _('Total Actual Contract Cost') . '</b></td> + <td class="number"><b>' . number_format($OtherReqtsActual+$ContractBOMActual,2) . '</b></td></tr>'; + +echo '</table>'; + +include('includes/footer.inc'); +?> Modified: trunk/Contracts.php =================================================================== --- trunk/Contracts.php 2010-08-14 10:03:42 UTC (rev 3691) +++ trunk/Contracts.php 2010-08-15 09:22:08 UTC (rev 3692) @@ -152,103 +152,9 @@ $_SESSION['Contract'.$identifier] = new Contract; /*read in all the guff from the selected contract into the contract Class variable */ - - $ContractHeaderSQL = "SELECT contractdescription, - contracts.debtorno, - contracts.branchcode, - status, - categoryid, - orderno, - margin, - wo, - requireddate, - drawing, - exrate, - debtorsmaster.name, - custbranch.brname, - debtorsmaster.currcode - FROM contracts INNER JOIN debtorsmaster - ON contracts.debtorno=debtorsmaster.debtorno - INNER JOIN currencies - ON debtorsmaster.currcode=currencies.currabrev - INNER JOIN custbranch - ON debtorsmaster.debtorno=custbranch.debtorno - WHERE contractref= '" . $_GET['ModifyContractRef'] . "'"; - - $ErrMsg = _('The contract cannot be retrieved because'); - $DbgMsg = _('The SQL statement that was used and failed was'); - $ContractHdrResult = DB_query($ContractHeaderSQL,$db,$ErrMsg,$DbgMsg); - - if (DB_num_rows($ContractHdrResult)==1 and !isset($_SESSION['Contract'.$identifier]->ContractRef )) { - - $myrow = DB_fetch_array($ContractHdrResult); - $_SESSION['Contract'.$identifier]->ContractRef = $_GET['ModifyContractRef']; - $_SESSION['Contract'.$identifier]->ContractDescription = $myrow['contractdescription']; - $_SESSION['Contract'.$identifier]->DebtorNo = $myrow['debtorno']; - $_SESSION['Contract'.$identifier]->BranchCode = $myrow['branchcode']; - $_SESSION['Contract'.$identifier]->Status = $myrow['status']; - $_SESSION['Contract'.$identifier]->CategoryID = $myrow['categoryid']; - $_SESSION['Contract'.$identifier]->OrderNo = $myrow['orderno']; - $_SESSION['Contract'.$identifier]->Margin = $myrow['margin']; - $_SESSION['Contract'.$identifier]->WO = $myrow['wo']; - $_SESSION['Contract'.$identifier]->RequiredDate = ConvertSQLDate($myrow['requireddate']); - $_SESSION['Contract'.$identifier]->Drawing = $myrow['drawing']; - $_SESSION['Contract'.$identifier]->ExRate = $myrow['exrate']; - $_SESSION['Contract'.$identifier]->BranchName = $myrow['brname']; - $_SESSION['RequireCustomerSelection'] = 0; - $_SESSION['Contract'.$identifier]->CustomerName = $myrow['name']; - $_SESSION['Contract'.$identifier]->CurrCode = $myrow['currcode']; + $ContractRef = $_GET['ModifyContractRef']; + include('includes/Contract_Readin.php'); - -/*now populate the contract BOM array with the items required for the contract */ - - $ContractBOMsql = "SELECT contractbom.stockid, - stockmaster.description, - contractbom.workcentreadded, - contractbom.quantity, - stockmaster.units, - stockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost AS cost - FROM contractbom INNER JOIN stockmaster - ON contractbom.stockid=stockmaster.stockid - WHERE contractref ='" . $_GET['ModifyContractRef'] . "'"; - - $ErrMsg = _('The bill of material cannot be retrieved because'); - $DbgMsg = _('The SQL statement that was used to retrieve the contract bill of material was'); - $ContractBOMResult = db_query($ContractBOMsql,$db,$ErrMsg,$DbgMsg); - - if (db_num_rows($ContractBOMResult) > 0) { - while ($myrow=db_fetch_array($ContractBOMResult)) { - $_SESSION['Contract'.$identifier]->Add_To_ContractBOM($myrow['stockid'], - $myrow['description'], - $myrow['workcentreadded'], - $myrow['quantity'], - $myrow['cost'], - $myrow['units']); - } /* add contract bill of materials BOM lines*/ - } //end is there was a contract BOM to add - //Now add the contract requirments - $ContractReqtsSQL = "SELECT requirement, - quantity, - costperunit, - contractreqid - FROM contractreqts - WHERE contractref ='" . $_GET['ModifyContractRef'] . "' - ORDER BY contractreqid"; - - $ErrMsg = _('The other contract requirementscannot be retrieved because'); - $DbgMsg = _('The SQL statement that was used to retrieve the other contract requirments was'); - $ContractReqtsResult = db_query($ContractReqtsSQL,$db,$ErrMsg,$DbgMsg); - - if (db_num_rows($ContractReqtsResult) > 0) { - while ($myrow=db_fetch_array($ContractReqtsResult)) { - $_SESSION['Contract'.$identifier]->Add_To_ContractRequirements($myrow['requirement'], - $myrow['quantity'], - $myrow['costperunit'], - $myrow['contractreqid']); - } /* add other contract requirments lines*/ - } //end is there are contract other contract requirments to add - } // end if there was a header for the contract - }// its an existing contract to readin if (isset($_POST['CancelContract'])) { Modified: trunk/SelectContract.php =================================================================== --- trunk/SelectContract.php 2010-08-14 10:03:42 UTC (rev 3691) +++ trunk/SelectContract.php 2010-08-15 09:22:08 UTC (rev 3692) @@ -15,17 +15,25 @@ echo '<p><div class="centre">'; -if (isset($_REQUEST['ContractRef']) AND $_REQUEST['ContractRef']!='') { - $_REQUEST['ContractRef'] = trim($_REQUEST['ContractRef']); - echo _('Contract Reference') . ' - ' . $_REQUEST['ContractRef']; +if (isset($_GET['ContractRef'])){ + $_POST['ContractRef']=$_GET['ContractRef']; +} +if (isset($_GET['SelectedCustomer'])){ + $_POST['SelectedCustomer']=$_GET['SelectedCustomer']; +} + + +if (isset($_POST['ContractRef']) AND $_POST['ContractRef']!='') { + $_POST['ContractRef'] = trim($_POST['ContractRef']); + echo _('Contract Reference') . ' - ' . $_POST['ContractRef']; } else { - if (isset($_REQUEST['SelectedCustomer'])) { - echo _('For customer') . ': ' . $_REQUEST['SelectedCustomer'] . ' ' . _('and') . ' '; - echo '<input type="hidden" name="SelectedCustomer" value="' . $_REQUEST['SelectedCustomer'] . '">'; + if (isset($_POST['SelectedCustomer'])) { + echo _('For customer') . ': ' . $_POST['SelectedCustomer'] . ' ' . _('and') . ' '; + echo '<input type="hidden" name="SelectedCustomer" value="' . $_POST['SelectedCustomer'] . '">'; } } -if (!isset($_REQUEST['ContractRef']) or $_REQUEST['ContractRef']==''){ +if (!isset($_POST['ContractRef']) or $_POST['ContractRef']==''){ echo _('Contract Reference') . ': <input type="text" name="ContractRef" maxlength=20 size=20>  '; echo '<select name="Status">'; @@ -75,7 +83,7 @@ //figure out the SQL required from the inputs available -if (isset($_REQUEST['ContractRef']) AND $_REQUEST['ContractRef'] !='') { +if (isset($_POST['ContractRef']) AND $_POST['ContractRef'] !='') { $SQL = "SELECT contractref, contractdescription, categoryid, @@ -89,10 +97,10 @@ requireddate FROM contracts INNER JOIN debtorsmaster ON contracts.debtorno = debtorsmaster.debtorno - WHERE contractref='". $_REQUEST['ContractRef'] ."'"; + WHERE contractref " . LIKE . " '%" . $_POST['ContractRef'] ."%'"; } else { //contractref not selected - if (isset($_REQUEST['SelectedCustomer'])) { + if (isset($_POST['SelectedCustomer'])) { $SQL = "SELECT contractref, contractdescription, @@ -107,7 +115,7 @@ requireddate FROM contracts INNER JOIN debtorsmaster ON contracts.debtorno = debtorsmaster.debtorno - WHERE debtorno='". $_REQUEST['SelectedCustomer'] ."'"; + WHERE debtorno='". $_POST['SelectedCustomer'] ."'"; if ($_POST['Status']!=4){ $SQL .= " AND status='" . $_POST['Status'] . "'"; } @@ -142,6 +150,7 @@ <th>' . _('Modify') . '</th> <th>' . _('Order') . '</th> <th>' . _('Issue To WO') . '</th> + <th>' . _('Costing') . '</th> <th>' . _('Contract Ref') . '</th> <th>' . _('Description') . '</th> <th>' . _('Customer') . '</th> @@ -163,7 +172,8 @@ $ModifyPage = $rootpath . '/Contracts.php?' . SID . '&ModifyContractRef=' . $myrow['contractref']; $OrderModifyPage = $rootpath . '/SelectOrderItems.php?' . SID . '&ModifyOrderNumber=' . $myrow['orderno']; - $IssueToWOPage = $rootpath . '/WOIssue.php?' . SID . '&WO=' . $myrow['wo']; + $IssueToWOPage = $rootpath . '/WorkOrderIssue.php?' . SID . '&WO=' . $myrow['wo'] . '&StockID=' . $myrow['contractref']; + $CostingPage = $rootpath . '/ContractCosting.php?' . SID . '&SelectedContract=' . $myrow['contractref']; $FormatedRequiredDate = ConvertSQLDate($myrow['requireddate']); if ($myrow['status']==0 OR $myrow['status']==1){ //still setting up the contract @@ -177,9 +187,11 @@ echo '<td>' . _('n/a') . '</td>'; } if ($myrow['status']==2){ //the customer has accepted the quote but not completed contract yet - echo '<td><a href="' . $IssueToWOPage . '">' . $myrow['wo'] . '</a></td>'; + echo '<td><a href="' . $IssueToWOPage . '">' . $myrow['wo'] . '</a></td> + <td><a href="' . $CostingPage . '">' . _('View') . '<a></td>'; } else { - echo '<td>' . _('n/a') . '</td>'; + echo '<td>' . _('n/a') . '</td> + <td>' . _('n/a') . '</td>'; } echo '<td>' . $myrow['contractref'] . '</td> <td>' . $myrow['contractdescription'] . '</td> Modified: trunk/WWW_Users.php =================================================================== --- trunk/WWW_Users.php 2010-08-14 10:03:42 UTC (rev 3691) +++ trunk/WWW_Users.php 2010-08-15 09:22:08 UTC (rev 3692) @@ -17,7 +17,6 @@ _('Purchasing'), _('Inventory'), _('Manufacturing'), - _('Contracts'), _('General Ledger'), _('Asset Manager'), _('Petty Cash'), Modified: trunk/WorkOrderIssue.php =================================================================== --- trunk/WorkOrderIssue.php 2010-08-14 10:03:42 UTC (rev 3691) +++ trunk/WorkOrderIssue.php 2010-08-15 09:22:08 UTC (rev 3692) @@ -8,23 +8,29 @@ include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); +if (isset($_GET['WO'])){ + $_POST['WO']=$_GET['WO']; +} +if (isset($_GET['StockID'])){ + $_POST['StockID']=$_GET['StockID']; +} + echo '<a href="'. $rootpath . '/SelectWorkOrder.php?' . SID . '">' . _('Back to Work Orders'). '</a><br>'; -echo '<a href="'. $rootpath . '/WorkOrderCosting.php?' . SID . '&WO=' . $_REQUEST['WO'] . '">' . _('Back to Costing'). '</a><br>'; +echo '<a href="'. $rootpath . '/WorkOrderCosting.php?' . SID . '&WO=' . $_POST['WO'] . '">' . _('Back to Costing'). '</a><br>'; echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; -if (!isset($_REQUEST['WO']) OR !isset($_REQUEST['StockID'])) { - /* This page can only be called with a purchase order number for invoicing*/ + +if (!isset($_POST['WO']) OR !isset($_POST['StockID'])) { + /* This page can only be called with a work order number for issuing stock to*/ echo '<div class="centre"><a href="' . $rootpath . '/SelectWorkOrder.php?' . SID . '">'. _('Select a work order to issue materials to').'</a></div>'; prnMsg(_('This page can only be opened if a work order has been selected. Please select a work order to issue materials to first'),'info'); include ('includes/footer.inc'); exit; } else { - echo '<input type="hidden" name="WO" value=' .$_REQUEST['WO'] . '>'; - $_POST['WO']=$_REQUEST['WO']; - echo '<input type="hidden" name="StockID" value=' .$_REQUEST['StockID'] . '>'; - $_POST['StockID']=$_REQUEST['StockID']; + echo '<input type="hidden" name="WO" value=' .$_POST['WO'] . '>'; + echo '<input type="hidden" name="StockID" value=' .$_POST['StockID'] . '>'; } if (isset($_GET['IssueItem'])){ $_POST['IssueItem']=$_GET['IssueItem']; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-08-14 10:03:42 UTC (rev 3691) +++ trunk/doc/Change.log.html 2010-08-15 09:22:08 UTC (rev 3692) @@ -1,5 +1,7 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>15/08/10 Phil: Decided to have contracts as part of orders module since not really enough links to warrant a new module changes to index.php WWW_Users.php and sql upgrade. +<p>15/08/10 Phil: New script for ContractCosting.php comparison of contract costs budgeted vs incurred. Lot of work on contracts <p>13/08/10 Phil: DefineSuppTransClass.php SupplierInvoice.php and SupplierCredit.php now allow entry of contract charges. New script for SuppContractChgs.php <p>13/08/10 Phil: Fixes to show creditors transactions correctly in GLTransInquiry.php signs mixed up and period not shown previously <p>10/08/10 Russell (Regal Prods): Fix SelectOrderItems.php width of narrative box was making screen unusable!! Added: trunk/includes/Contract_Readin.php =================================================================== --- trunk/includes/Contract_Readin.php (rev 0) +++ trunk/includes/Contract_Readin.php 2010-08-15 09:22:08 UTC (rev 3692) @@ -0,0 +1,100 @@ +<?php +/* $Id: $ */ +/*Contract_Readin.php is used by the modify existing Contract in Contracts.php and also by ContractCosting.php */ + +$ContractHeaderSQL = "SELECT contractdescription, + contracts.debtorno, + contracts.branchcode, + status, + categoryid, + orderno, + margin, + wo, + requireddate, + drawing, + exrate, + debtorsmaster.name, + custbranch.brname, + debtorsmaster.currcode + FROM contracts INNER JOIN debtorsmaster + ON contracts.debtorno=debtorsmaster.debtorno + INNER JOIN currencies + ON debtorsmaster.currcode=currencies.currabrev + INNER JOIN custbranch + ON debtorsmaster.debtorno=custbranch.debtorno + WHERE contractref= '" . $ContractRef . "'"; + +$ErrMsg = _('The contract cannot be retrieved because'); +$DbgMsg = _('The SQL statement that was used and failed was'); +$ContractHdrResult = DB_query($ContractHeaderSQL,$db,$ErrMsg,$DbgMsg); + +if (DB_num_rows($ContractHdrResult)==1 and !isset($_SESSION['Contract'.$identifier]->ContractRef )) { + + $myrow = DB_fetch_array($ContractHdrResult); + $_SESSION['Contract'.$identifier]->ContractRef = $ContractRef; + $_SESSION['Contract'.$identifier]->ContractDescription = $myrow['contractdescription']; + $_SESSION['Contract'.$identifier]->DebtorNo = $myrow['debtorno']; + $_SESSION['Contract'.$identifier]->BranchCode = $myrow['branchcode']; + $_SESSION['Contract'.$identifier]->Status = $myrow['status']; + $_SESSION['Contract'.$identifier]->CategoryID = $myrow['categoryid']; + $_SESSION['Contract'.$identifier]->OrderNo = $myrow['orderno']; + $_SESSION['Contract'.$identifier]->Margin = $myrow['margin']; + $_SESSION['Contract'.$identifier]->WO = $myrow['wo']; + $_SESSION['Contract'.$identifier]->RequiredDate = ConvertSQLDate($myrow['requireddate']); + $_SESSION['Contract'.$identifier]->Drawing = $myrow['drawing']; + $_SESSION['Contract'.$identifier]->ExRate = $myrow['exrate']; + $_SESSION['Contract'.$identifier]->BranchName = $myrow['brname']; + $_SESSION['RequireCustomerSelection'] = 0; + $_SESSION['Contract'.$identifier]->CustomerName = $myrow['name']; + $_SESSION['Contract'.$identifier]->CurrCode = $myrow['currcode']; + + +/*now populate the contract BOM array with the items required for the contract */ + + $ContractBOMsql = "SELECT contractbom.stockid, + stockmaster.description, + contractbom.workcentreadded, + contractbom.quantity, + stockmaster.units, + stockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost AS cost + FROM contractbom INNER JOIN stockmaster + ON contractbom.stockid=stockmaster.stockid + WHERE contractref ='" . $ContractRef . "'"; + + $ErrMsg = _('The bill of material cannot be retrieved because'); + $DbgMsg = _('The SQL statement that was used to retrieve the contract bill of material was'); + $ContractBOMResult = db_query($ContractBOMsql,$db,$ErrMsg,$DbgMsg); + + if (DB_num_rows($ContractBOMResult) > 0) { + while ($myrow=db_fetch_array($ContractBOMResult)) { + $_SESSION['Contract'.$identifier]->Add_To_ContractBOM($myrow['stockid'], + $myrow['description'], + $myrow['workcentreadded'], + $myrow['quantity'], + $myrow['cost'], + $myrow['units']); + } /* add contract bill of materials BOM lines*/ + } //end is there was a contract BOM to add + //Now add the contract requirments + $ContractReqtsSQL = "SELECT requirement, + quantity, + costperunit, + contractreqid + FROM contractreqts + WHERE contractref ='" . $ContractRef . "' + ORDER BY contractreqid"; + + $ErrMsg = _('The other contract requirementscannot be retrieved because'); + $DbgMsg = _('The SQL statement that was used to retrieve the other contract requirments was'); + $ContractReqtsResult = db_query($ContractReqtsSQL,$db,$ErrMsg,$DbgMsg); + + if (DB_num_rows($ContractReqtsResult) > 0) { + while ($myrow=db_fetch_array($ContractReqtsResult)) { + $_SESSION['Contract'.$identifier]->Add_To_ContractRequirements($myrow['requirement'], + $myrow['quantity'], + $myrow['costperunit'], + $myrow['contractreqid']); + } /* add other contract requirments lines*/ + } //end is there are contract other contract requirments to add +} // end if there was a header for the contract +?> \ No newline at end of file Modified: trunk/index.php =================================================================== --- trunk/index.php 2010-08-14 10:03:42 UTC (rev 3691) +++ trunk/index.php 2010-08-15 09:22:08 UTC (rev 3692) @@ -10,7 +10,7 @@ $title=_('Main Menu'); /*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', 'Contracts', 'GL', 'FA', 'PC', 'system'); +$ModuleLink = array('orders', 'AR', 'AP', 'PO', 'stock', 'manuf', 'GL', 'FA', 'PC', 'system'); /*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'), @@ -18,7 +18,6 @@ _('Purchases'), _('Inventory'), _('Manufacturing'), - _('Contracts'), _('General Ledger'), _('Asset Manager'), _('Petty Cash'), @@ -42,17 +41,17 @@ <table class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CustomerInquiry.php?' . sid . '&CustomerID=' . $_SESSION['CustomerID'] . '">' . _('Account Status') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/CustomerInquiry.php?' . SID . '&CustomerID=' . $_SESSION['CustomerID'] . '">' . _('Account Status') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectOrderItems.php?' . sid . '&NewOrder=Yes">' . _('Place An Order') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectOrderItems.php?' . SID . '&NewOrder=Yes">' . _('Place An Order') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectCompletedOrder.php?' . sid . '&SelectedCustomer=' . $_SESSION['CustomerID'] . '">' . _('Order Status') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectCompletedOrder.php?' . SID . '&SelectedCustomer=' . $_SESSION['CustomerID'] . '">' . _('Order Status') . '</a></p>'; ?> </td> </tr> </table> @@ -68,7 +67,7 @@ <table class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SupplierTenders.php?' . sid . '">' . _('Supplier Tenders') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SupplierTenders.php?' . SID . '">' . _('Supplier Tenders') . '</a></p>'; ?> </td> </tr> </table> @@ -96,9 +95,9 @@ $_SESSION['Module']=$ModuleLink[$i]; } if ($ModuleLink[$i] == $_SESSION['Module']){ - echo '<tr><td class="main_menu_selected"><a href="' . $_SERVER['PHP_SELF'] . '?' . sid . '&Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td></tr>'; + echo '<tr><td class="main_menu_selected"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td></tr>'; } else { - echo '<tr><td class="main_menu_unselected"><a href="' . $_SERVER['PHP_SELF'] . '?' . sid . '&Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td></tr>'; + echo '<tr><td class="main_menu_unselected"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td></tr>'; } } $i++; @@ -144,7 +143,7 @@ </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectSalesOrder.php?' . sid . '">' . _('Outstanding Sales Orders/Quotations') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectSalesOrder.php?' . SID . '">' . _('Outstanding Sales Orders/Quotations') . '</a></p>'; ?> </td> </tr> <tr> @@ -168,52 +167,52 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectCompletedOrder.php?' . sid . '">' . _('Order Inquiry') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectCompletedOrder.php?' . SID . '">' . _('Order Inquiry') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFPriceList.php?' . sid . '">' . _('Print Price Lists') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFPriceList.php?' . SID . '">' . _('Print Price Lists') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFOrderStatus.php?' . sid . '">' . _('Order Status Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFOrderStatus.php?' . SID . '">' . _('Order Status Report') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFOrdersInvoiced.php?' . sid . '">' . _('Orders Invoiced Reports') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFOrdersInvoiced.php?' . SID . '">' . _('Orders Invoiced Reports') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/DailySalesInquiry.php?' . sid . '">' . _('Daily Sales Inquiry') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/DailySalesInquiry.php?' . SID . '">' . _('Daily Sales Inquiry') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFDeliveryDifferences.php?' . sid . '">' . _('Order Delivery Differences Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFDeliveryDifferences.php?' . SID . '">' . _('Order Delivery Differences Report') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFDIFOT.php?' . sid . '">' . _('Delivery In Full On Time (DIFOT) Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFDIFOT.php?' . SID . '">' . _('Delivery In Full On Time (DIFOT) Report') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesInquiry.php?' . sid . '">' . _('Sales Order Detail Or Summary Inquiries') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SalesInquiry.php?' . SID . '">' . _('Sales Order Detail Or Summary Inquiries') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/TopItems.php?' . sid . '">' . _('Top Sales Items Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/TopItems.php?' . SID . '">' . _('Top Sales Items Report') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFLowGP.php?' . sid . '">' . _('Sales With Low Gross Profit Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFLowGP.php?' . SID . '">' . _('Sales With Low Gross Profit Report') . '</a></p>'; ?> </td> </tr> <tr> @@ -227,10 +226,18 @@ <td class="menu_group_items"> <!-- Orders Maintenance options --> <table width="100%"> <tr> - <td> - - </td> + <td class="menu_group_items"> + <table width="100%" class="table_index"> + <tr> + <td class="menu_group_item"> + <?php echo '<p>• <a href="' . $rootpath . '/SelectContract.php?' . SID . '">' . _('Select Contract') . '</a></p>'; ?> + </td> </tr> + <tr> + <td class="menu_group_item"> + <?php echo '<p>• <a href="' . $rootpath . '/Contracts.php?' . SID . '">' . _('Create Contract') . '</a></p>'; ?> + </td> + </tr> </table> </td> </tr> @@ -261,7 +268,7 @@ <table width="100%"class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectSalesOrder.php?' . sid . '">' . _('Select Order to Invoice') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectSalesOrder.php?' . SID . '">' . _('Select Order to Invoice') . '</a></p>'; ?> </td> </tr> <tr> @@ -271,13 +278,13 @@ </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CustomerReceipt.php?' . sid . '&NewReceipt=Yes">' . _('Enter Receipts') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/CustomerReceipt.php?' . SID . '&NewReceipt=Yes">' . _('Enter Receipts') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CustomerAllocations.php?' . sid . '">' . _('Allocate Receipts or Credit Notes') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/CustomerAllocations.php?' . SID . '">' . _('Allocate Receipts or Credit Notes') . '</a></p>'; ?> </td> </tr> </table> @@ -286,68 +293,68 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectCustomer.php?' . sid . '">' . _('Customer Transaction Inquiries') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectCustomer.php?' . SID . '">' . _('Customer Transaction Inquiries') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CustWhereAlloc.php?' . sid . '">' . _('Where Allocated Inquiry') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/CustWhereAlloc.php?' . SID . '">' . _('Where Allocated Inquiry') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> <?php if ($_SESSION['InvoicePortraitFormat']==0){ - echo '<p>• <a href="' . $rootpath . '/PrintCustTrans.php?' . sid . '">' . _('Print Invoices or Credit Notes') . '</a></p>'; + echo '<p>• <a href="' . $rootpath . '/PrintCustTrans.php?' . SID . '">' . _('Print Invoices or Credit Notes') . '</a></p>'; } else { - echo '<p>• <a href="' . $rootpath . '/PrintCustTransPortrait.php?' . sid . '">' . _('Print Invoices or Credit Notes') . '</a></p>'; + echo '<p>• <a href="' . $rootpath . '/PrintCustTransPortrait.php?' . SID . '">' . _('Print Invoices or Credit Notes') . '</a></p>'; } ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PrintCustStatements.php?' . sid . '">' . _('Print Statements') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PrintCustStatements.php?' . SID . '">' . _('Print Statements') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesAnalRepts.php?' . sid . '">' . _('Sales Analysis Reports') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SalesAnalRepts.php?' . SID . '">' . _('Sales Analysis Reports') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/AgedDebtors.php?' . sid . '">' . _('Aged Customer Balances/Overdues Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/AgedDebtors.php?' . SID . '">' . _('Aged Customer Balances/Overdues Report') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CustomerTransInquiry.php?' . sid . '">' . _('Transaction Inquiries') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/CustomerTransInquiry.php?' . SID . '">' . _('Transaction Inquiries') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFBankingSummary.php?' . sid . '">' . _('Re-Print A Deposit Listing') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFBankingSummary.php?' . SID . '">' . _('Re-Print A Deposit Listing') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/DebtorsAtPeriodEnd.php?' . sid . '">' . _('Debtor Balances At A Prior Month End') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/DebtorsAtPeriodEnd.php?' . SID . '">' . _('Debtor Balances At A Prior Month End') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFCustomerList.php?' . sid . '">' . _('Customer Listing By Area/Salesperson') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFCustomerList.php?' . SID . '">' . _('Customer Listing By Area/Salesperson') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesGraph.php?' . sid . '">' . _('Sales Graphs') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SalesGraph.php?' . SID . '">' . _('Sales Graphs') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFCustTransListing.php?' . sid . '">' . _('List Daily Transactions') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFCustTransListing.php?' . SID . '">' . _('List Daily Transactions') . '</a></p>'; ?> </td> </tr> <tr> @@ -361,12 +368,12 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Customers.php?' . sid . '">' . _('Add Customer') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/Customers.php?' . SID . '">' . _('Add Customer') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectCustomer.php?' . sid . '">' . _('Customers') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectCustomer.php?' . SID . '">' . _('Customers') . '</a></p>'; ?> </td> </tr> </table> @@ -396,12 +403,12 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectSupplier.php?' . sid . '">' . _('Select Supplier') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectSupplier.php?' . SID . '">' . _('Select Supplier') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . "/SupplierAllocations.php?" . sid . '">' . _('Supplier Allocations') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . "/SupplierAllocations.php?" . SID . '">' . _('Supplier Allocations') . '</a></p>'; ?> </td> </tr> </table> @@ -410,32 +417,32 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/AgedSuppliers.php?' . sid . '">' . _('Aged Supplier Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/AgedSuppliers.php?' . SID . '">' . _('Aged Supplier Report') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SuppPaymentRun.php?' . sid . '">' . _('Payment Run Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SuppPaymentRun.php?' . SID . '">' . _('Payment Run Report') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFRemittanceAdvice.php?' . sid . '">' . _('Remittance Advices') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFRemittanceAdvice.php?' . SID . '">' . _('Remittance Advices') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/OutstandingGRNs.php?' . sid . '">' . _('Outstanding GRNs Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/OutstandingGRNs.php?' . SID . '">' . _('Outstanding GRNs Report') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SupplierBalsAtPeriodEnd.php?' . sid . '">' . _('Supplier Balances At A Prior Month End') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SupplierBalsAtPeriodEnd.php?' . SID . '">' . _('Supplier Balances At A Prior Month End') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFSuppTransListing.php?' . sid . '">' . _('List Daily Transactions') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFSuppTransListing.php?' . SID . '">' . _('List Daily Transactions') . '</a></p>'; ?> </td> </tr> <tr> @@ -449,12 +456,12 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Suppliers.php?' . sid . '">' . _('Add Supplier') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/Suppliers.php?' . SID . '">' . _('Add Supplier') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Factors.php?' . sid . '">' . _('Maintain Factor Companies') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/Factors.php?' . SID . '">' . _('Maintain Factor Companies') . '</a></p>'; ?> </td> </tr> </table> @@ -482,32 +489,32 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?' . sid . '">' . _('Purchase Orders') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?' . SID . '">' . _('Purchase Orders') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PO_Header.php?&NewOrder=Yes' . sid . '">' . _('Add Purchase Order') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PO_Header.php?&NewOrder=Yes' . SID . '">' . _('Add Purchase Order') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/OffersReceived.php?' . sid . '">' . _('Process Tenders and Offers') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/OffersReceived.php?' . SID . '">' . _('Process Tenders and Offers') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PO_AuthoriseMyOrders.php?' . sid . '">' . _('Orders to Authorise') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PO_AuthoriseMyOrders.php?' . SID . '">' . _('Orders to Authorise') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectSupplier.php?' . sid . '">' . _('Shipment Entry') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectSupplier.php?' . SID . '">' . _('Shipment Entry') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Shipt_Select.php?' . sid . '">' . _('Select A Shipment') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/Shipt_Select.php?' . SID . '">' . _('Select A Shipment') . '</a></p>'; ?> </td> </tr> </table> @@ -516,12 +523,12 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PO_SelectPurchOrder.php?' . sid . '">' . _('Purchase Order Inquiry') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PO_SelectPurchOrder.php?' . SID . '">' . _('Purchase Order Inquiry') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/POReport.php?' . sid . '">' . _('Purchase Order Detail Or Summary Inquiries') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/POReport.php?' . SID . '">' . _('Purchase Order Detail Or Summary Inquiries') . '</a></p>'; ?> </td> </tr> <tr> @@ -561,37 +568,37 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?' . sid . '">' . _('Receive Purchase Orders') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?' . SID . '">' . _('Receive Purchase Orders') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockLocTransfer.php' . sid . '">' . _('Bulk Inventory Transfer') . ' - ' . _('Dispatch') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockLocTransfer.php' . SID . '">' . _('Bulk Inventory Transfer') . ' - ' . _('Dispatch') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockLocTransferReceive.php?' . sid . '">' . _('Bulk Inventory Transfer') . ' - ' . _('Receive') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockLocTransferReceive.php?' . SID . '">' . _('Bulk Inventory Transfer') . ' - ' . _('Receive') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockTransfers.php?' . sid . '">' . _('Inventory Location Transfers') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockTransfers.php?' . SID . '">' . _('Inventory Location Transfers') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockAdjustments.php?NewAdjustment=Yes' . sid . '">' . _('Inventory Adjustments') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockAdjustments.php?NewAdjustment=Yes' . SID . '">' . _('Inventory Adjustments') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/ReverseGRN.php?' . sid . '">' . _('Reverse Goods Received') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/ReverseGRN.php?' . SID . '">' . _('Reverse Goods Received') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockCounts.php?' . sid . '">' . _('Enter Stock Counts') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockCounts.php?' . SID . '">' . _('Enter Stock Counts') . '</a></p>'; ?> </td> </tr> </table> @@ -600,87 +607,87 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . "/StockSerialItemResearch.php?" . sid . '">' . _('Serial Item Research Tool') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . "/StockSerialItemResearch.php?" . SID . '">' . _('Serial Item Research Tool') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . "/StockMovements.php?" . sid . '">' . _('Inventory Item Movements') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . "/StockMovements.php?" . SID . '">' . _('Inventory Item Movements') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockStatus.php?' . sid . '">' . _('Inventory Item Status') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockStatus.php?' . SID . '">' . _('Inventory Item Status') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockUsage.php?' . sid . '">' . _('Inventory Item Usage') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockUsage.php?' . SID . '">' . _('Inventory Item Usage') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/InventoryQuantities.php?' . sid . '">' . _('Inventory Quantities') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/InventoryQuantities.php?' . SID . '">' . _('Inventory Quantities') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/ReorderLevel.php?' . sid . '">' . _('Reorder Level') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/ReorderLevel.php?' . SID . '">' . _('Reorder Level') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockDispatch.php?' . sid . '">' . _('Stock Dispatch') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockDispatch.php?' . SID . '">' . _('Stock Dispatch') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/InventoryValuation.php?' . sid . '">' . _('Inventory Valuation Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/InventoryValuation.php?' . SID . '">' . _('Inventory Valuation Report') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/InventoryPlanning.php?' . sid . '">' . _('Inventory Planning Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/InventoryPlanning.php?' . SID . '">' . _('Inventory Planning Report') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/InventoryPlanningPrefSupplier.php?' . sid . '">' . _('Inventory Planning Based On Preferred Supplier Data') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/InventoryPlanningPrefSupplier.php?' . SID . '">' . _('Inventory Planning Based On Preferred Supplier Data') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockCheck.php?' . sid . '">' . _('Inventory Stock Check Sheets') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockCheck.php?' . SID . '">' . _('Inventory Stock Check Sheets') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockQties_csv.php?' . sid . '">' . _('Make Inventory Quantities CSV') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockQties_csv.php?' . SID . '">' . _('Make Inventory Quantities CSV') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFStockCheckComparison.php?' . sid . '">' . _('Compare Counts Vs Stock Check Data') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFStockCheckComparison.php?' . SID . '">' . _('Compare Counts Vs Stock Check Data') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockLocMovements.php?' . sid . '">' . _('All Inventory Movements By Location/Date') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockLocMovements.php?' . SID . '">' . _('All Inventory Movements By Location/Date') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockLocStatus.php?' . sid . '">' . _('List Inventory Status By Location/Category') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockLocStatus.php?' . SID . '">' . _('List Inventory Status By Location/Category') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockQuantityByDate.php?' . sid . '">' . _('Historical Stock Quantity By Location/Category') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockQuantityByDate.php?' . SID . '">' . _('Historical Stock Quantity By Location/Category') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFStockNegatives.php?' . sid . '">' . _('List Negative Stocks') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFStockNegatives.php?' . SID . '">' . _('List Negative Stocks') . '</a></p>'; ?> </td> </tr> <tr> @@ -694,32 +701,32 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Stocks.php?' . sid . '">' . _('Add A New Item') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/Stocks.php?' . SID . '">' . _('Add A New Item') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectProduct.php?' . sid . '">' . _('Select An Item') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectProduct.php?' . SID . '">' . _('Select An Item') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesCategories.php?' . sid . '">' . _('Sales Category Maintenance') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SalesCategories.php?' . SID . '">' . _('Sales Category Maintenance') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PricesBasedOnMarkUp.php?' . sid . '">' . _('Add or Update Prices Based On Costs') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PricesBasedOnMarkUp.php?' . SID . '">' . _('Add or Update Prices Based On Costs') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PricesByCost.php?' . sid . '">' . _('View or Update Prices Based On Costs') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PricesByCost.php?' . SID . '">' . _('View or Update Prices Based On Costs') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/ReorderLevelLocation.php?' . sid . '">' . _('Reorder Level By Category/Location') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/ReorderLevelLocation.php?' . SID . '">' . _('Reorder Level By Category/Location') . '</a></p>'; ?> </td> ... [truncated message content] |