From: <dai...@us...> - 2011-06-13 10:23:55
|
Revision: 4596 http://web-erp.svn.sourceforge.net/web-erp/?rev=4596&view=rev Author: daintree Date: 2011-06-13 10:23:44 +0000 (Mon, 13 Jun 2011) Log Message: ----------- xhtml case indent etc Modified Paths: -------------- trunk/Areas.php trunk/BOMInquiry.php trunk/BOMListing.php trunk/BOMs.php trunk/BankAccounts.php trunk/BankMatching.php trunk/COGSGLPostings.php trunk/CompanyPreferences.php trunk/ConfirmDispatch_Invoice.php trunk/StockLocTransfer.php trunk/doc/Change.log trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.mo trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po trunk/locale/de_DE.utf8/LC_MESSAGES/messages.mo trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po trunk/locale/el_GR.utf8/LC_MESSAGES/messages.mo trunk/locale/el_GR.utf8/LC_MESSAGES/messages.po trunk/locale/en_GB.utf8/LC_MESSAGES/messages.pot trunk/locale/en_US.utf8/LC_MESSAGES/messages.mo trunk/locale/en_US.utf8/LC_MESSAGES/messages.po trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po trunk/locale/et_EE.utf8/LC_MESSAGES/messages.mo trunk/locale/et_EE.utf8/LC_MESSAGES/messages.po trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.mo trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.po trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.mo trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.po trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.mo trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.po trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.mo trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.po trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.mo trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.po trunk/locale/id_ID.utf8/LC_MESSAGES/messages.mo trunk/locale/id_ID.utf8/LC_MESSAGES/messages.po trunk/locale/it_IT.utf8/LC_MESSAGES/messages.mo trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.mo trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.po trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.mo trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.po trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.mo trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.po trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.mo trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.po trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.po trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.po trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.mo trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.po trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.mo trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.po trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.mo trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.po trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.mo trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.po trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.mo trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.po trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.mo trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.po trunk/locale/vi_VN.utf8/LC_MESSAGES/messages.mo trunk/locale/vi_VN.utf8/LC_MESSAGES/messages.po trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.po trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.po trunk/sql/mysql/weberp-demo.sql trunk/sql/mysql/weberp-new.sql Modified: trunk/Areas.php =================================================================== --- trunk/Areas.php 2011-06-12 09:30:10 UTC (rev 4595) +++ trunk/Areas.php 2011-06-13 10:23:44 UTC (rev 4596) @@ -68,7 +68,7 @@ $sql = "UPDATE areas SET areadescription='" . $_POST['AreaDescription'] . "' - WHERE areacode = '$SelectedArea'"; + WHERE areacode = '" . $SelectedArea . "'"; $msg = _('Area code') . ' ' . $SelectedArea . ' ' . _('has been updated'); @@ -172,13 +172,13 @@ //end of ifs and buts! if (isset($SelectedArea)) { - echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Review Areas Defined') . '</a></div>'; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Review Areas Defined') . '</a></div>'; } if (!isset($_GET['delete'])) { - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '"><br>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '"><br>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedArea)) { @@ -187,7 +187,7 @@ $sql = "SELECT areacode, areadescription FROM areas - WHERE areacode='$SelectedArea'"; + WHERE areacode='" . $SelectedArea . "'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); @@ -195,8 +195,8 @@ $_POST['AreaCode'] = $myrow['areacode']; $_POST['AreaDescription'] = $myrow['areadescription']; - echo '<input type=hidden name=SelectedArea VALUE=' . $SelectedArea . '>'; - echo '<input type=hidden name=AreaCode VALUE=' .$_POST['AreaCode'] . '>'; + echo '<input type=hidden name=SelectedArea value="' . $SelectedArea . '">'; + echo '<input type=hidden name=AreaCode value="' .$_POST['AreaCode'] . '">'; echo '<table class=selection><tr><td>' . _('Area Code') . ':</td><td>' . $_POST['AreaCode'] . '</td></tr>'; } else { @@ -206,7 +206,7 @@ if (!isset($_POST['AreaDescription'])) { $_POST['AreaDescription'] = ''; } - echo '<table class=selection> + echo '<table class="selection"> <tr> <td>' . _('Area Code') . ':</td> <td><input tabindex="1" ' . (in_array('AreaCode',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="AreaCode" value="' . $_POST['AreaCode'] . '" size=3 maxlength=3></td> @@ -217,7 +217,7 @@ <td><input tabindex="2" ' . (in_array('AreaDescription',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="AreaDescription" value="' . $_POST['AreaDescription'] .'" size=26 maxlength=25></td> </tr>'; - echo '<tr><td colspan=2><div class="centre"><input tabindex="3" type="Submit" name="submit" value=' . _('Enter Information') .'></div></td></tr>'; + echo '<tr><td colspan=2><div class="centre"><input tabindex="3" type="submit" name="submit" value=' . _('Enter Information') .'></div></td></tr>'; echo '</table></form>'; } //end if record deleted no point displaying form to add record Modified: trunk/BOMInquiry.php =================================================================== --- trunk/BOMInquiry.php 2011-06-12 09:30:10 UTC (rev 4595) +++ trunk/BOMInquiry.php 2011-06-13 10:23:44 UTC (rev 4596) @@ -1,7 +1,6 @@ <?php -/* $Revision: 1.12 $ */ + /* $Id$*/ -//$PageSecurity = 2; include('includes/session.inc'); $title = _('Costed Bill Of Material'); @@ -14,16 +13,20 @@ } if (!isset($_POST['StockID'])) { - echo "<form action=" . $_SERVER['PHP_SELF'] . "?" . SID ." method=post><b><br></b>". - '<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') . - ", " . _('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') . - " <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> - </tr></table><br><div class='centre'><input tabindex='3' type=submit name='Search' VALUE=" . _('Search Now') . "></div><br>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post"><b><br></b>'. + '<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') . + ', ' . _('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') . ' <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> + </tr></table> + <br /><div class="centre"><input tabindex="3" type="submit" name="Search" value=' . _('Search Now') . '></div><br />'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; } @@ -90,10 +93,10 @@ echo '<br><hr><br><table class=selection cellpadding=2 colspan=7>'; $TableHeader = '<tr><th>' . _('Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('On Hand') . '</th> - <th>' . _('Units') . '</th> - </tr>'; + <th>' . _('Description') . '</th> + <th>' . _('On Hand') . '</th> + <th>' . _('Units') . '</th> + </tr>'; echo $TableHeader; @@ -113,15 +116,14 @@ $StockOnHand = number_format($myrow['totalonhand'],2); } $tabindex=$j+4; - printf("<td><input tabindex='".$tabindex."' type=submit name='StockID' VALUE='%s'</td> + printf('<td><input tabindex="' .$tabindex . '" type="submit" name="StockID" value="%s"</td> <td>%s</td> - <td class=number>%s</td> - <td>%s</td></tr>", - $myrow['stockid'], - $myrow['description'], - $StockOnHand, - $myrow['units'] - ); + <td class=number>%s</td> + <td>%s</td></tr>', + $myrow['stockid'], + $myrow['description'], + $StockOnHand, + $myrow['units'] ); $j++; //end of page full new headings if } @@ -131,17 +133,18 @@ } if (isset($StockID) and $StockID!=""){ - /*CCF modification */ -// $result = DB_query("SELECT description, units FROM stockmaster WHERE stockid='" . $StockID . "'",$db); - $result = DB_query("SELECT description, units, labourcost, overheadcost FROM stockmaster WHERE stockid='" . $StockID . "'",$db); - /*CCF end modification */ + + $result = DB_query("SELECT description, + units, + labourcost, + overheadcost + FROM stockmaster + WHERE stockid='" . $StockID . "'", + $db); $myrow = DB_fetch_array($result); - /*CCF modification */ $ParentLabourCost = $myrow['labourcost']; $ParentOverheadCost = $myrow['overheadcost']; - /*CCF end modification */ - - + $sql = "SELECT bom.parent, bom.component, stockmaster.description, @@ -149,7 +152,8 @@ stockmaster.materialcost+ stockmaster.labourcost+stockmaster.overheadcost as standardcost, bom.quantity, bom.quantity * (stockmaster.materialcost+ stockmaster.labourcost+ stockmaster.overheadcost) AS componentcost - FROM bom INNER JOIN stockmaster ON bom.component = stockmaster.stockid + FROM bom INNER JOIN stockmaster + ON bom.component = stockmaster.stockid WHERE bom.parent = '" . $StockID . "' AND bom.effectiveafter < Now() AND bom.effectiveto > Now()"; @@ -161,20 +165,17 @@ prnMsg(_('The bill of material for this part is not set up') . ' - ' . _('there are no components defined for it'),'warn'); } else { echo '<a href="'.$rootpath.'/index.php">'._('Return to Main Menu').'</a>'; - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . - _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; - echo "<table class=selection cellpadding=2>"; - echo "<tr><th colspan=5><div class='centre'><font size=4><b>" . $myrow[0] . ' : ' . _('per') . ' ' . $myrow[1] . - "</b></font></div></th></tr>"; + echo '<table class="selection" cellpadding="2">'; + echo '<tr><th colspan=5><div class="centre"><font size=4><b>' . $myrow[0] . ' : ' . _('per') . ' ' . $myrow[1] . '</b></font></div></th></tr>'; $TableHeader = '<tr> - <th>' . _('Component') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Quantity') . '</th> - <th>' . _('Unit Cost') . '</th> - <th>' . _('Total Cost') . '</th> - </tr>'; - + <th>' . _('Component') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Unit Cost') . '</th> + <th>' . _('Total Cost') . '</th> + </tr>'; echo $TableHeader; $j = 1; @@ -192,39 +193,37 @@ $k++; } - $ComponentLink = "<a href='$rootpath/SelectProduct.php?" . SID . "&StockID=" . $myrow['component'] . "'>" . $myrow['component'] . "</a>"; + $ComponentLink = '<a href="' . $rootpath . '/SelectProduct.php?StockID=' . $myrow['component'] . '">' . $myrow['component'] . '</a>'; - /* Component Code Description Quantity Std Cost* Total Cost */ - printf("<td>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td class=number>%.2f</td> - <td class=number>%.2f</td> - </tr>", - $ComponentLink, - $myrow['description'], - number_format($myrow['quantity'], - $myrow['decimalplaces']), - $myrow['standardcost'], - $myrow['componentcost']); + /* Component Code Description Quantity Std Cost Total Cost */ + printf('<td>%s</td> + <td>%s</td> + <td class=number>%s</td> + <td class=number>%.2f</td> + <td class=number>%.2f</td> + </tr>', + $ComponentLink, + $myrow['description'], + number_format($myrow['quantity'],$myrow['decimalplaces']), + $myrow['standardcost'], + $myrow['componentcost']); $TotalCost += $myrow['componentcost']; $j++; } - /*CCF modification */ + $TotalCost += $ParentLabourCost; echo '<tr> - <td colspan=4 class=number><b>' . _('Labour Cost') . '</b></td> - <td class=number><b>' . number_format($ParentLabourCost,2) . '</b></td> </tr>'; + <td colspan="4" class="number"><b>' . _('Labour Cost') . '</b></td> + <td class=number><b>' . number_format($ParentLabourCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td></tr>'; $TotalCost += $ParentOverheadCost; - echo '<tr><td colspan=4 class=number><b>' . _('Overhead Cost') . '</b></td> - <td class=number><b>' . number_format($ParentOverheadCost,2) . '</b></td></tr>'; - /*CCF end modification */ + echo '<tr><td colspan="4" class="number"><b>' . _('Overhead Cost') . '</b></td> + <td class=number><b>' . number_format($ParentOverheadCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td></tr>'; echo '<tr> <td colspan=4 class=number><b>' . _('Total Cost') . '</b></td> - <td class=number><b>' . number_format($TotalCost,2) . '</b></td> + <td class=number><b>' . number_format($TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td> </tr>'; echo '</table>'; @@ -234,9 +233,9 @@ } if (!isset($_POST['StockID']) or $_POST['StockID']=='') { - echo "<script>defaultControl(document.forms[0].StockCode);</script>"; + echo '<script>defaultControl(document.forms[0].StockCode);</script>'; } echo '</form>'; include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/BOMListing.php =================================================================== --- trunk/BOMListing.php 2011-06-12 09:30:10 UTC (rev 4595) +++ trunk/BOMListing.php 2011-06-13 10:23:44 UTC (rev 4596) @@ -77,7 +77,7 @@ $SQL = "SELECT description FROM stockmaster WHERE stockmaster.stockid = '" . $BOMList['parent'] . "'"; $ParentResult = DB_query($SQL,$db); $ParentRow = DB_fetch_row($ParentResult); - $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,400-$Left_Margin,$FontSize,$BOMList['parent'] . ' - ' . $ParentRow[0],'left'); + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,400-$Left_Margin,$FontSize,$BOMList['parent'] . ' - ' . $ParentRow[0],'left'); $ParentPart = $BOMList['parent']; } Modified: trunk/BOMs.php =================================================================== --- trunk/BOMs.php 2011-06-12 09:30:10 UTC (rev 4595) +++ trunk/BOMs.php 2011-06-13 10:23:44 UTC (rev 4596) @@ -18,7 +18,7 @@ $c_result = DB_query("SELECT parent, component FROM bom WHERE parent='" . $parent. "'" - ,$db); + ,$db); if (DB_num_rows($c_result) > 0) { while ($row = DB_fetch_array($c_result)) { @@ -143,7 +143,7 @@ <td class=number>%s</td> <td><a href="%s&Select=%s&SelectedComponent=%s">' . _('Edit') . '</a></td> <td>'.$DrillText.'</a></td> - <td><a href="%s&Select=%s&SelectedComponent=%s&delete=1&ReSelect=%s">' . _('Delete') . '</a></td> + <td><a href="%s&Select=%s&SelectedComponent=%s&delete=1&ReSelect=%s" onclick="return confirm(\'' . _('Are you sure you wish to delete this component from the bill of material?') . '\');">' . _('Delete') . '</a></td> </tr>', $Level1, $myrow[0], @@ -216,13 +216,13 @@ if (!Is_Date($_POST['EffectiveAfter'])) { $InputError = 1; - prnMsg(_('The effective after date field must be a date in the format dd/mm/yy or dd/mm/yyyy or ddmmyy or ddmmyyyy or dd-mm-yy or dd-mm-yyyy'),'error'); + prnMsg(_('The effective after date field must be a date in the format') . ' ' .$_SESSION['DefaultDateFormat'],'error'); $Errors[$i] = 'EffectiveAfter'; $i++; } if (!Is_Date($_POST['EffectiveTo'])) { $InputError = 1; - prnMsg(_('The effective to date field must be a date in the format dd/mm/yy or dd/mm/yyyy or ddmmyy or ddmmyyyy or dd-mm-yy or dd-mm-yyyy'),'error'); + prnMsg(_('The effective to date field must be a date in the format') . ' ' .$_SESSION['DefaultDateFormat'],'error'); $Errors[$i] = 'EffectiveTo'; $i++; } @@ -380,9 +380,9 @@ //DisplayBOMItems($SelectedParent, $db); $sql = "SELECT stockmaster.description, - stockmaster.mbflag - FROM stockmaster - WHERE stockmaster.stockid='" . $SelectedParent . "'"; + stockmaster.mbflag + FROM stockmaster + WHERE stockmaster.stockid='" . $SelectedParent . "'"; $ErrMsg = _('Could not retrieve the description of the parent part because'); $DbgMsg = _('The SQL used to retrieve description of the parent part was'); @@ -410,16 +410,16 @@ break; } - echo '<br /><div class=centre><a href=' . $_SERVER['PHP_SELF'] . '?' . SID . '>' . _('Select a Different BOM') . '</a></div><br />'; + echo '<br /><div class=centre><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Select a Different BOM') . '</a></div><br />'; echo '<table class="selection">'; // Display Manufatured Parent Items $sql = "SELECT bom.parent, - stockmaster.description, - stockmaster.mbflag - FROM bom, stockmaster - WHERE bom.component='".$SelectedParent."' - AND stockmaster.stockid=bom.parent - AND stockmaster.mbflag='M'"; + stockmaster.description, + stockmaster.mbflag + FROM bom, stockmaster + WHERE bom.component='".$SelectedParent."' + AND stockmaster.stockid=bom.parent + AND stockmaster.mbflag='M'"; $ErrMsg = _('Could not retrieve the description of the parent part because'); $DbgMsg = _('The SQL used to retrieve description of the parent part was'); @@ -429,7 +429,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'] . '?' . SID . 'Select='.$myrow['parent'].'">'. + echo (($ix)?', ':'').'<a href="'.$_SERVER['PHP_SELF'] . '?Select='.$myrow['parent'].'">'. $myrow['description'].' ('.$myrow['parent'].')</a>'; $ix++; } //end while loop @@ -437,10 +437,12 @@ $reqnl = $ix; } // Display Assembly Parent Items - $sql = "SELECT bom.parent, stockmaster.description, stockmaster.mbflag - FROM bom, stockmaster + $sql = "SELECT bom.parent, + stockmaster.description, + stockmaster.mbflag + FROM bom INNER JOIN stockmaster + ON bom.parent=stockmaster.stockid WHERE bom.component='".$SelectedParent."' - AND stockmaster.stockid=bom.parent AND stockmaster.mbflag='A'"; $ErrMsg = _('Could not retrieve the description of the parent part because'); @@ -450,18 +452,20 @@ 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'] . '?' . SID . 'Select='.$myrow['parent'].'">'. + echo (($ix)?', ':'').'<a href="'.$_SERVER['PHP_SELF'] . '?Select='.$myrow['parent'].'">'. $myrow['description'].' ('.$myrow['parent'].')</a>'; $ix++; } //end while loop echo '</div></td></tr>'; } // Display Kit Sets - $sql = "SELECT bom.parent, stockmaster.description, stockmaster.mbflag - FROM bom, stockmaster - WHERE bom.component='".$SelectedParent."' - AND stockmaster.stockid=bom.parent - AND stockmaster.mbflag='K'"; + $sql = "SELECT bom.parent, + stockmaster.description, + stockmaster.mbflag + FROM bom INNER JOIN stockmaster + ON bom.parent=stockmaster.stockid + WHERE bom.component='".$SelectedParent."' + AND stockmaster.mbflag='K'"; $ErrMsg = _('Could not retrieve the description of the parent part because'); $DbgMsg = _('The SQL used to retrieve description of the parent part was'); @@ -470,18 +474,20 @@ 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'] . '?' . SID . 'Select='.$myrow['parent'].'">'. + echo (($ix)?', ':'').'<a href="'.$_SERVER['PHP_SELF'] . '?Select='.$myrow['parent'].'">'. $myrow['description'].' ('.$myrow['parent'].')</a>'; $ix++; } //end while loop echo '</div></td></tr>'; } // Display Phantom/Ghosts - $sql = "SELECT bom.parent, stockmaster.description, stockmaster.mbflag - FROM bom, stockmaster - WHERE bom.component='".$SelectedParent."' - AND stockmaster.stockid=bom.parent - AND stockmaster.mbflag='G'"; + $sql = "SELECT bom.parent, + stockmaster.description, + stockmaster.mbflag + FROM bom INNER JOIN stockmaster + ON bom.parent=stockmaster.stockid + WHERE bom.component='".$SelectedParent."' + AND stockmaster.mbflag='G'"; $ErrMsg = _('Could not retrieve the description of the parent part because'); $DbgMsg = _('The SQL used to retrieve description of the parent part was'); @@ -490,7 +496,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'] . '?' . SID . 'Select='.$myrow['parent'].'">'. + echo (($ix)?', ':'').'<a href="'.$_SERVER['PHP_SELF'] . '?Select='.$myrow['parent'].'">'. $myrow['description'].' ('.$myrow['parent'].')</a>'; $ix++; } //end while loop @@ -575,44 +581,46 @@ echo '<br /> <input type="hidden" name="SelectedParent" value="' . $SelectedParent . '" />'; echo '<input type="hidden" name="SelectedComponent" value="' . $SelectedComponent . '" />'; - echo '<table class=selection>'; + echo '<table class="selection">'; echo '<tr><th colspan=13><div class="centre"><font color=blue size=3><b>'. ('Edit Component Details') .'</font></b></th></tr>'; - echo '<tr><td>' . _('Component') . ':</td><td><b>' . $SelectedComponent . '</b></td></tr>'; + echo '<tr><td>' . _('Component') . ':</td> + <td><b>' . $SelectedComponent . '</b></td> + </tr>'; } else { //end of if $SelectedComponent echo '<input type=hidden name="SelectedParent" value="' . $SelectedParent . '" />'; /* echo "Enter the details of a new component in the fields below. <br />Click on 'Enter Information' to add the new component, once all fields are completed."; */ - echo '<table class=selection>'; + echo '<table class="selection">'; echo '<tr><th colspan=13><div class="centre"><font color=blue size=3><b>' . ('New Component Details') .'</font></b></th></tr>'; echo '<tr><td>' . _('Component code') . ':</td><td>'; echo '<select ' . (in_array('ComponentCode',$Errors) ? 'class="selecterror"' : '' ) .' tabindex="1" name="Component">'; if ($ParentMBflag=='A'){ /*Its an assembly */ $sql = "SELECT stockmaster.stockid, - stockmaster.description - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid = stockcategory.categoryid - WHERE ((stockcategory.stocktype='L' AND stockmaster.mbflag ='D') - OR stockmaster.mbflag !='D') - AND stockmaster.mbflag !='K' - AND stockmaster.mbflag !='A' - AND stockmaster.controlled = 0 - AND stockmaster.stockid != '".$SelectedParent."' - ORDER BY stockmaster.stockid"; + stockmaster.description + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid = stockcategory.categoryid + WHERE ((stockcategory.stocktype='L' AND stockmaster.mbflag ='D') + OR stockmaster.mbflag !='D') + AND stockmaster.mbflag !='K' + AND stockmaster.mbflag !='A' + AND stockmaster.controlled = 0 + AND stockmaster.stockid != '".$SelectedParent."' + ORDER BY stockmaster.stockid"; } else { /*Its either a normal manufac item, phantom, kitset - controlled items ok */ $sql = "SELECT stockmaster.stockid, - stockmaster.description - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid = stockcategory.categoryid - WHERE ((stockcategory.stocktype='L' AND stockmaster.mbflag ='D') - OR stockmaster.mbflag !='D') - AND stockmaster.mbflag !='K' - AND stockmaster.mbflag !='A' - AND stockmaster.stockid != '".$SelectedParent."' - ORDER BY stockmaster.stockid"; + stockmaster.description + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid = stockcategory.categoryid + WHERE ((stockcategory.stocktype='L' AND stockmaster.mbflag ='D') + OR stockmaster.mbflag !='D') + AND stockmaster.mbflag !='K' + AND stockmaster.mbflag !='A' + AND stockmaster.stockid != '".$SelectedParent."' + ORDER BY stockmaster.stockid"; } $ErrMsg = _('Could not retrieve the list of potential components because'); @@ -789,11 +797,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="">' . ' ' . $title; echo '<form action="' . $_SERVER['PHP_SELF'] . '" 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') . - ', ' . _('kits or assemblies to be available for construction of a bill of material') .'</div>'. - '</font> + '<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') . ', ' . _('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') . ' <b>' . _('description') . '</b>:</font></td> @@ -808,7 +812,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" colspan="7" class="selection">'; $TableHeader = '<tr><th>' . _('Code') . '</th> <th>' . _('Description') . '</th> <th>' . _('On Hand') . '</th> @@ -834,13 +838,13 @@ } $tab = $j+3; printf('<td><input tabindex="' . $tab . '" type="submit" name="Select" value="%s"</td> - <td>%s</td> - <td class=number>%s</td> - <td>%s</td></tr>', - $myrow['stockid'], - $myrow['description'], - $StockOnHand, - $myrow['units']); + <td>%s</td> + <td class=number>%s</td> + <td>%s</td></tr>', + $myrow['stockid'], + $myrow['description'], + $StockOnHand, + $myrow['units']); $j++; //end of page full new headings if Modified: trunk/BankAccounts.php =================================================================== --- trunk/BankAccounts.php 2011-06-12 09:30:10 UTC (rev 4595) +++ trunk/BankAccounts.php 2011-06-13 10:23:44 UTC (rev 4596) @@ -170,16 +170,15 @@ /* Always show the list of accounts */ If (!isset($SelectedBankAccount)) { $sql = "SELECT bankaccounts.accountcode, - bankaccounts.bankaccountcode, - chartmaster.accountname, - bankaccountname, - bankaccountnumber, - bankaddress, - currcode, - invoice - FROM bankaccounts, - chartmaster - WHERE bankaccounts.accountcode = chartmaster.accountcode"; + bankaccounts.bankaccountcode, + chartmaster.accountname, + bankaccountname, + bankaccountnumber, + bankaddress, + currcode, + invoice + FROM bankaccounts INNER JOIN chartmaster + ON bankaccounts.accountcode = chartmaster.accountcode"; $ErrMsg = _('The bank accounts set up could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve the bank account details was') . '<br />' . $sql; @@ -198,7 +197,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; @@ -206,33 +205,33 @@ echo '<tr class="OddTableRows">'; $k++; } - if ($myrow[7]==0) { - $defacc=_('No'); + if ($myrow['invoice']==0) { + $DefaultBankAccount=_('No'); } else { - $defacc=_('Yes'); + $DefaultBankAccount=_('Yes'); } printf('<td>%s<br /><font size=2>%s</font></td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td><a href="%s?SelectedBankAccount=%s">' . _('Edit') . '</td> - <td><a href="%s?SelectedBankAccount=%s&delete=1">' . _('Delete') . '</td> - </tr>', - $myrow[0], - $myrow[2], - $myrow[3], - $myrow[1], - $myrow[4], - $myrow[5], - $myrow[6], - $defacc, - $_SERVER['PHP_SELF'], - $myrow[0], - $_SERVER['PHP_SELF'], - $myrow[0]); + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td><a href="%s?SelectedBankAccount=%s">' . _('Edit') . '</td> + <td><a href="%s?SelectedBankAccount=%s&delete=1" onclick="return confirm(\'' . _('Are you sure you wish to delete this bank account?') . '\');">' . _('Delete') . '</td> + </tr>', + $myrow['accountcode'], + $myrow['accountname'], + $myrow['bankaccountname'], + $myrow['bankaccountcode'], + $myrow['bankaccountnumber'], + $myrow['bankaddress'], + $myrow['currcode'], + $DefaultBankAccount, + $_SERVER['PHP_SELF'], + $myrow['accountcode'], + $_SERVER['PHP_SELF'], + $myrow['accountcode']); } //END WHILE LIST LOOP @@ -243,25 +242,25 @@ if (isset($SelectedBankAccount)) { echo '<p>'; - echo '<div class="centre"><p><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Show All Bank Accounts Defined') . '</a></div>'; + echo '<div class="centre"><p><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Show All Bank Accounts Defined') . '</a></div>'; echo '<p>'; } -echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . ">"; +echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedBankAccount) AND !isset($_GET['delete'])) { //editing an existing bank account - not deleting $sql = "SELECT accountcode, - bankaccountname, - bankaccountcode, - bankaccountnumber, - bankaddress, - currcode, - invoice - FROM bankaccounts - WHERE bankaccounts.accountcode='$SelectedBankAccount'"; + bankaccountname, + bankaccountcode, + bankaccountnumber, + bankaddress, + currcode, + invoice + FROM bankaccounts + WHERE bankaccounts.accountcode='" . $SelectedBankAccount . "'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); @@ -274,30 +273,33 @@ $_POST['CurrCode'] = $myrow['currcode']; $_POST['DefAccount'] = $myrow['invoice']; - echo '<input type=hidden name=SelectedBankAccount VALUE=' . $SelectedBankAccount . '>'; - echo '<input type=hidden name=AccountCode VALUE=' . $_POST['AccountCode'] . '>'; - echo '<table class=selection> <tr><td>' . _('Bank Account GL Code') . ':</td><td>'; - echo $_POST['AccountCode'] . '</td></tr>'; + echo '<input type=hidden name="SelectedBankAccount" value="' . $SelectedBankAccount . '">'; + echo '<input type=hidden name="AccountCode" value="' . $_POST['AccountCode'] . '">'; + echo '<table class="selection"> + <tr><td>' . _('Bank Account GL Code') . ':</td> + <td>' . $_POST['AccountCode'] . '</td> + </tr>'; } else { //end of if $Selectedbank account only do the else when a new record is being entered - echo '<table class=selection><tr><td>' . _('Bank Account GL Code') . - ":</td><td><Select tabindex='1' " . (in_array('AccountCode',$Errors) ? 'class="selecterror"' : '' ) ." name='AccountCode'>"; + echo '<table class="selection"> + <tr><td>' . _('Bank Account GL Code') . ':</td> + <td><select tabindex="1" ' . (in_array('AccountCode',$Errors) ? 'class="selecterror"' : '' ) .' name="AccountCode">'; $sql = "SELECT accountcode, - accountname - FROM chartmaster, - accountgroups - WHERE chartmaster.group_ = accountgroups.groupname - AND accountgroups.pandl = 0 - ORDER BY accountcode"; - + accountname + FROM chartmaster, + accountgroups + WHERE chartmaster.group_ = accountgroups.groupname + AND accountgroups.pandl = 0 + ORDER BY accountcode"; + $result = DB_query($sql,$db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['AccountCode']) and $myrow['accountcode']==$_POST['AccountCode']) { - echo '<option selected VALUE='; + echo '<option selected value="'; } else { - echo '<option VALUE='; + echo '<option value="'; } - echo $myrow['accountcode'] . '>' . $myrow['accountname']; + echo $myrow['accountcode'] . '">' . $myrow['accountname'] . '</option>'; } //end while loop @@ -319,43 +321,53 @@ } echo '<tr><td>' . _('Bank Account Name') . ': </td> - <td><input tabindex="2" ' . (in_array('AccountName',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="BankAccountName" value="' . $_POST['BankAccountName'] . '" size=40 maxlength=50></td></tr> + <td><input tabindex="2" ' . (in_array('AccountName',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="BankAccountName" value="' . $_POST['BankAccountName'] . '" size=40 maxlength=50></td></tr> <tr><td>' . _('Bank Account Code') . ': </td> - <td><input tabindex="3" ' . (in_array('AccountCode',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="BankAccountCode" value="' . $_POST['BankAccountCode'] . '" size=40 maxlength=50></td></tr> + <td><input tabindex="3" ' . (in_array('AccountCode',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="BankAccountCode" value="' . $_POST['BankAccountCode'] . '" size=40 maxlength=50></td></tr> <tr><td>' . _('Bank Account Number') . ': </td> - <td><input tabindex="3" ' . (in_array('AccountNumber',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="BankAccountNumber" value="' . $_POST['BankAccountNumber'] . '" size=40 maxlength=50></td></tr> + <td><input tabindex="3" ' . (in_array('AccountNumber',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="BankAccountNumber" value="' . $_POST['BankAccountNumber'] . '" size="40" maxlength="50"></td></tr> <tr><td>' . _('Bank Address') . ': </td> - <td><input tabindex="4" ' . (in_array('BankAddress',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="BankAddress" value="' . $_POST['BankAddress'] . '" size=40 maxlength=50></td></tr> - <tr><td>' . _('Currency Of Account') . ': </td><td><select tabindex="5" name="CurrCode">'; + <td><input tabindex="4" ' . (in_array('BankAddress',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="BankAddress" value="' . $_POST['BankAddress'] . '" size="40" maxlength="50"></td></tr> + <tr><td>' . _('Currency Of Account') . ': </td> + <td><select tabindex="5" name="CurrCode">'; if (!isset($_POST['CurrCode']) OR $_POST['CurrCode']==''){ $_POST['CurrCode'] = $_SESSION['CompanyRecord']['currencydefault']; } -$result = DB_query('SELECT currabrev, currency FROM currencies',$db); +$result = DB_query("SELECT currabrev, + currency + FROM currencies",$db); + while ($myrow = DB_fetch_array($result)) { if ($myrow['currabrev']==$_POST['CurrCode']) { - echo '<option selected VALUE='; + echo '<option selected value="'; } else { - echo '<option VALUE='; + echo '<option value="'; } - echo $myrow['currabrev'] . '>' . $myrow['currabrev']; + echo $myrow['currabrev'] . '">' . $myrow['currabrev'] . '</option>'; } //end while loop echo '</select></td>'; -echo '<tr><td>' . _('Default for Invoices') . ': </td><td><select tabindex="6" name="DefAccount">'; +echo '<tr><td>' . _('Default for Invoices') . ': </td> + <td><select tabindex="6" name="DefAccount">'; if (!isset($_POST['DefAccount']) OR $_POST['DefAccount']==''){ - $_POST['DefAccount'] = $_SESSION['CompanyRecord']['currencydefault']; + $_POST['DefAccount'] = $_SESSION['CompanyRecord']['currencydefault']; } if (isset($SelectedBankAccount)) { - $result = DB_query("SELECT invoice FROM bankaccounts where accountcode ='" . $SelectedBankAccount ."'",$db); + $result = DB_query("SELECT invoice + FROM bankaccounts + WHERE accountcode ='" . $SelectedBankAccount ."'", + $db); while ($myrow = DB_fetch_array($result)) { if ($myrow['invoice']== 1) { - echo '<option selected VALUE=1>'._('Yes').'</option><option value=0>'._('No').'</option>'; + echo '<option selected value="1">'._('Yes').'</option> + <option value="0">'._('No').'</option>'; } else { - echo '<option selected VALUE=0>'._('No').'</option><option value=1>'._('Yes').'</option>'; + echo '<option selected value="0">'._('No').'</option> + <option value="1">'._('Yes').'</option>'; } }//end while loop } else { @@ -366,8 +378,8 @@ echo '</select></td>'; echo '</tr></table><br /> - <div class="centre"><input tabindex="7" type="Submit" name="submit" value="'. _('Enter Information') .'"></div>'; + <div class="centre"><input tabindex="7" type="submit" name="submit" value="'. _('Enter Information') .'"></div>'; echo '</form>'; include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/BankMatching.php =================================================================== --- trunk/BankMatching.php 2011-06-12 09:30:10 UTC (rev 4595) +++ trunk/BankMatching.php 2011-06-13 10:23:44 UTC (rev 4596) @@ -57,13 +57,14 @@ ((isset($_POST['AmtClear_' . $Counter]) AND $_POST['AmtClear_' . $Counter]<0 AND $Type=='Payments') OR ($Type=='Receipts' AND (isset($_POST['AmtClear_' . $Counter]) and $_POST['AmtClear_' . $Counter]>0)))){ /*if the amount entered was numeric and negative for a payment or positive for a receipt */ + $sql = "UPDATE banktrans SET amountcleared=" . $_POST['AmtClear_' . $Counter] . " WHERE banktransid='" . $_POST['BankTrans_' . $Counter]."'"; $ErrMsg = _('Could not update the amount matched off this bank transaction because'); $result = DB_query($sql,$db,$ErrMsg); - } elseif (isset($_POST['Unclear_' . $Counter]) and $_POST['Unclear_' . $Counter]==True){ + } elseif (isset($_POST['Unclear_' . $Counter]) AND $_POST['Unclear_' . $Counter]==True){ $sql = "UPDATE banktrans SET amountcleared = 0 WHERE banktransid='" . $_POST['BankTrans_' . $Counter]."'"; $ErrMsg = _('Could not unclear this bank transaction because'); @@ -76,13 +77,15 @@ 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'] . '?' . SID . '" method=post>'; +echo '<form action="'. $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<input type="hidden" name="Type" Value="' . $Type . '">'; +echo '<input type="hidden" name="Type" value="' . $Type . '">'; -echo '<table class=selection><tr>'; -echo '<td align=left>' . _('Bank Account') . ':</td><td colspan=3><select tabindex="1" name="BankAccount">'; +echo '<table class="selection"> + <tr> + <td align="left">' . _('Bank Account') . ':</td> + <td colspan=3><select tabindex="1" name="BankAccount">'; $sql = "SELECT accountcode, bankaccountname FROM bankaccounts"; $resultBankActs = DB_query($sql,$db); @@ -117,23 +120,23 @@ echo '<option value="Ostdg">' . _('Show unmatched') . ' ' . $TypeName . ' ' . _('only') . '</option>'; } else { echo '<option Value="All">' . _('Show all') . ' ' . $TypeName . ' ' . _('in the date range') . '</option>'; - echo '<option selected Value="Ostdg">' . _('Show unmatched') . ' ' . $TypeName . ' ' . _('only') . '</option>'; + echo '<option selected value="Ostdg">' . _('Show unmatched') . ' ' . $TypeName . ' ' . _('only') . '</option>'; } echo '</select></td></tr>'; echo '<tr><td colspan=3>' . _('Choose to display only the first 20 matching') . ' ' . $TypeName . ' ' . _('or all') . ' ' . $TypeName . ' ' . _('meeting the criteria') . ':</td><td><select tabindex="5" name="First20_or_All">'; if ($_POST['First20_or_All']=='All'){ - echo '<option selected Value="All">' . _('Show all') . ' ' . $TypeName . ' ' . _('in the date range') . '</option>'; - echo '<option Value="First20">' . _('Show only the first 20') . ' ' . $TypeName . '</option>'; + echo '<option selected value="All">' . _('Show all') . ' ' . $TypeName . ' ' . _('in the date range') . '</option>'; + echo '<option value="First20">' . _('Show only the first 20') . ' ' . $TypeName . '</option>'; } else { - echo '<option Value="All">' . _('Show all') . ' ' . $TypeName . ' ' . _('in the date range') . '</option>'; - echo '<option selected Value="First20">' . _('Show only the first 20') . ' ' . $TypeName . '</option>'; + echo '<option value="All">' . _('Show all') . ' ' . $TypeName . ' ' . _('in the date range') . '</option>'; + echo '<option selected value="First20">' . _('Show only the first 20') . ' ' . $TypeName . '</option>'; } echo '</select></td></tr>'; -echo '</table><br><div class="centre"><input tabindex="6" type=submit name="ShowTransactions" VALUE="' . _('Show selected') . ' ' . $TypeName . '">'; +echo '</table><br><div class="centre"><input tabindex="6" type=submit name="ShowTransactions" value="' . _('Show selected') . ' ' . $TypeName . '">'; echo '<p><a href="' . $rootpath . '/BankReconciliation.php">' . _('Show reconciliation') . '</a></div>'; echo '<hr />'; @@ -165,10 +168,10 @@ amount/exrate as amt, banktranstype FROM banktrans - WHERE amount <0 - AND transdate >= '". $SQLAfterDate . "' - AND transdate <= '" . $SQLBeforeDate . "' - AND bankact='" .$_POST['BankAccount'] . "' + WHERE amount < 0 + AND transdate >= '". $SQLAfterDate . "' + AND transdate <= '" . $SQLBeforeDate . "' + AND bankact='" .$_POST['BankAccount'] . "' ORDER BY transdate"; } else { /* Type must == Receipts */ @@ -180,9 +183,9 @@ banktranstype FROM banktrans WHERE amount >0 - AND transdate >= '". $SQLAfterDate . "' - AND transdate <= '" . $SQLBeforeDate . "' - AND bankact='" .$_POST['BankAccount'] . "' + AND transdate >= '". $SQLAfterDate . "' + AND transdate <= '" . $SQLBeforeDate . "' + AND bankact='" .$_POST['BankAccount'] . "' ORDER BY transdate"; } } else { /*it must be only the outstanding bank trans required */ @@ -228,7 +231,7 @@ <th>' . _('Date') . '</th> <th>' . _('Amount') . '</th> <th>' . _('Outstanding') . '</th> - <th colspan=3>' . _('Clear') . ' / ' . _('Unclear') . '</th> + <th colspan="3">' . _('Clear') . ' / ' . _('Unclear') . '</th> </tr>'; echo '<table cellpadding=2 class="selection">' . $TableHeader; Modified: trunk/COGSGLPostings.php =================================================================== --- trunk/COGSGLPostings.php 2011-06-12 09:30:10 UTC (rev 4595) +++ trunk/COGSGLPostings.php 2011-06-13 10:23:44 UTC (rev 4596) @@ -15,8 +15,7 @@ $SelectedCOGSPostingID=$_GET['SelectedCOGSPostingID']; } -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . - '" alt="" />' . ' ' . $title.'</p><br />'; +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; if (isset($_POST['submit'])) { @@ -134,45 +133,39 @@ $result = DB_query($sql,$db); if (DB_num_rows($result)==0){ /* The required group does not seem to exist so we create it */ - $sql = "INSERT INTO accountgroups ( - groupname, - sectioninaccounts, - pandl, - sequenceintb - ) VALUES ( - 'Sales', - '1', - '1', - '10')"; - + $sql = "INSERT INTO accountgroups ( groupname, + sectioninaccounts, + pandl, + sequenceintb ) + VALUES ('Sales', + '1', + '1', + '10')"; + $result = DB_query($sql,$db); } $sql = "SELECT accountcode FROM chartmaster WHERE accountcode ='1'"; $result = DB_query($sql,$db); if (DB_num_rows($result)==0){ /* account number 1 is not used, so insert a new account */ - $sql = "INSERT INTO chartmaster ( - accountcode, - accountname, - group_ - ) - VALUES ( - '1', - 'Default Sales/Discounts', - 'Sales' - )"; + $sql = "INSERT INTO chartmaster (accountcode, + accountname, + group_) + VALUES ('1', + 'Default Sales/Discounts', + 'Sales' + )"; $result = DB_query($sql,$db); } - $sql = "INSERT INTO cogsglpostings ( - area, - stkcat, - salestype, - glcode) - VALUES ('AN', - 'ANY', - 'AN', - '1')"; + $sql = "INSERT INTO cogsglpostings ( area, + stkcat, + salestype, + glcode) + VALUES ('AN', + 'ANY', + 'AN', + '1')"; $result = DB_query($sql,$db); } @@ -205,21 +198,21 @@ } printf('<td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td><a href="%sSelectedCOGSPostingID=%s">' . _('Edit') . '</td> - <td><a href="%sSelectedCOGSPostingID=%s&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this COGS GL posting record?') . '\');">' . _('Delete') . '</td> - </tr>', - $myrow['area'], - $myrow['stkcat'], - $myrow['salestype'], - $myrow['salestype'], - $_SERVER['PHP_SELF'] . '?', - $myrow['id'], - $_SERVER['PHP_SELF'] . '?', - $myrow['id']); - + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td><a href="%sSelectedCOGSPostingID=%s">' . _('Edit') . '</td> + <td><a href="%sSelectedCOGSPostingID=%s&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this COGS GL posting record?') . '\');">' . _('Delete') . '</td> + </tr>', + $myrow['area'], + $myrow['stkcat'], + $myrow['salestype'], + $myrow['salestype'], + $_SERVER['PHP_SELF'] . '?', + $myrow['id'], + $_SERVER['PHP_SELF'] . '?', + $myrow['id']); + }//END WHILE LIST LOOP echo '</table>'; } @@ -239,11 +232,11 @@ //editing an existing cost of sales posting record $sql = "SELECT stkcat, - glcode, - area, - salestype - FROM cogsglpostings - WHERE id='".$SelectedCOGSPostingID."'"; + glcode, + area, + salestype + FROM cogsglpostings + WHERE id='".$SelectedCOGSPostingID."'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); @@ -285,7 +278,7 @@ echo '</select></td></tr> <tr><td>' . _('Stock Category') . ':</td> <td><select tabindex=2 name="StkCat"> - <option VALUE="ANY">' . _('Any Other') . '</option>'; + <option value="ANY">' . _('Any Other') . '</option>'; while ($myrow = DB_fetch_array($result)) { if (isset($_POST['StkCat']) and $myrow['categoryid']==$_POST['StkCat']) { Modified: trunk/CompanyPreferences.php =================================================================== --- trunk/CompanyPreferences.php 2011-06-12 09:30:10 UTC (rev 4595) +++ trunk/CompanyPreferences.php 2011-06-13 10:23:44 UTC (rev 4596) @@ -23,7 +23,6 @@ /* actions to take once the user has clicked the submit button ie the page has called itself with some user input */ - //first off validate inputs sensible if (strlen($_POST['CoyName']) > 40 OR strlen($_POST['CoyName'])==0) { @@ -95,33 +94,32 @@ if ($InputError !=1){ - $sql = "UPDATE companies SET - coyname='" . $_POST['CoyName'] . "', - companynumber = '" . $_POST['CompanyNumber'] . "', - gstno='" . $_POST['GSTNo'] . "', - regoffice1='" . $_POST['RegOffice1'] . "', - regoffice2='" . $_POST['RegOffice2'] . "', - regoffice3='" . $_POST['RegOffice3'] . "', - regoffice4='" . $_POST['RegOffice4'] . "', - regoffice5='" . $_POST['RegOffice5'] . "', - regoffice6='" . $_POST['RegOffice6'] . "', - telephone='" . $_POST['Telephone'] . "', - fax='" . $_POST['Fax'] . "', - email='" . $_POST['Email'] . "', - currencydefault='" . $_POST['CurrencyDefault'] . "', - debtorsact='" . $_POST['DebtorsAct'] . "', - pytdiscountact='" . $_POST['PytDiscountAct'] . "', - creditorsact='" . $_POST['CreditorsAct'] . "', - payrollact='" . $_POST['PayrollAct'] . "', - grnact='" . $_POST['GRNAct'] . "', - exchangediffact='" . $_POST['ExchangeDiffAct'] . "', - purchasesexchangediffact='" . $_POST['PurchasesExchangeDiffAct'] . "', - retainedearnings='" . $_POST['RetainedEarnings'] . "', - gllink_debtors='" . $_POST['GLLink_Debtors'] . "', - gllink_creditors='" . $_POST['GLLink_Creditors'] . "', - gllink_stock='" . $_POST['GLLink_Stock'] ."', - freightact='" . $_POST['FreightAct'] . "' - WHERE coycode=1"; + $sql = "UPDATE companies SET coyname='" . $_POST['CoyName'] . "', + companynumber = '" . $_POST['CompanyNumber'] . "', + gstno='" . $_POST['GSTNo'] . "', + regoffice1='" . $_POST['RegOffice1'] . "', + regoffice2='" . $_POST['RegOffice2'] . "', + regoffice3='" . $_POST['RegOffice3'] . "', + regoffice4='" . $_POST['RegOffice4'] . "', + regoffice5='" . $_POST['RegOffice5'] . "', + regoffice6='" . $_POST['RegOffice6'] . "', + telephone='" . $_POST['Telephone'] . "', + fax='" . $_POST['Fax'] . "', + email='" . $_POST['Email'] . "', + currencydefault='" . $_POST['CurrencyDefault'] . "', + debtorsact='" . $_POST['DebtorsAct'] . "', + pytdiscountact='" . $_POST['PytDiscountAct'] . "', + creditorsact='" . $_POST['CreditorsAct'] . "', + payrollact='" . $_POST['PayrollAct'] . "', + grnact='" . $_POST['GRNAct'] . "', + exchangediffact='" . $_POST['ExchangeDiffAct'] . "', + purchasesexchangediffact='" . $_POST['PurchasesExchangeDiffAct'] . "', + retainedearnings='" . $_POST['RetainedEarnings'] . "', + gllink_debtors='" . $_POST['GLLink_Debtors'] . "', + gllink_creditors='" . $_POST['GLLink_Creditors'] . "', + gllink_stock='" . $_POST['GLLink_Stock'] ."', + freightact='" . $_POST['FreightAct'] . "' + WHERE coycode=1"; $ErrMsg = _('The company preferences could not be updated because'); $result = DB_query($sql,$db,$ErrMsg); @@ -136,7 +134,7 @@ $NewCurrencyRate=$myrow[0]; /* Set new rates */ - $sql="UPDATE currencies SET rate=rate/'".$NewCurrencyRate."'"; + $sql="UPDATE currencies SET rate=rate/" . $NewCurrencyRate; $ErrMsg = _('Could not update the currency rates'); $result = DB_query($sql,$db,$ErrMsg); @@ -155,38 +153,38 @@ 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="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<table class=selection>'; +echo '<table class="selection">'; if ($InputError != 1) { - $sql = 'SELECT coyname, - gstno, - companynumber, - regoffice1, - regoffice2, - regoffice3, - regoffice4, - regoffice5, - regoffice6, - telephone, - fax, - email, - currencydefault, - debtorsact, - pytdiscountact, - creditorsact, - payrollact, - grnact, - exchangediffact, - purchasesexchangediffact, - retainedearnings, - gllink_debtors, - gllink_creditors, - gllink_stock, - freightact - FROM companies - WHERE coycode=1'; + $sql = "SELECT coyname, + gstno, + companynumber, + regoffice1, + regoffice2, + regoffice3, + regoffice4, + regoffice5, + regoffice6, + telephone, + fax, + email, + currencydefault, + debtorsact, + pytdiscountact, + creditorsact, + payrollact, + grnact, + exchangediffact, + purchasesexchangediffact, + retainedearnings, + gllink_debtors, + gllink_creditors, + gllink_stock, + freightact + FROM companies + WHERE coycode=1"; $ErrMsg = _('The company preferences could not be retrieved because'); $result = DB_query($sql, $db,$ErrMsg); @@ -222,63 +220,64 @@ } echo '<tr><td>' . _('Name') . ' (' . _('to appear on reports') . '):</td> - <td><input '.(in_array('CoyName',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="1" type="Text" Name="CoyName" value="' . stripslashes($_POST['CoyName']) . '" size=52 maxlength=50></td> + <td><input '.(in_array('CoyName',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="1" type="text" Name="CoyName" value="' . stripslashes($_POST['CoyName']) . '" size=52 maxlength=50></td> </tr>'; echo '<tr><td>' . _('Official Company Number') . ':</td> - <td><input '.(in_array('CoyNumber',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="2" type="Text" Name="CompanyNumber" value="' . $_POST['CompanyNumber'] . '" size=22 maxlength=20></td> + <td><input '.(in_array('CoyNumber',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="2" type="text" name="CompanyNumber" value="' . $_POST['CompanyNumber'] . '" size=22 maxlength=20></td> </tr>'; echo '<tr><td>' . _('Tax Authority Reference') . ':</td> - <td><input '.(in_array('TaxRef',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="3" type="Text" Name="GSTNo" value="' . $_POST['GSTNo'] . '" size=22 maxlength=20></td> + <td><input '.(in_array('TaxRef',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="3" type="text" name="GSTNo" value="' . $_POST['GSTNo'] . '" size=22 maxlength=20></td> </tr>'; echo '<tr><td>' . _('Address Line 1') . ':</td> - <td><input '.(in_array('RegOffice1',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="4" type="Text" Name="RegOffice1" size=42 maxlength=40 value="' . stripslashes($_POST['RegOffice1']) . '"></td> + <td><input '.(in_array('RegOffice1',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="4" type="text" name="RegOffice1" size=42 maxlength=40 value="' . stripslashes($_POST['RegOffice1']) . '"></td> </tr>'; echo '<tr><td>' . _('Address Line 2') . ':</td> - <td><input '.(in_array('RegOffice2',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="5" type="Text" Name="RegOffice2" size=42 maxlength=40 value="' . stripslashes($_POST['RegOffice2']) . '"></td> + <td><input '.(in_array('RegOffice2',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="5" type="text" name="RegOffice2" size=42 maxlength=40 value="' . stripslashes($_POST['RegOffice2']) . '"></td> </tr>'; echo '<tr><td>' . _('Address Line 3') . ':</td> - <td><input '.(in_array('RegOffice3',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="6" type="Text" Name="RegOffice3" size=42 maxlength=40 value="' . stripslashes($_POST['RegOffice3']) . '"></td> + <td><input '.(in_array('RegOffice3',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="6" type="text" name="RegOffice3" size=42 maxlength=40 value="' . stripslashes($_POST['RegOffice3']) . '"></td> </tr>'; echo '<tr><td>' . _('Address Line 4') . ':</td> - <td><input '.(in_array('RegOffice4',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="7" type="Text" Name="RegOffice4" size=42 maxlength=40 value="' . stripslashes($_POST['RegOffice4']) . '"></td> + <td><input '.(in_array('RegOffice4',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="7" type="text" name="RegOffice4" size=42 maxlength=40 value="' . stripslashes($_POST['RegOffice4']) . '"></td> </tr>'; echo '<tr><td>' . _('Address Line 5') . ':</td> - <td><input '.(in_array('RegOffice5',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="8" type="Text" Name="RegOffice5" size=22 maxlength=20 value="' . stripslashes($_POST['RegOffice5']) . '"></td> + <td><input '.(in_array('RegOffice5',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="8" type="text" name="RegOffice5" size=22 maxlength=20 value="' . stripslashes($_POST['RegOffice5']) . '"></td> </tr>'; echo '<tr><td>' . _('Address Line 6') . ':</td> - <td><input '.(in_array('RegOffice6',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="9" type="Text" Name="RegOffice6" size=17 maxlength=15 value="' . stripslashes($_POST['RegOffice6']) . '"></td> + <td><input '.(in_array('RegOffice6',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="9" type="text" name="RegOffice6" size=17 maxlength=15 value="' . stripslashes($_POST['RegOffice6']) . '"></td> </tr>'; echo '<tr><td>' . _('Telephone Number') . ':</td> - <td><input '.(in_array('Telephone',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="10" type="Text" Name="Telephone" size=26 maxlength=25 value="' . $_POST['Telephone'] . '"></td> + <td><input '.(in_array('Telephone',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="10" type="text" name="Telephone" size=26 maxlength=25 value="' . $_POST['Telephone'] . '"></td> </tr>'; echo '<tr><td>' . _('Facsimile Number') . ':</td> - <td><input '.(in_array('Fax',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="11" type="Text" Name="Fax" size=26 maxlength=25 value="' . $_POST['Fax'] . '"></td> + <td><input '.(in_array('Fax',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="11" type="text" name="Fax" size=26 maxlength=25 value="' . $_POST['Fax'] . '"></td> </tr>'; echo '<tr><td>' . _('Email Address') . ':</td> - <td><input '.(in_array('Email',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="12" type="Text" Name="Email" size=50 maxlength=55 value="' . $_POST['Email'] . '"></td> + <td><input '.(in_array('Email',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="12" type="text" name="Email" size=50 maxlength=55 value="' . $_POST['Email'] . '"></td> </tr>'; -$result=DB_query('SELECT currabrev, currency FROM currencies',$db); +$result=DB_query("SELECT currabrev, currency FROM currencies",$db); -echo '<tr><td>' . _('Home Currency') . ':</td><td><select tabindex="13" Name=CurrencyDefault>'; +echo '<tr><td>' . _('Home Currency') . ':</td> + <td><select tabindex="13" name="CurrencyDefault">'; while ($myrow = DB_fetch_array($result)) { if ($_POST['CurrencyDefault']==$myrow['currabrev']){ - echo '<option selected VALUE="'. $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; + echo '<option selected value="'. $myrow['currabrev'] . '">' . $myrow['currency'] . '</opti... [truncated message content] |