! -> Note
$ -> Affected files
+16-Oct-2010 Joe Hunt
+! [0000266] Added dimension selections in Profit Loss and Balance drilldown and Trial Balance
+$ /gl/inquiry/balance_sheet.php
+ /gl/inquiry/gl_trial_balance.php
+ /gl/inquiry/profit_loss.php
+
15-Oct-2010 Joe Hunt
# [0000263] Customer Credit Note didn't update units when shifting items.
$ /sales/includes/ui/sales_credit_ui.inc
$_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"];
//----------------------------------------------------------------------------------------------------
-function display_type ($type, $typename, $from, $to, $convert, $drilldown, $path_to_root)
+function display_type ($type, $typename, $from, $to, $convert, $dimension, $dimension2, $drilldown, $path_to_root)
{
global $levelptr, $k;
- $dimension = $dimension2 = 0;
$acctstotal = 0;
$typestotal = 0;
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>";
while ($accounttype=db_fetch($result))
{
$typestotal += display_type($accounttype["id"], $accounttype["name"], $from, $to,
- $convert, $drilldown, $path_to_root);
+ $convert, $dimension, $dimension2, $drilldown, $path_to_root);
}
//Display Type Summary if total is != 0
//elseif ($drilldown && $type != $_POST["AccGrp"])
{
$url = "<a href='$path_to_root/gl/inquiry/balance_sheet.php?TransFromDate="
- . $from . "&TransToDate=" . $to
+ . $from . "&TransToDate=" . $to . "&Dimension=" . $dimension . "&Dimension2=" . $dimension2
. "&AccGrp=" . $type ."'>" . $typename ."</a>";
alt_table_row_color($k);
function inquiry_controls()
{
+ $dim = get_company_pref('use_dimension');
start_table(TABLESTYLE_NOBORDER);
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();
$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
while ($accounttype=db_fetch($typeresult))
{
$TypeTotal = display_type($accounttype["id"], $accounttype["name"], $from, $to,
- $convert, $drilldown, $path_to_root);
+ $convert, $dimension, $dimension2, $drilldown, $path_to_root);
//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['name'] ."</a>";
alt_table_row_color($k);
label_cell($url);
amount_cell($TypeTotal * $convert);
$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'");
table_section_title(get_account_type_name($_POST["AccGrp"]));
$classclose = display_type($accounttype["id"], $accounttype["name"], $from, $to,
- $convert, $drilldown, $path_to_root);
+ $convert, $dimension, $dimension2, $drilldown, $path_to_root);
}
end_table(1); // outer table
function gl_inquiry_controls()
{
+ $dim = get_company_pref('use_dimension');
start_form();
start_table(TABLESTYLE_NOBORDER);
date_cells(_("From:"), 'TransFromDate', '', null, -30);
date_cells(_("To:"), '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);
check_cells(_("No zero values"), 'NoZero', null);
check_cells(_("Only balances"), 'Balance', null);
global $path_to_root;
div_start('balance_tbl');
+ if (!isset($_POST['Dimension']))
+ $_POST['Dimension'] = 0;
+ if (!isset($_POST['Dimension2']))
+ $_POST['Dimension2'] = 0;
start_table(TABLESTYLE);
$tableheader = "<tr>
<td rowspan=2 class='tableheader'>" . _("Account") . "</td>
while ($account = db_fetch($accounts))
{
- $prev = get_balance($account["account_code"], 0, 0, $begin, $_POST['TransFromDate'], false, false);
- $curr = get_balance($account["account_code"], 0, 0, $_POST['TransFromDate'], $_POST['TransToDate'], true, true);
- $tot = get_balance($account["account_code"], 0, 0, $begin, $_POST['TransToDate'], false, true);
+ $prev = get_balance($account["account_code"], $_POST['Dimension'], $_POST['Dimension2'], $begin, $_POST['TransFromDate'], false, false);
+ $curr = get_balance($account["account_code"], $_POST['Dimension'], $_POST['Dimension2'], $_POST['TransFromDate'], $_POST['TransToDate'], true, true);
+ $tot = get_balance($account["account_code"], $_POST['Dimension'], $_POST['Dimension2'], $begin, $_POST['TransToDate'], false, true);
if (check_value("NoZero") && !$prev['balance'] && !$curr['balance'] && !$tot['balance'])
continue;
alt_table_row_color($k);
- $url = "<a href='$path_to_root/gl/inquiry/gl_account_inquiry.php?TransFromDate=" . $_POST["TransFromDate"] . "&TransToDate=" . $_POST["TransToDate"] . "&account=" . $account["account_code"] . "'>" . $account["account_code"] . "</a>";
+ $url = "<a href='$path_to_root/gl/inquiry/gl_account_inquiry.php?TransFromDate=" . $_POST["TransFromDate"] . "&TransToDate=" . $_POST["TransToDate"] . "&account=" . $account["account_code"] . "&Dimension=" . $_POST["Dimension"] . "&Dimension2=" . $_POST["Dimension2"] . "'>" . $account["account_code"] . "</a>";
label_cell($url);
label_cell($account["account_name"]);
$_POST["TransToDate"] = $_GET["TransToDate"];
if (isset($_GET["Compare"]))
$_POST["Compare"] = $_GET["Compare"];
+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 ($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>";
//elseif ($drilldown && $type != $_POST["AccGrp"])
{
$url = "<a href='$path_to_root/gl/inquiry/profit_loss.php?TransFromDate="
- . $from . "&TransToDate=" . $to . "&Compare=" . $compare
+ . $from . "&TransToDate=" . $to . "&Compare=" . $compare . "&Dimension=" . $dimension . "&Dimension2=" . $dimension2
. "&AccGrp=" . $type ."'>" . $typename ."</a>";
alt_table_row_color($k);
function inquiry_controls()
{
+ $dim = get_company_pref('use_dimension');
start_table(TABLESTYLE_NOBORDER);
date_cells(_("From:"), 'TransFromDate', '', null, -30);
echo "<td>";
echo array_selector('Compare', null, $sel);
echo "</td>\n";
+ 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();
{
global $path_to_root, $sel;
- $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'];
$from = $_POST['TransFromDate'];
$to = $_POST['TransToDate'];
if ($TypeTotal[0] != 0 || $TypeTotal[1] != 0 )
{
$url = "<a href='$path_to_root/gl/inquiry/profit_loss.php?TransFromDate="
- . $from . "&TransToDate=" . $to . "&Compare=" . $compare
+ . $from . "&TransToDate=" . $to . "&Compare=" . $compare . "&Dimension=" . $dimension . "&Dimension2=" . $dimension2
. "&AccGrp=" . $accounttype['id'] ."'>" . $accounttype['name'] ."</a>";
alt_table_row_color($k);