CHANGELOG.txt
[fa-stable.git] / gl / inquiry / balance_sheet.php
index e3f8a454fa26804848b008dbbcef4b9c3d46414d..6479ff83380ac228617143d780fa4002d639ffc3 100644 (file)
@@ -104,7 +104,6 @@ function display_type ($type, $typename, $from, $to, $convert, $dimension, $dime
                $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=" 
                                . $from . "&TransToDate=" . $to . "&Dimension=" . $dimension . "&Dimension2=" . $dimension2 
@@ -139,9 +138,9 @@ function display_balance_sheet()
 {
        global $path_to_root;
        
-       $from = begin_fiscalyear();
        $to = $_POST['TransToDate'];
-       
+       $from = get_fiscalyear_begin_for_date($to);
+
        if (!isset($_POST['Dimension']))
                $_POST['Dimension'] = 0;
        if (!isset($_POST['Dimension2']))
@@ -164,8 +163,6 @@ function display_balance_sheet()
                $lclose = 0.0; 
                $calculateclose = 0.0;          
 
-               $parent = -1;
-
                //Get classes for BS
                $classresult = get_account_classes(false, 1);
        
@@ -174,14 +171,14 @@ function display_balance_sheet()
                        $classclose = 0.0;
                        $convert = get_class_type_convert($class["ctype"]);
                        $ctype = $class["ctype"];
-                       $classname = $class["class_name"];      
 
                        //Print Class Name      
                        table_section_title($class["class_name"]);
                        
                        //Get Account groups/types under this group/type
                        $typeresult = get_account_types(false, $class['cid'], -1);
-                               
+                       
+                       $k = 0;
                        while ($accounttype=db_fetch($typeresult))
                        {
                                $TypeTotal = display_type($accounttype["id"], $accounttype["name"], $from, $to, 
@@ -255,7 +252,8 @@ function display_balance_sheet()
                        $convert, $dimension, $dimension2, $drilldown);
        }
        
-       end_table(1); // outer table
+       end_table(); // outer table
+       hyperlink_params($_SERVER['PHP_SELF'], _("Back"), "TransFromDate=". $from . "&TransToDate=" . $to . "&Dimension=" . $dimension . "&Dimension2=" . $dimension2);
        div_end();
 }
 
@@ -269,5 +267,5 @@ display_balance_sheet();
 
 end_form();
 
-end_page();
+end_page(false, true);