From: <dai...@us...> - 2015-05-26 09:43:59
|
Revision: 7313 http://sourceforge.net/p/web-erp/reponame/7313 Author: daintree Date: 2015-05-26 09:43:57 +0000 (Tue, 26 May 2015) Log Message: ----------- Removed SQL outside the loop to avoid unecessary round trips to the SQL server Modified Paths: -------------- trunk/SupplierInquiry.php trunk/doc/Change.log trunk/doc/Manual/ManualContributors.html Modified: trunk/SupplierInquiry.php =================================================================== --- trunk/SupplierInquiry.php 2015-05-21 21:05:18 UTC (rev 7312) +++ trunk/SupplierInquiry.php 2015-05-26 09:43:57 UTC (rev 7313) @@ -220,8 +220,16 @@ </tr> </thead><tbody>'; +$AuthSQL="SELECT offhold + FROM purchorderauth + WHERE userid='" . $_SESSION['UserID'] . "' + AND currabrev='" . $SupplierRecord['currcode']."'"; +$AuthResult=DB_query($AuthSQL); +$AuthRow=DB_fetch_array($AuthResult); + $j = 1; $k = 0;// Row colour counter. + while ($myrow=DB_fetch_array($TransResult)) { if ($myrow['hold'] == 0 AND $myrow['settled'] == 0) { @@ -282,15 +290,8 @@ $myrow['transno']); } else { - $AuthSQL="SELECT offhold - FROM purchorderauth - WHERE userid='" . $_SESSION['UserID'] . "' - AND currabrev='" . $SupplierRecord['currcode']."'"; - $AuthResult=DB_query($AuthSQL); - $AuthRow=DB_fetch_array($AuthResult); - printf($BaseTD8); - if ($AuthRow[0]==0) { + if ($AuthRow['offhold']==0) { echo '<td class="noprint"><a href="' .htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?HoldType=' . $myrow['type'] . '&HoldTrans=' . $myrow['transno']. '&HoldStatus=' . $HoldValue . '&FromDate=' . $_POST['TransAfterDate'].'">' . $HoldValue . '</a></td>'; } else { if ($HoldValue==_('Release')) { Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2015-05-21 21:05:18 UTC (rev 7312) +++ trunk/doc/Change.log 2015-05-26 09:43:57 UTC (rev 7313) @@ -1,5 +1,6 @@ webERP Change Log +25/5/15 Tom Barry: SupplierInquiry.php moved SQL to get the users authorisation to put supplier invoices on hold outside the loop to avoid unecessary round trips to the SQL server 21/5/15 RChacon: Adjust CustomerAccount.php for direct printing. 19/5/15 RChacon: Add documentation and help for users in Locations.php and ManualInventory.html. Modified: trunk/doc/Manual/ManualContributors.html =================================================================== --- trunk/doc/Manual/ManualContributors.html 2015-05-21 21:05:18 UTC (rev 7312) +++ trunk/doc/Manual/ManualContributors.html 2015-05-26 09:43:57 UTC (rev 7313) @@ -14,6 +14,8 @@ <br /> Shane Barnaby<br /> <br /> + Tom Barry<br /> + <br /> Klaus Beucher<br /> <br /> Chris Bice<br /> |