Skip to content

Commit

Permalink
Merge pull request #29 from TurboPT/master
Browse files Browse the repository at this point in the history
Pull changes from Tim and Ap.Muthu
  • Loading branch information
TurboPT authored Mar 31, 2018
2 parents e04bbd4 + e48a505 commit 0692586
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 8 deletions.
19 changes: 19 additions & 0 deletions AnalysisHorizontalIncome.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ function RelativeChange($selected_period, $previous_period) {
$_POST['SelectADifferentPeriod']='Select A Different Period';
}

if ($_POST['Period'] != '') {
$_POST['FromPeriod'] = ReportPeriod($_POST['Period'], 'From');
$_POST['ToPeriod'] = ReportPeriod($_POST['Period'], 'To');
}

include('includes/header.php');
if((!isset($_POST['FromPeriod']) AND !isset($_POST['ToPeriod'])) OR isset($_POST['SelectADifferentPeriod'])) {
echo '<p class="page_title_text"><img alt="" src="', $RootPath, '/css/', $Theme,
Expand Down Expand Up @@ -105,6 +110,20 @@ function RelativeChange($selected_period, $previous_period) {
echo '</select></td>
</tr>
<tr>
<td>
<h3>', _('OR'), '</h3>
</td>
</tr>';

if (!isset($_POST['Period'])) {
$_POST['Period'] = '';
}

echo '<tr>
<td>', _('Select Period'), ':</td>
<td>', ReportPeriodList($_POST['Period'], array('l', 't')), '</td>
</tr>
<tr>
<td>', _('Detail or summary'), ':</td>
<td><select name="Detail" required="required" title="', _('Selecting Summary will show on the totals at the account group level'), '" >
<option value="Summary">', _('Summary'), '</option>
Expand Down
24 changes: 22 additions & 2 deletions GLCashFlowsIndirect.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ function colDebitCredit($Amount) {
prnMsg(_('The period should be 12 months or less in duration. Please select an alternative period range.'), 'error');
}

if ($_POST['Period'] != '') {
$_POST['PeriodFrom'] = ReportPeriod($_POST['Period'], 'From');
$_POST['PeriodTo'] = ReportPeriod($_POST['Period'], 'To');
}

// Main code:
if(isset($_POST['PeriodFrom']) AND isset($_POST['PeriodTo']) AND $_POST['Action']!='New') {// If all parameters are set and valid, generates the report:
echo '<p class="page_title_text"><img alt="" src="', $RootPath, '/css/', $Theme,
Expand Down Expand Up @@ -779,9 +784,24 @@ function colDebitCredit($Amount) {
echo '</select>',
(!isset($_SESSION['ShowFieldHelp']) || $_SESSION['ShowFieldHelp'] ? _('Select the end of the reporting period') : ''), // If it is not set the $_SESSION['ShowFieldHelp'] parameter OR it is TRUE, shows the page help text.
'</td>
</tr>',
</tr>';

echo '<tr>
<td>
<h3>', _('OR'), '</h3>
</td>
</tr>';

if (!isset($_POST['Period'])) {
$_POST['Period'] = '';
}

echo '<tr>
<td>', _('Select Period'), ':</td>
<td>', ReportPeriodList($_POST['Period'], array('l', 't')), '</td>
</tr>';
// Show the budget for the period:
'<tr>',
echo '<tr>',
'<td><label for="ShowBudget">', _('Show the budget for the period'), '</label></td>
<td><input',($_POST['ShowBudget'] ? ' checked="checked"' : ''), ' id="ShowBudget" name="ShowBudget" type="checkbox">', // "Checked" if ShowBudget is set AND it is TRUE.
(!isset($_SESSION['ShowFieldHelp']) || $_SESSION['ShowFieldHelp'] ? _('Check this box to show the budget for the period') : ''), // If it is not set the $_SESSION['ShowFieldHelp'] parameter OR it is TRUE, shows the page help text.
Expand Down
20 changes: 20 additions & 0 deletions GLProfit_Loss.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
$_POST['SelectADifferentPeriod']='Select A Different Period';
}

if ($_POST['Period'] != '') {
$_POST['FromPeriod'] = ReportPeriod($_POST['Period'], 'From');
$_POST['ToPeriod'] = ReportPeriod($_POST['Period'], 'To');
}

if ((!isset($_POST['FromPeriod'])
AND !isset($_POST['ToPeriod']))
OR isset($_POST['SelectADifferentPeriod'])){
Expand Down Expand Up @@ -102,6 +107,21 @@
}
echo '</select></td></tr>';

echo '<tr>
<td>
<h3>', _('OR'), '</h3>
</td>
</tr>';

if (!isset($_POST['Period'])) {
$_POST['Period'] = '';
}

echo '<tr>
<td>', _('Select Period'), ':</td>
<td>', ReportPeriodList($_POST['Period'], array('l', 't')), '</td>
</tr>';

echo '<tr>
<td>' . _('Detail Or Summary').':</td>
<td><select name="Detail">
Expand Down
21 changes: 21 additions & 0 deletions GLTagProfit_Loss.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
$_POST['SelectADifferentPeriod']='Select A Different Period';
}

if ($_POST['Period'] != '') {
$_POST['FromPeriod'] = ReportPeriod($_POST['Period'], 'From');
$_POST['ToPeriod'] = ReportPeriod($_POST['Period'], 'To');
}

if ((!isset($_POST['FromPeriod']) AND !isset($_POST['ToPeriod'])) OR isset($_POST['SelectADifferentPeriod'])){

include('includes/header.php');
Expand Down Expand Up @@ -91,6 +96,22 @@
}
}
echo '</select></td></tr>';

echo '<tr>
<td>
<h3>', _('OR'), '</h3>
</td>
</tr>';

if (!isset($_POST['Period'])) {
$_POST['Period'] = '';
}

echo '<tr>
<td>', _('Select Period'), ':</td>
<td>', ReportPeriodList($_POST['Period'], array('l', 't')), '</td>
</tr>';

//Select the tag
echo '<tr>
<td>' . _('Select tag') . '</td>
Expand Down
15 changes: 10 additions & 5 deletions GLTrialBalance.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
$_POST['SelectADifferentPeriod']=_('Select A Different Period');
}

if ($_POST['Period'] != '') {
$_POST['FromPeriod'] = ReportPeriod($_POST['Period'], 'From');
$_POST['ToPeriod'] = ReportPeriod($_POST['Period'], 'To');
}

if ((! isset($_POST['FromPeriod'])
AND ! isset($_POST['ToPeriod']))
OR isset($_POST['SelectADifferentPeriod'])){
Expand Down Expand Up @@ -107,6 +112,11 @@

echo '</select></td>
</tr>
<tr>
<td>
<h3>', _('OR'), '</h3>
</td>
</tr>
<tr>
<td>' . _('Select Period') . ':</td>
<td>' . ReportPeriodList( $_POST['Period'] ) . '</td>
Expand All @@ -133,11 +143,6 @@
$FontSize = 10;
$line_height = 12;

if ($_POST['Period'] != '') {
$_POST['FromPeriod'] = ReportPeriod($_POST['Period'], 'From');
$_POST['ToPeriod'] = ReportPeriod($_POST['Period'], 'To');
}

$NumberOfMonths = $_POST['ToPeriod'] - $_POST['FromPeriod'] + 1;

$sql = "SELECT lastdate_in_period
Expand Down
20 changes: 20 additions & 0 deletions SalesGraph.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,21 @@
}
echo '</select></td></tr>';

echo '<tr>
<td>
<h3>', _('OR'), '</h3>
</td>
</tr>';

if (!isset($_POST['Period'])) {
$_POST['Period'] = '';
}

echo '<tr>
<td>', _('Select Period'), ':</td>
<td>', ReportPeriodList($_POST['Period'], array('l', 't')), '</td>
</tr>';

$AreasResult = DB_query("SELECT areacode, areadescription FROM areas ORDER BY areadescription");

if (!isset($_POST['SalesArea'])){
Expand Down Expand Up @@ -217,6 +232,11 @@
$SelectClause = 'qty';
}

if ($_POST['Period'] != '') {
$_POST['FromPeriod'] = ReportPeriod($_POST['Period'], 'From');
$_POST['ToPeriod'] = ReportPeriod($_POST['Period'], 'To');
}

$SQL = "SELECT YEAR(`lastdate_in_period`) AS year, MONTHNAME(`lastdate_in_period`) AS month
FROM `periods`
WHERE `periodno`='" . $_POST['FromPeriod'] . "' OR periodno='" . $_POST['ToPeriod'] . "'";
Expand Down
2 changes: 1 addition & 1 deletion install/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@

// Prevent the installation file from running again:
if(file_exists('../config.php') or file_exists('../Config.php')){
prnMsg(_('It seems that the system has been already installed. If you want to install again, please remove the config.php file first'),'error');
echo _('It seems that the system has been already installed. If you want to install again, please remove the config.php file first');
exit;
}
if(isset($_POST['Install'])){//confirm the final install data, the last validation step before we submit the data
Expand Down

0 comments on commit 0692586

Please sign in to comment.