projects
/
fa-stable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixup commit for tag 'version_2_3_1'
[fa-stable.git]
/
gl
/
inquiry
/
balance_sheet.php
diff --git
a/gl/inquiry/balance_sheet.php
b/gl/inquiry/balance_sheet.php
index c08183d74d5a47d915d628087795c1b60ce03af9..8bf527577a2dc663f61d753e252370bc92e4f2cf 100644
(file)
--- a/
gl/inquiry/balance_sheet.php
+++ b/
gl/inquiry/balance_sheet.php
@@
-38,16
+38,19
@@
if (isset($_GET["TransFromDate"]))
$_POST["TransFromDate"] = $_GET["TransFromDate"];
if (isset($_GET["TransToDate"]))
$_POST["TransToDate"] = $_GET["TransToDate"];
$_POST["TransFromDate"] = $_GET["TransFromDate"];
if (isset($_GET["TransToDate"]))
$_POST["TransToDate"] = $_GET["TransToDate"];
+if (isset($_GET["Dimension"]))
+ $_POST["Dimension"] = $_GET["Dimension"];
+if (isset($_GET["Dimension2"]))
+ $_POST["Dimension2"] = $_GET["Dimension2"];
if (isset($_GET["AccGrp"]))
$_POST["AccGrp"] = $_GET["AccGrp"];
//----------------------------------------------------------------------------------------------------
if (isset($_GET["AccGrp"]))
$_POST["AccGrp"] = $_GET["AccGrp"];
//----------------------------------------------------------------------------------------------------
-function display_type ($type, $typename, $from, $to, $convert, $drilldown, $path_to_root)
+function display_type ($type, $typename, $from, $to, $convert, $d
imension, $dimension2, $d
rilldown, $path_to_root)
{
global $levelptr, $k;
{
global $levelptr, $k;
- $dimension = $dimension2 = 0;
$acctstotal = 0;
$typestotal = 0;
$acctstotal = 0;
$typestotal = 0;
@@
-64,7
+67,7
@@
function display_type ($type, $typename, $from, $to, $convert, $drilldown, $path
if ($drilldown && $levelptr == 0)
{
$url = "<a href='$path_to_root/gl/inquiry/gl_account_inquiry.php?TransFromDate="
if ($drilldown && $levelptr == 0)
{
$url = "<a href='$path_to_root/gl/inquiry/gl_account_inquiry.php?TransFromDate="
- . $from . "&TransToDate=" . $to
+ . $from . "&TransToDate=" . $to
. "&Dimension=" . $dimension . "&Dimension2=" . $dimension2
. "&account=" . $account['account_code'] . "'>" . $account['account_code']
." ". $account['account_name'] ."</a>";
. "&account=" . $account['account_code'] . "'>" . $account['account_code']
." ". $account['account_name'] ."</a>";
@@
-84,7
+87,7
@@
function display_type ($type, $typename, $from, $to, $convert, $drilldown, $path
while ($accounttype=db_fetch($result))
{
$typestotal += display_type($accounttype["id"], $accounttype["name"], $from, $to,
while ($accounttype=db_fetch($result))
{
$typestotal += display_type($accounttype["id"], $accounttype["name"], $from, $to,
- $convert, $d
rilldown, $path_to_root);
+ $convert, $d
imension, $dimension2, $drilldown, $path_to_root);
}
//Display Type Summary if total is != 0
}
//Display Type Summary if total is != 0
@@
-97,11
+100,16
@@
function display_type ($type, $typename, $from, $to, $convert, $drilldown, $path
amount_cell(($acctstotal + $typestotal) * $convert);
end_row();
}
amount_cell(($acctstotal + $typestotal) * $convert);
end_row();
}
- elseif ($drilldown && $type != $_POST["AccGrp"])
+ //START Patch#1 : Display only direct child types
+ $acctype1 = get_account_type($type);
+ $parent1 = $acctype1["parent"];
+ if ($drilldown && $parent1 == $_POST["AccGrp"])
+ //END Patch#2
+ //elseif ($drilldown && $type != $_POST["AccGrp"])
{
$url = "<a href='$path_to_root/gl/inquiry/balance_sheet.php?TransFromDate="
{
$url = "<a href='$path_to_root/gl/inquiry/balance_sheet.php?TransFromDate="
- . $from . "&TransToDate=" . $to
- . "&AccGrp=" . $type ."'>" . $typename ."</a>";
+ . $from . "&TransToDate=" . $to
. "&Dimension=" . $dimension . "&Dimension2=" . $dimension2
+ . "&AccGrp=" . $type ."'>" . $type
. " " . $type
name ."</a>";
alt_table_row_color($k);
label_cell($url);
alt_table_row_color($k);
label_cell($url);
@@
-114,8
+122,13
@@
function display_type ($type, $typename, $from, $to, $convert, $drilldown, $path
function inquiry_controls()
{
function inquiry_controls()
{
- start_table("class='tablestyle_noborder'");
+ $dim = get_company_pref('use_dimension');
+ start_table(TABLESTYLE_NOBORDER);
date_cells(_("As at:"), 'TransToDate');
date_cells(_("As at:"), 'TransToDate');
+ if ($dim >= 1)
+ dimensions_list_cells(_("Dimension")." 1:", 'Dimension', null, true, " ", false, 1);
+ if ($dim > 1)
+ dimensions_list_cells(_("Dimension")." 2:", 'Dimension2', null, true, " ", false, 2);
submit_cells('Show',_("Show"),'','', 'default');
end_table();
submit_cells('Show',_("Show"),'','', 'default');
end_table();
@@
-125,13
+138,17
@@
function inquiry_controls()
function display_balance_sheet()
{
function display_balance_sheet()
{
- global $
comp_path, $path_to_root, $table_style
;
+ global $
path_to_root
;
$from = begin_fiscalyear();
$to = $_POST['TransToDate'];
$from = begin_fiscalyear();
$to = $_POST['TransToDate'];
- $dim = get_company_pref('use_dimension');
- $dimension = $dimension2 = 0;
+ if (!isset($_POST['Dimension']))
+ $_POST['Dimension'] = 0;
+ if (!isset($_POST['Dimension2']))
+ $_POST['Dimension2'] = 0;
+ $dimension = $_POST['Dimension'];
+ $dimension2 = $_POST['Dimension2'];
$lconvert = $econvert = 1;
if (isset($_POST["AccGrp"]) && (strlen($_POST['AccGrp']) > 0))
$drilldown = 1; // Deeper Level
$lconvert = $econvert = 1;
if (isset($_POST["AccGrp"]) && (strlen($_POST['AccGrp']) > 0))
$drilldown = 1; // Deeper Level
@@
-140,7
+157,7
@@
function display_balance_sheet()
div_start('balance_tbl');
div_start('balance_tbl');
- start_table(
"width=30% $table_style");
+ start_table(
TABLESTYLE, "width=30%");
if (!$drilldown) //Root Level
{
if (!$drilldown) //Root Level
{
@@
-169,12
+186,13
@@
function display_balance_sheet()
while ($accounttype=db_fetch($typeresult))
{
$TypeTotal = display_type($accounttype["id"], $accounttype["name"], $from, $to,
while ($accounttype=db_fetch($typeresult))
{
$TypeTotal = display_type($accounttype["id"], $accounttype["name"], $from, $to,
- $convert, $d
rilldown, $path_to_root);
+ $convert, $d
imension, $dimension2, $drilldown, $path_to_root);
//Print Summary
if ($TypeTotal != 0 )
{
$url = "<a href='$path_to_root/gl/inquiry/balance_sheet.php?TransFromDate="
//Print Summary
if ($TypeTotal != 0 )
{
$url = "<a href='$path_to_root/gl/inquiry/balance_sheet.php?TransFromDate="
- . $from . "&TransToDate=" . $to . "&AccGrp=" . $accounttype['id'] ."'>" . $accounttype['name'] ."</a>";
+ . $from . "&TransToDate=" . $to . "&Dimension=" . $dimension . "&Dimension2=" . $dimension2
+ . "&AccGrp=" . $accounttype['id'] ."'>" . $accounttype['id']." ".$accounttype['name'] ."</a>";
alt_table_row_color($k);
label_cell($url);
amount_cell($TypeTotal * $convert);
alt_table_row_color($k);
label_cell($url);
amount_cell($TypeTotal * $convert);
@@
-207,7
+225,7
@@
function display_balance_sheet()
$calculateclose *= -1;
//Final Report Summary
$url = "<a href='$path_to_root/gl/inquiry/profit_loss.php?TransFromDate="
$calculateclose *= -1;
//Final Report Summary
$url = "<a href='$path_to_root/gl/inquiry/profit_loss.php?TransFromDate="
- . $from."&TransToDate=".$to
+ . $from."&TransToDate=".$to
. "&Dimension=" . $dimension . "&Dimension2=" . $dimension2
."&Compare=0'>"._('Calculated Return')."</a>";
start_row("class='inquirybg' style='font-weight:bold'");
."&Compare=0'>"._('Calculated Return')."</a>";
start_row("class='inquirybg' style='font-weight:bold'");
@@
-232,10
+250,10
@@
function display_balance_sheet()
$convert = get_class_type_convert($class["ctype"]);
//Print Class Name
$convert = get_class_type_convert($class["ctype"]);
//Print Class Name
- table_section_title(get_account_type_name($_POST["AccGrp"]));
+ table_section_title(
$_POST["AccGrp"]. " " .
get_account_type_name($_POST["AccGrp"]));
$classclose = display_type($accounttype["id"], $accounttype["name"], $from, $to,
$classclose = display_type($accounttype["id"], $accounttype["name"], $from, $to,
- $convert, $drilldown, $path_to_root);
+ $convert, $d
imension, $dimension2, $d
rilldown, $path_to_root);
}
end_table(1); // outer table
}
end_table(1); // outer table