Merged changes form main trunk (2.2.8, 2.2.9)
[fa-stable.git] / gl / inquiry / profit_loss.php
index f7e6ea6958a914ec8bb7d664adf7602227e4deee..70f08d54c0134d92ca52a156d5f3ab85665ce7dd 100644 (file)
@@ -114,8 +114,13 @@ function display_type ($type, $typename, $from, $to, $begin, $end, $compare, $co
                        amount_cell(Achieve(($code_per_balance + $per_balance_total), ($code_acc_balance + $acc_balance_total)));
                        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/profit_loss.php?TransFromDate=" 
                                . $from . "&TransToDate=" . $to . "&Compare=" . $compare
                                . "&AccGrp=" . $type ."'>" . $typename ."</a>";
@@ -148,7 +153,7 @@ function Achieve($d1, $d2)
 
 function inquiry_controls()
 {  
-    start_table("class='tablestyle_noborder'");
+    start_table(TABLESTYLE_NOBORDER);
     
     date_cells(_("From:"), 'TransFromDate', '', null, -30);
        date_cells(_("To:"), 'TransToDate');
@@ -156,7 +161,7 @@ function inquiry_controls()
        //Compare Combo
        global $sel;
        $sel = array(_("Accumulated"), _("Period Y-1"), _("Budget"));   
-       echo "<td>Comapre To:</td>\n";
+       echo "<td>"._("Compare to").":</td>\n";
        echo "<td>";
        echo array_selector('Compare', null, $sel);
        echo "</td>\n"; 
@@ -171,7 +176,7 @@ function inquiry_controls()
 
 function display_profit_and_loss()
 {
-       global $comp_path, $path_to_root, $table_style, $sel;
+       global $path_to_root, $sel;
 
        $dim = get_company_pref('use_dimension');
        $dimension = $dimension2 = 0;
@@ -206,7 +211,7 @@ function display_profit_and_loss()
        
        div_start('pl_tbl');
 
-       start_table("width=50% $table_style");
+       start_table(TABLESTYLE, "width=50%");
 
        $tableheader =  "<tr>
         <td class='tableheader'>" . _("Group/Account Name") . "</td>