From: <dai...@us...> - 2013-03-21 07:26:02
|
Revision: 5827 http://sourceforge.net/p/web-erp/reponame/5827 Author: daintree Date: 2013-03-21 07:25:57 +0000 (Thu, 21 Mar 2013) Log Message: ----------- Arwan add tag description to GL Customer Receipts Modified Paths: -------------- trunk/CustomerReceipt.php trunk/doc/Change.log trunk/includes/DefineReceiptClass.php Modified: trunk/CustomerReceipt.php =================================================================== --- trunk/CustomerReceipt.php 2013-03-13 08:51:23 UTC (rev 5826) +++ trunk/CustomerReceipt.php 2013-03-21 07:25:57 UTC (rev 5827) @@ -917,6 +917,7 @@ <th>' . _('Customer') . '</th> <th>' . _('GL Code') . '</th> <th>' . _('Narrative') . '</th> + <th>' . _('Tag') . '</th> </tr>'; $BatchTotal = 0; @@ -933,6 +934,7 @@ <td>' . stripslashes($ReceiptItem->CustomerName) . '</td> <td>'.$ReceiptItem->GLCode.' - '.$myrow['accountname'].'</td> <td>'. stripslashes($ReceiptItem->Narrative) . '</td> + <td>'. $ReceiptItem->TagName . '</td> <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?Delete=' . $ReceiptItem->ID . '&Type=' . $_GET['Type']. '">' . _('Delete') . '</a></td> </tr>'; $BatchTotal= $BatchTotal + $ReceiptItem->Amount; @@ -1025,7 +1027,7 @@ $result=DB_query($SQL,$db); echo '<option value="0"></option>'; while ($myrow=DB_fetch_array($result)){ - if (isset($_POST['tag']) and $_POST['tag']==$myrow['tagref']){ + if (isset($_POST['tag']) AND$_POST['tag']==$myrow['tagref']){ echo '<option selected="selected" value="' . $myrow['tagref'] . '">' . $myrow['tagref'].' - ' .$myrow['tagdescription'] . '</option>'; } else { echo '<option value="' . $myrow['tagref'] . '">' . $myrow['tagref'].' - ' .$myrow['tagdescription'] . '</option>'; @@ -1179,7 +1181,7 @@ } //end if results to show } -if (isset($_SESSION['ReceiptBatch']->Items) and count($_SESSION['ReceiptBatch']->Items) > 0){ +if (isset($_SESSION['ReceiptBatch']->Items) AND count($_SESSION['ReceiptBatch']->Items) > 0){ echo '<div class="centre"> <br/> <input tabindex="13" type="submit" name="CommitBatch" value="' . _('Accept and Process Batch') . '" /> Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2013-03-13 08:51:23 UTC (rev 5826) +++ trunk/doc/Change.log 2013-03-21 07:25:57 UTC (rev 5827) @@ -1,5 +1,6 @@ webERP Change Log +21/3/13 Arwan: CustomerReceipt.php Added GL tag name for GL analysis of receipts 24/2/13 Tim Schofield: SalesGraph.php Fix syntax error, missing ; at end of line 24/2/13 Tim Schofield: CustWhereAlloc.php Fix syntax error, bad indenting, and an extra } entered because of it Modified: trunk/includes/DefineReceiptClass.php =================================================================== --- trunk/includes/DefineReceiptClass.php 2013-03-13 08:51:23 UTC (rev 5826) +++ trunk/includes/DefineReceiptClass.php 2013-03-21 07:25:57 UTC (rev 5827) @@ -56,9 +56,10 @@ Var $PayeeBankDetail; Var $ID; var $tag; + var $TagName; - function Receipt ($Amt, $Cust, $Disc, $Narr, $id, $GLCode, $PayeeBankDetail, $CustomerName, $tag){ - + function Receipt ($Amt, $Cust, $Disc, $Narr, $id, $GLCode, $PayeeBankDetail, $CustomerName, $Tag){ + global $db; /* Constructor function to add a new Receipt object with passed params */ $this->Amount =$Amt; $this->Customer = $Cust; @@ -68,7 +69,12 @@ $this->GLCode = $GLCode; $this->PayeeBankDetail=$PayeeBankDetail; $this->ID = $id; - $this->tag = $tag; + $this->tag = $Tag; + $result = DB_query("SELECT tagdescription FROM tags WHERE tagref='" . $Tag . "'",$db); + if (DB_num_rows($result)==1){ + $TagRow = DB_fetch_array($result); + $this->TagName = $TagRow['tagdescription']; + } } } |