$title = supplier_top($today, 3, 66, $pg);
source_graphic($today, $title, _("Supplier"), $pg, _("Purchases"));
$title = stock_top($today, 3, 66, 0, $pg);
$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);
table_two();
dimension_top($today, 3, 66);
$title = gl_top($today, 66, $pg);
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);
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);
display_title($title);
$th = array(_("Customer"), _("Amount"));
start_table(TABLESTYLE, "width='$width%'");
display_title($title);
$th = array(_("Customer"), _("Amount"));
start_table(TABLESTYLE, "width='$width%'");
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);
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);
display_title($title);
$th = array(_("Supplier"), _("Amount"));
start_table(TABLESTYLE, "width='$width%'");
display_title($title);
$th = array(_("Supplier"), _("Amount"));
start_table(TABLESTYLE, "width='$width%'");
- $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
display_title($title);
if ($type == 0)
$th = array(_("Item"), _("Sales"), _("Costs"), _("Quantity"));
display_title($title);
if ($type == 0)
$th = array(_("Item"), _("Sales"), _("Costs"), _("Quantity"));
(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");
(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");
display_title($title);
$th = array(_("Dimension"), _("Amount"));
start_table(TABLESTYLE, "width='$width%'");
display_title($title);
$th = array(_("Dimension"), _("Amount"));
start_table(TABLESTYLE, "width='$width%'");
function bank_balance($today, $width)
{
$today = date2sql($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
start_table(TABLESTYLE, "width='$width%'");
table_header($th);
$k = 0; //row colour counter
start_table(TABLESTYLE, "width='$width%'");
table_header($th);
$k = 0; //row colour counter