From: <tim...@us...> - 2010-07-03 21:45:24
|
Revision: 3550 http://web-erp.svn.sourceforge.net/web-erp/?rev=3550&view=rev Author: tim_schofield Date: 2010-07-03 21:45:18 +0000 (Sat, 03 Jul 2010) Log Message: ----------- Layout changes Modified Paths: -------------- trunk/BOMExtendedQty.php trunk/doc/Change.log.html Modified: trunk/BOMExtendedQty.php =================================================================== --- trunk/BOMExtendedQty.php 2010-07-03 21:44:57 UTC (rev 3549) +++ trunk/BOMExtendedQty.php 2010-07-03 21:45:18 UTC (rev 3550) @@ -8,7 +8,7 @@ $PageSecurity = 2; include('includes/session.inc'); -If (isset($_POST['PrintPDF'])) { +if (isset($_POST['PrintPDF'])) { include('includes/PDFStarter.php'); $pdf->addInfo('Title',_('Quantity Extended BOM Listing')); @@ -282,8 +282,9 @@ $title=_('Quantity Extended BOM Listing'); include('includes/header.inc'); + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="">' . ' ' . $title.'<br>'; - echo '</br></br><form action=' . $_SERVER['PHP_SELF'] . " method='post'><table>"; + echo '</br></br><form action=' . $_SERVER['PHP_SELF'] . " method='post'><table class=selection>"; echo '<tr><td>' . _('Part') . ":</td><td><input type ='text' name='Part' size='20'>"; echo '<tr><td>' . _('Quantity') . ":</td><td><input type='text' class=number name='Quantity' size='4'>"; echo '<tr><td>' . _('Selection Option') . ":</td><td><select name='Select'>"; @@ -294,7 +295,7 @@ echo "<option selected value='yes'>" . _('Print With Alternating Highlighted Lines'); echo "<option value='no'>" . _('Plain Print'); echo '</select></td></tr>'; - echo "</table></br></br><div class='centre'><input type=submit name='PrintPDF' value='" . _('Print PDF') . "'></div>"; + echo "</table></br></br><div class='centre'><br><input type=submit name='PrintPDF' value='" . _('Print PDF') . "'></div>"; include('includes/footer.inc'); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-07-03 21:44:57 UTC (rev 3549) +++ trunk/doc/Change.log.html 2010-07-03 21:45:18 UTC (rev 3550) @@ -1,5 +1,7 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>03/07/10 Tim: BOMExtendedQty.php - Layout changes </p> +<p>03/07/10 Tim: BankReconciliation.php - Corrections to sql statements and layout changes </p> <p>03/07/10 Tim: BankMatching.php - Corrections to sql statements and layout changes</p> <p>03/07/10 Tim: BankAccounts.php - Layout changes</p> <p>03/07/10 Tim: AddCustomerTypeNotes.php - Layout changes and verify Type ID before query</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-07-03 21:45:41
|
Revision: 3551 http://web-erp.svn.sourceforge.net/web-erp/?rev=3551&view=rev Author: tim_schofield Date: 2010-07-03 21:45:36 +0000 (Sat, 03 Jul 2010) Log Message: ----------- Layout changes Modified Paths: -------------- trunk/BOMIndented.php trunk/doc/Change.log.html Modified: trunk/BOMIndented.php =================================================================== --- trunk/BOMIndented.php 2010-07-03 21:45:18 UTC (rev 3550) +++ trunk/BOMIndented.php 2010-07-03 21:45:36 UTC (rev 3551) @@ -8,7 +8,7 @@ $PageSecurity = 2; include('includes/session.inc'); -If (isset($_POST['PrintPDF'])) { +if (isset($_POST['PrintPDF'])) { include('includes/PDFStarter.php'); $pdf->addInfo('Title',_('Indented BOM Listing')); @@ -185,7 +185,7 @@ $ListCount = DB_num_rows($result); // UldisN - While ($myrow = DB_fetch_array($result,$db)){ + while ($myrow = DB_fetch_array($result,$db)){ $YPos -=$line_height; $FontSize=8; @@ -258,8 +258,9 @@ $title=_('Indented BOM Listing'); include('includes/header.inc'); + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="">' . ' ' . $title.'<br>'; - echo '</br></br><form action=' . $_SERVER['PHP_SELF'] . " method='post'><table>"; + echo '</br></br><form action=' . $_SERVER['PHP_SELF'] . " method='post'><table class=selection>"; echo '<tr><td>' . _('Part') . ":</td>"; echo "<td><input type ='text' name='Part' size='20'>"; @@ -272,7 +273,7 @@ echo "<option selected value='yes'>" . _('Print With Alternating Highlighted Lines'); echo "<option value='no'>" . _('Plain Print'); echo '</select></td></tr>'; - echo "</table></br></br><div class='centre'><input type=submit name='PrintPDF' value='" . _('Print PDF') . "'></div>"; + echo "</table><p><div class='centre'><input type=submit name='PrintPDF' value='" . _('Print PDF') . "'></div>"; include('includes/footer.inc'); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-07-03 21:45:18 UTC (rev 3550) +++ trunk/doc/Change.log.html 2010-07-03 21:45:36 UTC (rev 3551) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>03/07/10 Tim: BOMIndented.php - Layout changes </p> <p>03/07/10 Tim: BOMExtendedQty.php - Layout changes </p> <p>03/07/10 Tim: BankReconciliation.php - Corrections to sql statements and layout changes </p> <p>03/07/10 Tim: BankMatching.php - Corrections to sql statements and layout changes</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-07-03 21:45:58
|
Revision: 3552 http://web-erp.svn.sourceforge.net/web-erp/?rev=3552&view=rev Author: tim_schofield Date: 2010-07-03 21:45:52 +0000 (Sat, 03 Jul 2010) Log Message: ----------- Layout changes Modified Paths: -------------- trunk/BOMIndentedReverse.php trunk/doc/Change.log.html Modified: trunk/BOMIndentedReverse.php =================================================================== --- trunk/BOMIndentedReverse.php 2010-07-03 21:45:36 UTC (rev 3551) +++ trunk/BOMIndentedReverse.php 2010-07-03 21:45:52 UTC (rev 3552) @@ -253,14 +253,15 @@ $title=_('Reverse Indented BOM Listing'); include('includes/header.inc'); - echo '</br></br><form action=' . $_SERVER['PHP_SELF'] . " method='post'><table>"; + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="">' . ' ' . $title.'<br>'; + echo '</br></br><form action=' . $_SERVER['PHP_SELF'] . " method='post'><table class=selection>"; echo '<tr><td>' . _('Part') . ":</td>"; echo "<td><input type ='text' name='Part' size='20'>"; echo '<tr><td>' . _('Print Option') . ":</td><td><select name='Fill'>"; echo "<option selected value='yes'>" . _('Print With Alternating Highlighted Lines'); echo "<option value='no'>" . _('Plain Print'); echo '</select></td></tr>'; - echo "</table></br></br><div class='centre'><input type=submit name='PrintPDF' value='" . _('Print PDF') . "'></div>"; + echo "</table><p><div class='centre'><input type=submit name='PrintPDF' value='" . _('Print PDF') . "'></div>"; include('includes/footer.inc'); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-07-03 21:45:36 UTC (rev 3551) +++ trunk/doc/Change.log.html 2010-07-03 21:45:52 UTC (rev 3552) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>03/07/10 Tim: BOMIndentedReverse.php - Layout changes </p> <p>03/07/10 Tim: BOMIndented.php - Layout changes </p> <p>03/07/10 Tim: BOMExtendedQty.php - Layout changes </p> <p>03/07/10 Tim: BankReconciliation.php - Corrections to sql statements and layout changes </p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-07-03 21:46:25
|
Revision: 3553 http://web-erp.svn.sourceforge.net/web-erp/?rev=3553&view=rev Author: tim_schofield Date: 2010-07-03 21:46:19 +0000 (Sat, 03 Jul 2010) Log Message: ----------- Minor bug fixes and layout changes Modified Paths: -------------- trunk/BOMInquiry.php trunk/doc/Change.log.html Modified: trunk/BOMInquiry.php =================================================================== --- trunk/BOMInquiry.php 2010-07-03 21:45:52 UTC (rev 3552) +++ trunk/BOMInquiry.php 2010-07-03 21:46:19 UTC (rev 3553) @@ -19,7 +19,7 @@ _('to view the costed bill of materials') . "." . "<br><font size=1>" . _('Parts must be defined in the stock item entry') . "/" . _('modification screen as manufactured') . ", " . _('kits or assemblies to be available for construction of a bill of material').'</div>' - ."</font><br><table align='center' cellpadding=3 colspan=4><tr><td><font size=1>" . _('Enter text extracts in the') . + ."</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> @@ -85,9 +85,9 @@ } //one of keywords or StockCode was more than a zero length string } //end of if search -if (isset($result) AND !isset($SelectedParent)) { +if (isset($_POST['Search']) and isset($result) AND !isset($SelectedParent)) { - echo '<br><hr><br><table align="center" cellpadding=2 colspan=7 BORDER=1>'; + echo '<br><hr><br><table class=selection cellpadding=2 colspan=7>'; $TableHeader = '<tr><th>' . _('Code') . '</th> <th>' . _('Description') . '</th> <th>' . _('On Hand') . '</th> @@ -127,7 +127,6 @@ //end of while loop echo '</table><br>'; - } if (isset($StockID) and $StockID!=""){ @@ -141,7 +140,6 @@ $ParentOverheadCost = $myrow['overheadcost']; /*CCF end modification */ - echo "<div class='centre'><br><font size=4><b>" . $myrow[0] . ' : ' . _('per') . ' ' . $myrow[1] . "</b></font></div>"; $sql = "SELECT bom.parent, bom.component, @@ -161,8 +159,12 @@ if (DB_num_rows($BOMResult)==0){ 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.'<br>'; - echo "<table cellpadding=2 border=2>"; + 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> @@ -235,4 +237,4 @@ echo '</form>'; include('includes/footer.inc'); -?> \ No newline at end of file +?> Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-07-03 21:45:52 UTC (rev 3552) +++ trunk/doc/Change.log.html 2010-07-03 21:46:19 UTC (rev 3553) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>03/07/10 Tim: BOMInquiry.php - Minor bug fixes and layout changes </p> <p>03/07/10 Tim: BOMIndentedReverse.php - Layout changes </p> <p>03/07/10 Tim: BOMIndented.php - Layout changes </p> <p>03/07/10 Tim: BOMExtendedQty.php - Layout changes </p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-07-04 21:59:30
|
Revision: 3554 http://web-erp.svn.sourceforge.net/web-erp/?rev=3554&view=rev Author: tim_schofield Date: 2010-07-04 21:59:23 +0000 (Sun, 04 Jul 2010) Log Message: ----------- Minor layout changes Modified Paths: -------------- trunk/BOMListing.php trunk/doc/Change.log.html Modified: trunk/BOMListing.php =================================================================== --- trunk/BOMListing.php 2010-07-03 21:46:19 UTC (rev 3553) +++ trunk/BOMListing.php 2010-07-04 21:59:23 UTC (rev 3554) @@ -130,7 +130,7 @@ /*if $FromCriteria is not set then show a form to allow input */ - echo '<form action=' . $_SERVER['PHP_SELF'] . " method='POST'><table>"; + echo '<form action=' . $_SERVER['PHP_SELF'] . " method='POST'><table class=selection>"; echo '<tr><td>' . _('From Inventory Part Code') . ':' . "</font></td><td><input tabindex='1' type=text name=FromCriteria size=20 maxlength=20 VALUE='1'></td></tr>"; @@ -144,4 +144,4 @@ } /*end of else not PrintPDF */ -?> \ No newline at end of file +?> Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-07-03 21:46:19 UTC (rev 3553) +++ trunk/doc/Change.log.html 2010-07-04 21:59:23 UTC (rev 3554) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>03/07/10 Tim: BOMListing.php - Minor layout changes </p> <p>03/07/10 Tim: BOMInquiry.php - Minor bug fixes and layout changes </p> <p>03/07/10 Tim: BOMIndentedReverse.php - Layout changes </p> <p>03/07/10 Tim: BOMIndented.php - Layout changes </p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-07-04 21:59:54
|
Revision: 3555 http://web-erp.svn.sourceforge.net/web-erp/?rev=3555&view=rev Author: tim_schofield Date: 2010-07-04 21:59:47 +0000 (Sun, 04 Jul 2010) Log Message: ----------- Corrections to sql statements and layout changes Modified Paths: -------------- trunk/BOMs.php trunk/doc/Change.log.html Modified: trunk/BOMs.php =================================================================== --- trunk/BOMs.php 2010-07-04 21:59:23 UTC (rev 3554) +++ trunk/BOMs.php 2010-07-04 21:59:47 UTC (rev 3555) @@ -53,7 +53,7 @@ /* returns true ie 1 if the BOM contains the parent part as a component ie the BOM is recursive otherwise false ie 0 */ - $sql = "SELECT component FROM bom WHERE parent='$ComponentToCheck'"; + $sql = "SELECT component FROM bom WHERE parent='".$ComponentToCheck."'"; $ErrMsg = _('An error occurred in retrieving the components of the BOM during the check for recursion'); $DbgMsg = _('The SQL that was used to retrieve the components of the BOM and that failed in the process was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); @@ -94,8 +94,8 @@ locations, workcentres, locstock - WHERE bom.component='$Component' - AND bom.parent = '$Parent' + WHERE bom.component='".$Component."' + AND bom.parent = '".$Parent."' AND bom.component=stockmaster.stockid AND bom.loccode = locations.loccode AND locstock.loccode=bom.loccode @@ -115,7 +115,7 @@ $Level1 = str_repeat('- ',$Level-1).$Level; if( $myrow[7]=='B' OR $myrow[7]=='K' OR $myrow[7]=='D') { $DrillText = '%s%s'; - $DrillLink = '<div class="centre">----</div>'; + $DrillLink = '<div class="centre">'._('No lower levels').'</div>'; $DrillID=''; } else { $DrillText = '<a href="%s&Select=%s">' . _('Drill Down'); @@ -213,7 +213,7 @@ unset($Select);// = NULL; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="">' . ' ' . $title.'<br>'; - If (isset($SelectedParent) AND isset($_POST['Submit'])) { + if (isset($SelectedParent) AND isset($_POST['Submit'])) { //editing a component need to do some validation of inputs @@ -275,8 +275,8 @@ loccode='" . $_POST['LocCode'] . "', effectiveafter='" . $EffectiveAfterSQL . "', effectiveto='" . $EffectiveToSQL . "', - quantity= " . $_POST['Quantity'] . ", - autoissue=" . $_POST['AutoIssue'] . " + quantity= '" . $_POST['Quantity'] . "', + autoissue='" . $_POST['AutoIssue'] . "' WHERE bom.parent='" . $SelectedParent . "' AND bom.component='" . $SelectedComponent . "'"; @@ -287,18 +287,18 @@ $msg = _('Details for') . ' - ' . $SelectedComponent . ' ' . _('have been updated') . '.'; UpdateCost($db, $SelectedComponent); - } elseIf ($InputError !=1 AND ! isset($SelectedComponent) AND isset($SelectedParent)) { + } elseif ($InputError !=1 AND ! isset($SelectedComponent) AND isset($SelectedParent)) { /*Selected component is null cos no item selected on first time round so must be adding a record must be Submitting new entries in the new component form */ //need to check not recursive BOM component of itself! - If (!CheckForRecursiveBOM ($SelectedParent, $_POST['Component'], $db)) { + if (!CheckForRecursiveBOM ($SelectedParent, $_POST['Component'], $db)) { /*Now check to see that the component is not already on the BOM */ $sql = "SELECT component FROM bom - WHERE parent='$SelectedParent' + WHERE parent='".$SelectedParent."' AND component='" . $_POST['Component'] . "' AND workcentreadded='" . $_POST['WorkCentreAdded'] . "' AND loccode='" . $_POST['LocCode'] . "'" ; @@ -318,7 +318,7 @@ effectiveafter, effectiveto, autoissue) - VALUES ('$SelectedParent', + VALUES ('".$SelectedParent."', '" . $_POST['Component'] . "', '" . $_POST['WorkCentreAdded'] . "', '" . $_POST['LocCode'] . "', @@ -355,7 +355,7 @@ //the link to delete a selected record was clicked instead of the Submit button - $sql="DELETE FROM bom WHERE parent='$SelectedParent' AND component='$SelectedComponent'"; + $sql="DELETE FROM bom WHERE parent='".$SelectedParent."' AND component='".$SelectedComponent."'"; $ErrMsg = _('Could not delete this BOM components because'); $DbgMsg = _('The SQL used to delete the BOM was'); @@ -373,7 +373,7 @@ AND !isset($SelectedComponent) AND ! isset($_POST['submit'])) { - /* It could still be the second time the page has been run and a record has been selected for modification - SelectedParent will exist because it was sent with the new call. If its the first time the page has been displayed with no parameters then none of the above are true and the list of components will be displayed with links to delete or edit each. These will call the same page again and allow update/input or deletion of the records*/ + /* It could still be the second time the page has been run and a record has been selected for modification - SelectedParent will exist because it was sent with the new call. if its the first time the page has been displayed with no parameters then none of the above are true and the list of components will be displayed with links to delete or edit each. These will call the same page again and allow update/input or deletion of the records*/ //DisplayBOMItems($SelectedParent, $db); } //BOM editing/insertion ifs @@ -415,14 +415,8 @@ break; } - echo "<div class='centre'><br><font color=BLUE size=3><b> $SelectedParent - " . $myrow[0] . ' ('. $MBdesc. ') </font></b>'; - - echo '<br><a href=' . $_SERVER['PHP_SELF'] . '?' . SID . '>' . _('Select a Different BOM') . '</a></div>'; - - if (isset($SelectedParent)) { - echo "<div class='centre'><a href='" . $_SERVER['PHP_SELF'] . '?' . SID . "Select=$SelectedParent'>" . _('Review Components') . '</a></div>'; - } - + echo '<br><div class=centre><a href=' . $_SERVER['PHP_SELF'] . '?' . SID . '>' . _('Select a Different BOM') . '</a></div><br>'; + echo '<table class=selection>'; // Display Manufatured Parent Items $sql = "SELECT bom.parent, stockmaster.description, @@ -438,13 +432,13 @@ $ix = 0; $reqnl = 0; if( DB_num_rows($result) > 0 ) { - echo '<div class="centre">'._('Manufactured parent items').' : '; + 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'].'">'. $myrow['description'].' ('.$myrow['parent'].')</a>'; $ix++; } //end while loop - echo '</div>'; + echo '</div></td></tr>'; $reqnl = $ix; } // Display Assembly Parent Items @@ -458,14 +452,14 @@ $DbgMsg = _('The SQL used to retrieve description of the parent part was'); $result=DB_query($sql,$db,$ErrMsg,$DbgMsg); if( DB_num_rows($result) > 0 ) { - echo (($reqnl)?'<br>':'').'<div class="centre">'._('Assembly parent items').' : '; + 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'].'">'. $myrow['description'].' ('.$myrow['parent'].')</a>'; $ix++; } //end while loop - echo '</div>'; + echo '</div></td></tr>'; } // Display Kit Sets $sql = "SELECT bom.parent, stockmaster.description, stockmaster.mbflag @@ -478,14 +472,14 @@ $DbgMsg = _('The SQL used to retrieve description of the parent part was'); $result=DB_query($sql,$db,$ErrMsg,$DbgMsg); if( DB_num_rows($result) > 0 ) { - echo (($reqnl)?'<br>':'').'<div class="centre">'._('Kit sets').' : '; + 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'].'">'. $myrow['description'].' ('.$myrow['parent'].')</a>'; $ix++; } //end while loop - echo '</div>'; + echo '</div></td></tr>'; } // Display Phantom/Ghosts $sql = "SELECT bom.parent, stockmaster.description, stockmaster.mbflag @@ -498,16 +492,17 @@ $DbgMsg = _('The SQL used to retrieve description of the parent part was'); $result=DB_query($sql,$db,$ErrMsg,$DbgMsg); if( DB_num_rows($result) > 0 ) { - echo (($reqnl)?'<br>':'').'<div class="centre">'._('Phantom').' : '; + 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'].'">'. $myrow['description'].' ('.$myrow['parent'].')</a>'; $ix++; } //end while loop - echo '</div>'; + echo '</div></td></tr>'; } - echo "<table border=1>"; + echo "</table><br><table class=selection>"; + echo "<tr><th colspan=13><div class='centre'><font color=blue size=3><b>".$SelectedParent ." - " . $myrow[0] . ' ('. $MBdesc. ') </font></b></th></tr>'; // *** POPAD&T $BOMTree = array(); @@ -557,7 +552,7 @@ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '&Select=' . $SelectedParent .'">'; - if (isset($SelectedComponent) and $InputError !=1) { + if (isset($_GET['SelectedComponent']) and $InputError !=1) { //editing a selected component from the link to the line item $sql = "SELECT loccode, @@ -567,8 +562,8 @@ quantity, autoissue FROM bom - WHERE parent='$SelectedParent' - AND component='$SelectedComponent'"; + WHERE parent='".$SelectedParent."' + AND component='".$SelectedComponent."'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); @@ -583,14 +578,18 @@ prnMsg(_('Edit the details of the selected component in the fields below') . '. <br>' . _('Click on the Enter Information button to update the component details'),'info'); echo "<br><input type=hidden name='SelectedParent' VALUE='$SelectedParent'>"; echo "<input type=hidden name='SelectedComponent' VALUE='$SelectedComponent'>"; - echo '<table><tr><td>' . _('Component') . ':</td><td><b>' . $SelectedComponent . '</b></td></tr>'; + 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>'; } 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><tr><td>' . _('Component code') . ':</td><td>'; + 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'>"; @@ -604,7 +603,7 @@ AND stockmaster.mbflag !='K' AND stockmaster.mbflag !='A' AND stockmaster.controlled = 0 - AND stockmaster.stockid != '$SelectedParent' + AND stockmaster.stockid != '".$SelectedParent."' ORDER BY stockmaster.stockid"; } else { /*Its either a normal manufac item, phantom, kitset - controlled items ok */ @@ -616,7 +615,7 @@ OR stockmaster.mbflag !='D') AND stockmaster.mbflag !='K' AND stockmaster.mbflag !='A' - AND stockmaster.stockid != '$SelectedParent' + AND stockmaster.stockid != '".$SelectedParent."' ORDER BY stockmaster.stockid"; } @@ -721,7 +720,7 @@ echo '<input type=hidden name="AutoIssue" VALUE=0>'; } - echo "</table><br><div class='centre'><input tabindex='8' type='Submit' name='Submit' value=" . _('Enter Information') . "></form></div>"; + echo "</table><br><div class='centre'><input tabindex='8' type='Submit' name='Submit' value='" . _('Enter Information') . "'></form></div>"; } //end if record deleted no point displaying form to add record @@ -730,16 +729,16 @@ } elseif (isset($_POST['Search'])){ // Work around to auto select - If ($_POST['Keywords']=='' AND $_POST['StockCode']=='') { + if ($_POST['Keywords']=='' AND $_POST['StockCode']=='') { $_POST['StockCode']='%'; } - If ($_POST['Keywords'] AND $_POST['StockCode']) { + if ($_POST['Keywords'] AND $_POST['StockCode']) { $msg=_('Stock description keywords have been used in preference to the Stock code extract entered'); } - If ($_POST['Keywords']=='' AND $_POST['StockCode']=='') { + if ($_POST['Keywords']=='' AND $_POST['StockCode']=='') { $msg=_('At least one stock description keyword or an extract of a stock code must be entered for the search'); } else { - If (strlen($_POST['Keywords'])>0) { + if (strlen($_POST['Keywords'])>0) { //insert wildcard characters in spaces $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; @@ -751,7 +750,7 @@ FROM stockmaster, locstock WHERE stockmaster.stockid = locstock.stockid - AND stockmaster.description " . LIKE . " '$SearchString' + AND stockmaster.description " . LIKE . " '".$SearchString."' AND (stockmaster.mbflag='M' OR stockmaster.mbflag='K' OR stockmaster.mbflag='A' OR stockmaster.mbflag='G') GROUP BY stockmaster.stockid, stockmaster.description, @@ -795,15 +794,15 @@ _('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 cellpadding=3 colspan=4><tr><td><font size=1>" . _('Enter text extracts in the') . + "</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=18></td> </tr></table><br><div class='centre'><input tabindex='3' type=submit name='Search' VALUE=" . _('Search Now') . "></div>"; -If (isset($result) AND !isset($SelectedParent)) { +if (isset($_POST['Search']) and isset($result) AND !isset($SelectedParent)) { - echo '<br><table cellpadding=2 colspan=7 border=1>'; + echo '<br><table cellpadding=2 colspan=7 class=selection>'; $TableHeader = '<tr><th>' . _('Code') . '</th> <th>' . _('Description') . '</th> <th>' . _('On Hand') . '</th> @@ -859,4 +858,4 @@ } //end StockID already selected include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-07-04 21:59:23 UTC (rev 3554) +++ trunk/doc/Change.log.html 2010-07-04 21:59:47 UTC (rev 3555) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>03/07/10 Tim: BOMs.php - Corrections to sql statements and layout changes</p> <p>03/07/10 Tim: BOMListing.php - Minor layout changes </p> <p>03/07/10 Tim: BOMInquiry.php - Minor bug fixes and layout changes </p> <p>03/07/10 Tim: BOMIndentedReverse.php - Layout changes </p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-07-04 22:00:19
|
Revision: 3556 http://web-erp.svn.sourceforge.net/web-erp/?rev=3556&view=rev Author: tim_schofield Date: 2010-07-04 22:00:12 +0000 (Sun, 04 Jul 2010) Log Message: ----------- Corrections to sql statements and layout changes Modified Paths: -------------- trunk/COGSGLPostings.php trunk/doc/Change.log.html Modified: trunk/COGSGLPostings.php =================================================================== --- trunk/COGSGLPostings.php 2010-07-04 21:59:47 UTC (rev 3555) +++ trunk/COGSGLPostings.php 2010-07-04 22:00:12 UTC (rev 3556) @@ -17,6 +17,8 @@ $SelectedCOGSPostingID=$_GET['SelectedCOGSPostingID']; } +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="">' . ' ' . $title.'<br>'; + if (isset($_POST['submit'])) { /* actions to take once the user has clicked the submit button @@ -31,7 +33,7 @@ area = '" . $_POST['Area'] . "', stkcat = '" . $_POST['StkCat'] . "', salestype='" . $_POST['SalesType'] . "' - WHERE id = $SelectedCOGSPostingID"; + WHERE id ='" .$SelectedCOGSPostingID."'"; $msg = _('Cost of sales GL posting code has been updated'); } else { @@ -44,7 +46,7 @@ stkcat, salestype) VALUES ( - " . $_POST['GLCode'] . ", + '" . $_POST['GLCode'] . "', '" . $_POST['Area'] . "', '" . $_POST['StkCat'] . "', '" . $_POST['SalesType'] . "' @@ -55,14 +57,16 @@ $result = DB_query($sql,$db); prnMsg ($msg,'info'); + echo '<br>'; unset ($SelectedCOGSPostingID); } elseif (isset($_GET['delete'])) { //the link to delete a selected record was clicked instead of the submit button - $sql="DELETE FROM cogsglpostings WHERE id=$SelectedCOGSPostingID"; + $sql="DELETE FROM cogsglpostings WHERE id='".$SelectedCOGSPostingID."'"; $result = DB_query($sql,$db); prnMsg( _('The cost of sales posting code record has been deleted'),'info'); + echo '<br>'; unset ($SelectedCOGSPostingID); } @@ -70,28 +74,28 @@ if (!isset($SelectedCOGSPostingID)) { $ShowLivePostingRecords = true; - + $sql = 'SELECT cogsglpostings.id, cogsglpostings.area, cogsglpostings.stkcat, cogsglpostings.salestype, chartmaster.accountname - FROM cogsglpostings LEFT JOIN chartmaster + FROM cogsglpostings LEFT JOIN chartmaster ON cogsglpostings.glcode = chartmaster.accountcode WHERE chartmaster.accountcode IS NULL'; - + $result = DB_query($sql,$db); if (DB_num_rows($result)>0){ $ShowLivePostingRecords = false; prnMsg (_('The following cost of sales posting records that do not have valid general ledger code specified - these records must be amended.'),'error'); - echo '<table border=1>'; + echo '<table class=selection>'; echo "<tr><th>" . _('Area') . "</th> <th>" . _('Stock Category') . "</th> <th>" . _('Sales Type') . "</th> <th>" . _('COGS Account') . "</th> </tr>"; $k=0; //row colour counter - + while ($myrow = DB_fetch_row($result)) { if ($k==1){ echo '<tr class="EvenTableRows">'; @@ -100,7 +104,7 @@ echo '<tr class="OddTableRows">'; $k=1; } - + printf("<td>%s</td> <td>%s</td> <td>%s</td> @@ -115,7 +119,7 @@ $myrow[0], $_SERVER['PHP_SELF']. '?' . SID . '&', $myrow[0]); - }//end while + }//end while echo '</table>'; } @@ -124,7 +128,7 @@ cogsglpostings.stkcat, cogsglpostings.salestype FROM cogsglpostings'; - + $result = DB_query($sql,$db); if (DB_num_rows($result)==0){ @@ -135,18 +139,18 @@ 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 + groupname, + sectioninaccounts, + pandl, + sequenceintb ) VALUES ( 'Sales', 1, 1, 10)"; - - $result = DB_query($sql,$db); - } + + $result = DB_query($sql,$db); + } $sql = 'SELECT accountcode FROM chartmaster WHERE accountcode =1'; $result = DB_query($sql,$db); if (DB_num_rows($result)==0){ @@ -170,9 +174,9 @@ salestype, glcode) VALUES ('AN', - 'ANY', + 'ANY', 'AN', - 1)"; + 1)"; $result = DB_query($sql,$db); } @@ -185,10 +189,10 @@ FROM cogsglpostings, chartmaster WHERE cogsglpostings.glcode = chartmaster.accountcode'; - + $result = DB_query($sql,$db); - - echo '<table border=1>'; + + echo '<table class=selection>'; echo '<tr><th>' . _('Area') . '</th><th>' . _('Stock Category') . '</th><th>' . _('Sales Type') . @@ -196,7 +200,7 @@ '</th></tr>'; $k = 0; - + while ($myrow = DB_fetch_row($result)) { if ($k==1){ echo '<tr class="EvenTableRows">'; @@ -205,7 +209,7 @@ echo '<tr class="OddTableRows">'; $k++; } - + printf("<td>%s</td> <td>%s</td> <td>%s</td> @@ -221,127 +225,124 @@ $myrow[0], $_SERVER['PHP_SELF'] . '?' . SID . '&', $myrow[0]); - + }//END WHILE LIST LOOP echo '</table>'; } } //end of ifs and buts! -if (isset($SelectedCOGSPostingID)) { +if (isset($SelectedCOGSPostingID)) { echo "<div class='centre'><a href=" . $_SERVER['PHP_SELF'] .">" . _('Show all cost of sales posting records') . "</a></div>"; } echo "<p>"; -if (!isset($_GET['delete'])) { +echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . ">"; - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . ">"; +if (isset($SelectedCOGSPostingID)) { + //editing an existing cost of sales posting record - if (isset($SelectedCOGSPostingID)) { - //editing an existing cost of sales posting record + $sql = "SELECT stkcat, + glcode, + area, + salestype + FROM cogsglpostings + WHERE id='".$SelectedCOGSPostingID."'"; - $sql = "SELECT stkcat, - glcode, - area, - salestype - FROM cogsglpostings - WHERE id=$SelectedCOGSPostingID"; + $result = DB_query($sql, $db); + $myrow = DB_fetch_array($result); - $result = DB_query($sql, $db); - $myrow = DB_fetch_array($result); + $_POST['GLCode'] = $myrow['glcode']; + $_POST['Area'] = $myrow['area']; + $_POST['StkCat'] = $myrow['stkcat']; + $_POST['SalesType'] = $myrow['salestype']; - $_POST['GLCode'] = $myrow['glcode']; - $_POST['Area'] = $myrow['area']; - $_POST['StkCat'] = $myrow['stkcat']; - $_POST['SalesType'] = $myrow['salestype']; + echo '<input type=hidden name="SelectedCOGSPostingID" VALUE="' . $SelectedCOGSPostingID . '">'; - echo '<input type=hidden name="SelectedCOGSPostingID" VALUE="' . $SelectedCOGSPostingID . '">'; +} //end of if $SelectedCOGSPostingID only do the else when a new record is being entered - } //end of if $SelectedCOGSPostingID only do the else when a new record is being entered +$sql = "SELECT areacode, + areadescription + FROM areas"; +$result = DB_query($sql,$db); - $sql = "SELECT areacode, - areadescription - FROM areas"; - $result = DB_query($sql,$db); +echo "<table class=selection><tr><td>" . _('Area') . ":</td><td><select tabindex=1 name='Area'><option value='AN'>" . _('Any Other'); - echo "<table><tr><td>" . _('Area') . ":</td><td><select tabindex=1 name='Area'><option value='AN'>" . _('Any Other'); +while ($myrow = DB_fetch_array($result)) { + if (isset($_POST['Area']) and $myrow['areacode']==$_POST['Area']) { + echo "<option selected VALUE='"; + } else { + echo "<option VALUE='"; + } + echo $myrow['areacode'] . "'>" . $myrow['areadescription']; - while ($myrow = DB_fetch_array($result)) { - if (isset($_POST['Area']) and $myrow['areacode']==$_POST['Area']) { - echo "<option selected VALUE='"; - } else { - echo "<option VALUE='"; - } - echo $myrow['areacode'] . "'>" . $myrow['areadescription']; +} //end while loop +DB_free_result($result); - } //end while loop - DB_free_result($result); +$sql = 'SELECT categoryid, categorydescription FROM stockcategory'; +$result = DB_query($sql,$db); - $sql = 'SELECT categoryid, categorydescription FROM stockcategory'; - $result = DB_query($sql,$db); +echo "</select></td></tr><tr><td>" . _('Stock Category') . ":</td><td><select tabindex=2 name='StkCat'> + <option VALUE='ANY'>" . _('Any Other'); - echo "</select></td></tr><tr><td>" . _('Stock Category') . ":</td><td><select tabindex=2 name='StkCat'> - <option VALUE='ANY'>" . _('Any Other'); +while ($myrow = DB_fetch_array($result)) { + if (isset($_POST['StkCat']) and $myrow["categoryid"]==$_POST['StkCat']) { + echo "<option selected VALUE='"; + } else { + echo "<option VALUE='"; + } + echo $myrow['categoryid'] . "'>" . $myrow['categorydescription']; - while ($myrow = DB_fetch_array($result)) { - if (isset($_POST['StkCat']) and $myrow["categoryid"]==$_POST['StkCat']) { - echo "<option selected VALUE='"; - } else { - echo "<option VALUE='"; - } - echo $myrow['categoryid'] . "'>" . $myrow['categorydescription']; +} //end while loop - } //end while loop +DB_free_result($result); - DB_free_result($result); +$sql = 'SELECT typeabbrev, sales_type FROM salestypes'; +$result = DB_query($sql,$db); - $sql = 'SELECT typeabbrev, sales_type FROM salestypes'; - $result = DB_query($sql,$db); +echo "</select></td></tr><tr><td>" . _('Sales Type') . " / " . _('Price List') . ":</td> + <td><select tabindex=3 name='SalesType'><option VALUE='AN'>" . _('Any Other'); - echo "</select></td></tr><tr><td>" . _('Sales Type') . " / " . _('Price List') . ":</td> - <td><select tabindex=3 name='SalesType'><option VALUE='AN'>" . _('Any Other'); +while ($myrow = DB_fetch_array($result)) { + if (isset($_POST['SalesType']) and $myrow['typeabbrev']==$_POST['SalesType']) { + echo "<option selected VALUE='"; + } else { + echo "<option VALUE='"; + } + echo $myrow["typeabbrev"] . "'>" . $myrow['sales_type']; - while ($myrow = DB_fetch_array($result)) { - if (isset($_POST['SalesType']) and $myrow['typeabbrev']==$_POST['SalesType']) { - echo "<option selected VALUE='"; - } else { - echo "<option VALUE='"; - } - echo $myrow["typeabbrev"] . "'>" . $myrow['sales_type']; +} //end while loop - } //end while loop +echo "</select></td></tr><tr><td>" . _('Post to GL account') . ":</td><td><select tabindex=4 name='GLCode'>"; - echo "</select></td></tr><tr><td>" . _('Post to GL account') . ":</td><td><select tabindex=4 name='GLCode'>"; +DB_free_result($result); +$sql = "SELECT chartmaster.accountcode, + chartmaster.accountname + FROM chartmaster, + accountgroups + WHERE chartmaster.group_=accountgroups.groupname + AND accountgroups.pandl=1 + ORDER BY accountgroups.sequenceintb, + chartmaster.accountcode, + chartmaster.accountname"; +$result = DB_query($sql,$db); - DB_free_result($result); - $sql = "SELECT chartmaster.accountcode, - chartmaster.accountname - FROM chartmaster, - accountgroups - WHERE chartmaster.group_=accountgroups.groupname - AND accountgroups.pandl=1 - ORDER BY accountgroups.sequenceintb, - chartmaster.accountcode, - chartmaster.accountname"; - $result = DB_query($sql,$db); +while ($myrow = DB_fetch_array($result)) { + if (isset($_POST['GLCode']) and $myrow['accountcode']==$_POST['GLCode']) { + echo "<option selected VALUE='"; + } else { + echo "<option VALUE='"; + } + echo $myrow['accountcode'] . "'>" . $myrow['accountcode'] . ' - ' . $myrow['accountname']; - while ($myrow = DB_fetch_array($result)) { - if (isset($_POST['GLCode']) and $myrow['accountcode']==$_POST['GLCode']) { - echo "<option selected VALUE='"; - } else { - echo "<option VALUE='"; - } - echo $myrow['accountcode'] . "'>" . $myrow['accountcode'] . ' - ' . $myrow['accountname']; +} //end while loop - } //end while loop +DB_free_result($result); - DB_free_result($result); +echo "</select></td></tr></table>"; +echo "<br><div class='centre'><input tabindex=5 type='Submit' name='submit' value=" . _('Enter Information') . "></form></div>"; - echo "</select></td></tr></table><div class='centre'><input tabindex=5 type='Submit' name='submit' value=" . _('Enter Information') . "></form></div>"; - -} //end if record deleted no point displaying form to add record - include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-07-04 21:59:47 UTC (rev 3555) +++ trunk/doc/Change.log.html 2010-07-04 22:00:12 UTC (rev 3556) @@ -1,6 +1,7 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> -<p>03/07/10 Tim: BOMs.php - Corrections to sql statements and layout changes</p> +<p>04/07/10 Tim: COGSGLPostings.php - Corrections to sql statements and layout changes</p> +<p>04/07/10 Tim: BOMs.php - Corrections to sql statements and layout changes</p> <p>03/07/10 Tim: BOMListing.php - Minor layout changes </p> <p>03/07/10 Tim: BOMInquiry.php - Minor bug fixes and layout changes </p> <p>03/07/10 Tim: BOMIndentedReverse.php - Layout changes </p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-07-04 22:00:40
|
Revision: 3557 http://web-erp.svn.sourceforge.net/web-erp/?rev=3557&view=rev Author: tim_schofield Date: 2010-07-04 22:00:34 +0000 (Sun, 04 Jul 2010) Log Message: ----------- Corrections to sql statements and layout changes Modified Paths: -------------- trunk/CompanyPreferences.php trunk/doc/Change.log.html Modified: trunk/CompanyPreferences.php =================================================================== --- trunk/CompanyPreferences.php 2010-07-04 22:00:12 UTC (rev 3556) +++ trunk/CompanyPreferences.php 2010-07-04 22:00:34 UTC (rev 3557) @@ -139,7 +139,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,10 +155,10 @@ } /* end of if submit */ + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="">' . ' ' . $title.'<br>'; - echo '<form method="post" action=' . $_SERVER['PHP_SELF'] . '>'; -echo '<table>'; +echo '<table class=selection>'; if ($InputError != 1) { $sql = "SELECT coyname, @@ -467,7 +467,7 @@ echo '</select></td></tr>'; -echo '</table><div class="centre"><input tabindex="26" type="Submit" Name="submit" value="' . _('Update') . '"></div>'; +echo '</table><br><div class="centre"><input tabindex="26" type="Submit" Name="submit" value="' . _('Update') . '"></div>'; include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-07-04 22:00:12 UTC (rev 3556) +++ trunk/doc/Change.log.html 2010-07-04 22:00:34 UTC (rev 3557) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>04/07/10 Tim: CompanyPreferences.php - Corrections to sql statements and layout changes</p> <p>04/07/10 Tim: COGSGLPostings.php - Corrections to sql statements and layout changes</p> <p>04/07/10 Tim: BOMs.php - Corrections to sql statements and layout changes</p> <p>03/07/10 Tim: BOMListing.php - Minor layout changes </p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-07-04 22:01:02
|
Revision: 3558 http://web-erp.svn.sourceforge.net/web-erp/?rev=3558&view=rev Author: tim_schofield Date: 2010-07-04 22:00:56 +0000 (Sun, 04 Jul 2010) Log Message: ----------- Various fixes, corrections to sql statements and layout changes Modified Paths: -------------- trunk/ConfirmDispatch_Invoice.php trunk/doc/Change.log.html Modified: trunk/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2010-07-04 22:00:34 UTC (rev 3557) +++ trunk/ConfirmDispatch_Invoice.php 2010-07-04 22:00:56 UTC (rev 3558) @@ -30,7 +30,8 @@ unset($_SESSION['Items']->LineItems); unset ($_SESSION['Items']); - $_SESSION['ProcessingOrder']=$_GET['OrderNumber']; + $_SESSION['ProcessingOrder']=(int)$_GET['OrderNumber']; + $_GET['OrderNumber']=(int)$_GET['OrderNumber']; $_SESSION['Items'] = new cart; /*read in all the guff from the selected order into the Items cart */ @@ -72,7 +73,7 @@ AND salesorders.debtorno = custbranch.debtorno AND locations.loccode=salesorders.fromstkloc AND debtorsmaster.currcode = currencies.currabrev - AND salesorders.orderno = ' . $_GET['OrderNumber']; + AND salesorders.orderno = "' . $_GET['OrderNumber'].'"'; $ErrMsg = _('The order cannot be retrieved because'); $DbgMsg = _('The SQL to get the order header was'); @@ -146,7 +147,7 @@ stockmaster.overheadcost AS standardcost FROM salesorderdetails INNER JOIN stockmaster ON salesorderdetails.stkcode = stockmaster.stockid - WHERE salesorderdetails.orderno =' . $_GET['OrderNumber'] . ' + WHERE salesorderdetails.orderno ="' . $_GET['OrderNumber'] . '" AND salesorderdetails.quantity - salesorderdetails.qtyinvoiced >0 ORDER BY salesorderdetails.orderlineno'; @@ -252,7 +253,7 @@ /*************************************************************** Line Item Display ***************************************************************/ -echo '<table width="90%" cellpadding="2" colspan="7" BORDER="1"> +echo '<table width="90%" cellpadding="2" colspan="7" class=selection> <tr> <th>' . _('Item Code') . '</th> <th>' . _('Item Description' ) . '</th> @@ -290,8 +291,6 @@ $k=1; } - echo $RowStarter; - $LineTotal = $LnItm->QtyDispatched * $LnItm->Price * (1 - $LnItm->DiscountPercent); $_SESSION['Items']->total += $LineTotal; @@ -306,12 +305,20 @@ if ($LnItm->Controlled==1){ - echo '<td class="number"><input type=hidden name="' . $LnItm->LineNumber . '_QtyDispatched" value="' . $LnItm->QtyDispatched . '"><a href="' . $rootpath .'/ConfirmDispatchControlled_Invoice.php?' . SID . '&LineNo='. $LnItm->LineNumber.'">' .$LnItm->QtyDispatched . '</a></td>'; - + if (isset($_POST['ProcessInvoice'])) { + echo '<td class="number">' . $LnItm->QtyDispatched . '</td>'; + } else { + echo '<td class="number"><input type=hidden name="' . $LnItm->LineNumber . '_QtyDispatched" value="' . + $LnItm->QtyDispatched . '"><a href="' . $rootpath .'/ConfirmDispatchControlled_Invoice.php?' . SID . + '&LineNo='. $LnItm->LineNumber.'">' .$LnItm->QtyDispatched . '</a></td>'; + } } else { - - echo '<td class="number"><input tabindex="'.$j.'" type="text" class="number" name="' . $LnItm->LineNumber .'_QtyDispatched" maxlength=12 size=12 value="' . $LnItm->QtyDispatched . '"></td>'; - + if (isset($_POST['ProcessInvoice'])) { + echo '<td class="number">' . $LnItm->QtyDispatched . '</td>'; + } else { + echo '<td class="number"><input tabindex="'.$j.'" type="text" class="number" name="' . $LnItm->LineNumber . + '_QtyDispatched" maxlength=12 size=12 value="' . $LnItm->QtyDispatched . '"></td>'; + } } $DisplayDiscountPercent = number_format($LnItm->DiscountPercent*100,2) . '%'; $DisplayLineNetTotal = number_format($LineTotal,2); @@ -344,7 +351,12 @@ if ($i>0){ echo '<br>'; } - echo '<input type="text" class="number" name="' . $LnItm->LineNumber . $Tax->TaxCalculationOrder . '_TaxRate" maxlength=4 size=4 value="' . $Tax->TaxRate*100 . '">'; + if (isset($_POST['ProcessInvoice'])) { + echo $Tax->TaxRate*100; + } else { + echo '<input type="text" class="number" name="' . $LnItm->LineNumber . $Tax->TaxCalculationOrder . + '_TaxRate" maxlength=4 size=4 value="' . $Tax->TaxRate*100 . '">'; + } $i++; if ($Tax->TaxOnTax ==1){ $TaxTotals[$Tax->TaxAuthID] += ($Tax->TaxRate * ($LineTotal + $TaxLineTotal)); @@ -425,7 +437,7 @@ } } -if (!is_numeric($_POST['ChargeFreightCost'])){ +if (isset($_POST['ChargeFreightCost']) and !is_numeric($_POST['ChargeFreightCost'])){ $_POST['ChargeFreightCost'] =0; } @@ -440,14 +452,21 @@ // echo '<td colspan="1"></td>'; } $j++; - +if (!isset($_POST['ChargeFreightCost'])) { + $_POST['ChargeFreightCost']=0; +} if ($_SESSION['Items']->Any_Already_Delivered()==1 and (!isset($_SESSION['Items']->FreightCost) or $_POST['ChargeFreightCost']==0)) { echo '<td colspan=2 class=number>'. _('Charge Freight Cost inc Tax').'</td> - <td><input tabindex='.$j.' type="text" class="number" size="10" maxlength="12" name="ChargeFreightCost" VALUE="0"></td>'; + <td><input tabindex='.$j.' type="text" class="number" size="10" maxlength="12" name="ChargeFreightCost" value="0"></td>'; $_SESSION['Items']->FreightCost=0; } else { - echo '<td colspan=2 class=number>'. _('Charge Freight Cost inc Tax').'</td> - <td><input tabindex='.$j.' type="text" class="number" size="10" maxlength="12" name="ChargeFreightCost" VALUE="' . $_SESSION['Items']->FreightCost . '"></td>'; + echo '<td colspan=2 class=number>'. _('Charge Freight Cost inc Tax').'</td>'; + if (isset($_POST['ProcessInvoice'])) { + echo '<td class=number>' . $_SESSION['Items']->FreightCost . '</td>'; + } else { + echo '<td class=number><input tabindex='.$j.' type="text" class="number" size="10" maxlength="12" + name="ChargeFreightCost" VALUE="' . $_SESSION['Items']->FreightCost . '"></td>'; + } $_POST['ChargeFreightCost'] = $_SESSION['Items']->FreightCost; } @@ -464,7 +483,7 @@ $i++; } -echo '</td><td>'; +echo '</td><td class=number>'; $i=0; foreach ($_SESSION['Items']->FreightTaxes as $FreightTaxLine) { @@ -472,7 +491,12 @@ echo '<br>'; } - echo '<input type="text" class="number" name="FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder . '" maxlength="4" size="4" VALUE="' . $FreightTaxLine->TaxRate * 100 . '">'; + if (isset($_POST['ProcessInvoice'])) { + echo $FreightTaxLine->TaxRate * 100 ; + } else { + echo '<input type="text" class="number" name="FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder . + '" maxlength="4" size="4" VALUE="' . $FreightTaxLine->TaxRate * 100 . '">'; + } if ($FreightTaxLine->TaxOnTax ==1){ $TaxTotals[$FreightTaxLine->TaxAuthID] += ($FreightTaxLine->TaxRate * ($_SESSION['Items']->FreightCost + $FreightTaxTotal)); @@ -629,7 +653,7 @@ orderlineno FROM salesorderdetails WHERE completed=0 - AND orderno = " . $_SESSION['ProcessingOrder']; + AND orderno = '" . $_SESSION['ProcessingOrder']."'"; $Result = DB_query($SQL,$db); @@ -692,7 +716,10 @@ DB_Txn_Begin($db); if ($DefaultShipVia != $_SESSION['Items']->ShipVia){ - $SQL = "UPDATE custbranch SET defaultshipvia ='" . $_SESSION['Items']->ShipVia . "' WHERE debtorno='" . $_SESSION['Items']->DebtorNo . "' AND branchcode='" . $_SESSION['Items']->Branch . "'"; + $SQL = "UPDATE custbranch + SET defaultshipvia ='" . $_SESSION['Items']->ShipVia . "' + WHERE debtorno='" . $_SESSION['Items']->DebtorNo . "' + AND branchcode='" . $_SESSION['Items']->Branch . "'"; $ErrMsg = _('Could not update the default shipping carrier for this branch because'); $DbgMsg = _('The SQL used to update the branch default carrier was'); $result = DB_query($SQL,$db, $ErrMsg, $DbgMsg, true); @@ -701,7 +728,9 @@ $DefaultDispatchDate = FormatDateForSQL($DefaultDispatchDate); /*Update order header for invoice charged on */ - $SQL = "UPDATE salesorders SET comments = CONCAT(comments,' Inv ','" . $InvoiceNo . "') WHERE orderno= " . $_SESSION['ProcessingOrder']; + $SQL = "UPDATE salesorders + SET comments = CONCAT(comments,' Inv ','" . $InvoiceNo . "') + WHERE orderno= '" . $_SESSION['ProcessingOrder']."'"; $ErrMsg = _('CRITICAL ERROR') . ' ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The sales order header could not be updated with the invoice number'); $DbgMsg = _('The following SQL to update the sales order was used'); @@ -729,22 +758,22 @@ consignment ) VALUES ( - ". $InvoiceNo . ", + '". $InvoiceNo . "', 10, '" . $_SESSION['Items']->DebtorNo . "', '" . $_SESSION['Items']->Branch . "', '" . $DefaultDispatchDate . "', '" . date('Y-m-d H-i-s') . "', - " . $PeriodNo . ", + '" . $PeriodNo . "', '', '" . $_SESSION['Items']->DefaultSalesType . "', - " . $_SESSION['ProcessingOrder'] . ", - " . $_SESSION['Items']->total . ", - " . $TaxTotal . ", - " . $_POST['ChargeFreightCost'] . ", - " . $_SESSION['CurrencyRate'] . ", + '" . $_SESSION['ProcessingOrder'] . "', + '" . $_SESSION['Items']->total . "', + '" . $TaxTotal . "', + '" . $_POST['ChargeFreightCost'] . "', + '" . $_SESSION['CurrencyRate'] . "', '" . $_POST['InvoiceText'] . "', - " . $_SESSION['Items']->ShipVia . ", + '" . $_SESSION['Items']->ShipVia . "', '" . $_POST['Consignment'] . "' )"; @@ -757,12 +786,12 @@ /* Insert the tax totals for each tax authority where tax was charged on the invoice */ foreach ($TaxTotals AS $TaxAuthID => $TaxAmount) { - $SQL = 'INSERT INTO debtortranstaxes (debtortransid, + $SQL = "INSERT INTO debtortranstaxes (debtortransid, taxauthid, taxamount) - VALUES (' . $DebtorTransID . ', - ' . $TaxAuthID . ', - ' . $TaxAmount/$_SESSION['CurrencyRate'] . ')'; + VALUES ('" . $DebtorTransID . "', + '" . $TaxAuthID . "', + '" . $TaxAmount/$_SESSION['CurrencyRate'] . "')"; $ErrMsg =_('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The debtor transaction taxes records could not be inserted because'); $DbgMsg = _('The following SQL to insert the debtor transaction taxes record was used'); @@ -777,7 +806,9 @@ if ($_POST['BOPolicy']=='CAN'){ $SQL = "UPDATE salesorderdetails - SET quantity = quantity - " . ($OrderLine->Quantity - $OrderLine->QtyDispatched) . " WHERE orderno = " . $_SESSION['ProcessingOrder'] . " AND stkcode = '" . $OrderLine->StockID . "'"; + SET quantity = quantity - " . ($OrderLine->Quantity - $OrderLine->QtyDispatched) . " + WHERE orderno = '" . $_SESSION['ProcessingOrder'] . " ' + AND stkcode = '" . $OrderLine->StockID . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The sales order detail record could not be updated because'); $DbgMsg = _('The following SQL to update the sales order detail record was used'); @@ -796,10 +827,10 @@ can_or_bo ) VALUES ( - " . $_SESSION['ProcessingOrder'] . ", - " . $InvoiceNo . ", + '" . $_SESSION['ProcessingOrder'] . "', + '" . $InvoiceNo . "', '" . $OrderLine->StockID . "', - " . ($OrderLine->Quantity - $OrderLine->QtyDispatched) . ", + '" . ($OrderLine->Quantity - $OrderLine->QtyDispatched) . "', '" . $_SESSION['Items']->DebtorNo . "', '" . $_SESSION['Items']->Branch . "', 'CAN' @@ -826,10 +857,10 @@ can_or_bo ) VALUES ( - " . $_SESSION['ProcessingOrder'] . ", - " . $InvoiceNo . ", + '" . $_SESSION['ProcessingOrder'] . "', + '" . $InvoiceNo . "', '" . $OrderLine->StockID . "', - " . ($OrderLine->Quantity - $OrderLine->QtyDispatched) . ", + '" . ($OrderLine->Quantity - $OrderLine->QtyDispatched) . "', '" . $_SESSION['Items']->DebtorNo . "', '" . $_SESSION['Items']->Branch . "', 'BO' @@ -850,13 +881,13 @@ SET qtyinvoiced = qtyinvoiced + " . $OrderLine->QtyDispatched . ", actualdispatchdate = '" . $DefaultDispatchDate . "', completed=1 - WHERE orderno = " . $_SESSION['ProcessingOrder'] . " + WHERE orderno = '" . $_SESSION['ProcessingOrder'] . "' AND orderlineno = '" . $OrderLine->LineNumber . "'"; } else { $SQL = "UPDATE salesorderdetails SET qtyinvoiced = qtyinvoiced + " . $OrderLine->QtyDispatched . ", actualdispatchdate = '" . $DefaultDispatchDate . "' - WHERE orderno = " . $_SESSION['ProcessingOrder'] . " + WHERE orderno = '" . $_SESSION['ProcessingOrder'] . "' AND orderlineno = '" . $OrderLine->LineNumber . "'"; } @@ -867,7 +898,9 @@ /* Update location stock records if not a dummy stock item need the MBFlag later too so save it to $MBFlag */ - $Result = DB_query("SELECT mbflag FROM stockmaster WHERE stockid = '" . $OrderLine->StockID . "'",$db,"<br>Can't retrieve the mbflag"); + $Result = DB_query("SELECT mbflag + FROM stockmaster + WHERE stockid = '" . $OrderLine->StockID . "'",$db,"<br>Can't retrieve the mbflag"); $myrow = DB_fetch_row($Result); $MBFlag = $myrow[0]; @@ -960,17 +993,17 @@ ) VALUES ( '" . $AssParts['component'] . "', 10, - " . $InvoiceNo . ", + '" . $InvoiceNo . "', '" . $_SESSION['Items']->Location . "', '" . $DefaultDispatchDate . "', '" . $_SESSION['Items']->DebtorNo . "', '" . $_SESSION['Items']->Branch . "', - " . $PeriodNo . ", + '" . $PeriodNo . "', '" . _('Assembly') . ': ' . $OrderLine->StockID . ' ' . _('Order') . ': ' . $_SESSION['ProcessingOrder'] . "', - " . -$AssParts['quantity'] * $OrderLine->QtyDispatched . ", - " . $AssParts['standard'] . ", + '" . -$AssParts['quantity'] * $OrderLine->QtyDispatched . "', + '" . $AssParts['standard'] . "', 0, - newqoh-" . ($AssParts['quantity'] * $OrderLine->QtyDispatched) . " + newqoh-" . ($AssParts['quantity'] * $OrderLine->QtyDispatched) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Stock movement records for the assembly components of'). ' '. $OrderLine->StockID . ' ' . _('could not be inserted because'); @@ -1018,18 +1051,18 @@ narrative ) VALUES ('" . $OrderLine->StockID . "', 10, - " . $InvoiceNo . ", + '" . $InvoiceNo . "', '" . $_SESSION['Items']->Location . "', '" . $DefaultDispatchDate . "', '" . $_SESSION['Items']->DebtorNo . "', '" . $_SESSION['Items']->Branch . "', - " . $LocalCurrencyPrice . ", - " . $PeriodNo . ", + '" . $LocalCurrencyPrice . "', + '" . $PeriodNo . "', '" . $_SESSION['ProcessingOrder'] . "', - " . -$OrderLine->QtyDispatched . ", - " . $OrderLine->DiscountPercent . ", - " . $OrderLine->StandardCost . ", - " . ($QtyOnHandPrior - $OrderLine->QtyDispatched) . ", + '" . -$OrderLine->QtyDispatched . "', + '" . $OrderLine->DiscountPercent . "', + '" . $OrderLine->StandardCost . "', + '" . ($QtyOnHandPrior - $OrderLine->QtyDispatched) . "', '" . DB_escape_string($OrderLine->Narrative) . "' )"; } else { // its an assembly or dummy and assemblies/dummies always have nil stock (by definition they are made up at the time of dispatch so new qty on hand will be nil @@ -1053,17 +1086,17 @@ narrative ) VALUES ('" . $OrderLine->StockID . "', 10, - " . $InvoiceNo . ", + '" . $InvoiceNo . "', '" . $_SESSION['Items']->Location . "', '" . $DefaultDispatchDate . "', '" . $_SESSION['Items']->DebtorNo . "', '" . $_SESSION['Items']->Branch . "', - " . $LocalCurrencyPrice . ", - " . $PeriodNo . ", + '" . $LocalCurrencyPrice . "', + '" . $PeriodNo . "', '" . $_SESSION['ProcessingOrder'] . "', - " . -$OrderLine->QtyDispatched . ", - " . $OrderLine->DiscountPercent . ", - " . $OrderLine->StandardCost . ", + '" . -$OrderLine->QtyDispatched . "', + '" . $OrderLine->DiscountPercent . "', + '" . $OrderLine->StandardCost . "', '" . DB_escape_string($OrderLine->Narrative) . "')"; } @@ -1078,16 +1111,16 @@ /*Insert the taxes that applied to this line */ foreach ($OrderLine->Taxes as $Tax) { - $SQL = 'INSERT INTO stockmovestaxes (stkmoveno, + $SQL = "INSERT INTO stockmovestaxes (stkmoveno, taxauthid, taxrate, taxcalculationorder, taxontax) - VALUES (' . $StkMoveNo . ', - ' . $Tax->TaxAuthID . ', - ' . $Tax->TaxRate . ', - ' . $Tax->TaxCalculationOrder . ', - ' . $Tax->TaxOnTax . ')'; + VALUES ('" . $StkMoveNo . "', + '" . $Tax->TaxAuthID . "', + '" . $Tax->TaxRate . "', + '" . $Tax->TaxCalculationOrder . "', + '" . $Tax->TaxOnTax . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Taxes and rates applicable to this invoice line item could not be inserted because'); $DbgMsg = _('The following SQL to insert the stock movement tax detail records was used'); @@ -1118,10 +1151,10 @@ stockid, serialno, moveqty) - VALUES (" . $StkMoveNo . ", + VALUES ('" . $StkMoveNo . "', '" . $OrderLine->StockID . "', '" . $Item->BundleRef . "', - " . -$Item->BundleQty . ")"; + '" . -$Item->BundleQty . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock movement record could not be inserted because'); $DbgMsg = _('The following SQL to insert the serial stock movement records was used'); @@ -1150,7 +1183,7 @@ AND salesanalysis.area=custbranch.area AND salesanalysis.salesperson=custbranch.salesman AND salesanalysis.typeabbrev ='" . $_SESSION['Items']->DefaultSalesType . "' - AND salesanalysis.periodno=" . $PeriodNo . " + AND salesanalysis.periodno='" . $PeriodNo . "' AND salesanalysis.cust " . LIKE . " '" . $_SESSION['Items']->DebtorNo . "' AND salesanalysis.custbranch " . LIKE . " '" . $_SESSION['Items']->Branch . "' AND salesanalysis.stockid " . LIKE . " '" . $OrderLine->StockID . "' @@ -1180,7 +1213,7 @@ WHERE salesanalysis.area='" . $myrow[5] . "' AND salesanalysis.salesperson='" . $myrow[8] . "' AND typeabbrev ='" . $_SESSION['Items']->DefaultSalesType . "' - AND periodno = " . $PeriodNo . " + AND periodno = '" . $PeriodNo . "' AND cust " . LIKE . " '" . $_SESSION['Items']->DebtorNo . "' AND custbranch " . LIKE . " '" . $_SESSION['Items']->Branch . "' AND stockid " . LIKE . " '" . $OrderLine->StockID . "' @@ -1205,13 +1238,13 @@ stkcategory ) SELECT '" . $_SESSION['Items']->DefaultSalesType . "', - " . $PeriodNo . ", - " . ($OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . ", - " . ($OrderLine->StandardCost * $OrderLine->QtyDispatched) . ", + '" . $PeriodNo . "', + '" . ($OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . "', + '" . ($OrderLine->StandardCost * $OrderLine->QtyDispatched) . "', '" . $_SESSION['Items']->DebtorNo . "', '" . $_SESSION['Items']->Branch . "', - " . $OrderLine->QtyDispatched . ", - " . ($OrderLine->DiscountPercent * $OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . ", + '" . $OrderLine->QtyDispatched . "', + '" . ($OrderLine->DiscountPercent * $OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . "', '" . $OrderLine->StockID . "', custbranch.area, 1, @@ -1241,15 +1274,15 @@ periodno, account, narrative, - amount ) + amount) VALUES ( 10, - " . $InvoiceNo . ", + '" . $InvoiceNo . "', '" . $DefaultDispatchDate . "', - " . $PeriodNo . ", - " . GetCOGSGLAccount($Area, $OrderLine->StockID, $_SESSION['Items']->DefaultSalesType, $db) . ", + '" . $PeriodNo . "', + '" . GetCOGSGLAccount($Area, $OrderLine->StockID, $_SESSION['Items']->DefaultSalesType, $db) . "', '" . $_SESSION['Items']->DebtorNo . " - " . $OrderLine->StockID . " x " . $OrderLine->QtyDispatched . " @ " . $OrderLine->StandardCost . "', - " . $OrderLine->StandardCost * $OrderLine->QtyDispatched . " )"; + '" . $OrderLine->StandardCost * $OrderLine->QtyDispatched . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The cost of sales GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); @@ -1265,15 +1298,15 @@ periodno, account, narrative, - amount ) + amount) VALUES ( 10, - " . $InvoiceNo . ", + '" . $InvoiceNo . "', '" . $DefaultDispatchDate . "', - " . $PeriodNo . ", - " . $StockGLCode['stockact'] . ", + '" . $PeriodNo . "', + '" . $StockGLCode['stockact'] . "', '" . $_SESSION['Items']->DebtorNo . " - " . $OrderLine->StockID . " x " . $OrderLine->QtyDispatched . " @ " . $OrderLine->StandardCost . "', - " . (-$OrderLine->StandardCost * $OrderLine->QtyDispatched) . " )"; + '" . (-$OrderLine->StandardCost * $OrderLine->QtyDispatched) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The stock side of the cost of sales GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); @@ -1295,12 +1328,12 @@ amount ) VALUES ( 10, - " . $InvoiceNo . ", + '" . $InvoiceNo . "', '" . $DefaultDispatchDate . "', - " . $PeriodNo . ", - " . $SalesGLAccounts['salesglcode'] . ", + '" . $PeriodNo . "', + '" . $SalesGLAccounts['salesglcode'] . "', '" . $_SESSION['Items']->DebtorNo . " - " . $OrderLine->StockID . " x " . $OrderLine->QtyDispatched . " @ " . $OrderLine->Price . "', - " . (-$OrderLine->Price * $OrderLine->QtyDispatched/$_SESSION['CurrencyRate']) . " )"; + '" . (-$OrderLine->Price * $OrderLine->QtyDispatched/$_SESSION['CurrencyRate']) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The sales GL posting could not be inserted because'); $DbgMsg = '<br>' ._('The following SQL to insert the GLTrans record was used'); @@ -1315,15 +1348,15 @@ periodno, account, narrative, - amount ) + amount) VALUES ( 10, - " . $InvoiceNo . ", + '" . $InvoiceNo . "', '" . $DefaultDispatchDate . "', - " . $PeriodNo . ", - " . $SalesGLAccounts['discountglcode'] . ", + '" . $PeriodNo . "', + '" . $SalesGLAccounts['discountglcode'] . "', '" . $_SESSION['Items']->DebtorNo . " - " . $OrderLine->StockID . " @ " . ($OrderLine->DiscountPercent * 100) . "%', - " . ($OrderLine->Price * $OrderLine->QtyDispatched * $OrderLine->DiscountPercent/$_SESSION['CurrencyRate']) . " )"; + '" . ($OrderLine->Price * $OrderLine->QtyDispatched * $OrderLine->DiscountPercent/$_SESSION['CurrencyRate']) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The sales discount GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); @@ -1346,15 +1379,15 @@ periodno, account, narrative, - amount ) + amount) VALUES ( 10, - " . $InvoiceNo . ", + '" . $InvoiceNo . "', '" . $DefaultDispatchDate . "', - " . $PeriodNo . ", - " . $_SESSION['CompanyRecord']['debtorsact'] . ", + '" . $PeriodNo . "', + '" . $_SESSION['CompanyRecord']['debtorsact'] . "', '" . $_SESSION['Items']->DebtorNo . "', - " . (($_SESSION['Items']->total + $_SESSION['Items']->FreightCost + $TaxTotal)/$_SESSION['CurrencyRate']) . " )"; + '" . (($_SESSION['Items']->total + $_SESSION['Items']->FreightCost + $TaxTotal)/$_SESSION['CurrencyRate']) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The total debtor GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the total debtors control GLTrans record was used'); @@ -1374,12 +1407,12 @@ amount ) VALUES ( 10, - " . $InvoiceNo . ", + '" . $InvoiceNo . "', '" . $DefaultDispatchDate . "', - " . $PeriodNo . ", - " . $_SESSION['CompanyRecord']['freightact'] . ", + '" . $PeriodNo . "', + '" . $_SESSION['CompanyRecord']['freightact'] . "', '" . $_SESSION['Items']->DebtorNo . "', - " . (-($_SESSION['Items']->FreightCost)/$_SESSION['CurrencyRate']) . " )"; + '" . (-($_SESSION['Items']->FreightCost)/$_SESSION['CurrencyRate']) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The freight GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); @@ -1394,15 +1427,15 @@ periodno, account, narrative, - amount ) + amount) VALUES ( 10, - " . $InvoiceNo . ", + '" . $InvoiceNo . "', '" . $DefaultDispatchDate . "', - " . $PeriodNo . ", - " . $TaxGLCodes[$TaxAuthID] . ", + '" . $PeriodNo . "', + '" . $TaxGLCodes[$TaxAuthID] . "', '" . $_SESSION['Items']->DebtorNo . "', - " . (-$TaxAmount/$_SESSION['CurrencyRate']) . " )"; + '" . (-$TaxAmount/$_SESSION['CurrencyRate']) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The tax GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); @@ -1444,7 +1477,7 @@ $_POST['InvoiceText']=''; } $j++; - echo '<table><tr> + echo '<table class=selection><tr> <td>' ._('Date On Invoice'). ':</td> <td><input tabindex='.$j.' type="text" maxlength="10" size="15" name="DispatchDate" value="'.$DefaultDispatchDate.'" id="datepicker" @@ -1468,7 +1501,7 @@ $j++; echo '</table> - <div class="centre"> + <br><div class="centre"> <input type=submit tabindex='.$j.' name=Update Value=' . _('Update'). '><br>'; $j++; @@ -1480,4 +1513,4 @@ echo '</form>'; include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-07-04 22:00:34 UTC (rev 3557) +++ trunk/doc/Change.log.html 2010-07-04 22:00:56 UTC (rev 3558) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>04/07/10 Tim: ConfirmDispatch_Invoice.php - Various fixes, corrections to sql statements and layout changes</p> <p>04/07/10 Tim: CompanyPreferences.php - Corrections to sql statements and layout changes</p> <p>04/07/10 Tim: COGSGLPostings.php - Corrections to sql statements and layout changes</p> <p>04/07/10 Tim: BOMs.php - Corrections to sql statements and layout changes</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-07-04 22:01:24
|
Revision: 3559 http://web-erp.svn.sourceforge.net/web-erp/?rev=3559&view=rev Author: tim_schofield Date: 2010-07-04 22:01:17 +0000 (Sun, 04 Jul 2010) Log Message: ----------- <p>04/07/10 Tim: ConfirmDispatchControlled_Invoice.php - Force the LineNo variable to be read as integer</p> Modified Paths: -------------- trunk/ConfirmDispatchControlled_Invoice.php trunk/doc/Change.log.html Modified: trunk/ConfirmDispatchControlled_Invoice.php =================================================================== --- trunk/ConfirmDispatchControlled_Invoice.php 2010-07-04 22:00:56 UTC (rev 3558) +++ trunk/ConfirmDispatchControlled_Invoice.php 2010-07-04 22:01:17 UTC (rev 3559) @@ -12,9 +12,9 @@ include('includes/header.inc'); if (isset($_GET['LineNo'])){ - $LineNo = $_GET['LineNo']; + $LineNo = (int)$_GET['LineNo']; } elseif (isset($_POST['LineNo'])){ - $LineNo = $_POST['LineNo']; + $LineNo = (int)$_POST['LineNo']; } else { echo '<div class="centre"><a href="' . $rootpath . '/ConfirmDispatch_Invoice.php?' . SID . '">'. _('Select a line item to invoice').'</a><br>'; @@ -74,4 +74,4 @@ include('includes/footer.inc'); exit; -?> \ No newline at end of file +?> Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-07-04 22:00:56 UTC (rev 3558) +++ trunk/doc/Change.log.html 2010-07-04 22:01:17 UTC (rev 3559) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>04/07/10 Tim: ConfirmDispatchControlled_Invoice.php - Force the LineNo variable to be read as integer</p> <p>04/07/10 Tim: ConfirmDispatch_Invoice.php - Various fixes, corrections to sql statements and layout changes</p> <p>04/07/10 Tim: CompanyPreferences.php - Corrections to sql statements and layout changes</p> <p>04/07/10 Tim: COGSGLPostings.php - Corrections to sql statements and layout changes</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-07-04 22:01:43
|
Revision: 3560 http://web-erp.svn.sourceforge.net/web-erp/?rev=3560&view=rev Author: tim_schofield Date: 2010-07-04 22:01:36 +0000 (Sun, 04 Jul 2010) Log Message: ----------- Minor bug fixes layout changes and corrections to sql statements Modified Paths: -------------- trunk/Credit_Invoice.php trunk/doc/Change.log.html Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2010-07-04 22:01:17 UTC (rev 3559) +++ trunk/Credit_Invoice.php 2010-07-04 22:01:36 UTC (rev 3560) @@ -23,7 +23,7 @@ exit; } elseif (isset($_GET['InvoiceNumber'])) { - + $_GET['InvoiceNumber']=(int)$_GET['InvoiceNumber']; unset($_SESSION['CreditItems']->LineItems); unset($_SESSION['CreditItems']); @@ -62,7 +62,7 @@ stockmoves.transno=debtortrans.transno INNER JOIN locations ON stockmoves.loccode = locations.loccode - WHERE debtortrans.transno = " . $_GET['InvoiceNumber'] . " + WHERE debtortrans.transno = '" . $_GET['InvoiceNumber'] . "' AND debtortrans.type=10 AND stockmoves.type=10"; @@ -120,7 +120,7 @@ stockmoves.narrative FROM stockmoves, stockmaster WHERE stockmoves.stockid = stockmaster.stockid - AND stockmoves.transno =" . $_GET['InvoiceNumber'] . " + AND stockmoves.transno ='" . $_GET['InvoiceNumber'] . "' AND stockmoves.type=10 AND stockmoves.show_on_inv_crds=1"; @@ -164,10 +164,10 @@ if ($myrow['controlled']==1){/* Populate the SerialItems array too*/ - $SQL = 'SELECT serialno, + $SQL = "SELECT serialno, moveqty FROM stockserialmoves - WHERE stockmoveno=' . $myrow['stkmoveno'] . " + WHERE stockmoveno='" . $myrow['stkmoveno'] . "' AND stockid = '" . $myrow['stockid'] . "'"; $ErrMsg = _('This invoice can not be credited using this program') . '. ' . _('A manual credit note will need to be prepared') . '. ' . _('The line item') . ' ' . $myrow['stockid'] . ' ' . _('is controlled but the serial numbers or batch numbers could not be retrieved because'); @@ -254,32 +254,36 @@ /* Always display credit quantities NB QtyDispatched in the LineItems array is used for the quantity to credit */ +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/credit.gif" title="' . _('Search') . '" alt="">' . $title.'</img></p>'; -echo '<font color=blue><b>' . _('Credit Invoice') . ' ' . $_SESSION['ProcessingCredit'] . '</b></font> - <div class="centre"><font size=4><b><u>' . $_SESSION['CreditItems']->CustomerName . '</u></b></font> - <font size=3> - ' . _('Credit Note amounts stated in') . ' ' . $_SESSION['CreditItems']->DefaultCurrency . "</div><br>"; +if (!isset($_POST['ProcessCredit'])) { -echo "<form action='" . $_SERVER['PHP_SELF'] . "?" . SID . "' method=post>"; + echo "<form action='" . $_SERVER['PHP_SELF'] . "?" . SID . "' method=post>"; -echo "<table cellpadding=2 colspan=7 border=0><tr> -<th>" . _('Item Code') . "</th> -<th>" . _('Item Description') . "</th> -<th>" . _('Invoiced') . "</th> -<th>" . _('Units') . "</th> -<th>" . _('Credit') . '<br>' . _('Quantity') . "</th> -<th>" . _('Price') . "</th> -<th>" . _('Discount') . ' %' . "</th> -<th>" . _('Total') . '<br>' . _('Excl Tax') . "</th> -<th>" . _('Tax Authority') . "</th> -<th>" . _('Tax') . ' %' . "</th> -<th>" . _('Tax') . '<br>' . _('Amount') . "</th> -<th>" . _('Total') . '<br>' . _('Incl Tax') . "</th></tr>"; + echo "<table cellpadding=2 colspan=7 class=selection><tr>"; + echo "<tr><th colspan=13>"; + echo '<div class="centre"><font color=blue size=4><b>' . _('Credit Invoice') . ' ' . $_SESSION['ProcessingCredit'] . '</b> + <b>'.' - ' . $_SESSION['CreditItems']->CustomerName . '</b></font> + <font size=3 color=blue> - ' . _('Credit Note amounts stated in') . ' ' . $_SESSION['CreditItems']->DefaultCurrency . "</div></font>"; + echo "</th></tr>"; + echo "<th>" . _('Item Code') . "</th> + <th>" . _('Item Description') . "</th> + <th>" . _('Invoiced') . "</th> + <th>" . _('Units') . "</th> + <th>" . _('Credit') . '<br>' . _('Quantity') . "</th> + <th>" . _('Price') . "</th> + <th>" . _('Discount') . ' %' . "</th> + <th>" . _('Total') . '<br>' . _('Excl Tax') . "</th> + <th>" . _('Tax Authority') . "</th> + <th>" . _('Tax') . ' %' . "</th> + <th>" . _('Tax') . '<br>' . _('Amount') . "</th> + <th>" . _('Total') . '<br>' . _('Incl Tax') . "</th></tr>"; -$_SESSION['CreditItems']->total = 0; -$_SESSION['CreditItems']->totalVolume = 0; -$_SESSION['CreditItems']->totalWeight = 0; - + $_SESSION['CreditItems']->total = 0; + $_SESSION['CreditItems']->totalVolume = 0; + $_SESSION['CreditItems']->totalWeight = 0; +} $TaxTotals = array(); $TaxGLCodes = array(); $TaxTotal =0; @@ -290,65 +294,73 @@ $j=0; //row counter foreach ($_SESSION['CreditItems']->LineItems as $LnItm) { - - if ($k==1){ - $RowStarter = 'class="EvenTableRows"'; - $k=0; - } else { - $RowStarter = 'class="OddTableRows"'; - $k=1; - } - $j++; $LineTotal =($LnItm->QtyDispatched * $LnItm->Price * (1 - $LnItm->DiscountPercent)); - $_SESSION['CreditItems']->total = $_SESSION['CreditItems']->total + $LineTotal; - $_SESSION['CreditItems']->totalVolume = $_SESSION['CreditItems']->totalVolume + $LnItm->QtyDispatched * $LnItm->Volume; - $_SESSION['CreditItems']->totalWeight = $_SESSION['CreditItems']->totalWeight + $LnItm->QtyDispatched * $LnItm->Weight; + if (!isset($_POST['ProcessCredit'])) { + $_SESSION['CreditItems']->total = $_SESSION['CreditItems']->total + $LineTotal; + $_SESSION['CreditItems']->totalVolume = $_SESSION['CreditItems']->totalVolume + $LnItm->QtyDispatched * $LnItm->Volume; + $_SESSION['CreditItems']->totalWeight = $_SESSION['CreditItems']->totalWeight + $LnItm->QtyDispatched * $LnItm->Weight; - echo '<tr '.$RowStarter.'><td>' . $LnItm->StockID . '</td> + if ($k==1){ + $RowStarter = 'class="EvenTableRows"'; + $k=0; + } else { + $RowStarter = 'class="OddTableRows"'; + $k=1; + } + $j++; + + echo '<tr '.$RowStarter.'><td>' . $LnItm->StockID . '</td> <td>' . $LnItm->ItemDescription . '</td> <td class=number>' . number_format($LnItm->Quantity,$LnItm->DecimalPlaces) . '</td> <td>' . $LnItm->Units . '</td>'; - if ($LnItm->Controlled==1){ + if ($LnItm->Controlled==1){ - echo "<td><input type=hidden name='Quantity_" . $LnItm->LineNumber ."' value=" . $LnItm->QtyDispatched . "><a href='$rootpath/CreditItemsControlled.php?" . SID . "&LineNo=" . $LnItm->LineNumber . "&CreditInvoice=Yes'>" . $LnItm->QtyDispatched . "</a></td>"; + echo "<td><input type=hidden name='Quantity_" . $LnItm->LineNumber ."' value=" . $LnItm->QtyDispatched . "><a href='$rootpath/CreditItemsControlled.php?" . SID . "&LineNo=" . $LnItm->LineNumber . "&CreditInvoice=Yes'>" . $LnItm->QtyDispatched . "</a></td>"; - } else { + } else { - echo "<td><input tabindex=".$j." type=text class=number name='Quantity_" . $LnItm->LineNumber ."' maxlength=6 size=6 value=" . $LnItm->QtyDispatched . "></td>"; + echo "<td><input tabindex=".$j." type=text class=number name='Quantity_" . $LnItm->LineNumber ."' maxlength=6 size=6 value=" . $LnItm->QtyDispatched . "></td>"; - } + } - $DisplayLineTotal = number_format($LineTotal,2); - $j++; - echo "<td><input tabindex=".$j." type=text class=number name='Price_" . $LnItm->LineNumber . "' maxlength=12 size=6 VALUE=" . $LnItm->Price . "></td> - <td><input tabindex=".$j." type=text class=number name='Discount_" . $LnItm->LineNumber . "' maxlength=3 size=3 VALUE=" . ($LnItm->DiscountPercent * 100) . "></td> - <td class=number>$DisplayLineTotal</td>"; + $DisplayLineTotal = number_format($LineTotal,2); + $j++; + echo "<td><input tabindex=".$j." type=text class=number name='Price_" . $LnItm->LineNumber . "' maxlength=12 size=6 VALUE=" . $LnItm->Price . "></td> + <td><input tabindex=".$j." type=text class=number name='Discount_" . $LnItm->LineNumber . "' maxlength=3 size=3 VALUE=" . ($LnItm->DiscountPercent * 100) . "></td> + <td class=number>$DisplayLineTotal</td>"; + /*Need to list the taxes applicable to this line */ - echo '<td>'; - $i=0; - if (is_array($_SESSION['CreditItems']->LineItems[$LnItm->LineNumber]->Taxes) ){ - foreach ($_SESSION['CreditItems']->LineItems[$LnItm->LineNumber]->Taxes AS $Tax) { - if ($i>0){ - echo '<br>'; + echo '<td>'; + $i=0; + if (is_array($_SESSION['CreditItems']->LineItems[$LnItm->LineNumber]->Taxes) ){ + foreach ($_SESSION['CreditItems']->LineItems[$LnItm->LineNumber]->Taxes AS $Tax) { + if ($i>0){ + echo '<br>'; + } + echo $Tax->TaxAuthDescription; + $i++; } - echo $Tax->TaxAuthDescription; - $i++; } + echo '</td>'; + echo '<td class=number>'; + } - echo '</td>'; - echo '<td class=number>'; - $i=0; // initialise the number of taxes iterated through $TaxLineTotal =0; //initialise tax total for the line - if (is_array($LnItm->Taxes) ){ - foreach ($LnItm->Taxes AS $Tax) { + foreach ($LnItm->Taxes as $Tax) { + $TaxTotals[$Tax->TaxAuthID]=0; + } + foreach ($LnItm->Taxes as $Tax) { if ($i>0){ echo '<br>'; } - echo '<input type=text class=number name="' . $LnItm->LineNumber . $Tax->TaxCalculationOrder . '_TaxRate" maxlength=4 size=4 value="' . $Tax->TaxRate*100 . '">'; + if (!isset($_POST['ProcessCredit'])) { + echo '<input type=text class=number name="' . $LnItm->LineNumber . $Tax->TaxCalculationOrder . + '_TaxRate" maxlength=4 size=4 value="' . $Tax->TaxRate*100 . '">'; + } $i++; if ($Tax->TaxOnTax ==1){ $TaxTotals[$Tax->TaxAuthID] += ($Tax->TaxRate * ($LineTotal + $TaxLineTotal)); @@ -360,55 +372,58 @@ $TaxGLCodes[$Tax->TaxAuthID] = $Tax->TaxGLCode; } } - echo '</td>'; - $TaxTotal += $TaxLineTotal; $DisplayTaxAmount = number_format($TaxLineTotal ,2); $DisplayGrossLineTotal = number_format($LineTotal+ $TaxLineTotal,2); - echo '<td class=number>' . $DisplayTaxAmount . '</td> - <td class=number>' . $DisplayGrossLineTotal . "</td> - <td><a href='". $_SERVER['PHP_SELF'] . "?" . SID . "&Delete=" . $LnItm->LineNumber . "'>" . _('Delete') . '</a></td></tr>'; + if (!isset($_POST['ProcessCredit'])) { + echo '</td>'; - echo '<tr'.$RowStarter . "><td colspan=12><TEXTAREA tabindex=".$j." name='Narrative_" . $LnItm->LineNumber . "' cols=100% rows=1>" . $LnItm->Narrative . "</TEXTAREa><br><hr></td></tr>"; - $j++; + echo '<td class=number>' . $DisplayTaxAmount . '</td> + <td class=number>' . $DisplayGrossLineTotal . "</td> + <td><a href='". $_SERVER['PHP_SELF'] . "?" . SID . "&Delete=" . $LnItm->LineNumber . "'>" . _('Delete') . '</a></td></tr>'; + + echo '<tr'.$RowStarter . "><td colspan=12><TEXTAREA tabindex=".$j." name='Narrative_" . $LnItm->LineNumber . "' cols=100% rows=1>" . $LnItm->Narrative . "</TEXTAREa><br><hr></td></tr>"; + $j++; + } } /*end foreach loop displaying the invoice lines to credit */ if (!isset($_POST['ChargeFreightCost']) AND !isset($_SESSION['CreditItems']->FreightCost)){ $_POST['ChargeFreightCost']=0; } -echo '<tr> - <td colspan=3 class=number>' . _('Freight cost charged on invoice') . '</td> - <td class=number>' . number_format($_SESSION['Old_FreightCost'],2) . '</td> - <td></td> - <td colspan=2 class=number>' . _('Credit Freight Cost') . "</td> - <td><input tabindex=".$j." type=TEXT class=number size=6 maxlength=6 name='ChargeFreightCost' VALUE=" . $_SESSION['CreditItems']->FreightCost . "></td>"; +if (!isset($_POST['ProcessCredit'])) { + echo '<tr> + <td colspan=3 class=number>' . _('Freight cost charged on invoice') . '</td> + <td class=number>' . number_format($_SESSION['Old_FreightCost'],2) . '</td> + <td></td> + <td colspan=2 class=number>' . _('Credit Freight Cost') . "</td> + <td><input tabindex=".$j." type=text class=number size=6 maxlength=6 name='ChargeFreightCost' value=" . $_SESSION['CreditItems']->FreightCost . "></td>"; + echo '<td>'; + echo '</td><td>'; -$FreightTaxTotal =0; //initialise tax total -echo '<td>'; - -$i=0; // initialise the number of taxes iterated through -foreach ($_SESSION['CreditItems']->FreightTaxes as $FreightTaxLine) { - if ($i>0){ - echo '<br>'; + $i=0; // initialise the number of taxes iterated through + foreach ($_SESSION['CreditItems']->FreightTaxes as $FreightTaxLine) { + if ($i>0){ + echo '<br>'; + } + echo $FreightTaxLine->TaxAuthDescription; + $i++; } - echo $FreightTaxLine->TaxAuthDescription; - $i++; } +$FreightTaxTotal =0; //initialise tax total -echo '</td><td>'; - $i=0; foreach ($_SESSION['CreditItems']->FreightTaxes as $FreightTaxLine) { if ($i>0){ echo '<br>'; } - echo '<input type=text class=number name=FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder . ' maxlength=4 size=4 VALUE=' . $FreightTaxLine->TaxRate * 100 . '>'; - + if (!isset($_POST['ProcessCredit'])) { + echo '<input type=text class=number name=FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder . ' maxlength=4 size=4 VALUE=' . $FreightTaxLine->TaxRate * 100 . '>'; + } if ($FreightTaxLine->TaxOnTax ==1){ $TaxTotals[$FreightTaxLine->TaxAuthID] += ($FreightTaxLine->TaxRate * ($_SESSION['CreditItems']->FreightCost + $FreightTaxTotal)); $FreightTaxTotal += ($FreightTaxLine->TaxRate * ($_SESSION['CreditItems']->FreightCost + $FreightTaxTotal)); @@ -419,24 +434,26 @@ $i++; $TaxGLCodes[$FreightTaxLine->TaxAuthID] = $FreightTaxLine->TaxGLCode; } -echo '</td>'; +if (!isset($_POST['ProcessCredit'])) { + echo '</td>'; -echo '<td class=number>' . number_format($FreightTaxTotal,2) . '</td> - <td class=number>' . number_format($FreightTaxTotal+ $_SESSION['CreditItems']->FreightCost,2) . '</td> - </tr>'; + echo '<td class=number>' . number_format($FreightTaxTotal,2) . '</td> + <td class=number>' . number_format($FreightTaxTotal+ $_SESSION['CreditItems']->FreightCost,2) . '</td> + </tr>'; +} $TaxTotal += $FreightTaxTotal; $DisplayTotal = number_format($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost,2); - -echo '<tr> - <td colspan=7 class=number>' . _('Credit Totals') . "</td> - <td class=number><hr><b>$DisplayTotal</b><hr></td> - <td colspan=2></td> - <td class=number><hr><b>" . number_format($TaxTotal,2) . "<hr></td> - <td class=number><hr><b>" . number_format($TaxTotal+($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost),2) . "</b><hr></td> -</tr></table>"; - +if (!isset($_POST['ProcessCredit'])) { + echo '<tr> + <td colspan=7 class=number>' . _('Credit Totals') . "</td> + <td class=number><hr><b>$DisplayTotal</b><hr></td> + <td colspan=2></td> + <td class=number><hr><b>" . number_format($TaxTotal,2) . "<hr></td> + <td class=number><hr><b>" . number_format($TaxTotal+($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost),2) . "</b><hr></td> + </tr></table>"; +} $DefaultDispatchDate = Date($_SESSION['DefaultDateFormat']); $OKToProcess = true; @@ -469,7 +486,6 @@ exit; } - /*Now Get the next credit note number - function in SQL_CommonFunctions*/ $CreditNo = GetNextTransNo(11, $db); @@ -521,8 +537,8 @@ $SQL = "UPDATE debtortrans SET alloc = alloc + " . $Allocate_amount . ", - settled=" . $SettledInvoice . " - WHERE transno = " . $_SESSION['ProcessingCredit'] . " + settled='" . $SettledInvoice . "' + WHERE transno = '" . $_SESSION['ProcessingCredit'] . "' AND type=10"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The alteration to the invoice record to reflect the allocation of the credit note to the invoice could not be done because'); @@ -531,7 +547,6 @@ } /*Now insert the Credit Note into the DebtorTrans table with the allocations as calculated above*/ - $SQL = "INSERT INTO debtortrans (transno, type, debtorno, @@ -555,15 +570,17 @@ '" . $_SESSION['CreditItems']->Branch . "', '" . $DefaultDispatchDate . "', '" . date('Y-m-d H-i-s') . "', - " . $PeriodNo . ", 'Inv-" . $_SESSION['ProcessingCredit'] . "', + '" . $PeriodNo . "', + 'Inv-" . $_SESSION['ProcessingCredit'] . "', '" . $_SESSION['CreditItems']->DefaultSalesType . "', - " . $_SESSION['CreditItems']->OrderNo . ", - " . -($_SESSION['CreditItems']->total) . ", - " . -$TaxTotal . ", " . -$_SESSION['CreditItems']->FreightCost . ", - " . $_SESSION['CurrencyRate'] . ", + '" . $_SESSION['CreditItems']->OrderNo . "', + '" . -($_SESSION['CreditItems']->total) . "', + '" . -$TaxTotal . "', + '" . -$_SESSION['CreditItems']->FreightCost . "', + '" . $_SESSION['CurrencyRate'] . "', '" . $_POST['CreditText'] . "', - " . -$Allocate_amount . ", - " . $Settled . ")"; + '" . -$Allocate_amount . "', + '" . $Settled . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The customer credit note transaction could not be added to the database because'); $DbgMsg = _('The following SQL to insert the customer credit note was used'); @@ -574,12 +591,13 @@ /* Insert the tax totals for each tax authority where tax was charged on the invoice */ foreach ($TaxTotals AS $TaxAuthID => $TaxAmount) { - $SQL = 'INSERT INTO debtortranstaxes (debtortransid, + $SQL = "INSERT INTO debtortranstaxes ( + debtortransid, taxauthid, taxamount) - VALUES (' . $CreditTransID . ', - ' . $TaxAuthID . ', - ' . -($TaxAmount/$_SESSION['CurrencyRate']) . ')'; + VALUES ('" . $CreditTransID . "', + '" . $TaxAuthID . "', + '" . -($TaxAmount/$_SESSION['CurrencyRate']) . "')"; $ErrMsg =_('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The debtor transaction taxes records could not be inserted because'); $DbgMsg = _('The following SQL to insert the debtor transaction taxes record was used'); @@ -592,9 +610,9 @@ transid_allocfrom, transid_allocto, datealloc) - VALUES (" . $Allocate_amount . ", - " . $CreditTransID . ", - " . $_SESSION['CreditItems']->TransID . ", + VALUES ('" . $Allocate_amount . "', + '" . $CreditTransID . "', + '" . $_SESSION['CreditItems']->TransID . "', '" . Date('Y-m-d') . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The allocation record for the credit note could not be added to the database because'); @@ -643,9 +661,9 @@ $SQL = "UPDATE salesorderdetails SET qtyinvoiced = qtyinvoiced - " . $OrderLine->QtyDispatched . ", completed=0 - WHERE orderno = " . $_SESSION['CreditItems']->OrderNo . " + WHERE orderno = '" . $_SESSION['CreditItems']->OrderNo . "' AND stkcode = '" . $OrderLine->StockID . "' - AND orderlineno=" . $OrderLine->LineNumber; + AND orderlineno='" . $OrderLine->LineNumber."'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The sales order detail record could not be updated for the reduced quantity invoiced because'); $DbgMsg = _('The following SQL to update the sales order detail record was used'); @@ -737,17 +755,17 @@ newqoh ) VALUES ('" . $AssParts['component'] . "', 11, - " . $CreditNo . ", + '" . $CreditNo . "', '" . $_SESSION['CreditItems']->Location . "', '" . $DefaultDispatchDate . "', '" . $_SESSION['CreditItems']->DebtorNo . "', '" . $_SESSION['CreditItems']->Branch . "', - " . $PeriodNo . ", + '" . $PeriodNo . "', '" . _('Ex Inv') . ': ' . $_SESSION['ProcessingCredit'] . ' ' . _('Assembly') . ': ' . $OrderLine->StockID . "', - " . $AssParts['quantity'] * $OrderLine->QtyDispatched . ", - " . $AssParts['standard'] . ", + '" . $AssParts['quantity'] * $OrderLine->QtyDispatched . "', + '" . $AssParts['standard'] . "', 0, - " . ($QtyOnHandPrior + ($AssParts['quantity'] * $OrderLine->QtyDispatched)) . " + '" . ($QtyOnHandPrior + ($AssParts['quantity'] * $OrderLine->QtyDispatched)) . "' )"; } else { @@ -766,15 +784,15 @@ show_on_inv_crds) VALUES ('" . $AssParts['component'] . "', 11, - " . $CreditNo . ", + '" . $CreditNo . "', '" . $_SESSION['CreditItems']->Location . "', '" . $DefaultDispatchDate . "', '" . $_SESSION['CreditItems']->DebtorNo . "', '" . $_SESSION['CreditItems']->Branch . "', - " . $PeriodNo . ", + '" . $PeriodNo . "', '" . _('Ex Inv') . ': ' . $_SESSION['ProcessingCredit'] . ' ' . _('Assembly') . ': ' . $OrderLine->StockID . "', - " . $AssParts['quantity'] * $OrderLine->QtyDispatched . ", - " . $AssParts['standard'] . ", + '" . $AssParts['quantity'] * $OrderLine->QtyDispatched . "', + '" . $AssParts['standard'] . "', 0)"; } @@ -823,18 +841,18 @@ narrative) VALUES ('" . $OrderLine->StockID . "', 11, - " . $CreditNo . ", + '" . $CreditNo . "', '" . $_SESSION['CreditItems']->Location . "', '" . $DefaultDispatchDate . "', '" . $_SESSION['CreditItems']->DebtorNo . "', '" . $_SESSION['CreditItems']->Branch . "', - " . $LocalCurrencyPrice . ", - " . $PeriodNo . ", + '" . $LocalCurrencyPrice . "', + '" . $PeriodNo . "', '" . _('Ex Inv') .' - ' . $_SESSION['ProcessingCredit'] . "', - " . $OrderLine->QtyDispatched . ", - " . $OrderLine->DiscountPercent . ", - " . $OrderLine->StandardCost . ", - " . ($QtyOnHandPrior + $OrderLine->QtyDispatched) . ", + '" . $OrderLine->QtyDispatched . "', + '" . $OrderLine->DiscountPercent . "', + '" . $OrderLine->StandardCost . "', + '" . ($QtyOnHandPrior + $OrderLine->QtyDispatched) . "', '" . $OrderLine->Narrative . "')"; } else { @@ -855,17 +873,17 @@ narrative) VALUES ('" . $OrderLine->StockID . "', 11, - " . $CreditNo . ", + '" . $CreditNo . "', '" . $_SESSION['CreditItems']->Location . "', '" . $DefaultDispatchDate . "', '" . $_SESSION['CreditItems']->DebtorNo . "', '" . $_SESSION['CreditItems']->Branch . "', - " . $LocalCurrencyPrice . ", - " . $PeriodNo . ", + '" . $LocalCurrencyPrice . "', + '" . $PeriodNo . "', '" . _('Ex Inv') . " - " . $_SESSION['ProcessingCredit'] . "', - " . $OrderLine->QtyDispatched . ", - " . $OrderLine->DiscountPercent . ", - " . $OrderLine->StandardCost . ", + '" . $OrderLine->QtyDispatched . "', + '" . $OrderLine->DiscountPercent . "', + '" . $OrderLine->StandardCost . "', '" . $OrderLine->Narrative . "' )"; } @@ -898,7 +916,7 @@ ('" . $OrderLine->StockID . "', '" . $_SESSION['CreditItems']->Location . "', '" . $Item->BundleRef . "', - ". $Item->BundleQty .")"; + '". $Item->BundleQty ."')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record could not be updated because'); $DbgMsg = _('The following SQL to update the serial stock item record was used'); @@ -921,10 +939,10 @@ stockid, serialno, moveqty) - VALUES (" . $StkMoveNo . ", + VALUES ('" . $StkMoveNo . "', '" . $OrderLine->StockID . "', '" . $Item->BundleRef . "', - " . $Item->BundleQty . ")"; + '" . $Item->BundleQty . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock movement record could not be inserted because'); $DbgMsg = _('The following SQL to insert the serial stock movement records was used'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); @@ -955,18 +973,18 @@ narrative ) VALUES ('" . $OrderLine->StockID . "', 11, - " . $CreditNo . ", + '" . $CreditNo . "', '" . $_SESSION['CreditItems']->Location . "', '" . $DefaultDispatchDate . "', '" . $_SESSION['CreditItems']->DebtorNo . "', '" . $_SESSION['CreditItems']->Branch . "', - " . $LocalCurrencyPrice . ", - " . $PeriodNo . ", + '" . $LocalCurrencyPrice . "', + '" . $PeriodNo . "', '" . _('Ex Inv') . ' - ' . $_SESSION['ProcessingCredit'] . "', - " . $OrderLine->QtyDispatched . ", - " . $OrderLine->DiscountPercent . ", - " . $OrderLine->StandardCost . ", - " . ($QtyOnHandPrior +$OrderLine->QtyDispatched) . ", + '" . $OrderLine->QtyDispatched . "', + '" . $OrderLine->DiscountPercent . "', + '" . $OrderLine->StandardCost . "', + '" . ($QtyOnHandPrior +$OrderLine->QtyDispatched) . "'', '" . $OrderLine->Narrative . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Stock movement records could not be inserted because'); @@ -993,19 +1011,19 @@ ) VALUES ('" . $OrderLine->StockID . "', 11, - " . $CreditNo . ", + '" . $CreditNo . "', '" . $_SESSION['CreditItems']->Location . "', '" . $DefaultDispatchDate . "', '" . $_SESSION['CreditItems']->DebtorNo . "', '" . $_SESSION['CreditItems']->Branch . "', - " . $LocalCurrencyPrice . ", - " . $PeriodNo . ", + '" . $LocalCurrencyPrice . "', + '" . $PeriodNo . "', '" . _('Written off ex Inv') . ' - ' . $_SESSION['ProcessingCredit'] . "', - " . -$OrderLine->QtyDispatched . ", - " . $OrderLine->DiscountPercent . ", - " . $OrderLine->StandardCost . ", + '" . -$OrderLine->QtyDispatched . "', + '" . $OrderLine->DiscountPercent . "', + '" . $OrderLine->StandardCost . "', 0, - " . $QtyOnHandPrior . ", + '" . $QtyOnHandPrior . "', '" . $OrderLine->Narrative . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Stock movement records could not be inserted because'); @@ -1033,18 +1051,18 @@ narrative) VALUES ('" . $OrderLine->StockID . "', 11, - " . $CreditNo . ", + '" . $CreditNo . "', '" . $_SESSION['CreditItems']->Location . "', '" . $DefaultDispatchDate . "', '" . $_SESSION['CreditItems']->DebtorNo . "', '" . $_SESSION['CreditItems']->Branch . "', - " . $LocalCurrencyPrice . ", - " . $PeriodNo . ", + '" . $LocalCurrencyPrice . "', + '" . $PeriodNo . "', '" . _('Ex Inv') .' - ' . $_SESSION['ProcessingCredit'] . "', - " . $OrderLine->QtyDispatched . ", - " . $OrderLine->DiscountPercent . ", - " . $OrderLine->StandardCost . ", - " . $QtyOnHandPrior . ", + '" . $OrderLine->QtyDispatched . "', + '" . $OrderLine->DiscountPercent . "', + '" . $OrderLine->StandardCost . "', + '" . $QtyOnHandPrior . "', 1, '" . $OrderLine->Narrative . "')"; @@ -1061,16 +1079,16 @@ /*Insert the taxes that applied to this line */ foreach ($OrderLine->Taxes as $Tax) { - $SQL = 'INSERT INTO stockmovestaxes (stkmoveno, + $SQL = "INSERT INTO stockmovestaxes (stkmoveno, taxauthid, taxrate, taxcalculationorder, taxontax) - VALUES (' . $StkMoveNo . ', - ' . $Tax->TaxAuthID . ', - ' . $Tax->TaxRate . ', - ' . $Tax->TaxCalculationOrder . ', - ' . $Tax->TaxOnTax . ')'; + VALUES ('" . $StkMoveNo . "', + '" . $Tax->TaxAuthID . "', + '" . $Tax->TaxRate . "', + '" . $Tax->TaxCalculationOrder . "', + '" . $Tax->TaxOnTax . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Taxes and rates applicable to this credit note line item could not be inserted because'); $DbgMsg = _('The following SQL to insert the stock movement tax detail records was used'); @@ -1093,7 +1111,7 @@ AND salesanalysis.area=custbranch.area AND salesanalysis.salesperson=custbranch.salesman AND typeabbrev ='" . $_SESSION['CreditItems']->DefaultSalesType . "' - AND periodno=" . $PeriodNo . " + AND periodno='" . $PeriodNo . "' AND cust = '" . $_SESSION['CreditItems']->DebtorNo . "' AND custbranch = '" . $_SESSION['CreditItems']->Branch . "' AND salesanalysis.stockid = '" . $OrderLine->StockID . "' @@ -1117,7 +1135,7 @@ WHERE salesanalysis.area='" . $myrow[2] . "' AND salesanalysis.salesperson='" . $myrow[3] . "' AND typeabbrev ='" . $_SESSION['CreditItems']->DefaultSalesType . "' - AND periodno = " . $PeriodNo . " + AND periodno = '" . $PeriodNo . "' AND cust = '" . $_SESSION['CreditItems']->DebtorNo . "' AND custbranch = '" . $_SESSION['CreditItems']->Branch . "' AND stockid = '" . $OrderLine->StockID . "' @@ -1134,7 +1152,7 @@ WHERE salesanalysis.area='" . $myrow[2] . "' AND salesanalysis.salesperson='" . $myrow[3] . "' AND typeabbrev ='" . $_SESSION['CreditItems']->DefaultSalesType . "' - AND periodno = " . $PeriodNo . " + AND periodno = '" . $PeriodNo . "' AND cust = '" . $_SESSION['CreditItems']->DebtorNo . "' AND custbranch = '" . $_SESSION['CreditItems']->Branch . "' AND stockid = '" . $OrderLine->StockID . "' @@ -1159,12 +1177,12 @@ salesperson, stkcategory) SELECT '" . $_SESSION['CreditItems']->DefaultSalesType . "', - " . $PeriodNo . ", - " . -($OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . ", + '" . $PeriodNo . "', + '" . -($OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . "', '" . $_SESSION['CreditItems']->DebtorNo . "', '" . $_SESSION['CreditItems']->Branch . "', 0, - " . -($OrderLine->DiscountPercent * $OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . ", + '" . -($OrderLine->DiscountPercent * $OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . "', '" . $OrderLine->StockID . "', custbranch.area, 1, @@ -1191,12 +1209,13 @@ salesperson, stkcategory) SELECT '" . $_SESSION['CreditItems']->DefaultSalesType . "', - " . $PeriodNo . ", " . -($OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . ", - " . -($OrderLine->StandardCost * $OrderLine->QtyDispatched) . ", + '" . $PeriodNo . "', + '" . -($OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . "', + '" . -($OrderLine->StandardCost * $OrderLine->QtyDispatched) . "', '" . $_SESSION['CreditItems']->DebtorNo . "', '" . $_SESSION['CreditItems']->Branch . "', - " . -$OrderLine->QtyDispatched . ", - " . -($OrderLine->DiscountPercent * $OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . ", + '" . -$OrderLine->QtyDispatched . "', + '" . -($OrderLine->DiscountPercent * $OrderLine->Price * $OrderLine->QtyDispatched / $_SESSION['CurrencyRate']) . "', '" . $OrderLine->StockID . "', custbranch.area, 1, @@ -1234,12 +1253,12 @@ narrative, amount) VALUES (11, - " . $CreditNo . ", + '" . $CreditNo . "', '" . $DefaultDispatchDate . "', - " . $PeriodNo . ", - " . $COGSAccount . ", + '" . $PeriodNo . "', + '" . $COGSAccount . "', '" . $_SESSION['CreditItems']->DebtorNo . " - " . $OrderLine->StockID . " x " . $OrderLine->QtyDispatched . " @ " . $OrderLine->StandardCost . "', - " . -round($OrderLine->StandardCost * $OrderLine->QtyDispatched,2) . " + '" . -round($OrderLine->StandardCost * $OrderLine->QtyDispatched,2) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The cost of sales GL posting could not be inserted because'); @@ -1258,12 +1277,12 @@ narrative, amount) VALUES (11, - " . $CreditNo . ", + '" . $CreditNo . "', '" . $DefaultDispatchDate . "', - " . $PeriodNo . ", - " . $_POST['WriteOffGLCode'] . ", + '" . $PeriodNo . "', + '" . $_POST['WriteOffGLCode'] . "', '" . $_SESSION['CreditItems']->DebtorNo . " - " . $OrderLine->StockID . " x " . $OrderLine->QtyDispatched . " @ " . $OrderLine->StandardCost . "', - " . round($OrderLine->StandardCost * $OrderLine->QtyDispatched,2) . ")"; + '" . round($OrderLine->StandardCost * $OrderLine->QtyDispatched,2) . "')"; } else { $StockGLCode = GetStockGLCode($OrderLine->StockID, $db); $SQL = "INSERT INTO gltrans (type, @@ -1274,12 +1293,12 @@ narrative, amount) VALUES (11, - " . $CreditNo . ", + '" . $CreditNo . "', '" . $DefaultDispatchDate . "', - " . $PeriodNo . ", - " . $StockGLCode['stockact'] . ", + '" . $PeriodNo . "', + '" . $StockGLCode['stockact'] . "', '" . $_SESSION['CreditItems']->DebtorNo . " - " . $OrderLine->StockID . " x " . $OrderLine->QtyDispatched . " @ " . $OrderLine->StandardCost . "', - " . round($OrderLine->StandardCost * $OrderLine->QtyDispatched,2) . ")"; + '" . round($OrderLine->StandardCost * $OrderLine->QtyDispatched,2) . "')"; } $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The stock side or write off of the cost of sales GL posting could not be inserted because'); @@ -1301,12 +1320,12 @@ narrative, amount) VALUES (11, - " . $CreditNo . ", + '" . $CreditNo . "', '" . $DefaultDispatchDate . "', - " . $PeriodNo . ", - " . $SalesGLAccounts['salesglcode'] . ", + '" . $PeriodNo . "', + '" . $SalesGLAccounts['salesglcode'] . "', '" . $_SESSION['CreditItems']->DebtorNo . " - " . $OrderLine->StockID . " x " . $OrderLine->QtyDispatched . " @ " . $OrderLine->Price . "', - " . round(($OrderLine->Price * $OrderLine->QtyDispatched)/$_SESSION['CurrencyRate'],2) . " + '" . round(($OrderLine->Price * $OrderLine->QtyDispatched)/$_SESSION['CurrencyRate'],2) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The credit note GL posting could not be inserted because'); @@ -1323,12 +1342,12 @@ narrative, amount) VALUES (11, - " . $CreditNo . ", + '" . $CreditNo . "', '" . $DefaultDispatchDate . "', - " . $PeriodNo . ", - " . $SalesGLAccounts['discountglcode'] . ", + '" . $PeriodNo . "', + '" . $SalesGLAccounts['discountglcode'] . "', '" . $_SESSION['CreditItems']->DebtorNo . " - " . $OrderLine->StockID . " @ " . ($OrderLine->DiscountPercent * 100) . "%', - " . -round(($OrderLine->Price * $OrderLine->QtyDispatched * $OrderLine->DiscountPercent)/$_SESSION['CurrencyRate'],2) . " + '" . -round(($OrderLine->Price * $OrderLine->QtyDispatched * $OrderLine->DiscountPercent)/$_SESSION['CurrencyRate'],2) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The credit note discount GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); @@ -1351,12 +1370,12 @@ narrative, amount) VALUES (11, - " . $CreditNo . ", + '" . $CreditNo . "', '" . $DefaultDispatchDate . "', - " . $PeriodNo . ", - " . $_SESSION['CompanyRecord']['debtorsact'] . ", + '" . $PeriodNo . "', + '" . $_SESSION['CompanyRecord']['debtorsact'] . "', '" . $_SESSION['CreditItems']->DebtorNo . "', - " . -round(($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost + $TaxTotal)/$_SESSION['CurrencyRate'],2) . " + '" . -round(($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost + $TaxTotal)/$_SESSION['CurrencyRate'],2) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The total debtor GL posting for the credit note could not be inserted because'); @@ -1377,12 +1396,12 @@ narrative, amount) VALUES (11, - " . $CreditNo . ", + '" . $CreditNo . "', '" . $DefaultDispatchDate . "', - " . $PeriodNo . ", - " . $_SESSION['CompanyRecord']['freightact'] . ", + '" . $PeriodNo . "', + '" . $_SESSION['CompanyRecord']['freightact'] . "', '" . $_SESSION['CreditItems']->DebtorNo . "', - " . round($_SESSION['CreditItems']->FreightCost/$_SESSION['CurrencyRate'],2) . " + '" . round($_SESSION['CreditItems']->FreightCost/$_SESSION['CurrencyRate'],2) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The freight GL posting for this credit note could not be inserted because'); @@ -1403,12 +1422,12 @@ ) VALUES ( 11, - " . $CreditNo . ", + '" . $CreditNo . "', '" . $DefaultDispatchDate . "', - " . $PeriodNo . ", - " . $TaxGLCodes[$TaxAuthID] . ", + '" . $PeriodNo . "', + '" . $TaxGLCodes[$TaxAuthID] . "', '" . $_SESSION['CreditItems']->DebtorNo . "', - " . ($TaxAmount/$_SESSION['CurrencyRate']) . " + '" . ($TaxAmount/$_SESSION['CurrencyRate']) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The tax GL posting could not be inserted because'); @@ -1437,7 +1456,7 @@ } else { /*Process Credit NOT set so allow inputs to set up the credit note */ - echo "<table>"; + echo "<br><table class=selection>"; echo '<tr><td>' . _('Credit Note Type') . "</td><td><select tabindex=".$j." name=CreditType>"; @@ -1461,7 +1480,7 @@ /*if the credit note is a return of goods then need to know which location to receive them into */ - echo '<tr><td>' . _('Goods returned to location') . '</td><td><select TABINDEX='.$j.' name=Location>'; + echo '<tr><td>' . _('Goods returned to location') . '</td><td><select tabindex='.$j.' name=Location>'; $SQL="SELECT loccode, locationname FROM locations"; $Result = DB_query($SQL,$db); @@ -1484,20 +1503,20 @@ echo '<tr><td>' . _('Write off the cost of the goods to') . '</td><td><select TABINDEX='.$j.' name="WriteOffGLCode">'; - $SQL='SELECT accountcode, + $SQL="SELECT accountcode, accountname FROM chartmaster, accountgroups WHERE chartmaster.group_=accountgroups.groupname - AND accountgroups.pandl=1 ORDER BY chartmaster.accountcode'; + AND accountgroups.pandl=1 ORDER BY chartmaster.accountcode"; $Result = DB_query($SQL,$db); while ($myrow = DB_fetch_array($Result)) { if ($_POST['WriteOffGLCode']==$myrow["accountcode"]){ - echo "<option selected VALUE=" . $myrow["accountcode"] . ">" . $myrow["accountname"]; + echo "<option selected value=" . $myrow["accountcode"] . ">" . $myrow["accountname"]; } else { - echo "<option VALUE=" . $myrow["accountcode"] . ">" . $myrow["accountname"]; + echo "<option value=" . $myrow["accountcode"] . ">" . $myrow["accountname"]; } } echo "</select></td></tr>"; @@ -1506,10 +1525,10 @@ $_POST['CreditText'] = ''; } $j++; - echo '<tr><td>' . _('Credit note text') . '</td><td><TEXTAREA TABINDEX='.$j.' name=CreditText COLS=31 ROWS=5>' . $_POST['CreditText'] . '</TEXTAREa></td></tr>'; - echo '</table><div class="centre"><input TABINDEX='.$j.' type=submit name=Update Value=' . _('Update') . '><p>'; + echo '<tr><td>' . _('Credit note text') . '</td><td><textarea tabindex='.$j.' name=CreditText cols=31 rows=5>' . $_POST['CreditText'] . '</textarea></td></tr>'; + echo '</table><br><div class="centre"><input TABINDEX='.$j.' type=submit name=Update Value=' . _('Update') . '><p>'; $j++; - echo "<input type=submit TABINDEX=".$j++." name='ProcessCredit' Value='" . _('Process Credit') ."'></div>"; + echo "<input type=submit tabindex=".$j++." name='ProcessCredit' Value='" . _('Process Credit') ."'></div>"; } echo "</form>"; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-07-04 22:01:17 UTC (rev 3559) +++ trunk/doc/Change.log.html 2010-07-04 22:01:36 UTC (rev 3560) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>04/07/10 Tim: Credit_Invoice.php - Minor bug fixes layout changes and corrections to sql statements</p> <p>04/07/10 Tim: ConfirmDispatchControlled_Invoice.php - Force the LineNo variable to be read as integer</p> <p>04/07/10 Tim: ConfirmDispatch_Invoice.php - Various fixes, corrections to sql statements and layout changes</p> <p>04/07/10 Tim: CompanyPreferences.php - Corrections to sql statements and layout changes</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-07-04 22:02:04
|
Revision: 3561 http://web-erp.svn.sourceforge.net/web-erp/?rev=3561&view=rev Author: tim_schofield Date: 2010-07-04 22:01:58 +0000 (Sun, 04 Jul 2010) Log Message: ----------- Corrections to sql statements and layout changes Modified Paths: -------------- trunk/CreditStatus.php trunk/doc/Change.log.html Modified: trunk/CreditStatus.php =================================================================== --- trunk/CreditStatus.php 2010-07-04 22:01:36 UTC (rev 3560) +++ trunk/CreditStatus.php 2010-07-04 22:01:58 UTC (rev 3561) @@ -18,6 +18,7 @@ } $Errors = array(); $InputError = 0; +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="">' . ' ' . $title.'<br>'; if (isset($_POST['submit'])) { @@ -29,7 +30,7 @@ //first off validate inputs are sensible - $sql="SELECT count(reasoncode) + $sql="SELECT count(reasoncode) FROM holdreasons WHERE reasoncode='".$_POST['ReasonCode']."'"; $result=DB_query($sql, $db); $myrow=DB_fetch_row($result); @@ -38,14 +39,14 @@ $InputError = 1; prnMsg( _('The credit status code already exists in the database'),'error'); $Errors[$i] = 'ReasonCode'; - $i++; + $i++; } if (!is_numeric($_POST['ReasonCode'])) { $InputError = 1; prnMsg(_('The status code name must be an integer'),'error'); $Errors[$i] = 'ReasonCode'; - $i++; - } + $i++; + } if (strlen($_POST['ReasonDescription']) > 30) { $InputError = 1; prnMsg(_('The credit status description must be thirty characters or less long'),'error'); @@ -54,7 +55,7 @@ $InputError = 1; prnMsg(_('The credit status description must be entered'),'error'); $Errors[$i] = 'ReasonDescription'; - $i++; + $i++; } $msg=''; @@ -64,15 +65,15 @@ /*SelectedReason could also exist if submit had not been clicked this code would not run in this case cos submit is false of course see the delete code below*/ if (isset($_POST['DisallowInvoices']) and $_POST['DisallowInvoices']=='on'){ - $sql = "UPDATE holdreasons SET - reasondescription='" . $_POST['ReasonDescription'] . "', - dissallowinvoices=1 - WHERE reasoncode = $SelectedReason"; + $sql = "UPDATE holdreasons SET + reasondescription='" . $_POST['ReasonDescription'] . "', + dissallowinvoices=1 + WHERE reasoncode = '".$SelectedReason."'"; } else { - $sql = "UPDATE holdreasons SET - reasondescription='" . $_POST['ReasonDescription'] . "', - dissallowinvoices=0 - WHERE reasoncode = $SelectedReason"; + $sql = "UPDATE holdreasons SET + reasondescription='" . $_POST['ReasonDescription'] . "', + dissallowinvoices=0 + WHERE reasoncode = '".$SelectedReason."'"; } $msg = _('The credit status record has been updated'); @@ -82,21 +83,21 @@ if (isset($_POST['DisallowInvoices']) and $_POST['DisallowInvoices']=='on'){ - $sql = 'INSERT INTO holdreasons ( - reasoncode, - reasondescription, - dissallowinvoices) - VALUES (' . - $_POST['ReasonCode'] . ", '" . - $_POST['ReasonDescription'] . "', 1)"; + $sql = "INSERT INTO holdreasons ( + reasoncode, + reasondescription, + dissallowinvoices) + VALUES ( + '" .$_POST['ReasonCode'] . ", + '" .$_POST['ReasonDescription'] . "', 1)"; } else { - $sql = 'INSERT INTO holdreasons ( - reasoncode, - reasondescription, - dissallowinvoices) - VALUES (' . - $_POST['ReasonCode'] . ", '" . - $_POST['ReasonDescription'] . "', 0)"; + $sql = "INSERT INTO holdreasons ( + reasoncode, + reasondescription, + dissallowinvoices) + VALUES ( + '" .$_POST['ReasonCode'] . ", + '" .$_POST['ReasonDescription'] . "', 0)"; } $msg = _('A new credit status record has been inserted'); @@ -113,10 +114,10 @@ // PREVENT DELETES IF DEPENDENT RECORDS IN DebtorsMaster - $sql= "SELECT COUNT(*) - FROM debtorsmaster - WHERE debtorsmaster.holdreason=$SelectedReason"; - + $sql= "SELECT COUNT(*) + FROM debtorsmaster + WHERE debtorsmaster.holdreason='".$SelectedReason."'"; + $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0] > 0) { @@ -142,10 +143,10 @@ links to delete or edit each. These will call the same page again and allow update/input or deletion of the records*/ - $sql = 'SELECT reasoncode, reasondescription, dissallowinvoices FROM holdreasons'; + $sql = "SELECT reasoncode, reasondescription, dissallowinvoices FROM holdreasons"; $result = DB_query($sql, $db); - echo '<table border=1>'; + echo '<table class=selection>'; echo "<tr> <th>". _('Status Code') ."</th> <th>". _('Description') ."</th> @@ -201,7 +202,7 @@ reasondescription, dissallowinvoices FROM holdreasons - WHERE reasoncode='$SelectedReason'"; + WHERE reasoncode='".$SelectedReason."'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); @@ -219,7 +220,7 @@ if (!isset($_POST['ReasonCode'])) { $_POST['ReasonCode'] = ''; } - echo '<table> + echo '<br><table class=selection> <tr> <td>'. _('Status Code') .":</td> <td><input " . (in_array('ReasonCode',$Errors) ? 'class="inputerror"' : '' ) . @@ -239,9 +240,9 @@ if (isset($_POST['DisallowInvoices']) and $_POST['DisallowInvoices']==1) { echo "<td><input tabindex=3 type='checkbox' checked name='DisallowInvoices'></td></tr>"; } else { - echo "<td><input tabindex=3 type='checkbox' name='DisallowInvoices'></td></tr>"; + echo "<td><input tabindex=3 type='checkbox' name='DisallowInvoices'></td></tr>"; } - echo "</table><div class='centre'><input tabindex=4 type='Submit' name='submit' value='" . _('Enter Information') . "'></div></form>"; + echo "</table><br><div class='centre'><input tabindex=4 type='Submit' name='submit' value='" . _('Enter Information') . "'></div></form>"; } //end if record deleted no point displaying form to add record include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-07-04 22:01:36 UTC (rev 3560) +++ trunk/doc/Change.log.html 2010-07-04 22:01:58 UTC (rev 3561) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>04/07/10 Tim: CreditStatus.php - Corrections to sql statements and layout changes</p> <p>04/07/10 Tim: Credit_Invoice.php - Minor bug fixes layout changes and corrections to sql statements</p> <p>04/07/10 Tim: ConfirmDispatchControlled_Invoice.php - Force the LineNo variable to be read as integer</p> <p>04/07/10 Tim: ConfirmDispatch_Invoice.php - Various fixes, corrections to sql statements and layout changes</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-07-04 22:02:34
|
Revision: 3562 http://web-erp.svn.sourceforge.net/web-erp/?rev=3562&view=rev Author: tim_schofield Date: 2010-07-04 22:02:28 +0000 (Sun, 04 Jul 2010) Log Message: ----------- Corrections to sql statements and layout changes Modified Paths: -------------- trunk/CreditStatus.php trunk/Currencies.php trunk/doc/Change.log.html Modified: trunk/CreditStatus.php =================================================================== --- trunk/CreditStatus.php 2010-07-04 22:01:58 UTC (rev 3561) +++ trunk/CreditStatus.php 2010-07-04 22:02:28 UTC (rev 3562) @@ -213,7 +213,7 @@ echo "<input type=hidden name='SelectedReason' VALUE='" . $SelectedReason . "'>"; echo "<input type=hidden name='ReasonCode' VALUE='" . $_POST['ReasonCode'] . "'>"; - echo "<table><tr><td>". _('Status Code') .':</td><td>'; + echo "<table class=selection><tr><td>". _('Status Code') .':</td><td>'; echo $_POST['ReasonCode'] . '</td></tr>'; } else { //end of if $SelectedReason only do the else when a new record is being entered Modified: trunk/Currencies.php =================================================================== --- trunk/Currencies.php 2010-07-04 22:01:58 UTC (rev 3561) +++ trunk/Currencies.php 2010-07-04 22:02:28 UTC (rev 3562) @@ -26,6 +26,8 @@ $Errors = array(); +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Search') . '" alt="">' . ' ' . $title.'<br>'; + if (isset($_POST['submit'])) { //initialise no input errors assumed initially before we test @@ -96,7 +98,7 @@ currency='" . $_POST['CurrencyName'] . "', country='". $_POST['Country']. "', hundredsname='" . $_POST['HundredsName'] . "', - rate=" .$_POST['ExchangeRate'] . " + rate='" .$_POST['ExchangeRate'] . "' WHERE currabrev = '" . $SelectedCurrency . "'"; $msg = _('The currency definition record has been updated'); @@ -112,7 +114,7 @@ '" . $_POST['Abbreviation'] . "', '" . $_POST['Country'] . "', '" . $_POST['HundredsName'] . "', - " . $_POST['ExchangeRate'] . ")"; + '" . $_POST['ExchangeRate'] . "')"; $msg = _('The currency definition record has been added'); } @@ -141,7 +143,7 @@ prnMsg(_('Cannot delete this currency because customer accounts have been created referring to this currency') . '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('customer accounts that refer to this currency'),'warn'); } else { - $sql= "SELECT COUNT(*) FROM suppliers WHERE suppliers.currcode = '$SelectedCurrency'"; + $sql= "SELECT COUNT(*) FROM suppliers WHERE suppliers.currcode = '".$SelectedCurrency."'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0] > 0) @@ -178,7 +180,7 @@ $sql = 'SELECT currency, currabrev, country, hundredsname, rate FROM currencies'; $result = DB_query($sql, $db); - echo '<table border=1>'; + echo '<table class=selection>'; echo '<tr><td></td> <th>' . _('ISO4217 Code') . '</th> <th>' . _('Currency Name') . '</th> @@ -192,6 +194,8 @@ /*Get published currency rates from Eurpoean Central Bank */ if ($_SESSION['UpdateCurrencyRatesDaily'] != '0') { $CurrencyRatesArray = GetECBCurrencyRates(); + } else { + $CurrencyRatesArray = array(); } while ($myrow = DB_fetch_row($result)) { @@ -297,14 +301,14 @@ echo '<input type="hidden" name="SelectedCurrency" VALUE="' . $SelectedCurrency . '">'; echo '<input type="hidden" name="Abbreviation" VALUE="' . $_POST['Abbreviation'] . '">'; - echo '<table><tr> + echo '<table class=selection><tr> <td>' . _('ISO 4217 Currency Code').':</td> <td>'; echo $_POST['Abbreviation'] . '</td></tr>'; } else { //end of if $SelectedCurrency only do the else when a new record is being entered if (!isset($_POST['Abbreviation'])) {$_POST['Abbreviation']='';} - echo '<table><tr> + echo '<table class=selection><tr> <td>' ._('Currency Abbreviation') . ':</td> <td><input ' . (in_array('Abbreviation',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="Abbreviation" value="' . $_POST['Abbreviation'] . '" size=4 maxlength=3></td></tr>'; } @@ -331,11 +335,11 @@ echo '</td></tr>'; echo '</table>'; - echo '<div class="centre"><input type="Submit" name="submit" value='._('Enter Information').'></div>'; + echo '<br><div class="centre"><input type="Submit" name="submit" value='._('Enter Information').'></div>'; echo '</form>'; } //end if record deleted no point displaying form to add record include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-07-04 22:01:58 UTC (rev 3561) +++ trunk/doc/Change.log.html 2010-07-04 22:02:28 UTC (rev 3562) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>04/07/10 Tim: Currencies.php - Corrections to sql statements and layout changes</p> <p>04/07/10 Tim: CreditStatus.php - Corrections to sql statements and layout changes</p> <p>04/07/10 Tim: Credit_Invoice.php - Minor bug fixes layout changes and corrections to sql statements</p> <p>04/07/10 Tim: ConfirmDispatchControlled_Invoice.php - Force the LineNo variable to be read as integer</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-07-04 22:02:52
|
Revision: 3563 http://web-erp.svn.sourceforge.net/web-erp/?rev=3563&view=rev Author: tim_schofield Date: 2010-07-04 22:02:46 +0000 (Sun, 04 Jul 2010) Log Message: ----------- Corrections to sql statements and layout changes Modified Paths: -------------- trunk/CustEDISetup.php trunk/doc/Change.log.html Modified: trunk/CustEDISetup.php =================================================================== --- trunk/CustEDISetup.php 2010-07-04 22:02:28 UTC (rev 3562) +++ trunk/CustEDISetup.php 2010-07-04 22:02:46 UTC (rev 3563) @@ -14,50 +14,51 @@ unset($Errors); } -$Errors = array(); +$Errors = array(); $i=0; +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Search') . '" alt="">' . ' ' . $title.'<br>'; if (isset($_POST['submit'])) { - //initialise no input errors assumed initially before we test - $InputError = 0; + //initialise no input errors assumed initially before we test + $InputError = 0; - /* actions to take once the user has clicked the submit button - ie the page has called itself with some user input */ + /* 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 + //first off validate inputs sensible - if (strstr($_POST['EDIReference'],"'") - OR strstr($_POST['EDIReference'],'+') + if (strstr($_POST['EDIReference'],"'") + OR strstr($_POST['EDIReference'],'+') OR strstr($_POST['EDIReference'],"\"") OR strstr($_POST['EDIReference'],'&') OR strstr($_POST['EDIReference'],' ')) { - $InputError = 1; - prnMsg(_('The customers EDI reference code cannot contain any of the following characters') .' - \' & + \" ' . _('or a space'),'warn'); - } - if (strlen($_POST['EDIReference'])<4 AND ($_POST['EDIInvoices']==1 OR $_POST['EDIOrders']==1)){ - $InputError = 1; - prnMsg(_('The customers EDI reference code must be set when EDI Invoices or EDI orders are activated'),'warn'); + $InputError = 1; + prnMsg(_('The customers EDI reference code cannot contain any of the following characters') .' - \' & + \" ' . _('or a space'),'warn'); + } + if (strlen($_POST['EDIReference'])<4 AND ($_POST['EDIInvoices']==1 OR $_POST['EDIOrders']==1)){ + $InputError = 1; + prnMsg(_('The customers EDI reference code must be set when EDI Invoices or EDI orders are activated'),'warn'); $Errors[$i] = 'EDIReference'; - $i++; - } - if (strlen($_POST['EDIAddress'])<4 AND $_POST['EDIInvoices']==1){ - $InputError = 1; - prnMsg(_('The customers EDI email address or FTP server address must be entered if EDI Invoices are to be sent'),'warn'); + $i++; + } + if (strlen($_POST['EDIAddress'])<4 AND $_POST['EDIInvoices']==1){ + $InputError = 1; + prnMsg(_('The customers EDI email address or FTP server address must be entered if EDI Invoices are to be sent'),'warn'); $Errors[$i] = 'EDIAddress'; - $i++; - } + $i++; + } - If ($InputError==0){ //ie no input errors + If ($InputError==0){ //ie no input errors - if (!isset($_POST['EDIServerUser'])){ - $_POST['EDIServerUser']=''; - } - if (!isset($_POST['EDIServerPwd'])){ - $_POST['EDIServerPwd']=''; - } - $sql = 'UPDATE debtorsmaster SET ediinvoices =' . $_POST['EDIInvoices'] . ', - ediorders =' . $_POST['EDIOrders'] . ", + if (!isset($_POST['EDIServerUser'])){ + $_POST['EDIServerUser']=''; + } + if (!isset($_POST['EDIServerPwd'])){ + $_POST['EDIServerPwd']=''; + } + $sql = "UPDATE debtorsmaster SET ediinvoices ='" . $_POST['EDIInvoices'] . "', + ediorders ='" . $_POST['EDIOrders'] . "', edireference='" . $_POST['EDIReference'] . "', editransport='" . $_POST['EDITransport'] . "', ediaddress='" . $_POST['EDIAddress'] . "', @@ -65,17 +66,17 @@ ediserverpwd='" . $_POST['EDIServerPwd'] . "' WHERE debtorno = '" . $_SESSION['CustomerID'] . "'"; - $ErrMsg = _('The customer EDI setup data could not be updated because'); + $ErrMsg = _('The customer EDI setup data could not be updated because'); $result = DB_query($sql,$db,$ErrMsg); - prnMsg(_('Customer EDI configuration updated'),'success'); + prnMsg(_('Customer EDI configuration updated'),'success'); - } else { - prnMsg(_('Customer EDI configuration failed'),'error'); - } + } else { + prnMsg(_('Customer EDI configuration failed'),'error'); + } } echo "<form method='post' action='" . $_SERVER['PHP_SELF'] . '?' . SID ."'>"; -echo '<table>'; +echo '<br><table class=selection>'; $sql = "SELECT debtorno, name, @@ -99,63 +100,63 @@ echo '<tr><td>'._('Customer Name').':</td> <td>' . $myrow['name'] . '</td></tr>'; echo '<tr><td>'._('Enable Sending of EDI Invoices').':</td> - <td><select TABINDEX=1 name="EDIInvoices">'; + <td><select tabindex=1 name="EDIInvoices">'; if ($myrow['ediinvoices']==0){ - echo '<option selected VALUE=0>'._('Disabled'); - echo '<option VALUE=1>'._('Enabled'); + echo '<option selected VALUE=0>'._('Disabled'); + echo '<option VALUE=1>'._('Enabled'); } else { - echo '<option VALUE=0>'._('Disabled'); - echo '<option selected VALUE=1>'._('Enabled'); + echo '<option VALUE=0>'._('Disabled'); + echo '<option selected VALUE=1>'._('Enabled'); } echo "</select><a href='$rootpath/EDIMessageFormat.php?" . SID . "&MessageType=INVOIC&PartnerCode=" . $_SESSION['CustomerID'] . "'>"._('Create') . '/' . _('Edit Invoice Message Format').'</a></td></tr>'; echo '<tr><td>'._('Enable Receiving of EDI Orders').":</td> - <td><select TABINDEX=2 name='EDIOrders'>"; + <td><select tabindex=2 name='EDIOrders'>"; if ($myrow['ediorders']==0){ - echo '<option selected VALUE=0>'._('Disabled'); - echo '<option VALUE=1>'._('Enabled'); + echo '<option selected VALUE=0>'._('Disabled'); + echo '<option VALUE=1>'._('Enabled'); } else { - echo '<option VALUE=0>'._('Disabled'); - echo '<option selected VALUE=1>'._('Enabled'); + echo '<option VALUE=0>'._('Disabled'); + echo '<option selected VALUE=1>'._('Enabled'); } echo '</select></td></tr>'; echo '<tr><td>'._('Customer EDI Reference').":</td> <td><input " . (in_array('EDIReference',$Errors) ? 'class="inputerror"' : '' ) . - " TABINDEX=3 type='Text' name='EDIReference' size=20 maxlength=20 value='" . $myrow['edireference'] . "'></td></tr>"; + " tabindex=3 type='Text' name='EDIReference' size=20 maxlength=20 value='" . $myrow['edireference'] . "'></td></tr>"; echo '<tr><td>'._('EDI Communication Method').":</td> - <td><select TABINDEX=4 name='EDITransport'>"; + <td><select tabindex=4 name='EDITransport'>"; if ($myrow['editransport']=='email'){ - echo "<option selected VALUE='email'>"._('Email Attachments'); - echo "<option VALUE='ftp'>"._('File Transfer Protocol (FTP)'); + echo "<option selected value='email'>"._('Email Attachments'); + echo "<option value='ftp'>"._('File Transfer Protocol (FTP)'); } else { - echo "<option VALUE='email'>"._('Email Attachments'); - echo "<option selected VALUE='ftp'>"._('File Transfer Protocol (FTP)'); + echo "<option value='email'>"._('Email Attachments'); + echo "<option selected value='ftp'>"._('File Transfer Protocol (FTP)'); } echo '</select></td></tr>'; echo '<tr><td>'._('FTP Server or Email Address').":</td> <td><input " . (in_array('EDIAddress',$Errors) ? 'class="inputerror"' : '' ) . - " TABINDEX=5 type='Text' name='EDIAddress' size=42 maxlength=40 value='" . $myrow['ediaddress'] . "'></td></tr>"; + " tabindex=5 type='Text' name='EDIAddress' size=42 maxlength=40 value='" . $myrow['ediaddress'] . "'></td></tr>"; if ($myrow['editransport']=='ftp'){ - echo '<tr><td>'._('FTP Server User Name').":</td> - <td><input TABINDEX=6 type='Text' name='EDIServerUser' size=20 maxlength=20 value=" . $myrow['ediserveruser'] . "></td></tr>"; - echo '<tr><td>'._('FTP Server Password').":</td> - <td><input TABINDEX=7 type='Text' name='EDIServerPwd' size=20 maxlength=20 value='" . $myrow['ediserverpwd'] . "'></td></tr>"; + echo '<tr><td>'._('FTP Server User Name').":</td> + <td><input tabindex=6 type='Text' name='EDIServerUser' size=20 maxlength=20 value=" . $myrow['ediserveruser'] . "></td></tr>"; + echo '<tr><td>'._('FTP Server Password').":</td> + <td><input tabindex=7 type='Text' name='EDIServerPwd' size=20 maxlength=20 value='" . $myrow['ediserverpwd'] . "'></td></tr>"; } -echo "</table><div class='centre'><input TABINDEX=8 type='Submit' name='submit' value='"._('Update EDI Configuration')."'></div></form>"; +echo "</table><br><div class='centre'><input tabindex=8 type='Submit' name='submit' value='"._('Update EDI Configuration')."'></div></form>"; include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-07-04 22:02:28 UTC (rev 3562) +++ trunk/doc/Change.log.html 2010-07-04 22:02:46 UTC (rev 3563) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>04/07/10 Tim: CustEDISetup.php - Corrections to sql statements</p> <p>04/07/10 Tim: Currencies.php - Corrections to sql statements and layout changes</p> <p>04/07/10 Tim: CreditStatus.php - Corrections to sql statements and layout changes</p> <p>04/07/10 Tim: Credit_Invoice.php - Minor bug fixes layout changes and corrections to sql statements</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-07-05 09:48:44
|
Revision: 3564 http://web-erp.svn.sourceforge.net/web-erp/?rev=3564&view=rev Author: tim_schofield Date: 2010-07-05 09:48:37 +0000 (Mon, 05 Jul 2010) Log Message: ----------- Margin must be decimal to allow margins like 2,5 or 3,3 time standard cost. Also ot has to be large enough to accept "currency margins". If you have a standard costs in EUR and want to check prices in IDR or viceversa, youll need to compute large margins. Modified Paths: -------------- trunk/PricesByCost.php trunk/doc/Change.log.html Modified: trunk/PricesByCost.php =================================================================== --- trunk/PricesByCost.php 2010-07-04 22:02:46 UTC (rev 3563) +++ trunk/PricesByCost.php 2010-07-05 09:48:37 UTC (rev 3564) @@ -1,5 +1,5 @@ <?php -/* $Id$ */ +/* $Id: PricesByCost.php 3475 2010-05-29 00:00:42Z daintree $ */ // PricesByCost.php - $PageSecurity = 11; include ('includes/session.inc'); @@ -23,7 +23,7 @@ $Category =''; }/*end of else StockCat */ - $sql = 'SELECT stockmaster.stockid, + $sql = "SELECT stockmaster.stockid, stockmaster.description, prices.debtorno, prices.branchcode, @@ -32,17 +32,17 @@ prices.startdate, prices.enddate FROM stockmaster, prices - WHERE stockmaster.stockid=prices.stockid' . $Category . ' - AND prices.price' . $Comparator . '(stockmaster.materialcost + stockmaster.labourcost + stockmaster.overheadcost) * ' . $_POST['Margin'] . " + WHERE stockmaster.stockid=prices.stockid" . $Category . " + AND prices.price" . $Comparator . "(stockmaster.materialcost + stockmaster.labourcost + stockmaster.overheadcost) * '" . $_POST['Margin'] . "' AND prices.typeabbrev ='" . $_POST['SalesType'] . "' AND prices.currabrev ='" . $_POST['CurrCode'] . "' AND (prices.enddate>='" . Date('Y-m-d') . "' OR prices.enddate='0000-00-00')"; $result = DB_query($sql, $db); $numrow = DB_num_rows($result); - +echo $sql; if ($_POST['submit'] == 'Update') { //Update Prices - $PriceCounter =0; + $PriceCounter =0; while ($myrow = DB_fetch_array($result)) { //update database if update pressed $SQLUpdate = "UPDATE prices @@ -61,29 +61,29 @@ $result = DB_query($sql, $db); //re-run the query with the updated prices $numrow = DB_num_rows($result); // get the new number - should be the same!! } - + $sqlcat = "SELECT categorydescription FROM stockcategory WHERE categoryid='" . $_POST['StockCat'] . "'"; $ResultCat = DB_query($sqlcat, $db); $CategoryRow = DB_fetch_array($ResultCat); - + $sqltype = "SELECT sales_type FROM salestypes WHERE typeabbrev='" . $_POST['SalesType'] . "'"; $ResultType = DB_query($sqltype, $db); $SalesTypeRow = DB_fetch_array($ResultType); - + if (isset($CategoryRow['categorgdescription'])) { $CategoryText = _('the') . ' ' . $CategoryRow['categorgdescription'] . ' ' . _('category'); } else { $CategoryText = _('all Categories'); } /*end of else Category */ - + echo '<div class="page_help_text">' . _('Items in') . ' ' . $CategoryText . ' ' . _('With Prices') . ' ' . $Comparator . '' . $_POST['Margin'] . ' ' . _('times') . ' ' . _('Cost in Price List') . ' ' . $SalesTypeRow['sales_type'] . '</div><br><br>'; - - if ($numrow > 0) { //the number of prices returned from the main prices query is - echo '<table>'; + + if ($numrow > 0) { //the number of prices returned from the main prices query is + echo '<table class=selection>'; echo '<tr><th>' . _('Code') . '</th> <th>' . _('Description') . '</th> <th>' . _('Customer') . '</th> @@ -102,10 +102,10 @@ <input type="hidden" value=' . $_POST['CurrCode'] . ' name="CurrCode"> <input type="hidden" value=' . $_POST['Comparator'] . ' name="Comparator"> <input type="hidden" value=' . $_POST['SalesType'] . ' name="SalesType">'; - + $PriceCounter =0; while ($myrow = DB_fetch_array($result)) { - + if ($k == 1) { echo '<tr class="EvenTableRows">'; $k = 0; @@ -119,7 +119,7 @@ } else { $Cost = $myrow['cost']; } /*end of else Cost */ - + //variables for update echo '<input type="hidden" value=' . $myrow['stockid'] . ' name="StockID_' . $PriceCounter .'"> <input type="hidden" value=' . $myrow['debtorno'] . ' name="DebtorNo_' . $PriceCounter .'"> @@ -162,8 +162,8 @@ } } else { /*The option to submit was not hit so display form */ echo '<div class="page_help_text">' . _('Use this report to display price list with the cost.') . '</div><br>'; - echo '</br></br><form action="' . $_SERVER['PHP_SELF'] . '" method="post"><table>'; - + echo '</br></br><form action="' . $_SERVER['PHP_SELF'] . '" method="post"><table class=selection>'; + $SQL = 'SELECT categoryid, categorydescription FROM stockcategory ORDER BY categorydescription'; @@ -189,7 +189,7 @@ $_POST['Margin']=1; } echo '<td> - <input type="text" class="number" name="Margin" MAXLENGTH =2 size=2 value=' .$_POST['Margin'] . '></td></tr>'; + <input type="text" class="number" name="Margin" MAXLENGTH =8 size=8 value=' .$_POST['Margin'] . '></td></tr>'; $result = DB_query('SELECT typeabbrev, sales_type FROM salestypes ', $db); echo '<tr><td>' . _('Sales Type') . '/' . _('Price List') . ":</td> <td><select name='SalesType'>"; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-07-04 22:02:46 UTC (rev 3563) +++ trunk/doc/Change.log.html 2010-07-05 09:48:37 UTC (rev 3564) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>05/07/10 Pak Ricard: PricesByCost.php - Margin must be decimal to allow margins like 2,5 or 3,3 time standard cost. Also ot has to be large enough to accept "currency margins". If you have a standard costs in EUR and want to check prices in IDR or viceversa, you'll need to compute large margins.</p> <p>04/07/10 Tim: CustEDISetup.php - Corrections to sql statements</p> <p>04/07/10 Tim: Currencies.php - Corrections to sql statements and layout changes</p> <p>04/07/10 Tim: CreditStatus.php - Corrections to sql statements and layout changes</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-07-05 09:49:09
|
Revision: 3565 http://web-erp.svn.sourceforge.net/web-erp/?rev=3565&view=rev Author: tim_schofield Date: 2010-07-05 09:49:03 +0000 (Mon, 05 Jul 2010) Log Message: ----------- Error in table name Modified Paths: -------------- trunk/doc/Change.log.html trunk/sql/mysql/upgrade3.11.1-3.12.sql Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-07-05 09:48:37 UTC (rev 3564) +++ trunk/doc/Change.log.html 2010-07-05 09:49:03 UTC (rev 3565) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>05/07/10 Pak Ricard: upgrade3.11.1-3.12.sql - Error in table name <p>05/07/10 Pak Ricard: PricesByCost.php - Margin must be decimal to allow margins like 2,5 or 3,3 time standard cost. Also ot has to be large enough to accept "currency margins". If you have a standard costs in EUR and want to check prices in IDR or viceversa, you'll need to compute large margins.</p> <p>04/07/10 Tim: CustEDISetup.php - Corrections to sql statements</p> <p>04/07/10 Tim: Currencies.php - Corrections to sql statements and layout changes</p> Modified: trunk/sql/mysql/upgrade3.11.1-3.12.sql =================================================================== --- trunk/sql/mysql/upgrade3.11.1-3.12.sql 2010-07-05 09:48:37 UTC (rev 3564) +++ trunk/sql/mysql/upgrade3.11.1-3.12.sql 2010-07-05 09:49:03 UTC (rev 3565) @@ -278,4 +278,4 @@ INSERT INTO `suppliertype` VALUES(1, 'Default'); ALTER TABLE `suppliers` ADD COLUMN `supptype` tinyint(4) NOT NULL DEFAULT 1 AFTER `address6`; -ALTER TABLE `locatransfers` CHANGE COLUMN `shipqty` `shipqty` double NOT NULL DEFAULT 0.0; \ No newline at end of file +ALTER TABLE `loctransfers` CHANGE COLUMN `shipqty` `shipqty` double NOT NULL DEFAULT 0.0; \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-07-05 22:10:57
|
Revision: 3568 http://web-erp.svn.sourceforge.net/web-erp/?rev=3568&view=rev Author: tim_schofield Date: 2010-07-05 21:27:03 +0000 (Mon, 05 Jul 2010) Log Message: ----------- Corrections to sql statements and layout changes Modified Paths: -------------- trunk/CustomerAllocations.php trunk/doc/Change.log.html Modified: trunk/CustomerAllocations.php =================================================================== --- trunk/CustomerAllocations.php 2010-07-05 21:26:42 UTC (rev 3567) +++ trunk/CustomerAllocations.php 2010-07-05 21:27:03 UTC (rev 3568) @@ -24,7 +24,7 @@ if (isset($_POST['UpdateDatabase']) OR isset($_POST['RefreshAllocTotal'])) { - if (!isset($_SESSION['Alloc'])){ + if (!isset($_SESSION['Alloc'])) { prnMsg(_('Allocations can not be processed again') . '. ' . _('If you hit refresh on this page after having just processed an allocation') . ', ' . _('try to use the navigation links provided rather than the back button') . ', ' . @@ -37,26 +37,21 @@ $TotalAllocated = 0; $TotalDiffOnExch = 0; - for ($AllocCounter=0;$AllocCounter < $_POST['TotalNumberOfAllocs']; $AllocCounter++) + for ($AllocCounter=0;$AllocCounter < $_POST['TotalNumberOfAllocs']; $AllocCounter++) { // loop through amounts allocated using AllocnItm->ID for each record - { - if (isset($_POST['Amt' . $AllocCounter])) // allocatable charge amounts - { - if (!is_numeric($_POST['Amt' . $AllocCounter])) - { + if (isset($_POST['Amt' . $AllocCounter])) { + // allocatable charge amounts + if (!is_numeric($_POST['Amt' . $AllocCounter])) { $_POST['Amt' . $AllocCounter] = 0; } - if ($_POST['Amt' . $AllocCounter] < 0) - { + if ($_POST['Amt' . $AllocCounter] < 0) { prnMsg(_('Amount entered was negative') . '. ' . _('Only positive amounts are allowed') . '.','warn'); $_POST['Amt' . $AllocCounter] = 0; } - if (isset($_POST['All' . $AllocCounter]) and $_POST['All' . $AllocCounter] == True) - { + if (isset($_POST['All' . $AllocCounter]) and $_POST['All' . $AllocCounter] == True) { $_POST['Amt' . $AllocCounter] = $_POST['YetToAlloc' . $AllocCounter]; } - if ($_POST['Amt' . $AllocCounter] > $_POST['YetToAlloc' . $AllocCounter]) - { + if ($_POST['Amt' . $AllocCounter] > $_POST['YetToAlloc' . $AllocCounter]) { $_POST['Amt' . $AllocCounter]=$_POST['YetToAlloc' . $AllocCounter]; // Amount entered must be smaller than unallocated amount } @@ -73,53 +68,48 @@ } - if ($TotalAllocated + $_SESSION['Alloc']->TransAmt > 0.008) - { - prnMsg(_('Allocation could not be processed because the amount allocated is more than the').' ' . - $_SESSION['Alloc']->TransTypeName . ' '._('being allocated') . '<br>' . _('Total allocated').' = ' . - $TotalAllocated . ' '._('and the total amount of the') .' ' . $_SESSION['Alloc']->TransTypeName . ' '. - _('was').' ' . -$_SESSION['Alloc']->TransAmt,'error'); - $InputError=1; + if ($TotalAllocated + $_SESSION['Alloc']->TransAmt > 0.008) { + prnMsg(_('Allocation could not be processed because the amount allocated is more than the').' ' . + $_SESSION['Alloc']->TransTypeName . ' '._('being allocated') . '<br>' . _('Total allocated').' = ' . + $TotalAllocated . ' '._('and the total amount of the') .' ' . $_SESSION['Alloc']->TransTypeName . ' '. + _('was').' ' . -$_SESSION['Alloc']->TransAmt,'error'); + $InputError=1; } } if (isset($_POST['UpdateDatabase'])) { - if ($InputError==0) - { + if ($InputError==0) { // //========[ START TRANSACTION ]=========== // - $error = ''; + $error = ''; $Result=DB_Txn_Begin($db); $AllAllocations = 0; - foreach ($_SESSION['Alloc']->Allocs as $AllocnItem) - { - if ($AllocnItem->PrevAllocRecordID != 'NA') - // original allocation has changed so delete the old allocation record - { + foreach ($_SESSION['Alloc']->Allocs as $AllocnItem) { + if ($AllocnItem->PrevAllocRecordID != 'NA') { + // original allocation has changed so delete the old allocation record $SQL = 'DELETE FROM custallocns WHERE id = ' . $AllocnItem->PrevAllocRecordID; - if( !$Result = DB_query($SQL,$db) ) - { + if( !$Result = DB_query($SQL,$db) ) { $error = 'Could not delete old allocation record'; } } // if ($AllocnItem->OrigAlloc != $AllocnItem->AllocAmt) // has previous allocated amount changed? // { - if ($AllocnItem->AllocAmt > 0) - { + if ($AllocnItem->AllocAmt > 0) { $SQL = "INSERT INTO - custallocns ( - datealloc, - amt, - transid_allocfrom, - transid_allocto - ) VALUES ('" . date('Y-m-d') . "', - " . $AllocnItem->AllocAmt . ', - ' . $_SESSION['Alloc']->AllocTrans . ', - ' . $AllocnItem->ID . ')'; - if( !$Result = DB_query($SQL,$db) ) - { + custallocns ( + datealloc, + amt, + transid_allocfrom, + transid_allocto + ) VALUES ( + '" . date('Y-m-d') . "', + '" . $AllocnItem->AllocAmt . "', + '" . $_SESSION['Alloc']->AllocTrans . "', + '" . $AllocnItem->ID . "' + )"; + if( !$Result = DB_query($SQL,$db) ) { $error = 'Could not change allocation record'; } } @@ -127,13 +117,12 @@ $AllAllocations = $AllAllocations + $AllocnItem->AllocAmt; $Settled = (abs($NewAllocTotal-$AllocnItem->TransAmount) < 0.005) ? 1 : 0; - $SQL = 'UPDATE debtortrans - SET diffonexch=' . $AllocnItem->DiffOnExch . ', - alloc = ' . $NewAllocTotal . ', - settled = ' . $Settled . ' - WHERE id = ' . $AllocnItem->ID; - if( !$Result = DB_query($SQL,$db) ) - { + $SQL = "UPDATE debtortrans + SET diffonexch='" . $AllocnItem->DiffOnExch . "', + alloc = '" . $NewAllocTotal . "', + settled = '" . $Settled . "' + WHERE id = '" . $AllocnItem->ID."'"; + if( !$Result = DB_query($SQL,$db) ) { $error = 'Could not update difference on exchange'; } // } @@ -141,64 +130,63 @@ $Settled = (abs($TotalAllocated + $_SESSION['Alloc']->TransAmt) < 0.01) ? 1 : 0; // Update the receipt or credit note - $SQL = 'UPDATE debtortrans - SET alloc = ' . -$AllAllocations . ', - diffonexch = ' . -$TotalDiffOnExch . ', - settled=' . $Settled . ' - WHERE id = ' . $_POST['AllocTrans']; + $SQL = "UPDATE debtortrans + SET alloc = '" . -$AllAllocations . "', + diffonexch = '" . -$TotalDiffOnExch . "', + settled='" . $Settled . "' + WHERE id = '" . $_POST['AllocTrans']."'"; - if( !$Result = DB_query($SQL,$db) ) - { + if( !$Result = DB_query($SQL,$db) ) { $error = 'Could not update receipt or credit note'; } // If GLLink to debtors active post diff on exchange to GL $MovtInDiffOnExch = -$_SESSION['Alloc']->PrevDiffOnExch - $TotalDiffOnExch; - if ($MovtInDiffOnExch !=0) - { - if ($_SESSION['CompanyRecord']['gllink_debtors'] == 1) - { + if ($MovtInDiffOnExch !=0) { + if ($_SESSION['CompanyRecord']['gllink_debtors'] == 1) { $PeriodNo = GetPeriod($_SESSION['Alloc']->TransDate, $db); $_SESSION['Alloc']->TransDate = FormatDateForSQL($_SESSION['Alloc']->TransDate); - $SQL = 'INSERT INTO gltrans ( - type, - typeno, - trandate, - periodno, - account, - narrative, - amount - ) VALUES ( - ' . $_SESSION['Alloc']->TransType . ', - ' . $_SESSION['Alloc']->TransNo . ", - '" . $_SESSION['Alloc']->TransDate . "', - " . $PeriodNo . ', - ' . $_SESSION['CompanyRecord']['exchangediffact'] . ", - '', " . $MovtInDiffOnExch . ')'; - if( !$Result = DB_query($SQL,$db) ) - { + $SQL = "INSERT INTO gltrans ( + type, + typeno, + trandate, + periodno, + account, + narrative, + amount + ) VALUES ( + '" . $_SESSION['Alloc']->TransType . "', + '" . $_SESSION['Alloc']->TransNo . "', + '" . $_SESSION['Alloc']->TransDate . "', + '" . $PeriodNo . "', + '" . $_SESSION['CompanyRecord']['exchangediffact'] . "', + '', + '" . $MovtInDiffOnExch . "' + )"; + if( !$Result = DB_query($SQL,$db) ) { $error = 'Could not update exchange difference in General Ledger'; } - $SQL = 'INSERT INTO gltrans ( - type, - typeno, - trandate, - periodno, - account, - narrative, - amount - ) VALUES ( - ' . $_SESSION['Alloc']->TransType . ', - ' . $_SESSION['Alloc']->TransNo . ", - '" . $_SESSION['Alloc']->TransDate . "', - " . $PeriodNo . ', - ' . $_SESSION['CompanyRecord']['debtorsact'] . ", - '', " . -$MovtInDiffOnExch . ')'; - if( !$Result = DB_query($SQL,$db) ) - { + $SQL = "INSERT INTO gltrans ( + type, + typeno, + trandate, + periodno, + account, + narrative, + amount + ) VALUES ( + '" . $_SESSION['Alloc']->TransType . "', + '" . $_SESSION['Alloc']->TransNo . "', + '" . $_SESSION['Alloc']->TransDate . "', + '" . $PeriodNo . "', + '" . $_SESSION['CompanyRecord']['debtorsact'] . "', + '', + '" . -$MovtInDiffOnExch . "' + )"; + if( !$Result = DB_query($SQL,$db) ) { $error = 'Could not update debtors control in General Ledger'; } } @@ -208,8 +196,7 @@ // //========[ COMMIT TRANSACTION ]=========== // - if ( empty($error) ) - { + if ( empty($error) ) { $Result = DB_Txn_Commit($db); } else { $Result = DB_Txn_Rollback($db); @@ -221,8 +208,7 @@ } if (isset($_GET['AllocTrans'])) { - if (isset($_SESSION['Alloc'])) - { + if (isset($_SESSION['Alloc'])) { unset($_SESSION['Alloc']->Allocs); unset($_SESSION['Alloc']); } @@ -246,7 +232,7 @@ WHERE debtortrans.type = systypes.typeid AND debtortrans.debtorno = debtorsmaster.debtorno AND - debtortrans.id=" . $_POST['AllocTrans']; + debtortrans.id='" . $_POST['AllocTrans'] . "'"; $Result = DB_query($SQL,$db); $myrow = DB_fetch_array($Result); DB_free_result($Result); @@ -278,8 +264,7 @@ ORDER BY debtortrans.trandate"; $Result = DB_query($SQL,$db); - while ($myrow=DB_fetch_array($Result)) - { + while ($myrow=DB_fetch_array($Result)) { $_SESSION['Alloc']->add_to_AllocsAllocn ( $myrow['id'], $myrow['typename'], @@ -312,13 +297,12 @@ custallocns WHERE debtortrans.type = systypes.typeid AND debtortrans.id=custallocns.transid_allocto AND - custallocns.transid_allocfrom=" . $_POST['AllocTrans'] . " AND + custallocns.transid_allocfrom='" . $_POST['AllocTrans'] . "' AND debtorno='" . $_SESSION['Alloc']->DebtorNo . "' ORDER BY debtortrans.trandate"; $Result=DB_query($SQL,$db); - while ($myrow=DB_fetch_array($Result)) - { + while ($myrow=DB_fetch_array($Result)) { $DiffOnExchThisOne = ($myrow['amt']/$myrow['rate']) - ($myrow['amt']/$_SESSION['Alloc']->TransExRate); $_SESSION['Alloc']->add_to_AllocsAllocn ( $myrow['id'], @@ -341,34 +325,33 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Allocate Receipt') . '" alt="">' . ' ' . _('Allocate Receipts') . '</p>'; $TableHeader = "<tr> - <th>" . _('Trans Type') . "</th> - <th>" . _('Customer') . "</th> - <th>" . _('Cust No') . "</th> - <th>" . _('Number') . "</th> - <th> " . _('Date') . "</th> - <th>" . _('Total') . "</th> - <th>" . _('To Alloc') . "</th> - <th>" . _('Action') . "</th> - </tr>"; + <th>" . _('Trans Type') . "</th> + <th>" . _('Customer') . "</th> + <th>" . _('Cust No') . "</th> + <th>" . _('Number') . "</th> + <th>" . _('Date') . "</th> + <th>" . _('Total') . "</th> + <th>" . _('To Alloc') . "</th> + <th>" . _('Action') . "</th> + </tr>"; - if (isset($_POST['AllocTrans'])) // Page called with trans number - { + if (isset($_POST['AllocTrans'])) { + // Page called with trans number echo "<form action='" . $_SERVER['PHP_SELF'] . '?' . SID . "' method=post>"; echo "<input type=hidden name='AllocTrans' value=" . $_POST['AllocTrans'] . '>'; // Show trans already allocated and potential new allocations - echo '<div class="centre"><font color=blue><b>' . $_SESSION['Alloc']->DebtorNo . ' - ' . $_SESSION['Alloc']->CustomerName . '</b></div>'; - if ($_SESSION['Alloc']->TransExRate != 1) - { + echo '<p><table class=selection>'; + echo '<tr><th colspan=7><div class="centre"><font color=blue><b>' . $_SESSION['Alloc']->DebtorNo . ' - ' . $_SESSION['Alloc']->CustomerName . '</b></div>'; + + if ($_SESSION['Alloc']->TransExRate != 1) { echo '<br>'._('Amount in customer currency').' <b>' . number_format(-$_SESSION['Alloc']->TransAmt,2) . '</b><i> ('._('converted into local currency at an exchange rate of'). ' ' . $_SESSION['Alloc']->TransExRate . ')</i>'; } - - echo '<p><table border=1>'; - echo "<tr> + echo "</th></tr><tr> <th>" . _('Trans') . '<br>' . _('Type') . "</th> <th>" . _('Trans') . '<br>' . _('Number') . "</th> <th>" . _('Trans') . '<br>' . _('Date') . "</th> @@ -379,25 +362,21 @@ </tr>"; $Counter = 0; - $TotalAllocated = 0; - $balance = 0; + $TotalAllocated = 0; + $balance = 0; $j=0; - foreach ($_SESSION['Alloc']->Allocs as $AllocnItem) - { + foreach ($_SESSION['Alloc']->Allocs as $AllocnItem) { $YetToAlloc = ($AllocnItem->TransAmount - $AllocnItem->PrevAlloc); - if ( $AllocnItem->ID == $_POST['AllocTrans'] ) - { - echo '<tr class="OddTableRows">'; - $curTrans = _('Being allocated'); - $remaining = -$YetToAlloc; - } - elseif ($AllocnItem->AllocAmt > 0) - { - echo '<tr class="OddTableRows">'; + if ( $AllocnItem->ID == $_POST['AllocTrans'] ) { + echo '<tr class="OddTableRows">'; + $curTrans = _('Being allocated'); + $remaining = -$YetToAlloc; + } else if ($AllocnItem->AllocAmt > 0) { + echo '<tr class="OddTableRows">'; } else { - echo '<tr class="EvenTableRows">'; - $curTrans = " "; + echo '<tr class="EvenTableRows">'; + $curTrans = " "; } echo "<td>" . $AllocnItem->TransType . "</td> @@ -407,16 +386,14 @@ <td class=number>" . number_format($YetToAlloc,2) . "</td>"; $j++; - if ($AllocnItem->TransAmount < 0) - { + if ($AllocnItem->TransAmount < 0) { $balance+=$YetToAlloc; echo "<td>" . $curTrans ."</td><td class=number>" . number_format($balance,2) . "</td></tr>"; } else { echo "<input type=hidden name='YetToAlloc" . $Counter . "' value=" . round($YetToAlloc,2) . '></td>'; echo "<td class=number><input tabindex=".$j." type='checkbox' name='All" . $Counter . "'"; - if (ABS($AllocnItem->AllocAmt-$YetToAlloc) < 0.01) - { + if (ABS($AllocnItem->AllocAmt-$YetToAlloc) < 0.01) { echo ' value=' . True . '>'; } else { echo '>'; @@ -447,9 +424,8 @@ echo "<div class='centre'><input tabindex=".$j." type=submit name=UpdateDatabase value=" . _('Process Allocations') . ">"; echo "<input tabindex=".$j." type=submit name=Cancel value=" . _('Cancel') . "></div>"; - } - elseif (isset($_GET['DebtorNo'])) // Page called with customer code - { + } elseif (isset($_GET['DebtorNo'])) { + // Page called with customer code unset($_SESSION['Alloc']->Allocs); unset($_SESSION['Alloc']); @@ -474,19 +450,23 @@ ORDER BY debtortrans.id"; $result = DB_query($SQL,$db); - if (DB_num_rows($result)==0) - { + if (DB_num_rows($result)==0) { prnMsg(_('No outstanding receipts or credits to be allocated for this customer'),'info'); include('includes/footer.inc'); - exit; - } - echo '<table border=1>'; + exit; + } + echo '<table class=selection>'; echo $TableHeader; - - while ($myrow = DB_fetch_array($result)) - { - echo "<tr> - <td>" . $myrow['typename'] ."</td> + $k=0; + while ($myrow = DB_fetch_array($result)) { + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">';; + $k++; + } + echo "<td>" . $myrow['typename'] ."</td> <td>" . $myrow['name'] . "</td> <td>" . $myrow['debtorno'] . "</td> <td>" . $myrow['transno'] . "</td> @@ -497,9 +477,8 @@ } DB_free_result($result); echo '</table><p>'; - } - else // Page called with no parameters - { + } else { + /* Page called with no parameters */ unset($_SESSION['Alloc']->Allocs); unset($_SESSION['Alloc']); $curDebtor = ''; @@ -527,17 +506,15 @@ $result = DB_query($SQL,$db); $trans = DB_num_rows($result); $curTrans = 1; - echo '<table border=1>'; + echo '<table class=selection>'; echo $TableHeader; - while ($myrow = DB_fetch_array($result)) - { + $k=0; + while ($myrow = DB_fetch_array($result)) { $allocate = '<a href=' . $_SERVER['PHP_SELF']. '?' . SID . '&AllocTrans=' . $myrow['id'] . '>' . _('Allocate') . '</a>'; - if ( $curDebtor != $myrow['debtorno'] ) - { - if ( $curTrans > 1 ) - { + if ( $curDebtor != $myrow['debtorno'] ) { + if ( $curTrans > 1 ) { echo "<tr class='OddTableRows'><td colspan=7 class=number>" . number_format($balance,2) . "</td><td><b>Balance</b></td></tr>"; } @@ -551,22 +528,26 @@ ORDER BY ovamount"; $balResult = DB_query($balSQL,$db); - while ($balRow = DB_fetch_array($balResult)) - { + while ($balRow = DB_fetch_array($balResult)) { $balance += $balRow['total']; } DB_free_result($balResult); } $curTrans ++; - if ( isset($balance) and abs($balance) < -0.01 ) - { + if ( isset($balance) and abs($balance) < -0.01 ) { $allocate = ' '; } + if ($k==1) { + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">';; + $k++; + } - echo "<tr> - <td>" . $myrow['typename'] ."</td> + echo "<td>" . $myrow['typename'] ."</td> <td>" . $myrow['name'] . "</td> <td>" . $myrow['debtorno'] . "</td> <td>" . $myrow['transno'] . "</td> @@ -575,8 +556,7 @@ <td class=number>" . number_format($myrow['total']-$myrow['alloc'],2) . "</td>"; echo '<td>' . $allocate . '</td></tr>'; - if ( $curTrans > $trans ) - { + if ( $curTrans > $trans ) { if (!isset($balance)) { $balance=0; } @@ -586,8 +566,7 @@ DB_free_result($result); echo '</table><p>'; - if ($trans == 0) - { + if ($trans == 0) { prnMsg(_('There are no allocations to be done'),'info'); } } @@ -595,4 +574,4 @@ echo '</td></tr></table>'; // end Page Border include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-07-05 21:26:42 UTC (rev 3567) +++ trunk/doc/Change.log.html 2010-07-05 21:27:03 UTC (rev 3568) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>05/07/10 Tim: CustomerAllocations.php - Corrections to sql statements and layout changes</p> <p>05/07/10 Tim: CustLoginSetup.php - Minor bug fixes, corrections to sql statements</p> <p>05/07/10 Pak Ricard: upgrade3.11.1-3.12.sql - Error in table name <p>05/07/10 Pak Ricard: PricesByCost.php - Margin must be decimal to allow margins like 2,5 or 3,3 time standard cost. Also ot has to be large enough to accept "currency margins". If you have a standard costs in EUR and want to check prices in IDR or viceversa, you'll need to compute large margins.</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-07-05 22:11:15
|
Revision: 3570 http://web-erp.svn.sourceforge.net/web-erp/?rev=3570&view=rev Author: tim_schofield Date: 2010-07-05 21:27:43 +0000 (Mon, 05 Jul 2010) Log Message: ----------- Layout changes Modified Paths: -------------- trunk/CustomerInquiry.php trunk/doc/Change.log.html Modified: trunk/CustomerInquiry.php =================================================================== --- trunk/CustomerInquiry.php 2010-07-05 21:27:25 UTC (rev 3569) +++ trunk/CustomerInquiry.php 2010-07-05 21:27:43 UTC (rev 3570) @@ -26,8 +26,8 @@ } if (!isset($_POST['TransAfterDate'])) { - $sql = 'SELECT confvalue - FROM `config` + $sql = 'SELECT confvalue + FROM `config` WHERE confname ="NumberOfMonthMustBeShown"'; $ErrMsg=_('The config value NumberOfMonthMustBeShown cannot be retrieved'); $result = DB_query($sql,$db,$ErrMsg); @@ -121,22 +121,22 @@ $CustomerRecord['overdue2']=0; } - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . - _('Customer') . '" alt="">' . ' ' . _('Customer') . ' : ' . $CustomerRecord['name'] . ' - (' . _('All amounts stated in') . - ' ' . $CustomerRecord['currency'] . ')<br><br>' . _('Terms') . ' : ' . $CustomerRecord['terms'] . '<br>' . _('Credit Limit') . + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . + _('Customer') . '" alt="">' . ' ' . _('Customer') . ' : ' . $CustomerRecord['name'] . ' - (' . _('All amounts stated in') . + ' ' . $CustomerRecord['currency'] . ')<br><br>' . _('Terms') . ' : ' . $CustomerRecord['terms'] . '<br>' . _('Credit Limit') . ': ' . number_format($CustomerRecord['creditlimit'],0) . ' ' . _('Credit Status') . ': ' . $CustomerRecord['reasondescription'] . ''; if ($CustomerRecord['dissallowinvoices']!=0){ echo '<br><font color=RED size=4><b>' . _('ACCOUNT ON HOLD') . '</font></b><br>'; } -echo "<table class=table2 BORDER=1> +echo "<table class=selection width=70%> <tr> - <th>" . _('Total Balance') . "</th> - <th>" . _('Current') . "</th> - <th>" . _('Now Due') . "</th> - <th>" . $_SESSION['PastDueDays1'] . "-" . $_SESSION['PastDueDays2'] . ' ' . _('Days Overdue') . "</th> - <th>" . _('Over') . ' ' . $_SESSION['PastDueDays2'] . ' ' . _('Days Overdue') . '</th></tr>'; + <th width=20%>" . _('Total Balance') . "</th> + <th width=20%>" . _('Current') . "</th> + <th width=20%>" . _('Now Due') . "</th> + <th width=20%>" . $_SESSION['PastDueDays1'] . "-" . $_SESSION['PastDueDays2'] . ' ' . _('Days Overdue') . "</th> + <th width=20%>" . _('Over') . ' ' . $_SESSION['PastDueDays2'] . ' ' . _('Days Overdue') . '</th></tr>'; echo '<tr><td class=number>' . number_format($CustomerRecord['balance'],2) . '</td> <td class=number>' . number_format(($CustomerRecord['balance'] - $CustomerRecord['due']),2) . '</td> @@ -182,9 +182,9 @@ } /*show a table of the invoices returned by the SQL */ -echo '<table class="table2" cellpadding="2" colspan="7">'; +echo '<table class="selection" cellpadding="2" colspan="7">'; -$tableheader = "<tr BGCOLOR =#800000> +$tableheader = "<tr bgcolor =#800000> <th>" . _('Type') . "</th> <th>" . _('Number') . "</th> <th>" . _('Date') . "</th> Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-07-05 21:27:25 UTC (rev 3569) +++ trunk/doc/Change.log.html 2010-07-05 21:27:43 UTC (rev 3570) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>05/07/10 Tim: CustomerInquiries.php - Layout changes</p> <p>05/07/10 Tim: CustomerAllocations.php - Corrections to sql statements and layout changes</p> <p>05/07/10 Tim: CustomerAllocations.php - Corrections to sql statements and layout changes</p> <p>05/07/10 Tim: CustLoginSetup.php - Minor bug fixes, corrections to sql statements</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-07-05 23:09:53
|
Revision: 3569 http://web-erp.svn.sourceforge.net/web-erp/?rev=3569&view=rev Author: tim_schofield Date: 2010-07-05 21:27:25 +0000 (Mon, 05 Jul 2010) Log Message: ----------- Corrections to sql statements and layout changes Modified Paths: -------------- trunk/CustomerBranches.php trunk/doc/Change.log.html Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2010-07-05 21:27:03 UTC (rev 3568) +++ trunk/CustomerBranches.php 2010-07-05 21:27:25 UTC (rev 3569) @@ -16,7 +16,9 @@ } if (!isset($DebtorNo)) { - prnMsg(_('This page must be called with the debtor code of the customer for whom you wish to edit the branches for').'. <br>'._('When the pages is called from within the system this will always be the case').' <br>'._('Select a customer first then select the link to add/edit/delete branches'),'warn'); + prnMsg(_('This page must be called with the debtor code of the customer for whom you wish to edit the branches for').'. + <br>'._('When the pages is called from within the system this will always be the case').' <br>'. + _('Select a customer first then select the link to add/edit/delete branches'),'warn'); include('includes/footer.inc'); exit; } @@ -154,23 +156,23 @@ specialinstructions = '" . $_POST['specialinstructions'] . "', phoneno='" . $_POST['PhoneNo'] . "', faxno='" . $_POST['FaxNo'] . "', - fwddate= " . $_POST['FwdDate'] . ", + fwddate= '" . $_POST['FwdDate'] . "', contactname='" . $_POST['ContactName'] . "', salesman= '" . $_POST['Salesman'] . "', area='" . $_POST['Area'] . "', - estdeliverydays =" . $_POST['EstDeliveryDays'] . ", + estdeliverydays ='" . $_POST['EstDeliveryDays'] . "', email='" . $_POST['Email'] . "', - taxgroupid=" . $_POST['TaxGroup'] . ", + taxgroupid='" . $_POST['TaxGroup'] . "', defaultlocation='" . $_POST['DefaultLocation'] . "', brpostaddr1 = '" . $_POST['BrPostAddr1'] . "', brpostaddr2 = '" . $_POST['BrPostAddr2'] . "', brpostaddr3 = '" . $_POST['BrPostAddr3'] . "', brpostaddr4 = '" . $_POST['BrPostAddr4'] . "', - disabletrans=" . $_POST['DisableTrans'] . ", - defaultshipvia=" . $_POST['DefaultShipVia'] . ", + disabletrans='" . $_POST['DisableTrans'] . "', + defaultshipvia='" . $_POST['DefaultShipVia'] . "', custbranchcode='" . $_POST['CustBranchCode'] ."', - deliverblind=" . $_POST['DeliverBlind'] . " - WHERE branchcode = '$SelectedBranch' AND debtorno='$DebtorNo'"; + deliverblind='" . $_POST['DeliverBlind'] . "' + WHERE branchcode = '".$SelectedBranch."' AND debtorno='".$DebtorNo."'"; $msg = $_POST['BrName'] . ' '._('branch has been updated.'); @@ -207,7 +209,7 @@ disabletrans, defaultshipvia, custbranchcode, - deliverblind) + deliverblind) VALUES ('" . $_POST['BranchCode'] . "', '" . $DebtorNo . "', '" . $_POST['BrName'] . "', @@ -220,24 +222,24 @@ '" . $latitude . "', '" . $longitude . "', '" . $_POST['specialinstructions'] . "', - " . $_POST['EstDeliveryDays'] . ", - " . $_POST['FwdDate'] . ", + '" . $_POST['EstDeliveryDays'] . "', + '" . $_POST['FwdDate'] . "', '" . $_POST['Salesman'] . "', '" . $_POST['PhoneNo'] . "', '" . $_POST['FaxNo'] . "', '" . $_POST['ContactName'] . "', '" . $_POST['Area'] . "', '" . $_POST['Email'] . "', - " . $_POST['TaxGroup'] . ", + '" . $_POST['TaxGroup'] . "', '" . $_POST['DefaultLocation'] . "', '" . $_POST['BrPostAddr1'] . "', '" . $_POST['BrPostAddr2'] . "', '" . $_POST['BrPostAddr3'] . "', '" . $_POST['BrPostAddr4'] . "', - " . $_POST['DisableTrans'] . ", - " . $_POST['DefaultShipVia'] . ", + '" . $_POST['DisableTrans'] . "', + '" . $_POST['DefaultShipVia'] . "', '" . $_POST['CustBranchCode'] ."', - " . $_POST['DeliverBlind'] . " + '" . $_POST['DeliverBlind'] . "' )"; } echo '<br>'; @@ -286,7 +288,7 @@ // PREVENT DELETES IF DEPENDENT RECORDS IN 'DebtorTrans' - $sql= "SELECT COUNT(*) FROM debtortrans WHERE debtortrans.branchcode='$SelectedBranch' AND debtorno = '$DebtorNo'"; + $sql= "SELECT COUNT(*) FROM debtortrans WHERE debtortrans.branchcode='".$SelectedBranch."' AND debtorno = '".$DebtorNo."'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { @@ -294,7 +296,7 @@ _('There are').' ' . $myrow[0] . ' '._('transactions with this Branch Code'),'error'); } else { - $sql= "SELECT COUNT(*) FROM salesanalysis WHERE salesanalysis.custbranch='$SelectedBranch' AND salesanalysis.cust = '$DebtorNo'"; + $sql= "SELECT COUNT(*) FROM salesanalysis WHERE salesanalysis.custbranch='".$SelectedBranch."' AND salesanalysis.cust = '".$DebtorNo."'"; $result = DB_query($sql,$db); @@ -305,7 +307,7 @@ } else { - $sql= "SELECT COUNT(*) FROM salesorders WHERE salesorders.branchcode='$SelectedBranch' AND salesorders.debtorno = '$DebtorNo'"; + $sql= "SELECT COUNT(*) FROM salesorders WHERE salesorders.branchcode='".$SelectedBranch."' AND salesorders.debtorno = '".$DebtorNo."'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); @@ -314,7 +316,7 @@ echo '<br>'._('There are').' ' . $myrow[0] . ' '._('sales orders for this Branch/customer'); } else { // Check if there are any users that refer to this branch code - $sql= "SELECT COUNT(*) FROM www_users WHERE www_users.branchcode='$SelectedBranch' AND www_users.customerid = '$DebtorNo'"; + $sql= "SELECT COUNT(*) FROM www_users WHERE www_users.branchcode='".$SelectedBranch."' AND www_users.customerid = '".$DebtorNo."'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); @@ -361,15 +363,16 @@ AND custbranch.area=areas.areacode AND custbranch.salesman=salesman.salesmancode AND custbranch.taxgroupid=taxgroups.taxgroupid - AND custbranch.debtorno = '$DebtorNo'"; + AND custbranch.debtorno = '".$DebtorNo."'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); $TotalEnable = 0; $TotalDisable = 0; if ($myrow) { - echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="">' . ' ' . _('Branches defined for'). ' '. $DebtorNo . ' - ' . $myrow[0] . '</p>'; - echo '<table border=1>'; + echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . + '" alt="">' . ' ' . _('Branches defined for'). ' '. $DebtorNo . ' - ' . $myrow[0] . '</p>'; + echo '<table class=selection>'; echo "<tr><th>"._('Code')."</th> <th>"._('Name')."</th> <th>"._('Branch Contact')."</th> @@ -380,20 +383,30 @@ <th>"._('Email')."</th> <th>"._('Tax Group')."</th> <th>"._('Enabled?')."</th></tr>"; + $k=0; + do { + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k=1; + } - do { - printf("<tr><td><font size=2>%s</td> - <td><font size=2>%s</td> - <td><font size=2>%s</font></td> - <td><font size=2>%s</font></td> - <td><font size=2>%s</font></td> - <td><font size=2>%s</font></td> - <td><font size=2>%s</font></td> - <td><font size=2><a href='Mailto:%s'>%s</a></font></td> - <td><font size=2>%s</font></td> - <td><font size=2>%s</font></td> - <td><font size=2><a href='%s?DebtorNo=%s&SelectedBranch=%s'>%s</font></td> - <td><font size=2><a href='%s?DebtorNo=%s&SelectedBranch=%s&delete=yes' onclick=\"return confirm('" . _('Are you sure you wish to delete this branch?') . "');\">%s</font></td></tr>", + + printf("<td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td><a href='Mailto:%s'>%s</a></td> + <td>%s</td> + <td>%s</td> + <td><a href='%s?DebtorNo=%s&SelectedBranch=%s'>%s</td> + <td><a href='%s?DebtorNo=%s&SelectedBranch=%s&delete=yes' onclick=\"return confirm('" . + _('Are you sure you wish to delete this branch?') . "');\">%s</td></tr>", $myrow[10], $myrow[2], $myrow[5], @@ -418,10 +431,10 @@ } while ($myrow = DB_fetch_row($result)); //END WHILE LIST LOOP - echo '</table><div class="centre">'; + echo '</table><br><table class=selection><tr><td><div class="centre">'; echo '<b>'.$TotalEnable.'</b> ' . _('Branches are enabled.') . '<br>'; echo '<b>'.$TotalDisable.'</b> ' . _('Branches are disabled.') . '<br>'; - echo '<b>'.($TotalEnable+$TotalDisable). '</b> ' . _('Total Branches') . '<br></div>'; + echo '<b>'.($TotalEnable+$TotalDisable). '</b> ' . _('Total Branches') . '</div></td></tr></table>'; } else { $sql = "SELECT debtorsmaster.name, address1, @@ -431,11 +444,11 @@ address5, address6 FROM debtorsmaster - WHERE debtorno = '$DebtorNo'"; + WHERE debtorno = '".$DebtorNo."'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); - echo '<br><div class="page_help_text">'._('No Branches are defined for').' - '.$myrow[0]. '. ' . _('You must have a minimum of one branch for each Customer. Please add a branch now.') .'</div>'; + echo '<div class="page_help_text">'._('No Branches are defined for').' - '.$myrow[0]. '. ' . _('You must have a minimum of one branch for each Customer. Please add a branch now.') .'</div>'; $_POST['BranchCode'] = substr($DebtorNo,0,10); $_POST['BrName'] = $myrow[0]; $_POST['BrAddress1'] = $myrow[1]; @@ -446,17 +459,8 @@ $_POST['BrAddress6'] = $myrow[6]; unset($myrow); } - - } -//end of ifs and buts! - -if (isset($SelectedBranch)) { - echo '<div class="centre"><a href=' . $_SERVER['PHP_SELF'] . '?' . SID . 'DebtorNo=' . $DebtorNo. '>' . _('Show all branches defined for'). ' '. $DebtorNo . '</a></div>'; -} -echo '<br>'; - if (!isset($_GET['delete'])) { echo "<form method='post' action=" . $_SERVER['PHP_SELF'] .'?' . SID . '>'; @@ -471,7 +475,7 @@ braddress4, braddress5, braddress6, - specialinstructions, + specialinstructions, estdeliverydays, fwddate, salesman, @@ -491,8 +495,8 @@ custbranchcode, deliverblind FROM custbranch - WHERE branchcode='$SelectedBranch' - AND debtorno='$DebtorNo'"; + WHERE branchcode='".$SelectedBranch."' + AND debtorno='".$DebtorNo."'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); @@ -529,7 +533,15 @@ echo "<input type=hidden name='SelectedBranch' VALUE='" . $SelectedBranch . "'>"; echo "<input type=hidden name='BranchCode' VALUE='" . $_POST['BranchCode'] . "'>"; - echo "<div class='centre'><b>"._('Change Branch')."</b><br><table> <tr><td>"._('Branch Code').':</td><td>'; + + echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . + '" alt="">' . ' ' . _('Change Details for Branch'). ' '. $SelectedBranch . '</p>'; + if (isset($SelectedBranch)) { + echo '<div class="centre"><a href=' . $_SERVER['PHP_SELF'] . '?' . SID . 'DebtorNo=' . $DebtorNo. '>' . _('Show all branches defined for'). ' '. $DebtorNo . '</a></div>'; + } + echo "<br><table class=selection>"; + echo "<tr><th colspan=2><div class='centre'><b>"._('Change Branch')."</b></th></tr>"; + echo "<tr><td>"._('Branch Code').':</td><td>'; echo $_POST['BranchCode'] . '</td></tr>'; } else { //end of if $SelectedBranch only do the else when a new record is being entered @@ -563,8 +575,8 @@ $_POST['BranchCode']=''; } echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="">' . ' ' . _('Add a Branch').'</p>'; -echo '<table><tr><td>'._('Branch Code'). ':</td> - <td><input ' .(in_array('BranchCode',$Errors) ? 'class="inputerror"' : '' ) . + echo '<table class=selection><tr><td>'._('Branch Code'). ':</td> + <td><input ' .(in_array('BranchCode',$Errors) ? 'class="inputerror"' : '' ) . " tabindex=1 type='Text' name='BranchCode' size=12 maxlength=10 value=" . $_POST['BranchCode'] . '></td></tr>'; $_POST['DeliverBlind'] = $_SESSION['DefaultBlindPackNote']; } @@ -779,10 +791,10 @@ if (!isset($_POST['CustBranchCode'])) {$_POST['CustBranchCode']='';} echo '<td><input tabindex=27 type="Text" name="CustBranchCode" size=31 maxlength=30 value="'. $_POST['CustBranchCode'].'"></td></tr>'; echo '</table>'; - echo '<div class="centre"><input tabindex=28 type="Submit" name="submit" value="' . _('Enter Branch') . '"></div>'; + echo '<br><div class="centre"><input tabindex=28 type="Submit" name="submit" value="' . _('Enter Branch') . '"></div>'; echo '</form>'; } //end if record deleted no point displaying form to add record include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-07-05 21:27:03 UTC (rev 3568) +++ trunk/doc/Change.log.html 2010-07-05 21:27:25 UTC (rev 3569) @@ -1,6 +1,7 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> <p>05/07/10 Tim: CustomerAllocations.php - Corrections to sql statements and layout changes</p> +<p>05/07/10 Tim: CustomerAllocations.php - Corrections to sql statements and layout changes</p> <p>05/07/10 Tim: CustLoginSetup.php - Minor bug fixes, corrections to sql statements</p> <p>05/07/10 Pak Ricard: upgrade3.11.1-3.12.sql - Error in table name <p>05/07/10 Pak Ricard: PricesByCost.php - Margin must be decimal to allow margins like 2,5 or 3,3 time standard cost. Also ot has to be large enough to accept "currency margins". If you have a standard costs in EUR and want to check prices in IDR or viceversa, you'll need to compute large margins.</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-07-05 23:10:10
|
Revision: 3567 http://web-erp.svn.sourceforge.net/web-erp/?rev=3567&view=rev Author: tim_schofield Date: 2010-07-05 21:26:42 +0000 (Mon, 05 Jul 2010) Log Message: ----------- Minor bug fixes, corrections to sql statements Modified Paths: -------------- trunk/CustLoginSetup.php trunk/doc/Change.log.html Modified: trunk/CustLoginSetup.php =================================================================== --- trunk/CustLoginSetup.php 2010-07-05 13:06:08 UTC (rev 3566) +++ trunk/CustLoginSetup.php 2010-07-05 21:26:42 UTC (rev 3567) @@ -15,12 +15,25 @@ _('Purchasing'), _('Inventory'), _('Manufacturing'), + _('Contracts'), _('General Ledger'), + _('Asset Manager'), + _('Petty Cash'), _('Setup')); echo "<a href='" . $rootpath . '/SelectCustomer.php?' . SID . "'>" . _('Back to Customers') . '</a><br>'; -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="">' . ' ' . _('Customer') . ' : ' . $_SESSION['CustomerID'] . ' - ' . $CustomerName . ' ' . $phone . _(' has been selected') . '<br>';//'</p>'; +$sql="SELECT name + FROM debtorsmaster + WHERE debtorno='".$_SESSION['CustomerID']."'"; + +$result=DB_query($sql, $db); +$myrow=DB_fetch_array($result); +$CustomerName=$myrow['name']; + +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . + '" alt="">' . ' ' . _('Customer') . ' : ' . $_SESSION['CustomerID'] . ' - ' . $CustomerName. _(' has been selected') . + '<br>';//'</p>'; //echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/group_add.png" title="' . _('Search') . '" alt="">' . ' ' . $title.'<br>'; @@ -126,7 +139,7 @@ $_POST['ModulesAllowed']= $ModulesAllowed; - if ($SelectedUser AND $InputError !=1) { + if (isset($SelectedUser) AND $InputError !=1) { /*SelectedUser could also exist if submit had not been clicked this code would not run in this case cos submit is false of course see the delete code below*/ @@ -146,13 +159,13 @@ ".$UpdatePassword." branchcode='" . $_POST['BranchCode'] . "', pagesize='" . $_POST['PageSize'] . "', - fullaccess=" . $_POST['Access'] . ", + fullaccess='" . $_POST['Access'] . "', theme='" . $_POST['Theme'] . "', language ='" . $_POST['UserLanguage'] . "', defaultlocation='" . $_POST['DefaultLocation'] ."', modulesallowed='" . $ModulesAllowed . "', - blocked=" . $_POST['Blocked'] . " - WHERE userid = '$SelectedUser'"; + blocked='" . $_POST['Blocked'] . "' + WHERE userid = '".$SelectedUser."'"; $msg = _('The selected user record has been updated'); } elseif ($InputError !=1) { @@ -165,6 +178,7 @@ phone, email, pagesize, + lastvisitdate, fullaccess, defaultlocation, modulesallowed, @@ -179,10 +193,11 @@ '" . $_POST['Phone'] . "', '" . $_POST['Email'] ."', '" . $_POST['PageSize'] ."', - " . $_POST['Access'] . ", + '" . date('Y-m-d') ."', + '" . $_POST['Access'] . "', '" . $_POST['DefaultLocation'] ."', '" . $ModulesAllowed . "', - " . $_SESSION['DefaultDisplayRecordsMax'] . ", + '" . $_SESSION['DefaultDisplayRecordsMax'] . "', '" . $_POST['Theme'] . "', '". $_POST['UserLanguage'] ."')"; $msg = _('A new user record has been inserted'); @@ -226,7 +241,7 @@ prnMsg(_('Cannot delete user as entries already exist in the audit trail'), 'warn'); } else { - $sql="DELETE FROM www_users WHERE userid='$SelectedUser'"; + $sql="DELETE FROM www_users WHERE userid='".$SelectedUser."'"; $ErrMsg = _('The User could not be deleted because');; $result = DB_query($sql,$db,$ErrMsg); prnMsg(_('User Deleted'),'info'); @@ -254,7 +269,7 @@ FROM www_users WHERE customerid = '" . $_SESSION['CustomerID'] . "'"; $result = DB_query($sql,$db); - echo '<table>'; + echo '<table class=selection>'; echo "<tr><th>" . _('User Login') . "</th> <th>" . _('Full Name') . "</th> <th>" . _('Telephone') . "</th> Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-07-05 13:06:08 UTC (rev 3566) +++ trunk/doc/Change.log.html 2010-07-05 21:26:42 UTC (rev 3567) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>05/07/10 Tim: CustLoginSetup.php - Minor bug fixes, corrections to sql statements</p> <p>05/07/10 Pak Ricard: upgrade3.11.1-3.12.sql - Error in table name <p>05/07/10 Pak Ricard: PricesByCost.php - Margin must be decimal to allow margins like 2,5 or 3,3 time standard cost. Also ot has to be large enough to accept "currency margins". If you have a standard costs in EUR and want to check prices in IDR or viceversa, you'll need to compute large margins.</p> <p>04/07/10 Tim: CustEDISetup.php - Corrections to sql statements</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-07-05 23:10:28
|
Revision: 3571 http://web-erp.svn.sourceforge.net/web-erp/?rev=3571&view=rev Author: tim_schofield Date: 2010-07-05 21:28:03 +0000 (Mon, 05 Jul 2010) Log Message: ----------- Corrections to sql statements Modified Paths: -------------- trunk/CustomerReceipt.php trunk/doc/Change.log.html Modified: trunk/CustomerReceipt.php =================================================================== --- trunk/CustomerReceipt.php 2010-07-05 21:27:43 UTC (rev 3570) +++ trunk/CustomerReceipt.php 2010-07-05 21:28:03 UTC (rev 3571) @@ -32,7 +32,7 @@ $_SESSION['ReceiptBatch']->Account = $_POST['BankAccount']; /*Get the bank account currency and set that too */ - $SQL = 'SELECT bankaccountname, currcode FROM bankaccounts WHERE accountcode=' . $_POST['BankAccount']; + $SQL = "SELECT bankaccountname, currcode FROM bankaccounts WHERE accountcode='" . $_POST['BankAccount']."'"; $ErrMsg =_('The bank account name cannot be retrieved because'); $result= DB_query($SQL,$db,$ErrMsg); @@ -215,7 +215,7 @@ echo '<br /><p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Allocate') . '" alt="">' . ' ' . _('Summary of Receipt Batch').'</p><br />'; - echo '<table><tr><th>'._('Batch Number').'</th> + echo '<table class=selection><tr><th>'._('Batch Number').'</th> <th>'._('Date Banked').'</th> <th>'._('Customer Name').'</th <th>'._('GL Code').'</th @@ -244,7 +244,7 @@ if ($ReceiptItem->GLCode !=''){ //so its a GL receipt if ($_SESSION['CompanyRecord']['gllink_debtors']==1){ /* then enter a GLTrans record */ - $SQL = 'INSERT INTO gltrans (type, + $SQL = "INSERT INTO gltrans (type, typeno, trandate, periodno, @@ -252,14 +252,16 @@ narrative, amount, tag) - VALUES (12, - ' . $_SESSION['ReceiptBatch']->BatchNo . ", + VALUES ( + 12, + '" . $_SESSION['ReceiptBatch']->BatchNo . "', '" . FormatDateForSQL($_SESSION['ReceiptBatch']->DateBanked) . "', - " . $PeriodNo . ', - ' . $ReceiptItem->GLCode . ", + '" . $PeriodNo . "', + '" . $ReceiptItem->GLCode . "', '" . $ReceiptItem->Narrative . "', - " . -($ReceiptItem->Amount/$_SESSION['ReceiptBatch']->ExRate/$_SESSION['ReceiptBatch']->FunctionalExRate) . ", - '" . $ReceiptItem->tag . "'" . ')'; + '" . -($ReceiptItem->Amount/$_SESSION['ReceiptBatch']->ExRate/$_SESSION['ReceiptBatch']->FunctionalExRate) . "', + '" . $ReceiptItem->tag . "'" . " + )"; $ErrMsg = _('Cannot insert a GL entry for the receipt because'); $DbgMsg = _('The SQL that failed to insert the receipt GL entry was'); $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); @@ -273,10 +275,10 @@ /*Need to deal with the case where the payment from one bank account could be to a bank account in another currency */ /*Get the currency and rate of the bank account transferring to*/ - $SQL = 'SELECT currcode, rate + $SQL = "SELECT currcode, rate FROM bankaccounts INNER JOIN currencies ON bankaccounts.currcode = currencies.currabrev - WHERE accountcode=' . $ReceiptItem->GLCode; + WHERE accountcode='" . $ReceiptItem->GLCode."'"; $TrfFromAccountResult = DB_query($SQL,$db); $TrfFromBankRow = DB_fetch_array($TrfFromAccountResult) ; $TrfFromBankCurrCode = $TrfFromBankRow['currcode']; @@ -316,7 +318,7 @@ */ $PaymentTransNo = GetNextTransNo( 1, $db); - $SQL='INSERT INTO banktrans (transno, + $SQL="INSERT INTO banktrans (transno, type, bankact, ref, @@ -326,17 +328,18 @@ banktranstype, amount, currcode) - VALUES (' . $PaymentTransNo . ', - 1, - ' . $ReceiptItem->GLCode . ", - '" . _('Act Transfer') .' - ' . $ReceiptItem->Narrative . "', - " . (($_SESSION['ReceiptBatch']->ExRate * $_SESSION['ReceiptBatch']->FunctionalExRate)/$TrfFromBankExRate). ', - ' . $TrfFromBankExRate . ", - '" . FormatDateForSQL($_SESSION['ReceiptBatch']->DateBanked) . "', - '" . $_SESSION['ReceiptBatch']->ReceiptType . "', - " . -$ReceiptItem->Amount . ", - '" . $_SESSION['ReceiptBatch']->Currency . "' - )"; + VALUES ( + '" . $PaymentTransNo . "', + 1, + '" . $ReceiptItem->GLCode . "', + '" . _('Act Transfer') ." - " . $ReceiptItem->Narrative . "', + '" . (($_SESSION['ReceiptBatch']->ExRate * $_SESSION['ReceiptBatch']->FunctionalExRate)/$TrfFromBankExRate). "', + '" . $TrfFromBankExRate . "', + '" . FormatDateForSQL($_SESSION['ReceiptBatch']->DateBanked) . "', + '" . $_SESSION['ReceiptBatch']->ReceiptType . "', + '" . -$ReceiptItem->Amount . "', + '" . $_SESSION['ReceiptBatch']->Currency . "' + )"; $DbgMsg = _('The SQL that failed to insert the bank transaction was'); $ErrMsg = _('Cannot insert a bank transaction using the SQL'); @@ -348,7 +351,7 @@ $BatchDebtorTotal += (($ReceiptItem->Discount + $ReceiptItem->Amount)/$_SESSION['ReceiptBatch']->ExRate/$_SESSION['ReceiptBatch']->FunctionalExRate); /*Create a DebtorTrans entry for each customer deposit */ - $SQL = 'INSERT INTO debtortrans (transno, + $SQL = "INSERT INTO debtortrans (transno, type, debtorno, branchcode, @@ -361,27 +364,29 @@ ovamount, ovdiscount, invtext) - VALUES (' . $_SESSION['ReceiptBatch']->BatchNo . ", + VALUES ( + '" . $_SESSION['ReceiptBatch']->BatchNo . "', 12, '" . $ReceiptItem->Customer . "', '', '" . FormatDateForSQL($_SESSION['ReceiptBatch']->DateBanked) . "', '" . date('Y-m-d H-i-s') . "', - " . $PeriodNo . ", + '" . $PeriodNo . "', '" . $_SESSION['ReceiptBatch']->ReceiptType . ' ' . $ReceiptItem->PayeeBankDetail . "', '', - " . ($_SESSION['ReceiptBatch']->ExRate/$_SESSION['ReceiptBatch']->FunctionalExRate) . ", - " . -$ReceiptItem->Amount . ", - " . -$ReceiptItem->Discount . ", + '" . ($_SESSION['ReceiptBatch']->ExRate/$_SESSION['ReceiptBatch']->FunctionalExRate) . "', + '" . -$ReceiptItem->Amount . "', + '" . -$ReceiptItem->Discount . "', '" . $ReceiptItem->Narrative. "' )"; $DbgMsg = _('The SQL that failed to insert the customer receipt transaction was'); $ErrMsg = _('Cannot insert a receipt transaction against the customer because') ; $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); - $SQL = "UPDATE debtorsmaster SET lastpaiddate = '" . FormatDateForSQL($_SESSION['ReceiptBatch']->DateBanked) . "', - lastpaid=" . $ReceiptItem->Amount ." - WHERE debtorsmaster.debtorno='" . $ReceiptItem->Customer . "'"; + $SQL = "UPDATE debtorsmaster + SET lastpaiddate = '" . FormatDateForSQL($_SESSION['ReceiptBatch']->DateBanked) . "', + lastpaid='" . $ReceiptItem->Amount ."' + WHERE debtorsmaster.debtorno='" . $ReceiptItem->Customer . "'"; $DbgMsg = _('The SQL that failed to update the date of the last payment received was'); $ErrMsg = _('Cannot update the customer record for the date of the last payment received because'); @@ -405,20 +410,22 @@ account, narrative, amount) - VALUES (12, - " . $_SESSION['ReceiptBatch']->BatchNo . ", + VALUES ( + 12, + '" . $_SESSION['ReceiptBatch']->BatchNo . "', '" . FormatDateForSQL($_SESSION['ReceiptBatch']->DateBanked) . "', - " . $PeriodNo . ", - " . $_SESSION['ReceiptBatch']->Account . ", + '" . $PeriodNo . "', + '" . $_SESSION['ReceiptBatch']->Account . "', '" . $_SESSION['ReceiptBatch']->Narrative . "', - " . $BatchReceiptsTotal . ')'; + '" . $BatchReceiptsTotal . "' + )"; $DbgMsg = _('The SQL that failed to insert the GL transaction fro the bank account debit was'); $ErrMsg = _('Cannot insert a GL transaction for the bank account debit'); $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); /*now enter the BankTrans entry */ - $SQL='INSERT INTO banktrans (type, + $SQL="INSERT INTO banktrans (type, transno, bankact, ref, @@ -428,15 +435,16 @@ banktranstype, amount, currcode) - VALUES (12, - ' . $_SESSION['ReceiptBatch']->BatchNo . ', - ' . $_SESSION['ReceiptBatch']->Account . ", + VALUES ( + 12, + '" . $_SESSION['ReceiptBatch']->BatchNo . "', + '" . $_SESSION['ReceiptBatch']->Account . "', '" . $_SESSION['ReceiptBatch']->Narrative . "', - " . $_SESSION['ReceiptBatch']->ExRate . ", - " . $_SESSION['ReceiptBatch']->FunctionalExRate . ", + '" . $_SESSION['ReceiptBatch']->ExRate . "', + '" . $_SESSION['ReceiptBatch']->FunctionalExRate . "', '" . FormatDateForSQL($_SESSION['ReceiptBatch']->DateBanked) . "', '" . $_SESSION['ReceiptBatch']->ReceiptType . "', - " . ($BatchReceiptsTotal * $_SESSION['ReceiptBatch']->FunctionalExRate * $_SESSION['ReceiptBatch']->ExRate) . ", + '" . ($BatchReceiptsTotal * $_SESSION['ReceiptBatch']->FunctionalExRate * $_SESSION['ReceiptBatch']->ExRate) . "', '" . $_SESSION['ReceiptBatch']->Currency . "' )"; $DbgMsg = _('The SQL that failed to insert the bank account transaction was'); @@ -445,21 +453,22 @@ } if ($BatchDebtorTotal!=0){ /* Now Credit Debtors account with receipts + discounts */ - $SQL='INSERT INTO gltrans ( type, + $SQL="INSERT INTO gltrans ( type, typeno, trandate, periodno, account, narrative, amount) - VALUES (12, - ' . $_SESSION['ReceiptBatch']->BatchNo . ", + VALUES ( + 12, + '" . $_SESSION['ReceiptBatch']->BatchNo . "', '" . FormatDateForSQL($_SESSION['ReceiptBatch']->DateBanked) . "', - " . $PeriodNo . ', - ' . $_SESSION['CompanyRecord']['debtorsact'] . ", - '" . $_SESSION['ReceiptBatch']->Narrative . "', - " . -$BatchDebtorTotal . ' - )'; + '" . $PeriodNo . "', + '". $_SESSION['CompanyRecord']['debtorsact'] . "', + '" . $_SESSION['ReceiptBatch']->Narrative . "', + '" . -$BatchDebtorTotal . "' + )"; $DbgMsg = _('The SQL that failed to insert the GL transaction for the debtors account credit was'); $ErrMsg = _('Cannot insert a GL transaction for the debtors account credit'); $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); @@ -468,20 +477,22 @@ if ($BatchDiscount!=0){ /* Now Debit Discount account with discounts allowed*/ - $SQL='INSERT INTO gltrans ( type, + $SQL="INSERT INTO gltrans ( type, typeno, trandate, periodno, account, narrative, amount) - VALUES (12, - ' . $_SESSION['ReceiptBatch']->BatchNo . ", + VALUES ( + 12, + '" . $_SESSION['ReceiptBatch']->BatchNo . "', '" . FormatDateForSQL($_SESSION['ReceiptBatch']->DateBanked) . "', - " . $PeriodNo . ', - ' . $_SESSION['CompanyRecord']['pytdiscountact'] . ", + '" . $PeriodNo . "', + '" . $_SESSION['CompanyRecord']['pytdiscountact'] . "', '" . $_SESSION['ReceiptBatch']->Narrative . "', - " . $BatchDiscount . ')'; + '" . $BatchDiscount . "' + )"; $DbgMsg = _('The SQL that failed to insert the GL transaction for the payment discount debit was'); $ErrMsg = _('Cannot insert a GL transaction for the payment discount debit'); $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); @@ -676,12 +687,12 @@ /*show the batch header details and the entries in the batch so far */ -$SQL = 'SELECT bankaccountname, +$SQL = "SELECT bankaccountname, bankaccounts.accountcode, bankaccounts.currcode FROM bankaccounts, chartmaster - WHERE bankaccounts.accountcode=chartmaster.accountcode'; + WHERE bankaccounts.accountcode=chartmaster.accountcode"; $ErrMsg = _('The bank accounts could not be retrieved because'); @@ -690,7 +701,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Enter Receipt') . '" alt="">' . ' ' . _('Enter Customer Receipt') . '</p>'; echo '<div class="page_help_text">' . _('To enter a payment TO a customer (ie. to pay out a credit note), enter a negative payment amount.') . '</div>'; -echo '<br><table><tr><td>' . _('Bank Account') . ':</td> +echo '<br><table class=selection><tr><td>' . _('Bank Account') . ':</td> <td><select tabindex=1 name="BankAccount" onChange="ReloadForm(form1.BatchInput)">'; if (DB_num_rows($AccountsResults)==0){ @@ -806,7 +817,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Banked') . '" alt="">' . ' ' . $_SESSION['ReceiptBatch']->ReceiptType . ' - ' . _('Banked into the') . " " . $_SESSION['ReceiptBatch']->BankAccountName . ' ' . _('on') . ' ' . $_SESSION['ReceiptBatch']->DateBanked . '</p>'; - echo '<table width="90%" border="1"><tr> + echo '<table width="90%" class=selection><tr> <th>' . _('Amount') . ' ' . _('Received') . '</th> <th>' . _('Discount') . '</th> <th>' . _('Customer') . '</th> @@ -862,13 +873,13 @@ echo '<br><font color=red size=4><b>' . _('ACCOUNT ON HOLD') . '</font></b><br/>'; } - echo '<table width="90%" border="1"> + echo '<table width="90%" class=selection> <tr> - <th>' . _('Total Balance') . '</th> - <th>' . _('Current') . '</th> - <th>' . _('Now Due') . '</th> - <th>' . $_SESSION['PastDueDays1'] . '-' . $_SESSION['PastDueDays2'] . ' ' . _('Days Overdue') . '</th> - <th>' . _('Over') . ' ' . $_SESSION['PastDueDays2'] . ' ' . _('Days Overdue') . '</th> + <th width=20%>' . _('Total Balance') . '</th> + <th width=20%>' . _('Current') . '</th> + <th width=20%>' . _('Now Due') . '</th> + <th width=20%>' . $_SESSION['PastDueDays1'] . '-' . $_SESSION['PastDueDays2'] . ' ' . _('Days Overdue') . '</th> + <th width=20%>' . _('Over') . ' ' . $_SESSION['PastDueDays2'] . ' ' . _('Days Overdue') . '</th> </tr>'; echo '<tr> @@ -880,7 +891,7 @@ </tr> </table><br>'; - echo '<table>'; + echo '<table class=selection>'; $DisplayDiscountPercent = number_format($_SESSION['CustomerRecord']['pymtdiscount']*100,2) . "%"; @@ -892,7 +903,7 @@ if (isset($_POST['GLEntry']) AND isset($_SESSION['ReceiptBatch'])){ /* Set up a heading for the transaction entry for a GL Receipt */ - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Banked') . '" alt=""> ' . _('General Ledger Receipt Entry') . '</font><table>'; + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Banked') . '" alt=""> ' . _('General Ledger Receipt Entry') . '</font><table class=selection>'; //Select the tag echo '<tr><td>' . _('Select Tag') . ':</td><td><select name="tag">'; @@ -972,7 +983,7 @@ echo '<td>' . _('Narrative') . ':</td>'; echo '<td><textarea name="Narrative" cols=40 rows=1></textarea></td>'; echo '</table>'; - echo '<div class="centre"><input tabindex=14 type="submit" name="Process" value="' . _('Accept') . '">'; + echo '<br><div class="centre"><input tabindex=14 type="submit" name="Process" value="' . _('Accept') . '">'; echo '<input tabindex=14 type="submit" name="Cancel" value="' . _('Cancel') . '"></div>'; } elseif (isset($_SESSION['ReceiptBatch']) && !isset($_POST['GLEntry'])){ @@ -982,7 +993,7 @@ echo $msg; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="">' . ' ' . _('Select a Customer') . '</b>'; - echo '<table cellpadding=3 colspan=4>'; + echo '<table cellpadding=3 colspan=4 class=selection>'; echo '<tr><td>' . _('Text in the Customer') . ' ' . '<b>' . _('name') . '</b>:</td>'; echo '<td><input tabindex=9 type="text" name="Keywords" size=15 maxlength=25></td>'; echo '<td><font size=3><b>' . _('OR') . '</b></font></td>'; @@ -992,7 +1003,7 @@ echo '<td>' . _('Customer invoice number') . ':</td>'; echo '<td><input tabindex=11 type="text" name="CustInvNo" size=8 maxlength=8></td>'; echo '</tr></table>'; - echo '<div class="centre">'; + echo '<div class="centre"><br>'; echo '<input tabindex=11 type=submit name="Search" value="' . _('Search Now') . '">'; echo '<br/><br/><input tabindex=12 type=submit name="GLEntry" value="' . _('Enter A GL Receipt') . '">'; @@ -1002,7 +1013,7 @@ if (isset($CustomerSearchResult)) { - echo '<table cellpadding=2 colspan=7 border=2>'; + echo '<table cellpadding=2 colspan=7 class=selection>'; $TableHeader = '<tr><th>' . _('Code') . '</th> <th>' . _('Customer Name') . '</th></tr>'; echo $TableHeader; @@ -1042,4 +1053,4 @@ echo '</form>'; include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-07-05 21:27:43 UTC (rev 3570) +++ trunk/doc/Change.log.html 2010-07-05 21:28:03 UTC (rev 3571) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>05/07/10 Tim: CustomerReceipt.php - Corrections to sql statements</p> <p>05/07/10 Tim: CustomerInquiries.php - Layout changes</p> <p>05/07/10 Tim: CustomerAllocations.php - Corrections to sql statements and layout changes</p> <p>05/07/10 Tim: CustomerAllocations.php - Corrections to sql statements and layout changes</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-07-06 21:57:59
|
Revision: 3572 http://web-erp.svn.sourceforge.net/web-erp/?rev=3572&view=rev Author: tim_schofield Date: 2010-07-06 21:57:53 +0000 (Tue, 06 Jul 2010) Log Message: ----------- Layout changes Modified Paths: -------------- trunk/Customers.php trunk/doc/Change.log.html Modified: trunk/Customers.php =================================================================== --- trunk/Customers.php 2010-07-05 21:28:03 UTC (rev 3571) +++ trunk/Customers.php 2010-07-06 21:57:53 UTC (rev 3572) @@ -171,17 +171,14 @@ address4='" . $_POST['Address4'] . "', address5='" . $_POST['Address5'] . "', address6='" . $_POST['Address6'] . "', - telephone='".$_POST['Phone']."', - fax = '".$_POST['Fax']."', - email = '".$_POST['Email']."', currcode='" . $_POST['CurrCode'] . "', - clientsince='$SQL_ClientSince', + clientsince='" . $SQL_ClientSince. "', holdreason='" . $_POST['HoldReason'] . "', paymentterms='" . $_POST['PaymentTerms'] . "', - discount=" . ($_POST['Discount'])/100 . ", + discount='" . ($_POST['Discount'])/100 . "', discountcode='" . $_POST['DiscountCode'] . "', - pymtdiscount=" . ($_POST['PymtDiscount'])/100 . ", - creditlimit=" . $_POST['CreditLimit'] . ", + pymtdiscount='" . ($_POST['PymtDiscount'])/100 . "', + creditlimit='" . $_POST['CreditLimit'] . "', salestype = '" . $_POST['SalesType'] . "', invaddrbranch='" . $_POST['AddrInvBranch'] . "', taxref='" . $_POST['TaxRef'] . "', @@ -205,16 +202,13 @@ address4='" . $_POST['Address4'] . "', address5='" . $_POST['Address5'] . "', address6='" . $_POST['Address6'] . "', - telephone='".$_POST['Phone']."', - fax = '".$_POST['Fax']."', - email = '".$_POST['Email']."', - clientsince='$SQL_ClientSince', + clientsince='" . $SQL_ClientSince . "', holdreason='" . $_POST['HoldReason'] . "', paymentterms='" . $_POST['PaymentTerms'] . "', - discount=" . ($_POST['Discount'])/100 . ", + discount='" . ($_POST['Discount'])/100 . "', discountcode='" . $_POST['DiscountCode'] . "', - pymtdiscount=" . ($_POST['PymtDiscount'])/100 . ", - creditlimit=" . $_POST['CreditLimit'] . ", + pymtdiscount='" . ($_POST['PymtDiscount'])/100 . "', + creditlimit='" . $_POST['CreditLimit'] . "', salestype = '" . $_POST['SalesType'] . "', invaddrbranch='" . $_POST['AddrInvBranch'] . "', taxref='" . $_POST['TaxRef'] . "', @@ -251,9 +245,6 @@ address4, address5, address6, - telephone, - fax, - email, currcode, clientsince, holdreason, @@ -275,17 +266,14 @@ '" . $_POST['Address4'] . "', '" . $_POST['Address5'] . "', '" . $_POST['Address6'] . "', - '".$_POST['Phone']."', - '".$_POST['Fax']."', - '".$_POST['Email']."', '" . $_POST['CurrCode'] . "', '" . $SQL_ClientSince . "', - " . $_POST['HoldReason'] . ", + '" . $_POST['HoldReason'] . "', '" . $_POST['PaymentTerms'] . "', - " . ($_POST['Discount'])/100 . ", + '" . ($_POST['Discount'])/100 . "', '" . $_POST['DiscountCode'] . "', - " . ($_POST['PymtDiscount'])/100 . ", - " . $_POST['CreditLimit'] . ", + '" . ($_POST['PymtDiscount'])/100 . "', + '" . $_POST['CreditLimit'] . "', '" . $_POST['SalesType'] . "', '" . $_POST['AddrInvBranch'] . "', '" . $_POST['TaxRef'] . "', @@ -363,6 +351,7 @@ $result = DB_query($sql,$db); prnMsg( _('Customer') . ' ' . $_POST['DebtorNo'] . ' ' . _('has been deleted - together with all the associated contacts') . ' !','success'); include('includes/footer.inc'); + unset($_SESSION['CustomerID']); exit; } //end if Delete Customer } @@ -468,7 +457,7 @@ $DataError =0; - echo '<table border=2 cellspacing=4><tr><td><table>'; + echo '<table class=selection cellspacing=4><tr><td valign=top><table class=selection>'; /* if $AutoDebtorNo in config.php has not been set or if it has been set to a number less than one, then provide an input box for the DebtorNo to manually assigned */ @@ -497,41 +486,41 @@ echo '<tr><td>' . _('Address Line 6') . ':</td> <td><input tabindex=8 type="Text" name="Address6" size=17 maxlength=15></td></tr>'; - echo '</table></td><td><table>'; + echo '</table></td><td><table class=selection>'; // Show Sales Type drop down list $result=DB_query('SELECT typeabbrev, sales_type FROM salestypes ',$db); if (DB_num_rows($result)==0){ - $DataError =1; - echo '<a href="SalesTypes.php?" target="_parent">Setup Types</a>'; - echo '<tr><td colspan=2>' . prnMsg(_('No sales types/price lists defined'),'error') . '</td></tr>'; - } else { - echo '<tr><td>' . _('Sales Type/Price List') . ':</td> - <td><select tabindex=9 name="SalesType">'; + $DataError =1; + echo '<a href="SalesTypes.php?" target="_parent">Setup Types</a>'; + echo '<tr><td colspan=2>' . prnMsg(_('No sales types/price lists defined'),'error') . '</td></tr>'; + } else { + echo '<tr><td>' . _('Sales Type/Price List') . ':</td> + <td><select tabindex=9 name="SalesType">'; - while ($myrow = DB_fetch_array($result)) { - echo '<option value="'. $myrow['typeabbrev'] . '">' . $myrow['sales_type'] . '</option>'; - } //end while loopre - DB_data_seek($result,0); + while ($myrow = DB_fetch_array($result)) { + echo '<option value="'. $myrow['typeabbrev'] . '">' . $myrow['sales_type'] . '</option>'; + } //end while loopre + DB_data_seek($result,0); echo '</select></td></tr>'; - } + } // Show Customer Type drop down list - $result=DB_query('SELECT typeid, typename FROM debtortype ',$db); - if (DB_num_rows($result)==0){ - $DataError =1; - echo '<a href="SalesTypes.php?" target="_parent">Setup Types</a>'; - echo '<tr><td colspan=2>' . prnMsg(_('No Customer types/price lists defined'),'error') . '</td></tr>'; - } else { - echo '<tr><td>' . _('Customer Type') . ':</td> - <td><select tabindex=9 name="typeid">'; + $result=DB_query('SELECT typeid, typename FROM debtortype ',$db); + if (DB_num_rows($result)==0){ + $DataError =1; + echo '<a href="SalesTypes.php?" target="_parent">Setup Types</a>'; + echo '<tr><td colspan=2>' . prnMsg(_('No Customer types/price lists defined'),'error') . '</td></tr>'; + } else { + echo '<tr><td>' . _('Customer Type') . ':</td> + <td><select tabindex=9 name="typeid">'; - while ($myrow = DB_fetch_array($result)) { - echo '<option value="'. $myrow['typeid'] . '">' . $myrow['typename'] . '</option>'; - } //end while loop - DB_data_seek($result,0); - echo '</select></td></tr>'; - } + while ($myrow = DB_fetch_array($result)) { + echo '<option value="'. $myrow['typeid'] . '">' . $myrow['typename'] . '</option>'; + } //end while loop + DB_data_seek($result,0); + echo '</select></td></tr>'; + } @@ -616,7 +605,7 @@ echo'</table></td></tr></table>'; if ($DataError ==0){ - echo "<div class='centre'><input tabindex=20 type='Submit' name='submit' value='" . _('Add New Customer') . "'><br><input tabindex=21 type=submit action=RESET VALUE='" . _('Reset') . "'></div>"; + echo "<br><div class='centre'><input tabindex=20 type='Submit' name='submit' value='" . _('Add New Customer') . "'> <input tabindex=21 type=submit action=RESET VALUE='" . _('Reset') . "'></div>"; } echo '</form>'; @@ -625,7 +614,7 @@ //DebtorNo exists - either passed when calling the form or from the form itself echo "<form method='post' action='" . $_SERVER['PHP_SELF'] . '?' . SID ."'>"; - echo '<table border=2 cellspacing=4><tr><td><table>'; + echo '<table class=selection cellspacing=4><tr><td valign=top><table class=selection>'; if (!isset($_POST['New'])) { $sql = "SELECT debtorsmaster.debtorno, @@ -715,7 +704,7 @@ echo '<tr><td>' . _('Address Line 4 (Postal Code)') . ':</td><td>' . $_POST['Address4'] . '</td></tr>'; echo '<tr><td>' . _('Address Line 5') . ':</td><td>' . $_POST['Address5'] . '</td></tr>'; echo '<tr><td>' . _('Address Line 6') . ':</td><td>' . $_POST['Address6'] . '</td></tr>'; - echo '</table></td><td><table>'; + echo '</table></td><td><table class=selection>'; } else { echo '<tr><td>' . _('Customer Name') . ':</td> <td><input ' . (in_array('CustName',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="CustName" value="' . $_POST['CustName'] . '" size=42 maxlength=40></td></tr>'; @@ -737,13 +726,13 @@ <td><input ' . (in_array('Address5',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="Address5" size=42 maxlength=40 value="' . $_POST['Address5'] . '"></td></tr>'; echo '<tr><td>' . _('Address Line 6') . ':</td> <td><input ' . (in_array('Address6',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="Address6" size=42 maxlength=40 value="' . $_POST['Address6'] . '"></td></tr>'; - echo '</table></td><td><table>'; + echo '</table></td><td><table class=selection>'; } // Select sales types for drop down list if (isset($_GET['Modify'])) { - $result=DB_query('SELECT sales_type FROM salestypes WHERE typeabbrev="'.$_POST['SalesType'].'"',$db); + $result=DB_query('SELECT sales_type FROM salestypes WHERE typeabbrev="'.$_POST['SalesType'].'"',$db); $myrow=DB_fetch_array($result); - echo '<tr><td>' . _('Sales Type') . ":</td><td>".$myrow['sales_type']."</td></tr>"; + echo '<tr><td>' . _('Sales Type') . ":</td><td>".$myrow['sales_type']."</td></tr>"; } else { $result=DB_query('SELECT typeabbrev, sales_type FROM salestypes ',$db); echo '<tr><td>' . _('Sales Type') . '/' . _('Price List') . ":</td> @@ -760,21 +749,21 @@ // Select Customer types for drop down list for SELECT/UPDATE if (isset($_GET['Modify'])) { - $result=DB_query('SELECT typename FROM debtortype WHERE typeid='.$_POST['typeid'],$db); + $result=DB_query("SELECT typename FROM debtortype WHERE typeid='".$_POST['typeid']."'",$db); $myrow=DB_fetch_array($result); - echo '<tr><td>' . _('Customer Type') . ":</td><td>".$myrow['typename']."</td></tr>"; + echo '<tr><td>' . _('Customer Type') . ":</td><td>".$myrow['typename']."</td></tr>"; } else { - $result=DB_query('SELECT typeid, typename FROM debtortype ORDER BY typename',$db); - echo '<tr><td>' . _('Customer Type') . ":</td> - <td><select name='typeid'>"; - while ($myrow = DB_fetch_array($result)) { - if ($_POST['typeid']==$myrow['typeid']){ - echo "<option selected VALUE='". $myrow['typeid'] . "'>" . $myrow['typename']; - } else { - echo "<option VALUE='". $myrow['typeid'] . "'>" . $myrow['typename']; - } - } //end while loop - DB_data_seek($result,0); + $result=DB_query("SELECT typeid, typename FROM debtortype ORDER BY typename",$db); + echo '<tr><td>' . _('Customer Type') . ":</td> + <td><select name='typeid'>"; + while ($myrow = DB_fetch_array($result)) { + if ($_POST['typeid']==$myrow['typeid']){ + echo "<option selected VALUE='". $myrow['typeid'] . "'>" . $myrow['typename']; + } else { + echo "<option VALUE='". $myrow['typeid'] . "'>" . $myrow['typename']; + } + } //end while loop + DB_data_seek($result,0); } if (isset($_GET['Modify'])) { @@ -802,9 +791,9 @@ } if (isset($_GET['Modify'])) { - $result=DB_query('SELECT terms FROM paymentterms WHERE termsindicator='.$_POST['PaymentTerms'],$db); + $result=DB_query("SELECT terms FROM paymentterms WHERE termsindicator='".$_POST['PaymentTerms']."'",$db); $myrow=DB_fetch_array($result); - echo '<tr><td>' . _('Payment Terms') . ":</td><td>".$myrow['terms']."</td></tr>"; + echo '<tr><td>' . _('Payment Terms') . ":</td><td>".$myrow['terms']."</td></tr>"; } else { $result=DB_query('SELECT terms, termsindicator FROM paymentterms',$db); echo '<tr><td>' . _('Payment Terms') . ":</td> @@ -821,9 +810,9 @@ } if (isset($_GET['Modify'])) { - $result=DB_query('SELECT reasondescription FROM holdreasons WHERE reasoncode="'.$_POST['HoldReason'].'"',$db); + $result=DB_query('SELECT reasondescription FROM holdreasons WHERE reasoncode="'.$_POST['HoldReason'].'"',$db); $myrow=DB_fetch_array($result); - echo '<tr><td>' . _('Credit Status') . ":</td><td>".$myrow['reasondescription']."</td></tr>"; + echo '<tr><td>' . _('Credit Status') . ":</td><td>".$myrow['reasondescription']."</td></tr>"; } else { $result=DB_query('SELECT reasoncode, reasondescription FROM holdreasons',$db); echo '<tr><td>' . _('Credit Status') . ":</td> @@ -840,9 +829,9 @@ } if (isset($_GET['Modify'])) { - $result=DB_query('SELECT currency FROM currencies WHERE currabrev="'.$_POST['CurrCode'].'"',$db); + $result=DB_query('SELECT currency FROM currencies WHERE currabrev="'.$_POST['CurrCode'].'"',$db); $myrow=DB_fetch_array($result); - echo '<tr><td>' . _('Credit Status') . ":</td><td>".$myrow['currency']."</td></tr>"; + echo '<tr><td>' . _('Credit Status') . ":</td><td>".$myrow['currency']."</td></tr>"; } else { $result=DB_query('SELECT currency, currabrev FROM currencies',$db); echo '<tr><td>' . _('Customers Currency') . ":</td> @@ -901,7 +890,7 @@ $sql = 'SELECT * FROM custcontacts where debtorno="'.$DebtorNo.'" ORDER BY contid'; $result = DB_query($sql,$db); - echo '<table border=1>'; + echo '<table class=selection>'; if (isset($_GET['Modify'])) { echo '<tr> <th>' . _('Name') . '</th> @@ -964,16 +953,16 @@ // echo "<input type='Submit' name='addcontact' VALUE='" . _('ADD Contact') . "'>"; echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?'.SID.'&DebtorNo="'.$DebtorNo.'"&ID='.$ID.'&Edit'.$Edit.'>'; if (isset($Edit) and $Edit!='') { - $SQLcustcontacts='SELECT * from custcontacts - WHERE debtorno="'.$DebtorNo.'" - and contid='.$ID; + $SQLcustcontacts="SELECT * from custcontacts + WHERE debtorno='".$DebtorNo."' + and contid='".$ID."'"; $resultcc = DB_query($SQLcustcontacts,$db); $myrowcc = DB_fetch_array($resultcc); $_POST['custname']=$myrowcc['contactname']; $_POST['role']=$myrowcc['role']; $_POST['phoneno']=$myrowcc['phoneno']; $_POST['notes']=$myrowcc['notes']; - echo '<table border=1>'; + echo '<table class=selection>'; echo "<tr> <td>" . _('Name') . "</td><td><input type=text name='custname' value='".$_POST['custname']."'></td></tr><tr> <td>" . _('Role') . "</td><td><input type=text name='role' value='".$_POST['role']."'></td></tr><tr> @@ -1013,10 +1002,11 @@ echo'</td></tr></table>'; if (isset($_POST['New']) and $_POST['New']) { - echo "<div class='centre'><input type='Submit' name='submit' VALUE='" . _('Add New Customer') . "'><br><input type=submit name='reset' VALUE='" . _('Reset') . "'></form>"; + echo "<div class='centre'><input type='Submit' name='submit' VALUE='" . _('Add New Customer') . + "'> <input type=submit name='reset' VALUE='" . _('Reset') . "'></div></form>"; } else if (!isset($_GET['Modify'])){ - echo "<hr><div class='centre'><input type='Submit' name='submit' VALUE='" . _('Update Customer') . "'>"; - echo '<p><input type="Submit" name="delete" VALUE="' . _('Delete Customer') . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">'; + echo "<br><div class='centre'><input type='Submit' name='submit' VALUE='" . _('Update Customer') . "'>"; + echo ' <input type="Submit" name="delete" VALUE="' . _('Delete Customer') . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">'; } if(isset($_POST['addcontact']) AND (isset($_POST['addcontact'])!='')) { @@ -1026,4 +1016,4 @@ } // end of main ifs include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-07-05 21:28:03 UTC (rev 3571) +++ trunk/doc/Change.log.html 2010-07-06 21:57:53 UTC (rev 3572) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>05/07/10 Tim: Customers.php - Layout changes</p> <p>05/07/10 Tim: CustomerReceipt.php - Corrections to sql statements</p> <p>05/07/10 Tim: CustomerInquiries.php - Layout changes</p> <p>05/07/10 Tim: CustomerAllocations.php - Corrections to sql statements and layout changes</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-07-06 21:58:31
|
Revision: 3573 http://web-erp.svn.sourceforge.net/web-erp/?rev=3573&view=rev Author: tim_schofield Date: 2010-07-06 21:58:25 +0000 (Tue, 06 Jul 2010) Log Message: ----------- Layout changes and correction to sql statement Modified Paths: -------------- trunk/CustomerTransInquiry.php trunk/doc/Change.log.html Modified: trunk/CustomerTransInquiry.php =================================================================== --- trunk/CustomerTransInquiry.php 2010-07-06 21:57:53 UTC (rev 3572) +++ trunk/CustomerTransInquiry.php 2010-07-06 21:58:25 UTC (rev 3573) @@ -14,7 +14,7 @@ echo "<form action='" . $_SERVER['PHP_SELF'] . "' method=post>"; -echo '<table cellpadding=2><tr>'; +echo '<table cellpadding=2 class=selection><tr>'; echo '<td>' . _('Type') . ":</td><td><select tabindex=1 name='TransType'> "; @@ -44,8 +44,7 @@ echo '<td>' . _('From') . ':</td><td><input tabindex="2" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" type="TEXT" name="FromDate" maxlength="10" size="11" VALUE="' . $_POST['FromDate'] . '"></td>'; echo '<td>' . _('To') . ':</td><td><input tabindex="3" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" type="TEXT" name="ToDate" maxlength="10" size="11" VALUE="' . $_POST['ToDate'] . '"></td>'; -echo "</tr></table><div class='centre'><input tabindex=4 type=submit name='ShowResults' VALUE='" . _('Show Transactions') . "'>"; -echo '<hr>'; +echo "</tr></table><br><div class='centre'><input tabindex=4 type=submit name='ShowResults' VALUE='" . _('Show Transactions') . "'>"; echo '</form></div>'; @@ -70,7 +69,7 @@ $sql = $sql . "trandate >='" . $SQL_FromDate . "' AND trandate <= '" . $SQL_ToDate . "'"; if ($_POST['TransType']!='All') { - $sql .= " AND type = " . $_POST['TransType']; + $sql .= " AND type = '" . $_POST['TransType']."'"; } $sql .= " ORDER BY id"; @@ -78,7 +77,7 @@ $DbgMsg = _('The SQL that failed was'); $TransResult = DB_query($sql, $db,$ErrMsg,$DbgMsg); - echo '<table cellpadding=2 border=2>'; + echo '<br><table cellpadding=2 class=selection>'; $tableheader = "<tr> <th>" . _('Type') . "</th> @@ -181,4 +180,4 @@ include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-07-06 21:57:53 UTC (rev 3572) +++ trunk/doc/Change.log.html 2010-07-06 21:58:25 UTC (rev 3573) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>05/07/10 Tim: Customers.php - Layout changes and correction to sql statement</p> <p>05/07/10 Tim: Customers.php - Layout changes</p> <p>05/07/10 Tim: CustomerReceipt.php - Corrections to sql statements</p> <p>05/07/10 Tim: CustomerInquiries.php - Layout changes</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-07-06 21:58:49
|
Revision: 3574 http://web-erp.svn.sourceforge.net/web-erp/?rev=3574&view=rev Author: tim_schofield Date: 2010-07-06 21:58:43 +0000 (Tue, 06 Jul 2010) Log Message: ----------- Misc minor bug fixes, layout changes and correction to sql statement Modified Paths: -------------- trunk/CustomerTypes.php trunk/doc/Change.log.html Modified: trunk/CustomerTypes.php =================================================================== --- trunk/CustomerTypes.php 2010-07-06 21:58:25 UTC (rev 3573) +++ trunk/CustomerTypes.php 2010-07-06 21:58:43 UTC (rev 3574) @@ -21,7 +21,7 @@ $Errors = array(); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Customer Types') . '" alt="">' . _('Customer Type Setup') . '</p>'; -echo '<div class="page_help_text">' . _('Add/edit/delete Customer Types') . '</div><br>'; +echo '<div class="page_help_text">' . _('Add/edit/delete Customer Types') . '</div>'; if (isset($_POST['submit'])) { @@ -35,14 +35,15 @@ $i=1; if (strlen($_POST['typename']) >100) { $InputError = 1; - echo prnMsg(_('The customer type name description must be 100 characters or less long'),'error'); + prnMsg(_('The customer type name description must be 100 characters or less long'),'error'); $Errors[$i] = 'CustomerType'; $i++; } if (strlen($_POST['typename'])==0) { $InputError = 1; - echo prnMsg(_('The customer type name description must contain at least one character'),'error'); + echo '<br>'; + prnMsg(_('The customer type name description must contain at least one character'),'error'); $Errors[$i] = 'CustomerType'; $i++; } @@ -52,18 +53,19 @@ WHERE typename = '" . $_POST['typename'] . "'"; $checkresult=DB_query($checksql, $db); $checkrow=DB_fetch_row($checkresult); - if ($checkrow[0]>0) { + if ($checkrow[0]>0 and !isset($SelectedType)) { $InputError = 1; - echo prnMsg(_('You already have a customer type called').' '.$_POST['typename'],'error'); + echo '<br>'; + prnMsg(_('You already have a customer type called').' '.$_POST['typename'],'error'); $Errors[$i] = 'CustomerName'; $i++; - } - + } + if (isset($SelectedType) AND $InputError !=1) { $sql = "UPDATE debtortype SET typename = '" . $_POST['typename'] . "' - WHERE typeid = '$SelectedType'"; + WHERE typeid = '" .$SelectedType."'"; $msg = _('The customer type') . ' ' . $SelectedType . ' ' . _('has been updated'); } elseif ( $InputError !=1 ) { @@ -72,7 +74,7 @@ $checkSql = "SELECT count(*) FROM debtortype - WHERE typeid = '" . $_POST['typeid'] . "'"; + WHERE typename = '" . $_POST['typename'] . "'"; $checkresult = DB_query($checkSql,$db); $checkrow = DB_fetch_row($checkresult); @@ -104,12 +106,7 @@ // Fetch the default price list. - $sql = "SELECT confvalue - FROM config - WHERE confname='DefaultCustomerType'"; - $result = DB_query($sql,$db); - $CustomerTypeRow = DB_fetch_row($result); - $DefaultCustomerType = $CustomerTypeRow[0]; + $DefaultCustomerType = $_SESSION['DefaultCustomerType']; // Does it exist $checkSql = "SELECT count(*) @@ -126,7 +123,7 @@ $result = DB_query($sql,$db); $_SESSION['DefaultCustomerType'] = $_POST['typeid']; } - + echo '<br>'; prnMsg($msg,'success'); unset($SelectedType); @@ -141,7 +138,7 @@ $sql= "SELECT COUNT(*) FROM debtortrans - WHERE debtortrans.type='$SelectedType'"; + WHERE debtortrans.type='".$SelectedType."'"; $ErrMsg = _('The number of transactions using this customer type could not be retrieved'); $result = DB_query($sql,$db,$ErrMsg); @@ -152,7 +149,7 @@ } else { - $sql = "SELECT COUNT(*) FROM debtorsmaster WHERE typeid='$SelectedType'"; + $sql = "SELECT COUNT(*) FROM debtorsmaster WHERE typeid='".$SelectedType."'"; $ErrMsg = _('The number of transactions using this Type record could not be retrieved because'); $result = DB_query($sql,$db,$ErrMsg); @@ -161,9 +158,10 @@ prnMsg (_('Cannot delete this type because customers are currently set up to use this type') . '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('customers with this type code')); } else { - $sql="DELETE FROM debtortype WHERE typeid='$SelectedType'"; + $sql="DELETE FROM debtortype WHERE typeid='".$SelectedType."'"; $ErrMsg = _('The Type record could not be deleted because'); $result = DB_query($sql,$db,$ErrMsg); + echo '<br>'; prnMsg(_('Customer type') . $SelectedType . ' ' . _('has been deleted') ,'success'); unset ($SelectedType); @@ -183,7 +181,7 @@ $sql = 'SELECT typeid, typename FROM debtortype'; $result = DB_query($sql,$db); - echo '<br><table border=1>'; + echo '<br><table class=selection>'; echo "<tr> <th>" . _('Type ID') . "</th> <th>" . _('Type Name') . "</th> @@ -223,8 +221,7 @@ if (! isset($_GET['delete'])) { echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; - echo '<p><table border=1>'; //Main table - echo '<td><table>'; // First column + echo '<p><table class=selection>'; //Main table // The user wish to EDIT an existing type @@ -234,7 +231,7 @@ $sql = "SELECT typeid, typename FROM debtortype - WHERE typeid='$SelectedType'"; + WHERE typeid='".$SelectedType."'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); @@ -244,7 +241,7 @@ echo "<input type=hidden name='SelectedType' VALUE=" . $SelectedType . ">"; echo "<input type=hidden name='typeid' VALUE=" . $_POST['typeid'] . ">"; - echo "<table> <tr><td>"; + echo "<table class=selection> <tr><td>"; // We dont allow the user to change an existing type code @@ -254,7 +251,7 @@ // This is a new type so the user may volunteer a type code - echo "<table>"; + echo "<table class=selection>"; } @@ -263,10 +260,9 @@ } echo "<tr><td>" . _('Type Name') . ":</td><td><input type='Text' name='typename' value='" . $_POST['typename'] . "'></td></tr>"; - echo '</table>'; // close table in first column echo '</td></tr></table>'; // close main table - echo '<p><div class="centre"><input type=submit name=submit VALUE="' . _('Accept') . '"></div>'; + echo '<p><div class="centre"><input type=submit name=submit value="' . _('Accept') . '"></div>'; echo '</form>'; @@ -274,4 +270,4 @@ include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-07-06 21:58:25 UTC (rev 3573) +++ trunk/doc/Change.log.html 2010-07-06 21:58:43 UTC (rev 3574) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>05/07/10 Tim: CustomerTypes.php - Misc minor bug fixes, layout changes and correction to sql statement</p> <p>05/07/10 Tim: Customers.php - Layout changes and correction to sql statement</p> <p>05/07/10 Tim: Customers.php - Layout changes</p> <p>05/07/10 Tim: CustomerReceipt.php - Corrections to sql statements</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-07-06 21:59:09
|
Revision: 3575 http://web-erp.svn.sourceforge.net/web-erp/?rev=3575&view=rev Author: tim_schofield Date: 2010-07-06 21:59:02 +0000 (Tue, 06 Jul 2010) Log Message: ----------- Layout changes and correction to sql statement Modified Paths: -------------- trunk/CustWhereAlloc.php trunk/doc/Change.log.html Modified: trunk/CustWhereAlloc.php =================================================================== --- trunk/CustWhereAlloc.php 2010-07-06 21:58:43 UTC (rev 3574) +++ trunk/CustWhereAlloc.php 2010-07-06 21:59:02 UTC (rev 3575) @@ -9,34 +9,37 @@ echo "<form action='" . $_SERVER['PHP_SELF'] . "' method=post>"; -echo '<table cellpadding=2><tr>'; +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . + _('Customer Where Allocated'). '" alt="">' . $title . '</p>'; +echo '<table class=selection cellpadding=2><tr>'; + echo '<td>' . _('Type') . ":</td><td><select tabindex=1 name='TransType'> "; -$sql = 'SELECT typeid, typename FROM systypes WHERE typeid = 10 OR typeid=12'; +$sql = "SELECT typeid, typename FROM systypes WHERE typeid = 10 OR typeid=12"; $resultTypes = DB_query($sql,$db); while ($myrow=DB_fetch_array($resultTypes)){ - if (isset($_POST['TransType'])){ - if ($myrow['typeid'] == $_POST['TransType']){ - echo "<option selected Value='" . $myrow['typeid'] . "'>" . $myrow['typename']; - } else { - echo "<option Value='" . $myrow['typeid'] . "'>" . $myrow['typename']; - } - } else { - echo "<option Value='" . $myrow['typeid'] . "'>" . $myrow['typename']; - } + if (isset($_POST['TransType'])){ + if ($myrow['typeid'] == $_POST['TransType']){ + echo "<option selected Value='" . $myrow['typeid'] . "'>" . $myrow['typename']; + } else { + echo "<option Value='" . $myrow['typeid'] . "'>" . $myrow['typename']; + } + } else { + echo "<option Value='" . $myrow['typeid'] . "'>" . $myrow['typename']; + } } echo '</select></td>'; if (!isset($_POST['TransNo'])) {$_POST['TransNo']='';} echo '<td>'._('Transaction Number').":</td> - <td><input tabindex=2 type=TEXT name='TransNo' maxlength=10 size=10 VALUE=". $_POST['TransNo'] . '></td>'; + <td><input tabindex=2 type=text name='TransNo' maxlength=10 size=10 value=". $_POST['TransNo'] . '></td>'; -echo "</tr></table> - <div class='centre'><input tabindex=3 type=submit name='ShowResults' VALUE="._('Show How Allocated').'></div>'; -echo '<hr>'; +echo "</tr></table><br> + <div class='centre'><input tabindex=3 type=submit name='ShowResults' value="._('Show How Allocated').'></div>'; if (isset($_POST['ShowResults']) AND $_POST['TransNo']==''){ + echo '<br>'; prnMsg(_('The transaction number to be queried must be entered first'),'warn'); } @@ -44,20 +47,19 @@ /*First off get the DebtorTransID of the transaction (invoice normally) selected */ - $sql = 'SELECT id, - ovamount+ovgst AS totamt + $sql = "SELECT id, + ovamount+ovgst AS totamt FROM debtortrans - WHERE type=' . $_POST['TransType'] . ' AND transno = ' . $_POST['TransNo']; + WHERE type='" . $_POST['TransType'] . "' AND transno = '" . $_POST['TransNo']."'"; - $result = DB_query($sql , $db); + $result = DB_query($sql , $db); - if (DB_num_rows($result)==1){ - $myrow = DB_fetch_array($result); - $AllocToID = $myrow['id']; + if (DB_num_rows($result)==1){ + $myrow = DB_fetch_array($result); + $AllocToID = $myrow['id']; - echo '<div class="centre"><font size=3><b><br>'._('Allocations made against invoice number') . ' ' . $_POST['TransNo'] . ' '._('Transaction Total').': '. number_format($myrow['totamt'],2) . '</font></b></div>'; - $sql = "SELECT type, + $sql = "SELECT type, transno, trandate, debtortrans.debtorno, @@ -67,17 +69,20 @@ custallocns.amt FROM debtortrans INNER JOIN custallocns ON debtortrans.id=custallocns.transid_allocfrom - WHERE custallocns.transid_allocto=". $AllocToID; + WHERE custallocns.transid_allocto='". $AllocToID."'"; - $ErrMsg = _('The customer transactions for the selected criteria could not be retrieved because'); + $ErrMsg = _('The customer transactions for the selected criteria could not be retrieved because'); - $TransResult = DB_query($sql, $db, $ErrMsg); - + $TransResult = DB_query($sql, $db, $ErrMsg); + if (DB_num_rows($TransResult)==0){ prnMsg(_('There are no allocations made against this transaction'),'info'); } else { - echo '<table cellpadding=2 BORDER=2>'; - + echo '<br><table cellpadding=2 class=selection>'; + + echo '<tr><th colspan=6><div class="centre"><font size=3 color=blue><b>'._('Allocations made against invoice number') . ' ' . $_POST['TransNo'] + . '<br>'._('Transaction Total').': '. number_format($myrow['totamt'],2) . '</font></b></div></th></tr>'; + $tableheader = "<tr><th>"._('Type')."</th> <th>"._('Number')."</th> <th>"._('Reference')."</th> @@ -86,13 +91,13 @@ <th>"._('Alloc').'</th> </tr>'; echo $tableheader; - + $RowCounter = 1; $k = 0; //row colour counter $AllocsTotal = 0; - + while ($myrow=DB_fetch_array($TransResult)) { - + if ($k==1){ echo '<tr class="EvenTableRows">'; $k=0; @@ -100,26 +105,20 @@ echo '<tr class="OddTableRows">'; $k++; } - + if ($myrow['type']==11){ $TransType = _('Credit Note'); } else { $TransType = _('Receipt'); } - printf( "<td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> - </tr>", - $TransType, - $myrow['transno'], - $myrow['reference'], - $myrow['rate'], - $myrow['totalamt'], - $myrow['amt']); - + echo "<td>".$TransType."</td> + <td>".$myrow['transno']."</td> + <td>".$myrow['reference']."</td> + <td>".$myrow['rate']."</td> + <td class=number>".number_format($myrow['totalamt'],2)."</td> + <td class=number>".number_format($myrow['amt'],2)."</td> + </tr>"; + $RowCounter++; If ($RowCounter == 12){ $RowCounter=1; @@ -129,10 +128,11 @@ $AllocsTotal +=$myrow['amt']; } //end of while loop - echo '<tr><td colspan = 6 class=number>' . number_format($AllocsTotal,2) . '</td></tr>'; + echo '<tr><td colspan = 5 class=number>'._('Total allocated').'</td> + <td class=number>' . number_format($AllocsTotal,2) . '</td></tr>'; echo '</table>'; } - } + } } echo '</form>'; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-07-06 21:58:43 UTC (rev 3574) +++ trunk/doc/Change.log.html 2010-07-06 21:59:02 UTC (rev 3575) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>05/07/10 Tim: CustWhereAlloc.php - Layout changes and correction to sql statement</p> <p>05/07/10 Tim: CustomerTypes.php - Misc minor bug fixes, layout changes and correction to sql statement</p> <p>05/07/10 Tim: Customers.php - Layout changes and correction to sql statement</p> <p>05/07/10 Tim: Customers.php - Layout changes</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |