From: <tim...@us...> - 2010-09-27 20:24:50
|
Revision: 3808 http://web-erp.svn.sourceforge.net/web-erp/?rev=3808&view=rev Author: tim_schofield Date: 2010-09-27 20:24:44 +0000 (Mon, 27 Sep 2010) Log Message: ----------- SQL quoting corrections Modified Paths: -------------- trunk/SupplierTenders.php trunk/doc/Change.log.html Modified: trunk/SupplierTenders.php =================================================================== --- trunk/SupplierTenders.php 2010-09-27 20:10:50 UTC (rev 3807) +++ trunk/SupplierTenders.php 2010-09-27 20:24:44 UTC (rev 3808) @@ -133,11 +133,11 @@ } } foreach ($_SESSION['offer']->LineItems as $LineItems) { - $sql='UPDATE offers SET - quantity='.$LineItems->Quantity.', - price='.$LineItems->Price.', - expirydate="'.FormatDateForSQL($LineItems->ExpiryDate).'" - WHERE offerid='.$LineItems->LineNo; + $sql="UPDATE offers SET + quantity='".$LineItems->Quantity."', + price='".$LineItems->Price."', + expirydate='".FormatDateForSQL($LineItems->ExpiryDate)."' + WHERE offerid='".$LineItems->LineNo . "'"; $ErrMsg = _('The suppliers offer could not be updated on the database because'); $DbgMsg = _('The SQL statement used to update the suppliers offer record and failed was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); @@ -179,7 +179,7 @@ } foreach ($_SESSION['offer']->LineItems as $LineItems) { if ($LineItems->Deleted==False) { - $sql='INSERT INTO offers ( + $sql="INSERT INTO offers ( supplierid, stockid, quantity, @@ -188,14 +188,14 @@ expirydate, currcode) VALUES ( - "'.$_POST['SupplierID'].'", - "'.$LineItems->StockID.'", - '.$LineItems->Quantity.', - "'.$LineItems->Units.'", - '.$LineItems->Price.', - "'.FormatDateForSQL($LineItems->ExpiryDate).'", - "'.$Currency.'" - )'; + '".$_POST['SupplierID']."', + '".$LineItems->StockID."', + '".$LineItems->Quantity."', + '".$LineItems->Units."', + '".$LineItems->Price."', + '".FormatDateForSQL($LineItems->ExpiryDate)."', + '".$Currency."' + )"; $ErrMsg = _('The suppliers offer could not be inserted into the database because'); $DbgMsg = _('The SQL statement used to insert the suppliers offer record and failed was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-27 20:10:50 UTC (rev 3807) +++ trunk/doc/Change.log.html 2010-09-27 20:24:44 UTC (rev 3808) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>27/09/10 Tim: SupplierTenders.php - SQL quoting corrections</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> 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:52:20
|
Revision: 3809 http://web-erp.svn.sourceforge.net/web-erp/?rev=3809&view=rev Author: tim_schofield Date: 2010-09-27 20:52:13 +0000 (Mon, 27 Sep 2010) Log Message: ----------- New script to show detail supplier transactions Modified Paths: -------------- trunk/SupplierTransInquiry.php trunk/doc/Change.log.html trunk/index.php Modified: trunk/SupplierTransInquiry.php =================================================================== --- trunk/SupplierTransInquiry.php 2010-09-27 20:24:44 UTC (rev 3808) +++ trunk/SupplierTransInquiry.php 2010-09-27 20:52:13 UTC (rev 3809) @@ -8,10 +8,12 @@ $title = _('Supplier Transactions Inquiry'); include('includes/header.inc'); +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Search') . + '" alt="">' . ' ' . $title . '</p>'; echo "<form action='" . $_SERVER['PHP_SELF'] . "' method=post>"; -echo '<table cellpadding=2><tr>'; +echo '<table cellpadding=2 class=selection><tr>'; echo '<td>' . _('Type') . ":</td><td><select name='TransType'> "; @@ -41,10 +43,9 @@ echo '<td>' . _('From') . ":</td><td><input type=TEXT class='date' alt='".$_SESSION['DefaultDateFormat']. "' name='FromDate' maxlength=10 size=11 VALUE=" . $_POST['FromDate'] . '></td>'; echo '<td>' . _('To') . ":</td><td><input type=TEXT class='date' alt='".$_SESSION['DefaultDateFormat']. "' name='ToDate' maxlength=10 size=11 VALUE=" . $_POST['ToDate'] . '></td>'; -echo "</tr></table><div class='centre'><input type=submit name='ShowResults' VALUE='" . _('Show Transactions') . "'>"; -echo '<hr>'; +echo "</tr></table><br /><div class='centre'><input type=submit name='ShowResults' VALUE='" . _('Show Transactions') . "'>"; -echo '</form></div>'; +echo '</form></div><br />'; if (isset($_POST['ShowResults']) && $_POST['TransType'] != ''){ $SQL_FromDate = FormatDateForSQL($_POST['FromDate']); @@ -78,7 +79,7 @@ $ErrMsg = _('The supplier transactions for the selected criteria could not be retrieved because') . ' - ' . DB_error_msg($db); $DbgMsg = _('The SQL that failed was'); - echo '<table cellpadding=2 BORDER=2>'; + echo '<table cellpadding=2 class=selection>'; $tableheader = "<tr> <th>" . _('Type') . "</th> @@ -102,7 +103,7 @@ echo '<tr class="EvenTableRows">'; $k=0; } else { - echo '<tr class="OddTableRows">';; + echo '<tr class="EvenTableRows">';; $k++; } @@ -121,27 +122,27 @@ $myrow['suppreference'], ConvertSQLDate($myrow['trandate']), $myrow['supplierno'] . ' - ' . $myrow['suppname'], - $myrow['trantext'], + $myrow['transtext'], ConvertSQLDate($myrow['duedate']), $myrow['rate'], number_format($myrow['totalamt'],2), $myrow['currcode'] ); - - $GLTransResult = DB_query('SELECT account, accountname, narrative, amount - FROM gltrans INNER JOIN chartmaster + + $GLTransResult = DB_query("SELECT account, accountname, narrative, amount + FROM gltrans INNER JOIN chartmaster ON gltrans.account=chartmaster.accountcode - WHERE type=' . $myrow['type'] . ' - AND typeno=' . $myrow['transno'], + WHERE type='" . $myrow['type'] . "' + AND typeno='" . $myrow['transno'] . "'", $db, _('Could not retrieve the GL transactions for this AP transaction')); - + if (DB_num_rows($GLTransResult)==0){ echo '<tr><td colspan=10>' . _('There are no GL transactions created for the above AP transaction') . '</td></tr>'; } else { - echo '<tr><td colspan=2></td><td colspan=8><table>'; - echo '<tr bgcolor=#FFFFFF><td colspan=2><b>' . _('GL Account') . '</b></td><td><b>' . _('Local Amount') . '</b></td><td><b>' . _('Narrative') . '</b></td></tr>'; + echo '<tr><td colspan=2></td><td colspan=8><table class=selection width=100%>'; + echo '<tr><th colspan=2><b>' . _('GL Account') . '</b></th><th><b>' . _('Local Amount') . '</b></th><th><b>' . _('Narrative') . '</b></th></tr>'; $CheckGLTransBalance =0; while ($GLTransRow = DB_fetch_array($GLTransResult)){ @@ -153,9 +154,9 @@ </tr>', $GLTransRow['account'], $GLTransRow['accountname'], - $GLTransRow['amount'], + number_format($GLTransRow['amount'],2), $GLTransRow['narrative']); - + $CheckGLTransBalance += $GLTransRow['amount']; } if (round($CheckGLTransBalance,5)!= 0){ Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-27 20:24:44 UTC (rev 3808) +++ trunk/doc/Change.log.html 2010-09-27 20:52:13 UTC (rev 3809) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>27/09/10 Tim: SupplierTransInquiry.php - New script to show detail supplier transactions</p> <p>27/09/10 Tim: SupplierTenders.php - SQL quoting corrections</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> Modified: trunk/index.php =================================================================== --- trunk/index.php 2010-09-27 20:24:44 UTC (rev 3808) +++ trunk/index.php 2010-09-27 20:52:13 UTC (rev 3809) @@ -447,6 +447,11 @@ </tr> <tr> <td class="menu_group_item"> + <?php echo '<p>• <a href="' . $rootpath . '/SupplierTransInquiry.php?' . SID . '">' . _('Supplier Transaction Inquiries') . '</a></p>'; ?> + </td> + </tr> + <tr> + <td class="menu_group_item"> <?php echo GetRptLinks('ap'); ?> </td> </tr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-27 21:02:15
|
Revision: 3810 http://web-erp.svn.sourceforge.net/web-erp/?rev=3810&view=rev Author: tim_schofield Date: 2010-09-27 21:02:09 +0000 (Mon, 27 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements Modified Paths: -------------- trunk/SupplierTypes.php trunk/doc/Change.log.html Modified: trunk/SupplierTypes.php =================================================================== --- trunk/SupplierTypes.php 2010-09-27 20:52:13 UTC (rev 3809) +++ trunk/SupplierTypes.php 2010-09-27 21:02:09 UTC (rev 3810) @@ -64,7 +64,7 @@ $sql = "UPDATE suppliertype SET typename = '" . $_POST['typename'] . "' - WHERE typeid = '$SelectedType'"; + WHERE typeid = '" . $SelectedType . "'"; $msg = _('The supplier type') . ' ' . $SelectedType . ' ' . _('has been updated'); } elseif ( $InputError !=1 ) { @@ -137,7 +137,7 @@ } elseif ( isset($_GET['delete']) ) { - $sql = "SELECT COUNT(*) FROM suppliers WHERE supptype='$SelectedType'"; + $sql = "SELECT COUNT(*) FROM suppliers WHERE supptype='" . $SelectedType . "'"; $ErrMsg = _('The number of suppliers using this Type record could not be retrieved because'); $result = DB_query($sql,$db,$ErrMsg); @@ -147,7 +147,7 @@ _('There are') . ' ' . $myrow[0] . ' ' . _('suppliers with this type code')); } else { - $sql="DELETE FROM suppliertype WHERE typeid='$SelectedType'"; + $sql="DELETE FROM suppliertype WHERE typeid='" . $SelectedType . "'"; $ErrMsg = _('The Type record could not be deleted because'); $result = DB_query($sql,$db,$ErrMsg); prnMsg(_('Supplier type') . $SelectedType . ' ' . _('has been deleted') ,'success'); @@ -169,7 +169,7 @@ $sql = 'SELECT typeid, typename FROM suppliertype'; $result = DB_query($sql,$db); - echo '<br><table class=selection>'; + echo '<table class=selection>'; echo "<tr> <th>" . _('Type ID') . "</th> <th>" . _('Type Name') . "</th> @@ -210,7 +210,7 @@ if (! isset($_GET['delete'])) { echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; - echo '<p><table class=selection>'; //Main table + echo '<br /><table class=selection>'; //Main table echo '<td>'; // First column @@ -221,7 +221,7 @@ $sql = "SELECT typeid, typename FROM suppliertype - WHERE typeid='$SelectedType'"; + WHERE typeid='" . $SelectedType . "'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-27 20:52:13 UTC (rev 3809) +++ trunk/doc/Change.log.html 2010-09-27 21:02:09 UTC (rev 3810) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>27/09/10 Tim: SupplierTypes.php - SQL quoting corrections and layout changes and improvements</p> <p>27/09/10 Tim: SupplierTransInquiry.php - New script to show detail supplier transactions</p> <p>27/09/10 Tim: SupplierTenders.php - SQL quoting corrections</p> <p>27/09/10 Tim: Suppliers.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-27 21:15:48
|
Revision: 3811 http://web-erp.svn.sourceforge.net/web-erp/?rev=3811&view=rev Author: tim_schofield Date: 2010-09-27 21:15:42 +0000 (Mon, 27 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements Modified Paths: -------------- trunk/SelectSupplier.php trunk/SuppLoginSetup.php trunk/doc/Change.log.html Modified: trunk/SelectSupplier.php =================================================================== --- trunk/SelectSupplier.php 2010-09-27 21:02:09 UTC (rev 3810) +++ trunk/SelectSupplier.php 2010-09-27 21:15:42 UTC (rev 3811) @@ -176,7 +176,7 @@ echo "<br><a href=\"$rootpath/SupplierContacts.php?" . SID . '&SupplierID=' . $_SESSION['SupplierID'] . "\">" . _('Add/Modify/Delete Supplier Contacts') . '</a>'; echo '<br>'; echo "<br><a href='$rootpath/Shipments.php?" . SID . "&NewShipment=Yes'>" . _('Set Up A New Shipment') . '</a>'; - echo "<br><a href='$rootpath/SuppLoginSetup.php?" . SID . "&NewShipment=Yes'>" . _('Supplier Login Configuration') . '</a>'; + echo "<br><a href='$rootpath/SuppLoginSetup.php?" . SID . "'>" . _('Supplier Login Configuration') . '</a>'; echo '</td></tr></table>'; } else { // Supplier is not selected yet Modified: trunk/SuppLoginSetup.php =================================================================== --- trunk/SuppLoginSetup.php 2010-09-27 21:02:09 UTC (rev 3810) +++ trunk/SuppLoginSetup.php 2010-09-27 21:15:42 UTC (rev 3811) @@ -124,7 +124,7 @@ supplierid='" . $_POST['Supp'] ."', phone='" . $_POST['Phone'] ."', email='" . $_POST['Email'] ."', - password='".CryptPass($UpdatePassword)."', + " . $UpdatePassword .", pagesize='" . $_POST['PageSize'] . "', fullaccess=" . $_POST['Access'] . ", theme='" . $_POST['Theme'] . "', @@ -132,7 +132,7 @@ defaultlocation='" . $_POST['DefaultLocation'] ."', modulesallowed='" . $ModulesAllowed . "', blocked=" . $_POST['Blocked'] . " - WHERE userid = '$SelectedUser'"; + WHERE userid = '" . $SelectedUser . "'"; prnMsg( _('The selected user record has been updated'), 'success' ); } elseif ($InputError !=1) { @@ -158,11 +158,11 @@ '" . $_POST['Phone'] . "', '" . $_POST['Email'] ."', '" . $_POST['PageSize'] ."', - " . $_POST['Access'] . ", + '" . $_POST['Access'] . "', '" . $_POST['DefaultLocation'] ."', '" . date($_SESSION['DefaultDateFormat']) ."', '" . $ModulesAllowed . "', - " . $_SESSION['DefaultDisplayRecordsMax'] . ", + '" . $_SESSION['DefaultDisplayRecordsMax'] . "', '" . $_POST['Theme'] . "', '". $_POST['UserLanguage'] ."')"; prnMsg( _('A new user record has been inserted'), 'success' ); @@ -206,7 +206,7 @@ prnMsg(_('Cannot delete user as entries already exist in the audit trail'), 'warn'); } else { - $sql="DELETE FROM www_users WHERE userid='$SelectedUser'"; + $sql="DELETE FROM www_users WHERE userid='" . $SelectedUser . "'"; $ErrMsg = _('The User could not be deleted because');; $result = DB_query($sql,$db,$ErrMsg); prnMsg(_('User Deleted'),'info'); @@ -233,7 +233,7 @@ FROM www_users WHERE supplierid = '" . $_SESSION['SupplierID'] . "'"; $result = DB_query($sql,$db); - echo '<table>'; + echo '<table class=selection>'; echo "<tr><th>" . _('User Login') . "</th> <th>" . _('Full Name') . "</th> <th>" . _('Telephone') . "</th> Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-27 21:02:09 UTC (rev 3810) +++ trunk/doc/Change.log.html 2010-09-27 21:15:42 UTC (rev 3811) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>27/09/10 Tim: SuppLoginSetup.php - SQL quoting corrections and layout changes and improvements</p> <p>27/09/10 Tim: SupplierTypes.php - SQL quoting corrections and layout changes and improvements</p> <p>27/09/10 Tim: SupplierTransInquiry.php - New script to show detail supplier transactions</p> <p>27/09/10 Tim: SupplierTenders.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-27 21:28:36
|
Revision: 3812 http://web-erp.svn.sourceforge.net/web-erp/?rev=3812&view=rev Author: tim_schofield Date: 2010-09-27 21:28:29 +0000 (Mon, 27 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements Modified Paths: -------------- trunk/SuppPaymentRun.php trunk/doc/Change.log.html Modified: trunk/SuppPaymentRun.php =================================================================== --- trunk/SuppPaymentRun.php 2010-09-27 21:15:42 UTC (rev 3811) +++ trunk/SuppPaymentRun.php 2010-09-27 21:28:29 UTC (rev 3812) @@ -171,8 +171,8 @@ /*Now update the SuppTrans for the allocation made and the fact that it is now settled */ $SQL = "UPDATE supptrans SET settled = 1, - alloc = " . $DetailTrans['trantotal'] . ", - diffonexch = " . ($DetailTrans['diffonexch'] + $DiffOnExch) . " + alloc = '" . $DetailTrans['trantotal'] . "', + diffonexch = '" . ($DetailTrans['diffonexch'] + $DiffOnExch) . "' WHERE type = " . $DetailTrans['type'] . ' AND transno = ' . $DetailTrans['transno']; @@ -234,13 +234,16 @@ $title=_('Payment Run'); include('includes/header.inc'); + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Supplier Types') + . '" alt="">' . $title . '</p>'; + if (isset($_POST['Currency']) AND !is_numeric($_POST['ExRate'])){ echo '<br>' . _('To process payments for') . ' ' . $_POST['Currency'] . ' ' . _('a numeric exchange rate applicable for purchasing the currency to make the payment with must be entered') . '. ' . _('This rate is used to calculate the difference in exchange and make the necessary postings to the General ledger if linked') . '.'; } /* show form to allow input */ - echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method="POST"><table>'; + echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method="POST"><table class=selection>'; if (!isset($_POST['FromCriteria']) or strlen($_POST['FromCriteria'])<1){ $DefaultFromCriteria = '1'; @@ -346,7 +349,7 @@ echo '<tr><td>' . _('Starting Reference no (eg chq no)') . ':</td> <td><input type=text name="Ref" maxlength=11 size=12 VALUE=' . $_POST['Ref'] . '></td></tr>'; - echo '</table><div class="centre"><input type=Submit Name="PrintPDF" Value="' . _('Print PDF Only') . '"> + echo '</table><br /><div class="centre"><input type=Submit Name="PrintPDF" Value="' . _('Print PDF Only') . '"> <input type=Submit Name="PrintPDFAndProcess" Value="' . _('Print and Process Payments') . '"></div>'; include ('includes/footer.inc'); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-27 21:15:42 UTC (rev 3811) +++ trunk/doc/Change.log.html 2010-09-27 21:28:29 UTC (rev 3812) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>27/09/10 Tim: SuppPaymentRun.php - SQL quoting corrections and layout changes and improvements</p> <p>27/09/10 Tim: SuppLoginSetup.php - SQL quoting corrections and layout changes and improvements</p> <p>27/09/10 Tim: SupplierTypes.php - SQL quoting corrections and layout changes and improvements</p> <p>27/09/10 Tim: SupplierTransInquiry.php - New script to show detail supplier transactions</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-09-28 09:00:43
|
Revision: 3813 http://web-erp.svn.sourceforge.net/web-erp/?rev=3813&view=rev Author: tim_schofield Date: 2010-09-28 09:00:37 +0000 (Tue, 28 Sep 2010) Log Message: ----------- Layout changes and improvements Modified Paths: -------------- trunk/SuppPriceList.php trunk/doc/Change.log.html Modified: trunk/SuppPriceList.php =================================================================== --- trunk/SuppPriceList.php 2010-09-27 21:28:29 UTC (rev 3812) +++ trunk/SuppPriceList.php 2010-09-28 09:00:37 UTC (rev 3813) @@ -203,7 +203,7 @@ $sql = "SELECT supplierid,suppname FROM `suppliers`"; $result = DB_query($sql,$db); - echo '<table>'; + echo '<table class=selection>'; echo '<tr><td>' . _('Supplier') . ':</td><td><select name="supplier"> '; while ($myrow=DB_fetch_array($result)){ if (isset($_POST['supplierid']) and ($myrow['supplierid'] == $_POST['supplierid'])) { Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-27 21:28:29 UTC (rev 3812) +++ trunk/doc/Change.log.html 2010-09-28 09:00:37 UTC (rev 3813) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>28/09/10 Tim: SuppPriceList.php - Layout changes and improvements</p> <p>27/09/10 Tim: SuppPaymentRun.php - SQL quoting corrections and layout changes and improvements</p> <p>27/09/10 Tim: SuppLoginSetup.php - SQL quoting corrections and layout changes and improvements</p> <p>27/09/10 Tim: SupplierTypes.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-28 09:06:33
|
Revision: 3814 http://web-erp.svn.sourceforge.net/web-erp/?rev=3814&view=rev Author: tim_schofield Date: 2010-09-28 09:06:27 +0000 (Tue, 28 Sep 2010) Log Message: ----------- Paul Thursby: Various default.css files -- Minor CSS corrections. Modified Paths: -------------- trunk/css/default/default.css trunk/css/fresh/default.css trunk/css/jelly/default.css trunk/css/professional/default.css trunk/css/professional-rtl/default.css trunk/doc/Change.log.html Modified: trunk/css/default/default.css =================================================================== --- trunk/css/default/default.css 2010-09-28 09:00:37 UTC (rev 3813) +++ trunk/css/default/default.css 2010-09-28 09:06:27 UTC (rev 3814) @@ -191,7 +191,7 @@ } #trim { - background: "#CCCCCC"; + background: #CCCCCC; } #page { @@ -244,7 +244,6 @@ width:90%; background: #eee; border: 0px 0px 2px 2px #222 solid; - background: #eee; margin: 0 auto; } /* Table type is used for UI tables type 2 */ @@ -252,7 +251,6 @@ width:90%; background: #eee; border: 0px 0px 2px 2px #222 solid; - background: #eee; margin: 0 auto; } @@ -632,7 +630,8 @@ color: #CCCCCC; font-weight: normal; font-size: 9px; - t + text-align: center; +} .legal { font-family: Arial, Verdana, Helvetica, sans-serif; @@ -693,7 +692,7 @@ } .notavailable { - font-weight:light; + font-weight:lighter; font-style:italic; color:#555555; } Modified: trunk/css/fresh/default.css =================================================================== --- trunk/css/fresh/default.css 2010-09-28 09:00:37 UTC (rev 3813) +++ trunk/css/fresh/default.css 2010-09-28 09:06:27 UTC (rev 3814) @@ -146,7 +146,7 @@ div.info { background-color:#c7ccf6; - color: nany; + color: navy; border: 1px solid navy; } @@ -191,7 +191,7 @@ } #trim { - background: "#ffffff"; + background: #ffffff; } #page { @@ -244,7 +244,6 @@ width:90%; background: #eee; border: 0px 0px 2px 2px #222 solid; - background: #eee; margin: 0 auto; } /* Table type is used for UI tables type 2 */ @@ -252,7 +251,6 @@ width:90%; background: #eee; border: 0px 0px 2px 2px #222 solid; - background: #eee; margin: 0 auto; } input.address3 { @@ -666,7 +664,7 @@ } .notavailable { - font-weight:light; + font-weight:lighter; font-style:italic; color:#555555; } Modified: trunk/css/jelly/default.css =================================================================== --- trunk/css/jelly/default.css 2010-09-28 09:00:37 UTC (rev 3813) +++ trunk/css/jelly/default.css 2010-09-28 09:06:27 UTC (rev 3814) @@ -52,7 +52,6 @@ background: #eee; border: 0px 0px 2px 2px #222 solid; margin: 0 auto; - background: #eee; } .dpTbl { Modified: trunk/css/professional/default.css =================================================================== --- trunk/css/professional/default.css 2010-09-28 09:00:37 UTC (rev 3813) +++ trunk/css/professional/default.css 2010-09-28 09:06:27 UTC (rev 3814) @@ -192,7 +192,7 @@ } #trim { - background: "white"; + background: white; } #page { @@ -245,7 +245,6 @@ width:90%; background: #eee; border: 0px 0px 2px 2px #222 solid; - background: #eee; margin: 0 auto; } /* Table type is used for UI tables type 2 */ @@ -253,7 +252,6 @@ width:90%; background: #eee; border: 0px 0px 2px 2px #222 solid; - background: #eee; margin: 0 auto; } input.address3 { @@ -668,7 +666,7 @@ } .notavailable { - font-weight:light; + font-weight:lighter; font-style:italic; color:#555555; } Modified: trunk/css/professional-rtl/default.css =================================================================== --- trunk/css/professional-rtl/default.css 2010-09-28 09:00:37 UTC (rev 3813) +++ trunk/css/professional-rtl/default.css 2010-09-28 09:06:27 UTC (rev 3814) @@ -186,7 +186,7 @@ } #trim { - background: "white"; + background: white; } #page { @@ -662,7 +662,7 @@ } .notavailable { - font-weight:light; + font-weight:lighter; font-style:italic; color:#555555; } Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-28 09:00:37 UTC (rev 3813) +++ trunk/doc/Change.log.html 2010-09-28 09:06:27 UTC (rev 3814) @@ -1,6 +1,7 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> <p>28/09/10 Tim: SuppPriceList.php - Layout changes and improvements</p> +<p>27/09/10 Paul Thursby: Various default.css files -- Minor CSS corrections.</p> <p>27/09/10 Tim: SuppPaymentRun.php - SQL quoting corrections and layout changes and improvements</p> <p>27/09/10 Tim: SuppLoginSetup.php - SQL quoting corrections and layout changes and improvements</p> <p>27/09/10 Tim: SupplierTypes.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-28 09:23:07
|
Revision: 3815 http://web-erp.svn.sourceforge.net/web-erp/?rev=3815&view=rev Author: tim_schofield Date: 2010-09-28 09:23:01 +0000 (Tue, 28 Sep 2010) Log Message: ----------- Layout changes and improvements Modified Paths: -------------- trunk/SuppShiptChgs.php trunk/doc/Change.log.html Modified: trunk/SuppShiptChgs.php =================================================================== --- trunk/SuppShiptChgs.php 2010-09-28 09:06:27 UTC (rev 3814) +++ trunk/SuppShiptChgs.php 2010-09-28 09:23:01 UTC (rev 3815) @@ -19,6 +19,12 @@ include('includes/header.inc'); +if ($_SESSION['SuppTrans']->InvoiceOrCredit == 'Invoice'){ + echo '<a href="' . $rootpath . '/SupplierInvoice.php?' . SID . '">' . _('Back to Invoice Entry') . '</a>'; +} else { + echo '<a href="' . $rootpath . '/SupplierCredit.php?' . SID . '">' . _('Back to Credit Note Entry') . '</a>'; +} + if (!isset($_SESSION['SuppTrans'])){ prnMsg(_('Shipment charges or credits are entered against supplier invoices or credit notes respectively') . '. ' . _('To enter supplier transactions the supplier must first be selected from the supplier selection screen') . ', ' . _('then the link to enter a supplier invoice or credit note must be clicked on'),'info'); echo "<br><a href='$rootpath/SelectSupplier.php?" . SID ."'>" . _('Select A Supplier') . '</a>'; @@ -64,7 +70,7 @@ } echo $_SESSION['SuppTrans']->SuppReference . ' ' ._('From') . ' ' . $_SESSION['SuppTrans']->SupplierName; echo '</div>'; -echo '<table cellpadding=2>'; +echo '<table cellpadding=2 class=selection>'; $TableHeader = '<tr><th>' . _('Shipment') . '</th> <th>' . _('Amount') . '</th></tr>'; echo $TableHeader; @@ -82,34 +88,28 @@ } echo '<tr> - <td colspan=2 class=number><font size=4 color=BLUE>' . _('Total') . ':</font></td> - <td class=number><font size=4 color=BLUE><U>' . number_format($TotalShiptValue,2) . '</U></font></td> + <td class=number><font size=2 color=navy>' . _('Total') . ':</font></td> + <td class=number><font size=2 color=navy><U>' . number_format($TotalShiptValue,2) . '</U></font></td> </tr> -</table>'; +</table><br />'; -if ($_SESSION['SuppTrans']->InvoiceOrCredit == 'Invoice'){ - echo '<br><a href="' . $rootpath . '/SupplierInvoice.php?' . SID . '">' . _('Back to Invoice Entry') . '</a><hr>'; -} else { - echo '<br><a href="' . $rootpath . '/SupplierCredit.php?' . SID . '">' . _('Back to Credit Note Entry') . '</a><hr>'; -} - /*Set up a form to allow input of new Shipment charges */ echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method="post">'; if (!isset($_POST['ShiptRef'])) { $_POST['ShiptRef']=''; } -echo '<table>'; +echo '<table class=selection>'; echo '<tr><td>' . _('Shipment Reference') . ':</td> <td><input type="text" name="ShiptRef" size="12" maxlength="11" VALUE="' . $_POST['ShiptRef'] . '"></td></tr>'; echo '<tr><td>' . _('Shipment Selection') . ':<br> ' . _('If you know the code enter it above') . '<br>' . _('otherwise select the shipment from the list') . '</td><td><select name="ShiptSelection">'; -$sql = 'SELECT shiptref, - vessel, - eta, - suppname - FROM shipments INNER JOIN suppliers - ON shipments.supplierid=suppliers.supplierid +$sql = 'SELECT shiptref, + vessel, + eta, + suppname + FROM shipments INNER JOIN suppliers + ON shipments.supplierid=suppliers.supplierid WHERE closed=0'; $result = DB_query($sql, $db); @@ -132,7 +132,7 @@ <td><input type="text" name="Amount" size="12" maxlength="11" VALUE="' . $_POST['Amount'] . '"></td></tr>'; echo '</table>'; -echo '<input type="submit" name="AddShiptChgToInvoice" VALUE="' . _('Enter Shipment Charge') . '">'; +echo '<br /><div class=centre><input type="submit" name="AddShiptChgToInvoice" VALUE="' . _('Enter Shipment Charge') . '"></div>'; echo '</form>'; include('includes/footer.inc'); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-28 09:06:27 UTC (rev 3814) +++ trunk/doc/Change.log.html 2010-09-28 09:23:01 UTC (rev 3815) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>28/09/10 Tim: SuppShiptChargesphp - Layout changes and improvements</p> <p>28/09/10 Tim: SuppPriceList.php - Layout changes and improvements</p> <p>27/09/10 Paul Thursby: Various default.css files -- Minor CSS corrections.</p> <p>27/09/10 Tim: SuppPaymentRun.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-28 09:50:17
|
Revision: 3816 http://web-erp.svn.sourceforge.net/web-erp/?rev=3816&view=rev Author: tim_schofield Date: 2010-09-28 09:50:07 +0000 (Tue, 28 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements Modified Paths: -------------- trunk/SuppTransGLAnalysis.php trunk/doc/Change.log.html Modified: trunk/SuppTransGLAnalysis.php =================================================================== --- trunk/SuppTransGLAnalysis.php 2010-09-28 09:23:01 UTC (rev 3815) +++ trunk/SuppTransGLAnalysis.php 2010-09-28 09:50:07 UTC (rev 3816) @@ -32,10 +32,10 @@ $_POST['GLCode'] = $_POST['AcctSelection']; } - $sql = 'SELECT accountcode, + $sql = "SELECT accountcode, accountname FROM chartmaster - WHERE accountcode=' . $_POST['GLCode']; + WHERE accountcode='" . $_POST['GLCode'] . "'"; $result = DB_query($sql, $db); if (DB_num_rows($result) == 0){ prnMsg(_('The account code entered is not a valid code') . '. ' . _('This line cannot be added to the transaction') . '.<br>' . _('You can use the selection box to select the account you want'),'error'); @@ -84,7 +84,7 @@ echo '<div class="centre"><p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('General Ledger') . '" alt="">' . ' ' . _('General Ledger Analysis of Credit Note From') . ' ' . $_SESSION['SuppTrans']->SupplierName; } -echo '</p><table cellpadding=2>'; +echo '</p><table cellpadding=2 class=selection>'; $TableHeader = '<tr> <th>' . _('Account') . '</th> @@ -116,21 +116,21 @@ echo '<tr> <td colspan=2 class=number><font size=4 color=BLUE>' . _('Total') . ':</font></td> - <td class=number><font size=4 color=BLUE><U>' . number_format($TotalGLValue,2) . '</U></font></td> + <td class=number><font size=2 color=navy><U>' . number_format($TotalGLValue,2) . '</U></font></td> </tr> </table>'; if ($_SESSION['SuppTrans']->InvoiceOrCredit == 'Invoice'){ - echo '<br><a href="' . $rootpath . '/SupplierInvoice.php?' . SID . '">' . _('Back to Invoice Entry') . '</a><hr>'; + echo '<br /><a href="' . $rootpath . '/SupplierInvoice.php?' . SID . '">' . _('Back to Invoice Entry') . '</a>'; } else { - echo '<br><a href="' . $rootpath . '/SupplierCredit.php?' . SID . '">' . _('Back to Credit Note Entry') . '</a><hr>'; + echo '<br /><a href="' . $rootpath . '/SupplierCredit.php?' . SID . '">' . _('Back to Credit Note Entry') . '</a>'; } /*Set up a form to allow input of new GL entries */ echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method="post">'; -echo '<table>'; +echo '<br /><table class=selection>'; if (!isset($_POST['GLCode'])) { $_POST['GLCode']=''; } @@ -172,9 +172,9 @@ } echo '<tr> <td>' . _('Narrative') . ':</td> - <td><TEXTAREA name="Narrative" cols=40 rows=2>' . $_POST['Narrative'] . '</textarea></td> + <td><textarea name="Narrative" cols=40 rows=2>' . $_POST['Narrative'] . '</textarea></td> </tr> - </table>'; + </table><br />'; echo '<input type="submit" name="AddGLCodeToTrans" VALUE="' . _('Enter GL Line') . '">'; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-28 09:23:01 UTC (rev 3815) +++ trunk/doc/Change.log.html 2010-09-28 09:50:07 UTC (rev 3816) @@ -1,6 +1,7 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> -<p>28/09/10 Tim: SuppShiptChargesphp - Layout changes and improvements</p> +<p>28/09/10 Tim: SuppTransGLAnalysis.php - SQL quoting corrections and layout changes and improvements</p> +<p>28/09/10 Tim: SuppShiptCharges.php - Layout changes and improvements</p> <p>28/09/10 Tim: SuppPriceList.php - Layout changes and improvements</p> <p>27/09/10 Paul Thursby: Various default.css files -- Minor CSS corrections.</p> <p>27/09/10 Tim: SuppPaymentRun.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-28 12:11:24
|
Revision: 3817 http://web-erp.svn.sourceforge.net/web-erp/?rev=3817&view=rev Author: tim_schofield Date: 2010-09-28 12:11:16 +0000 (Tue, 28 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements Modified Paths: -------------- trunk/SystemParameters.php trunk/doc/Change.log.html Modified: trunk/SystemParameters.php =================================================================== --- trunk/SystemParameters.php 2010-09-28 09:50:07 UTC (rev 3816) +++ trunk/SystemParameters.php 2010-09-28 12:11:16 UTC (rev 3817) @@ -10,6 +10,9 @@ include('includes/header.inc'); +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Supplier Types') + . '" alt="">' . $title. '</p>'; + if (isset($_POST['submit'])) { //initialise no input errors assumed initially before we test @@ -244,16 +247,16 @@ $sql[] = "UPDATE config SET confvalue = '" . $_POST['X_WeightedAverageCosting']."' WHERE confname = 'WeightedAverageCosting'"; } if ($_SESSION['AutoIssue'] != $_POST['X_AutoIssue']){ - $sql[] = 'UPDATE config SET confvalue=' . $_POST['X_AutoIssue'] . " WHERE confname='AutoIssue'"; + $sql[] = "UPDATE config SET confvalue='" . $_POST['X_AutoIssue'] . "' WHERE confname='AutoIssue'"; } if ($_SESSION['ProhibitNegativeStock'] != $_POST['X_ProhibitNegativeStock']){ - $sql[] = 'UPDATE config SET confvalue=' . $_POST['X_ProhibitNegativeStock'] . " WHERE confname='ProhibitNegativeStock'"; + $sql[] = "UPDATE config SET confvalue='" . $_POST['X_ProhibitNegativeStock'] . "' WHERE confname='ProhibitNegativeStock'"; } if ($_SESSION['MonthsAuditTrail'] != $_POST['X_MonthsAuditTrail']){ - $sql[] = 'UPDATE config SET confvalue=' . $_POST['X_MonthsAuditTrail'] . " WHERE confname='MonthsAuditTrail'"; + $sql[] = "UPDATE config SET confvalue='" . $_POST['X_MonthsAuditTrail'] . "' WHERE confname='MonthsAuditTrail'"; } if ($_SESSION['LogSeverity'] != $_POST['X_LogSeverity']){ - $sql[] = 'UPDATE config SET confvalue=' . $_POST['X_LogSeverity'] . " WHERE confname='LogSeverity'"; + $sql[] = "UPDATE config SET confvalue='" . $_POST['X_LogSeverity'] . "' WHERE confname='LogSeverity'"; } if ($_SESSION['LogPath'] != $_POST['X_LogPath']){ $sql[] = "UPDATE config SET confvalue='" . $_POST['X_LogPath'] . "' WHERE confname='LogPath'"; @@ -268,7 +271,7 @@ $sql[] = "UPDATE config SET confvalue='" . $_POST['X_PurchasingManagerEmail'] . "' WHERE confname='PurchasingManagerEmail'"; } if ($_SESSION['AutoCreateWOs'] != $_POST['X_AutoCreateWOs']){ - $sql[] = 'UPDATE config SET confvalue=' . $_POST['X_AutoCreateWOs'] . " WHERE confname='AutoCreateWOs'"; + $sql[] = "UPDATE config SET confvalue='" . $_POST['X_AutoCreateWOs'] . "' WHERE confname='AutoCreateWOs'"; } if ($_SESSION['DefaultFactoryLocation'] != $_POST['X_DefaultFactoryLocation']){ $sql[] = "UPDATE config SET confvalue='" . $_POST['X_DefaultFactoryLocation'] . "' WHERE confname='DefaultFactoryLocation'"; @@ -302,7 +305,7 @@ } /* end of if submit */ echo '<form method="post" action=' . $_SERVER['PHP_SELF'] . '>'; -echo '<table BORDER=1>'; +echo '<table cellpadding=2 class=selection width=98%>'; $TableHeader = '<tr><th>' . _('System Variable Name') . '</th> <th>' . _('Value') . '</th> @@ -312,7 +315,7 @@ echo $TableHeader; // DefaultDateFormat -echo '<tr><td>' . _('Default Date Format') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Default Date Format') . ':</td> <td><select Name="X_DefaultDateFormat"> <option '.(($_SESSION['DefaultDateFormat']=='d/m/Y')?'selected ':'').'Value="d/m/Y">d/m/Y</option> <option '.(($_SESSION['DefaultDateFormat']=='d.m.Y')?'selected ':'').'Value="d.m.Y">d.m.Y</option> @@ -322,7 +325,7 @@ <td>' . _('The default date format for entry of dates and display.') . '</td></tr>'; // DefaultTheme -echo '<tr><td>' . _('New Users Default Theme') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('New Users Default Theme') . ':</td> <td><select Name="X_DefaultTheme">'; $ThemeDirectory = dir('css/'); while (false != ($ThemeName = $ThemeDirectory->read())){ @@ -339,23 +342,23 @@ echo '<tr><th colspan=3>' . _('Accounts Receivable/Payable Settings') . '</th></tr>'; // PastDueDays1 -echo '<tr><td>' . _('First Overdue Deadline in (days)') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('First Overdue Deadline in (days)') . ':</td> <td><input type="Text" class="number" Name="X_PastDueDays1" value="' . $_SESSION['PastDueDays1'] . '" size=3 maxlength=3></td> <td>' . _('Customer and supplier balances are displayed as overdue by this many days. This parameter is used on customer and supplier enquiry screens and aged listings') . '</td></tr>'; // PastDueDays2 -echo '<tr><td>' . _('Second Overdue Deadline in (days)') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Second Overdue Deadline in (days)') . ':</td> <td><input type="Text" class="number" Name="X_PastDueDays2" value="' . $_SESSION['PastDueDays2'] . '" size=3 maxlength=3></td> <td>' . _('As above but the next level of overdue') . '</td></tr>'; // DefaultCreditLimit -echo '<tr><td>' . _('Default Credit Limit') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Default Credit Limit') . ':</td> <td><input type="Text" class="number" Name="X_DefaultCreditLimit" value="' . $_SESSION['DefaultCreditLimit'] . '" size=12 maxlength=12></td> <td>' . _('The default used in new customer set up') . '</td></tr>'; // Check Credit Limits -echo '<tr><td>' . _('Check Credit Limits') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Check Credit Limits') . ':</td> <td><select Name="X_CheckCreditLimits"> <option '.($_SESSION['CheckCreditLimits']==0?'selected ':'').'value="0">'._('Do not check').' <option '.($_SESSION['CheckCreditLimits']==1?'selected ':'').'value="1">'._('Warn on breach').' @@ -364,7 +367,7 @@ <td>' . _('Credit limits can be checked at order entry to warn only or to stop the order from being entered where it would take a customer account balance over their limit') . '</td></tr>'; // Show_Settled_LastMonth -echo '<tr><td>' . _('Show Settled Last Month') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Show Settled Last Month') . ':</td> <td><select Name="X_Show_Settled_LastMonth"> <option '.($_SESSION['Show_Settled_LastMonth']?'selected ':'').'value="1">'._('Yes').' <option '.(!$_SESSION['Show_Settled_LastMonth']?'selected ':'').'value="0">'._('No').' @@ -372,22 +375,22 @@ <td>' . _('This setting refers to the format of customer statements. If the invoices and credit notes that have been paid and settled during the course of the current month should be shown then select Yes. Selecting No will only show currently outstanding invoices, credits and payments that have not been allocated') . '</td></tr>'; //RomalpaClause -echo '<tr><td>' . _('Romalpa Clause') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Romalpa Clause') . ':</td> <td><textarea Name="X_RomalpaClause" rows=3 cols=40>' . $_SESSION['RomalpaClause'] . '</textarea></td> <td>' . _('This text appears on invoices and credit notes in small print. Normally a reservation of title clause that gives the company rights to collect goods which have not been paid for - to give some protection for bad debts.') . '</td></tr>'; // QuickEntries -echo '<tr><td>' . _('Quick Entries') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Quick Entries') . ':</td> <td><input type="Text" class="number" Name="X_QuickEntries" value="' . $_SESSION['QuickEntries'] . '" size=3 maxlength=2></td> <td>' . _('This parameter defines the layout of the sales order entry screen. The number of fields available for quick entries. Any number from 1 to 99 can be entered.') . '</td></tr>'; // Frequently Ordered Items -echo '<tr><td>' . _('Frequently Ordered Items') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Frequently Ordered Items') . ':</td> <td><input type="Text" class="number" Name="X_FrequentlyOrderedItems" value="' . $_SESSION['FrequentlyOrderedItems'] . '" size=3 maxlength=2></td> <td>' . _('To show the most frequently ordered items enter the number of frequently ordered items you wish to display from 1 to 99. If you do not wish to display the frequently ordered item list enter 0.') . '</td></tr>'; //'AllowOrderLineItemNarrative' -echo '<tr><td>' . _('Order Entry allows Line Item Narrative') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Order Entry allows Line Item Narrative') . ':</td> <td><select Name="X_AllowOrderLineItemNarrative"> <option '.($_SESSION['AllowOrderLineItemNarrative']=='1'?'selected ':'').'value="1">'._('Allow Narrative Entry').' <option '.($_SESSION['AllowOrderLineItemNarrative']=='0'?'selected ':'').'value="0">'._('No Narrative Line').' @@ -396,7 +399,7 @@ </tr>'; //'RequirePickingNote' -echo '<tr><td>' . _('A picking note must be produced before an order can be delivered') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('A picking note must be produced before an order can be delivered') . ':</td> <td><select Name="X_RequirePickingNote"> <option '.($_SESSION['RequirePickingNote']=='1'?'selected ':'').'value="1">'._('Yes').' <option '.($_SESSION['RequirePickingNote']=='0'?'selected ':'').'value="0">'._('No').' @@ -405,7 +408,7 @@ </tr>'; //UpdateCurrencyRatesDaily -echo '<tr><td>' . _('Auto Update Exchange Rates Daily') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Auto Update Exchange Rates Daily') . ':</td> <td><select Name="X_UpdateCurrencyRatesDaily"> <option '.($_SESSION['UpdateCurrencyRatesDaily']!='0'?'selected ':'').'value="1">'._('Automatic').' <option '.($_SESSION['UpdateCurrencyRatesDaily']=='0'?'selected ':'').'value="0">'._('Manual').' @@ -414,7 +417,7 @@ </tr>'; //Default Packing Note Format -echo '<tr><td>' . _('Format of Packing Slips') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Format of Packing Slips') . ':</td> <td><select Name="X_PackNoteFormat"> <option '.($_SESSION['PackNoteFormat']=='1'?'selected ':'').'value="1">'._('Laser Printed').' <option '.($_SESSION['PackNoteFormat']=='2'?'selected ':'').'value="2">'._('Special Stationery').' @@ -423,7 +426,7 @@ </tr>'; //Default Invoice Format -echo '<tr><td>' . _('Invoice Orientation') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Invoice Orientation') . ':</td> <td><select Name="X_InvoicePortraitFormat"> <option '.($_SESSION['InvoicePortraitFormat']=='0'?'selected ':'').'value="0">'._('Landscape').' <option '.($_SESSION['InvoicePortraitFormat']=='1'?'selected ':'').'value="1">'._('Portrait').' @@ -432,7 +435,7 @@ </tr>'; //Blind packing note -echo '<tr><td>' . _('Show company details on packing slips') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Show company details on packing slips') . ':</td> <td><select Name="X_DefaultBlindPackNote"> <option '.($_SESSION['DefaultBlindPackNote']=="1"?'selected ':'').'value="1">'._('Show Company Details').' <option '.($_SESSION['DefaultBlindPackNote']=="2"?'selected ':'').'value="2">'._('Hide Company Details').' @@ -441,7 +444,7 @@ </tr>'; //Show values on GRN -echo '<tr><td>' . _('Show order values on GRN') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Show order values on GRN') . ':</td> <td><select Name="X_ShowValueOnGRN"> <option '.($_SESSION['ShowValueOnGRN']?'selected ':'').'value="1">'._('Yes').' <option '.(!$_SESSION['ShowValueOnGRN']?'selected ':'').'value="0">'._('No').' @@ -451,7 +454,7 @@ // DispatchCutOffTime -echo '<tr><td>' . _('Dispatch Cut-Off Time') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Dispatch Cut-Off Time') . ':</td> <td><select Name="X_DispatchCutOffTime">'; for ($i=0; $i < 24; $i++ ) echo '<option '.($_SESSION['DispatchCutOffTime'] == $i?'selected ':'').'value="'.$i.'">'.$i; @@ -459,7 +462,7 @@ <td>' . _('Orders entered after this time will default to be dispatched the following day, this can be over-ridden at the time of sales order entry') . '</td></tr>'; // AllowSalesOfZeroCostItems -echo '<tr><td>' . _('Allow Sales Of Zero Cost Items') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Allow Sales Of Zero Cost Items') . ':</td> <td><select Name="X_AllowSalesOfZeroCostItems"> <option '.($_SESSION['AllowSalesOfZeroCostItems']?'selected ':'').'value="1">'._('Yes').' <option '.(!$_SESSION['AllowSalesOfZeroCostItems']?'selected ':'').'value="0">'._('No').' @@ -467,7 +470,7 @@ <td>' . _('If an item selected at order entry does not have a cost set up then if this parameter is set to No then the order line will not be able to be entered') . '</td></tr>'; // CreditingControlledItems_MustExist -echo '<tr><td>' . _('Controlled Items Must Exist For Crediting') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Controlled Items Must Exist For Crediting') . ':</td> <td><select Name="X_CreditingControlledItems_MustExist"> <option '.($_SESSION['CreditingControlledItems_MustExist']?'selected ':'').'value="1">'._('Yes').' <option '.(!$_SESSION['CreditingControlledItems_MustExist']?'selected ':'').'value="0">'._('No').' @@ -478,7 +481,7 @@ $sql = 'SELECT typeabbrev, sales_type FROM salestypes ORDER BY sales_type'; $ErrMsg = _('Could not load price lists'); $result = DB_query($sql,$db,$ErrMsg); -echo '<tr><td>' . _('Default Price List') . ':</td>'; +echo '<tr style="outline: 1px solid"><td>' . _('Default Price List') . ':</td>'; echo '<td><select Name="X_DefaultPriceList">'; if( DB_num_rows($result) == 0 ) { echo '<option selected value="">'._('Unavailable'); @@ -494,7 +497,7 @@ $sql = 'SELECT shipper_id, shippername FROM shippers ORDER BY shippername'; $ErrMsg = _('Could not load shippers'); $result = DB_query($sql,$db,$ErrMsg); -echo '<tr><td>' . _('Default Shipper') . ':</td>'; +echo '<tr style="outline: 1px solid"><td>' . _('Default Shipper') . ':</td>'; echo '<td><select Name="X_Default_Shipper">'; if( DB_num_rows($result) == 0 ) { echo '<option selected value="">'._('Unavailable'); @@ -507,7 +510,7 @@ <td>' . _('This shipper is used where the best shipper for a customer branch has not been defined previously') . '</td></tr>'; // DoFreightCalc -echo '<tr><td>' . _('Do Freight Calculation') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Do Freight Calculation') . ':</td> <td><select Name="X_DoFreightCalc"> <option '.($_SESSION['DoFreightCalc']?'selected ':'').'value="1">'._('Yes').' <option '.(!$_SESSION['DoFreightCalc']?'selected ':'').'value="0">'._('No').' @@ -515,13 +518,13 @@ <td>' . _('If this is set to Yes then the system will attempt to calculate the freight cost of a dispatch based on the weight and cubic and the data defined for each shipper and their rates for shipping to various locations. The results of this calculation will only be meaningful if the data is entered for the item weight and volume in the stock item setup for all items and the freight costs for each shipper properly maintained.') . '</td></tr>'; //FreightChargeAppliesIfLessThan -echo '<tr><td>' . _('Apply freight charges if an order is less than') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Apply freight charges if an order is less than') . ':</td> <td><input type="Text" class="number" Name="X_FreightChargeAppliesIfLessThan" size=12 maxlength=12 value="' . $_SESSION['FreightChargeAppliesIfLessThan'] . '"></td> <td>' . _('This parameter is only effective if Do Freight Calculation is set to Yes. If it is set to 0 then freight is always charged. The total order value is compared to this value in deciding whether or not to charge freight') .'</td></tr>'; // AutoDebtorNo -echo '<tr><td>' . _('Create Debtor Codes Automatically') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Create Debtor Codes Automatically') . ':</td> <td><select Name="X_AutoDebtorNo">'; if ($_SESSION['AutoDebtorNo']==0) { @@ -538,7 +541,7 @@ $sql = 'SELECT taxcatid, taxcatname FROM taxcategories ORDER BY taxcatname'; $ErrMsg = _('Could not load tax categories table'); $result = DB_query($sql,$db,$ErrMsg); -echo '<tr><td>' . _('Default Tax Category') . ':</td>'; +echo '<tr style="outline: 1px solid"><td>' . _('Default Tax Category') . ':</td>'; echo '<td><select Name="X_DefaultTaxCategory">'; if( DB_num_rows($result) == 0 ) { echo '<option selected value="">'._('Unavailable'); @@ -552,7 +555,7 @@ //TaxAuthorityReferenceName -echo '<tr><td>' . _('TaxAuthorityReferenceName') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('TaxAuthorityReferenceName') . ':</td> <td><input type="Text" Name="X_TaxAuthorityReferenceName" size=16 maxlength=25 value="' . $_SESSION['TaxAuthorityReferenceName'] . '"></td> <td>' . _('This parameter is what is displayed on tax invoices and credits for the tax authority of the company eg. in Australian this would by A.B.N.: - in NZ it would be GST No: in the UK it would be VAT Regn. No') .'</td></tr>'; @@ -560,7 +563,7 @@ $sql = 'SELECT currabrev, country FROM currencies ORDER BY country'; $ErrMsg = _('Could not load the countries from the currency table'); $result = DB_query($sql,$db,$ErrMsg); -echo '<tr><td>' . _('Country Of Operation') . ':</td>'; +echo '<tr style="outline: 1px solid"><td>' . _('Country Of Operation') . ':</td>'; echo '<td><select name="X_CountryOfOperation">'; if( DB_num_rows($result) == 0 ) { echo '<option selected value="">'._('Unavailable'); @@ -573,14 +576,14 @@ <td>' . _('This parameter is only effective if Do Freight Calculation is set to Yes. Country names come from the currencies table.') .'</td></tr>'; // NumberOfPeriodsOfStockUsage -echo '<tr><td>' . _('Number Of Periods Of StockUsage') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Number Of Periods Of StockUsage') . ':</td> <td><select Name="X_NumberOfPeriodsOfStockUsage">'; for ($i=1; $i <= 12; $i++ ) echo '<option '.($_SESSION['NumberOfPeriodsOfStockUsage'] == $i?'selected ':'').'value="'.$i.'">'.$i; echo '</select></td><td>' . _('In stock usage inquiries this determines how many periods of stock usage to show. An average is calculated over this many periods') .'</td></tr>'; // Check_Qty_Charged_vs_Del_Qty -echo '<tr><td>' . _('Check Quantity Charged vs Deliver Qty') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Check Quantity Charged vs Deliver Qty') . ':</td> <td><select Name="X_Check_Qty_Charged_vs_Del_Qty"> <option '.($_SESSION['Check_Qty_Charged_vs_Del_Qty']?'selected ':'').'value="1">'._('Yes').' <option '.(!$_SESSION['Check_Qty_Charged_vs_Del_Qty']?'selected ':'').'value="0">'._('No').' @@ -588,7 +591,7 @@ <td>' . _('In entry of AP invoices this determines whether or not to check the quantities received into stock tie up with the quantities invoiced') .'</td></tr>'; // Check_Price_Charged_vs_Order_Price -echo '<tr><td>' . _('Check Price Charged vs Order Price') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Check Price Charged vs Order Price') . ':</td> <td><select Name="X_Check_Price_Charged_vs_Order_Price"> <option '.($_SESSION['Check_Price_Charged_vs_Order_Price']?'selected ':'').'value="1">'._('Yes').' <option '.(!$_SESSION['Check_Price_Charged_vs_Order_Price']?'selected ':'').'value="0">'._('No').' @@ -596,24 +599,24 @@ <td>' . _('In entry of AP invoices this parameter determines whether or not to check invoice prices tie up to ordered prices') .'</td></tr>'; // OverChargeProportion -echo '<tr><td>' . _('Allowed Over Charge Proportion') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Allowed Over Charge Proportion') . ':</td> <td><input type="Text" class="number" Name="X_OverChargeProportion" size=4 maxlength=3 value="' . $_SESSION['OverChargeProportion'] . '"></td> <td>' . _('If check price charges vs Order price is set to yes then this proportion determines the percentage by which invoices can be overcharged with respect to price') .'</td></tr>'; // OverReceiveProportion -echo '<tr><td>' . _('Allowed Over Receive Proportion') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Allowed Over Receive Proportion') . ':</td> <td><input type="Text" class="number" Name="X_OverReceiveProportion" size=4 maxlength=3 value="' . $_SESSION['OverReceiveProportion'] . '"></td> <td>' . _('If check quantity charged vs delivery quantity is set to yes then this proportion determines the percentage by which invoices can be overcharged with respect to delivery') .'</td></tr>'; // PO_AllowSameItemMultipleTimes -echo '<tr><td>' . _('Purchase Order Allows Same Item Multiple Times') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Purchase Order Allows Same Item Multiple Times') . ':</td> <td><select Name="X_PO_AllowSameItemMultipleTimes"> <option '.($_SESSION['PO_AllowSameItemMultipleTimes']?'selected ':'').'value="1">'._('Yes').' <option '.(!$_SESSION['PO_AllowSameItemMultipleTimes']?'selected ':'').'value="0">'._('No').' </select></td> <td></td></tr>'; // SO_AllowSameItemMultipleTimes -echo '<tr><td>' . _('Sales Order Allows Same Item Multiple Times') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Sales Order Allows Same Item Multiple Times') . ':</td> <td><select Name="X_SO_AllowSameItemMultipleTimes"> <option '.($_SESSION['SO_AllowSameItemMultipleTimes']?'selected ':'').'value="1">'._('Yes').' <option '.(!$_SESSION['SO_AllowSameItemMultipleTimes']?'selected ':'').'value="0">'._('No').' @@ -635,7 +638,7 @@ 10=>_('October'), 11=>_('November'), 12=>_('December') ); -echo '<tr><td>' . _('Financial Year Ends On') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Financial Year Ends On') . ':</td> <td><select Name="X_YearEnd">'; for ($i=1; $i <= sizeof($MonthNames); $i++ ) echo '<option '.($_SESSION['YearEnd'] == $i ? 'selected ' : '').'value="'.$i.'">'.$MonthNames[$i]; @@ -643,18 +646,18 @@ <td>' . _('Defining the month in which the financial year ends enables the system to provide useful defaults for general ledger reports') .'</td></tr>'; //PageLength -echo '<tr><td>' . _('Report Page Length') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Report Page Length') . ':</td> <td><input type="text" class="number" name="X_PageLength" size=4 maxlength=6 value="' . $_SESSION['PageLength'] . '"></td><td> </td> </tr>'; //DefaultDisplayRecordsMax -echo '<tr><td>' . _('Default Maximum Number of Records to Show') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Default Maximum Number of Records to Show') . ':</td> <td><input type="text" class="number" name="X_DefaultDisplayRecordsMax" size=4 maxlength=3 value="' . $_SESSION['DefaultDisplayRecordsMax'] . '"></td> <td>' . _('When pages have code to limit the number of returned records - such as select customer, select supplier and select item, then this will be the default number of records to show for a user who has not changed this for themselves in user settings.') . '</td> </tr>'; //MaxImageSize -echo '<tr><td>' . _('Maximum Size in KB of uploaded images') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Maximum Size in KB of uploaded images') . ':</td> <td><input type="text" class="number" name="X_MaxImageSize" size=4 maxlength=3 value="' . $_SESSION['MaxImageSize'] . '"></td> <td>' . _('Picture files of items can be uploaded to the server. The system will check that files uploaded are less than this size (in KB) before they will be allowed to be uploaded. Large pictures will make the system slow and will be difficult to view in the stock maintenance screen.') .'</td> </tr>'; @@ -668,13 +671,13 @@ $row = DB_fetch_array($result); $_SESSION['NumberOfMonthMustBeShown'] = $row['confvalue']; -echo '<tr><td>' . _('Number Of Month Must Be Shown') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Number Of Month Must Be Shown') . ':</td> <td><input type="text" class="number" name="X_NumberOfMonthMustBeShown" size=4 maxlength=3 value="' . $_SESSION['NumberOfMonthMustBeShown'] . '"></td> <td>' . _('Number of month must be shown on report can be changed with this parameters ex: in CustomerInquiry.php ') .'</td> </tr>'; //$part_pics_dir -echo '<tr><td>' . _('The directory where images are stored') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('The directory where images are stored') . ':</td> <td><select name="X_part_pics_dir">'; @@ -704,7 +707,7 @@ //$reports_dir -echo '<tr><td>' . _('The directory where reports are stored') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('The directory where reports are stored') . ':</td> <td><select name="X_reports_dir">'; $DirHandle = dir($CompanyDirectory); @@ -737,7 +740,7 @@ // HTTPS_Only -echo '<tr><td>' . _('Only allow secure socket connections') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Only allow secure socket connections') . ':</td> <td><select name="X_HTTPS_Only"> <option '.($_SESSION['HTTPS_Only']?'selected ':'').'value="1">'._('Yes') . '</option> <option '.(!$_SESSION['HTTPS_Only']?'selected ':'').'value="0">'._('No') . '</option> @@ -746,7 +749,7 @@ </tr>'; /*Perform Database maintenance DB_Maintenance*/ -echo '<tr><td>' . _('Perform Database Maintenance At Logon') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Perform Database Maintenance At Logon') . ':</td> <td><select name="X_DB_Maintenance">'; if ($_SESSION['DB_Maintenance']=='1'){ echo '<option selected value="1">'._('Daily') . '</option>'; @@ -777,7 +780,7 @@ _('WackoWiki'), _('MediaWiki') ); -echo '<tr><td>' . _('Wiki application') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Wiki application') . ':</td> <td><select name="X_WikiApp">'; for ($i=0; $i < sizeof($WikiApplications); $i++ ) { echo '<option '.($_SESSION['WikiApp'] == $WikiApplications[$i] ? 'selected ' : '').'value="'.$WikiApplications[$i].'">'.$WikiApplications[$i] . '</option>'; @@ -785,11 +788,11 @@ echo '</select></td> <td>' . _('This feature makes webERP show links to a free form company knowledge base using a wiki. This allows sharing of important company information - about customers, suppliers and products and the set up of work flow menus and/or company procedures documentation') .'</td></tr>'; -echo '<tr><td>' . _('Wiki Path') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Wiki Path') . ':</td> <td><input type="text" name="X_WikiPath" size=40 maxlength=40 value="' . $_SESSION['WikiPath'] . '"></td> <td>' . _('The path to the wiki installation to form the basis of wiki URLs - this should be the directory on the web-server where the wiki is installed. The wiki must be installed on the same web-server as webERP') .'</td></tr>'; -echo '<tr><td>' . _('Geocode Customers and Suppliers') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Geocode Customers and Suppliers') . ':</td> <td><select name="X_geocode_integration">'; if ($_SESSION['geocode_integration']==1){ echo '<option selected value="1">' . _('Geocode Integration Enabled') . '</option>'; @@ -801,7 +804,7 @@ echo '</select></td> <td>' . _('This feature will give Latitude and Longitude coordinates to customers and suppliers. Requires access to a mapping provider. You must setup this facility under Main Menu - Setup - Geocode Setup. This feature is experimental.') .'</td></tr>'; -echo '<tr><td>' . _('Extended Customer Information') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Extended Customer Information') . ':</td> <td><select name="X_Extended_CustomerInfo">'; if ($_SESSION['Extended_CustomerInfo']==1){ echo '<option selected value="1">' . _('Extended Customer Info Enabled') . '</option>'; @@ -813,7 +816,7 @@ echo '</select></td> <td>' . _('This feature will give extended information in the Select Customer screen.') .'</td></tr>'; -echo '<tr><td>' . _('Extended Supplier Information') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Extended Supplier Information') . ':</td> <td><select name="X_Extended_SupplierInfo">'; if ($_SESSION['Extended_SupplierInfo']==1){ echo '<option selected value="1">' . _('Extended Supplier Info Enabled') . '</option>'; @@ -825,7 +828,7 @@ echo '</select></td> <td>' . _('This feature will give extended information in the Select Supplier screen.') .'</td></tr>'; -echo '<tr><td>' . _('Prohibit GL Journals to Control Accounts') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Prohibit GL Journals to Control Accounts') . ':</td> <td><select name="X_ProhibitJournalsToControlAccounts">'; if ($_SESSION['ProhibitJournalsToControlAccounts']=='1'){ echo '<option selected value="1">' . _('Prohibited') . '</option>'; @@ -837,7 +840,7 @@ echo '</select></td><td>' . _('Setting this to prohibited prevents accidentally entering a journal to the automatically posted and reconciled control accounts for creditors (AP) and debtors (AR)') . '</td></tr>'; -echo '<tr><td>' . _('Prohibit GL Journals to Periods Prior To') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Prohibit GL Journals to Periods Prior To') . ':</td> <td><select Name="X_ProhibitPostingsBefore">'; $sql = 'SELECT lastdate_in_period FROM periods ORDER BY periodno DESC'; @@ -852,7 +855,7 @@ } echo '</select></td><td>' . _('This allows all periods before the selected date to be locked from postings. All postings for transactions dated prior to this date will be posted in the period following this date.') . '</td></tr>'; -echo '<tr><td>' . _('Inventory Costing Method') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Inventory Costing Method') . ':</td> <td><select name="X_WeightedAverageCosting">'; if ($_SESSION['WeightedAverageCosting']==1){ @@ -865,7 +868,7 @@ echo '</select></td><td>' . _('webERP allows inventory to be costed based on the weighted average of items in stock or full standard costing with price variances reported. The selection here determines the method used and the general ledger postings resulting from purchase invoices and shipment closing') . '</td></tr>'; -echo '<tr><td>' . _('Auto Issue Components') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Auto Issue Components') . ':</td> <td> <select name="X_AutoIssue">'; if ($_SESSION['AutoIssue']==0) { @@ -877,7 +880,7 @@ } echo '</select></td><td>' . _('When items are manufactured it is possible for the components of the item to be automatically decremented from stock in accordance with the Bill of Material setting') . '</td></tr>' ; -echo '<tr><td>' . _('Prohibit Negative Stock') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Prohibit Negative Stock') . ':</td> <td> <select name="X_ProhibitNegativeStock">'; if ($_SESSION['ProhibitNegativeStock']==0) { @@ -890,12 +893,12 @@ echo '</select></td><td>' . _('Setting this parameter to Yes prevents invoicing and the issue of stock if this would result in negative stock. The stock problem must be corrected before the invoice or issue is allowed to be processed.') . '</td></tr>' ; //Months of Audit Trail to Keep -echo '<tr><td>' . _('Months of Audit Trail to Retain') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Months of Audit Trail to Retain') . ':</td> <td><input type="text" class="number" name="X_MonthsAuditTrail" size=3 maxlength=2 value="' . $_SESSION['MonthsAuditTrail'] . '"></td><td>' . _('If this parameter is set to 0 (zero) then no audit trail is retained. An audit trail is a log of which users performed which additions updates and deletes of database records. The full SQL is retained') . '</td> </tr>'; //Which messages to log -echo '<tr><td>' . _('Log Severity Level') . ':</td><td><select name="X_LogSeverity" >'; +echo '<tr style="outline: 1px solid"><td>' . _('Log Severity Level') . ':</td><td><select name="X_LogSeverity" >'; if ($_SESSION['LogSeverity']==0) { echo '<option selected value=0>' ._('None'). '</option>'; echo '<option value=1>' ._('Errors Only'). '</option>'; @@ -931,12 +934,12 @@ echo '<td>' . _('Choose which Status messages to keep in your log file.') . '</td></tr>'; //Path to keep log files in -echo '<tr><td>' . _('Path to log files') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Path to log files') . ':</td> <td><input type="text" name="X_LogPath" size=40 maxlength=79 value="' . $_SESSION['LogPath'] . '"></td><td>' . _('The path to the directory where the log files will be stored. Note the apache user must have write permissions on this directory.') . '</td> </tr>'; //DefineControlledOnWOEntry -echo '<tr><td>' . _('Controlled Items Defined At Work Order Entry') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Controlled Items Defined At Work Order Entry') . ':</td> <td><select Name="X_DefineControlledOnWOEntry"> <option '.($_SESSION['DefineControlledOnWOEntry']?'selected ':'').'value="1">'._('Yes').' <option '.(!$_SESSION['DefineControlledOnWOEntry']?'selected ':'').'value="0">'._('No').' @@ -944,7 +947,7 @@ <td>' . _('When set to yes, controlled items are defined at the time of the work order creation. Otherwise controlled items (serial numbers and batch/roll/lot references) are entered at the time the finished items are received against the work order') . '</td></tr>'; //AutoCreateWOs -echo '<tr><td>' . _('Auto Create Work Orders') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Auto Create Work Orders') . ':</td> <td> <select name="X_AutoCreateWOs">'; @@ -957,7 +960,7 @@ } echo '</select></td><td>' . _('Setting this parameter to Yes will ensure that when a sales order is placed if there is insufficient stock then a new work order is created at the default factory location') . '</td></tr>' ; -echo '<tr><td>' . _('Default Factory Location') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Default Factory Location') . ':</td> <td><select Name="X_DefaultFactoryLocation">'; $sql = 'SELECT loccode,locationname FROM locations'; @@ -972,16 +975,16 @@ } echo '</select></td><td>' . _('This location is the location where work orders will be created from when the auto create work orders option is activated') . '</td></tr>'; -echo '<tr><td>' . _('Factory Manager Email Address') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Factory Manager Email Address') . ':</td> <td><input type="text" name="X_FactoryManagerEmail" size=50 maxlength=50 value="' . $_SESSION['FactoryManagerEmail'] . '"></td> <td>' . _('Work orders automatically created when sales orders are entered will be emailed to this address') .'</td></tr>'; -echo '<tr><td>' . _('Purchasing Manager Email Address') . ':</td> +echo '<tr style="outline: 1px solid"><td>' . _('Purchasing Manager Email Address') . ':</td> <td><input type="text" name="X_PurchasingManagerEmail" size=50 maxlength=50 value="' . $_SESSION['PurchasingManagerEmail'] . '"></td> <td>' . _('The email address for the purchasing manager, used to receive notifications by the tendering system') .'</td></tr>'; -echo '</table><div class="centre"><input type="Submit" Name="submit" value="' . _('Update') . '"></div></form>'; +echo '</table><br /><div class="centre"><input type="Submit" Name="submit" value="' . _('Update') . '"></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-28 09:50:07 UTC (rev 3816) +++ trunk/doc/Change.log.html 2010-09-28 12:11:16 UTC (rev 3817) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>28/09/10 Tim: SystemParameters.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: SuppTransGLAnalysis.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: SuppShiptCharges.php - Layout changes and improvements</p> <p>28/09/10 Tim: SuppPriceList.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-28 12:44:59
|
Revision: 3818 http://web-erp.svn.sourceforge.net/web-erp/?rev=3818&view=rev Author: tim_schofield Date: 2010-09-28 12:44:53 +0000 (Tue, 28 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements Modified Paths: -------------- trunk/Tax.php trunk/doc/Change.log.html Modified: trunk/Tax.php =================================================================== --- trunk/Tax.php 2010-09-28 12:11:16 UTC (rev 3817) +++ trunk/Tax.php 2010-09-28 12:44:53 UTC (rev 3818) @@ -5,15 +5,15 @@ $PageSecurity = 2; include('includes/session.inc'); -if (isset($_POST['TaxAuthority']) AND - isset($_POST['PrintPDF']) AND - isset($_POST['NoOfPeriods']) AND +if (isset($_POST['TaxAuthority']) AND + isset($_POST['PrintPDF']) AND + isset($_POST['NoOfPeriods']) AND isset($_POST['ToPeriod'])){ include('includes/PDFStarter.php'); - - $sql = 'SELECT lastdate_in_period - FROM periods + + $sql = 'SELECT lastdate_in_period + FROM periods WHERE periodno=' . $_POST['ToPeriod']; $ErrMsg = _('Could not determine the last date of the period selected') . '. ' . _('The sql returned the following error'); $PeriodEndResult = DB_query($sql,$db,$ErrMsg); @@ -25,16 +25,16 @@ $TaxAuthorityName = $TaxAuthDescription[0]; $pdf->addInfo('Title',_('Taxation Report')); - $ReportTitle = $TaxAuthorityName . ' ' . _('Tax Report for') . ' ' . $_POST['NoOfPeriods'] . ' ' . _('months to') . ' ' . $PeriodEnd; + $ReportTitle = $TaxAuthorityName . ' ' . _('Tax Report for') . ' ' . $_POST['NoOfPeriods'] . ' ' . _('months to') . ' ' . $PeriodEnd; $pdf->addInfo('Subject', $ReportTitle); - + $FontSize=12; $PageNumber=0; $line_height=12; - + /*Now get the invoices for the tax report */ - - $SQL = 'SELECT debtortrans.transno, + + $SQL = "SELECT debtortrans.transno, debtortrans.type, systypes.typename, debtortrans.trandate, @@ -49,11 +49,11 @@ INNER JOIN debtorsmaster ON debtortrans.debtorno=debtorsmaster.debtorno INNER JOIN systypes ON debtortrans.type=systypes.typeid INNER JOIN debtortranstaxes ON debtortrans.id = debtortranstaxes.debtortransid - WHERE debtortrans.prd >= ' . ($_POST['ToPeriod'] - $_POST['NoOfPeriods'] + 1) . ' - AND debtortrans.prd <= ' . $_POST['ToPeriod'] . ' + WHERE debtortrans.prd >= '" . ($_POST['ToPeriod'] - $_POST['NoOfPeriods'] + 1) . "' + AND debtortrans.prd <= '" . $_POST['ToPeriod'] . "' AND (debtortrans.type=10 OR debtortrans.type=11) - AND debtortranstaxes.taxauthid = ' . $_POST['TaxAuthority'] . ' - ORDER BY debtortrans.id'; + AND debtortranstaxes.taxauthid = '" . $_POST['TaxAuthority'] . "' + ORDER BY debtortrans.id"; $DebtorTransResult = DB_query($SQL,$db,'','',false,false); //don't trap errors in DB_query @@ -124,7 +124,7 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,350,12, _('Total Outputs'),'right'); } - + if ($_POST['DetailOrSummary']=='Detail'){ /*Print out the outputs totals */ $LeftOvers = $pdf->addTextWrap(410,$YPos,60,8, number_format($Outputs,2),'right'); @@ -160,12 +160,12 @@ supptranstaxes.taxamount/supptrans.rate AS taxamt FROM supptrans INNER JOIN suppliers ON supptrans.supplierno=suppliers.supplierid - INNER JOIN systypes ON supptrans.type=systypes.typeid - INNER JOIN supptranstaxes ON supptrans.id = supptranstaxes.supptransid + INNER JOIN systypes ON supptrans.type=systypes.typeid + INNER JOIN supptranstaxes ON supptrans.id = supptranstaxes.supptransid WHERE supptrans.trandate >= '" . $StartDateSQL . "' AND supptrans.trandate <= '" . FormatDateForSQL($PeriodEnd) . "' - AND (supptrans.type=20 OR supptrans.type=21) - AND supptranstaxes.taxauthid = " . $_POST['TaxAuthority'] . " + AND (supptrans.type=20 OR supptrans.type=21) + AND supptranstaxes.taxauthid = '" . $_POST['TaxAuthority'] . "' ORDER BY supptrans.trandate"; $SuppTransResult = DB_query($SQL,$db,'','',false,false); //doint trap errors in DB_query @@ -223,7 +223,7 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,350,12, _('Total Inputs'),'right'); } /*Accumulate the input totals */ - + if ($_POST['DetailOrSummary']=='Detail'){ /*Print out the input totals */ $LeftOvers = $pdf->addTextWrap(410,$YPos,60,8, number_format($Inputs,2),'right'); @@ -295,11 +295,14 @@ $title=_('Tax Reporting'); include('includes/header.inc'); - echo '<form action=' . $_SERVER['PHP_SELF'] . " method='POST'><table>"; + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Supplier Types') + . '" alt="">' . $title. '</p>'; + echo '<form action=' . $_SERVER['PHP_SELF'] . " method='POST'><table class=selection>"; + echo '<tr><td>' . _('Tax Authority To Report On:') . ':</font></td> <td><select name=TaxAuthority>'; - + $result = DB_query('SELECT taxid, description FROM taxauthorities',$db); while ($myrow = DB_fetch_array($result)){ echo '<option Value=' . $myrow['taxid'] . '>' . $myrow['description']; @@ -320,8 +323,8 @@ $DefaultPeriod = GetPeriod(Date($_SESSION['DefaultDateFormat'],Mktime(0,0,0,Date('m'),0,Date('Y'))),$db); - $sql = 'SELECT periodno, - lastdate_in_period + $sql = 'SELECT periodno, + lastdate_in_period FROM periods'; $ErrMsg = _('Could not retrieve the period data because'); @@ -345,11 +348,11 @@ echo "</table> - <div class='centre'><input type=Submit Name='PrintPDF' Value='" . _('Print PDF') . "'> + <br /><div class='centre'><input type=Submit Name='PrintPDF' Value='" . _('Print PDF') . "'> </div> </form>"; include('includes/footer.inc'); } /*end of else not PrintPDF */ -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-28 12:11:16 UTC (rev 3817) +++ trunk/doc/Change.log.html 2010-09-28 12:44:53 UTC (rev 3818) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>28/09/10 Tim: Tax.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: SystemParameters.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: SuppTransGLAnalysis.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: SuppShiptCharges.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-28 13:28:13
|
Revision: 3819 http://web-erp.svn.sourceforge.net/web-erp/?rev=3819&view=rev Author: tim_schofield Date: 2010-09-28 13:10:31 +0000 (Tue, 28 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements Modified Paths: -------------- trunk/TaxAuthorities.php trunk/doc/Change.log.html Modified: trunk/TaxAuthorities.php =================================================================== --- trunk/TaxAuthorities.php 2010-09-28 12:44:53 UTC (rev 3818) +++ trunk/TaxAuthorities.php 2010-09-28 13:10:31 UTC (rev 3819) @@ -7,6 +7,8 @@ $title = _('Tax Authorities'); include('includes/header.inc'); +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Supplier Types') + . '" alt="">' . $title. '</p>'; if (isset($_POST['SelectedTaxAuthID'])){ $SelectedTaxAuthID =$_POST['SelectedTaxAuthID']; @@ -30,15 +32,15 @@ would not run in this case cos submit is false of course see the delete code below*/ - $sql = 'UPDATE taxauthorities - SET taxglcode =' . $_POST['TaxGLCode'] . ', - purchtaxglaccount =' . $_POST['PurchTaxGLCode'] . ", + $sql = "UPDATE taxauthorities + SET taxglcode ='" . $_POST['TaxGLCode'] . "', + purchtaxglaccount ='" . $_POST['PurchTaxGLCode'] . "', description = '" . $_POST['Description'] . "', bank = '". $_POST['Bank']."', bankacctype = '". $_POST['BankAccType']."', bankacc = '". $_POST['BankAcc']."', bankswift = '". $_POST['BankSwift']."' - WHERE taxid = " . $SelectedTaxAuthID; + WHERE taxid = '" . $SelectedTaxAuthID . "'"; $ErrMsg = _('The update of this tax authority failed because'); $result = DB_query($sql,$db,$ErrMsg); @@ -56,10 +58,10 @@ bank, bankacctype, bankacc, - bankswift) + bankswift) VALUES ( - " . $_POST['TaxGLCode'] . ", - " . $_POST['PurchTaxGLCode'] . ", + '" . $_POST['TaxGLCode'] . "', + '" . $_POST['PurchTaxGLCode'] . "', '" .$_POST['Description'] . "', '" .$_POST['Bank'] . "', '" .$_POST['BankAccType'] . "', @@ -79,13 +81,13 @@ dispatchtaxprovince, taxcatid ) - SELECT + SELECT ' . $NewTaxID . ', taxprovinces.taxprovinceid, taxcategories.taxcatid - FROM taxprovinces, + FROM taxprovinces, taxcategories'; - + $InsertResult = DB_query($sql,$db); } //run the SQL from either of the above possibilites @@ -95,26 +97,26 @@ unset( $_POST['Description']); unset( $SelectedTaxID ); } - + prnMsg($msg); - + } elseif (isset($_GET['delete'])) { //the link to delete a selected record was clicked instead of the submit button // PREVENT DELETES IF DEPENDENT RECORDS IN OTHER TABLES - $sql= 'SELECT COUNT(*) - FROM taxgrouptaxes - WHERE taxauthid=' . $SelectedTaxAuthID; - + $sql= "SELECT COUNT(*) + FROM taxgrouptaxes + WHERE taxauthid='" . $SelectedTaxAuthID . "'"; + $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { prnmsg(_('Cannot delete this tax authority because there are tax groups defined that use it'),'warn'); } else { /*Cascade deletes in TaxAuthLevels */ - $result = DB_query('DELETE FROM taxauthrates WHERE taxauthority= ' . $SelectedTaxAuthID,$db); - $result = DB_query('DELETE FROM taxauthorities WHERE taxid= ' . $SelectedTaxAuthID,$db); + $result = DB_query("DELETE FROM taxauthrates WHERE taxauthority= '" . $SelectedTaxAuthID . "'",$db); + $result = DB_query("DELETE FROM taxauthorities WHERE taxid= '" . $SelectedTaxAuthID . "'",$db); prnMsg(_('The selected tax authority record has been deleted'),'success'); unset ($SelectedTaxAuthID); } // end of related records testing @@ -126,7 +128,7 @@ $sql = 'SELECT taxid, description, - taxglcode, + taxglcode, purchtaxglaccount, bank, bankacc, @@ -138,7 +140,7 @@ $DbgMsg = _('The following SQL to retrieve the tax authorities was used'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); - echo '<table border=1>'; + echo '<table class=selection>'; echo "<tr> <th>" . _('ID') . "</th> <th>" . _('Description') . "</th> @@ -149,10 +151,18 @@ <th>" . _('Bank Act Type') . "</th> <th>" . _('Bank Swift') . "</th> </tr></font>"; - + $k=0; while ($myrow = DB_fetch_row($result)) { - printf("<tr><td>%s</td> + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k++; + } + + printf("<td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> @@ -160,10 +170,10 @@ <td>%s</td> <td>%s</td> <td>%s</td> + <td><a href=\"%s&SelectedTaxAuthID=%s\">" . _('Edit') . "</a></td> + <td><a href=\"%s&SelectedTaxAuthID=%s&delete=yes\">" . _('Delete') . "</a></td> <td><td><a href=\"%s&TaxAuthority=%s\">" . _('Edit Rates') . "</a></td> - <td><a href=\"%s&SelectedTaxAuthID=%s\">" . _('Edit') . "</a></td> - <td><a href=\"%s&SelectedTaxAuthID=%s&delete=yes\">" . _('Delete') . '</a></td> - </tr>', + </tr>", $myrow[0], $myrow[1], $myrow[3], @@ -172,11 +182,11 @@ $myrow[5], $myrow[6], $myrow[7], - $rootpath . '/TaxAuthorityRates.php?' . SID, + $_SERVER['PHP_SELF'] . '?' . SID, $myrow[0], $_SERVER['PHP_SELF'] . '?' . SID, $myrow[0], - $_SERVER['PHP_SELF'] . '?' . SID, + $rootpath . '/TaxAuthorityRates.php?' . SID, $myrow[0]); } @@ -199,15 +209,15 @@ if (isset($SelectedTaxAuthID)) { //editing an existing tax authority - $sql = 'SELECT taxglcode, - purchtaxglaccount, + $sql = "SELECT taxglcode, + purchtaxglaccount, description, bank, bankacc, bankacctype, - bankswift - FROM taxauthorities - WHERE taxid=' . $SelectedTaxAuthID; + bankswift + FROM taxauthorities + WHERE taxid='" . $SelectedTaxAuthID . "'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); @@ -219,8 +229,8 @@ $_POST['BankAccType'] = $myrow['bankacctype']; $_POST['BankAcc'] = $myrow['bankacc']; $_POST['BankSwift'] = $myrow['bankswift']; - + echo "<input type=hidden name='SelectedTaxAuthID' VALUE=" . $SelectedTaxAuthID . '>'; } //end of if $SelectedTaxAuthID only do the else when a new record is being entered @@ -231,14 +241,14 @@ FROM chartmaster, accountgroups WHERE chartmaster.group_=accountgroups.groupname - AND accountgroups.pandl=0 + AND accountgroups.pandl=0 ORDER BY accountcode'; $result = DB_query($SQL,$db); if (!isset($_POST['Description'])) { $_POST['Description']=''; } -echo '<table> +echo '<table class=selection> <tr><td>' . _('Tax Type Description') . ":</td> <td><input type=Text name='Description' size=21 maxlength=20 value='" . $_POST['Description'] . "'></td></tr>"; @@ -299,7 +309,7 @@ echo '</table>'; -echo '<div class="centre"><input type=submit name=submit value=' . _('Enter Information') . '></div></form>'; +echo '<br /><div class="centre"><input type=submit name=submit value=' . _('Enter Information') . '></div></form>'; include('includes/footer.inc'); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-28 12:44:53 UTC (rev 3818) +++ trunk/doc/Change.log.html 2010-09-28 13:10:31 UTC (rev 3819) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>28/09/10 Tim: TaxAuthorities.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: Tax.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: SystemParameters.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: SuppTransGLAnalysis.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-28 17:59:39
|
Revision: 3820 http://web-erp.svn.sourceforge.net/web-erp/?rev=3820&view=rev Author: tim_schofield Date: 2010-09-28 17:59:33 +0000 (Tue, 28 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements Modified Paths: -------------- trunk/TaxAuthorityRates.php trunk/doc/Change.log.html Modified: trunk/TaxAuthorityRates.php =================================================================== --- trunk/TaxAuthorityRates.php 2010-09-28 13:10:31 UTC (rev 3819) +++ trunk/TaxAuthorityRates.php 2010-09-28 17:59:33 UTC (rev 3820) @@ -14,6 +14,9 @@ $title = _('Tax Rates'); include('includes/header.inc'); +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Supplier Types') + . '" alt="">' . $title. '</p>'; + /* <-- $Revision: 1.16 $ --> */ if (!isset($TaxAuthority)){ @@ -25,19 +28,19 @@ if (isset($_POST['UpdateRates'])){ - $TaxRatesResult = DB_query('SELECT taxauthrates.taxcatid, + $TaxRatesResult = DB_query("SELECT taxauthrates.taxcatid, taxauthrates.taxrate, taxauthrates.dispatchtaxprovince FROM taxauthrates - WHERE taxauthrates.taxauthority=' . $TaxAuthority, + WHERE taxauthrates.taxauthority='" . $TaxAuthority . "'", $db); while ($myrow=DB_fetch_array($TaxRatesResult)){ - $sql = 'UPDATE taxauthrates SET taxrate=' . ($_POST[$myrow['dispatchtaxprovince'] . '_' . $myrow['taxcatid']]/100) . ' - WHERE taxcatid = ' . $myrow['taxcatid'] . ' - AND dispatchtaxprovince = ' . $myrow['dispatchtaxprovince'] . ' - AND taxauthority = ' . $TaxAuthority; + $sql = "UPDATE taxauthrates SET taxrate=" . ($_POST[$myrow['dispatchtaxprovince'] . '_' . $myrow['taxcatid']]/100) . " + WHERE taxcatid = '" . $myrow['taxcatid'] . "' + AND dispatchtaxprovince = '" . $myrow['dispatchtaxprovince'] . "' + AND taxauthority = '" . $TaxAuthority . "'"; DB_query($sql,$db); } prnMsg(_('All rates updated successfully'),'info'); @@ -49,33 +52,33 @@ /*Display updated rates */ -$TaxAuthDetail = DB_query('SELECT description FROM taxauthorities WHERE taxid=' . $TaxAuthority,$db); +$TaxAuthDetail = DB_query("SELECT description FROM taxauthorities WHERE taxid='" . $TaxAuthority . "'",$db); $myrow = DB_fetch_row($TaxAuthDetail); -echo '<font size=3 color=BLUE><b>' . _('Update') . ' ' . $myrow[0] . ' ' . _('Rates') . '</b></font>'; echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID .'" method=post>'; echo '<input type=hidden name="TaxAuthority" VALUE=' . $TaxAuthority . '>'; -$TaxRatesResult = DB_query('SELECT taxauthrates.taxcatid, +$TaxRatesResult = DB_query("SELECT taxauthrates.taxcatid, taxcategories.taxcatname, taxauthrates.taxrate, taxauthrates.dispatchtaxprovince, taxprovinces.taxprovincename FROM taxauthrates INNER JOIN taxauthorities ON taxauthrates.taxauthority=taxauthorities.taxid - INNER JOIN taxprovinces + INNER JOIN taxprovinces ON taxauthrates.dispatchtaxprovince= taxprovinces.taxprovinceid - INNER JOIN taxcategories + INNER JOIN taxcategories ON taxauthrates.taxcatid=taxcategories.taxcatid - WHERE taxauthrates.taxauthority=' . $TaxAuthority . " - ORDER BY taxauthrates.dispatchtaxprovince, + WHERE taxauthrates.taxauthority='" . $TaxAuthority . "' + ORDER BY taxauthrates.dispatchtaxprovince, taxauthrates.taxcatid", $db); if (DB_num_rows($TaxRatesResult)>0){ - echo '<table cellpadding=2 border=2>'; + echo '<table cellpadding=2 class=selection>'; + echo '<tr><th colspan=3><font size=3 color=navy>' . _('Update') . ' ' . $myrow[0] . ' ' . _('Rates') . '</font></th></tr>'; $TableHeader = '<tr><th>' . _('Deliveries From') . '<br>' . _('Tax Province') . '</th> <th>' . _('Tax Category') . '</th> <th>' . _('Tax Rate') . ' %</th></tr>'; @@ -83,9 +86,9 @@ $j = 1; $k = 0; //row counter to determine background colour $OldProvince=''; - + while ($myrow = DB_fetch_array($TaxRatesResult)){ - + if ($OldProvince!=$myrow['dispatchtaxprovince'] AND $OldProvince!=''){ echo '<tr bgcolor="#555555"><font size=1> </font><td colspan=3></td></tr>'; } @@ -106,14 +109,14 @@ $myrow['taxcatname'], $myrow['dispatchtaxprovince'] . '_' . $myrow['taxcatid'], $myrow['taxrate']*100 ); - + $OldProvince = $myrow['dispatchtaxprovince']; } //end of while loop echo '</table>'; echo "<br><div class='centre'><input type=submit name='UpdateRates' VALUE='" . _('Update Rates') . "'>"; -} //end if tax taxcatid/rates to show +} //end if tax taxcatid/rates to show else { prnMsg(_('There are no tax rates to show - perhaps the dispatch tax province records have not yet been created?'),'warn'); } Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-28 13:10:31 UTC (rev 3819) +++ trunk/doc/Change.log.html 2010-09-28 17:59:33 UTC (rev 3820) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>28/09/10 Tim: TaxAuthorityRates.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: TaxAuthorities.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: Tax.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: SystemParameters.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-28 18:12:21
|
Revision: 3821 http://web-erp.svn.sourceforge.net/web-erp/?rev=3821&view=rev Author: tim_schofield Date: 2010-09-28 18:12:15 +0000 (Tue, 28 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements Modified Paths: -------------- trunk/TaxCategories.php trunk/doc/Change.log.html Modified: trunk/TaxCategories.php =================================================================== --- trunk/TaxCategories.php 2010-09-28 17:59:33 UTC (rev 3820) +++ trunk/TaxCategories.php 2010-09-28 18:12:15 UTC (rev 3821) @@ -9,6 +9,9 @@ include('includes/header.inc'); +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Supplier Types') + . '" alt="">' . $title. '</p>'; + if ( isset($_GET['SelectedTaxCategory']) ) $SelectedTaxCategory = $_GET['SelectedTaxCategory']; elseif (isset($_POST['SelectedTaxCategory'])) @@ -39,7 +42,7 @@ /*SelectedTaxCategory could also exist if submit had not been clicked this code would not run in this case cos submit is false of course see the delete code below*/ // Check the name does not clash $sql = "SELECT count(*) FROM taxcategories - WHERE taxcatid <> " . $SelectedTaxCategory ." + WHERE taxcatid <> '" . $SelectedTaxCategory ."' AND taxcatname ".LIKE." '" . $_POST['TaxCategoryName'] . "'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); @@ -50,7 +53,7 @@ // Get the old name and check that the record still exists $sql = "SELECT taxcatname FROM taxcategories - WHERE taxcatid = " . $SelectedTaxCategory; + WHERE taxcatid = '" . $SelectedTaxCategory . "'"; $result = DB_query($sql,$db); if ( DB_num_rows($result) != 0 ) { // This is probably the safest way there is @@ -88,13 +91,13 @@ $LastTaxCatID = DB_Last_Insert_ID($db, 'taxcategories','taxcatid'); - $sql = 'INSERT INTO taxauthrates (taxauthority, + $sql = "INSERT INTO taxauthrates (taxauthority, dispatchtaxprovince, taxcatid) SELECT taxauthorities.taxid, taxprovinces.taxprovinceid, - ' . $LastTaxCatID . ' - FROM taxauthorities CROSS JOIN taxprovinces'; + '" . $LastTaxCatID . "' + FROM taxauthorities CROSS JOIN taxprovinces"; $result = DB_query($sql,$db,$ErrMsg,true); $result = DB_Txn_Commit($db); @@ -114,7 +117,7 @@ // PREVENT DELETES IF DEPENDENT RECORDS IN 'stockmaster' // Get the original name of the tax category the ID is just a secure way to find the tax category $sql = "SELECT taxcatname FROM taxcategories - WHERE taxcatid = " . $SelectedTaxCategory; + WHERE taxcatid = '" . $SelectedTaxCategory . "'"; $result = DB_query($sql,$db); if ( DB_num_rows($result) == 0 ) { // This is probably the safest way there is @@ -129,9 +132,9 @@ prnMsg( _('Cannot delete this tax category because inventory items have been created using this tax category'),'warn'); echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('inventory items that refer to this tax category') . '</font>'; } else { - $sql = 'DELETE FROM taxauthrates WHERE taxcatid = ' . $SelectedTaxCategory; + $sql = "DELETE FROM taxauthrates WHERE taxcatid = '" . $SelectedTaxCategory . "'"; $result = DB_query($sql,$db); - $sql = 'DELETE FROM taxcategories WHERE taxcatid = ' .$SelectedTaxCategory;; + $sql = "DELETE FROM taxcategories WHERE taxcatid = '" . $SelectedTaxCategory . "'"; $result = DB_query($sql,$db); prnMsg( $OldTaxCategoryName . ' ' . _('tax category and any tax rates set for it have been deleted'),'success'); } @@ -161,7 +164,7 @@ $ErrMsg = _('Could not get tax categories because'); $result = DB_query($sql,$db,$ErrMsg); - echo "<table> + echo "<table class=selection> <tr> <th>" . _('Tax Categories') . "</th> </tr>"; @@ -203,7 +206,7 @@ $sql = "SELECT taxcatid, taxcatname FROM taxcategories - WHERE taxcatid=" . $SelectedTaxCategory; + WHERE taxcatid='" . $SelectedTaxCategory . "'"; $result = DB_query($sql, $db); if ( DB_num_rows($result) == 0 ) { @@ -215,12 +218,12 @@ $_POST['TaxCategoryName'] = $myrow['taxcatname']; echo "<input type=hidden name='SelectedTaxCategory' VALUE='" . $myrow['taxcatid'] . "'>"; - echo "<table>"; + echo "<table class=selection>"; } } else { $_POST['TaxCategoryName']=''; - echo "<table>"; + echo "<table class=selection>"; } echo "<tr> <td>" . _('Tax Category Name') . ':' . "</td> @@ -228,7 +231,7 @@ </tr>"; echo '</table>'; - echo '<div class="centre"><input type=Submit name=submit value=' . _('Enter Information') . '></div>'; + echo '<br /><div class="centre"><input type=Submit name=submit value=' . _('Enter Information') . '></div>'; echo '</form>'; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-28 17:59:33 UTC (rev 3820) +++ trunk/doc/Change.log.html 2010-09-28 18:12:15 UTC (rev 3821) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>28/09/10 Tim: TaxCategories.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: TaxAuthorityRates.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: TaxAuthorities.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: Tax.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-28 18:26:21
|
Revision: 3822 http://web-erp.svn.sourceforge.net/web-erp/?rev=3822&view=rev Author: tim_schofield Date: 2010-09-28 18:26:15 +0000 (Tue, 28 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements Modified Paths: -------------- trunk/TaxGroups.php trunk/doc/Change.log.html Modified: trunk/TaxGroups.php =================================================================== --- trunk/TaxGroups.php 2010-09-28 18:12:15 UTC (rev 3821) +++ trunk/TaxGroups.php 2010-09-28 18:26:15 UTC (rev 3822) @@ -34,7 +34,7 @@ if (isset($_POST['GroupName']) ){ // Update or Add a tax group if(isset($SelectedGroup)) { // Update a tax group $sql = "UPDATE taxgroups SET taxgroupdescription = '". $_POST['GroupName'] ."' - WHERE taxgroupid = ".$SelectedGroup; + WHERE taxgroupid = '".$SelectedGroup . "'"; $ErrMsg = _('The update of the tax group description failed because'); $SuccessMsg = _('The tax group description was updated to') . ' ' . $_POST['GroupName']; } else { // Add new tax group @@ -57,16 +57,16 @@ $sql = "INSERT INTO taxgrouptaxes ( taxgroupid, taxauthid, calculationorder) - VALUES (" . $SelectedGroup . ", - " . $TaxAuthority . ", + VALUES ('" . $SelectedGroup . "', + '" . $TaxAuthority . "', 0)"; $ErrMsg = _('The addition of the tax failed because'); $SuccessMsg = _('The tax was added.'); } elseif ( isset($_GET['remove']) ) { // remove a taxauthority from a tax group $sql = "DELETE FROM taxgrouptaxes - WHERE taxgroupid = ".$SelectedGroup." - AND taxauthid = ".$TaxAuthority; + WHERE taxgroupid = '".$SelectedGroup."' + AND taxauthid = '".$TaxAuthority . "'"; $ErrMsg = _('The removal of this tax failed because'); $SuccessMsg = _('This tax was removed.'); } @@ -83,29 +83,29 @@ } } elseif (isset($_POST['UpdateOrder'])) { //A calculation order update - $sql = 'SELECT taxauthid FROM taxgrouptaxes WHERE taxgroupid=' . $SelectedGroup; + $sql = "SELECT taxauthid FROM taxgrouptaxes WHERE taxgroupid='" . $SelectedGroup . "'"; $Result = DB_query($sql,$db,_('Could not get tax authorities in the selected tax group')); while ($myrow=DB_fetch_row($Result)){ if (is_numeric($_POST['CalcOrder_' . $myrow[0]]) AND $_POST['CalcOrder_' . $myrow[0]] <5){ - $sql = 'UPDATE taxgrouptaxes - SET calculationorder=' . $_POST['CalcOrder_' . $myrow[0]] . ', - taxontax=' . $_POST['TaxOnTax_' . $myrow[0]] . ' - WHERE taxgroupid=' . $SelectedGroup . ' - AND taxauthid=' . $myrow[0]; + $sql = "UPDATE taxgrouptaxes + SET calculationorder='" . $_POST['CalcOrder_' . $myrow[0]] . "', + taxontax='" . $_POST['TaxOnTax_' . $myrow[0]] . "' + WHERE taxgroupid='" . $SelectedGroup . "' + AND taxauthid='" . $myrow[0] . "'"; $result = DB_query($sql,$db); } } //need to do a reality check to ensure that taxontax is relevant only for taxes after the first tax - $sql = 'SELECT taxauthid, + $sql = "SELECT taxauthid, taxontax FROM taxgrouptaxes - WHERE taxgroupid=' . $SelectedGroup . ' - ORDER BY calculationorder'; + WHERE taxgroupid='" . $SelectedGroup . "' + ORDER BY calculationorder"; $Result = DB_query($sql,$db,_('Could not get tax authorities in the selected tax group')); @@ -120,14 +120,14 @@ /* PREVENT DELETES IF DEPENDENT RECORDS IN 'custbranch, suppliers */ - $sql= "SELECT COUNT(*) FROM custbranch WHERE taxgroupid=" . $_GET['SelectedGroup']; + $sql= "SELECT COUNT(*) FROM custbranch WHERE taxgroupid='" . $_GET['SelectedGroup'] . "'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { prnMsg( _('Cannot delete this tax group because some customer branches are setup using it'),'warn'); echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('customer branches referring to this tax group'); } else { - $sql= "SELECT COUNT(*) FROM suppliers WHERE taxgroupid=" . $_GET['SelectedGroup']; + $sql= "SELECT COUNT(*) FROM suppliers WHERE taxgroupid='" . $_GET['SelectedGroup'] . "'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { @@ -135,9 +135,9 @@ echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('suppliers referring to this tax group'); } else { - $sql="DELETE FROM taxgrouptaxes WHERE taxgroupid=" . $_GET['SelectedGroup']; + $sql="DELETE FROM taxgrouptaxes WHERE taxgroupid='" . $_GET['SelectedGroup'] . "'"; $result = DB_query($sql,$db); - $sql="DELETE FROM taxgroups WHERE taxgroupid=" . $_GET['SelectedGroup']; + $sql="DELETE FROM taxgroups WHERE taxgroupid='" . $_GET['SelectedGroup'] . "'"; $result = DB_query($sql,$db); prnMsg( $_GET['GroupID'] . ' ' . _('tax group has been deleted') . '!','success'); } @@ -160,7 +160,7 @@ prnMsg(_('There are no tax groups configured.'),'info'); echo '</div>'; } else { - echo '<table border=1>'; + echo '<table class=selection>'; echo "<tr><th>" . _('Group No') . "</th> <th>" . _('Tax Group') . "</th></tr>"; @@ -203,7 +203,7 @@ $sql = "SELECT taxgroupid, taxgroupdescription FROM taxgroups - WHERE taxgroupid=" . $SelectedGroup; + WHERE taxgroupid='" . $SelectedGroup . "'"; $result = DB_query($sql, $db); if ( DB_num_rows($result) == 0 ) { prnMsg( _('The selected tax group is no longer available.'),'warn'); @@ -218,7 +218,7 @@ if( isset($_POST['SelectedGroup'])) { echo "<input type=hidden name='SelectedGroup' value='" . $_POST['SelectedGroup'] . "'>"; } -echo '<table>'; +echo '<table class=selection>'; if (!isset($_POST['GroupName'])) { $_POST['GroupName']=''; @@ -242,8 +242,8 @@ taxontax FROM taxgrouptaxes INNER JOIN taxauthorities ON taxgrouptaxes.taxauthid=taxauthorities.taxid - WHERE taxgroupid=". $SelectedGroup . ' - ORDER BY calculationorder'; + WHERE taxgroupid='". $SelectedGroup . "' + ORDER BY calculationorder"; $Result = DB_query($sql, $db); @@ -260,10 +260,10 @@ /* the order and tax on tax will only be an issue if more than one tax authority in the group */ if (count($TaxAuthsUsed)>0) { - echo '<div class="centre"><font size=3 color=blue>'._('Calculation Order').'</font></div>'; echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?' . SID .'">'; echo '<input type=hidden name="SelectedGroup" value="' . $SelectedGroup .'">'; - echo '<table>'; + echo '<table class=selection>'; + echo '<tr><th colspan=3><font size=3 color=navy>'._('Calculation Order').'</font></th></tr>'; echo '<tr><th>'._('Tax Authority').'</th> <th>'._('Order').'</th> @@ -304,7 +304,7 @@ if (DB_num_rows($Result)>0 ) { echo '<br>'; - echo '<table><tr>'; + echo '<table class=selection><tr>'; echo "<th colspan=4>"._('Assigned Taxes')."</th>"; echo '<th></th>'; echo "<th colspan=2>"._('Available Taxes')."</th>"; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-28 18:12:15 UTC (rev 3821) +++ trunk/doc/Change.log.html 2010-09-28 18:26:15 UTC (rev 3822) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>28/09/10 Tim: TaxGroups.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: TaxCategories.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: TaxAuthorityRates.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: TaxAuthorities.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-28 18:37:48
|
Revision: 3823 http://web-erp.svn.sourceforge.net/web-erp/?rev=3823&view=rev Author: tim_schofield Date: 2010-09-28 18:37:42 +0000 (Tue, 28 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements Modified Paths: -------------- trunk/TaxProvinces.php trunk/doc/Change.log.html Modified: trunk/TaxProvinces.php =================================================================== --- trunk/TaxProvinces.php 2010-09-28 18:26:15 UTC (rev 3822) +++ trunk/TaxProvinces.php 2010-09-28 18:37:42 UTC (rev 3823) @@ -9,6 +9,8 @@ include('includes/header.inc'); +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="">' . ' ' . $title.'</p>'; + if ( isset($_GET['SelectedTaxProvince']) ) $SelectedTaxProvince = $_GET['SelectedTaxProvince']; elseif (isset($_POST['SelectedTaxProvince'])) @@ -39,7 +41,7 @@ /*SelectedTaxProvince could also exist if submit had not been clicked this code would not run in this case cos submit is false of course see the delete code below*/ // Check the name does not clash $sql = "SELECT count(*) FROM taxprovinces - WHERE taxprovinceid <> " . $SelectedTaxProvince ." + WHERE taxprovinceid <> '" . $SelectedTaxProvince ."' AND taxprovincename " . LIKE . " '" . $_POST['TaxProvinceName'] . "'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); @@ -48,8 +50,8 @@ prnMsg( _('The tax province cannot be renamed because another with the same name already exists.'),'error'); } else { // Get the old name and check that the record still exists - $sql = "SELECT taxprovincename FROM taxprovinces - WHERE taxprovinceid = " . $SelectedTaxProvince; + $sql = "SELECT taxprovincename FROM taxprovinces + WHERE taxprovinceid = '" . $SelectedTaxProvince . "'"; $result = DB_query($sql,$db); if ( DB_num_rows($result) != 0 ) { // This is probably the safest way there is @@ -70,7 +72,7 @@ } } elseif ($InputError !=1) { /*SelectedTaxProvince is null cos no item selected on first time round so must be adding a record*/ - $sql = "SELECT count(*) FROM taxprovinces + $sql = "SELECT count(*) FROM taxprovinces WHERE taxprovincename " .LIKE. " '".$_POST['TaxProvinceName'] ."'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); @@ -85,15 +87,15 @@ )"; $ErrMsg = _('Could not add tax province'); $result = DB_query($sql,$db, $ErrMsg); - + $TaxProvinceID = DB_Last_Insert_ID($db, 'taxprovinces', 'taxprovinceid'); - $sql = 'INSERT INTO taxauthrates (taxauthority, dispatchtaxprovince, taxcatid) - SELECT taxauthorities.taxid, ' . $TaxProvinceID . ', taxcategories.taxcatid - FROM taxauthorities CROSS JOIN taxcategories'; + $sql = "INSERT INTO taxauthrates (taxauthority, dispatchtaxprovince, taxcatid) + SELECT taxauthorities.taxid, '" . $TaxProvinceID . "', taxcategories.taxcatid + FROM taxauthorities CROSS JOIN taxcategories"; $ErrMsg = _('Could not add tax authority rates for the new dispatch tax province. The rates of tax will not be able to be added - manual database interaction will be required to use this dispatch tax province'); $result = DB_query($sql,$db, $ErrMsg); } - + if (!$result){ prnMsg(_('Errors were encountered adding this tax province'),'error'); } else { @@ -108,8 +110,8 @@ //the link to delete a selected record was clicked instead of the submit button // PREVENT DELETES IF DEPENDENT RECORDS IN 'stockmaster' // Get the original name of the tax province the ID is just a secure way to find the tax province - $sql = "SELECT taxprovincename FROM taxprovinces - WHERE taxprovinceid = " . $SelectedTaxProvince; + $sql = "SELECT taxprovincename FROM taxprovinces + WHERE taxprovinceid = '" . $SelectedTaxProvince . "'"; $result = DB_query($sql,$db); if ( DB_num_rows($result) == 0 ) { // This is probably the safest way there is @@ -117,20 +119,20 @@ } else { $myrow = DB_fetch_row($result); $OldTaxProvinceName = $myrow[0]; - $sql= "SELECT COUNT(*) FROM locations WHERE taxprovinceid = " . $SelectedTaxProvince; + $sql= "SELECT COUNT(*) FROM locations WHERE taxprovinceid = '" . $SelectedTaxProvince . "'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { prnMsg( _('Cannot delete this tax province because at least one stock location is defined to be inside this province'),'warn'); echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('stock locations that refer to this tax province') . '</font>'; } else { - $sql = 'DELETE FROM taxauthrates WHERE dispatchtaxprovince = ' . $SelectedTaxProvince; + $sql = "DELETE FROM taxauthrates WHERE dispatchtaxprovince = '" . $SelectedTaxProvince . "'"; $result = DB_query($sql,$db); - $sql = 'DELETE FROM taxprovinces WHERE taxprovinceid = ' .$SelectedTaxProvince;; + $sql = "DELETE FROM taxprovinces WHERE taxprovinceid = '" .$SelectedTaxProvince . "'"; $result = DB_query($sql,$db); prnMsg( $OldTaxProvinceName . ' ' . _('tax province and any tax rates set for it have been deleted'),'success'); } - } //end if + } //end if unset ($SelectedTaxProvince); unset ($_GET['SelectedTaxProvince']); unset($_GET['delete']); @@ -140,7 +142,7 @@ if (!isset($SelectedTaxProvince)) { -/* An tax province could be posted when one has been edited and is being updated +/* An tax province could be posted when one has been edited and is being updated or GOT when selected for modification SelectedTaxProvince will exist because it was sent with the page in a GET . If its the first time the page has been displayed with no parameters @@ -156,7 +158,7 @@ $ErrMsg = _('Could not get tax categories because'); $result = DB_query($sql,$db,$ErrMsg); - echo "<table> + echo "<table class=selection> <tr> <th>" . _('Tax Provinces') . "</th> </tr>"; @@ -198,7 +200,7 @@ $sql = "SELECT taxprovinceid, taxprovincename FROM taxprovinces - WHERE taxprovinceid=" . $SelectedTaxProvince; + WHERE taxprovinceid='" . $SelectedTaxProvince . "'"; $result = DB_query($sql, $db); if ( DB_num_rows($result) == 0 ) { @@ -210,12 +212,12 @@ $_POST['TaxProvinceName'] = $myrow['taxprovincename']; echo "<input type=hidden name='SelectedTaxProvince' VALUE='" . $myrow['taxprovinceid'] . "'>"; - echo "<table>"; + echo "<table class=selection>"; } } else { $_POST['TaxProvinceName']=''; - echo "<table>"; + echo "<table class=selection>"; } echo "<tr> <td>" . _('Tax Province Name') . ':' . "</td> @@ -223,7 +225,7 @@ </tr>"; echo '</table>'; - echo '<div class="centre"><input type=Submit name=submit value=' . _('Enter Information') . '></div>'; + echo '<br /><div class="centre"><input type=Submit name=submit value=' . _('Enter Information') . '></div>'; echo '</form>'; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-28 18:26:15 UTC (rev 3822) +++ trunk/doc/Change.log.html 2010-09-28 18:37:42 UTC (rev 3823) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>28/09/10 Tim: TaxProvinces.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: TaxGroups.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: TaxCategories.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: TaxAuthorityRates.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-28 19:00:42
|
Revision: 3824 http://web-erp.svn.sourceforge.net/web-erp/?rev=3824&view=rev Author: tim_schofield Date: 2010-09-28 19:00:36 +0000 (Tue, 28 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements Modified Paths: -------------- trunk/TopItems.php trunk/doc/Change.log.html Modified: trunk/TopItems.php =================================================================== --- trunk/TopItems.php 2010-09-28 18:37:42 UTC (rev 3823) +++ trunk/TopItems.php 2010-09-28 19:00:36 UTC (rev 3824) @@ -10,7 +10,7 @@ if (!(isset($_POST['Location']) and isset($_POST['NumberOfDays']) and isset($_POST['Customers']) and isset($_POST['NumberOfTopItems']) and isset($_POST['order']))) { echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Top Sales Order Search') . '" alt="">' . ' ' . _('Top Sales Order Search') . '</p>'; echo "<form action=" . $_SERVER['PHP_SELF'] . '?' . SID . ' name="SelectCustomer" method=POST>'; - echo '<table cellpadding=3 colspan=4>'; + echo '<table cellpadding=3 colspan=4 class=selection>'; //to view store location echo '<tr><td width="150">' . _('Select Location') . ' </td><td>:</td><td><select name=Location>'; $sql = 'SELECT loccode, @@ -54,9 +54,9 @@ <tr> <td></td> <td></td> - <td><input tabindex=5 type=submit Value="' . _('Search') . '"></td> </tr> - </form>'; + </form></table>'; + echo '<br /><div class=centre><input tabindex=5 type=submit value="' . _('Search') . '"></div>'; } else { // everything below here to view NumberOfTopItems items sale on selected location //the situation if the location and customer type selected "All" @@ -149,7 +149,7 @@ } $result = DB_query($SQL, $db); echo '<p class="page_title_text" align="center"><strong>' . _('Top Sales Items List') . '</strong></p>'; - echo "<form action=PDFTopItems.php method='GET'> <table class='table1'>"; + echo "<form action=PDFTopItems.php method='GET'><table class='selection'>"; $TableHeader = '<tr><th><strong>' . _('#') . '</strong></th> <th><strong>' . _('Code') . '</strong></th> <th><strong>' . _('Description') . '</strong></th> @@ -197,7 +197,7 @@ } echo '</table>'; // echo '<td style="text-align:center" colspan=6><a href="javascript:history.go(-1)" title="Return to previous page"><input type=Button Name="Back" Value="' . _('Back') . '"></a></font>   '; - echo '<div class="centre"><input type=Submit Name="PrintPDF" Value="' . _('Print To PDF') . '"></div>'; + echo '<br /><div class="centre"><input type=Submit Name="PrintPDF" Value="' . _('Print To PDF') . '"></div>'; echo '</form>'; //end of the else statement Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-28 18:37:42 UTC (rev 3823) +++ trunk/doc/Change.log.html 2010-09-28 19:00:36 UTC (rev 3824) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>28/09/10 Tim: TopItems.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: TaxProvinces.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: TaxGroups.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: TaxCategories.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-28 19:13:33
|
Revision: 3825 http://web-erp.svn.sourceforge.net/web-erp/?rev=3825&view=rev Author: tim_schofield Date: 2010-09-28 19:13:27 +0000 (Tue, 28 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements Modified Paths: -------------- trunk/UnitsOfMeasure.php trunk/doc/Change.log.html Modified: trunk/UnitsOfMeasure.php =================================================================== --- trunk/UnitsOfMeasure.php 2010-09-28 19:00:36 UTC (rev 3824) +++ trunk/UnitsOfMeasure.php 2010-09-28 19:13:27 UTC (rev 3825) @@ -8,6 +8,8 @@ $title = _('Units Of Measure'); include('includes/header.inc'); +echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . + _('Top Sales Order Search') . '" alt="">' . ' ' . $title . '</p>'; if ( isset($_GET['SelectedMeasureID']) ) $SelectedMeasureID = $_GET['SelectedMeasureID']; @@ -39,7 +41,7 @@ /*SelectedMeasureID could also exist if submit had not been clicked this code would not run in this case cos submit is false of course see the delete code below*/ // Check the name does not clash $sql = "SELECT count(*) FROM unitsofmeasure - WHERE unitid <> " . $SelectedMeasureID ." + WHERE unitid <> '" . $SelectedMeasureID ."' AND unitname ".LIKE." '" . $_POST['MeasureName'] . "'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); @@ -51,7 +53,7 @@ // idealy this is one of those sets that should be in a stored procedure simce even the checks are // relavant $sql = "SELECT unitname FROM unitsofmeasure - WHERE unitid = " . $SelectedMeasureID; + WHERE unitid = '" . $SelectedMeasureID . "'"; $result = DB_query($sql,$db); if ( DB_num_rows($result) != 0 ) { // This is probably the safest way there is @@ -124,7 +126,7 @@ // PREVENT DELETES IF DEPENDENT RECORDS IN 'stockmaster' // Get the original name of the unit of measure the ID is just a secure way to find the unit of measure $sql = "SELECT unitname FROM unitsofmeasure - WHERE unitid = " . $SelectedMeasureID; + WHERE unitid = '" . $SelectedMeasureID . "'"; $result = DB_query($sql,$db); if ( DB_num_rows($result) == 0 ) { // This is probably the safest way there is @@ -179,7 +181,7 @@ $ErrMsg = _('Could not get unit of measures because'); $result = DB_query($sql,$db,$ErrMsg); - echo "<table> + echo "<table class=selection> <tr> <th>" . _('Units of Measure') . "</th> </tr>"; @@ -221,7 +223,7 @@ $sql = "SELECT unitid, unitname FROM unitsofmeasure - WHERE unitid=" . $SelectedMeasureID; + WHERE unitid='" . $SelectedMeasureID . "'"; $result = DB_query($sql, $db); if ( DB_num_rows($result) == 0 ) { Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-28 19:00:36 UTC (rev 3824) +++ trunk/doc/Change.log.html 2010-09-28 19:13:27 UTC (rev 3825) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>28/09/10 Tim: UnitsOfMeasure.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: TopItems.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: TaxProvinces.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: TaxGroups.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-28 19:24:19
|
Revision: 3826 http://web-erp.svn.sourceforge.net/web-erp/?rev=3826&view=rev Author: tim_schofield Date: 2010-09-28 19:24:12 +0000 (Tue, 28 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements Modified Paths: -------------- trunk/UserSettings.php trunk/doc/Change.log.html Modified: trunk/UserSettings.php =================================================================== --- trunk/UserSettings.php 2010-09-28 19:13:27 UTC (rev 3825) +++ trunk/UserSettings.php 2010-09-28 19:24:12 UTC (rev 3826) @@ -8,7 +8,8 @@ $title = _('User Settings'); include('includes/header.inc'); -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/user.png" title="' . _('User Settings') . '" alt="">' . ' ' . _('User Settings'); +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/user.png" title="' . + _('User Settings') . '" alt="">' . ' ' . _('User Settings') . '</p>'; $PDFLanguages = array(_('Latin Western Languages'), _('Eastern European Russian Japanese'), @@ -62,11 +63,11 @@ // no errors if ($update_pw != 'Y'){ $sql = "UPDATE www_users - SET displayrecordsmax=" . $_POST['DisplayRecordsMax'] . ", + SET displayrecordsmax='" . $_POST['DisplayRecordsMax'] . "', theme='" . $_POST['Theme'] . "', language='" . $_POST['Language'] . "', email='". $_POST['email'] ."', - pdflanguage=" . $_POST['PDFLanguage'] . " + pdflanguage='" . $_POST['PDFLanguage'] . "' WHERE userid = '" . $_SESSION['UserID'] . "'"; $ErrMsg = _('The user alterations could not be processed because'); @@ -77,11 +78,11 @@ prnMsg( _('The user settings have been updated') . '. ' . _('Be sure to remember your password for the next time you login'),'success'); } else { $sql = "UPDATE www_users - SET displayrecordsmax=" . $_POST['DisplayRecordsMax'] . ", + SET displayrecordsmax='" . $_POST['DisplayRecordsMax'] . "', theme='" . $_POST['Theme'] . "', language='" . $_POST['Language'] . "', email='". $_POST['email'] ."', - pdflanguage=" . $_POST['PDFLanguage'] . ", + pdflanguage='" . $_POST['PDFLanguage'] . "', password='" . CryptPass($_POST['pass']) . "' WHERE userid = '" . $_SESSION['UserID'] . "'"; @@ -111,7 +112,7 @@ } -echo '<table><tr><td>' . _('User ID') . ':</td><td>'; +echo '<table class=selection><tr><td>' . _('User ID') . ':</td><td>'; echo $_SESSION['UserID'] . '</td></tr>'; echo '<tr><td>' . _('User Name') . ':</td><td>'; @@ -205,7 +206,7 @@ } } echo "</select></td></tr></table> - <br><div class='centre'><input type='Submit' name='Modify' value=" . _('Modify') . '></div> + <br /><div class='centre'><input type='Submit' name='Modify' value=" . _('Modify') . '></div> </form>'; include('includes/footer.inc'); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-28 19:13:27 UTC (rev 3825) +++ trunk/doc/Change.log.html 2010-09-28 19:24:12 UTC (rev 3826) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>28/09/10 Tim: UserSettings.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: UnitsOfMeasure.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: TopItems.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: TaxProvinces.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-28 19:32:51
|
Revision: 3827 http://web-erp.svn.sourceforge.net/web-erp/?rev=3827&view=rev Author: tim_schofield Date: 2010-09-28 19:32:44 +0000 (Tue, 28 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements Modified Paths: -------------- trunk/WhereUsedInquiry.php trunk/doc/Change.log.html Modified: trunk/WhereUsedInquiry.php =================================================================== --- trunk/WhereUsedInquiry.php 2010-09-28 19:24:12 UTC (rev 3826) +++ trunk/WhereUsedInquiry.php 2010-09-28 19:32:44 UTC (rev 3827) @@ -17,18 +17,18 @@ echo "<a href='" . $rootpath . '/SelectProduct.php?' . SID . "'>" . _('Back to Items') . '</a><br>'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="">' . ' ' . $title; if (isset($StockID)){ - $result = DB_query("SELECT description, - units, - mbflag - FROM stockmaster - WHERE stockid='$StockID'",$db); + $result = DB_query("SELECT description, + units, + mbflag + FROM stockmaster + WHERE stockid='".$StockID."'",$db); $myrow = DB_fetch_row($result); if (DB_num_rows($result)==0){ prnMsg(_('The item code entered') . ' - ' . $StockID . ' ' . _('is not set up as an item in the system') . '. ' . _('Re-enter a valid item code or select from the Select Item link above'),'error'); include('includes/footer.inc'); exit; } - echo "<br><br><font color=BLUE size=3><b>$StockID - $myrow[0] </b> (" . _('in units of') . ' ' . $myrow[1] . ')</font>'; + echo "<br /><font color=navy size=3><b>$StockID - $myrow[0] </b> (" . _('in units of') . ' ' . $myrow[1] . ')</font>'; } echo "<form action='" . $_SERVER['PHP_SELF'] . '?'. SID ."' method=post><div class='centre'>"; @@ -36,12 +36,12 @@ if (isset($StockID)) { echo _('Enter an Item Code') . ": <input type=text name='StockID' size=21 maxlength=20 value='$StockID' >"; } else { - echo _('Enter an Item Code') . ": <input type=text name='StockID' size=21 maxlength=20>"; + echo _('Enter an Item Code') . ": <input type=text name='StockID' size=21 maxlength=20>"; } -echo "<input type=submit name='ShowWhereUsed' VALUE='" . _('Show Where Used') . "'>"; +echo "<input type=submit name='ShowWhereUsed' value='" . _('Show Where Used') . "'>"; -echo '</div><hr>'; +echo '</div><br />'; if (isset($StockID)) { @@ -56,10 +56,10 @@ $ErrMsg = _('The parents for the selected part could not be retrieved because');; $result = DB_query($SQL,$db,$ErrMsg); if (DB_num_rows($result)==0){ - prnMsg(_('The selected item') . ' ' . $StockID . ' ' . _('is not used as a component of any other parts'),'error');; + prnMsg(_('The selected item') . ' ' . $StockID . ' ' . _('is not used as a component of any other parts'),'error'); } else { - echo '<table WIDTH=100%>'; + echo '<table width=97% class=selection>'; $tableheader = "<tr><th>" . _('Used By') . "</th> <th>" . _('Work Centre') . "</th> Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-28 19:24:12 UTC (rev 3826) +++ trunk/doc/Change.log.html 2010-09-28 19:32:44 UTC (rev 3827) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>28/09/10 Tim: WhereUsedInquiry.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: UserSettings.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: UnitsOfMeasure.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: TopItems.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-28 20:24:00
|
Revision: 3828 http://web-erp.svn.sourceforge.net/web-erp/?rev=3828&view=rev Author: tim_schofield Date: 2010-09-28 20:23:53 +0000 (Tue, 28 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements Modified Paths: -------------- trunk/WorkCentres.php trunk/doc/Change.log.html Modified: trunk/WorkCentres.php =================================================================== --- trunk/WorkCentres.php 2010-09-28 19:32:44 UTC (rev 3827) +++ trunk/WorkCentres.php 2010-09-28 20:23:53 UTC (rev 3828) @@ -44,8 +44,8 @@ $sql = "UPDATE workcentres SET location = '" . $_POST['Location'] . "', description = '" . $_POST['Description'] . "', - overheadrecoveryact =" . $_POST['OverheadRecoveryAct'] . ", - overheadperhour = " . $_POST['OverheadPerHour'] . " + overheadrecoveryact ='" . $_POST['OverheadRecoveryAct'] . "', + overheadperhour = '" . $_POST['OverheadPerHour'] . "' WHERE code = '" . $SelectedWC . "'"; $msg = _('The work centre record has been updated'); } elseif ($InputError !=1) { @@ -60,8 +60,8 @@ VALUES ('" . $_POST['Code'] . "', '" . $_POST['Location'] . "', '" . $_POST['Description'] . "', - " . $_POST['OverheadRecoveryAct'] . ", - " . $_POST['OverheadPerHour'] . " + '" . $_POST['OverheadRecoveryAct'] . "', + '" . $_POST['OverheadPerHour'] . "' )"; $msg = _('The new work centre has been added to the database'); } @@ -83,19 +83,19 @@ // PREVENT DELETES IF DEPENDENT RECORDS IN 'BOM' - $sql= "SELECT COUNT(*) FROM bom WHERE bom.workcentreadded='$SelectedWC'"; + $sql= "SELECT COUNT(*) FROM bom WHERE bom.workcentreadded='" . $SelectedWC . "'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { prnMsg(_('Cannot delete this work centre because bills of material have been created requiring components to be added at this work center') . '<br>' . _('There are') . ' ' . $myrow[0] . ' ' ._('BOM items referring to this work centre code'),'warn'); } else { - $sql= "SELECT COUNT(*) FROM contractbom WHERE contractbom.workcentreadded='$SelectedWC'"; + $sql= "SELECT COUNT(*) FROM contractbom WHERE contractbom.workcentreadded='" . $SelectedWC . "'"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { prnMsg(_('Cannot delete this work centre because contract bills of material have been created having components added at this work center') . '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('Contract BOM items referring to this work centre code'),'warn'); } else { - $sql="DELETE FROM workcentres WHERE code='$SelectedWC'"; + $sql="DELETE FROM workcentres WHERE code='" . $SelectedWC . "'"; $result = DB_query($sql,$db); prnMsg(_('The selected work centre record has been deleted'),'succes'); } // end of Contract BOM test @@ -120,8 +120,8 @@ WHERE workcentres.location = locations.loccode'; $result = DB_query($sql,$db); - echo "<table border=1> - <tr BGCOLOR =#800000><th>" . _('WC Code') . "</th> + echo "<table class=selection> + <tr bgcolor =#800000><th>" . _('WC Code') . "</th> <th>" . _('Description') . "</th> <th>" . _('Location') . "</th> <th>" . _('Overhead GL Account') . "</th> @@ -170,7 +170,7 @@ overheadrecoveryact, overheadperhour FROM workcentres - WHERE code='$SelectedWC'"; + WHERE code='" . $SelectedWC . "'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); @@ -183,13 +183,13 @@ echo '<input type=hidden name="SelectedWC" value=' . $SelectedWC . '>'; echo '<input type=hidden name="Code" value="' . $_POST['Code'] . '">'; - echo '<table><tr><td>' ._('Work Centre Code') . ':</td><td>' . $_POST['Code'] . '</td></tr>'; + echo '<table class=selection><tr><td>' ._('Work Centre Code') . ':</td><td>' . $_POST['Code'] . '</td></tr>'; } else { //end of if $SelectedWC only do the else when a new record is being entered if (!isset($_POST['Code'])) { $_POST['Code'] = ''; } - echo '<table><tr> + echo '<table class=selection><tr> <td>' . _('Work Centre Code') . ":</td> <td><input type='Text' name='Code' size=6 maxlength=5 value='" . $_POST['Code'] . "'></td> </tr>"; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-28 19:32:44 UTC (rev 3827) +++ trunk/doc/Change.log.html 2010-09-28 20:23:53 UTC (rev 3828) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>28/09/10 Tim: WorkCentres.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: WhereUsedInquiry.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: UserSettings.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: UnitsOfMeasure.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-28 20:24:19
|
Revision: 3829 http://web-erp.svn.sourceforge.net/web-erp/?rev=3829&view=rev Author: tim_schofield Date: 2010-09-28 20:24:12 +0000 (Tue, 28 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements Modified Paths: -------------- trunk/WorkOrderCosting.php trunk/doc/Change.log.html Modified: trunk/WorkOrderCosting.php =================================================================== --- trunk/WorkOrderCosting.php 2010-09-28 20:23:53 UTC (rev 3828) +++ trunk/WorkOrderCosting.php 2010-09-28 20:24:12 UTC (rev 3829) @@ -10,6 +10,9 @@ echo '<a href="'. $rootpath . '/SelectWorkOrder.php?' . SID . '">' . _('Back to Work Orders'). '</a><br>'; +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . + _('Search') . '" alt="">' . ' ' . $title . '</p>'; + echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; if (!isset($_REQUEST['WO'])) { @@ -34,7 +37,7 @@ workorders.closed FROM workorders INNER JOIN locations ON workorders.loccode=locations.loccode - WHERE workorders.wo=" . $_POST['WO'], + WHERE workorders.wo='" . $_POST['WO'] . "'", $db, $ErrMsg); @@ -46,14 +49,14 @@ $WorkOrderRow = DB_fetch_array($WOResult); -echo '<table cellpadding=2 border=0> +echo '<table cellpadding=2 class=selection> <tr><td class="label">' . _('Work order') . ':</td> <td>' . $_POST['WO'] .'</td> <td class="label">' . _('Manufactured at') . ':</td> <td>' . $WorkOrderRow['locationname'] . '</td> <td class="label">' . _('Required By') . ':</td> <td>' . ConvertSQLDate($WorkOrderRow['requiredby']) . '</td></tr> - </table>'; + </table><br />'; $WOItemsResult = DB_query("SELECT woitems.stockid, @@ -72,11 +75,11 @@ ON woitems.stockid=stockmaster.stockid INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - WHERE woitems.wo=". $_POST['WO'], + WHERE woitems.wo='". $_POST['WO'] . "'", $db, $ErrMsg); -echo '<table><tr><th>' . _('Item') . '</th> +echo '<table class=selection><tr><th>' . _('Item') . '</th> <th>' . _('Description') . '</th> <th>' . _('Quantity Required') . '</th> <th>' . _('Units') . '</th> @@ -102,8 +105,8 @@ } echo '</table> - <hr> - <table>'; + <br /> + <table class=selection>'; echo '<tr><th>' . _('Item') . '</th> @@ -117,7 +120,7 @@ <th>' . _('Cost Variance') . '</th> </tr>'; -$RequirementsResult = DB_query('SELECT worequirements.stockid, +$RequirementsResult = DB_query("SELECT worequirements.stockid, stockmaster.description, stockmaster.decimalplaces, worequirements.stdcost, @@ -127,11 +130,11 @@ FROM worequirements INNER JOIN stockmaster ON worequirements.stockid=stockmaster.stockid INNER JOIN woitems ON woitems.stockid=worequirements.parentstockid AND woitems.wo=worequirements.wo - WHERE worequirements.wo=' . $_POST['WO'] . ' + WHERE worequirements.wo='" . $_POST['WO'] . "' GROUP BY worequirements.stockid, stockmaster.description, stockmaster.decimalplaces, - worequirements.stdcost', $db); + worequirements.stdcost", $db); $k=0; $TotalUsageVar =0; @@ -229,11 +232,11 @@ FROM stockmoves INNER JOIN stockmaster ON stockmoves.stockid=stockmaster.stockid WHERE stockmoves.type=28 - AND reference = " . $_POST['WO'] . " + AND reference = '" . $_POST['WO'] . "' AND stockmoves.stockid NOT IN (SELECT worequirements.stockid FROM worequirements - WHERE worequirements.wo=" . $_POST['WO'] . ")"; + WHERE worequirements.wo='" . $_POST['WO'] . "')"; $WOIssuesResult = DB_query($sql,$db,_('Could not get issues that were not required by the BOM because')); @@ -323,13 +326,13 @@ narrative, amount) VALUES (29, - " . $WOCloseNo . ", + '" . $WOCloseNo . "', '" . Date('Y-m-d') . "', - " . $PeriodNo . ", - " . $WORow['materialuseagevarac'] . ", + '" . $PeriodNo . "', + '" . $WORow['materialuseagevarac'] . "', '" . $_POST['WO'] . ' - ' . $WORow['stockid'] . ' ' . _('share of variance') . "', - " . (-$TotalVariance*$ShareProportion*(1-$ProportionOnHand)) . ")"; - + '" . (-$TotalVariance*$ShareProportion*(1-$ProportionOnHand)) . "')"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GL posting for the work order variance could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); @@ -344,12 +347,12 @@ narrative, amount) VALUES (29, - " . $WOCloseNo . ", + '" . $WOCloseNo . "', '" . Date('Y-m-d') . "', - " . $PeriodNo . ", - " . $WORow['stockact'] . ", + '" . $PeriodNo . "', + '" . $WORow['stockact'] . "', '" . $_POST['WO'] . ' - ' . $WORow['stockid'] . ' ' . _('share of variance') . "', - " . (-$TotalVariance*$ShareProportion*$ProportionOnHand) . ")"; + '" . (-$TotalVariance*$ShareProportion*$ProportionOnHand) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GL posting for the work order variance could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); @@ -363,12 +366,12 @@ narrative, amount) VALUES (29, - " . $WOCloseNo . ", + '" . $WOCloseNo . "', '" . Date('Y-m-d') . "', - " . $PeriodNo . ", - " . $WORow['wipact'] . ", + '" . $PeriodNo . "', + '" . $WORow['wipact'] . "', '" . $_POST['WO'] . ' - ' . $WORow['stockid'] . ' ' . _('share of variance') . "', - " . ($TotalVariance*$ShareProportion) . ")"; + '" . ($TotalVariance*$ShareProportion) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GL posting for the WIP side of the work order variance posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); @@ -379,10 +382,10 @@ $NewCost = $WORow['currcost'] +(-$TotalVariance * $ShareProportion *$ProportionOnHand)/$TotalOnHand; $SQL = "UPDATE stockmaster SET - materialcost=" . $NewCost . ", + materialcost='" . $NewCost . "', labourcost=0, overheadcost=0, - lastcost=" . $WORow['currcost'] . " + lastcost='" . $WORow['currcost'] . "' WHERE stockid='" . $_POST['StockID'] . "'"; $ErrMsg = _('The cost details for the stock item could not be updated because'); @@ -400,12 +403,12 @@ narrative, amount) VALUES (29, - " . $WOCloseNo . ", + '" . $WOCloseNo . "', '" . Date('Y-m-d') . "', - " . $PeriodNo . ", - " . $WORow['materialuseagevarac'] . ", + '" . $PeriodNo . "', + '" . $WORow['materialuseagevarac'] . "', '" . $_POST['WO'] . ' - ' . $WORow['stockid'] . ' ' . _('share of usage variance') . "', - " . (-$TotalUsageVar*$ShareProportion) . ")"; + '" . (-$TotalUsageVar*$ShareProportion) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GL posting for the material usage variance could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); @@ -419,12 +422,12 @@ narrative, amount) VALUES (29, - " . $WOCloseNo . ", + '" . $WOCloseNo . "', '" . Date('Y-m-d') . "', - " . $PeriodNo . ", - " . $WORow['wipact'] . ", + '" . $PeriodNo . "', + '" . $WORow['wipact'] . "', '" . $_POST['WO'] . ' - ' . $WORow['stockid'] . ' ' . _('share of usage variance') . "', - " . ($TotalUsageVar*$ShareProportion) . ")"; + '" . ($TotalUsageVar*$ShareProportion) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GL posting for the WIP side of the usage variance posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); @@ -442,12 +445,12 @@ narrative, amount) VALUES (29, - " . $WOCloseNo . ", + '" . $WOCloseNo . "', '" . Date('Y-m-d') . "', - " . $PeriodNo . ", - " . $WORow['purchpricevaract'] . ", + '" . $PeriodNo . "', + '" . $WORow['purchpricevaract'] . "', '" . $_POST['WO'] . ' - ' . $WORow['stockid'] . ' ' . _('share of cost variance') . "', - " . (-$TotalCostVar*$ShareProportion) . ")"; + '" . (-$TotalCostVar*$ShareProportion) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GL posting for the cost variance could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); @@ -461,12 +464,12 @@ narrative, amount) VALUES (29, - " . $WOCloseNo . ", + '" . $WOCloseNo . "', '" . Date('Y-m-d') . "', - " . $PeriodNo . ", - " . $WORow['wipact'] . ", + '" . $PeriodNo . "', + '" . $WORow['wipact'] . "', '" . $_POST['WO'] . ' - ' . $WORow['stockid'] . ' ' . _('share of cost variance') . "', - " . ($TotalCostVar*$ShareProportion) . ")"; + '" . ($TotalCostVar*$ShareProportion) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GL posting for the WIP side of the cost variance posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); @@ -476,12 +479,12 @@ } //end of standard costing section } // end loop around the items on the work order - $CloseWOResult =DB_query('UPDATE workorders SET closed=1 WHERE wo=' .$_POST['WO'], + $CloseWOResult =DB_query("UPDATE workorders SET closed=1 WHERE wo='" .$_POST['WO'] . "'", $db, _('Could not update the work order to closed because:'), _('The SQL used to close the work order was:'), true); - $DeleteAnyWOSerialNos = DB_query('DELETE FROM woserialnos WHERE wo=' . $_POST['WO'], + $DeleteAnyWOSerialNos = DB_query("DELETE FROM woserialnos WHERE wo='" . $_POST['WO'] . "'", $db, _('Could not delete the predefined work order serial numbers'), _('The SQL used to delete the predefined serial numbers was:'), @@ -513,4 +516,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-28 20:23:53 UTC (rev 3828) +++ trunk/doc/Change.log.html 2010-09-28 20:24:12 UTC (rev 3829) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>28/09/10 Tim: WorkOrderCosting.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: WorkCentres.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: WhereUsedInquiry.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: UserSettings.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-29 10:19:57
|
Revision: 3830 http://web-erp.svn.sourceforge.net/web-erp/?rev=3830&view=rev Author: tim_schofield Date: 2010-09-29 10:19:50 +0000 (Wed, 29 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements Modified Paths: -------------- trunk/WorkOrderEntry.php trunk/doc/Change.log.html Modified: trunk/WorkOrderEntry.php =================================================================== --- trunk/WorkOrderEntry.php 2010-09-28 20:24:12 UTC (rev 3829) +++ trunk/WorkOrderEntry.php 2010-09-29 10:19:50 UTC (rev 3830) @@ -35,7 +35,7 @@ loccode, requiredby, startdate) - VALUES (" . $_POST['WO'] . ", + VALUES ('" . $_POST['WO'] . "', '" . $LocCode . "', '" . $ReqDate . "', '" . Date('Y-m-d'). "')"; @@ -199,7 +199,7 @@ $CheckItemResult = DB_query("SELECT stockid FROM woitems WHERE stockid='" . $NewItem . "' - AND wo=" .$_POST['WO'], + AND wo='" .$_POST['WO'] . "'", $db); if (DB_num_rows($CheckItemResult)==1){ prnMsg(_('This item is already on the work order and cannot be added again'),'warn'); @@ -232,11 +232,11 @@ stockid, qtyreqd, stdcost) - VALUES ( " . $_POST['WO'] . ", - '" . $NewItem . "', - " . $EOQ . ", - " . $Cost . " - )"; + VALUES ( '" . $_POST['WO'] . "', + '" . $NewItem . "', + '" . $EOQ . "', + '" . $Cost . "' + )"; $ErrMsg = _('The work order item could not be added'); $result = DB_query($sql,$db,$ErrMsg); @@ -252,9 +252,9 @@ if (isset($_POST['submit'])) { //The update button has been clicked - echo '<a href="' . $_SERVER['PHP_SELF'] . '?' . SID . "'>" . _('Enter a new work order') . '</a>'; + echo '<div class=centre><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . "'>" . _('Enter a new work order') . '</a>'; echo '<br><a href="' . $rootpath . '/SelectWorkOrder.php?' . SID . '">' . _('Select an existing work order') . '</a>'; - echo '<br><a href="'. $rootpath . '/WorkOrderCosting.php?' . SID . '&WO=' . $_REQUEST['WO'] . '">' . _('Go to Costing'). '</a>'; + echo '<br><a href="'. $rootpath . '/WorkOrderCosting.php?' . SID . '&WO=' . $_REQUEST['WO'] . '">' . _('Go to Costing'). '</a></div>'; $Input_Error = false; //hope for the best for ($i=1;$i<=$_POST['NumberOfOutputs'];$i++){ @@ -284,11 +284,11 @@ if ($QtyRecd==0){ //can only change factory location if Qty Recd is 0 $sql[] = "UPDATE workorders SET requiredby='" . $SQL_ReqDate . "', loccode='" . $_POST['StockLocation'] . "' - WHERE wo=" . $_POST['WO']; + WHERE wo='" . $_POST['WO'] . "'"; } else { prnMsg(_('The factory where this work order is made can only be updated if the quantity received on all output items is 0'),'warn'); $sql[] = "UPDATE workorders SET requiredby='" . $SQL_ReqDate . "' - WHERE wo=" . $_POST['WO']; + WHERE wo='" . $_POST['WO'] . "'"; } for ($i=1;$i<=$_POST['NumberOfOutputs'];$i++){ @@ -298,7 +298,7 @@ if (isset($_POST['QtyRecd'.$i]) and $_POST['QtyRecd'.$i]>$_POST['OutputQty'.$i]){ $_POST['OutputQty'.$i]=$_POST['QtyRecd'.$i]; //OutputQty must be >= Qty already reced } - if ($_POST['RecdQty'.$i]==0 AND $_POST['HasWOSerialNos'.$i]==false){ + if ($_POST['RecdQty'.$i]==0 AND (isset($_POST['HasWOSerialNos'.$i]) and $_POST['HasWOSerialNos'.$i]==false)){ /* can only change location cost if QtyRecd=0 */ $CostResult = DB_query("SELECT SUM((materialcost+labourcost+overheadcost)*bom.quantity) AS cost FROM stockmaster INNER JOIN bom @@ -313,15 +313,15 @@ } else { $Cost = $CostRow[0]; } - $sql[] = "UPDATE woitems SET qtyreqd = ". $_POST['OutputQty' . $i] . ", + $sql[] = "UPDATE woitems SET qtyreqd = '". $_POST['OutputQty' . $i] . "', nextlotsnref = '". $_POST['NextLotSNRef'.$i] ."', - stdcost =" . $Cost . " - WHERE wo=" . $_POST['WO'] . " + stdcost ='" . $Cost . "' + WHERE wo='" . $_POST['WO'] . "' AND stockid='" . $_POST['OutputItem'.$i] . "'"; } elseif (isset($_POST['HasWOSerialNos'.$i]) and $_POST['HasWOSerialNos'.$i]==false) { - $sql[] = "UPDATE woitems SET qtyreqd = ". $_POST['OutputQty' . $i] . ", + $sql[] = "UPDATE woitems SET qtyreqd = '". $_POST['OutputQty' . $i] . "', nextlotsnref = '". $_POST['NextLotSNRef'.$i] ."' - WHERE wo=" . $_POST['WO'] . " + WHERE wo='" . $_POST['WO'] . "' AND stockid='" . $_POST['OutputItem'.$i] . "'"; } } @@ -361,17 +361,17 @@ if ($CancelDelete==false) { //ie all tests proved ok to delete DB_Txn_Begin($db); //delete the worequirements - $sql = "DELETE FROM worequirements WHERE wo=" . $_POST['WO']; + $sql = "DELETE FROM worequirements WHERE wo='" . $_POST['WO'] . "'"; $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); //delete the items on the work order - $sql = "DELETE FROM woitems WHERE wo=" . $_POST['WO']; + $sql = "DELETE FROM woitems WHERE wo='" . $_POST['WO'] . "'"; $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); //delete the controlled items defined in wip - $sql="DELETE FROM woserialnos WHERE wo=" . $_POST['WO']; + $sql="DELETE FROM woserialnos WHERE wo='" . $_POST['WO'] . "'"; $ErrMsg=_('The work order serial numbers could not be deleted'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); // delete the actual work order - $sql="DELETE FROM workorders WHERE wo=" . $_POST['WO']; + $sql="DELETE FROM workorders WHERE wo='" . $_POST['WO'] . "'"; $ErrMsg=_('The work order could not be deleted'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); @@ -404,7 +404,7 @@ closed FROM workorders INNER JOIN locations ON workorders.loccode=locations.loccode - WHERE workorders.wo=" . $_POST['WO']; + WHERE workorders.wo='" . $_POST['WO'] . "'"; $WOResult = DB_query($sql,$db); if (DB_num_rows($WOResult)==1){ @@ -415,7 +415,7 @@ $_POST['RequiredBy'] = ConvertSQLDate($myrow['requiredby']); $_POST['StockLocation'] = $myrow['loccode']; $ErrMsg =_('Could not get the work order items'); - $WOItemsResult = DB_query('SELECT woitems.stockid, + $WOItemsResult = DB_query("SELECT woitems.stockid, stockmaster.description, qtyreqd, qtyrecd, @@ -426,7 +426,7 @@ nextserialno FROM woitems INNER JOIN stockmaster ON woitems.stockid=stockmaster.stockid - WHERE wo=' .$_POST['WO'],$db,$ErrMsg); + WHERE wo='" .$_POST['WO'] . "'",$db,$ErrMsg); $NumberOfOutputs=DB_num_rows($WOItemsResult); $i=1; @@ -486,7 +486,7 @@ <td class=number>' . number_format($myrow['costissued'],2) . '</td></tr>'; } echo '</table> - <p><table>'; + <p><table class=selection>'; echo '<tr><th>' . _('Output Item') . '</th> <th>' . _('Qty Required') . '</th> <th>' . _('Qty Received') . '</th> @@ -543,11 +543,11 @@ } echo '</table>'; -echo '<div class="centre"><hr><input type=submit name="submit" value="' . _('Update') . '">'; +echo '<div class="centre"><br /><input type=submit name="submit" value="' . _('Update') . '">'; echo '<br><p><input type=submit name="delete" VALUE="' . _('Delete This Work Order') . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">'; -echo '<hr></div>'; +echo '<br /></div>'; $SQL="SELECT categoryid, categorydescription @@ -556,7 +556,7 @@ ORDER BY categorydescription"; $result1 = DB_query($SQL,$db); -echo '<table><tr><td><font size=2>' . _('Select a stock category') . ':</font><select name="StockCat">'; +echo '<table class=selection><tr><td>' . _('Select a stock category') . ':<select name="StockCat">'; if (!isset($_POST['StockCat'])){ echo '<option selected VALUE="All">' . _('All'); @@ -576,14 +576,14 @@ ?> </select> -<td><font size=2><?php echo _('Enter text extracts in the'); ?> <b><?php echo _('description'); ?></b>:</font></td> +<td><?php echo _('Enter text extracts in the'); ?> <b><?php echo _('description'); ?></b>:</td> <td><input type="Text" name="Keywords" size=20 maxlength=25 VALUE="<?php if (isset($_POST['Keywords'])) echo $_POST['Keywords']; ?>"></td></tr> <tr><td></td> - <td><font SIZE 3><b><?php echo _('OR'); ?> </b></font><font size=2><?php echo _('Enter extract of the'); ?> <b><?php echo _('Stock Code'); ?></b>:</font></td> + <td><font SIZE 3><b><?php echo _('OR'); ?> </b></font><?php echo _('Enter extract of the'); ?> <b><?php echo _('Stock Code'); ?></b>:</td> <td><input type="Text" name="StockCode" size=15 maxlength=18 VALUE="<?php if (isset($_POST['StockCode'])) echo $_POST['StockCode']; ?>"></td> </tr> </table> - <div class="centre"><input type=submit name="Search" VALUE="<?php echo _('Search Now'); ?>"> + <br /><div class="centre"><input type=submit name="Search" VALUE="<?php echo _('Search Now'); ?>"> <?php @@ -593,7 +593,7 @@ if (DB_num_rows($SearchResult)>1){ - echo '<table cellpadding=2 colspan=7 BORDER=1>'; + echo '<table cellpadding=2 colspan=7 class=selection>'; $TableHeader = '<tr><th>' . _('Code') . '</th> <th>' . _('Description') . '</th> <th>' . _('Units') . '</th></tr>'; @@ -609,10 +609,10 @@ if (!in_array($myrow['stockid'],$ItemCodes)){ if (function_exists('imagecreatefrompng') ){ - $ImageSource = '<IMG SRC="GetStockImage.php?SID&automake=1&textcolor=FFFFFF&bgcolor=CCCCCC&StockID=' . urlencode($myrow['stockid']). '&text=&width=64&height=64">'; + $ImageSource = '<img src="GetStockImage.php?SID&automake=1&textcolor=FFFFFF&bgcolor=CCCCCC&StockID=' . urlencode($myrow['stockid']). '&text=&width=64&height=64">'; } else { if(file_exists($_SERVER['DOCUMENT_ROOT'] . $rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg')) { - $ImageSource = '<IMG SRC="' .$_SERVER['DOCUMENT_ROOT'] . $rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg">'; + $ImageSource = '<img src="' .$_SERVER['DOCUMENT_ROOT'] . $rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg">'; } else { $ImageSource = _('No Image'); } @@ -663,4 +663,4 @@ include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-09-28 20:24:12 UTC (rev 3829) +++ trunk/doc/Change.log.html 2010-09-29 10:19:50 UTC (rev 3830) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>29/09/10 Tim: WorkOrderEntry.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: WorkOrderCosting.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: WorkCentres.php - SQL quoting corrections and layout changes and improvements</p> <p>28/09/10 Tim: WhereUsedInquiry.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-29 10:56:11
|
Revision: 3831 http://web-erp.svn.sourceforge.net/web-erp/?rev=3831&view=rev Author: tim_schofield Date: 2010-09-29 10:56:03 +0000 (Wed, 29 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements Modified Paths: -------------- trunk/WorkOrderIssue.php trunk/doc/Change.log.html Modified: trunk/WorkOrderIssue.php =================================================================== --- trunk/WorkOrderIssue.php 2010-09-29 10:19:50 UTC (rev 3830) +++ trunk/WorkOrderIssue.php 2010-09-29 10:56:03 UTC (rev 3831) @@ -18,353 +18,356 @@ echo '<a href="'. $rootpath . '/SelectWorkOrder.php?' . SID . '">' . _('Back to Work Orders'). '</a><br>'; echo '<a href="'. $rootpath . '/WorkOrderCosting.php?' . SID . '&WO=' . $_POST['WO'] . '">' . _('Back to Costing'). '</a><br>'; +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/group_add.png" title="' . + _('Search') . '" alt="">' . ' ' . $title.'</p'; + echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; if (!isset($_POST['WO']) OR !isset($_POST['StockID'])) { - /* This page can only be called with a work order number for issuing stock to*/ - echo '<div class="centre"><a href="' . $rootpath . '/SelectWorkOrder.php?' . SID . '">'. - _('Select a work order to issue materials to').'</a></div>'; - prnMsg(_('This page can only be opened if a work order has been selected. Please select a work order to issue materials to first'),'info'); - include ('includes/footer.inc'); - exit; + /* This page can only be called with a work order number for issuing stock to*/ + echo '<div class="centre"><a href="' . $rootpath . '/SelectWorkOrder.php?' . SID . '">'. + _('Select a work order to issue materials to').'</a></div>'; + prnMsg(_('This page can only be opened if a work order has been selected. Please select a work order to issue materials to first'),'info'); + include ('includes/footer.inc'); + exit; } else { - echo '<input type="hidden" name="WO" value=' .$_POST['WO'] . '>'; - echo '<input type="hidden" name="StockID" value=' .$_POST['StockID'] . '>'; + echo '<input type="hidden" name="WO" value=' .$_POST['WO'] . '>'; + echo '<input type="hidden" name="StockID" value=' .$_POST['StockID'] . '>'; } if (isset($_GET['IssueItem'])){ - $_POST['IssueItem']=$_GET['IssueItem']; + $_POST['IssueItem']=$_GET['IssueItem']; } if (isset($_GET['FromLocation'])){ - $_POST['FromLocation'] =$_GET['FromLocation']; + $_POST['FromLocation'] =$_GET['FromLocation']; } if (isset($_POST['Process'])){ //user hit the process the work order issues entered. - $InputError = false; //ie assume no problems for a start - ever the optomist - $ErrMsg = _('Could not retrieve the details of the selected work order item'); - $WOResult = DB_query("SELECT workorders.loccode, - locations.locationname, - workorders.closed, - stockcategory.wipact, - stockcategory.stockact - FROM workorders INNER JOIN locations - ON workorders.loccode=locations.loccode - INNER JOIN woitems - ON workorders.wo=woitems.wo - INNER JOIN stockmaster - ON woitems.stockid=stockmaster.stockid - INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE woitems.stockid='" . $_POST['StockID'] . "' - AND woitems.wo=" . $_POST['WO'], - $db, - $ErrMsg); + $InputError = false; //ie assume no problems for a start - ever the optomist + $ErrMsg = _('Could not retrieve the details of the selected work order item'); + $WOResult = DB_query("SELECT workorders.loccode, + locations.locationname, + workorders.closed, + stockcategory.wipact, + stockcategory.stockact + FROM workorders INNER JOIN locations + ON workorders.loccode=locations.loccode + INNER JOIN woitems + ON workorders.wo=woitems.wo + INNER JOIN stockmaster + ON woitems.stockid=stockmaster.stockid + INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE woitems.stockid='" . $_POST['StockID'] . "' + AND woitems.wo='" . $_POST['WO'] . "'", + $db, + $ErrMsg); - if (DB_num_rows($WOResult)==0){ - prnMsg(_('The selected work order item cannot be retrieved from the database'),'info'); - include('includes/footer.inc'); - exit; - } - $WORow = DB_fetch_array($WOResult); + if (DB_num_rows($WOResult)==0){ + prnMsg(_('The selected work order item cannot be retrieved from the database'),'info'); + include('includes/footer.inc'); + exit; + } + $WORow = DB_fetch_array($WOResult); - if ($WORow['closed']==1){ - prnMsg(_('The work order is closed - no more materials or components can be issued to it.'),'error'); - $InputError=true; - } - $QuantityIssued =0; - if (is_array($_POST['SerialNos'])){ //then we are issuing a serialised item - $QuantityIssued = count($_POST['SerialNos']); // the total quantity issued as 1 per serial no - } elseif ( isset($_POST['Qty'])){ //then its a plain non-controlled item - $QuantityIssued = $_POST['Qty']; - } else { //it must be a batch/lot controlled item - for ($i=0;$i<15;$i++){ - if (strlen($_POST['Qty'.$i])>0){ - if (!is_numeric($_POST['Qty'.$i])){ - $InputError=1; - } else { - $QuantityIssued += $_POST['Qty'.$i]; - } //end if the qty field is numeric - } // end if the qty field is entered - }//end for the 15 fields available for batch/lot entry - }//end batch/lot controlled item + if ($WORow['closed']==1){ + prnMsg(_('The work order is closed - no more materials or components can be issued to it.'),'error'); + $InputError=true; + } + $QuantityIssued =0; + if (is_array($_POST['SerialNos'])){ //then we are issuing a serialised item + $QuantityIssued = count($_POST['SerialNos']); // the total quantity issued as 1 per serial no + } elseif ( isset($_POST['Qty'])){ //then its a plain non-controlled item + $QuantityIssued = $_POST['Qty']; + } else { //it must be a batch/lot controlled item + for ($i=0;$i<15;$i++){ + if (strlen($_POST['Qty'.$i])>0){ + if (!is_numeric($_POST['Qty'.$i])){ + $InputError=1; + } else { + $QuantityIssued += $_POST['Qty'.$i]; + } //end if the qty field is numeric + } // end if the qty field is entered + }//end for the 15 fields available for batch/lot entry + }//end batch/lot controlled item - //Need to get the current standard cost for the item being issued - $SQL = "SELECT materialcost+labourcost+overheadcost AS cost, - controlled, - serialised, - mbflag - FROM stockmaster - WHERE stockid='" .$_POST['IssueItem'] . "'"; - $Result = DB_query($SQL,$db); - $IssueItemRow = DB_fetch_array($Result); + //Need to get the current standard cost for the item being issued + $SQL = "SELECT materialcost+labourcost+overheadcost AS cost, + controlled, + serialised, + mbflag + FROM stockmaster + WHERE stockid='" .$_POST['IssueItem'] . "'"; + $Result = DB_query($SQL,$db); + $IssueItemRow = DB_fetch_array($Result); - if ($IssueItemRow['cost']==0){ - prnMsg(_('The item being issued has a zero cost. Zero cost items cannot be issued to work orders'),'error'); - $InputError=1; - } + if ($IssueItemRow['cost']==0){ + prnMsg(_('The item being issued has a zero cost. Zero cost items cannot be issued to work orders'),'error'); + $InputError=1; + } - if ($_SESSION['ProhibitNegativeStock']==1 - AND ($IssueItemRow['mbflag']=='M' OR $IssueItemRow['mbflag']=='B')){ - //don't need to check labour or dummy items - $SQL = "SELECT quantity FROM locstock - WHERE stockid ='" . $_POST['IssueItem'] . "' - AND loccode ='" . $_POST['FromLocation'] . "'"; - $CheckNegResult = DB_query($SQL,$db); - $CheckNegRow = DB_fetch_row($CheckNegResult); - if ($CheckNegRow[0]<$QuantityIssued){ - $InputError = true; - prnMsg(_('This issue cannot be processed because the system parameter is set to prohibit negative stock and this issue would result in stock going into negative. Please correct the stock first before attempting another issue'),'error'); - } + if ($_SESSION['ProhibitNegativeStock']==1 + AND ($IssueItemRow['mbflag']=='M' OR $IssueItemRow['mbflag']=='B')){ + //don't need to check labour or dummy items + $SQL = "SELECT quantity FROM locstock + WHERE stockid ='" . $_POST['IssueItem'] . "' + AND loccode ='" . $_POST['FromLocation'] . "'"; + $CheckNegResult = DB_query($SQL,$db); + $CheckNegRow = DB_fetch_row($CheckNegResult); + if ($CheckNegRow[0]<$QuantityIssued){ + $InputError = true; + prnMsg(_('This issue cannot be processed because the system parameter is set to prohibit negative stock and this issue would result in stock going into negative. Please correct the stock first before attempting another issue'),'error'); + } - } + } - if ($InputError==false){ + if ($InputError==false){ /************************ BEGIN SQL TRANSACTIONS ************************/ - $Result = DB_Txn_Begin($db); - /*Now Get the next WO Issue transaction type 28 - function in SQL_CommonFunctions*/ - $WOIssueNo = GetNextTransNo(28, $db); + $Result = DB_Txn_Begin($db); + /*Now Get the next WO Issue transaction type 28 - function in SQL_CommonFunctions*/ + $WOIssueNo = GetNextTransNo(28, $db); - $PeriodNo = GetPeriod(Date($_SESSION['DefaultDateFormat']), $db); - $SQLIssuedDate = FormatDateForSQL($_POST['IssuedDate']); - $StockGLCode = GetStockGLCode($_POST['IssueItem'],$db); + $PeriodNo = GetPeriod(Date($_SESSION['DefaultDateFormat']), $db); + $SQLIssuedDate = FormatDateForSQL($_POST['IssuedDate']); + $StockGLCode = GetStockGLCode($_POST['IssueItem'],$db); - if ($IssueItemRow['mbflag']=='M' OR $IssueItemRow['mbflag']=='B'){ - /* Need to get the current location quantity will need it later for the stock movement */ - $SQL="SELECT locstock.quantity - FROM locstock - WHERE locstock.stockid='" . $_POST['IssueItem'] . "' - AND loccode= '" . $_POST['FromLocation'] . "'"; + if ($IssueItemRow['mbflag']=='M' OR $IssueItemRow['mbflag']=='B'){ + /* Need to get the current location quantity will need it later for the stock movement */ + $SQL="SELECT locstock.quantity + FROM locstock + WHERE locstock.stockid='" . $_POST['IssueItem'] . "' + AND loccode= '" . $_POST['FromLocation'] . "'"; - $Result = DB_query($SQL, $db); - if (DB_num_rows($Result)==1){ - $LocQtyRow = DB_fetch_row($Result); - $NewQtyOnHand = ($LocQtyRow[0] - $QuantityIssued); - } else { - /*There must actually be some error this should never happen */ - $NewQtyOnHand = 0; - } + $Result = DB_query($SQL, $db); + if (DB_num_rows($Result)==1){ + $LocQtyRow = DB_fetch_row($Result); + $NewQtyOnHand = ($LocQtyRow[0] - $QuantityIssued); + } else { + /*There must actually be some error this should never happen */ + $NewQtyOnHand = 0; + } - $SQL = "UPDATE locstock - SET quantity = locstock.quantity - " . $QuantityIssued . " - WHERE locstock.stockid = '" . $_POST['IssueItem'] . "' - AND loccode = '" . $_POST['FromLocation'] . "'"; + $SQL = "UPDATE locstock + SET quantity = locstock.quantity - " . $QuantityIssued . " + WHERE locstock.stockid = '" . $_POST['IssueItem'] . "' + AND loccode = '" . $_POST['FromLocation'] . "'"; - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The location stock record could not be updated because'); - $DbgMsg = _('The following SQL to update the location stock record was used'); - $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); - } else { - $NewQtyOnHand =0; //since we can't have stock of labour type items!! - } - /*Insert stock movements - with unit cost */ + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The location stock record could not be updated because'); + $DbgMsg = _('The following SQL to update the location stock record was used'); + $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); + } else { + $NewQtyOnHand =0; //since we can't have stock of labour type items!! + } + /*Insert stock movements - with unit cost */ - $SQL = "INSERT INTO stockmoves (stockid, - type, - transno, - loccode, - trandate, - price, - prd, - reference, - qty, - standardcost, - newqoh) - VALUES ('" . $_POST['IssueItem'] . "', - 28, - " . $WOIssueNo . ", - '" . $_POST['FromLocation'] . "', - '" . FormatDateForSQL($_POST['issuedate']) . "', - " . $IssueItemRow['cost'] . ", - " . $PeriodNo . ", - '" . $_POST['WO'] . "', - " . -$QuantityIssued . ", - " . $IssueItemRow['cost'] . ", - " . $NewQtyOnHand . ")"; + $SQL = "INSERT INTO stockmoves (stockid, + type, + transno, + loccode, + trandate, + price, + prd, + reference, + qty, + standardcost, + newqoh) + VALUES ('" . $_POST['IssueItem'] . "', + 28, + '" . $WOIssueNo . "', + '" . $_POST['FromLocation'] . "', + '" . FormatDateForSQL($_POST['issuedate']) . "', + '" . $IssueItemRow['cost'] . "', + '" . $PeriodNo . "', + '" . $_POST['WO'] . "', + '" . -$QuantityIssued . "', + '" . $IssueItemRow['cost'] . "', + '" . $NewQtyOnHand . "')"; - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('stock movement records could not be inserted when processing the work order issue because'); - $DbgMsg = _('The following SQL to insert the stock movement records was used'); - $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('stock movement records could not be inserted when processing the work order issue because'); + $DbgMsg = _('The following SQL to insert the stock movement records was used'); + $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); - /*Get the ID of the StockMove... */ - $StkMoveNo = DB_Last_Insert_ID($db,'stockmoves','stkmoveno'); - /* Do the Controlled Item INSERTS HERE */ + /*Get the ID of the StockMove... */ + $StkMoveNo = DB_Last_Insert_ID($db,'stockmoves','stkmoveno'); + /* Do the Controlled Item INSERTS HERE */ - if ($IssueItemRow['controlled'] ==1){ - //the form is different for serialised items and just batch/lot controlled items - if ($IssueItemRow['serialised']==1){ - //serialised items form has multi select box of serial numbers that contains all the available serial numbers at the location selected - foreach ($_POST['SerialNos'] as $SerialNo){ - /* We need to add the StockSerialItem record and - The StockSerialMoves as well */ - //need to test if the serialised item exists first already - if (trim($SerialNo) != ""){ + if ($IssueItemRow['controlled'] ==1){ + //the form is different for serialised items and just batch/lot controlled items + if ($IssueItemRow['serialised']==1){ + //serialised items form has multi select box of serial numbers that contains all the available serial numbers at the location selected + foreach ($_POST['SerialNos'] as $SerialNo){ + /* We need to add the StockSerialItem record and + The StockSerialMoves as well */ + //need to test if the serialised item exists first already + if (trim($SerialNo) != ""){ - $SQL = "UPDATE stockserialitems set quantity=0 - WHERE (stockid= '" . $_POST['IssueItem'] . "') - AND (loccode = '" . $_POST['FromLocation'] . "') - AND (serialno = '" . $SerialNo . "')"; - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record could not be inserted because'); - $DbgMsg = _('The following SQL to insert the serial stock item records was used'); - $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); + $SQL = "UPDATE stockserialitems set quantity=0 + WHERE (stockid= '" . $_POST['IssueItem'] . "') + AND (loccode = '" . $_POST['FromLocation'] . "') + AND (serialno = '" . $SerialNo . "')"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record could not be inserted because'); + $DbgMsg = _('The following SQL to insert the serial stock item records was used'); + $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); - /** end of handle stockserialitems records */ + /** end of handle stockserialitems records */ - /* now insert the serial stock movement */ - $SQL = "INSERT INTO stockserialmoves (stockmoveno, - stockid, - serialno, - moveqty) - VALUES (" . $StkMoveNo . ", - '" . $_POST['IssueItem'] . "', - '" . $SerialNo . "', - -1)"; - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock movement record could not be inserted because'); - $DbgMsg = _('The following SQL to insert the serial stock movement records was used'); - $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); - }//non blank SerialNo - } //end for all of the potential serialised entries in the multi select box - } else { //the item is just batch/lot controlled not serialised - /*the form for entry of batch controlled items is only 15 possible fields */ - for($i=0;$i<15;$i++){ - /* We need to add the StockSerialItem record and - The StockSerialMoves as well */ - //need to test if the batch/lot exists first already - if (trim($_POST['BatchRef' .$i]) != ""){ + /* now insert the serial stock movement */ + $SQL = "INSERT INTO stockserialmoves (stockmoveno, + stockid, + serialno, + moveqty) + VALUES ('" . $StkMoveNo . "', + '" . $_POST['IssueItem'] . "', + '" . $SerialNo . "', + -1)"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock movement record could not be inserted because'); + $DbgMsg = _('The following SQL to insert the serial stock movement records was used'); + $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); + }//non blank SerialNo + } //end for all of the potential serialised entries in the multi select box + } else { //the item is just batch/lot controlled not serialised + /*the form for entry of batch controlled items is only 15 possible fields */ + for($i=0;$i<15;$i++){ + /* We need to add the StockSerialItem record and + The StockSerialMoves as well */ + //need to test if the batch/lot exists first already + if (trim($_POST['BatchRef' .$i]) != ""){ - $SQL = "SELECT COUNT(*) FROM stockserialitems - WHERE stockid='" .$_POST['IssueItem'] . "' - AND loccode = '" . $_POST['FromLocation'] . "' - AND serialno = '" . $_POST['BatchRef' .$i] . "'"; - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Could not check if a batch/lot reference for the item already exists because'); - $DbgMsg = _('The following SQL to test for an already existing controlled item was used'); - $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); - $AlreadyExistsRow = DB_fetch_row($Result); + $SQL = "SELECT COUNT(*) FROM stockserialitems + WHERE stockid='" .$_POST['IssueItem'] . "' + AND loccode = '" . $_POST['FromLocation'] . "' + AND serialno = '" . $_POST['BatchRef' .$i] . "'"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Could not check if a batch/lot reference for the item already exists because'); + $DbgMsg = _('The following SQL to test for an already existing controlled item was used'); + $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); + $AlreadyExistsRow = DB_fetch_row($Result); - if ($AlreadyExistsRow[0]>0){ - $SQL = 'UPDATE stockserialitems SET quantity = quantity - ' . $_POST['Qty' . $i] . " - WHERE stockid='" . $_POST['IssueItem'] . "' - AND loccode = '" . $_POST['FromLocation'] . "' - AND serialno = '" . $_POST['BatchRef' .$i] . "'"; - } else { - $SQL = "INSERT INTO stockserialitems (stockid, - loccode, - serialno, - qualitytext, - quantity) - VALUES ('" . $_POST['IssueItem'] . "', - '" . $_POST['FromLocation'] . "', - '" . $_POST['BatchRef' . $i] . "', - '', - " . -($_POST['Qty'.$i]) . ")"; - } + if ($AlreadyExistsRow[0]>0){ + $SQL = "UPDATE stockserialitems SET quantity = quantity - " . $_POST['Qty' . $i] . " + WHERE stockid='" . $_POST['IssueItem'] . "' + AND loccode = '" . $_POST['FromLocation'] . "' + AND serialno = '" . $_POST['BatchRef' .$i] . "'"; + } else { + $SQL = "INSERT INTO stockserialitems (stockid, + loccode, + serialno, + qualitytext, + quantity) + VALUES ('" . $_POST['IssueItem'] . "', + '" . $_POST['FromLocation'] . "', + '" . $_POST['BatchRef' . $i] . "', + '', + '" . -($_POST['Qty'.$i]) . "')"; + } - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The batch/lot item record could not be inserted because'); - $DbgMsg = _('The following SQL to insert the batch/lot item records was used'); - $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The batch/lot item record could not be inserted because'); + $DbgMsg = _('The following SQL to insert the batch/lot item records was used'); + $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); - /** end of handle stockserialitems records */ + /** end of handle stockserialitems records */ - /** now insert the serial stock movement **/ - $SQL = "INSERT INTO stockserialmoves (stockmoveno, - stockid, - serialno, - moveqty) - VALUES (" . $StkMoveNo . ", - '" . $_POST['IssueItem'] . "', - '" . $_POST['BatchRef'.$i] . "', - " . $_POST['Qty'.$i] . ")"; - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock movement record could not be inserted because'); - $DbgMsg = _('The following SQL to insert the serial stock movement records was used'); - $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); - }//non blank BundleRef - } //end for all 15 of the potential batch/lot fields received - } //end of the batch controlled stuff - } //end if the woitem received here is a controlled item + /** now insert the serial stock movement **/ + $SQL = "INSERT INTO stockserialmoves (stockmoveno, + stockid, + serialno, + moveqty) + VALUES ('" . $StkMoveNo . "', + '" . $_POST['IssueItem'] . "', + '" . $_POST['BatchRef'.$i] . "', + '" . $_POST['Qty'.$i] . "')"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock movement record could not be inserted because'); + $DbgMsg = _('The following SQL to insert the serial stock movement records was used'); + $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); + }//non blank BundleRef + } //end for all 15 of the potential batch/lot fields received + } //end of the batch controlled stuff + } //end if the woitem received here is a controlled item - if ($_SESSION['CompanyRecord']['gllink_stock']==1){ - /*GL integration with stock is activated so need the GL journals to make it so */ + if ($_SESSION['CompanyRecord']['gllink_stock']==1){ + /*GL integration with stock is activated so need the GL journals to make it so */ - /*first the debit the WIP of the item being manufactured from the WO - the appropriate account was already retrieved into the $StockGLCode variable as the Processing code is kicked off - it is retrieved from the stock category record of the item by a function in SQL_CommonFunctions.inc*/ + /*first the debit the WIP of the item being manufactured from the WO + the appropriate account was already retrieved into the $StockGLCode variable as the Processing code is kicked off + it is retrieved from the stock category record of the item by a function in SQL_CommonFunctions.inc*/ - $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES (28, - " . $WOIssueNo . ", - '" . FormatDateForSQL($_POST['issuedate']) . "', - " . $PeriodNo . ", - " . $WORow['wipact'] . ", - '" . $_POST['WO'] . " " . $_POST['IssueItem'] . ' x ' . $QuantityIssued . " @ " . number_format($IssueItemRow['cost'],2) . "', - " . ($IssueItemRow['cost'] * $QuantityIssued) . ")"; + $SQL = "INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (28, + '" . $WOIssueNo . "', + '" . FormatDateForSQL($_POST['issuedate']) . "', + '" . $PeriodNo . "', + '" . $WORow['wipact'] . "', + '" . $_POST['WO'] . " " . $_POST['IssueItem'] . ' x ' . $QuantityIssued . " @ " . number_format($IssueItemRow['cost'],2) . "', + '" . ($IssueItemRow['cost'] * $QuantityIssued) . "')"; - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The issue of the item to the work order GL posting could not be inserted because'); - $DbgMsg = _('The following SQL to insert the work order issue GLTrans record was used'); - $Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true); + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The issue of the item to the work order GL posting could not be inserted because'); + $DbgMsg = _('The following SQL to insert the work order issue GLTrans record was used'); + $Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true); - /*now the credit Stock entry*/ - $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES (28, - " . $WOIssueNo . ", - '" . FormatDateForSQL($_POST['issuedate']) . "', - " . $PeriodNo . ", - " . $StockGLCode['stockact'] . ", - '" . $_POST['WO'] . " " . $_POST['IssueItem'] . ' x ' . $QuantityIssued . " @ " . number_format($IssueItemRow['cost'],2) . "', - " . -($IssueItemRow['cost'] * $QuantityIssued) . ")"; + /*now the credit Stock entry*/ + $SQL = "INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (28, + '" . $WOIssueNo . "', + '" . FormatDateForSQL($_POST['issuedate']) . "', + '" . $PeriodNo . "', + '" . $StockGLCode['stockact'] . "', + '" . $_POST['WO'] . " " . $_POST['IssueItem'] . ' x ' . $QuantityIssued . " @ " . number_format($IssueItemRow['cost'],2) . "', + '" . -($IssueItemRow['cost'] * $QuantityIssued) . "')"; - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The stock account credit on the issue of items to a work order GL posting could not be inserted because'); - $DbgMsg = _('The following SQL to insert the stock GLTrans record was used'); - $Result = DB_query($SQL,$db, $ErrMsg, $DbgMsg,true); + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The stock account credit on the issue of items to a work order GL posting could not be inserted because'); + $DbgMsg = _('The following SQL to insert the stock GLTrans record was used'); + $Result = DB_query($SQL,$db, $ErrMsg, $DbgMsg,true); - } /* end of if GL and stock integrated and standard cost !=0 */ + } /* end of if GL and stock integrated and standard cost !=0 */ - //update the wo with the new qtyrecd - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' ._('Could not update the work order cost issued to the work order because'); - $DbgMsg = _('The following SQL was used to update the work order'); - $UpdateWOResult =DB_query("UPDATE workorders - SET costissued=costissued+" . ($QuantityIssued*$IssueItemRow['cost']) . " - WHERE wo=" . $_POST['WO'], - $db,$ErrMsg,$DbgMsg,true); + //update the wo with the new qtyrecd + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' ._('Could not update the work order cost issued to the work order because'); + $DbgMsg = _('The following SQL was used to update the work order'); + $UpdateWOResult =DB_query("UPDATE workorders + SET costissued=costissued+" . ($QuantityIssued*$IssueItemRow['cost']) . " + WHERE wo='" . $_POST['WO'] . "'", + $db,$ErrMsg,$DbgMsg,true); - $Result = DB_Txn_Commit($db); + $Result = DB_Txn_Commit($db); - prnMsg(_('The issue of') . ' ' . $QuantityIssued . ' ' . _('of') . ' ' . $_POST['IssueItem'] . ' ' . _('against work order') . ' '. $_POST['WO'] . ' ' . _('has been processed'),'info'); - echo '<p><ul><li><a href="' . $rootpath . '/WorkOrderIssue.php?' . SID . '&WO=' . $_POST['WO'] . '&StockID=' . $_POST['StockID'] . '">' . _('Issue more components to this work order') . '</a></li>'; - echo '<li><a href="' . $rootpath . '/SelectWorkOrder.php?' . SID . '">' . _('Select a different work order for issuing materials and components against'). '</a></li></ul>'; - unset($_POST['WO']); - unset($_POST['StockID']); - unset($_POST['IssueItem']); - unset($_POST['FromLocation']); - unset($_POST['Process']); - unset($_POST['SerialNos']); - for ($i=0;$i<15;$i++){ - unset($_POST['BatchRef'.$i]); - unset($_POST['Qty'.$i]); - } - unset($_POST['Qty']); - /*end of process work order issues entry */ - include('includes/footer.inc'); - exit; - } //end if there were not input errors reported - so the processing was allowed to continue + prnMsg(_('The issue of') . ' ' . $QuantityIssued . ' ' . _('of') . ' ' . $_POST['IssueItem'] . ' ' . _('against work order') . ' '. $_POST['WO'] . ' ' . _('has been processed'),'info'); + echo '<p><ul><li><a href="' . $rootpath . '/WorkOrderIssue.php?' . SID . '&WO=' . $_POST['WO'] . '&StockID=' . $_POST['StockID'] . '">' . _('Issue more components to this work order') . '</a></li>'; + echo '<li><a href="' . $rootpath . '/SelectWorkOrder.php?' . SID . '">' . _('Select a different work order for issuing materials and components against'). '</a></li></ul>'; + unset($_POST['WO']); + unset($_POST['StockID']); + unset($_POST['IssueItem']); + unset($_POST['FromLocation']); + unset($_POST['Process']); + unset($_POST['SerialNos']); + for ($i=0;$i<15;$i++){ + unset($_POST['BatchRef'.$i]); + unset($_POST['Qty'.$i]); + } + unset($_POST['Qty']); + /*end of process work order issues entry */ + include('includes/footer.inc'); + exit; + } //end if there were not input errors reported - so the processing was allowed to continue } //end of if the user hit the process button @@ -372,113 +375,113 @@ /*User hit the search button looking for an item to issue to the WO */ if (isset($_POST['Search'])){ - If ($_POST['Keywords'] AND $_POST['StockCode']) { - prnMsg(_('Stock description keywords have been used in preference to the Stock code extract entered'),'warn'); - } - If (strlen($_POST['Keywords'])>0) { - //insert wildcard characters in spaces - $_POST['Keywords'] = strtoupper($_POST['Keywords']); + If ($_POST['Keywords'] AND $_POST['StockCode']) { + prnMsg(_('Stock description keywords have been used in preference to the Stock code extract entered'),'warn'); + } + If (strlen($_POST['Keywords'])>0) { + //insert wildcard characters in spaces + $_POST['Keywords'] = strtoupper($_POST['Keywords']); $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; - - if ($_POST['StockCat']=='All'){ - $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, - stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='L' OR stockcategory.stocktype='M') - AND stockmaster.description " . LIKE . " '$SearchString' - AND stockmaster.discontinued=0 - AND (mbflag='B' OR mbflag='M' OR mbflag='D') - ORDER BY stockmaster.stockid"; - } else { - $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='L' OR stockcategory.stocktype='M') - AND stockmaster.discontinued=0 - AND stockmaster.description " . LIKE . " '" . $SearchString . "' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - AND (mbflag='B' OR mbflag='M' OR mbflag='D') - ORDER BY stockmaster.stockid"; - } - } elseif (strlen($_POST['StockCode'])>0){ + if ($_POST['StockCat']=='All'){ + $SQL = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units + FROM stockmaster, + stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='L' OR stockcategory.stocktype='M') + AND stockmaster.description " . LIKE . " '$SearchString' + AND stockmaster.discontinued=0 + AND (mbflag='B' OR mbflag='M' OR mbflag='D') + ORDER BY stockmaster.stockid"; + } else { + $SQL = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units + FROM stockmaster, stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='L' OR stockcategory.stocktype='M') + AND stockmaster.discontinued=0 + AND stockmaster.description " . LIKE . " '" . $SearchString . "' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + AND (mbflag='B' OR mbflag='M' OR mbflag='D') + ORDER BY stockmaster.stockid"; + } - $_POST['StockCode'] = strtoupper($_POST['StockCode']); - $SearchString = '%' . $_POST['StockCode'] . '%'; + } elseif (strlen($_POST['StockCode'])>0){ - if ($_POST['StockCat']=='All'){ - $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='L' OR stockcategory.stocktype='M') - AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' - AND stockmaster.discontinued=0 - AND (mbflag='B' OR mbflag='M' OR mbflag='D') - ORDER BY stockmaster.stockid"; - } else { - $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='L' OR stockcategory.stocktype='M') - AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' - AND stockmaster.discontinued=0 - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - AND (mbflag='B' OR mbflag='M' OR mbflag='D') - ORDER BY stockmaster.stockid"; - } - } else { - if ($_POST['StockCat']=='All'){ - $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='L' OR stockcategory.stocktype='M') - AND stockmaster.discontinued=0 - AND (mbflag='B' OR mbflag='M' OR mbflag='D') - ORDER BY stockmaster.stockid"; - } else { - $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='L' OR stockcategory.stocktype='M') - AND stockmaster.discontinued=0 - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - AND (mbflag='B' OR mbflag='M' OR mbflag='D') - ORDER BY stockmaster.stockid"; - } - } + $_POST['StockCode'] = strtoupper($_POST['StockCode']); + $SearchString = '%' . $_POST['StockCode'] . '%'; - $SQL = $SQL . ' LIMIT ' . $_SESSION['DisplayRecordsMax']; + if ($_POST['StockCat']=='All'){ + $SQL = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units + FROM stockmaster, stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='L' OR stockcategory.stocktype='M') + AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' + AND stockmaster.discontinued=0 + AND (mbflag='B' OR mbflag='M' OR mbflag='D') + ORDER BY stockmaster.stockid"; + } else { + $SQL = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units + FROM stockmaster, stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='L' OR stockcategory.stocktype='M') + AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' + AND stockmaster.discontinued=0 + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + AND (mbflag='B' OR mbflag='M' OR mbflag='D') + ORDER BY stockmaster.stockid"; + } + } else { + if ($_POST['StockCat']=='All'){ + $SQL = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units + FROM stockmaster, stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='L' OR stockcategory.stocktype='M') + AND stockmaster.discontinued=0 + AND (mbflag='B' OR mbflag='M' OR mbflag='D') + ORDER BY stockmaster.stockid"; + } else { + $SQL = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units + FROM stockmaster, stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='L' OR stockcategory.stocktype='M') + AND stockmaster.discontinued=0 + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + AND (mbflag='B' OR mbflag='M' OR mbflag='D') + ORDER BY stockmaster.stockid"; + } + } - $ErrMsg = _('There is a problem selecting the part records to display because'); - $DbgMsg = _('The SQL used to get the part selection was'); - $SearchResult = DB_query($SQL,$db,$ErrMsg, $DbgMsg); + $SQL = $SQL . ' LIMIT ' . $_SESSION['DisplayRecordsMax']; - if (DB_num_rows($SearchResult)==0 ){ - prnMsg (_('There are no products available meeting the criteria specified'),'info'); + $ErrMsg = _('There is a problem selecting the part records to display because'); + $DbgMsg = _('The SQL used to get the part selection was'); + $SearchResult = DB_query($SQL,$db,$ErrMsg, $DbgMsg); - if ($debug==1){ - prnMsg(_('The SQL statement used was') . ':<br>' . $SQL,'info'); - } - } - if (DB_num_rows($SearchResult)==1){ - $myrow=DB_fetch_array($SearchResult); - $_POST['IssueItem'] = $myrow['stockid']; - DB_data_seek($SearchResult,0); - } + if (DB_num_rows($SearchResult)==0 ){ + prnMsg (_('There are no products available meeting the criteria specified'),'info'); + if ($debug==1){ + prnMsg(_('The SQL statement used was') . ':<br>' . $SQL,'info'); + } + } + if (DB_num_rows($SearchResult)==1){ + $myrow=DB_fetch_array($SearchResult); + $_POST['IssueItem'] = $myrow['stockid']; + DB_data_seek($SearchResult,0); + } + } //end of if search @@ -486,298 +489,291 @@ $ErrMsg = _('Could not retrieve the details of the selected work order item'); $WOResult = DB_query("SELECT workorders.loccode, - locations.locationname, - workorders.requiredby, - workorders.startdate, - workorders.closed, - stockmaster.description, - stockmaster.decimalplaces, - stockmaster.units, - woitems.qtyreqd, - woitems.qtyrecd - FROM workorders INNER JOIN locations - ON workorders.loccode=locations.loccode - INNER JOIN woitems - ON workorders.wo=woitems.wo - INNER JOIN stockmaster - ON woitems.stockid=stockmaster.stockid - WHERE woitems.stockid='" . $_POST['StockID'] . "' - AND woitems.wo =" . $_POST['WO'], - $db, - $ErrMsg); + locations.locationname, + workorders.requiredby, + workorders.startdate, + workorders.closed, + stockmaster.description, + stockmaster.decimalplaces, + stockmaster.units, + woitems.qtyreqd, + woitems.qtyrecd + FROM workorders INNER JOIN locations + ON workorders.loccode=locations.loccode + INNER JOIN woitems + ON workorders.wo=woitems.wo + INNER JOIN stockmaster + ON woitems.stockid=stockmaster.stockid + WHERE woitems.stockid='" . $_POST['StockID'] . "' + AND woitems.wo ='" . $_POST['WO'] . "'", + $db, + $ErrMsg); if (DB_num_rows($WOResult)==0){ - prnMsg(_('The selected work order item cannot be retrieved from the database'),'info'); - include('includes/footer.inc'); - exit; + prnMsg(_('The selected work order item cannot be retrieved from the database'),'info'); + include('includes/footer.inc'); + exit; } $WORow = DB_fetch_array($WOResult); if ($WORow['closed']==1){ - prnMsg(_('The selected work order has been closed and variances calculated and posted. No more issues of materials and components can be made against this work order.'),'info'); - include('includes/footer.inc'); - exit; + prnMsg(_('The selected work order has been closed and variances calculated and posted. No more issues of materials and components can be made against this work order.'),'info'); + include('includes/footer.inc'); + exit; } if (!isset($_POST['IssuedDate'])){ - $_POST['IssuedDate'] = Date($_SESSION['DefaultDateFormat']); + $_POST['IssuedDate'] = Date($_SESSION['DefaultDateFormat']); } -echo '<table cellpadding=2 border=0> - <tr><td class="label">' . _('Issue to work order') . ':</td><td>' . $_POST['WO'] .'</td><td class="label">' . _('Item') . ':</td><td>' . $_POST['StockID'] . ' - ' . $WORow['description'] . '</td></tr> - <tr><td class="label">' . _('Manufactured at') . ':</td><td>' . $WORow['locationname'] . '</td><td class="label">' . _('Required By') . ':</td><td>' . ConvertSQLDate($WORow['requiredby']) . '</td></tr> - <tr><td class="label">' . _('Quantity Ordered') . ':</td><td class=number>' . number_format($WORow['qtyreqd'],$WORow['decimalplaces']) . '</td><td colspan=2>' . $WORow['units'] . '</td></tr> - <tr><td class="label">' . _('Already Received') . ':</td><td class=number>' . number_format($WORow['qtyrecd'],$WORow['decimalplaces']) . '</td><td colspan=2>' . $WORow['units'] . '</td></tr> - <tr><td colspan=4><hr></td></tr> - <tr><td class="label">' . _('Date Material Issued') . ':</td><td><input type=text name=issuedate value=' +echo '<table cellpadding=2 class=selection> + <tr><td class="label">' . _('Issue to work order') . ':</td><td>' . $_POST['WO'] .'</td><td class="label">' . _('Item') . ':</td><td>' . $_POST['StockID'] . ' - ' . $WORow['description'] . '</td></tr> + <tr><td class="label">' . _('Manufactured at') . ':</td><td>' . $WORow['locationname'] . '</td><td class="label">' . _('Required By') . ':</td><td>' . ConvertSQLDate($WORow['requiredby']) . '</td></tr> + <tr><td class="label">' . _('Quantity Ordered') . ':</td><td class=number>' . number_format($WORow['qtyreqd'],$WORow['decimalplaces']) . '</td><td colspan=2>' . $WORow['units'] . '</td></tr> + <tr><td class="label">' . _('Already Received') . ':</td><td class=number>' . number_format($WORow['qtyrecd'],$WORow['decimalplaces']) . '</td><td colspan=2>' . $WORow['units'] . '</td></tr> + <tr><td colspan=4></td></tr> + <tr><td class="label">' . _('Date Material Issued') . ':</td><td><input type=text name=issuedate value=' . Date($_SESSION['DefaultDateFormat']) . ' class=date size=10 alt="'.$_SESSION['DefaultDateFormat'].'" ></td> - <td class="label">' . _('Issued From') . ':</td><td>'; + <td class="label">' . _('Issued From') . ':</td><td>'; if (!isset($_POST['IssueItem'])){ - $LocResult = DB_query('SELECT loccode, locationname FROM locations',$db); + $LocResult = DB_query('SELECT loccode, locationname FROM locations',$db); - echo '<select name="FromLocation">'; + echo '<select name="FromLocation">'; - if (!isset($_POST['FromLocation'])){ - $_POST['FromLocation']=$WORow['loccode']; - } + if (!isset($_POST['FromLocation'])){ + $_POST['FromLocation']=$WORow['loccode']; + } - while ($LocRow = DB_fetch_array($LocResult)){ - if ($_POST['FromLocation'] ==$LocRow['loccode']){ - echo '<option selected value="' . $LocRow['loccode'] .'">' . $LocRow['locationname']; - } else { - echo '<option value="' . $LocRow['loccode'] .'">' . $LocRow['locationname']; - } - } - echo '</select>'; + while ($LocRow = DB_fetch_array($LocResult)){ + if ($_POST['FromLocation'] ==$LocRow['loccode']){ + echo '<option selected value="' . $LocRow['loccode'] .'">' . $LocRow['locationname']; + } else { + echo '<option value="' . $LocRow['loccode'] .'">' . $LocRow['locationname']; + } + } + echo '</select>'; } else { - $LocResult = DB_query("SELECT loccode, locationname - FROM locations - WHERE loccode='" . $_POST['FromLocation'] . "'", - $db); - $LocRow = DB_fetch_array($LocResult); - echo '<input type="hidden" name="FromLocation" value="' . $_POST['FromLocation'] . '">'; - echo $LocRow['locationname']; + $LocResult = DB_query("SELECT loccode, locationname + FROM locations + WHERE loccode='" . $_POST['FromLocation'] . "'", + $db); + $LocRow = DB_fetch_array($LocResult); + echo '<input type="hidden" name="FromLocation" value="' . $_POST['FromLocation'] . '">'; + echo $LocRow['locationname']; } echo '</td></tr> - </table> - <table>'; + </table><br /> + <table class=selection>'; if (!isset($_POST['IssueItem'])){ //no item selected to issue yet - //set up options for selection of the item to be issued to the WO - echo '<tr><th colspan=5>' . _('Material Requirements For this Work Order') . '</th></tr>'; - echo '<tr><th colspan=2>' . _('Item') . '</th> - <th>' . _('Qty Required') . '</th> - <th>' . _('Qty Issued') . '</th></tr>'; + //set up options for selection of the item to be issued to the WO + echo '<tr><th colspan=5>' . _('Material Requirements For this Work Order') . '</th></tr>'; + echo '<tr><th colspan=2>' . _('Item') . '</th> + <th>' . _('Qty Required') . '</th> + <th>' . _('Qty Issued') . '</th></tr>'; - $RequirmentsResult = DB_query("SELECT worequirements.stockid, - stockmaster.description, - stockmaster.decimalplaces, - autoissue, - qtypu - FROM worequirements INNER JOIN stockmaster - ON worequirements.stockid=stockmaster.stockid - WHERE wo=" . $_POST['WO'], - $db); + $RequirmentsResult = DB_query("SELECT worequirements.stockid, + stockmaster.description, + stockmaster.decimalplaces, + autoissue, + qtypu + FROM worequirements INNER JOIN stockmaster + ON worequirements.stockid=stockmaster.stockid + WHERE wo='" . $_POST['WO'] . "'", + $db); - while ($RequirementsRow = DB_fetch_array($RequirmentsResult)){ - if ($RequirementsRow['autoissue']==0){ - echo '<tr><td><input type="submit" name="IssueItem" value="' .$RequirementsRow['stockid'] . '"></td> - <td>' . $RequirementsRow['stockid'] . ' - ' . $RequirementsRow['description'] . '</td>'; - } else { - echo '<tr><td class="notavailable">' . _('Auto Issue') . '<td class="notavailable">' .$RequirementsRow['stockid'] . ' - ' . $RequirementsRow['description'] .'</td>'; - } - $IssuedAlreadyResult = DB_query("SELECT SUM(-qty) FROM stockmoves - WHERE stockmoves.type=28 - AND stockid='" . $RequirementsRow['stockid'] . "' - AND reference='" . $_POST['WO'] . "'", - $db); - $IssuedAlreadyRow = DB_fetch_row($IssuedAlreadyResult); + while ($RequirementsRow = DB_fetch_array($RequirmentsResult)){ + if ($RequirementsRow['autoissue']==0){ + echo '<tr><td><input type="submit" name="IssueItem" value="' .$RequirementsRow['stockid'] . '"></td> + <td>' . $RequirementsRow['stockid'] . ' - ' . $RequirementsRow['description'] . '</td>'; + } else { + echo '<tr><td class="notavailable">' . _('Auto Issue') . '<td class="notavailable">' .$RequirementsRow['stockid'] . ' - ' . $RequirementsRow['description'] .'</td>'; + } + $IssuedAlreadyResult = DB_query("SELECT SUM(-qty) FROM stockmoves + WHERE stockmoves.type=28 + AND stockid='" . $RequirementsRow['stockid'] . "' + AND reference='" . $_POST['WO'] . "'", + $db); + $IssuedAlreadyRow = DB_fetch_row($IssuedAlreadyResult); - echo '<td class=number>' . number_format($WORow['qtyreqd']*$RequirementsRow['qtypu'],$RequirementsRow['decimalplaces']) . '</td> - <td class=number>' . number_format($IssuedAlreadyRow[0],$RequirementsRow['decimalplaces']) . '</td></tr>'; - } + echo '<td class=number>' . number_format($WORow['qtyreqd']*$RequirementsRow['qtypu'],$RequirementsRow['decimalplaces']) . '</td> + <td class=number>' . number_format($IssuedAlreadyRow[0],$RequirementsRow['decimalplaces']) . '</td></tr>'; + } - echo '</table>'; + echo '</table><br />'; + $SQL="SELECT categoryid, + categorydescription + FROM stockcategory + WHERE stocktype='F' OR stocktype='D' + ORDER BY categorydescription"; + $result1 = DB_query($SQL,$db); - echo '<hr>'; + echo '<table class=selection><tr><td>' . _('Select a stock category') . ':<select name="StockCat">'; - $SQL="SELECT categoryid, - categorydescription - FROM stockcategory - WHERE stocktype='F' OR stocktype='D' - ORDER BY categorydescription"; - $result1 = DB_query($SQL,$db); + if (!isset($_POST['StockCat'])){ + echo "<option selected VALUE='All'>" . _('All'); + $_POST['StockCat'] ='All'; + } else { + echo "<option VALUE='All'>" . _('All'); + } - echo '<table><tr><td><font size=2>' . _('Select a stock category') . ':</font><select name="StockCat">'; + while ($myrow1 = DB_fetch_array($result1)) { - if (!isset($_POST['StockCat'])){ - echo "<option selected VALUE='All'>" . _('All'); - $_POST['StockCat'] ='All'; - } else { - echo "<option VALUE='All'>" . _('All'); - } + if ($_POST['StockCat']==$myrow1['categoryid']){ + echo '<option selected VALUE=' . $myrow1['categoryid'] . '>' . $myrow1['categorydescription']; + } else { + echo '<option VALUE='. $myrow1['categoryid'] . '>' . $myrow1['categorydescription']; + } + } + ?> - while ($myrow1 = DB_fetch_array($result1)) { + </select> + <td><?php echo _('Enter text extracts in the'); ?> <b><?php echo _('description'); ?></b>:</td> + <td><input type="Text" name="Keywords" size=20 maxlength=25 VALUE="<?php if (isset($_POST['Keywords'])) echo $_POST['Keywords']; ?>"></td></tr> + <tr><td></td> + <td><font SIZE 3><b><?php echo _('OR'); ?> </b></font><?php echo _('Enter extract of the'); ?> <b><?php echo _('Stock Code'); ?></b>:</td> + <td><input type="Text" name="StockCode" size=15 maxlength=18 VALUE="<?php if (isset($_POST['StockCode'])) echo $_POST['StockCode']; ?>"></td> + </tr> + </table> + <br /><div class="centre"><input type=submit name="Search" VALUE="<?php echo _('Search Now'); ?>"> - if ($_POST['StockCat']==$myrow1['categoryid']){ - echo '<option selected VALUE=' . $myrow1['categoryid'] . '>' . $myrow1['categorydescription']; - } else { - echo '<option VALUE='. $myrow1['categoryid'] . '>' . $myrow1['categorydescription']; - } - } - ?> + <script language='JavaScript' type='text/javascript'> - </select> - <td><font size=2><?php echo _('Enter text extracts in the'); ?> <b><?php echo _('description'); ?></b>:</font></td> - <td><input type="Text" name="Keywords" size=20 maxlength=25 VALUE="<?php if (isset($_POST['Keywords'])) echo $_POST['Keywords']; ?>"></td></tr> - <tr><td></td> - <td><font SIZE 3><b><?php echo _('OR'); ?> </b></font><font size=2><?php echo _('Enter extract of the'); ?> <b><?php echo _('Stock Code'); ?></b>:</font></td> - <td><input type="Text" name="StockCode" size=15 maxlength=18 VALUE="<?php if (isset($_POST['StockCode'])) echo $_POST['StockCode']; ?>"></td> - </tr> - </table> - <div class="centre"><input type=submit name="Search" VALUE="<?php echo _('Search Now'); ?>"> + document.forms[0].StockCode.select(); + document.forms[0].StockCode.focus(); - <script language='JavaScript' type='text/javascript'> + </script> - document.forms[0].StockCode.select(); - document.forms[0].StockCode.focus(); + <?php + echo '</div>'; - </script> + if (isset($SearchResult)) { - <?php - echo '</div>'; + if (DB_num_rows($SearchResult)>1){ - if (isset($SearchResult)) { + echo '<br /><table cellpadding=2 colspan=7 class=selection>'; + $TableHeader = '<tr><th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Units') . '</th></tr>'; + echo $TableHeader; + $j = 1; + $k=0; //row colour counter + $ItemCodes = array(); - if (DB_num_rows($SearchResult)>1){ + while ($myrow=DB_fetch_array($SearchResult)) { - echo '<table cellpadding=2 colspan=7 BORDER=1>'; - $TableHeader = '<tr><th>' . _('Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Units') . '</th></tr>'; - echo $TableHeader; - $j = 1; - $k=0; //row colour counter - $ItemCodes = array(); - for ($i=1;$i<=$NumberOfOutputs;$i++){ - $ItemCodes[] =$_POST['OutputItem'.$i]; - } + if (!in_array($myrow['stockid'],$ItemCodes)){ + if (function_exists('imagecreatefrompng') ){ + $ImageSource = '<IMG SRC="GetStockImage.php?SID&automake=1&textcolor=FFFFFF&bgcolor=CCCCCC&StockID=' . urlencode($myrow['stockid']). '&text=&width=64&height=64">'; + } else { + if(file_exists($_SERVER['DOCUMENT_ROOT'] . $rootpath. '/' . $_SESSION['part_pics_dir'] . '/' .... [truncated message content] |
From: <tim...@us...> - 2010-09-29 16:21:33
|
Revision: 3832 http://web-erp.svn.sourceforge.net/web-erp/?rev=3832&view=rev Author: tim_schofield Date: 2010-09-29 16:21:25 +0000 (Wed, 29 Sep 2010) Log Message: ----------- SQL quoting corrections and layout changes and improvements Modified Paths: -------------- trunk/WorkOrderReceive.php trunk/doc/Change.log.html Modified: trunk/WorkOrderReceive.php =================================================================== --- trunk/WorkOrderReceive.php 2010-09-29 10:56:03 UTC (rev 3831) +++ trunk/WorkOrderReceive.php 2010-09-29 16:21:25 UTC (rev 3832) @@ -11,41 +11,44 @@ echo '<a href="'. $rootpath . '/SelectWorkOrder.php?' . SID . '">' . _('Back to Work Orders'). '</a><br>'; echo '<a href="'. $rootpath . '/WorkOrderCosting.php?' . SID . '&WO=' . $_REQUEST['WO'] . '">' . _('Back to Costing'). '</a><br>'; +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/group_add.png" title="' . + _('Search') . '" alt="">' . ' ' . $title.'</p'; + echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; if (!isset($_REQUEST['WO']) OR !isset($_REQUEST['StockID'])) { - /* This page can only be called with a purchase order number for invoicing*/ - echo '<div class="centre"><a href="' . $rootpath . '/SelectWorkOrder.php?' . SID . '">'. - _('Select a work order to receive').'</a></div>'; - prnMsg(_('This page can only be opened if a work order has been selected. Please select a work order to receive first'),'info'); - include ('includes/footer.inc'); - exit; + /* This page can only be called with a purchase order number for invoicing*/ + echo '<div class="centre"><a href="' . $rootpath . '/SelectWorkOrder.php?' . SID . '">'. + _('Select a work order to receive').'</a></div>'; + prnMsg(_('This page can only be opened if a work order has been selected. Please select a work order to receive first'),'info'); + include ('includes/footer.inc'); + exit; } else { - echo '<input type="hidden" name="WO" value=' .$_REQUEST['WO'] . '>'; - $_POST['WO']=$_REQUEST['WO']; - echo '<input type="hidden" name="StockID" value=' .$_REQUEST['StockID'] . '>'; - $_POST['StockID']=$_REQUEST['StockID']; + echo '<input type="hidden" name="WO" value=' .$_REQUEST['WO'] . '>'; + $_POST['WO']=$_REQUEST['WO']; + echo '<input type="hidden" name="StockID" value=' .$_REQUEST['StockID'] . '>'; + $_POST['StockID']=$_REQUEST['StockID']; } if (isset($_POST['Process'])){ //user hit the process the work order receipts entered. - $InputError = false; //ie assume no problems for a start - ever the optimist - $ErrMsg = _('Could not retrieve the details of the selected work order item'); - $WOResult = DB_query("SELECT workorders.loccode, - locations.locationname, - workorders.requiredby, - workorders.startdate, - workorders.closed, - stockmaster.description, - stockmaster.controlled, - stockmaster.serialised, - stockmaster.decimalplaces, - stockmaster.units, - woitems.qtyreqd, - woitems.qtyrecd, - woitems.stdcost, - stockcategory.wipact, - stockcategory.stockact + $InputError = false; //ie assume no problems for a start - ever the optimist + $ErrMsg = _('Could not retrieve the details of the selected work order item'); + $WOResult = DB_query("SELECT workorders.loccode, + locations.locationname, + workorders.requiredby, + workorders.startdate, + workorders.closed, + stockmaster.description, + stockmaster.controlled, + stockmaster.serialised, + stockmaster.decimalplaces, + stockmaster.units, + woitems.qtyreqd, + woitems.qtyrecd, + woitems.stdcost, + stockcategory.wipact, + stockcategory.stockact FROM workorders INNER JOIN locations ON workorders.loccode=locations.loccode INNER JOIN woitems @@ -55,409 +58,414 @@ INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid WHERE woitems.stockid='" . $_POST['StockID'] . "' - AND workorders.wo=".$_POST['WO'], + AND workorders.wo='".$_POST['WO'] . "'", $db, $ErrMsg); - if (DB_num_rows($WOResult)==0){ - prnMsg(_('The selected work order item cannot be retrieved from the database'),'info'); - include('includes/footer.inc'); - exit; - } - $WORow = DB_fetch_array($WOResult); + if (DB_num_rows($WOResult)==0){ + prnMsg(_('The selected work order item cannot be retrieved from the database'),'info'); + include('includes/footer.inc'); + exit; + } + $WORow = DB_fetch_array($WOResult); - $QuantityReceived = 0; + $QuantityReceived = 0; - if($WORow['controlled']==1){ //controlled - if ($WORow['serialised']==1){ //serialised - for ($i=0;$i<$_POST['CountOfInputs'];$i++){ - if ($_SESSION['DefineControlledOnWOEntry']==1){ + if($WORow['controlled']==1){ //controlled + if ($WORow['serialised']==1){ //serialised + for ($i=0;$i<$_POST['CountOfInputs'];$i++){ + if ($_SESSION['DefineControlledOnWOEntry']==1){ if (isset($_POST['CheckItem' . $i])){ $QuantityReceived ++; - } + } } else { //not predefined serial numbers if (strlen($_POST['SerialNo' . $i])>0){ $QuantityReceived ++; } } - } - } else { //controlled but not serialised - just lot/batch control - for ($i=0;$i<15;$i++){ - if (strlen($_POST['BatchRef' . $i])>0){ - $QuantityReceived += $_POST['Qty' .$i]; - } - } - } //end of lot/batch control - } else { //not controlled - an easy one! + } + } else { //controlled but not serialised - just lot/batch control + for ($i=0;$i<15;$i++){ + if (strlen($_POST['BatchRef' . $i])>0){ + $QuantityReceived += $_POST['Qty' .$i]; + } + } + } //end of lot/batch control + } else { //not controlled - an easy one! if (!is_numeric($_POST['Qty'])){ $InputError=true; prnMsg(_('The quantity entered is not numeric - a number is expected'),'error'); } else { - $QuantityReceived = $_POST['Qty']; + $QuantityReceived = $_POST['Qty']; } - } + } - if ($QuantityReceived + $WORow['qtyrecd'] > $WORow['qtyreqd'] *(1+$_SESSION['OverReceiveProportion'])){ - prnMsg(_('The quantity received is greater than the quantity required even after allowing for the configured allowable over-receive proportion. If this is correct then the work order must be modified first.'),'error'); - $InputError=true; - } + if ($QuantityReceived + $WORow['qtyrecd'] > $WORow['qtyreqd'] *(1+$_SESSION['OverReceiveProportion'])){ + prnMsg(_('The quantity received is greater than the quantity required even after allowing for the configured allowable over-receive proportion. If this is correct then the work order must be modified first.'),'error'); + $InputError=true; + } - if ($WORow['serialised']==1){ - /* serialised items form has a possible $_POST['CountOfInputs'] fields for entry of serial numbers - 12 rows x 5 per row + if ($WORow['serialised']==1){ + /* serialised items form has a possible $_POST['CountOfInputs'] fields for entry of serial numbers - 12 rows x 5 per row * if serial numbers are defined at the time of work order entry $_SESSION['DefineControlledOnWOEntry']==1 then possibly more * need to inspect $_POST['CountOfInputs'] */ - for($i=0;$i<$_POST['CountOfInputs'];$i++){ - //need to test if the serialised item exists first already - if (trim($_POST['SerialNo' .$i]) != "" AND ($_SESSION['DefineControlledOnWOEntry']==0 + for($i=0;$i<$_POST['CountOfInputs'];$i++){ + //need to test if the serialised item exists first already + if (trim($_POST['SerialNo' .$i]) != "" AND ($_SESSION['DefineControlledOnWOEntry']==0 OR ($_SESSION['DefineControlledOnWOEntry']==1 AND $_POST['CheckedItem'.$i]==true))){ - $SQL = "SELECT COUNT(*) FROM stockserialitems - WHERE stockid='" . $_POST['StockID'] . "' - AND loccode = '" . $_POST['IntoLocation'] . "' - AND serialno = '" . $_POST['SerialNo' .$i] . "'"; - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Could not check if a serial number for the stock item already exists because'); - $DbgMsg = _('The following SQL to test for an already existing serialised stock item was used'); - $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); - $AlreadyExistsRow = DB_fetch_row($Result); + $SQL = "SELECT COUNT(*) FROM stockserialitems + WHERE stockid='" . $_POST['StockID'] . "' + AND loccode = '" . $_POST['IntoLocation'] . "' + AND serialno = '" . $_POST['SerialNo' .$i] . "'"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Could not check if a serial number for the stock item already exists because'); + $DbgMsg = _('The following SQL to test for an already existing serialised stock item was used'); + $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); + $AlreadyExistsRow = DB_fetch_row($Result); - if ($AlreadyExistsRow[0]>0){ - prnMsg(_('The serial number entered already exists. Duplicate serial numbers are prohibited. The duplicate item is:') . ' ' . $_POST['SerialNo'.$i] ,'error'); - $InputError = true; - } - } - } //end loop throught the 60 fields for serial number entry - }//end check on pre-existing serial numbered items + if ($AlreadyExistsRow[0]>0){ + prnMsg(_('The serial number entered already exists. Duplicate serial numbers are prohibited. The duplicate item is:') . ' ' . $_POST['SerialNo'.$i] ,'error'); + $InputError = true; + } + } + } //end loop throught the 60 fields for serial number entry + }//end check on pre-existing serial numbered items - if ($_SESSION['ProhibitNegativeStock']==1){ - /*Now look for autoissue components that would go negative */ - $SQL = "SELECT worequirements.stockid, - stockmaster.description, - locstock.quantity-(" . $QuantityReceived . "*worequirements.qtypu) AS qtyleft - FROM worequirements - INNER JOIN stockmaster - ON worequirements.stockid=stockmaster.stockid - INNER JOIN locstock - ON worequirements.stockid=locstock.stockid - WHERE worequirements.wo=" . $_POST['WO'] . " - AND worequirements.parentstockid='" .$_POST['StockID'] . "' - AND locstock.loccode='" . $WORow['loccode'] . "' - AND stockmaster.mbflag <>'D' - AND worequirements.autoissue=1"; + if ($_SESSION['ProhibitNegativeStock']==1){ + /*Now look for autoissue components that would go negative */ + $SQL = "SELECT worequirements.stockid, + stockmaster.description, + locstock.quantity-(" . $QuantityReceived . "*worequirements.qtypu) AS qtyleft + FROM worequirements + INNER JOIN stockmaster + ON worequirements.stockid=stockmaster.stockid + INNER JOIN locstock + ON worequirements.stockid=locstock.stockid + WHERE worequirements.wo='" . $_POST['WO'] . "' + AND worequirements.parentstockid='" .$_POST['StockID'] . "' + AND locstock.loccode='" . $WORow['loccode'] . "' + AND stockmaster.mbflag <>'D' + AND worequirements.autoissue=1"; - $ErrMsg = _('Could not retrieve the component quantity left at the location once the component items are issued to the work order (for the purposes of checking that stock will not go negative) because'); - $Result = DB_query($SQL,$db,$ErrMsg); - while ($NegRow = DB_fetch_array($Result)){ - if ($NegRow['qtyleft']<0){ - prnMsg(_('Receiving the selected quantity against this work order would result in negative stock for a component. The system parameters are set to prohibit negative stocks from occurring. This manufacturing receipt cannot be created until the stock on hand is corrected.'),'error',_('Component') . ' - ' .$NegRow['component'] . ' ' . $NegRow['description'] . ' - ' . _('Negative Stock Prohibited')); - $InputError = true; - } // end if negative would result - } //loop around the autoissue requirements for the work order - } + $ErrMsg = _('Could not retrieve the component quantity left at the location once the component items are issued to the work order (for the purposes of checking that stock will not go negative) because'); + $Result = DB_query($SQL,$db,$ErrMsg); + while ($NegRow = DB_fetch_array($Result)){ + if ($NegRow['qtyleft']<0){ + prnMsg(_('Receiving the selected quantity against this work order would result in negative stock for a component. The system parameters are set to prohibit negative stocks from occurring. This manufacturing receipt cannot be created until the stock on hand is corrected.'),'error',_('Component') . ' - ' .$NegRow['component'] . ' ' . $NegRow['description'] . ' - ' . _('Negative Stock Prohibited')); + $InputError = true; + } // end if negative would result + } //loop around the autoissue requirements for the work order + } - if ($InputError==false){ + if ($InputError==false){ /************************ BEGIN SQL TRANSACTIONS ************************/ - $Result = DB_Txn_Begin($db); - /*Now Get the next WOReceipt transaction type 26 - function in SQL_CommonFunctions*/ - $WOReceiptNo = GetNextTransNo(26, $db); + $Result = DB_Txn_Begin($db); + /*Now Get the next WOReceipt transaction type 26 - function in SQL_CommonFunctions*/ + $WOReceiptNo = GetNextTransNo(26, $db); - $PeriodNo = GetPeriod(Date($_SESSION['DefaultDateFormat']), $db); - $SQLReceivedDate = FormatDateForSQL($_POST['ReceivedDate']); - $StockGLCode = GetStockGLCode($_POST['StockID'],$db); + $PeriodNo = GetPeriod(Date($_SESSION['DefaultDateFormat']), $db); - //Recalculate the standard for the item if there were no items previously received against the work order - if ($WORow['qtyrecd']==0){ - $CostResult = DB_query("SELECT SUM((materialcost+labourcost+overheadcost)*bom.quantity) AS cost - FROM stockmaster INNER JOIN bom - ON stockmaster.stockid=bom.component - WHERE bom.parent='" . $_POST['StockID'] . "' - AND bom.loccode='" . $WORow['loccode'] . "'", - $db); - $CostRow = DB_fetch_row($CostResult); - if (is_null($CostRow[0]) OR $CostRow[0]==0){ - $Cost =0; - } else { - $Cost = $CostRow[0]; - } - //Need to refresh the worequirments with the bom components now incase they changed - $DelWORequirements = DB_query("DELETE FROM worequirements - WHERE wo=" . $_POST['WO'] . " - AND parentstockid='" . $_POST['StockID'] . "'", - $db); + if (!isset($_POST['ReceivedDate'])){ + $_POST['ReceivedDate'] = Date($_SESSION['DefaultDateFormat']); + } + $SQLReceivedDate = FormatDateForSQL($_POST['ReceivedDate']); + $StockGLCode = GetStockGLCode($_POST['StockID'],$db); + + //Recalculate the standard for the item if there were no items previously received against the work order + if ($WORow['qtyrecd']==0){ + $CostResult = DB_query("SELECT SUM((materialcost+labourcost+overheadcost)*bom.quantity) AS cost + FROM stockmaster INNER JOIN bom + ON stockmaster.stockid=bom.component + WHERE bom.parent='" . $_POST['StockID'] . "' + AND bom.loccode='" . $WORow['loccode'] . "'", + $db); + $CostRow = DB_fetch_row($CostResult); + if (is_null($CostRow[0]) OR $CostRow[0]==0){ + $Cost =0; + } else { + $Cost = $CostRow[0]; + } + //Need to refresh the worequirments with the bom components now incase they changed + $DelWORequirements = DB_query("DELETE FROM worequirements + WHERE wo='" . $_POST['WO'] . "' + AND parentstockid='" . $_POST['StockID'] . "'", + $db); + //Recursively insert real component requirements WoRealRequirements($db, $_POST['WO'], $WORow['loccode'], $_POST['StockID']); - //Need to check this against the current standard cost and do a cost update if necessary - $sql = "SELECT materialcost+labourcost+overheadcost AS cost, - sum(quantity) AS totalqoh, + //Need to check this against the current standard cost and do a cost update if necessary + $sql = "SELECT materialcost+labourcost+overheadcost AS cost, + sum(quantity) AS totalqoh, labourcost, - overheadcost - FROM stockmaster INNER JOIN locstock - ON stockmaster.stockid=locstock.stockid - WHERE stockmaster.stockid='" . $_POST['StockID'] . "' - GROUP BY - materialcost, - labourcost, - overheadcost"; - $ItemResult = DB_query($sql,$db); - $ItemCostRow = DB_fetch_array($ItemResult); + overheadcost + FROM stockmaster INNER JOIN locstock + ON stockmaster.stockid=locstock.stockid + WHERE stockmaster.stockid='" . $_POST['StockID'] . "' + GROUP BY + materialcost, + labourcost, + overheadcost"; + $ItemResult = DB_query($sql,$db); + $ItemCostRow = DB_fetch_array($ItemResult); - if (($Cost + $ItemCostRow['labourcost'] + $ItemCostRow['overheadcost']) != $ItemCostRow['cost']){ //the cost roll-up cost <> standard cost + if (($Cost + $ItemCostRow['labourcost'] + $ItemCostRow['overheadcost']) != $ItemCostRow['cost']){ //the cost roll-up cost <> standard cost - if ($_SESSION['CompanyRecord']['gllink_stock']==1 AND $ItemCostRow['totalqoh']!=0){ + if ($_SESSION['CompanyRecord']['gllink_stock']==1 AND $ItemCostRow['totalqoh']!=0){ - $CostUpdateNo = GetNextTransNo(35, $db); - $PeriodNo = GetPeriod(Date($_SESSION['DefaultDateFormat']), $db); + $CostUpdateNo = GetNextTransNo(35, $db); + $PeriodNo = GetPeriod(Date($_SESSION['DefaultDateFormat']), $db); - $ValueOfChange = $ItemCostRow['totalqoh'] * (($Cost + $ItemCostRow['labourcost'] + $ItemCostRow['overheadcost']) - $ItemCostRow['cost']); + $ValueOfChange = $ItemCostRow['totalqoh'] * (($Cost + $ItemCostRow['labourcost'] + $ItemCostRow['overheadcost']) - $ItemCostRow['cost']); - $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES (35, - " . $CostUpdateNo . ", - '" . Date('Y-m-d') . "', - " . $PeriodNo . ", - " . $StockGLCode['adjglact'] . ", - '" . _('Cost roll on release of WO') . ': ' . $_POST['WO'] . ' - ' . $_POST['StockID'] . ' ' . _('cost was') . ' ' . $ItemCostRow['cost'] . ' ' . _('changed to') . ' ' . $Cost . ' x ' . _('Quantity on hand of') . ' ' . $ItemCostRow['totalqoh'] . "', - " . (-$ValueOfChange) . ")"; + $SQL = "INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (35, + '" . $CostUpdateNo . "', + '" . Date('Y-m-d') . "', + '" . $PeriodNo . "', + '" . $StockGLCode['adjglact'] . "', + '" . _('Cost roll on release of WO') . ': ' . $_POST['WO'] . ' - ' . $_POST['StockID'] . ' ' . _('cost was') . ' ' . $ItemCostRow['cost'] . ' ' . _('changed to') . ' ' . $Cost . ' x ' . _('Quantity on hand of') . ' ' . $ItemCostRow['totalqoh'] . "', + '" . (-$ValueOfChange) . "')"; - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GL credit for the stock cost adjustment posting could not be inserted because'); - $DbgMsg = _('The following SQL to insert the GLTrans record was used'); - $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GL credit for the stock cost adjustment posting could not be inserted because'); + $DbgMsg = _('The following SQL to insert the GLTrans record was used'); + $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); - $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES (35, - " . $CostUpdateNo . ", - '" . Date('Y-m-d') . "', - " . $PeriodNo . ", - " . $StockGLCode['stockact'] . ", - '" . _('Cost roll on release of WO') . ': ' . $_POST['WO'] . ' - ' . $_POST['StockID'] . ' ' . _('cost was') . ' ' . $ItemCostRow['cost'] . ' ' . _('changed to') . ' ' . $Cost . ' x ' . _('Quantity on hand of') . ' ' . $ItemCostRow['totalqoh'] . "', - " . $ValueOfChange . ")"; + $SQL = "INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (35, + '" . $CostUpdateNo . "', + '" . Date('Y-m-d') . "', + '" . $PeriodNo . "', + '" . $StockGLCode['stockact'] . "', + '" . _('Cost roll on release of WO') . ': ' . $_POST['WO'] . ' - ' . $_POST['StockID'] . ' ' . _('cost was') . ' ' . $ItemCostRow['cost'] . ' ' . _('changed to') . ' ' . $Cost . ' x ' . _('Quantity on hand of') . ' ' . $ItemCostRow['totalqoh'] . "', + '" . $ValueOfChange . "')"; - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GL debit for stock cost adjustment posting could not be inserted because'); - $DbgMsg = _('The following SQL to insert the GLTrans record was used'); - $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); - } + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GL debit for stock cost adjustment posting could not be inserted because'); + $DbgMsg = _('The following SQL to insert the GLTrans record was used'); + $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); + } - $SQL = "UPDATE stockmaster SET - materialcost=" . $Cost . ", - labourcost=" . $ItemCostRow['labourcost'] . ", - overheadcost=" . $ItemCostRow['overheadcost'] . ", - lastcost=" . $ItemCostRow['cost'] . " - WHERE stockid='" . $_POST['StockID'] . "'"; + $SQL = "UPDATE stockmaster SET + materialcost='" . $Cost . "', + labourcost='" . $ItemCostRow['labourcost'] . "', + overheadcost='" . $ItemCostRow['overheadcost'] . "', + lastcost='" . $ItemCostRow['cost'] . "' + WHERE stockid='" . $_POST['StockID'] . "'"; - $ErrMsg = _('The cost details for the stock item could not be updated because'); - $DbgMsg = _('The SQL that failed was'); - $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); - } //cost as rolled up now <> current standard cost so do adjustments - } //qty recd previously was 0 so need to check costs and do adjustments as required + $ErrMsg = _('The cost details for the stock item could not be updated because'); + $DbgMsg = _('The SQL that failed was'); + $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); + } //cost as rolled up now <> current standard cost so do adjustments + } //qty recd previously was 0 so need to check costs and do adjustments as required - //Do the issues for autoissue components in the worequirements table - $AutoIssueCompsResult = DB_query("SELECT worequirements.stockid, - qtypu, - materialcost+labourcost+overheadcost AS cost, - stockcategory.stockact, - stockcategory.stocktype - FROM worequirements - INNER JOIN stockmaster - ON worequirements.stockid=stockmaster.stockid - INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE wo=" . $_POST['WO'] . " - AND parentstockid='" .$_POST['StockID'] . "' - AND autoissue=1", - $db); + //Do the issues for autoissue components in the worequirements table + $AutoIssueCompsResult = DB_query("SELECT worequirements.stockid, + qtypu, + materialcost+labourcost+overheadcost AS cost, + stockcategory.stockact, + stockcategory.stocktype + FROM worequirements + INNER JOIN stockmaster + ON worequirements.stockid=stockmaster.stockid + INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE wo='" . $_POST['WO'] . "' + AND parentstockid='" .$_POST['StockID'] . "' + AND autoissue=1", + $db); - $WOIssueNo = GetNextTransNo(28,$db); - while ($AutoIssueCompRow = DB_fetch_array($AutoIssueCompsResult)){ + $WOIssueNo = GetNextTransNo(28,$db); + while ($AutoIssueCompRow = DB_fetch_array($AutoIssueCompsResult)){ - //Note that only none-controlled items can be auto-issuers so don't worry about serial nos and batches of controlled ones - /*Cost variances calculated overall on close of the work orders so NO need to check if cost of component has been updated subsequent to the release of the WO - */ - if ($AutoIssueCompRow['stocktype']!='L'){ - //Need to get the previous locstock quantity for the component at the location where the WO manuafactured - $CompQOHResult = DB_query("SELECT locstock.quantity - FROM locstock - WHERE locstock.stockid='" . $AutoIssueCompRow['stockid'] . "' - AND loccode= '" . $WORow['loccode'] . "'", - $db); - if (DB_num_rows($CompQOHResult)==1){ - $LocQtyRow = DB_fetch_row($CompQOHResult); - $NewQtyOnHand = $LocQtyRow[0] - ($AutoIssueCompRow['qtypu'] * $QuantityReceived); - } else { - /*There must actually be some error this should never happen */ - $NewQtyOnHand = 0; - } + //Note that only none-controlled items can be auto-issuers so don't worry about serial nos and batches of controlled ones + /*Cost variances calculated overall on close of the work orders so NO need to check if cost of component has been updated subsequent to the release of the WO + */ + if ($AutoIssueCompRow['stocktype']!='L'){ + //Need to get the previous locstock quantity for the component at the location where the WO manuafactured + $CompQOHResult = DB_query("SELECT locstock.quantity + FROM locstock + WHERE locstock.stockid='" . $AutoIssueCompRow['stockid'] . "' + AND loccode= '" . $WORow['loccode'] . "'", + $db); + if (DB_num_rows($CompQOHResult)==1){ + $LocQtyRow = DB_fetch_row($CompQOHResult); + $NewQtyOnHand = $LocQtyRow[0] - ($AutoIssueCompRow['qtypu'] * $QuantityReceived); + } else { + /*There must actually be some error this should never happen */ + $NewQtyOnHand = 0; + } - $SQL = "UPDATE locstock - SET quantity = quantity - " . ($AutoIssueCompRow['qtypu'] * $QuantityReceived). " - WHERE locstock.stockid = '" . $AutoIssueCompRow['stockid'] . "' - AND loccode = '" . $WORow['loccode'] . "'"; + $SQL = "UPDATE locstock + SET quantity = quantity - " . ($AutoIssueCompRow['qtypu'] * $QuantityReceived). " + WHERE locstock.stockid = '" . $AutoIssueCompRow['stockid'] . "' + AND loccode = '" . $WORow['loccode'] . "'"; - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The location stock record could not be updated by the issue of stock to the work order from an auto issue component because'); - $DbgMsg = _('The following SQL to update the location stock record was used'); - $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); - } else { - $NewQtyOnHand =0; - } - $SQL = "INSERT INTO stockmoves (stockid, - type, - transno, - loccode, - trandate, - prd, - reference, - price, - qty, - standardcost, - newqoh) - VALUES ('" . $AutoIssueCompRow['stockid'] . "', - 28, - " . $WOIssueNo . ", - '" . $WORow['loccode'] . "', - '" . Date('Y-m-d') . "', - " . $PeriodNo . ", - '" . $_POST['WO'] . "', - " . $AutoIssueCompRow['cost'] . ", - " . -($AutoIssueCompRow['qtypu'] * $QuantityReceived) . ", - " . $AutoIssueCompRow['cost'] . ", - " . $NewQtyOnHand . ")"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The location stock record could not be updated by the issue of stock to the work order from an auto issue component because'); + $DbgMsg = _('The following SQL to update the location stock record was used'); + $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); + } else { + $NewQtyOnHand =0; + } + $SQL = "INSERT INTO stockmoves (stockid, + type, + transno, + loccode, + trandate, + prd, + reference, + price, + qty, + standardcost, + newqoh) + VALUES ('" . $AutoIssueCompRow['stockid'] . "', + 28, + '" . $WOIssueNo . "', + '" . $WORow['loccode'] . "', + '" . Date('Y-m-d') . "', + '" . $PeriodNo . "', + '" . $_POST['WO'] . "', + '" . $AutoIssueCompRow['cost'] . "', + '" . -($AutoIssueCompRow['qtypu'] * $QuantityReceived) . "', + '" . $AutoIssueCompRow['cost'] . "', + '" . $NewQtyOnHand . "')"; - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('stock movement record could not be inserted for an auto-issue component because'); - $DbgMsg = _('The following SQL to insert the stock movement records was used'); - $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('stock movement record could not be inserted for an auto-issue component because'); + $DbgMsg = _('The following SQL to insert the stock movement records was used'); + $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); - //Update the workorder record with the cost issued to the work order - $SQL = "UPDATE workorders SET - costissued = costissued+" . ($AutoIssueCompRow['qtypu'] * $QuantityReceived * $AutoIssueCompRow['cost']) ." - WHERE wo=" . $_POST['WO']; - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Could not be update the work order cost for an auto-issue component because'); - $DbgMsg = _('The following SQL to update the work order cost was used'); - $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); + //Update the workorder record with the cost issued to the work order + $SQL = "UPDATE workorders SET + costissued = costissued+" . ($AutoIssueCompRow['qtypu'] * $QuantityReceived * $AutoIssueCompRow['cost']) ." + WHERE wo='" . $_POST['WO'] . "'"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Could not be update the work order cost for an auto-issue component because'); + $DbgMsg = _('The following SQL to update the work order cost was used'); + $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); - if ($_SESSION['CompanyRecord']['gllink_stock']==1 AND ($AutoIssueCompRow['qtypu'] * $QuantityReceived * $AutoIssueCompRow['cost'])!=0){ - //if GL linked then do the GL entries to DR wip and CR stock + if ($_SESSION['CompanyRecord']['gllink_stock']==1 AND ($AutoIssueCompRow['qtypu'] * $QuantityReceived * $AutoIssueCompRow['cost'])!=0){ + //if GL linked then do the GL entries to DR wip and CR stock - $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES (28, - " . $WOIssueNo . ", - '" . Date('Y-m-d') . "', - " . $PeriodNo . ", - " . $StockGLCode['wipact'] . ", - '" . $_POST['WO'] . ' - ' . $_POST['StockID'] . ' ' . _('Component') . ': ' . $AutoIssueCompRow['stockid'] . ' - ' . $QuantityReceived . ' x ' . $AutoIssueCompRow['qtypu'] . ' @ ' . number_format($AutoIssueCompRow['cost'],2) . "', - " . ($AutoIssueCompRow['qtypu'] * $QuantityReceived * $AutoIssueCompRow['cost']) . ")"; + $SQL = "INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (28, + '" . $WOIssueNo . "', + '" . Date('Y-m-d') . "', + '" . $PeriodNo . "', + '" . $StockGLCode['wipact'] . "', + '" . $_POST['WO'] . ' - ' . $_POST['StockID'] . ' ' . _('Component') . ': ' . $AutoIssueCompRow['stockid'] . ' - ' . $QuantityReceived . ' x ' . $AutoIssueCompRow['qtypu'] . ' @ ' . number_format($AutoIssueCompRow['cost'],2) . "', + '" . ($AutoIssueCompRow['qtypu'] * $QuantityReceived * $AutoIssueCompRow['cost']) . "')"; - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The WIP side of the work order issue GL posting could not be inserted because'); - $DbgMsg = _('The following SQL to insert the WO issue GLTrans record was used'); - $Result = DB_query($SQL,$db, $ErrMsg, $DbgMsg, true); + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The WIP side of the work order issue GL posting could not be inserted because'); + $DbgMsg = _('The following SQL to insert the WO issue GLTrans record was used'); + $Result = DB_query($SQL,$db, $ErrMsg, $DbgMsg, true); - $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES (28, - " . $WOIssueNo . ", - '" . Date('Y-m-d') . "', - " . $PeriodNo . ", - " . $AutoIssueCompRow['stockact'] . ", - '" . $_POST['WO'] . ' - ' . $_POST['StockID'] . ' -> ' . $AutoIssueCompRow['stockid'] . ' - ' . $QuantityReceived . ' x ' . $AutoIssueCompRow['qtypu'] . ' @ ' . number_format($AutoIssueCompRow['cost'],2) . "', - " . -($AutoIssueCompRow['qtypu'] * $QuantityReceived * $AutoIssueCompRow['cost']) . ")"; + $SQL = "INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (28, + '" . $WOIssueNo . "', + '" . Date('Y-m-d') . "', + '" . $PeriodNo . "', + '" . $AutoIssueCompRow['stockact'] . "', + '" . $_POST['WO'] . ' - ' . $_POST['StockID'] . ' -> ' . $AutoIssueCompRow['stockid'] . ' - ' . $QuantityReceived . ' x ' . $AutoIssueCompRow['qtypu'] . ' @ ' . number_format($AutoIssueCompRow['cost'],2) . "', + '" . -($AutoIssueCompRow['qtypu'] * $QuantityReceived * $AutoIssueCompRow['cost']) . "')"; - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The stock side of the work order issue GL posting could not be inserted because'); - $DbgMsg = _('The following SQL to insert the WO issue GLTrans record was used'); - $Result = DB_query($SQL,$db, $ErrMsg, $DbgMsg, true); - }//end GL-stock linked + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The stock side of the work order issue GL posting could not be inserted because'); + $DbgMsg = _('The following SQL to insert the WO issue GLTrans record was used'); + $Result = DB_query($SQL,$db, $ErrMsg, $DbgMsg, true); + }//end GL-stock linked - } //end of auto-issue loop for all components set to auto-issue + } //end of auto-issue loop for all components set to auto-issue - /* Need to get the current location quantity will need it later for the stock movement */ - $SQL = "SELECT locstock.quantity + /* Need to get the current location quantity will need it later for the stock movement */ + $SQL = "SELECT locstock.quantity FROM locstock WHERE locstock.stockid='" . $_POST['StockID'] . "' AND loccode= '" . $_POST['IntoLocation'] . "'"; - $Result = DB_query($SQL, $db); - if (DB_num_rows($Result)==1){ - $LocQtyRow = DB_fetch_row($Result); - $QtyOnHandPrior = $LocQtyRow[0]; - } else { - /*There must actually be some error this should never happen */ - $QtyOnHandPrior = 0; - } + $Result = DB_query($SQL, $db); + if (DB_num_rows($Result)==1){ + $LocQtyRow = DB_fetch_row($Result); + $QtyOnHandPrior = $LocQtyRow[0]; + } else { + /*There must actually be some error this should never happen */ + $QtyOnHandPrior = 0; + } - $SQL = "UPDATE locstock - SET quantity = locstock.quantity + " . $QuantityReceived . " - WHERE locstock.stockid = '" . $_POST['StockID'] . "' - AND loccode = '" . $_POST['IntoLocation'] . "'"; + $SQL = "UPDATE locstock + SET quantity = locstock.quantity + " . $QuantityReceived . " + WHERE locstock.stockid = '" . $_POST['StockID'] . "' + AND loccode = '" . $_POST['IntoLocation'] . "'"; - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The location stock record could not be updated because'); - $DbgMsg = _('The following SQL to update the location stock record was used'); - $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The location stock record could not be updated because'); + $DbgMsg = _('The following SQL to update the location stock record was used'); + $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); - $WOReceiptNo = GetNextTransNo(26,$db); - /*Insert stock movements - with unit cost */ + $WOReceiptNo = GetNextTransNo(26,$db); + /*Insert stock movements - with unit cost */ - $SQL = "INSERT INTO stockmoves (stockid, - type, - transno, - loccode, - trandate, - price, - prd, - reference, - qty, - standardcost, - newqoh) - VALUES ('" . $_POST['StockID'] . "', - 26, - " . $WOReceiptNo . ", - '" . $_POST['IntoLocation'] . "', - '" . Date('Y-m-d') . "', - " . $WORow['stdcost'] . ", - " . $PeriodNo . ", - '" . $_POST['WO'] . "', - " . $QuantityReceived . ", - " . $WORow['stdcost'] . ", - " . ($QtyOnHandPrior + $QuantityReceived) . ")"; + $SQL = "INSERT INTO stockmoves (stockid, + type, + transno, + loccode, + trandate, + price, + prd, + reference, + qty, + standardcost, + newqoh) + VALUES ('" . $_POST['StockID'] . "', + 26, + '" . $WOReceiptNo . "', + '" . $_POST['IntoLocation'] . "', + '" . Date('Y-m-d') . "', + '" . $WORow['stdcost'] . "', + '" . $PeriodNo . "', + '" . $_POST['WO'] . "', + '" . $QuantityReceived . "', + '" . $WORow['stdcost'] . "', + '" . ($QtyOnHandPrior + $QuantityReceived) . "')"; - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('stock movement records could not be inserted when processing the work order receipt because'); - $DbgMsg = _('The following SQL to insert the stock movement records was used'); - $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('stock movement records could not be inserted when processing the work order receipt because'); + $DbgMsg = _('The following SQL to insert the stock movement records was used'); + $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); - /*Get the ID of the StockMove... */ - $StkMoveNo = DB_Last_Insert_ID($db,'stockmoves','stkmoveno'); - /* Do the Controlled Item INSERTS HERE */ + /*Get the ID of the StockMove... */ + $StkMoveNo = DB_Last_Insert_ID($db,'stockmoves','stkmoveno'); + /* Do the Controlled Item INSERTS HERE */ - if ($WORow['controlled'] ==1){ - //the form is different for serialised items and just batch/lot controlled items - if ($WORow['serialised']==1){ - //serialised items form has a possible 60 fields for entry of serial numbers - 12 rows x 5 per row - for($i=0;$i<$_POST['CountOfInputs'];$i++){ - /* We need to add the StockSerialItem record and - The StockSerialMoves as well */ + if ($WORow['controlled'] ==1){ + //the form is different for serialised items and just batch/lot controlled items + if ($WORow['serialised']==1){ + //serialised items form has a possible 60 fields for entry of serial numbers - 12 rows x 5 per row + for($i=0;$i<$_POST['CountOfInputs'];$i++){ + /* We need to add the StockSerialItem record and + The StockSerialMoves as well */ if (trim($_POST['SerialNo' .$i]) != ""){ if ($_SESSION['DefineControlledOnWOEntry']==0 OR ($_SESSION['DefineControlledOnWOEntry']==1 AND $_POST['CheckItem'.$i]==true)){ @@ -491,7 +499,7 @@ stockid, serialno, moveqty) - VALUES (" . $StkMoveNo . ", + VALUES ('" . $StkMoveNo . "', '" . $_POST['StockID'] . "', '" . DB_escape_string($_POST['SerialNo' .$i]) . "', 1)"; @@ -502,7 +510,7 @@ if ($_SESSION['DefineControlledOnWOEntry']==1){ //need to delete the item from woserialnos $SQL = "DELETE FROM woserialnos - WHERE wo=" . $_POST['WO'] . " + WHERE wo='" . $_POST['WO'] . "' AND stockid='" . $_POST['StockID'] ."' AND serialno='" . DB_escape_string($_POST['SerialNo'.$i]) . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The predefined serial number record could not be deleted because'); @@ -511,64 +519,64 @@ } }//end prefined controlled items or not } //non blank SerialNo - } //end for all of the potential serialised fields received - } else { //the item is just batch/lot controlled not serialised - /*the form for entry of batch controlled items is only 15 possible fields */ - for($i=0;$i<$_POST['CountOfItems'];$i++){ - /* We need to add the StockSerialItem record and - The StockSerialMoves as well */ - //need to test if the batch/lot exists first already - if (trim($_POST['BatchRef' .$i]) != ""){ - $LastRef = trim($_POST['BatchRef' .$i]); - $SQL = "SELECT COUNT(*) FROM stockserialitems - WHERE stockid='" . $_POST['StockID'] . "' - AND loccode = '" . $_POST['IntoLocation'] . "' - AND serialno = '" . $_POST['BatchRef' .$i] . "'"; - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Could not check if a serial number for the stock item already exists because'); - $DbgMsg = _('The following SQL to test for an already existing serialised stock item was used'); - $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); - $AlreadyExistsRow = DB_fetch_row($Result); + } //end for all of the potential serialised fields received + } else { //the item is just batch/lot controlled not serialised + /*the form for entry of batch controlled items is only 15 possible fields */ + for($i=0;$i<$_POST['CountOfItems'];$i++){ + /* We need to add the StockSerialItem record and + The StockSerialMoves as well */ + //need to test if the batch/lot exists first already + if (trim($_POST['BatchRef' .$i]) != ""){ + $LastRef = trim($_POST['BatchRef' .$i]); + $SQL = "SELECT COUNT(*) FROM stockserialitems + WHERE stockid='" . $_POST['StockID'] . "' + AND loccode = '" . $_POST['IntoLocation'] . "' + AND serialno = '" . $_POST['BatchRef' .$i] . "'"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Could not check if a serial number for the stock item already exists because'); + $DbgMsg = _('The following SQL to test for an already existing serialised stock item was used'); + $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); + $AlreadyExistsRow = DB_fetch_row($Result); if (isset($_POST['QualityText'.$i])){ $QualityText = $_POST['QualityText'.$i]; } else { $QualityText =''; } - if ($AlreadyExistsRow[0]>0){ - $SQL = 'UPDATE stockserialitems SET quantity = quantity + ' . $_POST['Qty' . $i] . ", + if ($AlreadyExistsRow[0]>0){ + $SQL = 'UPDATE stockserialitems SET quantity = quantity + ' . $_POST['Qty' . $i] . ", qualitytext = '" . DB_escape_string($QualityText) . "' - WHERE stockid='" . $_POST['StockID'] . "' - AND loccode = '" . $_POST['IntoLocation'] . "' - AND serialno = '" . $POST['BatchRef' .$i] . "'"; - } else { - $SQL = "INSERT INTO stockserialitems (stockid, - loccode, - serialno, - quantity, + WHERE stockid='" . $_POST['StockID'] . "' + AND loccode = '" . $_POST['IntoLocation'] . "' + AND serialno = '" . $POST['BatchRef' .$i] . "'"; + } else { + $SQL = "INSERT INTO stockserialitems (stockid, + loccode, + serialno, + quantity, qualitytext) - VALUES ('" . $_POST['StockID'] . "', - '" . $_POST['IntoLocation'] . "', - '" . DB_escape_string($_POST['BatchRef' . $i]) . "', - " . $_POST['Qty'.$i] . ", + VALUES ('" . $_POST['StockID'] . "', + '" . $_POST['IntoLocation'] . "', + '" . DB_escape_string($_POST['BatchRef' . $i]) . "', + '" . $_POST['Qty'.$i] . "', '" . DB_escape_string($_POST['QualityText']) . "')"; - } - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record could not be inserted because'); - $DbgMsg = _('The following SQL to insert the serial stock item records was used'); - $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); + } + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record could not be inserted because'); + $DbgMsg = _('The following SQL to insert the serial stock item records was used'); + $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); - /** end of handle stockserialitems records */ + /** end of handle stockserialitems records */ - /** now insert the serial stock movement **/ - $SQL = "INSERT INTO stockserialmoves (stockmoveno, - stockid, - serialno, - moveqty) - VALUES (" . $StkMoveNo . ", - '" . $_POST['StockID'] . "', - '" . DB_escape_string($_POST['BatchRef'.$i]) . "', - " . $_POST['Qty'.$i] . ")"; - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock movement record could not be inserted because'); - $DbgMsg = _('The following SQL to insert the serial stock movement records was used'); - $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); + /** now insert the serial stock movement **/ + $SQL = "INSERT INTO stockserialmoves (stockmoveno, + stockid, + serialno, + moveqty) + VALUES ('" . $StkMoveNo . "', + '" . $_POST['StockID'] . "', + '" . DB_escape_string($_POST['BatchRef'.$i]) . "', + '" . $_POST['Qty'.$i] . "')"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock movement record could not be inserted because'); + $DbgMsg = _('The following SQL to insert the serial stock movement records was used'); + $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); if ($_SESSION['DefineControlledOnWOEntry']==1){ //check how many of the batch/bundle/lot has been received @@ -583,7 +591,7 @@ if ($BatchTotQtyRow[0] >= $_POST['QtyReqd'.$i]){ //need to delete the item from woserialnos $SQL = "DELETE FROM woserialnos - WHERE wo=" . $_POST['WO'] . " + WHERE wo='" . $_POST['WO'] . "' AND stockid='" . $_POST['StockID'] ."' AND serialno='" . DB_escape_string($_POST['BatchRef'.$i]) . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The predefined batch/lot/bundle record could not be deleted because'); @@ -591,92 +599,94 @@ $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); } } - }//non blank BundleRef - } //end for all of the potential batch/lot fields received - } //end of the batch controlled stuff - } //end if the woitem received here is a controlled item + }//non blank BundleRef + } //end for all of the potential batch/lot fields received + } //end of the batch controlled stuff + } //end if the woitem received here is a controlled item - /* If GLLink_Stock then insert GLTrans to debit the GL Code and credit GRN Suspense account at standard cost*/ - if ($_SESSION['CompanyRecord']['gllink_stock']==1 AND ($WORow['stdcost']*$QuantityReceived)!=0){ - /*GL integration with stock is activated so need the GL journals to make it so */ + /* If GLLink_Stock then insert GLTrans to debit the GL Code and credit GRN Suspense account at standard cost*/ + if ($_SESSION['CompanyRecord']['gllink_stock']==1 AND ($WORow['stdcost']*$QuantityReceived)!=0){ + /*GL integration with stock is activated so need the GL journals to make it so */ - /*first the debit the finished stock of the item received from the WO - the appropriate account was already retrieved into the $StockGLCode variable as the Processing code is kicked off - it is retrieved from the stock category record of the item by a function in SQL_CommonFunctions.inc*/ + /*first the debit the finished stock of the item received from the WO + the appropriate account was already retrieved into the $StockGLCode variable as the Processing code is kicked off + it is retrieved from the stock category record of the item by a function in SQL_CommonFunctions.inc*/ - $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES (26, - " . $WOReceiptNo . ", - '" . Date('Y-m-d') . "', - " . $PeriodNo . ", - " . $StockGLCode['stockact'] . ", - '" . $_POST['WO'] . " " . $_POST['StockID'] . " - " . $WORow['description'] . ' x ' . $QuantityReceived . " @ " . number_format($WORow['stdcost'],2) . "', - " . ($WORow['stdcost'] * $QuantityReceived) . ")"; + $SQL = "INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (26, + '" . $WOReceiptNo . "', + '" . Date('Y-m-d') . "', + '" . $PeriodNo . "', + '" . $StockGLCode['stockact'] . "', + '" . $_POST['WO'] . " " . $_POST['StockID'] . " - " . $WORow['description'] . ' x ' . $QuantityReceived . " @ " . number_format($WORow['stdcost'],2) . "', + '" . ($WORow['stdcost'] * $QuantityReceived) . "')"; - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The receipt of work order finished stock GL posting could not be inserted because'); - $DbgMsg = _('The following SQL to insert the work order receipt of finished items GLTrans record was used'); - $Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true); + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The receipt of work order finished stock GL posting could not be inserted because'); + $DbgMsg = _('The following SQL to insert the work order receipt of finished items GLTrans record was used'); + $Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true); - /*now the credit WIP entry*/ - $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES (26, - " . $WOReceiptNo . ", - '" . Date('Y-m-d') . "', - " . $PeriodNo . ", - " . $StockGLCode['wipact'] . ", - '" . $_POST['WO'] . " " . $_POST['StockID'] . " - " . $WORow['description'] . ' x ' . $QuantityReceived . " @ " . number_format($WORow['stdcost'],2) . "', - " . -($WORow['stdcost'] * $QuantityReceived) . ")"; + /*now the credit WIP entry*/ + $SQL = "INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (26, + '" . $WOReceiptNo . "', + '" . Date('Y-m-d') . "', + '" . $PeriodNo . "', + '" . $StockGLCode['wipact'] . "', + '" . $_POST['WO'] . " " . $_POST['StockID'] . " - " . $WORow['description'] . ' x ' . $QuantityReceived . " @ " . number_format($WORow['stdcost'],2) . "', + '" . -($WORow['stdcost'] *... [truncated message content] |