[Weberp-svn] SF.net SVN: weberp:[7763] trunk
Brought to you by:
sotandeka,
tim_schofield
From: <tim...@us...> - 2011-08-15 12:29:34
|
Revision: 7763 http://weberp.svn.sourceforge.net/weberp/?rev=7763&view=rev Author: tim_schofield Date: 2011-08-15 12:29:28 +0000 (Mon, 15 Aug 2011) Log Message: ----------- New script for inquiring on general ledger journals Modified Paths: -------------- trunk/PDFGLJournal.php trunk/index.php Added Paths: ----------- trunk/GLJournalInquiry.php Added: trunk/GLJournalInquiry.php =================================================================== --- trunk/GLJournalInquiry.php (rev 0) +++ trunk/GLJournalInquiry.php 2011-08-15 12:29:28 UTC (rev 7763) @@ -0,0 +1,122 @@ +<?php + +include ('includes/session.inc'); +$title = _('General Ledger Journal Inquiry'); +include('includes/header.inc'); + +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p>'; + +if (!isset($_POST['Show'])) { + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + + echo '<table class="selection">'; + echo '<tr><th colspan="3"><font color="navy" size="2">' . _('Selection Criteria') . '</font></th></tr>'; + + $sql = "SELECT typeno FROM systypes WHERE typeid=0"; + $result = DB_query($sql, $db); + $myrow = DB_fetch_array($result); + $MaxJournalNumberUsed = $myrow['typeno']; + + echo '<tr> + <td>' . _('Journal Number Range') . ' (' . _('Between') . ' 1 ' . _('and') . ' ' . $MaxJournalNumberUsed . ')</td> + <td>' . _('From') . ':'. '<input type="text" class="number" name="NumberFrom" size="10" maxlength="11" value="1" />'.'</td> + <td>' . _('To') . ':'. '<input type="text" class="number" name="NumberTo" size="10" maxlength="11" value="' . $MaxJournalNumberUsed . '" />'.'</td> + </tr>'; + + $sql = "SELECT MIN(trandate) AS fromdate, + MAX(trandate) AS todate FROM gltrans WHERE type=0"; + $result = DB_query($sql, $db); + $myrow = DB_fetch_array($result); + $FromDate = $myrow['fromdate']; + $ToDate = $myrow['todate']; + + echo '<tr><td>' . _('Journals Dated Between') . ':</td> + <td>' . _('From') . ':'. '<input type="text" name="FromTransDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" maxlength="10" size="11" value="' . ConvertSQLDate($FromDate) . '" /></td> + <td>' . _('To') . ':'. '<input type="text" name="ToTransDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" maxlength="10" size="11" value="' . ConvertSQLDate($ToDate) . '" /></td> + </tr>'; + + echo '</table>'; + echo '<br /><div class="centre"><input type="submit" name="Show" value="' . _('Show transactions'). '" /></div>'; + echo '</form>'; +} else { + + $sql="SELECT gltrans.typeno, + gltrans.trandate, + gltrans.account, + chartmaster.accountname, + gltrans.narrative, + gltrans.amount, + gltrans.tag, + tags.tagdescription, + gltrans.jobref + FROM gltrans + INNER JOIN chartmaster + ON gltrans.account=chartmaster.accountcode + LEFT JOIN tags + ON gltrans.tag=tags.tagref + WHERE gltrans.type='0' + AND gltrans.trandate>='" . FormatDateForSQL($_POST['FromTransDate']) . "' + AND gltrans.trandate<='" . FormatDateForSQL($_POST['ToTransDate']) . "' + AND gltrans.typeno>='" . $_POST['NumberFrom'] . "' + AND gltrans.typeno<='" . $_POST['NumberTo'] . "' + ORDER BY gltrans.typeno"; + + $result = DB_query($sql, $db); + if (DB_num_rows($result)==0) { + prnMsg(_('There are no transactions for this account in the date range selected'), 'info'); + } else { + echo '<table class="selection">'; + echo '<tr> + <th>' . ('Date') . '</th> + <th>'._('Journal Number').'</th> + <th>'._('Account Code').'</th> + <th>'._('Account Description').'</th> + <th>'._('Narrative').'</th> + <th>'._('Amount').' '.$_SESSION['CompanyRecord']['currencydefault'].'</th> + <th>'._('Tag').'</th> + </tr>'; + + $LastJournal = 0; + + while ($myrow = DB_fetch_array($result)){ + + if ($myrow['tag']==0) { + $myrow['tagdescription']='None'; + } + + if ($myrow['typeno']!=$LastJournal) { + echo '<tr><td colspan="8" bgcolor="navy"></td></tr><tr> + <td>'. ConvertSQLDate($myrow['trandate']) . '</td> + <td class="number">'.$myrow['typeno'].'</td>'; + + } else { + echo '<tr><td colspan="2"></td>'; + } + + echo '<td>'.$myrow['account'].'</td> + <td>'.$myrow['accountname'].'</td> + <td>'.$myrow['narrative'] .'</td> + <td class="number">'.number_format($myrow['amount'],$_SESSION['Currencies'][$_SESSION['CompanyRecord']['currencydefault']]['DecimalPlaces']).'</td> + <td class="number">'.$myrow['tag'] . ' - ' . $myrow['tagdescription'].'</td>'; + + if ($myrow['typeno']!=$LastJournal) { + echo '<td class="number"><a href="PDFGLJournal.php?JournalNo='.$myrow['typeno'].'">'._('Print') .'</a></td></tr>'; + + $LastJournal = $myrow['typeno']; + } else { + echo '<td colspan="1"></td></tr>'; + } + + } + echo '</table>'; + } //end if no bank trans in the range to show + + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<br /><div class="centre"><input type="submit" name="Return" value="' . _('Select Another Date'). '" /></div>'; + echo '</form>'; +} +include('includes/footer.inc'); + +?> \ No newline at end of file Modified: trunk/PDFGLJournal.php =================================================================== --- trunk/PDFGLJournal.php 2011-08-15 12:29:09 UTC (rev 7762) +++ trunk/PDFGLJournal.php 2011-08-15 12:29:28 UTC (rev 7763) @@ -1,5 +1,5 @@ <?php -$PageSecurity=1; + /* $Id$*/ /* $Revision: 1.5 $ */ Modified: trunk/index.php =================================================================== --- trunk/index.php 2011-08-15 12:29:09 UTC (rev 7762) +++ trunk/index.php 2011-08-15 12:29:28 UTC (rev 7763) @@ -330,6 +330,7 @@ _('Account Inquiry'), _('Account Listing'), _('Account Listing to CSV File'), + _('General Ledger Journal Inquiry'), _('Bank Account Reconciliation Statement'), _('Cheque Payments Listing'), _('Daily Bank Transactions'), @@ -343,6 +344,7 @@ '/SelectGLAccount.php', '/GLAccountReport.php', '/GLAccountCSV.php', + '/GLJournalInquiry.php', '/BankReconciliation.php', '/PDFChequeListing.php', '/DailyBankTransactions.php', This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |