<?php
/**********************************************************************
	Copyright (C) Evolve Techniologies
	Author : Evolve Technologies
	Email : info@evolve-sl.com
	Company : Evolve Technologies(pvt)Ltd
***********************************************************************/
$page_security = 'SA_SALESTRANSVIEW';
$path_to_root = "..";
include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/sales/includes/sales_ui.inc");
include_once($path_to_root . "/sales/includes/sales_db.inc");


$js = "";
if ($use_popup_windows)
	$js .= get_js_open_window(900, 600);
page(_($help_context = "Outsatnding For Today"), true, false, "", $js);

display_heading(sprintf(_("Outsatnding For Today")));

$today = date('Y-m-d');

$result = get_oustanding_invoice(ST_CUSTDELIVERY, $today);

start_table(TABLESTYLE, "width=95%");

if (db_num_rows($result) > 0)
{
	$th = array(_("Invoice #"), _("Inv Date"), _("Customer"), _("Amount"));
	table_header($th);

	$k = 0;	//row colour counter
	$sub_total = 0;
	
	
	while ($myrow = db_fetch($result))
	{

		alt_table_row_color($k);


	    label_cell($myrow["trans_no"], "align=Center");
		label_cell($myrow["tran_date"]);
        label_cell($myrow["name"], "align=Left");
        amount_cell($myrow["ov_amount"]);
		$sub_total = $sub_total+$myrow["ov_amount"];
		end_row();
	} //end while there are line items to print out

	$display_sub_tot = price_format($sub_total);
	label_row(_("<b>Sub-total</b>"), "<b>".$display_sub_tot."</b>", "colspan=3 align=right", "nowrap align=right width=15% ");
}
else
	display_note(_("There are no Outstanding invoice for today."), 1, 2);

end_table(1);

end_page(true, false, false, ST_SALESINVOICE, $trans_id);

?>