From: <tim...@us...> - 2010-09-25 21:14:20
|
Revision: 3782 http://web-erp.svn.sourceforge.net/web-erp/?rev=3782&view=rev Author: tim_schofield Date: 2010-09-25 21:14:14 +0000 (Sat, 25 Sep 2010) Log Message: ----------- SQL quoting corrections Modified Paths: -------------- trunk/SMTPServer.php trunk/doc/Change.log.html Modified: trunk/SMTPServer.php =================================================================== --- trunk/SMTPServer.php 2010-09-25 21:09:43 UTC (rev 3781) +++ trunk/SMTPServer.php 2010-09-25 21:14:14 UTC (rev 3782) @@ -12,13 +12,13 @@ _('SMTP Server') . '" alt="">' . ' ' . _('SMTP Server Settings') . '</p>'; if (isset($_POST['submit'])) { - $sql='UPDATE emailsettings SET - host="'.$_POST['host'].'", - port='.$_POST['port'].', - heloaddress="'.$_POST['heloaddress'].'", - username="'.$_POST['username'].'", - password="'.$_POST['password'].'", - auth='.$_POST['auth']; + $sql="UPDATE emailsettings SET + host='".$_POST['host']."', + port='".$_POST['port']."', + heloaddress='".$_POST['heloaddress']."', + username='".$_POST['username']."', + password='".$_POST['password']."', + auth='".$_POST['auth']."'"; $result=DB_query($sql, $db); prnMsg(_('The settings for the SMTP server have been successfully updated'), 'success'); echo '<br>'; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-25 21:09:43 UTC (rev 3781) +++ trunk/doc/Change.log.html 2010-09-25 21:14:14 UTC (rev 3782) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>25/09/10 Tim: SMTPServer.php - SQL quoting corrections</p> <p>25/09/10 Tim: ShiptsList.php - Add script to show list of open shipments for selected supplier</p> <p>25/09/10 Tim: Shipt_Select.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> <p>25/09/10 Tim: Shippers.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-26 08:12:20
|
Revision: 3784 http://web-erp.svn.sourceforge.net/web-erp/?rev=3784&view=rev Author: tim_schofield Date: 2010-09-26 08:12:14 +0000 (Sun, 26 Sep 2010) Log Message: ----------- SQL quoting corrections Modified Paths: -------------- trunk/SpecialOrder.php trunk/doc/Change.log.html Modified: trunk/SpecialOrder.php =================================================================== --- trunk/SpecialOrder.php 2010-09-25 22:20:10 UTC (rev 3783) +++ trunk/SpecialOrder.php 2010-09-26 08:12:14 UTC (rev 3784) @@ -292,7 +292,7 @@ $sql = $sql . "'" . $_SESSION['SPL']->SupplierID . "', '" . $_SESSION['SPL']->Comments . "', '" . Date("Y-m-d") . "', - " . $_SESSION['SPL']->SuppCurrExRate . ", + '" . $_SESSION['SPL']->SuppCurrExRate . "', '" . $_SESSION['SPL']->Initiator . "', '" . $_SESSION['SPL']->QuotationRef . "', '" . $_SESSION['SPL']->StkLocation . "', @@ -312,8 +312,8 @@ /*Get the auto increment value of the order number created from the SQL above */ // $_SESSION['SPL']->PurchOrderNo = DB_Last_Insert_ID($db,'purchorders','orderno'); $_SESSION['SPL']->PurchOrderNo = GetNextTransNo(18, $db); - + /*Insert the purchase order detail records */ foreach ($_SESSION['SPL']->LineItems as $SPLLine) { @@ -350,7 +350,7 @@ '" . $SPLLine->StkCat . "', '" . $SPLLine->ItemDescription . "', '" . $SPLLine->ItemDescription . "', - " . $SPLLine->Cost . ")"; + '" . $SPLLine->Cost . "')"; $ErrMsg = _('The item record for line') . " " . $SPLLine->LineNo . " " . _('could not be create because'); @@ -381,14 +381,14 @@ glcode, unitprice, quantityord) - VALUES ("; - $sql = $sql . $_SESSION['SPL']->PurchOrderNo . ", + VALUES ('"; + $sql = $sql . $_SESSION['SPL']->PurchOrderNo . "', '" . $PartCode . "', '" . $OrderDate . "', '" . $SPLLine->ItemDescription . "', - " . $GLCode . ", - " . $SPLLine->Cost . ", - " . $SPLLine->Quantity . ")"; + '" . $GLCode . "', + '" . $SPLLine->Cost . "', + '" . $SPLLine->Quantity . "')"; $ErrMsg = _('One of the purchase order detail records could not be inserted into the database because'); $DbgMsg = _('The SQL statement used to insert the purchase order detail record and failed was'); @@ -442,12 +442,14 @@ contactemail, fromstkloc, deliverydate) - VALUES (".$OrderNo.",'" . $_SESSION['SPL']->CustomerID . "', + VALUES ( + '" . $OrderNo."', + '" . $_SESSION['SPL']->CustomerID . "', '" . $_SESSION['SPL']->BranchCode . "', - '". $_SESSION['SPL']->CustRef ."', + '" . $_SESSION['SPL']->CustRef ."', '" . Date("Y-m-d") . "', '" . $BranchDetails['salestype'] . "', - " . $BranchDetails['defaultshipvia'] .", + '" . $BranchDetails['defaultshipvia'] ."', '" . $BranchDetails['brname'] . "', '" . $BranchDetails['braddress1'] . "', '" . $BranchDetails['braddress2'] . "', @@ -465,19 +467,19 @@ // $SalesOrderNo = DB_Last_Insert_ID($db,'salesorders','orderno'); // $SalesOrderNo = GetNextTransNo(30, $db); - + $StartOf_LineItemsSQL = "INSERT INTO salesorderdetails (orderno, stkcode, unitprice, quantity, orderlineno) - VALUES (" . $OrderNo; + VALUES ('" . $OrderNo . "'"; $ErrMsg = _('There was a problem inserting a line into the sales order because'); foreach ($_SESSION['SPL']->LineItems as $StockItem) { - $LineItemsSQL = $StartOf_LineItemsSQL . ", '" . $StockItem->PartCode . "',". $StockItem->Price . ", " . $StockItem->Quantity . ", " . $StockItem->LineNo . ")"; + $LineItemsSQL = $StartOf_LineItemsSQL . "', '" . $StockItem->PartCode . "','". $StockItem->Price . "', '" . $StockItem->Quantity . "', '" . $StockItem->LineNo . "')"; $Ins_LineItemResult = DB_query($LineItemsSQL,$db,$ErrMsg); } /* inserted line items into sales order details */ @@ -654,4 +656,4 @@ echo '</div></form>'; include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-25 22:20:10 UTC (rev 3783) +++ trunk/doc/Change.log.html 2010-09-26 08:12:14 UTC (rev 3784) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>25/09/10 Tim: SpecialOrder.php - SQL quoting corrections</p> <p>25/09/10 Tim: SMTPServer.php - SQL quoting corrections</p> <p>25/09/10 Tim: ShiptsList.php - Add script to show list of open shipments for selected supplier</p> <p>25/09/10 Tim: Shipt_Select.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-26 09:57:46
|
Revision: 3785 http://web-erp.svn.sourceforge.net/web-erp/?rev=3785&view=rev Author: tim_schofield Date: 2010-09-26 09:57:39 +0000 (Sun, 26 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements and bug fixes Modified Paths: -------------- trunk/StockCategories.php trunk/doc/Change.log.html Modified: trunk/StockCategories.php =================================================================== --- trunk/StockCategories.php 2010-09-26 08:12:14 UTC (rev 3784) +++ trunk/StockCategories.php 2010-09-26 09:57:39 UTC (rev 3785) @@ -9,6 +9,9 @@ include('includes/header.inc'); +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . + _('Inventory Adjustment') . '" alt="">' . ' ' . $title . '</p>'; + if (isset($_GET['SelectedCategory'])){ $SelectedCategory = strtoupper($_GET['SelectedCategory']); } else if (isset($_POST['SelectedCategory'])){ @@ -18,9 +21,9 @@ if (isset($_GET['DeleteProperty'])){ $ErrMsg = _('Could not delete the property') . ' ' . $_GET['DeleteProperty'] . ' ' . _('because'); - $sql = "DELETE FROM stockitemproperties WHERE stkcatpropid=" . $_GET['DeleteProperty']; + $sql = "DELETE FROM stockitemproperties WHERE stkcatpropid='" . $_GET['DeleteProperty'] . "'"; $result = DB_query($sql,$db,$ErrMsg); - $sql = "DELETE FROM stockcatproperties WHERE stkcatpropid=" . $_GET['DeleteProperty']; + $sql = "DELETE FROM stockcatproperties WHERE stkcatpropid='" . $_GET['DeleteProperty'] . "'"; $result = DB_query($sql,$db,$ErrMsg); prnMsg(_('Deleted the property') . ' ' . $_GET['DeleteProperty'],'success'); } @@ -184,7 +187,7 @@ $sql = "SELECT * FROM stockcategory WHERE stocktype<>'".'A'."'"; $result = DB_query($sql,$db); - echo "<br><table border=1>\n"; + echo "<br><table class=selection>\n"; echo '<tr><th>' . _('Cat Code') . '</th> <th>' . _('Description') . '</th> <th>' . _('Type') . '</th> @@ -278,13 +281,13 @@ } echo '<input type=hidden name="SelectedCategory" value="' . $SelectedCategory . '">'; echo '<input type=hidden name="CategoryID" value="' . $_POST['CategoryID'] . '">'; - echo '<table><tr><td>' . _('Category Code') . ':</td><td>' . $_POST['CategoryID'] . '</td></tr>'; + echo '<table class=selection><tr><td>' . _('Category Code') . ':</td><td>' . $_POST['CategoryID'] . '</td></tr>'; } else { //end of if $SelectedCategory only do the else when a new record is being entered if (!isset($_POST['CategoryID'])) { $_POST['CategoryID'] = ''; } - echo '<table><tr><td>' . _('Category Code') . ':</td> + echo '<table class=selection><tr><td>' . _('Category Code') . ':</td> <td><input type="Text" name="CategoryID" size=7 maxlength=6 value="' . $_POST['CategoryID'] . '"></td></tr>'; } @@ -312,7 +315,7 @@ if (!isset($_POST['CategoryDescription'])) { $_POST['CategoryDescription'] = ''; } - + echo '<tr><td>' . _('Category Description') . ':</td> <td><input type="Text" name="CategoryDescription" size=22 maxlength=20 value="' . $_POST['CategoryDescription'] . '"></td></tr>'; @@ -341,7 +344,7 @@ } echo '</select></td></tr>'; - + echo '<input type="submit" name="UpdateTypes" style="visibility:hidden;width:1px" value="Not Seen">'; if (isset($_POST['StockType']) and $_POST['StockType']=='L') { $Result = $PnLAccountsResult; @@ -351,9 +354,9 @@ echo '<tr><td>' . _('Stock GL Code'); } echo ':</td><td><select name="StockAct">'; - + while ($myrow = DB_fetch_array($Result)){ - + if (isset($_POST['StockAct']) and $myrow['accountcode']==$_POST['StockAct']) { echo '<option selected value='; } else { @@ -368,7 +371,7 @@ echo '<tr><td>' . _('WIP GL Code') . ':</td><td><select name="WIPAct">'; while ($myrow = DB_fetch_array($BSAccountsResult)) { - + if (isset($_POST['WIPAct']) and $myrow['accountcode']==$_POST['WIPAct']) { echo '<option selected value='; } else { @@ -394,7 +397,7 @@ } //end while loop DB_data_seek($PnLAccountsResult,0); echo '</select></td></tr>'; - + echo '<tr><td>' . _('Price Variance GL Code') . ':</td> <td><select name="PurchPriceVarAct">'; @@ -429,8 +432,9 @@ DB_free_result($PnLAccountsResult); echo '</select></td></tr> </table>'; - - + if (!isset($SelectedCategory)) { + $SelectedCategory=''; + } if (isset($SelectedCategory)) { //editing an existing stock category @@ -448,7 +452,7 @@ /* echo '<br>Number of rows returned by the sql = ' . DB_num_rows($result) . '<br>The SQL was:<br>' . $sql; */ - echo '<hr><table>'; + echo '<br /><table class=selection>'; $TableHeader = '<tr><th>' . _('Property Label') . '</th> <th>' . _('Control Type') . '</th> <th>' . _('Default Value') . '</th> @@ -513,7 +517,7 @@ } /* end if there is a category selected */ - 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>'; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-26 08:12:14 UTC (rev 3784) +++ trunk/doc/Change.log.html 2010-09-26 09:57:39 UTC (rev 3785) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>25/09/10 Tim: StockCategories.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> <p>25/09/10 Tim: SpecialOrder.php - SQL quoting corrections</p> <p>25/09/10 Tim: SMTPServer.php - SQL quoting corrections</p> <p>25/09/10 Tim: ShiptsList.php - Add script to show list of open shipments for selected supplier</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-26 10:31:53
|
Revision: 3786 http://web-erp.svn.sourceforge.net/web-erp/?rev=3786&view=rev Author: tim_schofield Date: 2010-09-26 10:31:46 +0000 (Sun, 26 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements and bug fixes Modified Paths: -------------- trunk/StockCostUpdate.php trunk/doc/Change.log.html Modified: trunk/StockCostUpdate.php =================================================================== --- trunk/StockCostUpdate.php 2010-09-26 09:57:39 UTC (rev 3785) +++ trunk/StockCostUpdate.php 2010-09-26 10:31:46 UTC (rev 3786) @@ -19,6 +19,9 @@ echo "<a href='" . $rootpath . '/SelectProduct.php?' . SID . "'>" . _('Back to Items') . '</a><br>'; +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . + _('Inventory Adjustment') . '" alt="">' . ' ' . $title . '</p>'; + if (isset($_POST['UpdateData'])){ @@ -57,7 +60,7 @@ $OldCost =$_POST['OldMaterialCost'] + $_POST['OldLabourCost'] + $_POST['OldOverheadCost']; $NewCost =$_POST['MaterialCost'] + $_POST['LabourCost'] + $_POST['OverheadCost']; - $result = DB_query("SELECT * FROM stockmaster WHERE stockid='$StockID'",$db); + $result = DB_query("SELECT * FROM stockmaster WHERE stockid='".$StockID."'",$db); $myrow = DB_fetch_row($result); if (DB_num_rows($result)==0) { prnMsg (_('The entered item code does not exist'),'error',_('Non-existent Item')); @@ -68,10 +71,10 @@ $SQL = "UPDATE stockmaster SET - materialcost=" . $_POST['MaterialCost'] . ", - labourcost=" . $_POST['LabourCost'] . ", - overheadcost=" . $_POST['OverheadCost'] . ", - lastcost=" . $OldCost . " + materialcost='" . $_POST['MaterialCost'] . "', + labourcost='" . $_POST['LabourCost'] . "', + overheadcost='" . $_POST['OverheadCost'] . "', + lastcost='" . $OldCost . "' WHERE stockid='" . $StockID . "'"; $ErrMsg = _('The cost details for the stock item could not be updated because'); @@ -115,12 +118,14 @@ $myrow = DB_fetch_array($result); -echo "<br><div class='centre'><font color=BLUE size=3><b>" . $StockID . " - " . $myrow['description'] . '</b> - ' . _('Total Quantity On Hand') . ': ' . $myrow['totalqoh'] . " " . $myrow['units'] ."</font>"; echo "<form action='" . $_SERVER['PHP_SELF'] . "?". SID ."' method=post>"; -echo _('Item Code') . ":<input type=text name='StockID' value='$StockID' 1 maxlength=20>"; -echo " <input type=submit name='Show' VALUE='" . _('Show Cost Details') . "'></div><hr>"; +echo '<table cellpadding=2 class=selection>'; +echo "<tr><th colspan=2>"._('Item Code') . ":<input type=text name='StockID' value='$StockID' 1 maxlength=20>"; +echo "<input type=submit name='Show' VALUE='" . _('Show Cost Details') . "'></th></tr>"; +echo "<tr><th colspan=2><font color=navy size=2>" . $StockID . " - " . $myrow['description'] . '</font></th></tr>'; +echo "<tr><th colspan=2><font color=navy size=2>". _('Total Quantity On Hand') . ': ' . $myrow['totalqoh'] . " " . $myrow['units'] ."</font></th></tr>"; if (($myrow['mbflag']=='D' AND $myrow['stocktype'] != 'L') OR $myrow['mbflag']=='A' @@ -143,7 +148,6 @@ echo '<input type=hidden name=OldOverheadCost VALUE=' . $myrow['overheadcost'] .">"; echo '<input type=hidden name=QOH VALUE=' . $myrow['totalqoh'] .'>'; -echo '<table cellpadding=2 BORDER=2>'; echo '<tr><td>' . _('Last Cost') .':</td><td class=number>' . number_format($myrow['lastcost'],2) . '</td></tr>'; if (! in_array($UpdateSecurity,$_SESSION['AllowedPageSecurityTokens']) OR !isset($UpdateSecurity)){ echo '<tr><td>' . _('Cost') . ':</td><td class=number>' . number_format($myrow['materialcost']+$myrow['labourcost']+$myrow['overheadcost'],2) . '</td></tr></table>'; @@ -152,15 +156,15 @@ if ($myrow['mbflag']=='M'){ echo '<input type=hidden name="MaterialCost" VALUE=' . $myrow['materialcost'] . '>'; echo '<tr><td>' . _('Standard Material Cost Per Unit') .':</td><td class=number>' . number_format($myrow['materialcost'],4) . '</td></tr>'; - echo '<tr><td>' . _('Standard Labour Cost Per Unit') . ':</td><td><input type=TEXT class="number" name=LabourCost VALUE=' . $myrow['labourcost'] . '></td></tr>'; - echo '<tr><td>' . _('Standard Overhead Cost Per Unit') . ':</td><td><input type=TEXT class="number" name=OverheadCost VALUE=' . $myrow['overheadcost'] . '></td></tr>'; + echo '<tr><td>' . _('Standard Labour Cost Per Unit') . ':</td><td class=number><input type=TEXT class="number" name=LabourCost VALUE=' . $myrow['labourcost'] . '></td></tr>'; + echo '<tr><td>' . _('Standard Overhead Cost Per Unit') . ':</td><td class=number><input type=TEXT class="number" name=OverheadCost VALUE=' . $myrow['overheadcost'] . '></td></tr>'; } elseif ($myrow['mbflag']=='B' OR $myrow['mbflag']=='D') { - echo '<tr><td>' . _('Standard Cost') .':</td><td><input type=TEXT class="number" name="MaterialCost" VALUE=' . $myrow['materialcost'] . '></td></tr>'; + echo '<tr><td>' . _('Standard Cost') .':</td><td class=number><input type=TEXT class="number" name="MaterialCost" VALUE=' . $myrow['materialcost'] . '></td></tr>'; } else { echo '<input type=hidden name=LabourCost VALUE=0>'; echo '<input type=hidden name=OverheadCost VALUE=0>'; } - echo "</table><div class='centre'><input type=submit name='UpdateData' VALUE='" . _('Update') . "'><hr>"; + echo "</table><br /><div class='centre'><input type=submit name='UpdateData' VALUE='" . _('Update') . "'><br /><br />"; } if ($myrow['mbflag']!='D'){ echo "<a href='$rootpath/StockStatus.php?" . SID . "&StockID=$StockID'>" . _('Show Stock Status') . '</a>'; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-26 09:57:39 UTC (rev 3785) +++ trunk/doc/Change.log.html 2010-09-26 10:31:46 UTC (rev 3786) @@ -1,7 +1,8 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> -<p>25/09/10 Tim: StockCategories.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> -<p>25/09/10 Tim: SpecialOrder.php - SQL quoting corrections</p> +<p>26/09/10 Tim: StockCostUpdate.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> +<p>26/09/10 Tim: StockCategories.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> +<p>26/09/10 Tim: SpecialOrder.php - SQL quoting corrections</p> <p>25/09/10 Tim: SMTPServer.php - SQL quoting corrections</p> <p>25/09/10 Tim: ShiptsList.php - Add script to show list of open shipments for selected supplier</p> <p>25/09/10 Tim: Shipt_Select.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-26 15:26:52
|
Revision: 3787 http://web-erp.svn.sourceforge.net/web-erp/?rev=3787&view=rev Author: tim_schofield Date: 2010-09-26 15:26:44 +0000 (Sun, 26 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements and bug fixes Modified Paths: -------------- trunk/StockCounts.php trunk/doc/Change.log.html Modified: trunk/StockCounts.php =================================================================== --- trunk/StockCounts.php 2010-09-26 10:31:46 UTC (rev 3786) +++ trunk/StockCounts.php 2010-09-26 15:26:44 UTC (rev 3787) @@ -11,24 +11,27 @@ echo "<form action='" . $_SERVER['PHP_SELF'] . "' method=post>"; -echo "<br>"; +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . + _('Inventory Adjustment') . '" alt="">' . ' ' . $title . '</p>'; if (!isset($_POST['Action']) and !isset($_GET['Action'])) { $_GET['Action'] = 'Enter'; } -if (isset($_POST['Action'])) { - $_GET['Action'] = $_POST['Action']; +if (isset($_POST['Action'])) { + $_GET['Action'] = $_POST['Action']; } -if ($_GET['Action']!='View' and $_GET['Action']!='Enter'){ - $_GET['Action'] = 'Enter'; +if ($_GET['Action']!='View' and $_GET['Action']!='Enter'){ + $_GET['Action'] = 'Enter'; } +echo '<table class=selection><tr>'; if ($_GET['Action']=='View'){ - echo '<a href="' . $rootpath . '/StockCounts.php?' . SID . '&Action=Enter">' . _('Resuming Entering Counts') . '</a> <b>|</b>' . _('Viewing Entered Counts') . '<br><br>'; + echo '<td><a href="' . $rootpath . '/StockCounts.php?' . SID . '&Action=Enter">' . _('Resuming Entering Counts') . '</a> </td><td>' . _('Viewing Entered Counts') . '</td>'; } else { - echo _('Entering Counts') .'<b>|</b> <a href="' . $rootpath . '/StockCounts.php?' . SID . '&Action=View">' . _('View Entered Counts') . '</a><br><br>'; + echo '<td>'._('Entering Counts') .'</td><td> <a href="' . $rootpath . '/StockCounts.php?' . SID . '&Action=View">' . _('View Entered Counts') . '</a></td>'; } +echo '</tr></table><br />'; if ($_GET['Action'] == 'Enter'){ @@ -62,7 +65,7 @@ reference) VALUES ('" . $_POST[$StockID] . "', '" . $_POST['Location'] . "', - " . $_POST[$Quantity] . ", + '" . $_POST[$Quantity] . "', '" . $_POST[$Reference] . "')"; $ErrMsg = _('The stock count line number') . ' ' . $i . ' ' . _('could not be entered because'); @@ -74,7 +77,9 @@ unset($_POST['EnterCounts']); } // end of if enter counts button hit - echo _('Stock Check Counts at Location') . ":<select name='Location'>"; + + echo '<table cellpadding=2 class=selection>'; + echo '<tr><th colspan=3>'._('Stock Check Counts at Location') . ":<select name='Location'>"; $sql = 'SELECT loccode, locationname FROM locations'; $result = DB_query($sql,$db); @@ -86,9 +91,7 @@ echo "<option VALUE='" . $myrow['loccode'] . "'>" . $myrow['locationname']; } } - echo '</select><br><br>'; - - echo '<table cellpadding=2 BORDER=1>'; + echo '</select></th></tr>'; echo "<tr> <th>" . _('Stock Code') . "</th> <th>" . _('Quantity') . "</th> @@ -103,7 +106,7 @@ } - echo "</table><br><input type=submit name='EnterCounts' VALUE='" . _('Enter Above Counts') . "'>"; + echo "</table><br /><div class=centre><input type=submit name='EnterCounts' VALUE='" . _('Enter Above Counts') . "'></div>"; //END OF action=ENTER } elseif ($_GET['Action']=='View'){ @@ -111,19 +114,19 @@ if (isset($_POST['DEL']) && is_array($_POST['DEL']) ){ foreach ($_POST['DEL'] as $id=>$val){ if ($val == 'on'){ - $sql = "DELETE FROM stockcounts WHERE id=$id"; + $sql = "DELETE FROM stockcounts WHERE id='".$id."'"; $ErrMsg = _('Failed to delete StockCount ID #').' '.$i; $EnterResult = DB_query($sql, $db,$ErrMsg); prnMsg( _('Deleted Id #') . ' ' . $id, 'success'); } } } - + //START OF action=VIEW $SQL = "select * from stockcounts"; $result = DB_query($SQL, $db); echo '<input type=hidden name=Action Value="View">'; - echo '<table cellpadding=2 BORDER=1>'; + echo '<table cellpadding=2 class=selection>'; echo "<tr> <th>" . _('Stock Code') . "</th> <th>" . _('Location') . "</th> @@ -139,7 +142,7 @@ <td><input type=CHECKBOX name='DEL[" .$myrow['id']."]' maxlength=20 size=20></td></tr>"; } - echo "</table><br><input type=submit name='SubmitChanges' VALUE='" . _('Save Changes') . "'>"; + echo "</table><br><div class=centre><input type=submit name='SubmitChanges' VALUE='" . _('Save Changes') . "'></div>"; //END OF action=VIEW } Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-26 10:31:46 UTC (rev 3786) +++ trunk/doc/Change.log.html 2010-09-26 15:26:44 UTC (rev 3787) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>26/09/10 Tim: StockCounts.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> <p>26/09/10 Tim: StockCostUpdate.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> <p>26/09/10 Tim: StockCategories.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> <p>26/09/10 Tim: SpecialOrder.php - SQL quoting corrections</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-26 16:19:23
|
Revision: 3788 http://web-erp.svn.sourceforge.net/web-erp/?rev=3788&view=rev Author: tim_schofield Date: 2010-09-26 16:19:15 +0000 (Sun, 26 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements and bug fixes Modified Paths: -------------- trunk/StockDispatch.php trunk/doc/Change.log.html Modified: trunk/StockDispatch.php =================================================================== --- trunk/StockDispatch.php 2010-09-26 15:26:44 UTC (rev 3787) +++ trunk/StockDispatch.php 2010-09-26 16:19:15 UTC (rev 3788) @@ -1,7 +1,7 @@ <?php /* $Id$*/ // StockDispatch.php - Report of parts with overstock at one location that can be transferred -// to another location to cover shortage based on reorder level. Creates loctransfer records +// to another location to cover shortage based on reorder level. Creates loctransfer records // that can be processed using Bulk Inventory Transfer - Receive. @@ -11,9 +11,9 @@ If (isset($_POST['PrintPDF'])) { include('includes/PDFStarter.php'); - if (!is_numeric($_POST['Percent'])) { - $_POST['Percent'] = 0; - } + if (!is_numeric($_POST['Percent'])) { + $_POST['Percent'] = 0; + } $pdf->addInfo('Title',_('Stock Dispatch Report')); $pdf->addInfo('Subject',_('Parts to dispatch to another location to cover reorder level')); @@ -21,7 +21,7 @@ $PageNumber=1; $line_height=12; $Xpos = $Left_Margin+1; - + //tempate if($_POST['template']=='simple'){ $template='simple'; @@ -32,25 +32,26 @@ if(!isset($Trf_ID) && $_POST['ReportType'] == 'Batch'){ $Trf_ID = GetNextTransNo(16,$db); } - - + + // from location + $ErrMsg = _('Could not retrieve location name from the database'); $sqlfrom="SELECT locationname FROM `locations` where loccode='" . $_POST['FromLocation'] . "'"; $result = db_query($sqlfrom,$db,$ErrMsg); $Row = db_fetch_row($result); $FromLocation=$Row['0']; - + // to location $sqlto="SELECT locationname FROM `locations` where loccode='" . $_POST['ToLocation'] . "'"; $resultto = db_query($sqlto,$db,$ErrMsg); $RowTo = db_fetch_row($resultto); $ToLocation=$RowTo['0']; - + // Creates WHERE clause for stock categories. StockCat is defined as an array so can choose // more than one category $wherecategory = " "; if ($_POST['StockCat'] != 'All') { - $wherecategory = " AND stockmaster.categoryid ='" . $_POST['StockCat'] . "' "; + $wherecategory = " AND stockmaster.categoryid ='" . $_POST['StockCat'] . "' "; } @@ -63,52 +64,53 @@ stockmaster.serialised, stockmaster.controlled, ROUND((locstock.reorderlevel - locstock.quantity) * - (1 + (' . $_POST['Percent'] . '/100))) - as neededqty, - (fromlocstock.quantity - fromlocstock.reorderlevel) as available, - fromlocstock.reorderlevel as fromreorderlevel, - fromlocstock.quantity as fromquantity - FROM stockmaster, + (1 + (' . $_POST['Percent'] . '/100))) + as neededqty, + (fromlocstock.quantity - fromlocstock.reorderlevel) as available, + fromlocstock.reorderlevel as fromreorderlevel, + fromlocstock.quantity as fromquantity + FROM stockmaster, locstock - LEFT JOIN locstock AS fromlocstock ON + LEFT JOIN locstock AS fromlocstock ON locstock.stockid = fromlocstock.stockid AND fromlocstock.loccode = "' . $_POST['FromLocation'] . '" - WHERE locstock.stockid=stockmaster.stockid - AND locstock.loccode ="' . $_POST['ToLocation'] . '" + WHERE locstock.stockid=stockmaster.stockid + AND locstock.loccode ="' . $_POST['ToLocation'] . '" AND locstock.reorderlevel > locstock.quantity AND (fromlocstock.quantity - fromlocstock.reorderlevel) > 0 AND (stockmaster.mbflag="B" OR stockmaster.mbflag="M") ' . $wherecategory . ' ORDER BY locstock.loccode,locstock.stockid'; - + $result = DB_query($sql,$db,'','',false,true); - + if (DB_error_no($db) !=0) { $title = _('Stock Dispatch - Problem Report'); include('includes/header.inc'); prnMsg( _('The Stock Dispatch report could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); echo "<br><a href='" .$rootpath .'/index.php?' . SID . "'>" . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br>$sql"; + echo "<br>$sql"; } include('includes/footer.inc'); exit; } if (DB_num_rows($result) ==0) { - $title = _('Stock Dispatch - Problem Report'); - include('includes/header.inc'); - prnMsg( _('The stock dispatch did not have any items to list'),'error'); - echo "<br><a href='" .$rootpath .'/index.php?' . SID . "'>" . _('Back to the menu') . '</a>'; - include('includes/footer.inc'); - exit; + $title = _('Stock Dispatch - Problem Report'); + include('includes/header.inc'); + echo '<br />'; + prnMsg( _('The stock dispatch did not have any items to list'),'warn'); + echo "<br><a href='" .$rootpath .'/index.php?' . SID . "'>" . _('Back to the menu') . '</a>'; + include('includes/footer.inc'); + exit; } PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin, - $Page_Width,$Right_Margin,$Trf_ID,$FromLocation,$ToLocation,$template); + $Page_Width,$Right_Margin,$Trf_ID,$FromLocation,$ToLocation,$template); - $FontSize=8; - - While ($myrow = DB_fetch_array($result,$db)){ + $FontSize=8; + + while ($myrow = DB_fetch_array($result,$db)){ $YPos -=(2 * $line_height); // Parameters for addTextWrap are defined in /includes/class.pdf.php // 1) X position 2) Y position 3) Width @@ -119,42 +121,42 @@ $pdf->addTextWrap(50,$YPos,70,$FontSize,$myrow['stockid'],'',0,$fill); $pdf->addTextWrap(135,$YPos,250,$FontSize,$myrow['description'],'',0,$fill); $pdf->addTextWrap(380,$YPos,45,$FontSize,number_format($myrow['fromquantity'], - $myrow['decimalplaces']),'right',0,$fill); + $myrow['decimalplaces']),'right',0,$fill); $pdf->addTextWrap(425,$YPos,40,$FontSize,number_format($myrow['quantity'], - $myrow['decimalplaces']),'right',0,$fill); + $myrow['decimalplaces']),'right',0,$fill); $shipqty = $myrow['available']; if ($myrow['neededqty'] < $myrow['available']) { - $shipqty = $myrow['neededqty']; + $shipqty = $myrow['neededqty']; } - $pdf->addTextWrap(465,$YPos,40,11,number_format($shipqty, - $myrow['decimalplaces']),'right',0,$fill); - $pdf->addTextWrap(510,$YPos,40,$FontSize,'_________','right',0,$fill); + $pdf->addTextWrap(465,$YPos,40,11,number_format($shipqty, + $myrow['decimalplaces']),'right',0,$fill); + $pdf->addTextWrap(510,$YPos,40,$FontSize,'_________','right',0,$fill); }else{ //for standard template $pdf->addTextWrap(50,$YPos,70,$FontSize,$myrow['stockid'],'',0,$fill); $pdf->addTextWrap(135,$YPos,200,$FontSize,$myrow['description'],'',0,$fill); $pdf->addTextWrap(305,$YPos,40,$FontSize,number_format($myrow['fromquantity'], - $myrow['decimalplaces']),'right',0,$fill); + $myrow['decimalplaces']),'right',0,$fill); $pdf->addTextWrap(345,$YPos,40,$FontSize,number_format($myrow['fromreorderlevel'], - $myrow['decimalplaces']),'right',0,$fill); + $myrow['decimalplaces']),'right',0,$fill); $pdf->addTextWrap(380,$YPos,40,$FontSize,number_format($myrow['quantity'], - $myrow['decimalplaces']),'right',0,$fill); + $myrow['decimalplaces']),'right',0,$fill); $pdf->addTextWrap(420,$YPos,40,$FontSize,number_format($myrow['reorderlevel'], - $myrow['decimalplaces']),'right',0,$fill); + $myrow['decimalplaces']),'right',0,$fill); $shipqty = $myrow['available']; if ($myrow['neededqty'] < $myrow['available']) { - $shipqty = $myrow['neededqty']; + $shipqty = $myrow['neededqty']; } - $pdf->addTextWrap(460,$YPos,40,11,number_format($shipqty, - $myrow['decimalplaces']),'right',0,$fill); - $pdf->addTextWrap(510,$YPos,40,$FontSize,'_________','right',0,$fill); + $pdf->addTextWrap(460,$YPos,40,11,number_format($shipqty, + $myrow['decimalplaces']),'right',0,$fill); + $pdf->addTextWrap(510,$YPos,40,$FontSize,'_________','right',0,$fill); } - + if ($YPos < $Bottom_Margin + $line_height + 200){ - + PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, - $Right_Margin,$Trf_ID,$FromLocation,$ToLocation,$template); + $Right_Margin,$Trf_ID,$FromLocation,$ToLocation,$template); } // Create loctransfers records for each record @@ -171,13 +173,13 @@ '" . $_POST['FromLocation'] ."', '" . $_POST['ToLocation'] . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('Unable to enter Location Transfer record for'). ' '.$_POST['StockID' . $i]; - if ($_POST['ReportType'] == 'Batch') { - $resultLocShip = DB_query($sql2,$db, $ErrMsg); + if ($_POST['ReportType'] == 'Batch') { + $resultLocShip = DB_query($sql2,$db, $ErrMsg); } } /*end while loop */ //add prepared by - $pdf->addTextWrap(50,$YPos-50,100,9,_('Prepared By :'), 'left'); + $pdf->addTextWrap(50,$YPos-50,100,9,_('Prepared By :'), 'left'); $pdf->addTextWrap(50,$YPos-70,100,$FontSize,_('Name'), 'left'); $pdf->addTextWrap(90,$YPos-70,200,$FontSize,':__________________','left',0,$fill); $pdf->addTextWrap(50,$YPos-90,100,$FontSize,_('Date'), 'left'); @@ -186,10 +188,10 @@ $pdf->addTextWrap(90,$YPos-110,200,$FontSize,':__________________','left',0,$fill); $pdf->addTextWrap(50,$YPos-150,100,$FontSize,_('Signature'), 'left'); $pdf->addTextWrap(90,$YPos-150,200,$FontSize,':__________________','left',0,$fill); - - + + //add received by - $pdf->addTextWrap(390,$YPos-50,100,9,_('Received By :'), 'left'); + $pdf->addTextWrap(390,$YPos-50,100,9,_('Received By :'), 'left'); $pdf->addTextWrap(390,$YPos-70,100,$FontSize,_('Name'), 'left'); $pdf->addTextWrap(430,$YPos-70,200,$FontSize,':__________________','left',0,$fill); $pdf->addTextWrap(390,$YPos-90,100,$FontSize,_('Date'), 'left'); @@ -198,32 +200,39 @@ $pdf->addTextWrap(430,$YPos-110,200,$FontSize,':__________________','left',0,$fill); $pdf->addTextWrap(390,$YPos-150,100,$FontSize,_('Signature'), 'left'); $pdf->addTextWrap(430,$YPos-150,200,$FontSize,':__________________','left',0,$fill); - + if ($YPos < $Bottom_Margin + $line_height){ - PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, - $Right_Margin,$Trf_ID,$FromLocation,$ToLocation,$template); + PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, + $Right_Margin,$Trf_ID,$FromLocation,$ToLocation,$template); } /*Print out the grand totals */ $pdf->OutputD($_SESSION['DatabaseName'] . '_Stock_Transfer_Dispatch_' . Date('Y-m-d') . '.pdf'); $pdf->__destruct(); - + } else { /*The option to print PDF was not hit so display form */ $title=_('Stock Dispatch Report'); include('includes/header.inc'); -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . '" alt="">' . ' ' . _('Inventory Stock Dispatch Report') . ''; -echo '<div class="page_help_text">' . _('Create batch of overstock from one location to transfer to another location that is below reorder level.<br/> - Quantity to ship is based on reorder level minus the quantity on hand at the To Location; if there is a<br/> - dispatch percentage entered, that needed quantity is inflated by the percentage entered.<br/> - Use Bulk Inventory Transfer - Receive to process the batch') . '</div><br>'; + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . '" alt="">' . ' ' . _('Inventory Stock Dispatch Report') . ''; + echo '<div class="page_help_text">' . _('Create batch of overstock from one location to transfer to another location that is below reorder level.<br/> + Quantity to ship is based on reorder level minus the quantity on hand at the To Location; if there is a<br/> + dispatch percentage entered, that needed quantity is inflated by the percentage entered.<br/> + Use Bulk Inventory Transfer - Receive to process the batch') . '</div>'; - echo '<br/><br/><form action=' . $_SERVER['PHP_SELF'] . " method='post'><table>"; + $sql = "SELECT defaultlocation FROM www_users WHERE userid='".$_SESSION['UserID']."'"; + $result = DB_query($sql, $db); + $myrow = DB_fetch_array($result); + $DefaultLocation = $myrow['defaultlocation']; + echo '<br/><form action=' . $_SERVER['PHP_SELF'] . " method='post'><table class=selection>"; $sql = "SELECT loccode, locationname FROM locations"; $resultStkLocs = DB_query($sql,$db); - echo '<table><tr><td>' . _('Dispatch Percent') . ":</td><td><input type ='text' name='Percent' size='8'>"; + if (!isset($_POST['FromLocation'])) { + $_POST['FromLocation']=$DefaultLocation; + } + echo '<table class=selection><tr><td>' . _('Dispatch Percent') . ":</td><td><input type ='text' name='Percent' class=number size='8' value=0>"; echo '<tr><td>' . _('From Stock Location') . ':</td><td><select name="FromLocation"> '; while ($myrow=DB_fetch_array($resultStkLocs)){ if ($myrow['loccode'] == $_POST['FromLocation']){ @@ -231,9 +240,12 @@ } else { echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; } - } + } echo '</select></td></tr>'; DB_data_seek($resultStkLocs,0); + if (!isset($_POST['ToLocation'])) { + $_POST['ToLocation']=$DefaultLocation; + } echo '<tr><td>' . _('To Stock Location') . ':</td><td><select name="ToLocation"> '; while ($myrow=DB_fetch_array($resultStkLocs)){ if ($myrow['loccode'] == $_POST['ToLocation']){ @@ -241,9 +253,9 @@ } else { echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; } - } + } echo '</select></td></tr>'; - + $SQL='SELECT categoryid, categorydescription FROM stockcategory ORDER BY categorydescription'; $result1 = DB_query($SQL,$db); if (DB_num_rows($result1)==0){ @@ -255,10 +267,10 @@ include ('includes/footer.inc'); exit; } - + // Define StockCat with 'name="StockCat[ ]" multiple' so can select more than one // Also have to change way define $wherecategory for WHERE clause - + echo '<tr><td>' . _('In Stock Category') . ':</td><td><select name="StockCat">'; if (!isset($_POST['StockCat'])){ $_POST['StockCat']='All'; @@ -276,22 +288,22 @@ } } echo '</select></td></tr>'; - + echo '<tr></tr><tr></tr><tr><td>' . _('Report Type') . ':</td>'; - echo "<td><select name='ReportType'>"; + echo "<td><select name='ReportType'>"; echo "<option selected value='Batch'>" . _('Create Batch'); echo "<option value='Report'>" . _('Report Only'); echo '</select></td><td> </td></tr>'; - - + + echo '<tr><td>' . _('Template') . ':</td>'; - echo "<td><select name='template'>"; + echo "<td><select name='template'>"; echo "<option selected value='standard'>" . _('Standard'); echo "<option value='simple'>" . _('Simple'); echo '</select></td><td> </td></tr>'; - - echo "</table><br/><br/><br/><div class='centre'><input type=submit name='PrintPDF' value='" . _('Print PDF') . "'></div>"; + echo "</table><br/><div class='centre'><input type=submit name='PrintPDF' value='" . _('Print PDF') . "'></div>"; + include('includes/footer.inc'); } /*end of else not PrintPDF */ @@ -299,7 +311,7 @@ function PrintHeader(&$pdf,&$YPos,&$PageNumber,$Page_Height,$Top_Margin,$Left_Margin, - $Page_Width,$Right_Margin,$Trf_ID,$FromLocation,$ToLocation,$template) { + $Page_Width,$Right_Margin,$Trf_ID,$FromLocation,$ToLocation,$template) { /*PDF page header for Stock Dispatch report */ @@ -310,20 +322,20 @@ $FontSize=9; $YPos= $Page_Height-$Top_Margin; $YPos -=(3*$line_height); - + $pdf->addTextWrap($Left_Margin,$YPos,300,$FontSize,$_SESSION['CompanyRecord']['coyname']); $YPos -=$line_height; - + $pdf->addTextWrap($Left_Margin,$YPos,150,$FontSize,_('Stock Dispatch ') . $_POST['ReportType']); $pdf->addTextWrap(200,$YPos,50,$FontSize,_('From :')); $pdf->addTextWrap(250,$YPos,200,$FontSize,$FromLocation); - - $pdf->addTextWrap($Page_Width-$Right_Margin-150,$YPos,160,$FontSize,_('Printed') . ': ' . + + $pdf->addTextWrap($Page_Width-$Right_Margin-150,$YPos,160,$FontSize,_('Printed') . ': ' . Date($_SESSION['DefaultDateFormat']) . ' ' . _('Page') . ' ' . $PageNumber,'left'); $YPos -= $line_height; $pdf->addTextWrap($Left_Margin,$YPos,50,$FontSize,_('Transfer No.')); $pdf->addTextWrap(95,$YPos,50,$FontSize,$Trf_ID); - $pdf->addTextWrap(200,$YPos,20,$FontSize,_('To :')); + $pdf->addTextWrap(200,$YPos,20,$FontSize,_('To :')); $pdf->addTextWrap(250,$YPos,200,$FontSize,$ToLocation); $YPos -= $line_height; $pdf->addTextWrap($Left_Margin,$YPos,50,$FontSize,_('Category')); @@ -332,10 +344,10 @@ $YPos -= $line_height; $pdf->addTextWrap($Left_Margin,$YPos,50,$FontSize,_('Percent')); $pdf->addTextWrap(95,$YPos,50,$FontSize,$_POST['Percent']); - $YPos -=(2*$line_height); + $YPos -=(2*$line_height); /*set up the headings */ $Xpos = $Left_Margin+1; - + if($template=='simple'){ $pdf->addTextWrap(50,$YPos,100,$FontSize,_('Part Number'), 'left'); $pdf->addTextWrap(135,$YPos,220,$FontSize,_('Description'), 'left'); @@ -351,13 +363,13 @@ $pdf->addTextWrap(460,$YPos,40,$FontSize,_('Shipped'), 'right'); $pdf->addTextWrap(510,$YPos,40,$FontSize,_('Received'), 'right'); $YPos -= $line_height; - $pdf->addTextWrap(305,$YPos,40,$FontSize,_('QOH'), 'right'); - $pdf->addTextWrap(345,$YPos,40,$FontSize,_('Reord'), 'right'); - $pdf->addTextWrap(380,$YPos,40,$FontSize,_('QOH'), 'right'); - $pdf->addTextWrap(420,$YPos,40,$FontSize,_('Reord'), 'right'); - + $pdf->addTextWrap(305,$YPos,40,$FontSize,_('QOH'), 'right'); + $pdf->addTextWrap(345,$YPos,40,$FontSize,_('Reord'), 'right'); + $pdf->addTextWrap(380,$YPos,40,$FontSize,_('QOH'), 'right'); + $pdf->addTextWrap(420,$YPos,40,$FontSize,_('Reord'), 'right'); + } - + $FontSize=8; $PageNumber++; } // End of PrintHeader() function Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-26 15:26:44 UTC (rev 3787) +++ trunk/doc/Change.log.html 2010-09-26 16:19:15 UTC (rev 3788) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>26/09/10 Tim: StockDispatch.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> <p>26/09/10 Tim: StockCounts.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> <p>26/09/10 Tim: StockCostUpdate.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> <p>26/09/10 Tim: StockCategories.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-26 18:15:22
|
Revision: 3789 http://web-erp.svn.sourceforge.net/web-erp/?rev=3789&view=rev Author: tim_schofield Date: 2010-09-26 18:15:16 +0000 (Sun, 26 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements and bug fixes Modified Paths: -------------- trunk/StockLocStatus.php trunk/doc/Change.log.html Modified: trunk/StockLocStatus.php =================================================================== --- trunk/StockLocStatus.php 2010-09-26 16:19:15 UTC (rev 3788) +++ trunk/StockLocStatus.php 2010-09-26 18:15:16 UTC (rev 3789) @@ -111,7 +111,7 @@ stockmaster, locations WHERE locstock.stockid=stockmaster.stockid - AND locstock.loccode = '$_POST[StockLocation]' + AND locstock.loccode = '".$_POST['StockLocation']."' AND locstock.loccode=locations.loccode AND (stockmaster.mbflag='B' OR stockmaster.mbflag='M') ORDER BY locstock.stockid"; @@ -129,7 +129,7 @@ stockmaster, locations WHERE locstock.stockid=stockmaster.stockid - AND locstock.loccode = '$_POST[StockLocation]' + AND locstock.loccode = '" . $_POST['StockLocation'] . "' AND locstock.loccode=locations.loccode AND (stockmaster.mbflag='B' OR stockmaster.mbflag='M') AND stockmaster.categoryid='" . $_POST['StockCat'] . "' Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-26 16:19:15 UTC (rev 3788) +++ trunk/doc/Change.log.html 2010-09-26 18:15:16 UTC (rev 3789) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>26/09/10 Tim: StockLocStatus.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> <p>26/09/10 Tim: StockDispatch.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> <p>26/09/10 Tim: StockCounts.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> <p>26/09/10 Tim: StockCostUpdate.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-26 18:50:26
|
Revision: 3790 http://web-erp.svn.sourceforge.net/web-erp/?rev=3790&view=rev Author: tim_schofield Date: 2010-09-26 18:50:20 +0000 (Sun, 26 Sep 2010) Log Message: ----------- Layout changes and improvements Modified Paths: -------------- trunk/StockMovements.php trunk/doc/Change.log.html Modified: trunk/StockMovements.php =================================================================== --- trunk/StockMovements.php 2010-09-26 18:15:16 UTC (rev 3789) +++ trunk/StockMovements.php 2010-09-26 18:50:20 UTC (rev 3790) @@ -21,13 +21,21 @@ // This is already linked from this page //echo "<a href='" . $rootpath . '/SelectProduct.php?' . SID . "'>" . _('Back to Items') . '</a><br>'; -$result = DB_query("SELECT description, units FROM stockmaster WHERE stockid='$StockID'",$db); +$result = DB_query("SELECT description, units FROM stockmaster WHERE stockid='".$StockID."'",$db); $myrow = DB_fetch_row($result); -echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . '" alt=""><b>' . ' ' . $StockID . ' - ' . $myrow['0'] . ' : ' . _('in units of') . ' : ' . $myrow[1] . ''; +echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . '" alt=""><b>' . ' ' . $StockID . ' - ' . $myrow['0'] . ' : ' . _('in units of') . ' : ' . $myrow[1] . '</p>'; -echo "<div class='centre'><form action='". $_SERVER['PHP_SELF'] . "?" . SID . "' method=post>"; -echo _('Stock Code') . ":<input type=TEXT name='StockID' size=21 VALUE='$StockID' maxlength=20>"; +echo "<form action='". $_SERVER['PHP_SELF'] . "?" . SID . "' method=post>"; +if (!isset($_POST['BeforeDate']) OR !Is_Date($_POST['BeforeDate'])){ + $_POST['BeforeDate'] = Date($_SESSION['DefaultDateFormat']); +} +if (!isset($_POST['AfterDate']) OR !Is_Date($_POST['AfterDate'])){ + $_POST['AfterDate'] = Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date("m")-3,Date("d"),Date("y"))); +} +echo '<br /><table cellpadding=2 class=selection>'; +echo '<tr><th colspan=10>' . _('Stock Code') . ":<input type=TEXT name='StockID' size=21 VALUE='$StockID' maxlength=20>"; + echo ' ' . _('From Stock Location') . ":<select name='StockLocation'> "; $sql = 'SELECT loccode, locationname FROM locations'; @@ -48,18 +56,10 @@ } } -echo '</select><br>'; - -if (!isset($_POST['BeforeDate']) OR !Is_Date($_POST['BeforeDate'])){ - $_POST['BeforeDate'] = Date($_SESSION['DefaultDateFormat']); -} -if (!isset($_POST['AfterDate']) OR !Is_Date($_POST['AfterDate'])){ - $_POST['AfterDate'] = Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date("m")-3,Date("d"),Date("y"))); -} -echo ' ' . _('Show Movements before') . ': <input type=TEXT name="BeforeDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" size="12" maxlength="12" VALUE="' . $_POST['BeforeDate'] . '">'; +echo '</select></th></tr>'; +echo '<tr><th colspan=10>' . _('Show Movements before') . ': <input type=text name="BeforeDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" size="12" maxlength="12" VALUE="' . $_POST['BeforeDate'] . '">'; echo ' ' . _('But after') . ': <input type=TEXT name="AfterDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" size="12" maxlength="12" VALUE="' . $_POST['AfterDate'] . '">'; -echo " <input type=submit name='ShowMoves' VALUE='" . _('Show Stock Movements') . "'>"; -echo '<hr>'; +echo " <input type=submit name='ShowMoves' VALUE='" . _('Show Stock Movements') . "'></th></tr>"; $SQLBeforeDate = FormatDateForSQL($_POST['BeforeDate']); $SQLAfterDate = FormatDateForSQL($_POST['AfterDate']); @@ -92,7 +92,6 @@ $MovtsResult = DB_query($sql, $db, $ErrMsg, $DbgMsg); -echo '<table cellpadding=2 BORDER=0>'; $tableheader = "<tr> <th>" . _('Type') . "</th><th>" . _('Number') . "</th> <th>" . _('Date') . "</th><th>" . _('Customer') . "</th> @@ -200,8 +199,8 @@ } //end of while loop -echo '</table><hr>'; -echo "<a href='$rootpath/StockStatus.php?" . SID . "&StockID=$StockID'>" . _('Show Stock Status') . '</a>'; +echo '</table>'; +echo "<div class=centre><br /><a href='$rootpath/StockStatus.php?" . SID . "&StockID=$StockID'>" . _('Show Stock Status') . '</a>'; echo "<br><a href='$rootpath/StockUsage.php?" . SID . "&StockID=$StockID&StockLocation=" . $_POST['StockLocation'] . "'>" . _('Show Stock Usage') . '</a>'; echo "<br><a href='$rootpath/SelectSalesOrder.php?" . SID . "&SelectedStockItem=$StockID&StockLocation=" . $_POST['StockLocation'] . "'>" . _('Search Outstanding Sales Orders') . '</a>'; echo "<br><a href='$rootpath/SelectCompletedOrder.php?" . SID . "&SelectedStockItem=$StockID'>" . _('Search Completed Sales Orders') . '</a>'; @@ -210,4 +209,4 @@ include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-26 18:15:16 UTC (rev 3789) +++ trunk/doc/Change.log.html 2010-09-26 18:50:20 UTC (rev 3790) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>26/09/10 Tim: StockMovements.php - Layout changes and improvements</p> <p>26/09/10 Tim: StockLocStatus.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> <p>26/09/10 Tim: StockDispatch.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> <p>26/09/10 Tim: StockCounts.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-26 18:56:52
|
Revision: 3791 http://web-erp.svn.sourceforge.net/web-erp/?rev=3791&view=rev Author: tim_schofield Date: 2010-09-26 18:56:46 +0000 (Sun, 26 Sep 2010) Log Message: ----------- Layout changes and improvements Modified Paths: -------------- trunk/StockQties_csv.php trunk/doc/Change.log.html Modified: trunk/StockQties_csv.php =================================================================== --- trunk/StockQties_csv.php 2010-09-26 18:50:20 UTC (rev 3790) +++ trunk/StockQties_csv.php 2010-09-26 18:56:46 UTC (rev 3791) @@ -7,11 +7,14 @@ $title = _('Produce Stock Quantities CSV'); include ('includes/header.inc'); +echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . +'" alt=""><b>' . $title. '</p>'; + function stripcomma($str) { //because we're using comma as a delimiter return str_replace(",", "", $str); } -echo '<p>' . _('Making a comma separated values file of the current stock quantities'); +echo '<div class=centre>' . _('Making a comma separated values file of the current stock quantities'); $ErrMsg = _('The SQL to get the stock quantities failed with the message'); @@ -27,7 +30,7 @@ $fp = fopen($filename,"w"); if ($fp==FALSE){ - + prnMsg(_('Could not open or create the file under') . ' ' . $_SESSION['reports_dir'] . '/StockQties.csv','error'); include('includes/footer.inc'); exit; @@ -40,7 +43,7 @@ fclose($fp); -echo "<p><a href='" . $rootpath . '/' . $_SESSION['reports_dir'] . "/StockQties.csv'>" . _('click here') . '</a> ' . _('to view the file') . '<br>'; +echo "<br /><a href='" . $rootpath . '/' . $_SESSION['reports_dir'] . "/StockQties.csv'>" . _('click here') . '</a> ' . _('to view the file') . '</div>'; include('includes/footer.inc'); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-26 18:50:20 UTC (rev 3790) +++ trunk/doc/Change.log.html 2010-09-26 18:56:46 UTC (rev 3791) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>26/09/10 Tim: StockQties_csv.php - Layout changes and improvements</p> <p>26/09/10 Tim: StockMovements.php - Layout changes and improvements</p> <p>26/09/10 Tim: StockLocStatus.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> <p>26/09/10 Tim: StockDispatch.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-26 19:09:01
|
Revision: 3792 http://web-erp.svn.sourceforge.net/web-erp/?rev=3792&view=rev Author: tim_schofield Date: 2010-09-26 19:08:55 +0000 (Sun, 26 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements Modified Paths: -------------- trunk/StockQuantityByDate.php trunk/doc/Change.log.html Modified: trunk/StockQuantityByDate.php =================================================================== --- trunk/StockQuantityByDate.php 2010-09-26 18:56:46 UTC (rev 3791) +++ trunk/StockQuantityByDate.php 2010-09-26 19:08:55 UTC (rev 3792) @@ -10,12 +10,15 @@ $title = _('Stock On Hand By Date'); include('includes/header.inc'); -echo "<hr><form action='" . $_SERVER['PHP_SELF'] . "?". SID . "' method=post>"; +echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . +'" alt=""><b>' . $title. '</p>'; +echo "<form action='" . $_SERVER['PHP_SELF'] . "?". SID . "' method=post>"; + $sql = 'SELECT categoryid, categorydescription FROM stockcategory'; $resultStkLocs = DB_query($sql, $db); -echo '<table><tr>'; +echo '<table class=selection><tr>'; echo '<td>' . _('For Stock Category') . ":</td> <td><select name='StockCategory'> "; @@ -61,7 +64,7 @@ echo '<td>' . _("On-Hand On Date") . ":</td> <td><input type=TEXT class='date' alt='".$_SESSION['DefaultDateFormat']."' name='OnHandDate' size=12 maxlength=12 VALUE='" . $_POST['OnHandDate'] . "'></td></tr>"; echo "<tr><td colspan=6><div class='centre'><input type=submit name='ShowStatus' VALUE='" . _('Show Stock Status') ."'></div></td></tr></table>"; -echo '</form><hr>'; +echo '</form>'; $TotalQuantity = 0; @@ -81,7 +84,7 @@ $SQLOnHandDate = FormatDateForSQL($_POST['OnHandDate']); - echo '<table cellpadding=5 cellspacing=4 border=0>'; + echo '<br /><table cellpadding=5 cellspacing=1 class=selection>'; $tableheader = "<tr> <th>" . _('Item Code') . "</th> @@ -94,9 +97,9 @@ $sql = "SELECT stockid, newqoh FROM stockmoves - WHERE stockmoves.trandate <= '". $SQLOnHandDate . "' - AND stockid = '" . $myrows['stockid'] . "' - AND loccode = '" . $_POST['StockLocation'] ."' + WHERE stockmoves.trandate <= '". $SQLOnHandDate . "' + AND stockid = '" . $myrows['stockid'] . "' + AND loccode = '" . $_POST['StockLocation'] ."' ORDER BY stkmoveno DESC LIMIT 1"; $ErrMsg = _('The stock held as at') . ' ' . $_POST['OnHandDate'] . ' ' . _('could not be retrieved because'); @@ -150,4 +153,4 @@ } include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-26 18:56:46 UTC (rev 3791) +++ trunk/doc/Change.log.html 2010-09-26 19:08:55 UTC (rev 3792) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>26/09/10 Tim: StockQuantityByDate.php - SQL quoting corrections and layout changes and improvements</p> <p>26/09/10 Tim: StockQties_csv.php - Layout changes and improvements</p> <p>26/09/10 Tim: StockMovements.php - Layout changes and improvements</p> <p>26/09/10 Tim: StockLocStatus.php - SQL quoting corrections and layout changes and improvements and bug fixes</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-26 19:23:50
|
Revision: 3793 http://web-erp.svn.sourceforge.net/web-erp/?rev=3793&view=rev Author: tim_schofield Date: 2010-09-26 19:23:44 +0000 (Sun, 26 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements Modified Paths: -------------- trunk/StockReorderLevel.php trunk/doc/Change.log.html Modified: trunk/StockReorderLevel.php =================================================================== --- trunk/StockReorderLevel.php 2010-09-26 19:08:55 UTC (rev 3792) +++ trunk/StockReorderLevel.php 2010-09-26 19:23:44 UTC (rev 3793) @@ -14,16 +14,15 @@ $StockID = trim(strtoupper($_POST['StockID'])); } +echo "<a href='" . $rootpath . '/SelectProduct.php?' . SID . "'>" . _('Back to Items') . '</a>'; -echo "<a href='" . $rootpath . '/SelectProduct.php?' . SID . "'>" . _('Back to Items') . '</a><br>'; +echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . +'" alt=""><b>' . $title. '</p>'; $result = DB_query("SELECT description, units FROM stockmaster WHERE stockid='$StockID'", $db); $myrow = DB_fetch_row($result); -echo '<div class="centre"><br><font color=BLUE size=3><b>' . $StockID . ' - ' . $myrow[0] . '</b> (' . _('In Units of') . ' ' . $myrow[1] . ')</font>'; echo "<form action='" . $_SERVER['PHP_SELF'] . "?" . SID . "' method=post>"; -echo _('Stock Code') . ":<input type=TEXT name='StockID' size=21 VALUE='$StockID' maxlength=20>"; -echo " <input type=submit name='Show' VALUE='" . _('Show Re-Order Levels') . "'><hr></div>"; $sql = "SELECT locstock.loccode, locations.locationname, @@ -40,7 +39,10 @@ $LocStockResult = DB_query($sql, $db, $ErrMsg, $DbgMsg); -echo "<table cellpadding=2 BORDER=2>"; +echo "<table cellpadding=2 class=selection>"; +echo '<tr><th colspan=3'._('Stock Code') . ":<input type=TEXT name='StockID' size=21 VALUE='$StockID' maxlength=20>"; +echo " <input type=submit name='Show' VALUE='" . _('Show Re-Order Levels') . "'></th></tr>"; +echo '<tr><th colspan=3><font color=BLUE size=3><b>' . $StockID . ' - ' . $myrow[0] . '</b> (' . _('In Units of') . ' ' . $myrow[1] . ')</font></th></tr>'; $TableHeader = "<tr> <th>" . _('Location') . "</th> @@ -65,7 +67,7 @@ if (isset($_POST['UpdateData']) AND is_numeric($_POST[$myrow['loccode']]) AND $_POST[$myrow['loccode']]>=0){ $myrow['reorderlevel'] = $_POST[$myrow['loccode']]; - $sql = 'UPDATE locstock SET reorderlevel = ' . $_POST[$myrow['loccode']] . " + $sql = "UPDATE locstock SET reorderlevel = '" . $_POST[$myrow['loccode']] . "' WHERE stockid = '" . $StockID . "' AND loccode = '" . $myrow['loccode'] ."'"; $UpdateReorderLevel = DB_query($sql, $db); @@ -74,7 +76,7 @@ printf("<td>%s</td> <td class=number>%s</td> - <td><input type=TEXT class='number' name=%s maxlength=10 size=10 VALUE=%s></td>", + <td><input type=text class='number' name=%s maxlength=10 size=10 VALUE=%s></td>", $myrow['locationname'], number_format($myrow['quantity'],StockDecimalPlaces($StockID, $db)), $myrow['loccode'], @@ -88,7 +90,7 @@ } //end of while loop -echo "</table><div class='centre'><input type=submit name='UpdateData' VALUE='" . _('Update') . "'><hr>"; +echo "</table><br /><div class='centre'><input type=submit name='UpdateData' VALUE='" . _('Update') . "'><br /><br />"; echo "<a href='$rootpath/StockMovements.php?" . SID . "&StockID=$StockID'>" . _('Show Stock Movements') . '</a>'; echo "<br><a href='$rootpath/StockUsage.php?" . SID . "&StockID=$StockID'>" . _('Show Stock Usage') . '</a>'; echo "<br><a href='$rootpath/SelectSalesOrder.php?" . SID . "&SelectedStockItem=$StockID'>" . _('Search Outstanding Sales Orders') . '</a>'; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-26 19:08:55 UTC (rev 3792) +++ trunk/doc/Change.log.html 2010-09-26 19:23:44 UTC (rev 3793) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>26/09/10 Tim: StockReorderLevel.php - SQL quoting corrections and layout changes and improvements</p> <p>26/09/10 Tim: StockQuantityByDate.php - SQL quoting corrections and layout changes and improvements</p> <p>26/09/10 Tim: StockQties_csv.php - Layout changes and improvements</p> <p>26/09/10 Tim: StockMovements.php - Layout changes and improvements</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-26 19:36:49
|
Revision: 3794 http://web-erp.svn.sourceforge.net/web-erp/?rev=3794&view=rev Author: tim_schofield Date: 2010-09-26 19:36:43 +0000 (Sun, 26 Sep 2010) Log Message: ----------- Layout changes and improvements Modified Paths: -------------- trunk/StockSerialItemResearch.php trunk/doc/Change.log.html Modified: trunk/StockSerialItemResearch.php =================================================================== --- trunk/StockSerialItemResearch.php 2010-09-26 19:23:44 UTC (rev 3793) +++ trunk/StockSerialItemResearch.php 2010-09-26 19:36:43 UTC (rev 3794) @@ -7,7 +7,10 @@ $title = _('Serial Item Research'); include('includes/header.inc'); +echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . +'" alt=""><b>' . $title. '</p>'; + //validate the submission if (isset($_POST['serialno'])) { $SN = trim($_POST['serialno']); @@ -18,18 +21,18 @@ } $SN = $SN; -?> -<div class="centre"> + +echo '<div class="centre"> <br> -<form name=SNRESEARCH method=post action="<?php echo $_SERVER['PHP_SELF']; ?>"> -<?php echo _('Serial Number') ?>: <input ID="serialno" name="serialno" size=21 maxlength=20 VALUE="<?php echo $SN; ?>"> -<input type=submit name=submit> -</form> -<SCRIPT> +<form name=SNRESEARCH method=post action="' . $_SERVER['PHP_SELF'] .'"> +' . _('Serial Number') .': <input ID="serialno" name="serialno" size=21 maxlength=20 VALUE="'. $SN . '"> +<input type=submit name=submit></div><br /> +</form>'; + +echo "<SCRIPT> document.getElementById('serialno').focus(); -</SCRIPT> +</SCRIPT>"; -<?php if ($SN!='') { //the point here is to allow a semi fuzzy search, but still keep someone from killing the db server @@ -43,9 +46,9 @@ } } $SQL = "SELECT ssi.serialno, - ssi.stockid, ssi.quantity CurInvQty, - ssm.moveqty, - sm.type, st.typename, + ssi.stockid, ssi.quantity CurInvQty, + ssm.moveqty, + sm.type, st.typename, sm.transno, sm.loccode, l.locationname, sm.trandate, sm.debtorno, sm.branchcode, sm.reference, sm.qty TotalMoveQty FROM stockserialitems ssi INNER JOIN stockserialmoves ssm ON ssi.serialno = ssm.serialno AND ssi.stockid=ssm.stockid @@ -59,12 +62,12 @@ ORDER BY stkmoveno"; $result = DB_query($SQL,$db); - + if (DB_num_rows($result) == 0){ prnMsg( _('No History found for Serial Number'). ': <b>'.$SN.'</b>' , 'warn'); } else { echo '<h4>'. _('Details for Serial Item').': <b>'.$SN.'</b><br>'. _('Length').'='.strlen($SN).'</h4>'; - echo '<table BORDER=1>'; + echo '<table class=selection>'; echo "<tr><th>" . _('StockID') . "</th> <th>" . _('CurInvQty') . "</th> <th>" . _('Move Qty') . "</th> Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-26 19:23:44 UTC (rev 3793) +++ trunk/doc/Change.log.html 2010-09-26 19:36:43 UTC (rev 3794) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>26/09/10 Tim: StockSerialItemResearch.php - Layout changes and improvements</p> <p>26/09/10 Tim: StockReorderLevel.php - SQL quoting corrections and layout changes and improvements</p> <p>26/09/10 Tim: StockQuantityByDate.php - SQL quoting corrections and layout changes and improvements</p> <p>26/09/10 Tim: StockQties_csv.php - Layout changes and improvements</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-26 20:03:14
|
Revision: 3795 http://web-erp.svn.sourceforge.net/web-erp/?rev=3795&view=rev Author: tim_schofield Date: 2010-09-26 20:03:07 +0000 (Sun, 26 Sep 2010) Log Message: ----------- Layout changes and improvements Modified Paths: -------------- trunk/StockSerialItems.php trunk/doc/Change.log.html Modified: trunk/StockSerialItems.php =================================================================== --- trunk/StockSerialItems.php 2010-09-26 19:36:43 UTC (rev 3794) +++ trunk/StockSerialItems.php 2010-09-26 20:03:07 UTC (rev 3795) @@ -7,6 +7,8 @@ $title = _('Stock Of Controlled Items'); include('includes/header.inc'); +echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . +'" alt=""><b>' . $title. '</p>'; if (isset($_GET['StockID'])){ $StockID = trim(strtoupper($_GET['StockID'])); @@ -23,18 +25,18 @@ serialised, controlled FROM stockmaster - WHERE stockid='$StockID'", + WHERE stockid='".$StockID."'", $db, _('Could not retrieve the requested item because')); $myrow = DB_fetch_row($result); +$Description = $myrow[0]; +$UOM = $myrow[1]; $DecimalPlaces = $myrow[3]; $Serialised = $myrow[4]; $Controlled = $myrow[5]; -echo "<br><font color=BLUE size=3><b>$StockID - $myrow[0] </b> (" . _('In units of') . ' ' . $myrow[1] . ')</font>'; - if ($myrow[2]=='K' OR $myrow[2]=='A' OR $myrow[2]=='D'){ prnMsg(_('This item is either a kitset or assembly or a dummy part and cannot have a stock holding') . '. ' . _('This page cannot be displayed') . '. ' . _('Only serialised or controlled items can be displayed in this page'),'error'); @@ -42,13 +44,6 @@ exit; } -if ($Serialised==1){ - echo '<br><b>' . _('Serialised items in') . ' '; -} else { - echo '<br><b>' . _('Controlled items in') . ' '; -} - - $result = DB_query("SELECT locationname FROM locations WHERE loccode='" . $_GET['Location'] . "'", @@ -57,7 +52,6 @@ _('The SQL used to lookup the location was')); $myrow = DB_fetch_row($result); -echo $myrow[0]; $sql = "SELECT serialno, quantity @@ -70,8 +64,17 @@ $ErrMsg = _('The serial numbers/batches held cannot be retrieved because'); $LocStockResult = DB_query($sql, $db, $ErrMsg); -echo '<table cellpadding=2 BORDER=0>'; +echo '<table cellpadding=2 class=selection>'; +if ($Serialised==1){ + echo '<tr<th colspan=3><font color=navy size=2>' . _('Serialised items in') . ' '; +} else { + echo '<tr<th colspan=3><font color=navy size=2>' . _('Controlled items in') . ' '; +} +echo $myrow[0]. '</font></th></tr>'; + +echo "<tr><th colspan=3><font color=navy size=2>".$StockID ."-". $Description ."</b> (" . _('In units of') . ' ' . $UOM . ')</font></th></tr>'; + if ($Serialised == 1){ $tableheader = "<tr> <th>" . _('Serial Number') . "</th> @@ -131,7 +134,7 @@ } //end of while loop -echo '</table><hr>'; +echo '</table><br />'; echo '<div class="centre"><br><b>' . _('Total quantity') . ': ' . number_format($TotalQuantity, $DecimalPlaces) . '<br></div>'; echo '</form>'; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-26 19:36:43 UTC (rev 3794) +++ trunk/doc/Change.log.html 2010-09-26 20:03:07 UTC (rev 3795) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>26/09/10 Tim: StockSerialItems.php - Layout changes and improvements</p> <p>26/09/10 Tim: StockSerialItemResearch.php - Layout changes and improvements</p> <p>26/09/10 Tim: StockReorderLevel.php - SQL quoting corrections and layout changes and improvements</p> <p>26/09/10 Tim: StockQuantityByDate.php - SQL quoting corrections and layout changes and improvements</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-26 20:13:20
|
Revision: 3796 http://web-erp.svn.sourceforge.net/web-erp/?rev=3796&view=rev Author: tim_schofield Date: 2010-09-26 20:13:14 +0000 (Sun, 26 Sep 2010) Log Message: ----------- Layout changes and improvements Modified Paths: -------------- trunk/StockStatus.php trunk/doc/Change.log.html Modified: trunk/StockStatus.php =================================================================== --- trunk/StockStatus.php 2010-09-26 20:03:07 UTC (rev 3795) +++ trunk/StockStatus.php 2010-09-26 20:13:14 UTC (rev 3796) @@ -30,7 +30,7 @@ FROM stockmaster WHERE - stockid='$StockID'", + stockid='".$StockID."'", $db, _('Could not retrieve the requested item'), _('The SQL used to retrieve the items was')); @@ -41,7 +41,8 @@ $Serialised = $myrow[4]; $Controlled = $myrow[5]; -echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . '" alt=""><b>' . ' ' . $StockID . ' - ' . $myrow['0'] . ' : ' . _('in units of') . ' : ' . $myrow[1] . ''; +echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . + '" alt=""><b>' . ' ' . $StockID . ' - ' . $myrow['0'] . ' : ' . _('in units of') . ' : ' . $myrow[1] . ''; $Its_A_KitSet_Assembly_Or_Dummy =False; if ($myrow[2]=='K'){ @@ -75,7 +76,7 @@ $DbgMsg = _('The SQL that was used to update the stock item and failed was'); $LocStockResult = DB_query($sql, $db, $ErrMsg, $DbgMsg); -echo '<br><table cellpadding=2 BORDER=0>'; +echo '<br><table cellpadding=2 class=selection>'; if ($Its_A_KitSet_Assembly_Or_Dummy == True){ $tableheader = '<tr> @@ -294,7 +295,7 @@ } if (isset($PriceHistory)) { echo '<p>' . _('Pricing history for sales of') . ' ' . $StockID . ' ' . _('to') . ' ' . $DebtorNo; - echo '<table cellpadding=2 BORDER=0>'; + echo '<table cellpadding=2 class=selection>'; $tableheader = "<tr> <th>" . _('Date Range') . "</th> <th>" . _('Quantity') . "</th> @@ -307,7 +308,7 @@ foreach($PriceHistory as $ph) { $j--; - If ($j < 0 ){ + if ($j < 0 ){ $j = 11; echo $tableheader; } @@ -351,4 +352,4 @@ echo '</form></div>'; include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-26 20:03:07 UTC (rev 3795) +++ trunk/doc/Change.log.html 2010-09-26 20:13:14 UTC (rev 3796) @@ -1,6 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> -<p>26/09/10 Tim: StockSerialItems.php - Layout changes and improvements</p> +<p>26/09/10 Tim: StockStatus.php - Layout changes and improvements</p> <p>26/09/10 Tim: StockSerialItemResearch.php - Layout changes and improvements</p> <p>26/09/10 Tim: StockReorderLevel.php - SQL quoting corrections and layout changes and improvements</p> <p>26/09/10 Tim: StockQuantityByDate.php - SQL quoting corrections and layout changes and improvements</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-26 20:23:30
|
Revision: 3797 http://web-erp.svn.sourceforge.net/web-erp/?rev=3797&view=rev Author: tim_schofield Date: 2010-09-26 20:23:24 +0000 (Sun, 26 Sep 2010) Log Message: ----------- Layout changes and improvements Modified Paths: -------------- trunk/StockTransfers.php trunk/doc/Change.log.html Modified: trunk/StockTransfers.php =================================================================== --- trunk/StockTransfers.php 2010-09-26 20:13:14 UTC (rev 3796) +++ trunk/StockTransfers.php 2010-09-26 20:23:24 UTC (rev 3797) @@ -404,7 +404,7 @@ } if (!isset($_SESSION['Transfer']->TransferItem[0]->StockID)) { - $_SESSION['Transfer']->TransferItem[0]->StockID = ''; + $_SESSION['Transfer']->TransferItem[0]->StockID = ' '; } if (!isset($_SESSION['Transfer']->TransferItem[0]->ItemDescription)) { $_SESSION['Transfer']->TransferItem[0]->ItemDescription = ''; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-26 20:13:14 UTC (rev 3796) +++ trunk/doc/Change.log.html 2010-09-26 20:23:24 UTC (rev 3797) @@ -1,6 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> -<p>26/09/10 Tim: StockStatus.php - Layout changes and improvements</p> +<p>26/09/10 Tim: StockTransfers.php - Layout changes and improvements</p> <p>26/09/10 Tim: StockSerialItemResearch.php - Layout changes and improvements</p> <p>26/09/10 Tim: StockReorderLevel.php - SQL quoting corrections and layout changes and improvements</p> <p>26/09/10 Tim: StockQuantityByDate.php - SQL quoting corrections and layout changes and improvements</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-27 09:11:47
|
Revision: 3798 http://web-erp.svn.sourceforge.net/web-erp/?rev=3798&view=rev Author: tim_schofield Date: 2010-09-27 09:11:41 +0000 (Mon, 27 Sep 2010) Log Message: ----------- Layout changes and improvements Modified Paths: -------------- trunk/StockUsage.php trunk/doc/Change.log.html Modified: trunk/StockUsage.php =================================================================== --- trunk/StockUsage.php 2010-09-26 20:23:24 UTC (rev 3797) +++ trunk/StockUsage.php 2010-09-27 09:11:41 UTC (rev 3798) @@ -27,34 +27,37 @@ include('includes/header.inc'); -$result = DB_query("SELECT description, - units, - mbflag, - decimalplaces - FROM stockmaster - WHERE stockid='$StockID'",$db); +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Dispatch') . + '" alt="">' . ' ' . _('Select Item to Transfer') . ''; + +$result = DB_query("SELECT description, + units, + mbflag, + decimalplaces + FROM stockmaster + WHERE stockid='".$StockID."'",$db); $myrow = DB_fetch_row($result); $DecimalPlaces = $myrow[3]; -echo '<div class="centre">'; +echo '<table class=selection>'; $Its_A_KitSet_Assembly_Or_Dummy =False; if (($myrow[2]=='K') OR ($myrow[2]=='A') OR ($myrow[2]=='D')) { $Its_A_KitSet_Assembly_Or_Dummy =True; - echo "<br><font color=BLUE size=3><b>$StockID - $myrow[0] </b></font>"; + echo "<font color=navy size=3><b>$StockID - $myrow[0] </b></font>"; echo '<br>' . _('The selected item is a dummy or assembly or kit-set item and cannot have a stock holding') . '. ' . _('Please select a different item'); $StockID = ''; } else { -echo '<br><font size=3>' . _('Item') . ' :<b> ' . $StockID . ' - ' . $myrow[0] . ' </b> (' . _('in units of') . ' :<b> ' . $myrow[1] . ')</b></font><br><br>'; + echo '<tr><th><font size=3 color=navy>' . _('Item') . ' :<b> ' . $StockID . ' - ' . $myrow[0] . ' </b> (' . _('in units of') . ' :<b> ' . $myrow[1] . ')</b></font></th></tr>'; } -echo "<form action='" . $_SERVER['PHP_SELF'] . '?'. SID ."' method=post>"; +echo "<form action='" . $_SERVER['PHP_SELF'] . '?'. SID ."' method=post><tr><td>"; echo _('Stock Code') . ":<input type=text name='StockID' size=21 maxlength=20 value='$StockID' >"; -echo _('From Stock Location') . ":<select name='StockLocation'> "; +echo _('From Stock Location') . ":<select name='StockLocation'>"; $sql = 'SELECT loccode, locationname FROM locations'; $resultStkLocs = DB_query($sql,$db); @@ -82,8 +85,7 @@ echo '</select>'; echo " <input type=submit name='ShowUsage' VALUE='" . _('Show Stock Usage') . "'>"; -echo " <input type=submit name='ShowGraphUsage' VALUE='" . _('Show Graph Of Stock Usage') . "'>"; -echo '<hr>'; +echo " <input type=submit name='ShowGraphUsage' VALUE='" . _('Show Graph Of Stock Usage') . "'></td></tr></table><br />"; /* $_SESSION['NumberOfPeriodsOfStockUsage'] is defined in config.php as a user definable variable config.php is loaded by header.inc */ @@ -92,29 +94,29 @@ but there is no physical stock movement - it makes sense honest ??? */ if (isset($_POST['ShowUsage'])){ if($_POST['StockLocation']=='All'){ - $sql = "SELECT periods.periodno, - periods.lastdate_in_period, - SUM(-stockmoves.qty) AS qtyused - FROM stockmoves INNER JOIN periods - ON stockmoves.prd=periods.periodno - WHERE (stockmoves.type=10 OR stockmoves.type=11 OR stockmoves.type=28) - AND stockmoves.hidemovt=0 - AND stockmoves.stockid = '" . $StockID . "' - GROUP BY periods.periodno, - periods.lastdate_in_period + $sql = "SELECT periods.periodno, + periods.lastdate_in_period, + SUM(-stockmoves.qty) AS qtyused + FROM stockmoves INNER JOIN periods + ON stockmoves.prd=periods.periodno + WHERE (stockmoves.type=10 OR stockmoves.type=11 OR stockmoves.type=28) + AND stockmoves.hidemovt=0 + AND stockmoves.stockid = '" . $StockID . "' + GROUP BY periods.periodno, + periods.lastdate_in_period ORDER BY periodno DESC LIMIT " . $_SESSION['NumberOfPeriodsOfStockUsage']; } else { - $sql = "SELECT periods.periodno, - periods.lastdate_in_period, - SUM(-stockmoves.qty) AS qtyused - FROM stockmoves INNER JOIN periods - ON stockmoves.prd=periods.periodno - WHERE (stockmoves.type=10 Or stockmoves.type=11 OR stockmoves.type=28) - AND stockmoves.hidemovt=0 - AND stockmoves.loccode='" . $_POST['StockLocation'] . "' - AND stockmoves.stockid = '" . $StockID . "' - GROUP BY periods.periodno, - periods.lastdate_in_period + $sql = "SELECT periods.periodno, + periods.lastdate_in_period, + SUM(-stockmoves.qty) AS qtyused + FROM stockmoves INNER JOIN periods + ON stockmoves.prd=periods.periodno + WHERE (stockmoves.type=10 Or stockmoves.type=11 OR stockmoves.type=28) + AND stockmoves.hidemovt=0 + AND stockmoves.loccode='" . $_POST['StockLocation'] . "' + AND stockmoves.stockid = '" . $StockID . "' + GROUP BY periods.periodno, + periods.lastdate_in_period ORDER BY periodno DESC LIMIT " . $_SESSION['NumberOfPeriodsOfStockUsage']; } $MovtsResult = DB_query($sql, $db); @@ -125,19 +127,19 @@ } exit; } - - echo '</div><table cellpadding=2 border=0>'; + + echo '</div><table cellpadding=2 class=selection>'; $tableheader = "<tr><th>" . _('Month') . "</th><th>" . _('Usage') . '</th></tr>'; echo $tableheader; - + $j = 1; $k=0; //row colour counter - + $TotalUsage = 0; $PeriodsCounter =0; - + while ($myrow=DB_fetch_array($MovtsResult)) { - + if ($k==1){ echo '<tr class="EvenTableRows">'; $k=0; @@ -145,26 +147,26 @@ echo '<tr class="OddTableRows">'; $k++; } - + $DisplayDate = MonthAndYearFromSQLDate($myrow['lastdate_in_period']); - + $TotalUsage += $myrow['qtyused']; $PeriodsCounter++; printf('<td>%s</td><td class=number>%s</td></tr>', $DisplayDate, number_format($myrow['qtyused'],$DecimalPlaces)); - + //end of page full new headings if } //end of while loop - - echo '</table>'; + if ($TotalUsage>0 && $PeriodsCounter>0){ - echo '<br><div class="centre">' . _('Average Usage per month is') . ' ' . number_format($TotalUsage/$PeriodsCounter); - echo '</div>'; + echo '<tr<th colspan=2>' . _('Average Usage per month is') . ' ' . number_format($TotalUsage/$PeriodsCounter); + echo '</th></tr>'; } + echo '</table>'; } /* end if Show Usage is clicked */ -echo '<div class="centre">'; -echo "<hr><a href='$rootpath/StockStatus.php?". SID . "&StockID=$StockID'>" . _('Show Stock Status') .'</a>'; +echo '<br /><div class="centre">'; +echo "<a href='$rootpath/StockStatus.php?". SID . "&StockID=$StockID'>" . _('Show Stock Status') .'</a>'; echo "<br><a href='$rootpath/StockMovements.php?". SID . "&StockID=$StockID&StockLocation=" . $_POST['StockLocation'] . "'>" . _('Show Stock Movements') . '</a>'; echo "<br><a href='$rootpath/SelectSalesOrder.php?". SID . "&SelectedStockItem=$StockID&StockLocation=" . $_POST['StockLocation'] . "'>" . _('Search Outstanding Sales Orders') . '</a>'; echo "<br><a href='$rootpath/SelectCompletedOrder.php?". SID . "&SelectedStockItem=$StockID'>" . _('Search Completed Sales Orders') . '</a>'; @@ -173,4 +175,4 @@ echo '</form></div>'; include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-26 20:23:24 UTC (rev 3797) +++ trunk/doc/Change.log.html 2010-09-27 09:11:41 UTC (rev 3798) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>26709/10 Tim: StockUsage.php - Layout changes and improvements</p> <p>26/09/10 Tim: StockTransfers.php - Layout changes and improvements</p> <p>26/09/10 Tim: StockSerialItemResearch.php - Layout changes and improvements</p> <p>26/09/10 Tim: StockReorderLevel.php - SQL quoting corrections and layout changes and improvements</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-27 12:22:45
|
Revision: 3799 http://web-erp.svn.sourceforge.net/web-erp/?rev=3799&view=rev Author: tim_schofield Date: 2010-09-27 12:22:38 +0000 (Mon, 27 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements Modified Paths: -------------- trunk/StockUsage.php trunk/SuppCreditGRNs.php trunk/doc/Change.log.html Modified: trunk/StockUsage.php =================================================================== --- trunk/StockUsage.php 2010-09-27 09:11:41 UTC (rev 3798) +++ trunk/StockUsage.php 2010-09-27 12:22:38 UTC (rev 3799) @@ -28,7 +28,7 @@ include('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Dispatch') . - '" alt="">' . ' ' . _('Select Item to Transfer') . ''; + '" alt="">' . ' ' . $title . '</p>'; $result = DB_query("SELECT description, units, Modified: trunk/SuppCreditGRNs.php =================================================================== --- trunk/SuppCreditGRNs.php 2010-09-27 09:11:41 UTC (rev 3798) +++ trunk/SuppCreditGRNs.php 2010-09-27 12:22:38 UTC (rev 3799) @@ -16,6 +16,9 @@ include('includes/header.inc'); +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Dispatch') . + '" alt="">' . ' ' . $title . '</p>'; + if (!isset($_SESSION['SuppTrans'])){ prnMsg(_('To enter a supplier transactions the supplier must first be selected from the supplier selection screen') . ', ' . _('then the link to enter a supplier credit note must be clicked on'),'info'); echo '<br><a href="' . $rootpath . '/SelectSupplier.php?' . SID .'">' . _('Select A Supplier to Enter a Transaction For') . '</a>'; @@ -65,8 +68,8 @@ /*Show all the selected GRNs so far from the SESSION['SuppTrans']->GRNs array */ -echo '<div class="centre"><font size=4 color=BLUE>' . _('Credits Against Goods Received Selected'); -echo '<table cellpadding=0>'; +echo '<table cellpadding=0 class=selection>'; +echo '<tr><th colspan=6><font size=3 color=navy>' . _('Credits Against Goods Received Selected') . '</font></th></tr>'; $TableHeader = '<tr><th>' . _('GRN') . '</th> <th>' . _('Item Code') . '</th> <th>' . _('Description') . '</th> @@ -77,6 +80,7 @@ echo $TableHeader; $TotalValueCharged=0; +$i=0; foreach ($_SESSION['SuppTrans']->GRNs as $EnteredGRN){ @@ -97,9 +101,9 @@ } } -echo '<tr><td colspan=5 class=number><font size=4 color=BLUE>' . _('Total Value Credited Against Goods') . ':</font></td> - <td class=number><font size=4 color=BLUE><U>' . number_format($TotalValueCharged,2) . '</U></font></td></tr>'; -echo '</table><br><a href="' . $rootpath . '/SupplierCredit.php?' . SID . '">' . _('Back to Credit Note Entry') . '</a><hr>'; +echo '<tr><td colspan=5 class=number><font size=2 color=navy>' . _('Total Value Credited Against Goods') . ':</font></td> + <td class=number><font size=2 color=navy><U>' . number_format($TotalValueCharged,2) . '</U></font></td></tr>'; +echo '</table><br /><div class=centre><a href="' . $rootpath . '/SupplierCredit.php?' . SID . '">' . _('Back to Credit Note Entry') . '</a></div>'; /* Now get all the GRNs for this supplier from the database after the date entered */ @@ -133,10 +137,11 @@ /*Set up a table to show the GRNs outstanding for selection */ echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; -echo '<br>' . _('Show Goods Received Since') . ': <input type=Text name="Show_Since" maxlength=11 size=12 VALUE="' . $_POST['Show_Since'] . '">'; -echo '<font size=4 color=BLUE> ' . _('From') . ' ' . $_SESSION['SuppTrans']->SupplierName; +echo '<br /><table cellpadding=2 colspan=7 class=selection>'; -echo '<table cellpadding=2 colspan=7>'; +echo '<tr<th colspan=10><font size=3 color=navy>' . _('Show Goods Received Since') . ': </font>'; +echo '<input type=Text name="Show_Since" maxlength=11 size=12 class=date alt='.$_SESSION['DefaultDateFormat'].' value="' . $_POST['Show_Since'] . '"><font size=3 color=navy> '; +echo _('From') . ' ' . $_SESSION['SuppTrans']->SupplierName . '</font></th></tr>'; $TableHeader = '<tr><th>' . _('GRN') . '</th> <th>' . _('Order') . '</th> @@ -186,8 +191,9 @@ if (isset($_POST['GRNNo']) AND $_POST['GRNNo']!=''){ - $SQL = 'SELECT grnno, + $SQL = "SELECT grnno, grns.podetailitem, + purchorderdetails.orderno, purchorderdetails.unitprice, purchorderdetails.glcode, grns.itemcode, @@ -205,13 +211,13 @@ purchorderdetails LEFT JOIN shipments ON purchorderdetails.shiptref=shipments.shiptref WHERE grns.podetailitem=purchorderdetails.podetailitem AND - grns.grnno=' .$_POST['GRNNo']; + grns.grnno='" .$_POST['GRNNo'] . "'"; $GRNEntryResult = DB_query($SQL,$db); $myrow = DB_fetch_array($GRNEntryResult); - echo '<p><font size=4 color=BLUE><b>' . _('GRN Selected For Adding To A Suppliers Credit Note') . '</font></b>'; - - echo '<table><tr><th>' . _('GRN') . '</th> + echo '<br /><table class=selection>'; + echo '<tr><th colspan=6><font size=3 color=navy>' . _('GRN Selected For Adding To A Suppliers Credit Note') . '</font></th></tr>'; + echo '<tr><th>' . _('GRN') . '</th> <th>' . _('Item') . '</th> <th>' . _('Quantity') . '<br>' . _('Outstanding') . '</th> <th>' . _('Quantity') . '<br>' . _('credited') . '</th> @@ -235,22 +241,23 @@ echo '<input type=hidden name="ShiptRef" Value="' . $myrow['shiptref'] . '">'; } - echo '<p><input type=Submit Name="AddGRNToTrans" Value="' . _('Add to Credit Note') . '">'; + echo '<br /><div class=centre><input type=Submit Name="AddGRNToTrans" Value="' . _('Add to Credit Note') . '"></div>'; - echo '<input type=hidden name="GRNNumber" VALUE=' . $_POST['GRNNo'] . '>'; - echo '<input type=hidden name="ItemCode" VALUE="' . $myrow['itemcode'] . '">'; - echo '<input type=hidden name="ItemDescription" VALUE="' . $myrow['itemdescription'] . '">'; - echo '<input type=hidden name="QtyRecd" VALUE=' . $myrow['qtyrecd'] . '>'; - echo '<input type=hidden name="Prev_QuantityInv" VALUE=' . $myrow['quantityinv'] . '>'; - echo '<input type=hidden name="OrderPrice" VALUE=' . $myrow['unitprice'] . '>'; - echo '<input type=hidden name="StdCostUnit" VALUE=' . $myrow['stdcostunit'] . '>'; + echo '<input type=hidden name="GRNNumber" value=' . $_POST['GRNNo'] . '>'; + echo '<input type=hidden name="ItemCode" value="' . $myrow['itemcode'] . '">'; + echo '<input type=hidden name="ItemDescription" value="' . $myrow['itemdescription'] . '">'; + echo '<input type=hidden name="QtyRecd" value=' . $myrow['qtyrecd'] . '>'; + echo '<input type=hidden name="Prev_QuantityInv" value=' . $myrow['quantityinv'] . '>'; + echo '<input type=hidden name="OrderPrice" value=' . $myrow['unitprice'] . '>'; + echo '<input type=hidden name="StdCostUnit" value=' . $myrow['stdcostunit'] . '>'; echo '<input type=hidden name="JobRef" Value="' . $myrow['jobref'] . '">'; echo '<input type=hidden name="GLCode" Value="' . $myrow['glcode'] . '">'; echo '<input type=hidden name="PODetailItem" Value="' . $myrow['podetailitem'] . '">'; + echo '<input type=hidden name="PONo" Value="' . $myrow['orderno'] . '">'; } echo '</form>'; include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-27 09:11:41 UTC (rev 3798) +++ trunk/doc/Change.log.html 2010-09-27 12:22:38 UTC (rev 3799) @@ -1,6 +1,7 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> -<p>26709/10 Tim: StockUsage.php - Layout changes and improvements</p> +<p>27/09/10 Tim: SuppCreditGRNs.php - SQL quoting corrections and layout changes and improvements</p> +<p>27/09/10 Tim: StockUsage.php - Layout changes and improvements</p> <p>26/09/10 Tim: StockTransfers.php - Layout changes and improvements</p> <p>26/09/10 Tim: StockSerialItemResearch.php - Layout changes and improvements</p> <p>26/09/10 Tim: StockReorderLevel.php - SQL quoting corrections and layout changes and improvements</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-27 13:10:28
|
Revision: 3800 http://web-erp.svn.sourceforge.net/web-erp/?rev=3800&view=rev Author: tim_schofield Date: 2010-09-27 13:10:17 +0000 (Mon, 27 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements Modified Paths: -------------- trunk/SuppInvGRNs.php trunk/doc/Change.log.html Modified: trunk/SuppInvGRNs.php =================================================================== --- trunk/SuppInvGRNs.php 2010-09-27 12:22:38 UTC (rev 3799) +++ trunk/SuppInvGRNs.php 2010-09-27 13:10:17 UTC (rev 3800) @@ -14,6 +14,10 @@ include('includes/session.inc'); $title = _('Enter Supplier Invoice Against Goods Received'); include('includes/header.inc'); + +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Dispatch') . + '" alt="">' . ' ' . $title . '</p>'; + $Complete=false; if (!isset($_SESSION['SuppTrans'])){ prnMsg(_('To enter a supplier transactions the supplier must first be selected from the supplier selection screen') . ', ' . _('then the link to enter a supplier invoice must be clicked on'),'info'); @@ -104,8 +108,8 @@ /*Show all the selected GRNs so far from the SESSION['SuppTrans']->GRNs array */ -echo '<div class="centre"><font size=4 color=BLUE>' . _('Invoiced Goods Received Selected'); -echo '</font></div><table cellpadding=1>'; +echo '<table cellpadding=1 class=selection>'; +echo '<tr><th colspan=6><font size=3 color=navy>' . _('Invoiced Goods Received Selected') . '</font></th></tr>'; $tableheader = "<tr bgcolor=#800000> <th>" . _('Sequence') . " #</th> @@ -142,11 +146,11 @@ } echo '<tr> - <td colspan=5 align=right><font size=4 color=BLUE>' . _('Total Value of Goods Charged') . ':</font></td> - <td class=number><font size=4 color=BLUE><U>' . number_format($TotalValueCharged,2) . '</U></font></td> + <td colspan=5 align=right><font size=2 color=navy>' . _('Total Value of Goods Charged') . ':</font></td> + <td class=number><font size=2 color=navy>' . number_format($TotalValueCharged,2) . '</font></td> </tr>'; echo "</table>"; -echo "<div class='centre'><br><a href='$rootpath/SupplierInvoice.php?" . SID ."'>" . _('Back to Invoice Entry') . '</a><hr></div>'; +echo "<br /><div class='centre'><a href='$rootpath/SupplierInvoice.php?" . SID ."'>" . _('Back to Invoice Entry') . '</a></div><br />'; /* Now get all the outstanding GRNs for this supplier from the database*/ @@ -219,9 +223,9 @@ $GRNNo = $_GET['Modify']; $GRNTmp = $_SESSION['SuppTrans']->GRNs[$GRNNo]; - echo '<p><div class="centre"><font size=4 color=BLUE><b>' . _('GRN Selected For Adding To A Purchase Invoice') . '</font></b></div>'; - echo "<table> - <tr bgcolor=#800000> + echo "<table class=selection>"; + echo '<tr><th colspan=10><font size=3 color=navy>' . _('GRN Selected For Adding To A Purchase Invoice') . '</font></th></tr>'; + echo "<tr bgcolor=#800000> <th>" . _('Sequence') . " #</th> <th>" . _('Item') . "</th> <th>" . _('Qty Outstanding') . "</th> @@ -263,8 +267,8 @@ } else { if (count( $_SESSION['SuppTransTmp']->GRNs)>0){ /*if there are any outstanding GRNs then */ - echo '<div class="centre"><font size=4 color=BLUE>' . _('Goods Received Yet to be Invoiced From') . ' ' . $_SESSION['SuppTrans']->SupplierName.'</div>'; - echo "<table cellpadding=1 colspan=7>"; + echo "<table cellpadding=1 colspan=7 class=selection>"; + echo '<tr><th colspan=10><font size=3 color=navy>' . _('Goods Received Yet to be Invoiced From') . ' ' . $_SESSION['SuppTrans']->SupplierName.'</font></th></tr>'; $tableheader = "<tr bgcolor=#800000><th>" . _('Select') . "</th> <th>" . _('Sequence') . " #</th> @@ -312,7 +316,7 @@ } } echo '</table>'; - echo "<div class='centre'><input type=Submit Name='SelectAll' Value='" . _('Select All') . "'>"; + echo "<br /><div class='centre'><input type=Submit Name='SelectAll' Value='" . _('Select All') . "'>"; echo "<input type=Submit Name='DeSelectAll' Value='" . _('Deselect All') . "'>"; echo "<br><input type=Submit Name='AddGRNToTrans' Value='" . _('Add to Invoice') . "'></div>"; } Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-27 12:22:38 UTC (rev 3799) +++ trunk/doc/Change.log.html 2010-09-27 13:10:17 UTC (rev 3800) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>27/09/10 Tim: SuppInvGRNs.php - SQL quoting corrections and layout changes and improvements</p> <p>27/09/10 Tim: SuppCreditGRNs.php - SQL quoting corrections and layout changes and improvements</p> <p>27/09/10 Tim: StockUsage.php - Layout changes and improvements</p> <p>26/09/10 Tim: StockTransfers.php - Layout changes and improvements</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-27 15:17:41
|
Revision: 3801 http://web-erp.svn.sourceforge.net/web-erp/?rev=3801&view=rev Author: tim_schofield Date: 2010-09-27 15:17:34 +0000 (Mon, 27 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements Modified Paths: -------------- trunk/SupplierAllocations.php trunk/doc/Change.log.html Modified: trunk/SupplierAllocations.php =================================================================== --- trunk/SupplierAllocations.php 2010-09-27 13:10:17 UTC (rev 3800) +++ trunk/SupplierAllocations.php 2010-09-27 15:17:34 UTC (rev 3801) @@ -15,7 +15,7 @@ 3. No parameters The page will show all outstanding supplier credit notes and payments yet to be - allocated + allocated */ include('includes/DefineSuppAllocsClass.php'); @@ -29,9 +29,9 @@ include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Supplier Allocations') . '" alt="">' . ' ' . _('Supplier Allocations') . '</p>'; +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . + _('Supplier Allocations') . '" alt="">' . ' ' . _('Supplier Allocations') . '</p>'; - if (isset($_POST['UpdateDatabase']) OR isset($_POST['RefreshAllocTotal'])) { //initialise no input errors assumed initially before we test @@ -62,7 +62,7 @@ $_POST['Amt' . $AllocCounter] = 0; } - if ($_POST['All' . $AllocCounter] == True){ + if (isset($_POST['All' . $AllocCounter]) and $_POST['All' . $AllocCounter] == True){ $_POST['Amt' . $AllocCounter] = $_POST['YetToAlloc' . $AllocCounter]; } @@ -90,10 +90,10 @@ recalc diff on exchange and add up total allocations */ if ($TotalAllocated + $_SESSION['Alloc']->TransAmt > 0.005){ - echo '<br><hr>'; + echo '<br>'; prnMsg(_('These allocations cannot be processed because the amount allocated is more than the amount of the') . ' ' . $_SESSION['Alloc']->TransTypeName . ' ' . _('being allocated') . '<br>' . _('Total allocated') . ' = ' . $TotalAllocated . ' ' . _('and the total amount of the Credit/payment was') . ' ' . -$_SESSION['Alloc']->TransAmt,'error'); - echo '<br><hr>'; + echo '<br>'; $InputError = 1; } @@ -136,10 +136,10 @@ the transaction with the new alloc amount and diff on exch */ if ($AllocnItem->AllocAmt > 0){ - $SQL = "INSERT INTO suppallocs (datealloc, amt, transid_allocfrom, transid_allocto) VALUES ('" . FormatDateForSQL(date($_SESSION['DefaultDateFormat'])) . "', - " . $AllocnItem->AllocAmt . ', - ' . $_SESSION['Alloc']->AllocTrans . ', - ' . $AllocnItem->ID . ')'; + $SQL = "INSERT INTO suppallocs (datealloc, amt, transid_allocfrom, transid_allocto) VALUES ('" . FormatDateForSQL(date($_SESSION['DefaultDateFormat'])) . "', + '" . $AllocnItem->AllocAmt . "', + '" . $_SESSION['Alloc']->AllocTrans . "', + '" . $AllocnItem->ID . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The supplier allocation record for') . ' ' . $AllocnItem->TransType . ' ' . $AllocnItem->TypeNo . ' ' ._('could not be inserted because'); $DbgMsg = _('The following SQL to insert the allocation record was used'); @@ -154,10 +154,10 @@ $Settled = 0; } - $SQL = 'UPDATE supptrans SET diffonexch=' . $AllocnItem->DiffOnExch . ', - alloc = ' . $NewAllocTotal . ', - settled = ' . $Settled . ' - WHERE id = ' . $AllocnItem->ID; + $SQL = "UPDATE supptrans SET diffonexch='" . $AllocnItem->DiffOnExch . "', + alloc = '" . $NewAllocTotal . "', + settled = '" . $Settled . "' + WHERE id = '" . $AllocnItem->ID . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The debtor transaction record could not be modified for the allocation against it because'); @@ -178,10 +178,10 @@ $Settled = 0; } - $SQL = 'UPDATE supptrans SET alloc = ' . -$TotalAllocated . ', - diffonexch = ' . -$TotalDiffOnExch . ', - settled=' . $Settled . ' - WHERE id = ' . $_SESSION['AllocTrans']; + $SQL = "UPDATE supptrans SET alloc = '" . -$TotalAllocated . "', + diffonexch = '" . -$TotalDiffOnExch . "', + settled='" . $Settled . "' + WHERE id = '" . $_SESSION['AllocTrans'] . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The supplier payment or credit note transaction could not be modified for the new allocation and exchange difference because'); @@ -202,20 +202,20 @@ $_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']['purchasesexchangediffact'] . ", - '". _('Exch diff') . "', - " . $MovtInDiffOnExch . ')'; + $SQL = "INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES ('" . $_SESSION['Alloc']->TransType . "', + '" . $_SESSION['Alloc']->TransNo . "', + '" . $_SESSION['Alloc']->TransDate . "', + '" . $PeriodNo . "', + '" . $_SESSION['CompanyRecord']['purchasesexchangediffact'] . "', + '". _('Exch diff') . "', + '" . $MovtInDiffOnExch . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GL entry for the difference on exchange arising out of this allocation could not be inserted because'); @@ -224,20 +224,20 @@ $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, True); - $SQL = 'INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES (' . $_SESSION['Alloc']->TransType . ', - ' . $_SESSION['Alloc']->TransNo . ", - '" . $_SESSION['Alloc']->TransDate . "', - " . $PeriodNo . ', - ' . $_SESSION['CompanyRecord']['creditorsact'] . ", - '" . _('Exch Diff') . "', - " . -$MovtInDiffOnExch . ')'; + $SQL = "INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES ('" . $_SESSION['Alloc']->TransType . "', + '" . $_SESSION['Alloc']->TransNo . "', + '" . $_SESSION['Alloc']->TransDate . "', + '" . $PeriodNo . "', + '" . $_SESSION['CompanyRecord']['creditorsact'] . "', + '" . _('Exch Diff') . "', + '" . -$MovtInDiffOnExch . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ' : ' . _('The GL entry for the difference on exchange arising out of this allocation could not be inserted because'); @@ -307,22 +307,22 @@ $_POST['AllocTrans'] = $_GET['AllocTrans']; - $SQL= 'SELECT systypes.typename, - supptrans.type, - supptrans.transno, - supptrans.trandate, + $SQL= "SELECT systypes.typename, + supptrans.type, + supptrans.transno, + supptrans.trandate, supptrans.supplierno, - suppliers.suppname, - rate, - (supptrans.ovamount+supptrans.ovgst) AS total, + suppliers.suppname, + rate, + (supptrans.ovamount+supptrans.ovgst) AS total, supptrans.diffonexch, supptrans.alloc - FROM supptrans, - systypes, + FROM supptrans, + systypes, suppliers WHERE supptrans.type = systypes.typeid AND supptrans.supplierno = suppliers.supplierid - AND supptrans.id=' . $_SESSION['AllocTrans']; + AND supptrans.id='" . $_SESSION['AllocTrans'] . "'"; $Result = DB_query($SQL, $db); if (DB_num_rows($Result) != 1){ @@ -349,16 +349,16 @@ /* Now populate the array of possible (and previous actual) allocations for this supplier */ /*First get the transactions that have outstanding balances ie Total-Alloc >0 */ - $SQL= "SELECT supptrans.id, - typename, - transno, - trandate, - suppreference, + $SQL= "SELECT supptrans.id, + typename, + transno, + trandate, + suppreference, rate, - ovamount+ovgst AS total, - diffonexch, + ovamount+ovgst AS total, + diffonexch, alloc - FROM supptrans, + FROM supptrans, systypes WHERE supptrans.type = systypes.typeid AND supptrans.settled=0 @@ -372,17 +372,17 @@ $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg); while ($myrow=DB_fetch_array($Result)){ - $_SESSION['Alloc']->add_to_AllocsAllocn ($myrow['id'], - $myrow['typename'], + $_SESSION['Alloc']->add_to_AllocsAllocn ($myrow['id'], + $myrow['typename'], $myrow['transno'], - ConvertSQLDate($myrow['trandate']), - $myrow['suppreference'], - 0, + ConvertSQLDate($myrow['trandate']), + $myrow['suppreference'], + 0, $myrow['total'], - $myrow['rate'], - $myrow['diffonexch'], - $myrow['diffonexch'], - $myrow['alloc'], + $myrow['rate'], + $myrow['diffonexch'], + $myrow['diffonexch'], + $myrow['alloc'], 'NA'); } @@ -390,24 +390,24 @@ NB existing entries where still some of the trans outstanding entered from above logic will be overwritten with the prev alloc detail below */ - $SQL = 'SELECT supptrans.id, - typename, - transno, - trandate, - suppreference, + $SQL = "SELECT supptrans.id, + typename, + transno, + trandate, + suppreference, rate, - ovamount+ovgst AS total, - diffonexch, + ovamount+ovgst AS total, + diffonexch, supptrans.alloc-suppallocs.amt AS prevallocs, - amt, + amt, suppallocs.id AS allocid - FROM supptrans, - systypes, + FROM supptrans, + systypes, suppallocs WHERE supptrans.type = systypes.typeid AND supptrans.id=suppallocs.transid_allocto - AND suppallocs.transid_allocfrom=' . $_SESSION['AllocTrans'] . - " AND supplierno='" . $_SESSION['Alloc']->SupplierID . "'"; + AND suppallocs.transid_allocfrom='" . $_SESSION['AllocTrans'] . + "' AND supplierno='" . $_SESSION['Alloc']->SupplierID . "'"; $ErrMsg = _('There was a problem retrieving the previously allocated transactions for modification'); @@ -421,11 +421,11 @@ $_SESSION['Alloc']->add_to_AllocsAllocn ($myrow['id'], $myrow['typename'], $myrow['transno'], ConvertSQLDate($myrow['trandate']), $myrow['suppreference'], $myrow['amt'], - $myrow['total'], - $myrow['rate'], + $myrow['total'], + $myrow['rate'], $DiffOnExchThisOne, - ($myrow['diffonexch'] - $DiffOnExchThisOne), - $myrow['prevallocs'], + ($myrow['diffonexch'] - $DiffOnExchThisOne), + $myrow['prevallocs'], $myrow['allocid']); } } @@ -437,7 +437,7 @@ /*Show the transaction being allocated and the potential trans it could be allocated to and those where there is already an existing allocation */ - echo '<hr><div class="centre"><font color=BLUE>' . _('Allocation of supplier') . ' ' . + echo '<div class="centre"><font color=BLUE>' . _('Allocation of supplier') . ' ' . $_SESSION['Alloc']->TransTypeName . ' ' . _('number') . ' ' . $_SESSION['Alloc']->TransNo . ' ' . _('from') . ' ' . $_SESSION['Alloc']->SupplierID . ' - <b>' . @@ -455,11 +455,9 @@ echo '<br>' . _('Transaction total') . ': <b>' . -$_SESSION['Alloc']->TransAmt . '</b></div>'; } - echo '<hr>'; + /*Now display the potential and existing allocations put into the array above */ - /*Now display the potential and existing allocations put into the array above */ - - echo '<table cellpadding=2 colspan=7 BORDER=0>'; + echo '<table cellpadding=2 colspan=7 class=selection>'; $TableHeader = "<tr><th>" . _('Type') . "</th> <th>" . _('Trans') . '<br>' . _('Number') . "</th> <th>" . _('Trans') .'<br>' . _('Date') . "</th> @@ -530,7 +528,7 @@ echo "<div class='centre'><input type=hidden name='TotalNumberOfAllocs' VALUE=$Counter>"; - echo "<input type=submit name='RefreshAllocTotal' VALUE='" . _('Recalculate Total To Allocate') . "'>"; + echo "<br /><input type=submit name='RefreshAllocTotal' VALUE='" . _('Recalculate Total To Allocate') . "'>"; echo "<input type=submit name=UpdateDatabase VALUE='" . _('Process Allocations') . "'></div>"; } elseif(isset($_GET['SupplierID'])){ @@ -544,23 +542,23 @@ unset($_SESSION['Alloc']); - $sql = "SELECT id, - transno, - typename, - type, - suppliers.supplierid, - suppname, + $sql = "SELECT id, + transno, + typename, + type, + suppliers.supplierid, + suppname, trandate, - suppreference, - rate, - ovamount+ovgst AS total, + suppreference, + rate, + ovamount+ovgst AS total, alloc - FROM supptrans, - suppliers, + FROM supptrans, + suppliers, systypes WHERE supptrans.type=systypes.typeid AND supptrans.supplierno=suppliers.supplierid - AND suppliers.supplierid='" . $_GET['SupplierID'] ."' + AND suppliers.supplierid='" . $_GET['SupplierID'] ."' AND (type=21 or type=22) AND settled=0 ORDER BY id"; $result = DB_query($sql, $db); @@ -569,7 +567,7 @@ include('includes/footer.inc'); exit; } - echo '<table>'; + echo '<table class=selection>'; $TableHeader = "<tr><th>" . _('Trans Type') . "</th><th>" . _('Supplier') . @@ -619,19 +617,19 @@ unset($_SESSION['Alloc']->Allocs); unset($_SESSION['Alloc']); - $sql = 'SELECT id, - transno, - typename, - type, - suppliers.supplierid, - suppname, + $sql = 'SELECT id, + transno, + typename, + type, + suppliers.supplierid, + suppname, trandate, - suppreference, - rate, - ovamount+ovgst AS total, + suppreference, + rate, + ovamount+ovgst AS total, alloc - FROM supptrans, - suppliers, + FROM supptrans, + suppliers, systypes WHERE supptrans.type=systypes.typeid AND supptrans.supplierno=suppliers.supplierid @@ -640,7 +638,7 @@ $result = DB_query($sql, $db); - echo '<table>'; + echo '<table class=selection>'; $TableHeader = "<tr><th>" . _('Trans Type') . "</th> <th>" . _('Supplier') . "</th> <th>" . _('Number') . "</th> @@ -694,4 +692,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-09-27 13:10:17 UTC (rev 3800) +++ trunk/doc/Change.log.html 2010-09-27 15:17:34 UTC (rev 3801) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>27/09/10 Tim: SupplierAllocations.php - SQL quoting corrections and layout changes and improvements</p> <p>27/09/10 Tim: SuppInvGRNs.php - SQL quoting corrections and layout changes and improvements</p> <p>27/09/10 Tim: SuppCreditGRNs.php - SQL quoting corrections and layout changes and improvements</p> <p>27/09/10 Tim: StockUsage.php - Layout changes and improvements</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-27 15:29:10
|
Revision: 3802 http://web-erp.svn.sourceforge.net/web-erp/?rev=3802&view=rev Author: tim_schofield Date: 2010-09-27 15:29:04 +0000 (Mon, 27 Sep 2010) Log Message: ----------- Layout changes and improvements Modified Paths: -------------- trunk/SupplierBalsAtPeriodEnd.php trunk/doc/Change.log.html Modified: trunk/SupplierBalsAtPeriodEnd.php =================================================================== --- trunk/SupplierBalsAtPeriodEnd.php 2010-09-27 15:17:34 UTC (rev 3801) +++ trunk/SupplierBalsAtPeriodEnd.php 2010-09-27 15:29:04 UTC (rev 3802) @@ -5,17 +5,17 @@ $PageSecurity = 2; include('includes/session.inc'); -If (isset($_POST['PrintPDF']) - AND isset($_POST['FromCriteria']) - AND strlen($_POST['FromCriteria'])>=1 - AND isset($_POST['ToCriteria']) +If (isset($_POST['PrintPDF']) + AND isset($_POST['FromCriteria']) + AND strlen($_POST['FromCriteria'])>=1 + AND isset($_POST['ToCriteria']) AND strlen($_POST['ToCriteria'])>=1){ include('includes/PDFStarter.php'); $pdf->addInfo('Title',_('Supplier Balance Listing')); $pdf->addInfo('Subject',_('Supplier Balances')); - + $FontSize=12; $PageNumber=0; $line_height=12; @@ -30,7 +30,7 @@ SUM(CASE WHEN supptrans.trandate > '" . $_POST['PeriodEnd'] . "' THEN (supptrans.ovamount + supptrans.ovgst)/supptrans.rate ELSE 0 END) AS afterdatetrans, - Sum(CASE WHEN supptrans.trandate > '" . $_POST['PeriodEnd'] . "' + Sum(CASE WHEN supptrans.trandate > '" . $_POST['PeriodEnd'] . "' AND (supptrans.type=22 OR supptrans.type=21) THEN supptrans.diffonexch ELSE 0 END) AS afterdatediffonexch, @@ -44,8 +44,8 @@ AND suppliers.supplierid = supptrans.supplierno AND suppliers.supplierid >= '" . $_POST['FromCriteria'] . "' AND suppliers.supplierid <= '" . $_POST['ToCriteria'] . "' - GROUP BY suppliers.supplierid, - suppliers.suppname, + GROUP BY suppliers.supplierid, + suppliers.suppname, currencies.currency"; $SupplierResult = DB_query($SQL,$db); @@ -107,47 +107,53 @@ $DisplayTotBalance = number_format($TotBal,2); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayTotBalance,'right'); - + $pdf->OutputD($_SESSION['DatabaseName'] . '_Supplier_Balances_at_Period_End_' . Date('Y-m-d') . '.pdf'); $pdf->__destruct(); - + } else { /*The option to print PDF was not hit */ $title=_('Supplier Balances At A Period End'); include('includes/header.inc'); - - if (strlen($_POST['FromCriteria'])<1 || strlen($_POST['ToCriteria'])<1) { + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . + _('Supplier Allocations') . '" alt="">' . ' ' . $title . '</p>'; + if (!isset($_POST['FromCriteria'])) { + $_POST['FromCriteria'] = '1'; + } + if (!isset($_POST['ToCriteria'])) { + $_POST['ToCriteria'] = 'zzzzzz'; + } /*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 Supplier Code') . ":</font></td> - <td><input Type=text maxlength=6 size=7 name=FromCriteria value='1'></td></tr>"; - echo '<tr><td>' . _('To Supplier Code') . ":</td> - <td><input Type=text maxlength=6 size=7 name=ToCriteria value='zzzzzz'></td></tr>"; + echo '<tr><td>' . _('From Supplier Code') . ":</font></td> + <td><input Type=text maxlength=6 size=7 name=FromCriteria value=".$_POST['FromCriteria']."></td></tr>"; + echo '<tr><td>' . _('To Supplier Code') . ":</td> + <td><input Type=text maxlength=6 size=7 name=ToCriteria value=".$_POST['ToCriteria']."></td></tr>"; - echo '<tr><td>' . _('Balances As At') . ":</td> + echo '<tr><td>' . _('Balances As At') . ":</td> <td><select Name='PeriodEnd'>"; - $sql = 'SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC'; + $sql = 'SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC'; - $ErrMsg = _('Could not retrieve period data because'); - $Periods = DB_query($sql,$db,$ErrMsg); + $ErrMsg = _('Could not retrieve period data because'); + $Periods = DB_query($sql,$db,$ErrMsg); - while ($myrow = DB_fetch_array($Periods,$db)){ + while ($myrow = DB_fetch_array($Periods,$db)){ - echo '<option VALUE=' . $myrow['lastdate_in_period'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']); + echo '<option VALUE=' . $myrow['lastdate_in_period'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']); - } } + echo '</select></td></tr>'; - echo "</table><div class='centre'><input type=Submit Name='PrintPDF' Value='" . _('Print PDF') . "'></div>"; + echo "</table><br /><div class='centre'><input type=Submit Name='PrintPDF' Value='" . _('Print PDF') . "'></div>"; include('includes/footer.inc'); -} /*end of else not PrintPDF */ +}/*end of else not PrintPDF */ -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-27 15:17:34 UTC (rev 3801) +++ trunk/doc/Change.log.html 2010-09-27 15:29:04 UTC (rev 3802) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>27/09/10 Tim: SupplierBalsAtPeriodEnd.php - Layout changes and improvements</p> <p>27/09/10 Tim: SupplierAllocations.php - SQL quoting corrections and layout changes and improvements</p> <p>27/09/10 Tim: SuppInvGRNs.php - SQL quoting corrections and layout changes and improvements</p> <p>27/09/10 Tim: SuppCreditGRNs.php - SQL quoting corrections and layout changes and improvements</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-27 15:39:23
|
Revision: 3803 http://web-erp.svn.sourceforge.net/web-erp/?rev=3803&view=rev Author: tim_schofield Date: 2010-09-27 15:38:46 +0000 (Mon, 27 Sep 2010) Log Message: ----------- Layout changes and improvements Modified Paths: -------------- trunk/SupplierContacts.php trunk/doc/Change.log.html Modified: trunk/SupplierContacts.php =================================================================== --- trunk/SupplierContacts.php 2010-09-27 15:29:04 UTC (rev 3802) +++ trunk/SupplierContacts.php 2010-09-27 15:38:46 UTC (rev 3803) @@ -9,7 +9,6 @@ include('includes/header.inc'); - if (isset($_GET['SupplierID'])){ $SupplierID = $_GET['SupplierID']; } elseif (isset($_POST['SupplierID'])){ @@ -18,6 +17,9 @@ echo "<a href='" . $rootpath . '/SelectSupplier.php?' . SID . "'>" . _('Back to Suppliers') . '</a><br>'; +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . + _('Supplier Allocations') . '" alt="">' . ' ' . $title . '</p>'; + if (!isset($SupplierID)) { echo '<p><p>'; prnMsg(_('This page must be called with the supplier code of the supplier for whom you wish to edit the contacts') . '<br>' . _('When the page is called from within the system this will always be the case') . @@ -59,7 +61,7 @@ fax='" . $_POST['Fax'] . "', email='" . $_POST['Email'] . "', mobile = '". $_POST['Mobile'] . "' - WHERE contact='$SelectedContact' AND supplierid='$SupplierID'"; + WHERE contact='".$SelectedContact."' AND supplierid='".$SupplierID."'"; $msg = _('The supplier contact information has been updated'); @@ -104,8 +106,8 @@ } elseif (isset($_GET['delete'])) { $sql = "DELETE FROM suppliercontacts - WHERE contact='$SelectedContact' - AND supplierid = '$SupplierID'"; + WHERE contact='".$SelectedContact."' + AND supplierid = '".$SupplierID."'"; $ErrMsg = _('The supplier contact could not be deleted because'); $DbgMsg = _('The SQL that was used but failed was'); @@ -129,16 +131,16 @@ FROM suppliercontacts, suppliers WHERE suppliercontacts.supplierid=suppliers.supplierid - AND suppliercontacts.supplierid = '$SupplierID'"; + AND suppliercontacts.supplierid = '".$SupplierID."'"; $result = DB_query($sql, $db); $myrow = DB_fetch_row($result); + echo "<table class=selection>\n"; + if ($myrow) { - echo '<div class="centre"><b>' . _('Contacts Defined for') . " - $myrow[0]</b></div>"; + echo '<tr><th colspan=7><font size=3 color=navy>' . _('Contacts Defined for') . " - ".$myrow[0]."</font></th></tr>"; } - - echo "<table border=1>\n"; echo "<tr><th>" . _('Name') . "</th> <th>" . _('Position') . "</th> <th>" . _('Phone No') . "</th> @@ -172,7 +174,7 @@ //end of ifs and buts! -echo '</table><p>'; +echo '</table><br />'; if (isset($SelectedContact)) { echo "<div class='centre'><a href='" . $_SERVER['PHP_SELF'] . "?" . SID . "SupplierID=$SupplierID" . "'>" . @@ -193,8 +195,8 @@ mobile, email FROM suppliercontacts - WHERE contact='$SelectedContact' - AND supplierid='$SupplierID'"; + WHERE contact='".$SelectedContact."' + AND supplierid='".$SupplierID."'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); @@ -213,7 +215,7 @@ if (!isset($_POST['Contact'])) { $_POST['Contact']=''; } - echo '<table><tr><td>' . _('Contact Name') . ":</td> + echo '<table class=selection><tr><td>' . _('Contact Name') . ":</td> <td><input type='Text' name='Contact' size=41 maxlength=40 VALUE='" . $_POST['Contact'] . "'></td></tr>"; } if (!isset($_POST['Position'])) { @@ -243,7 +245,7 @@ <td><input type=text name='Mobile' size=31 maxlength=30 VALUE='" . $_POST['Mobile'] . "'></td></tr> <tr><td><a href='Mailto:" . $_POST['Email'] . "'>" . _('Email') . ":</a></td> <td><input type=text name='Email' size=51 maxlength=50 VALUE='" . $_POST['Email'] . "'></td></tr> - </table>"; + </table><br />"; echo "<div class='centre'><input type='Submit' name='submit' VALUE='" . _('Enter Information') . "'>"; echo '</div></form>'; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-27 15:29:04 UTC (rev 3802) +++ trunk/doc/Change.log.html 2010-09-27 15:38:46 UTC (rev 3803) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>27/09/10 Tim: SupplierContacts.php - SQL quoting corrections and layout changes and improvements</p> <p>27/09/10 Tim: SupplierBalsAtPeriodEnd.php - Layout changes and improvements</p> <p>27/09/10 Tim: SupplierAllocations.php - SQL quoting corrections and layout changes and improvements</p> <p>27/09/10 Tim: SuppInvGRNs.php - SQL quoting corrections and layout changes and improvements</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-27 18:28:12
|
Revision: 3804 http://web-erp.svn.sourceforge.net/web-erp/?rev=3804&view=rev Author: tim_schofield Date: 2010-09-27 18:28:04 +0000 (Mon, 27 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements Modified Paths: -------------- trunk/SupplierCredit.php trunk/doc/Change.log.html Modified: trunk/SupplierCredit.php =================================================================== --- trunk/SupplierCredit.php 2010-09-27 15:38:46 UTC (rev 3803) +++ trunk/SupplierCredit.php 2010-09-27 18:28:04 UTC (rev 3804) @@ -242,7 +242,7 @@ /* everything below here only do if a Supplier is selected fisrt add a header to show who we are making an credit note for */ -echo "<table BORDER=2 colspan=4><tr><th>" . _('Supplier') . "</th> +echo "<table class=selection colspan=4><tr><th>" . _('Supplier') . "</th> <th>" . _('Currency') . "</th> <th>" . _('Terms') . "</th> <th>" . _('Tax Group') . '</th></tr>'; @@ -257,7 +257,7 @@ echo "<form action='" . $_SERVER['PHP_SELF'] . "?" . SID . "' method=post name=form1>"; -echo '<table>'; +echo '<br /><table class=selection>'; echo '<tr><td><font color=red>' . _('Supplier Credit Note Reference') . ":</font></td> <td><font size=2><input type=TEXT size=20 maxlength=20 name=SuppReference VALUE='" . $_SESSION['SuppTrans']->SuppReference . "'></td>"; @@ -279,14 +279,14 @@ echo '</div>'; } - +echo '<br />'; if (count($_SESSION['SuppTrans']->GRNs)>0){ /*if there are some GRNs selected for crediting then */ /*Show all the selected GRNs so far from the SESSION['SuppInv']->GRNs array Note that the class for carrying GRNs refers to quantity invoiced read credited in this context*/ - echo '<table cellpadding=2>'; + echo '<table cellpadding=2 class=selection>'; $TableHeader = "<tr><th>" . _('GRN') . "</th> <th>" . _('Item Code') . "</th> <th>" . _('Description') . "</th> @@ -312,12 +312,12 @@ echo '<tr><td colspan=5 class=number><font color=red>' . _('Total Value of Goods Credited') . ':</font></td> <td class=number><font color=red><U>' . number_format($TotalGRNValue,2) . '</U></font></td></tr>'; - echo '</table>'; + echo '</table><br />'; } if (count($_SESSION['SuppTrans']->Shipts)>0){ /*if there are any Shipment charges on the credit note*/ - echo '<table cellpadding=2>'; + echo '<table cellpadding=2 class=selection>'; $TableHeader = "<tr><th>" . _('Shipment') . "</th> <th>" . _('Amount') . '</th></tr>'; echo $TableHeader; @@ -337,13 +337,13 @@ } - echo '<tr><td colspan=2 class=number><font size=4 color=red>' . _('Total Credited Against Shipments') . ':</font></td> - <td class=number><font size=4 color=red><U>' . number_format($TotalShiptValue,2) . '</U></font></td></tr>'; + echo '<tr><td class=number><font color=red>' . _('Total Credited Against Shipments') . ':</font></td> + <td class=number><fontcolor=red><U>' . number_format($TotalShiptValue,2) . '</U></font></td></tr></table><br />'; } if (count( $_SESSION['SuppTrans']->Contracts) > 0){ /*if there are any contract charges on the invoice*/ - echo '<table cellpadding="2">'; + echo '<table cellpadding="2" class=selection>'; $TableHeader = '<tr><th>' . _('Contract') . '</th> <th>' . _('Amount') . '</th> <th>' . _('Narrative') . '</th></tr>'; @@ -369,18 +369,17 @@ echo '<tr><td class="number">' . _('Total') . ':</font></td> <td class="number">' . number_format($TotalContractsValue,2) . '</td> - </tr></table>'; + </tr></table><br />'; } if ($_SESSION['SuppTrans']->GLLink_Creditors ==1){ if (count($_SESSION['SuppTrans']->GLCodes)>0){ - echo '<table cellpadding=2>'; + echo '<table cellpadding=2 class=selection>'; $TableHeader = '<tr><th>' . _('Account') . '</th> <th>' . _('Name') . '</th> <th>' . _('Amount') . '<br>' . _('in') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th> - <th>' . _('Shipment') . '</th> <th>' . _('Narrative') . '</th></tr>'; echo $TableHeader; @@ -391,7 +390,6 @@ echo '<tr><td>' . $EnteredGLCode->GLCode . '</td> <td>' . $EnteredGLCode->GLActName . '</td> <td class=number>' . number_format($EnteredGLCode->Amount,2) . '</td> - <td>' . $EnteredGLCode->ShiptRef . '</td> <td>' . $EnteredGLCode->Narrative . '</td></tr>'; $TotalGLValue = $TotalGLValue + $EnteredGLCode->Amount; @@ -405,7 +403,7 @@ echo '<tr><td colspan=2 class=number><font size=4 color=red>' . _('Total') . ':</font></td> <td class=number><font size=4 color=red><U>' . number_format($TotalGLValue,2) . '</U></font></td> - </tr></table>'; + </tr></table><br />'; } if (!isset($TotalGRNValue)) { @@ -420,13 +418,13 @@ if (!isset($TotalContractsValue)){ $TotalContractsValue = 0; } - + $_SESSION['SuppTrans']->OvAmount = round($TotalGRNValue + $TotalGLValue + $TotalShiptValue + $TotalContractsValue,2); - - echo '<table><tr><td><font color=red>' . _('Credit Amount in Supplier Currency') . ':</font></td> + + echo '<table class=selection><tr><td><font color=red>' . _('Credit Amount in Supplier Currency') . ':</font></td> <td colspan=2 class=number>' . number_format($_SESSION['SuppTrans']->OvAmount,2) . '</td></tr>'; } else { - echo '<table><tr><td><font color=red>' . _('Credit Amount in Supplier Currency') . + echo '<table class=selection><tr><td><font color=red>' . _('Credit Amount in Supplier Currency') . ':</font></td> <td colspan=2 class=number><input type=TEXT size="12" maxlength="10" name="OvAmount" VALUE=' . number_format($_SESSION['SuppTrans']->OvAmount,2) . '></td></tr>'; } @@ -493,9 +491,9 @@ $DisplayTotal = number_format($_SESSION['SuppTrans']->OvAmount + $TaxTotal,2); echo '<tr><td><font color=red>' . _('Credit Note Total') . '</font></td><td colspan=2 class=number><b>' . - $DisplayTotal. '</b></td></tr></table>'; + $DisplayTotal. '</b></td></tr></table> <br />'; -echo '<table><tr><td><font color=red>' . _('Comments') . '</font></td><td><textarea name=Comments cols=40 rows=2>' . +echo '<table class=selection><tr><td><font color=red>' . _('Comments') . '</font></td><td><textarea name=Comments cols=40 rows=2>' . $_SESSION['SuppTrans']->Comments . '</textarea></td></tr></table>'; echo "<p><div class='centre'><input type=submit name='PostCreditNote' VALUE='" . _('Enter Credit Note') . "'></div>"; @@ -608,7 +606,7 @@ /*GL Items are straight forward - just do the credit postings to the GL accounts specified - the debit is to creditors control act done later for the total credit note value + tax*/ - $SQL = 'INSERT INTO gltrans (type, + $SQL = "INSERT INTO gltrans (type, typeno, trandate, periodno, @@ -617,13 +615,13 @@ amount, jobref) VALUES (21, - ' . $CreditNoteNo . ", + '" . $CreditNoteNo . "', '" . $SQLCreditNoteDate . "', - " . $PeriodNo . ', - ' . $EnteredGLCode->GLCode . ", + '" . $PeriodNo . "', + '" . $EnteredGLCode->GLCode . "', '" . $_SESSION['SuppTrans']->SupplierID . " " . $EnteredGLCode->Narrative . "', - " . round(-$EnteredGLCode->Amount/$_SESSION['SuppTrans']->ExRate,2) . - ", '" . $EnteredGLCode->JobRef . "' + '" . round(-$EnteredGLCode->Amount/$_SESSION['SuppTrans']->ExRate,2) ."', + '' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction could not be added because'); @@ -641,7 +639,7 @@ /*shipment postings are also straight forward - just do the credit postings to the GRN suspense account these entries are reversed from the GRN suspense when the shipment is closed - entries only to open shipts*/ - $SQL = 'INSERT INTO gltrans (type, + $SQL = "INSERT INTO gltrans (type, typeno, trandate, periodno, @@ -649,13 +647,13 @@ narrative, amount) VALUES (21, - ' . $CreditNoteNo . ", + '" . $CreditNoteNo . "', '" . $SQLCreditNoteDate . "', - " . $PeriodNo . ', - ' . $_SESSION['SuppTrans']->GRNAct . ", + '" . $PeriodNo . "', + '" . $_SESSION['SuppTrans']->GRNAct . "', '" . $_SESSION['SuppTrans']->SupplierID . ' ' . _('Shipment credit against') . ' ' . $ShiptChg->ShiptRef . "', - " . round(-$ShiptChg->Amount/$_SESSION['SuppTrans']->ExRate,2) . ' - )'; + '" . round(-$ShiptChg->Amount/$_SESSION['SuppTrans']->ExRate,2) . "' + )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction for the shipment') . ' ' . $ShiptChg->ShiptRef . ' ' . _('could not be added because'); $DbgMsg = _('The following SQL to insert the GL transaction was used'); @@ -665,28 +663,28 @@ $LocalTotal += round($ShiptChg->Amount/$_SESSION['SuppTrans']->ExRate,2); } - + foreach ($_SESSION['SuppTrans']->Contracts as $Contract){ /*contract postings need to get the WIP from the contract item's stock category record * debit postings to this WIP account * the WIP account is tidied up when the contract is closed*/ - $result = DB_query("SELECT wipact FROM stockcategory - INNER JOIN stockmaster ON - stockcategory.categoryid=stockmaster.categoryid + $result = DB_query("SELECT wipact FROM stockcategory + INNER JOIN stockmaster ON + stockcategory.categoryid=stockmaster.categoryid WHERE stockmaster.stockid='" . $Contract->ContractRef . "'",$db); $WIPRow = DB_fetch_row($result); $WIPAccount = $WIPRow[0]; - $SQL = 'INSERT INTO gltrans (type, + $SQL = "INSERT INTO gltrans (type, typeno, trandate, periodno, account, narrative, amount) - VALUES (21, ' . - $CreditNoteNo . ", + VALUES (21, + '" .$CreditNoteNo . "', '" . $SQLCreditNoteDate. "', '" . $PeriodNo . "', '". $WIPAccount . "', @@ -702,7 +700,7 @@ $LocalTotal += ($Contract->Amount/ $_SESSION['SuppTrans']->ExRate); } - + foreach ($_SESSION['SuppTrans']->GRNs as $EnteredGRN){ if (strlen($EnteredGRN->ShiptRef)==0 OR $EnteredGRN->ShiptRef=="" OR $EnteredGRN->ShiptRef==0){ /*so its not a shipment item */ @@ -710,20 +708,21 @@ enter the GL entry to reverse the GRN suspense entry created on delivery at standard cost used on delivery */ if ($EnteredGRN->StdCostUnit * $EnteredGRN->This_QuantityInv != 0) { - $SQL = 'INSERT INTO gltrans (type, + $SQL = "INSERT INTO gltrans (type, typeno, trandate, periodno, account, narrative, amount) - VALUES (21, ' . $CreditNoteNo . ", + VALUES (21, + '" . $CreditNoteNo . "', '" . $SQLCreditNoteDate . "', - " . $PeriodNo . ', - ' . $_SESSION['SuppTrans']->GRNAct . ", + '" . $PeriodNo . "', + '" . $_SESSION['SuppTrans']->GRNAct . "', '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('GRN Credit Note') . ' ' . $EnteredGRN->GRNNo . ' - ' . $EnteredGRN->ItemCode . ' x ' . $EnteredGRN->This_QuantityInv . ' @ ' . _('std cost of') . ' ' . $EnteredGRN->StdCostUnit . "', - " . (-$EnteredGRN->StdCostUnit * $EnteredGRN->This_QuantityInv) . ')'; + '" . (-$EnteredGRN->StdCostUnit * $EnteredGRN->This_QuantityInv) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction could not be added because'); @@ -779,19 +778,22 @@ - $TotalQuantityOnHand) * (($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit); - $SQL = 'INSERT INTO gltrans (type, + $SQL = "INSERT INTO gltrans (type, typeno, trandate, periodno, account, narrative, amount) - VALUES (21, ' . - $CreditNoteNo . ", '" . $SQLCreditNoteDate . "', " . $PeriodNo . ', ' . $StockGLCode['purchpricevaract'] . - ", '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('GRN Credit Note') . ' ' . $EnteredGRN->GRNNo . + VALUES (21, + '" . $CreditNoteNo . "', + '" . $SQLCreditNoteDate . "', + '" . $PeriodNo . "', + '" . $StockGLCode['purchpricevaract'] . "', + '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('GRN Credit Note') . ' ' . $EnteredGRN->GRNNo . ' - ' . $EnteredGRN->ItemCode . ' x ' . ($EnteredGRN->This_QuantityInv-$TotalQuantityOnHand) . ' x ' . _('price var of') . ' ' . number_format(($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit,2) . - "', " . (-$WriteOffToVariances) . ')'; + "', '" . (-$WriteOffToVariances) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction could not be added for the price variance of the stock item because'); $DbgMsg = _('The following SQL to insert the GL transaction was used'); @@ -801,22 +803,22 @@ } /*Now post any remaining price variance to stock rather than price variances */ - $SQL = 'INSERT INTO gltrans (type, + $SQL = "INSERT INTO gltrans (type, typeno, trandate, periodno, account, narrative, amount) - VALUES (21, ' . - $CreditNoteNo . ", - '" . $SQLCreditNoteDate . "', - " . $PeriodNo . ', - ' . $StockGLCode['stockact'] . ", - '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('Average Cost Adj') . - ' - ' . $EnteredGRN->ItemCode . ' x ' . $TotalQuantityOnHand . ' x ' . - number_format(($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit,2) . - "', " . (-($PurchPriceVar - $WriteOffToVariances)) . ')'; + VALUES (21, + '" . $CreditNoteNo . "', + '" . $SQLCreditNoteDate . "', + '" . $PeriodNo . "', + '" . $StockGLCode['stockact'] . "', + '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('Average Cost Adj') . + ' - ' . $EnteredGRN->ItemCode . ' x ' . $TotalQuantityOnHand . ' x ' . + number_format(($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit,2) . "', + '" . (-($PurchPriceVar - $WriteOffToVariances)) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction could not be added for the price variance of the stock item because'); $DbgMsg = _('The following SQL to insert the GL transaction was used'); @@ -850,19 +852,22 @@ } else { //It must be Standard Costing - $SQL = 'INSERT INTO gltrans (type, + $SQL = "INSERT INTO gltrans (type, typeno, trandate, periodno, account, narrative, amount) - VALUES (21, ' . - $CreditNoteNo . ", '" . $SQLCreditNoteDate . "', " . $PeriodNo . ', ' . $StockGLCode['purchpricevaract'] . - ", '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('GRN') . ' ' . $EnteredGRN->GRNNo . - ' - ' . $EnteredGRN->ItemCode . ' x ' . $EnteredGRN->This_QuantityInv . ' x ' . _('price var of') . ' ' . - number_format(($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit,2) . - "', " . (-$PurchPriceVar) . ')'; + VALUES (21, + '" . $CreditNoteNo . "', + '" . $SQLCreditNoteDate . "', + '" . $PeriodNo . "', + '" . $StockGLCode['purchpricevaract'] . "', + '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('GRN') . ' ' . $EnteredGRN->GRNNo . + ' - ' . $EnteredGRN->ItemCode . ' x ' . $EnteredGRN->This_QuantityInv . ' x ' . _('price var of') . ' ' . + number_format(($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit,2) . "', + '" . (-$PurchPriceVar) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction could not be added for the price variance of the stock item because'); $DbgMsg = _('The following SQL to insert the GL transaction was used'); @@ -875,7 +880,7 @@ order price and the actual invoice price since the std cost was made equal to the order price in local currency at the time the goods were received */ - $SQL = 'INSERT INTO gltrans (type, + $SQL = "INSERT INTO gltrans (type, typeno, trandate, periodno, @@ -883,14 +888,14 @@ narrative, amount) VALUES (21, - ' . $CreditNoteNo . ", + '" . $CreditNoteNo . "', '" . $SQLCreditNoteDate . "', - " . $PeriodNo . ', - ' . $EnteredGRN->GLCode . ", - '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('GRN') . ' ' . $EnteredGRN->GRNNo . ' - ' . + '" . $PeriodNo . "', + '" . $EnteredGRN->GLCode . "', + '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('GRN') . ' ' . $EnteredGRN->GRNNo . ' - ' . $EnteredGRN->ItemDescription . ' x ' . $EnteredGRN->This_QuantityInv . ' x ' . _('price var') . ' ' . number_format(($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit,2) . "', - " . (-$PurchPriceVar) . ')'; + '" . (-$PurchPriceVar) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction could not be added for the price variance of the stock item because'); @@ -903,7 +908,7 @@ /*then its a purchase order item on a shipment - whole charge amount to GRN suspense pending closure of the shipment when the variance is calculated and the GRN act cleared up for the shipment */ - $SQL = 'INSERT INTO gltrans (type, + $SQL = "INSERT INTO gltrans (type, typeno, trandate, periodno, @@ -911,13 +916,14 @@ narrative, amount) VALUES (21, - ' . $CreditNoteNo . ", + '" . $CreditNoteNo . "', '" . $SQLCreditNoteDate . "', - " . $PeriodNo . ', - ' . $_SESSION['SuppTrans']->GRNAct . ", - '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('GRN') .' ' . $EnteredGRN->GRNNo . ' - ' . $EnteredGRN->ItemCode . ' x ' . $EnteredGRN->This_QuantityInv . ' @ ' . $_SESSION['SuppTrans']->CurrCode . $EnteredGRN->ChgPrice . ' @ ' . _('a rate of') . ' ' . $_SESSION['SuppTrans']->ExRate . "', - " . round(-$EnteredGRN->ChgPrice * $EnteredGRN->This_QuantityInv,2) / $_SESSION['SuppTrans']->ExRate . ' - )'; + '" . $PeriodNo . "', + '" . $_SESSION['SuppTrans']->GRNAct . "', + '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('GRN') .' ' . $EnteredGRN->GRNNo . ' - ' . $EnteredGRN->ItemCode . ' x ' . + $EnteredGRN->This_QuantityInv . ' @ ' . $_SESSION['SuppTrans']->CurrCode . $EnteredGRN->ChgPrice . ' @ ' . _('a rate of') . ' ' . $_SESSION['SuppTrans']->ExRate . "', + '" . round(-$EnteredGRN->ChgPrice * $EnteredGRN->This_QuantityInv,2) / $_SESSION['SuppTrans']->ExRate . "' + )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction could not be added because'); $DbgMsg = _('The following SQL to insert the GL transaction was used'); @@ -936,34 +942,33 @@ foreach ($_SESSION['SuppTrans']->Taxes as $Tax){ /* Now the TAX account */ if ($Tax->TaxOvAmount/ $_SESSION['SuppTrans']->ExRate !=0){ - $SQL = 'INSERT INTO gltrans (type, + $SQL = "INSERT INTO gltrans (type, typeno, trandate, periodno, account, narrative, amount) - VALUES (21, ' . - $CreditNoteNo . ", + VALUES (21, + '" . $CreditNoteNo . "', '" . $SQLCreditNoteDate . "', - " . $PeriodNo . ', - ' . $Tax->TaxGLCode . ", + '" . $PeriodNo . "', + '" . $Tax->TaxGLCode . "', '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('Credit note') . ' ' . $_SESSION['SuppTrans']->SuppReference . ' ' . $_SESSION['SuppTrans']->CurrCode . - $Tax->TaxOvAmount . ' @ ' . _('a rate of') . ' ' . $_SESSION['SuppTrans']->ExRate . - "', - " . round(-$Tax->TaxOvAmount/ $_SESSION['SuppTrans']->ExRate,2) . ')'; + $Tax->TaxOvAmount . ' @ ' . _('a rate of') . ' ' . $_SESSION['SuppTrans']->ExRate . "', + '" . round(-$Tax->TaxOvAmount/ $_SESSION['SuppTrans']->ExRate,2) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction for the tax could not be added because'); $DbgMsg = _('The following SQL to insert the GL transaction was used'); - + $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, True); }/* if the tax is not 0 */ } /*end of loop to post the tax */ /* Now the control account */ - $SQL = 'INSERT INTO gltrans (type, + $SQL = "INSERT INTO gltrans (type, typeno, trandate, periodno, @@ -971,12 +976,12 @@ narrative, amount) VALUES (21, - ' . $CreditNoteNo . ", + '" . $CreditNoteNo . "', '" . $SQLCreditNoteDate . "', - " . $PeriodNo . ', - ' . $_SESSION['SuppTrans']->CreditorsAct . ", + '" . $PeriodNo . "', + '" . $_SESSION['SuppTrans']->CreditorsAct . "', '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('Credit Note') . ' ' . $_SESSION['SuppTrans']->SuppReference . ' ' . $_SESSION['SuppTrans']->CurrCode . number_format($_SESSION['SuppTrans']->OvAmount + $_SESSION['SuppTrans']->OvGST,2) . ' @ ' . _('a rate of') . ' ' . $_SESSION['SuppTrans']->ExRate . "', - " . round($LocalTotal + ($TaxTotal / $_SESSION['SuppTrans']->ExRate),2) . ')'; + '" . round($LocalTotal + ($TaxTotal / $_SESSION['SuppTrans']->ExRate),2) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction for the control total could not be added because'); $DbgMsg = _('The following SQL to insert the GL transaction was used'); @@ -986,7 +991,7 @@ /*Now insert the credit note into the SuppTrans table*/ - $SQL = 'INSERT INTO supptrans (transno, + $SQL = "INSERT INTO supptrans (transno, type, supplierno, suppreference, @@ -997,16 +1002,17 @@ ovgst, rate, transtext) - VALUES ('. $CreditNoteNo . ", + VALUES ( + '". $CreditNoteNo . "', 21, '" . $_SESSION['SuppTrans']->SupplierID . "', '" . $_SESSION['SuppTrans']->SuppReference . "', '" . $SQLCreditNoteDate . "', '" . FormatDateForSQL($_SESSION['SuppTrans']->DueDate) . "', '" . Date('Y-m-d H-i-s') . "', - " . round(-$_SESSION['SuppTrans']->OvAmount,2) . ', - ' .round(-$TaxTotal,2) . ', - ' . $_SESSION['SuppTrans']->ExRate . ", + '" . round(-$_SESSION['SuppTrans']->OvAmount,2) . "', + '" .round(-$TaxTotal,2) . "', + '" . $_SESSION['SuppTrans']->ExRate . "', '" . $_SESSION['SuppTrans']->Comments . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The supplier credit note transaction could not be added to the database because'); @@ -1018,12 +1024,13 @@ /* Insert the tax totals for each tax authority where tax was charged on the invoice */ foreach ($_SESSION['SuppTrans']->Taxes AS $TaxTotals) { - $SQL = 'INSERT INTO supptranstaxes (supptransid, + $SQL = "INSERT INTO supptranstaxes (supptransid, taxauthid, taxamount) - VALUES (' . $SuppTransID . ', - ' . $TaxTotals->TaxAuthID . ', - ' . -$TaxTotals->TaxOvAmount . ')'; + VALUES ( + '" . $SuppTransID . "', + '" . $TaxTotals->TaxAuthID . "', + '" . -$TaxTotals->TaxOvAmount . "')"; $ErrMsg =_('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The supplier transaction taxes records could not be inserted because'); $DbgMsg = _('The following SQL to insert the supplier transaction taxes record was used:'); @@ -1034,15 +1041,15 @@ foreach ($_SESSION['SuppTrans']->GRNs as $EnteredGRN){ - $SQL = 'UPDATE purchorderdetails SET qtyinvoiced = qtyinvoiced - ' . - $EnteredGRN->This_QuantityInv . ' WHERE podetailitem = ' . $EnteredGRN->PODetailItem; + $SQL = "UPDATE purchorderdetails SET qtyinvoiced = qtyinvoiced - " . + $EnteredGRN->This_QuantityInv . " WHERE podetailitem = '" . $EnteredGRN->PODetailItem ."'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The quantity credited of the purchase order line could not be updated because'); $DbgMsg = _('The following SQL to update the purchase order details was used'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, True); - $SQL = 'UPDATE grns SET quantityinv = quantityinv - ' . - $EnteredGRN->This_QuantityInv . ' WHERE grnno = ' . $EnteredGRN->GRNNo; + $SQL = "UPDATE grns SET quantityinv = quantityinv - " . + $EnteredGRN->This_QuantityInv . " WHERE grnno = '" . $EnteredGRN->GRNNo . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The quantity credited off the goods received record could not be updated because'); $DbgMsg = _('The following SQL to update the GRN quantity credited was used'); @@ -1055,17 +1062,18 @@ if (strlen($EnteredGRN->ShiptRef)>0 AND $EnteredGRN->ShiptRef!=0){ /* and insert the shipment charge records */ - $SQL = 'INSERT INTO shipmentcharges (shiptref, + $SQL = "INSERT INTO shipmentcharges (shiptref, transtype, transno, stockid, value) - VALUES (' . $EnteredGRN->ShiptRef . ', + VALUES ( + '" . $EnteredGRN->ShiptRef . "', 21, - ' . $CreditNoteNo . ", + '" . $CreditNoteNo . "', '" . $EnteredGRN->ItemCode . "', - " . round(-$EnteredGRN->This_QuantityInv * $EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate,2) . ' - )'; + '" . round(-$EnteredGRN->This_QuantityInv * $EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate,2) . "' + )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The shipment charge record for the shipment') . ' ' . $EnteredGRN->ShiptRef . ' ' . _('could not be added because'); $DbgMsg = _('The following SQL to insert the Shipment charge record was used'); @@ -1079,15 +1087,16 @@ foreach ($_SESSION['SuppTrans']->Shipts as $ShiptChg){ - $SQL = 'INSERT INTO shipmentcharges (shiptref, + $SQL = "INSERT INTO shipmentcharges (shiptref, transtype, transno, value) - VALUES (' . $ShiptChg->ShiptRef . ', + VALUES ( + '" . $ShiptChg->ShiptRef . "', 21, - ' . $CreditNoteNo . ', - ' . (-$ShiptChg->Amount/$_SESSION['SuppTrans']->ExRate) . ' - )'; + '" . $CreditNoteNo . "', + '" . (-$ShiptChg->Amount/$_SESSION['SuppTrans']->ExRate) . "' + )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The shipment charge record for the shipment') . ' ' . $ShiptChg->ShiptRef . ' ' . _('could not be added because'); $DbgMsg = _('The following SQL to insert the Shipment charge record was used'); @@ -1097,24 +1106,25 @@ /*Add contract charges records as necessary */ foreach ($_SESSION['SuppTrans']->Contracts as $Contract){ - + if($Contract->AnticipatedCost ==true){ $Anticipated =1; } else { $Anticipated =0; } $SQL = "INSERT INTO contractcharges (contractref, - transtype, - transno, - amount, - narrative, - anticipated) - VALUES ('" . $Contract->ContractRef . "', - '21', - '" . $CreditNoteNo . "', - '" . -$Contract->Amount/ $_SESSION['SuppTrans']->ExRate . "', - '" . $Contract->Narrative . "', - '" . $Anticipated . "')"; + transtype, + transno, + amount, + narrative, + anticipated) + VALUES ( + '" . $Contract->ContractRef . "', + '21', + '" . $CreditNoteNo . "', + '" . -$Contract->Amount/ $_SESSION['SuppTrans']->ExRate . "', + '" . $Contract->Narrative . "', + '" . $Anticipated . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The contract charge record for contract') . ' ' . $Contract->ContractRef . ' ' . _('could not be added because'); $DbgMsg = _('The following SQL to insert the contract charge record was used'); @@ -1122,7 +1132,7 @@ } DB_Txn_Commit($db); - + prnMsg(_('Supplier credit note number') . ' ' . $CreditNoteNo . ' ' . _('has been processed'),'success'); echo '<br><div class="centre"><a href="' . $rootpath . '/SupplierCredit.php?&SupplierID=' .$_SESSION['SuppTrans']->SupplierID . '">' . _('Enter another Credit Note for this Supplier') . '</a></div>'; unset($_SESSION['SuppTrans']->GRNs); @@ -1137,4 +1147,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-09-27 15:38:46 UTC (rev 3803) +++ trunk/doc/Change.log.html 2010-09-27 18:28:04 UTC (rev 3804) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>27/09/10 Tim: SupplierCredit.php - SQL quoting corrections and layout changes and improvements</p> <p>27/09/10 Tim: SupplierContacts.php - SQL quoting corrections and layout changes and improvements</p> <p>27/09/10 Tim: SupplierBalsAtPeriodEnd.php - Layout changes and improvements</p> <p>27/09/10 Tim: SupplierAllocations.php - SQL quoting corrections and layout changes and improvements</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-27 18:38:53
|
Revision: 3805 http://web-erp.svn.sourceforge.net/web-erp/?rev=3805&view=rev Author: tim_schofield Date: 2010-09-27 18:38:47 +0000 (Mon, 27 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements Modified Paths: -------------- trunk/SupplierInquiry.php trunk/doc/Change.log.html Modified: trunk/SupplierInquiry.php =================================================================== --- trunk/SupplierInquiry.php 2010-09-27 18:28:04 UTC (rev 3804) +++ trunk/SupplierInquiry.php 2010-09-27 18:38:47 UTC (rev 3805) @@ -133,7 +133,7 @@ } -echo "<table WIDTH=90% BORDER=1><tr><th>" . _('Total Balance') . +echo "<table width=90% class=selection><tr><th>" . _('Total Balance') . "</th><th>" . _('Current') . "</th><th>" . _('Now Due') . "</th><th>" . $_SESSION['PastDueDays1'] . '-' . $_SESSION['PastDueDays2'] . @@ -148,7 +148,7 @@ echo "<br><div class='centre'><form action='" . $_SERVER['PHP_SELF'] . "?" . SID . "' method=post>"; echo _('Show all transactions after') . ': ' ."<input type=text class='date' alt='".$_SESSION['DefaultDateFormat']."' name='TransAfterDate' VALUE='" . - $_POST['TransAfterDate'] . "' MAXLENGTH =10 size=10> <input type=submit name='Refresh Inquiry' VALUE='" . _('Refresh Inquiry') . "'></form><br>"; + $_POST['TransAfterDate'] . "' maxlength =10 size=10> <input type=submit name='Refresh Inquiry' VALUE='" . _('Refresh Inquiry') . "'></form><br>"; echo '</div>'; $DateAfterCriteria = FormatDateForSQL($_POST['TransAfterDate']); @@ -169,7 +169,7 @@ systypes WHERE supptrans.type = systypes.typeid AND supptrans.supplierno = '" . $SupplierID . "' - AND supptrans.trandate >= '$DateAfterCriteria' + AND supptrans.trandate >= '" . $DateAfterCriteria . "' ORDER BY supptrans.trandate"; $ErrMsg = _('No transactions were returned by the SQL because'); @@ -187,7 +187,7 @@ /*show a table of the transactions returned by the SQL */ -echo '<table width="90%" cellpadding="2" colspan="7">'; +echo '<table width="90%" cellpadding="2" colspan="7" class=selection>'; $TableHeader = "<tr BGCOLOR =#800000><th>" . _('Trans') . ' #' . "</th><th>" . _('Type') . "</th><th>" . _('Supplier Ref') . @@ -397,4 +397,4 @@ echo '</table>'; include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-27 18:28:04 UTC (rev 3804) +++ trunk/doc/Change.log.html 2010-09-27 18:38:47 UTC (rev 3805) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>27/09/10 Tim: SupplierInquiry.php - SQL quoting corrections and layout changes and improvements</p> <p>27/09/10 Tim: SupplierCredit.php - SQL quoting corrections and layout changes and improvements</p> <p>27/09/10 Tim: SupplierContacts.php - SQL quoting corrections and layout changes and improvements</p> <p>27/09/10 Tim: SupplierBalsAtPeriodEnd.php - Layout changes and improvements</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-27 19:58:03
|
Revision: 3806 http://web-erp.svn.sourceforge.net/web-erp/?rev=3806&view=rev Author: tim_schofield Date: 2010-09-27 19:57:56 +0000 (Mon, 27 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements Modified Paths: -------------- trunk/SupplierInvoice.php trunk/doc/Change.log.html Modified: trunk/SupplierInvoice.php =================================================================== --- trunk/SupplierInvoice.php 2010-09-27 18:38:47 UTC (rev 3805) +++ trunk/SupplierInvoice.php 2010-09-27 19:57:56 UTC (rev 3806) @@ -211,7 +211,7 @@ /* everything below here only do if a Supplier is selected fisrt add a header to show who we are making an invoice for */ - echo '<table border=2 colspan=4><tr><th>' . _('Supplier') . '</th> + echo '<br /><table class=selection colspan=4><tr><th>' . _('Supplier') . '</th> <th>' . _('Currency') . '</th> <th>' . _('Terms') . '</th> <th>' . _('Tax Authority') . '</th></tr>'; @@ -226,7 +226,7 @@ echo '<br><form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method="post" name="form1">'; - echo '<table>'; + echo '<br /><table class=selection>'; echo '<tr><td>' . _('Supplier Invoice Reference') . ':</td> <td><input type="text" size="20" maxlength="20" name="SuppReference" VALUE="' . @@ -257,7 +257,7 @@ if (count( $_SESSION['SuppTrans']->GRNs)>0){ /*if there are any GRNs selected for invoicing then */ /*Show all the selected GRNs so far from the SESSION['SuppInv']->GRNs array */ - echo '<table cellpadding=2>'; + echo '<br /><table cellpadding=2 class=selection>'; $tableheader = '<tr bgcolor=#800000><th>' . _('Seq') . ' #</th> <th>' . _('Item Code') . '</th> <th>' . _('Description') . '</th> @@ -288,7 +288,7 @@ if (count( $_SESSION['SuppTrans']->Shipts) > 0){ /*if there are any Shipment charges on the invoice*/ - echo '<table cellpadding=2>'; + echo '<br /><table cellpadding=2 class=selection>'; $TableHeader = "<tr><th>" . _('Shipment') . "</th> <th>" . _('Amount') . '</th></tr>'; echo $TableHeader; @@ -315,7 +315,7 @@ if (count( $_SESSION['SuppTrans']->Contracts) > 0){ /*if there are any contract charges on the invoice*/ - echo '<table cellpadding="2">'; + echo '<br /><table cellpadding="2" class=selection>'; $TableHeader = '<tr><th>' . _('Contract') . '</th> <th>' . _('Amount') . '</th> <th>' . _('Narrative') . '</th></tr>'; @@ -348,7 +348,7 @@ if ( $_SESSION['SuppTrans']->GLLink_Creditors == 1){ if (count($_SESSION['SuppTrans']->GLCodes) > 0){ - echo '<br><table cellpadding=2>'; + echo '<br /><table cellpadding=2 class=selection>'; $TableHeader = '<tr><th>' . _('Account') . '</th> <th>' . _('Name') . '</th> <th>' . _('Amount') . '<br>' . _('in') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th> @@ -389,10 +389,10 @@ } $_SESSION['SuppTrans']->OvAmount = ($TotalGRNValue + $TotalGLValue + $TotalShiptValue + $TotalContractsValue); - echo '<br><table><tr><td>' . _('Amount in supplier currency') . ':</td><td colspan=2 class=number>' . + echo '<br /><table class=selection><tr><td>' . _('Amount in supplier currency') . ':</td><td colspan=2 class=number>' . number_format( $_SESSION['SuppTrans']->OvAmount,2) . '</td></tr>'; } else { - echo '<table><tr><td>' . _('Amount in supplier currency') . + echo '<br /><table class=selection><tr><td>' . _('Amount in supplier currency') . ':</td><td colspan=2 class=number><input type="text" size="12" maxlength="10" name="OvAmount" VALUE=' . number_format( $_SESSION['SuppTrans']->OvAmount,2) . '></td></tr>'; } @@ -463,7 +463,7 @@ echo '<tr><td>' . _('Invoice Total') . ':</td><td colspan=2 class=number><b>' . $DisplayTotal . '</b></td></tr></table>'; - echo '<table><tr><td>' . _('Comments') . '</td><td><TEXTAREA name=Comments COLS=40 ROWS=2>' . + echo '<br /><table class=selection><tr><td>' . _('Comments') . '</td><td><TEXTAREA name=Comments COLS=40 ROWS=2>' . $_SESSION['SuppTrans']->Comments . '</TEXTAREa></td></tr></table>'; echo "<p><div class='centre'><input type=submit name='PostInvoice' VALUE='" . _('Enter Invoice') . "'></div>"; @@ -607,7 +607,7 @@ /*GL Items are straight forward - just do the debit postings to the GL accounts specified - the credit is to creditors control act done later for the total invoice value + tax*/ - $SQL = 'INSERT INTO gltrans (type, + $SQL = "INSERT INTO gltrans (type, typeno, trandate, periodno, @@ -615,13 +615,13 @@ narrative, amount, jobref) - VALUES (20, ' . - $InvoiceNo . ", + VALUES (20, + '" . $InvoiceNo . "', '" . $SQLInvoiceDate . "', - " . $PeriodNo . ', - ' . $EnteredGLCode->GLCode . ", + '" . $PeriodNo . "', + '" . $EnteredGLCode->GLCode . "', '" . $_SESSION['SuppTrans']->SupplierID . ' ' . $EnteredGLCode->Narrative . "', - " . round($EnteredGLCode->Amount/ $_SESSION['SuppTrans']->ExRate,2) . ", + '" . round($EnteredGLCode->Amount/ $_SESSION['SuppTrans']->ExRate,2) . "', '" . $EnteredGLCode->JobRef . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction could not be added because'); @@ -637,20 +637,20 @@ /*shipment postings are also straight forward - just do the debit postings to the GRN suspense account these entries are reversed from the GRN suspense when the shipment is closed*/ - $SQL = 'INSERT INTO gltrans (type, + $SQL = "INSERT INTO gltrans (type, typeno, trandate, periodno, account, narrative, amount) - VALUES (20, ' . - $InvoiceNo . ", + VALUES (20, + '" . $InvoiceNo . "', '" . $SQLInvoiceDate . "', - " . $PeriodNo . ', - ' . $_SESSION['SuppTrans']->GRNAct . ", + '" . $PeriodNo . "', + '" . $_SESSION['SuppTrans']->GRNAct . "', '" . $_SESSION['SuppTrans']->SupplierID . ' ' . _('Shipment charge against') . ' ' . $ShiptChg->ShiptRef . "', - " . round($ShiptChg->Amount/ $_SESSION['SuppTrans']->ExRate,2) . ')'; + '" . round($ShiptChg->Amount/ $_SESSION['SuppTrans']->ExRate,2) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction for the shipment') . ' ' . $ShiptChg->ShiptRef . ' ' . _('could not be added because'); @@ -662,10 +662,10 @@ $LocalTotal += round($ShiptChg->Amount/ $_SESSION['SuppTrans']->ExRate,2); } - $sql='SELECT conversionfactor + $sql="SELECT conversionfactor FROM purchdata - WHERE supplierno="'.$_SESSION['SuppTrans']->SupplierID.'" - AND stockid="'.$EnteredGRN->ItemCode.'"'; + WHERE supplierno='".$_SESSION['SuppTrans']->SupplierID."' + AND stockid='".$EnteredGRN->ItemCode."'"; $result=DB_query($sql, $db); if (DB_num_rows($result)>0) { $myrow=DB_fetch_array($result); @@ -683,20 +683,20 @@ $EnteredGRN->StdCostUnit=0; } // If WeightedAverageCosting=1, directly posting purchasing cost to material if ($EnteredGRN->StdCostUnit * ($EnteredGRN->This_QuantityInv * $conversionfactor) != 0) { - $SQL = 'INSERT INTO gltrans (type, + $SQL = "INSERT INTO gltrans (type, typeno, trandate, periodno, account, narrative, amount) - VALUES (20, ' . $InvoiceNo . ", + VALUES (20, '" . $InvoiceNo . "', '" . $SQLInvoiceDate . "', - " . $PeriodNo . ', - ' . $_SESSION['SuppTrans']->GRNAct . ", + '" . $PeriodNo . "', + '" . $_SESSION['SuppTrans']->GRNAct . "', '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('GRN') . ' ' . $EnteredGRN->GRNNo . ' - ' . $EnteredGRN->ItemCode . ' x ' . $EnteredGRN->This_QuantityInv * $conversionfactor . ' @ ' . _('std cost of') . ' ' . $EnteredGRN->StdCostUnit . "', - " . round($EnteredGRN->StdCostUnit * $EnteredGRN->This_QuantityInv * $conversionfactor,2) . ')'; + '" . round($EnteredGRN->StdCostUnit * $EnteredGRN->This_QuantityInv * $conversionfactor,2) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction could not be added because'); @@ -759,19 +759,22 @@ - $TotalQuantityOnHand) * (($EnteredGRN->ChgPric / $conversionfactor/ $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit); - $SQL = 'INSERT INTO gltrans (type, + $SQL = "INSERT INTO gltrans (type, typeno, trandate, periodno, account, narrative, amount) - VALUES (20, ' . - $InvoiceNo . ", '" . $SQLInvoiceDate . "', " . $PeriodNo . ', ' . $StockGLCode['purchpricevaract'] . - ", '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('GRN') . ' ' . $EnteredGRN->GRNNo . + VALUES (20, + '" . $InvoiceNo . "', + '" . $SQLInvoiceDate . "', + '" . $PeriodNo . "', + '" . $StockGLCode['purchpricevaract'] . "', + '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('GRN') . ' ' . $EnteredGRN->GRNNo . ' - ' . $EnteredGRN->ItemCode . ' x ' . ($EnteredGRN->This_QuantityInv * $conversionfactor-$TotalQuantityOnHand) . ' x ' . _('price var of') . ' ' . - round(($EnteredGRN->ChgPrice / $conversionfactor / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit,2) . - "', " . $WriteOffToVariances . ')'; + round(($EnteredGRN->ChgPrice / $conversionfactor / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit,2) . "', + '" . $WriteOffToVariances . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction could not be added for the price variance of the stock item because'); $DbgMsg = _('The following SQL to insert the GL transaction was used'); @@ -781,22 +784,22 @@ } /*Now post any remaining price variance to stock rather than price variances */ - $SQL = 'INSERT INTO gltrans (type, + $SQL = "INSERT INTO gltrans (type, typeno, trandate, periodno, account, narrative, amount) - VALUES (20, ' . - $InvoiceNo . ", + VALUES (20, + '" . $InvoiceNo . "', '" . $SQLInvoiceDate . "', - " . $PeriodNo . ', - ' . $StockGLCode['stockact'] . ", + '" . $PeriodNo . "', + '" . $StockGLCode['stockact'] . "', '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('Average Cost Adj') . ' - ' . $EnteredGRN->ItemCode . ' x ' . $TotalQuantityOnHand . ' x ' . - round(($EnteredGRN->ChgPrice / $conversionfactor / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit,2) . - "', " . ($PurchPriceVar - $WriteOffToVariances) . ')'; + round(($EnteredGRN->ChgPrice / $conversionfactor / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit,2) . "', + '" . ($PurchPriceVar - $WriteOffToVariances) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction could not be added for the price variance of the stock item because'); $DbgMsg = _('The following SQL to insert the GL transaction was used'); @@ -830,19 +833,22 @@ } else { //It must be Standard Costing - $SQL = 'INSERT INTO gltrans (type, + $SQL = "INSERT INTO gltrans (type, typeno, trandate, periodno, account, narrative, amount) - VALUES (20, ' . - $InvoiceNo . ", '" . $SQLInvoiceDate . "', " . $PeriodNo . ', ' . $StockGLCode['purchpricevaract'] . - ", '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('GRN') . ' ' . $EnteredGRN->GRNNo . + VALUES (20, + '" . $InvoiceNo . "', + '" . $SQLInvoiceDate . "', + '" . $PeriodNo . "', + '" . $StockGLCode['purchpricevaract'] . "', + '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('GRN') . ' ' . $EnteredGRN->GRNNo . ' - ' . $EnteredGRN->ItemCode . ' x ' . $EnteredGRN->This_QuantityInv . ' x ' . _('price var of') . ' ' . - round(($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit,2) . - "', " . $PurchPriceVar . ')'; + round(($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit,2) . "', + '" . $PurchPriceVar . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction could not be added for the price variance of the stock item because'); $DbgMsg = _('The following SQL to insert the GL transaction was used'); @@ -855,7 +861,7 @@ order price and the actual invoice price since the std cost was made equal to the order price in local currency at the time the goods were received */ - $SQL = 'INSERT INTO gltrans (type, + $SQL = "INSERT INTO gltrans (type, typeno, trandate, periodno, @@ -863,14 +869,14 @@ narrative, amount) VALUES (20, - ' . $InvoiceNo . ", + '" . $InvoiceNo . "', '" . $SQLInvoiceDate . "', - " . $PeriodNo . ', - ' . $EnteredGRN->GLCode . ", - '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('GRN') . ' ' . $EnteredGRN->GRNNo . ' - ' . + '" . $PeriodNo . "', + '" . $EnteredGRN->GLCode . "', + '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('GRN') . ' ' . $EnteredGRN->GRNNo . ' - ' . $EnteredGRN->ItemDescription . ' x ' . $EnteredGRN->This_QuantityInv . ' x ' . _('price var') . ' ' . round(($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit,2) . "', - " . $PurchPriceVar . ')'; + '" . $PurchPriceVar . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction could not be added for the price variance of the stock item because'); @@ -883,20 +889,23 @@ } else { /*then its a purchase order item on a shipment - whole charge amount to GRN suspense pending closure of the shipment when the variance is calculated and the GRN act cleared up for the shipment */ - $SQL = 'INSERT INTO gltrans (type, + $SQL = "INSERT INTO gltrans (type, typeno, trandate, periodno, account, narrative, amount) - VALUES (20, ' . - $InvoiceNo . ", '" . $SQLInvoiceDate . "', " . $PeriodNo . ', ' . $_SESSION['SuppTrans']->GRNAct . - ", '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('GRN') . ' ' . $EnteredGRN->GRNNo . ' - ' . + VALUES (20, + '" . $InvoiceNo . "', + '" . $SQLInvoiceDate . "', + '" . $PeriodNo . "', + '" . $_SESSION['SuppTrans']->GRNAct . "', + '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('GRN') . ' ' . $EnteredGRN->GRNNo . ' - ' . $EnteredGRN->ItemCode . ' x ' . $EnteredGRN->This_QuantityInv . ' @ ' . $_SESSION['SuppTrans']->CurrCode . ' ' . $EnteredGRN->ChgPrice . ' @ ' . _('a rate of') . ' ' . - $_SESSION['SuppTrans']->ExRate . "', " . - round(($EnteredGRN->ChgPrice * $EnteredGRN->This_QuantityInv) / $_SESSION['SuppTrans']->ExRate,2) . ')'; + $_SESSION['SuppTrans']->ExRate . "', + '" . round(($EnteredGRN->ChgPrice * $EnteredGRN->This_QuantityInv) / $_SESSION['SuppTrans']->ExRate,2) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction could not be added because'); @@ -917,23 +926,22 @@ foreach ($_SESSION['SuppTrans']->Taxes as $Tax){ /* Now the TAX account */ if ($Tax->TaxOvAmount <>0){ - $SQL = 'INSERT INTO gltrans (type, + $SQL = "INSERT INTO gltrans (type, typeno, trandate, periodno, account, narrative, amount) - VALUES (20, ' . - $InvoiceNo . ", - '" . $SQLInvoiceDate . "', - " . $PeriodNo . ', - ' . $Tax->TaxGLCode . ", - '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('Inv') . ' ' . + VALUES (20, + '" . $InvoiceNo . "', + '" . $SQLInvoiceDate . "', + '" . $PeriodNo . "', + '" . $Tax->TaxGLCode . "', + '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('Inv') . ' ' . $_SESSION['SuppTrans']->SuppReference . ' ' . $Tax->TaxAuthDescription . ' ' . number_format($Tax->TaxRate*100,2) . '% ' . $_SESSION['SuppTrans']->CurrCode . - $Tax->TaxOvAmount . ' @ ' . _('exch rate') . ' ' . $_SESSION['SuppTrans']->ExRate . - "', - " . round( $Tax->TaxOvAmount/ $_SESSION['SuppTrans']->ExRate,2) . ')'; + $Tax->TaxOvAmount . ' @ ' . _('exch rate') . ' ' . $_SESSION['SuppTrans']->ExRate . "', + '" . round( $Tax->TaxOvAmount/ $_SESSION['SuppTrans']->ExRate,2) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction for the tax could not be added because'); @@ -945,20 +953,23 @@ } /*end of loop to post the tax */ /* Now the control account */ - $SQL = 'INSERT INTO gltrans (type, + $SQL = "INSERT INTO gltrans (type, typeno, trandate, periodno, account, narrative, amount) - VALUES (20, ' . - $InvoiceNo . ", '" . $SQLInvoiceDate . "', " . $PeriodNo . ', ' . $_SESSION['SuppTrans']->CreditorsAct . - ", '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('Inv') . ' ' . + VALUES (20, + '" . $InvoiceNo . "', + '" . $SQLInvoiceDate . "', + '" . $PeriodNo . "', + '" . $_SESSION['SuppTrans']->CreditorsAct . "', + '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('Inv') . ' ' . $_SESSION['SuppTrans']->SuppReference . ' ' . $_SESSION['SuppTrans']->CurrCode . number_format( $_SESSION['SuppTrans']->OvAmount + $TaxTotal,2) . - ' @ ' . _('a rate of') . ' ' . $_SESSION['SuppTrans']->ExRate . "', " . - -round(($LocalTotal + ( $TaxTotal / $_SESSION['SuppTrans']->ExRate)),2) . ')'; + ' @ ' . _('a rate of') . ' ' . $_SESSION['SuppTrans']->ExRate . "', + '" . -round(($LocalTotal + ( $TaxTotal / $_SESSION['SuppTrans']->ExRate)),2) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction for the control total could not be added because'); @@ -970,7 +981,7 @@ /*Now insert the invoice into the SuppTrans table*/ - $SQL = 'INSERT INTO supptrans (transno, + $SQL = "INSERT INTO supptrans (transno, type, supplierno, suppreference, @@ -980,15 +991,16 @@ ovgst, rate, transtext) - VALUES ('. $InvoiceNo . ", + VALUES ( + '". $InvoiceNo . "', 20 , '" . $_SESSION['SuppTrans']->SupplierID . "', '" . $_SESSION['SuppTrans']->SuppReference . "', '" . $SQLInvoiceDate . "', '" . FormatDateForSQL($_SESSION['SuppTrans']->DueDate) . "', - " . round($_SESSION['SuppTrans']->OvAmount,2) . ', - ' . round($TaxTotal,2) . ', - ' . $_SESSION['SuppTrans']->ExRate . ", + '" . round($_SESSION['SuppTrans']->OvAmount,2) . "', + '" . round($TaxTotal,2) . "', + '" . $_SESSION['SuppTrans']->ExRate . "', '" . $_SESSION['SuppTrans']->Comments . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The supplier invoice transaction could not be added to the database because'); @@ -1002,12 +1014,13 @@ /* Insert the tax totals for each tax authority where tax was charged on the invoice */ foreach ($_SESSION['SuppTrans']->Taxes AS $TaxTotals) { - $SQL = 'INSERT INTO supptranstaxes (supptransid, + $SQL = "INSERT INTO supptranstaxes (supptransid, taxauthid, taxamount) - VALUES (' . $SuppTransID . ', - ' . $TaxTotals->TaxAuthID . ', - ' . $TaxTotals->TaxOvAmount . ')'; + VALUES ( + '" . $SuppTransID . "', + '" . $TaxTotals->TaxAuthID . "', + '" . $TaxTotals->TaxOvAmount . "')"; $ErrMsg =_('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The supplier transaction taxes records could not be inserted because'); $DbgMsg = _('The following SQL to insert the supplier transaction taxes record was used:'); @@ -1018,9 +1031,9 @@ foreach ($_SESSION['SuppTrans']->GRNs as $EnteredGRN){ - $SQL = 'UPDATE purchorderdetails SET qtyinvoiced = qtyinvoiced + ' . $EnteredGRN->This_QuantityInv .', - actprice = ' . $EnteredGRN->ChgPrice . ' - WHERE podetailitem = ' . $EnteredGRN->PODetailItem; + $SQL = "UPDATE purchorderdetails SET qtyinvoiced = qtyinvoiced + " . $EnteredGRN->This_QuantityInv .", + actprice = '" . $EnteredGRN->ChgPrice . "' + WHERE podetailitem = '" . $EnteredGRN->PODetailItem . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The quantity invoiced of the purchase order line could not be updated because'); @@ -1028,8 +1041,8 @@ $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, True); - $SQL = 'UPDATE grns SET quantityinv = quantityinv + ' . $EnteredGRN->This_QuantityInv . - ' WHERE grnno = ' . $EnteredGRN->GRNNo; + $SQL = "UPDATE grns SET quantityinv = quantityinv + " . $EnteredGRN->This_QuantityInv . + " WHERE grnno = '" . $EnteredGRN->GRNNo . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The quantity invoiced off the goods received record could not be updated because'); @@ -1042,16 +1055,17 @@ /* insert the shipment charge records */ - $SQL = 'INSERT INTO shipmentcharges (shiptref, + $SQL = "INSERT INTO shipmentcharges (shiptref, transtype, transno, stockid, value) - VALUES (' . $EnteredGRN->ShiptRef . ', + VALUES ( + '" . $EnteredGRN->ShiptRef . "', 20, - ' . $InvoiceNo . ", + '" . $InvoiceNo . "', '" . $EnteredGRN->ItemCode . "', - " . ($EnteredGRN->This_QuantityInv * $EnteredGRN->ChgPrice) / $_SESSION['SuppTrans']->ExRate . ')'; + '" . ($EnteredGRN->This_QuantityInv * $EnteredGRN->ChgPrice) / $_SESSION['SuppTrans']->ExRate . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The shipment charge record for the shipment') . ' ' . $EnteredGRN->ShiptRef . ' ' . _('could not be added because'); @@ -1068,14 +1082,15 @@ foreach ($_SESSION['SuppTrans']->Shipts as $ShiptChg){ - $SQL = 'INSERT INTO shipmentcharges (shiptref, + $SQL = "INSERT INTO shipmentcharges (shiptref, transtype, transno, value) - VALUES (' . $ShiptChg->ShiptRef . ', + VALUES ( + '" . $ShiptChg->ShiptRef . "', 20, - ' . $InvoiceNo . ', - ' . $ShiptChg->Amount/ $_SESSION['SuppTrans']->ExRate . ')'; + '" . $InvoiceNo . "', + '" . $ShiptChg->Amount/ $_SESSION['SuppTrans']->ExRate . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The shipment charge record for the shipment') . ' ' . $ShiptChg->ShiptRef . ' ' . _('could not be added because'); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-27 18:38:47 UTC (rev 3805) +++ trunk/doc/Change.log.html 2010-09-27 19:57:56 UTC (rev 3806) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>27/09/10 Tim: SupplierInvoice.php - SQL quoting corrections and layout changes and improvements</p> <p>27/09/10 Tim: SupplierInquiry.php - SQL quoting corrections and layout changes and improvements</p> <p>27/09/10 Tim: SupplierCredit.php - SQL quoting corrections and layout changes and improvements</p> <p>27/09/10 Tim: SupplierContacts.php - SQL quoting corrections and layout changes and improvements</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-27 20:10:56
|
Revision: 3807 http://web-erp.svn.sourceforge.net/web-erp/?rev=3807&view=rev Author: tim_schofield Date: 2010-09-27 20:10:50 +0000 (Mon, 27 Sep 2010) Log Message: ----------- SQL quoting corrections Modified Paths: -------------- trunk/Suppliers.php trunk/doc/Change.log.html Modified: trunk/Suppliers.php =================================================================== --- trunk/Suppliers.php 2010-09-27 19:57:56 UTC (rev 3806) +++ trunk/Suppliers.php 2010-09-27 20:10:50 UTC (rev 3807) @@ -465,20 +465,20 @@ telephone='".$_POST['Phone']."', fax = '".$_POST['Fax']."', email = '".$_POST['Email']."', - supptype = ".$_POST['SupplierType'].", + supptype = '".$_POST['SupplierType']."', currcode='" . $_POST['CurrCode'] . "', - suppliersince='$SQL_SupplierSince', + suppliersince='".$SQL_SupplierSince . "', paymentterms='" . $_POST['PaymentTerms'] . "', bankpartics='" . $_POST['BankPartics'] . "', bankref='" . $_POST['BankRef'] . "', bankact='" . $_POST['BankAct'] . "', - remittance=" . $_POST['Remittance'] . ", - taxgroupid=" . $_POST['TaxGroup'] . ", - factorcompanyid=" . $_POST['FactorID'] .", + remittance='" . $_POST['Remittance'] . "', + taxgroupid='" . $_POST['TaxGroup'] . "', + factorcompanyid='" . $_POST['FactorID'] ."', lat='" . $latitude ."', lng='" . $longitude ."', taxref='". $_POST['TaxRef'] ."' - WHERE supplierid = '$SupplierID'"; + WHERE supplierid = '".$SupplierID."'"; } else { if ($suppcurr[0] != $_POST['CurrCode']) { prnMsg( _('Cannot change currency code as transactions already exist'), info); @@ -491,19 +491,19 @@ telephone='".$_POST['Phone']."', fax = '".$_POST['Fax']."', email = '".$_POST['Email']."', - supptype = ".$_POST['SupplierType'].", - suppliersince='$SQL_SupplierSince', + supptype = '".$_POST['SupplierType']."', + suppliersince='" . $SQL_SupplierSince . "', paymentterms='" . $_POST['PaymentTerms'] . "', bankpartics='" . $_POST['BankPartics'] . "', bankref='" . $_POST['BankRef'] . "', bankact='" . $_POST['BankAct'] . "', - remittance=" . $_POST['Remittance'] . ", - taxgroupid=" . $_POST['TaxGroup'] . ", - factorcompanyid=" . $_POST['FactorID'] .", + remittance='" . $_POST['Remittance'] . "', + taxgroupid='" . $_POST['TaxGroup'] . "', + factorcompanyid='" . $_POST['FactorID'] ."', lat='" . $latitude ."', lng='" . $longitude ."', taxref='". $_POST['TaxRef'] ."' - WHERE supplierid = '$SupplierID'"; + WHERE supplierid = '" . $SupplierID . "'"; } $ErrMsg = _('The supplier could not be updated because'); @@ -546,16 +546,16 @@ '".$_POST['Phone']."', '".$_POST['Fax']."', '".$_POST['Email']."', - ".$_POST['SupplierType'].", + '".$_POST['SupplierType']."', '" . $_POST['CurrCode'] . "', '" . $SQL_SupplierSince . "', '" . $_POST['PaymentTerms'] . "', '" . $_POST['BankPartics'] . "', '" . $_POST['BankRef'] . "', '" . $_POST['BankAct'] . "', - " . $_POST['Remittance'] . ", - " . $_POST['TaxGroup'] . ", - " . $_POST['FactorID'] . ", + '" . $_POST['Remittance'] . "', + '" . $_POST['TaxGroup'] . "', + '" . $_POST['FactorID'] . "', '" . $latitude ."', '" . $longitude ."', '" . $_POST['TaxRef'] . "')"; @@ -604,7 +604,7 @@ // PREVENT DELETES IF DEPENDENT RECORDS IN 'SuppTrans' , PurchOrders, SupplierContacts - $sql= "SELECT COUNT(*) FROM supptrans WHERE supplierno='$SupplierID'"; + $sql= "SELECT COUNT(*) FROM supptrans WHERE supplierno='" . $SupplierID . "'"; $result = DB_query($sql, $db); $myrow = DB_fetch_row($result); if ($myrow[0] > 0) { @@ -613,7 +613,7 @@ echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('transactions against this supplier'); } else { - $sql= "SELECT COUNT(*) FROM purchorders WHERE supplierno='$SupplierID'"; + $sql= "SELECT COUNT(*) FROM purchorders WHERE supplierno='" . $SupplierID . "'"; $result = DB_query($sql, $db); $myrow = DB_fetch_row($result); if ($myrow[0] > 0) { @@ -621,7 +621,7 @@ prnMsg(_('Cannot delete the supplier record because purchase orders have been created against this supplier'),'warn'); echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('orders against this supplier'); } else { - $sql= "SELECT COUNT(*) FROM suppliercontacts WHERE supplierid='$SupplierID'"; + $sql= "SELECT COUNT(*) FROM suppliercontacts WHERE supplierid='" . $SupplierID . "'"; $result = DB_query($sql, $db); $myrow = DB_fetch_row($result); if ($myrow[0] > 0) { @@ -634,7 +634,7 @@ } if ($CancelDelete == 0) { - $sql="DELETE FROM suppliers WHERE supplierid='$SupplierID'"; + $sql="DELETE FROM suppliers WHERE supplierid='" . $SupplierID . "'"; $result = DB_query($sql, $db); prnMsg(_('Supplier record for') . ' ' . $SupplierID . ' ' . _('has been deleted'),'success'); unset($SupplierID); @@ -769,7 +769,7 @@ factorcompanyid, taxref FROM suppliers - WHERE supplierid = '$SupplierID'"; + WHERE supplierid = '" . $SupplierID . "'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-27 19:57:56 UTC (rev 3806) +++ trunk/doc/Change.log.html 2010-09-27 20:10:50 UTC (rev 3807) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>27/09/10 Tim: Suppliers.php - SQL quoting corrections</p> <p>27/09/10 Tim: SupplierInvoice.php - SQL quoting corrections and layout changes and improvements</p> <p>27/09/10 Tim: SupplierInquiry.php - SQL quoting corrections and layout changes and improvements</p> <p>27/09/10 Tim: SupplierCredit.php - SQL quoting corrections and layout changes and improvements</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |