From: <tim...@us...> - 2010-08-06 17:14:26
|
Revision: 3683 http://web-erp.svn.sourceforge.net/web-erp/?rev=3683&view=rev Author: tim_schofield Date: 2010-08-06 17:14:20 +0000 (Fri, 06 Aug 2010) Log Message: ----------- Purchase Ordering - Set the allow print flag when the order is re-authorised Modified Paths: -------------- trunk/PO_AuthoriseMyOrders.php trunk/PO_Header.php trunk/doc/Change.log.html Modified: trunk/PO_AuthoriseMyOrders.php =================================================================== --- trunk/PO_AuthoriseMyOrders.php 2010-08-02 09:54:13 UTC (rev 3682) +++ trunk/PO_AuthoriseMyOrders.php 2010-08-06 17:14:20 UTC (rev 3683) @@ -22,9 +22,10 @@ $status=$_POST['status'.$orderno]; $comment=date($_SESSION['DefaultDateFormat']).' - '._('Authorised by').' '.'<a href="mailto:'. $emailrow['email'].'">'.$_SESSION['UserID'].'</a><br>'.$_POST['comment']; - $sql="UPDATE purchorders + $sql="UPDATE purchorders SET status='".$status."', - stat_comment='".$comment."' + stat_comment='".$comment."', + allowprint=1 WHERE orderno=".$orderno; $result=DB_query($sql, $db); } @@ -33,13 +34,13 @@ /* Retrieve the purchase order header information */ -$sql='SELECT purchorders.*, +$sql='SELECT purchorders.*, suppliers.suppname, suppliers.currcode, www_users.realname, www_users.email FROM purchorders - LEFT JOIN suppliers + LEFT JOIN suppliers ON suppliers.supplierid=purchorders.supplierno LEFT JOIN www_users ON www_users.userid=purchorders.initiator @@ -59,7 +60,7 @@ echo '</tr>'; while ($myrow=DB_fetch_array($result)) { - + $authsql='SELECT authlevel FROM purchorderauth WHERE userid="'.$_SESSION['UserID'].'" AND currabrev="'.$myrow['currcode'].'"'; @@ -67,15 +68,15 @@ $authresult=DB_query($authsql, $db); $myauthrow=DB_fetch_array($authresult); $authlevel=$myauthrow['authlevel']; - + $ordervaluesql='SELECT sum(unitprice*quantityord) as ordervalue - FROM purchorderdetails + FROM purchorderdetails WHERE orderno='.$myrow['orderno']; $ordervalueresult=DB_query($ordervaluesql, $db); $myordervaluerow=DB_fetch_array($ordervalueresult); $ordervalue=$myordervaluerow['ordervalue']; - + if ($authlevel>=$ordervalue) { echo '<tr>'; echo '<td>'.$myrow['orderno'].'</td>'; Modified: trunk/PO_Header.php =================================================================== --- trunk/PO_Header.php 2010-08-02 09:54:13 UTC (rev 3682) +++ trunk/PO_Header.php 2010-08-06 17:14:20 UTC (rev 3683) @@ -86,6 +86,7 @@ '</a>'.$_POST['StatComments'].'<br>'.$_POST['statcommentscomplete']; $_SESSION['PO'.$identifier]->StatComments=$StatusComment; $_SESSION['PO'.$identifier]->Stat=$NewStatus; + $_SESSION['PO'.$identifier]->AllowPrintPO=1; } else { $OK_to_updstat=0; prnMsg( _('You do not have permission to authorise this purchase order').'.<br>'. _('This order is for').' '. @@ -148,10 +149,15 @@ if($_SESSION['ExistingOrder']!=0){ - + if ($_SESSION['PO'.$identifier]->Stat==PurchOrder::STATUS_AUTHORISED) { + $AllowPrint=1; + } else { + $AllowPrint=0; + } $SQL = "UPDATE purchorders SET status='" . $_POST['Stat']. "', - stat_comment='" . $StatusComment ."' + stat_comment='" . $StatusComment ."', + allowprint='".$AllowPrint."' WHERE purchorders.orderno =" . $_SESSION['ExistingOrder']; $ErrMsg = _('The order status could not be updated because'); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-08-02 09:54:13 UTC (rev 3682) +++ trunk/doc/Change.log.html 2010-08-06 17:14:20 UTC (rev 3683) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>06/08/10 Tim: Purchase Ordering - Set the allow print flag when the order is re-authorised</p> <p>02/08/10 Tim: DailyBankTransactions.php - Show currencies correctly when transaction is in different currency to bank currency</p> <p>30/07/10 Tim: Payments.php - Syntax error in sql statement</p> <p>28/07/10 Simon Peter Otandeka: Change locatransfers table so that recd quantity on bulk stock transfers is a double field not integer</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |