X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=includes%2Fdashboard.inc;h=9a5a9f4b5ce57e024ebc5292ffecdcfde36c7e31;hb=e685a94465fe8f26c8ff3789242b43c1c20054cf;hp=493a70730078256be109412b7f56bf1f946142ae;hpb=e6889facea537bbee7b66151c95790a13d0fff59;p=fa-stable.git diff --git a/includes/dashboard.inc b/includes/dashboard.inc index 493a7073..9a5a9f4b 100644 --- a/includes/dashboard.inc +++ b/includes/dashboard.inc @@ -15,7 +15,7 @@ function dashboard($sel_app) $selected_app = $sel_app; - if (!$_SESSION["wa_current_user"]->check_application_access($selected_app)) + if (is_object($sel_app) && !$_SESSION["wa_current_user"]->check_application_access($selected_app)) return; // first have a look through the directory, // and remove old temporary pdfs and pngs @@ -157,12 +157,15 @@ function display_all() table_one(); $title = customer_top($today, 3, 66, $pg); source_graphic($today, $title, _("Customer"), $pg, _("Sales")); + $pg = new graph(); $title = supplier_top($today, 3, 66, $pg); source_graphic($today, $title, _("Supplier"), $pg, _("Purchases")); + $pg = new graph(); $title = stock_top($today, 3, 66, 0, $pg); source_graphic($today, $title, _("Items"), $pg, _("Sales"), _("Costs")); table_two(); dimension_top($today, 3, 66); + $pg = new graph(); $title = gl_top($today, 66, $pg); source_graphic($today, $title, _("Class"), $pg, _("Amount"), null, 5); stock_top($today, 3, 66, 2); @@ -192,7 +195,7 @@ function customer_top($today, $limit=10, $width="33", &$pg=null) while ($myrow = db_fetch($result)) { alt_table_row_color($k); - $name = $myrow["debtor_no"]." ".$myrow["name"]; + $name = $myrow["debtor_no"]." ".htmlspecialchars_decode($myrow["name"]); label_cell($name); amount_cell($myrow['total']); if ($pg != null) @@ -229,7 +232,7 @@ function supplier_top($today, $limit=10, $width="33", &$pg=null) while ($myrow = db_fetch($result)) { alt_table_row_color($k); - $name = $myrow["supplier_id"]." ".$myrow["supp_name"]; + $name = $myrow["supplier_id"]." ".htmlspecialchars_decode($myrow["supp_name"]); label_cell($name); amount_cell($myrow['total']); if ($pg != null) @@ -269,7 +272,7 @@ function stock_top($today, $limit=10, $width="33", $type=0, &$pg=null) SUM(qty) AS qty FROM ".TB_PREF."stock_master AS s, ".TB_PREF."stock_moves AS m WHERE s.stock_id=m.stock_id "; if ($type == 1) - $sql .= "AND s.mb_flag='M' "; + $sql .= "AND s.mb_flag='M' AND m.type <> ".ST_CUSTDELIVERY." AND m.type <> ".ST_CUSTCREDIT." "; elseif ($type == 2) $sql .= "AND s.mb_flag='F' "; }