[Weberp-svn] SF.net SVN: weberp:[9482] trunk/GLJournal.php
Brought to you by:
sotandeka,
tim_schofield
From: <tim...@us...> - 2012-08-07 22:23:07
|
Revision: 9482 http://weberp.svn.sourceforge.net/weberp/?rev=9482&view=rev Author: tim_schofield Date: 2012-08-07 22:23:01 +0000 (Tue, 07 Aug 2012) Log Message: ----------- Use new link function and use new separate form to post the journal Modified Paths: -------------- trunk/GLJournal.php Modified: trunk/GLJournal.php =================================================================== --- trunk/GLJournal.php 2012-08-07 22:22:49 UTC (rev 9481) +++ trunk/GLJournal.php 2012-08-07 22:23:01 UTC (rev 9482) @@ -14,7 +14,6 @@ unset($_SESSION['JournalDetail']->GLEntries); unset($_SESSION['JournalDetail']); } - if (!isset($_SESSION['JournalDetail'])){ $_SESSION['JournalDetail'] = new Journal; @@ -44,7 +43,7 @@ $_SESSION['JournalDetail']->JournalType = $_POST['JournalType']; } -if (isset($_POST['CommitBatch'])){ +if (isset($_POST['CommitBatch']) and $_POST['CommitBatch']=='CommitBatch'){ /* once the GL analysis of the journal is entered process all the data in the session cookie into the DB @@ -80,7 +79,7 @@ $DbgMsg = _('The SQL that failed to insert the GL Trans record was'); $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); - if ($_POST['JournalType']=='Reversing'){ + if ($_SESSION['JournalDetail']->JournalType=='Reversing'){ $SQL = "INSERT INTO gltrans (type, typeno, trandate, @@ -111,7 +110,8 @@ prnMsg(_('Journal').' ' . $TransNo . ' '._('has been successfully entered'),'success'); - echo '<br /><div class="centre"><a href="PDFGLJournal.php?JournalNo='.$TransNo.'">'._('Print this Journal').'</a>'; + echo '<br /><div class="centre">'; + echo InternalLink('', 'PDFGLJournal.php?JournalNo='.$TransNo, _('Print this Journal')); unset($_POST['JournalProcessDate']); unset($_POST['JournalType']); @@ -119,7 +119,7 @@ unset($_SESSION['JournalDetail']); /*Set up a newy in case user wishes to enter another */ - echo '<br /><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?NewJournal=Yes">'._('Enter Another General Ledger Journal').'</a></div>'; + echo '<br />' . InternalLink('', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?NewJournal=Yes', _('Enter Another General Ledger Journal')).'</div>'; /*And post the journal too */ include ('includes/GLPostings.inc'); include ('includes/footer.inc'); @@ -339,6 +339,7 @@ echo '</tr></table>'; /*Close the main table */ echo '<div class="centre"><button type="submit" name="Process">' . _('Accept') . '</button></div>'; +echo '</form>'; echo '<table class="selection" width="85%">'; @@ -406,19 +407,20 @@ } echo '</table>'; +echo '<form onsubmit="return SubmitForm(this, \'\')" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post" name="form">'; +echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + if (ABS($_SESSION['JournalDetail']->JournalTotal)<0.001 AND $_SESSION['JournalDetail']->GLItemCounter > 0){ - echo '<br /><br /><div class="centre"><button type="submit" name="CommitBatch">'._('Accept and Process Journal').'</button></div>'; + echo '<br /><br /><div class="centre"><button type="submit" name="CommitBatch" value="CommitBatch">'._('Accept and Process Journal').'</button></div>'; } elseif(count($_SESSION['JournalDetail']->GLEntries)>0) { echo ''; prnMsg(_('The journal must balance ie debits equal to credits before it can be processed'),'warn'); } - +echo '</form>'; if (!isset($_GET['NewJournal']) or $_GET['NewJournal']=='') { echo '<script>defaultControl(document.form.GLManualCode);</script>'; } else { echo '<script>defaultControl(document.form.JournalProcessDate);</script>'; } - -echo '</form>'; include('includes/footer.inc'); ?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |