Fixed typos in installer translation files, fixed translations in dashboard procedures.
[fa-stable.git] / includes / dashboard.inc
index 69654c88e39f9ba6e4624c6e55e1c663dead245d..6bdc84c9985c4f288258f3c1b3a165744bf13438 100644 (file)
@@ -160,7 +160,7 @@ function display_all()
        $title = supplier_top($today, 3, 66, $pg);
        source_graphic($today, $title, _("Supplier"), $pg, _("Purchases"));
        $title = stock_top($today, 3, 66, 0, $pg);
-       source_graphic($today, $title, _("Stock"), $pg, _("Sales"));
+       source_graphic($today, $title, _("Items"), $pg, _("Sales"), _("Costs"));
        table_two();
        dimension_top($today, 3, 66);
        $title = gl_top($today, 66, $pg);
@@ -181,7 +181,7 @@ function customer_top($today, $limit=10, $width="33", &$pg=null)
                AND tran_date >= '$begin1' AND tran_date <= '$today1' GROUP by d.debtor_no ORDER BY total DESC, d.debtor_no 
                LIMIT $limit";
        $result = db_query($sql);
-       $title = _("Top $limit customers in fiscal year");
+       $title = sprintf(_("Top %s customers in fiscal year"), $limit);
        display_title($title);
        $th = array(_("Customer"), _("Amount"));
        start_table(TABLESTYLE, "width='$width%'");
@@ -218,7 +218,7 @@ function supplier_top($today, $limit=10, $width="33", &$pg=null)
                AND tran_date >= '$begin1' AND tran_date <= '$today1' GROUP by s.supplier_id ORDER BY total DESC, s.supplier_id 
                LIMIT $limit";
        $result = db_query($sql);
-       $title = _("Top $limit suppliers in fiscal year");
+       $title = sprintf(_("Top %s suppliers in fiscal year"), $limit);
        display_title($title);
        $th = array(_("Supplier"), _("Amount"));
        start_table(TABLESTYLE, "width='$width%'");
@@ -273,15 +273,17 @@ function stock_top($today, $limit=10, $width="33", $type=0, &$pg=null)
                elseif ($type == 2)     
                        $sql .= "AND s.mb_flag='F' ";
        }
-       $sql .= "AND tran_date >= '$begin1' AND tran_date <= '$today1' GROUP by s.stock_id ORDER BY total DESC, s.stock_id 
+       if ($type != 2)
+               $sql .= "AND tran_date >= '$begin1' ";
+       $sql .= "AND tran_date <= '$today1' GROUP by s.stock_id ORDER BY total DESC, s.stock_id 
                LIMIT $limit";
        $result = db_query($sql);
        if ($type == 1)
-               $title = _("Top $limit Manufactured Items in fiscal year");
+               $title = sprintf(_("Top %s Manufactured Items in fiscal year"), $limit);
        elseif ($type == 2)
-               $title = _("Top $limit Fixed Assets in fiscal year");
+               $title = sprintf(_("Top %s Fixed Assets"), $limit);
        else    
-               $title = _("Top $limit Sold Items in fiscal year");
+               $title = sprintf(_("Top %s Sold Items in fiscal year"), $limit);
        display_title($title);  
        if ($type == 0) 
                $th = array(_("Item"), _("Sales"), _("Costs"), _("Quantity"));
@@ -326,7 +328,7 @@ function dimension_top($today, $limit=10, $width="33", &$pg=null)
                (t.dimension_id = d.id OR t.dimension2_id = d.id) AND
                t.tran_date >= '$begin1' AND t.tran_date <= '$today1' GROUP BY d.id ORDER BY total DESC LIMIT $limit";
        $result = db_query($sql, "Transactions could not be calculated");
-       $title = _("Top $limit Dimensions in fiscal year");
+       $title = sprintf(_("Top %s Dimensions in fiscal year"), $limit);
        display_title($title);
        $th = array(_("Dimension"), _("Amount"));
        start_table(TABLESTYLE, "width='$width%'");
@@ -591,7 +593,7 @@ function supplier_trans($today)
 function bank_balance($today, $width)
 {
        $today = date2sql($today);
-       $sql = "SELECT bank_act, bank_account_name, SUM(amount) balance FROM ".TB_PREF."bank_trans bt 
+       $sql = "SELECT bank_act, bank_account_name, bank_curr_code, SUM(amount) balance FROM ".TB_PREF."bank_trans bt 
                    INNER JOIN ".TB_PREF."bank_accounts ba ON bt.bank_act = ba.id
                    WHERE trans_date <= '$today'
                    AND inactive <> 1
@@ -600,7 +602,7 @@ function bank_balance($today, $width)
        $result = db_query($sql);
        $title = _("Bank Account Balances");
        display_title($title);
-       $th = array(_("Account"), _("Balance"));
+       $th = array(_("Account"), _("Currency"), _("Balance"));
        start_table(TABLESTYLE, "width='$width%'");
        table_header($th);
        $k = 0; //row colour counter
@@ -608,6 +610,7 @@ function bank_balance($today, $width)
        {
                alt_table_row_color($k);
                label_cell(viewer_link($myrow["bank_account_name"], 'gl/inquiry/bank_inquiry.php?bank_account='.$myrow["bank_act"]));
+               label_cell($myrow["bank_curr_code"]);
                amount_cell($myrow['balance']);
                end_row();
        }