<?php
/**********************************************************************
***********************************************************************/
$page_security = 'SA_PETTYCASH_TRANSVIEW';
$path_to_root = "../..";

include_once($path_to_root . "/includes/session.inc");

include_once($path_to_root . "/includes/date_functions.inc");
include_once($path_to_root . "/includes/inventory.inc");
include_once($path_to_root . "/includes/data_checks.inc");
include_once($path_to_root . "/includes/ui.inc");
include_once($path_to_root . "/petty_cash/includes/db/petty_cash_float_adjustments_db.inc");


$js = "";
if ($SysPrefs->use_popup_windows)
	$js .= get_js_open_window(800, 500);
page(_($help_context = "View Petty Cash Float Entry"), true, false, "", $js);

//-------------------------------------------------------------------------------------------------
$woid = 0;
if ($_GET['trans_no'] != "")
{
	$id = $_GET['trans_no'];
}

global $approval_statuses;

display_heading("Petty Cash Float Entry No: " . $id);
br();
$myrow = view_petty_cash_float_adjustment($id);

start_table(TABLESTYLE2, "width=50%");

start_row();

label_cells(_("Reference"), $myrow['reference'], "class='tableheader2'");
end_row();
label_cells(_("Float"), $myrow['float_name'], "class='tableheader2'");
end_row();
label_cells(_("Date"), sql2date($myrow['tran_date']), "class='tableheader2'");
end_row();
label_cells(_("Type"), ($myrow['is_return'] == 1?"Deduct from float": "Add to float"), "class='tableheader2'");
end_row();
label_cells(_("Amount"), number_format($myrow['amount'],2), "class='tableheader2'");
end_row();
label_cells(_("Comment"), $myrow['comment'], "class='tableheader2'");
end_row();

label_cells(_("Created By"), $myrow['user_name'], "class='tableheader2'");
end_row();

//$link = get_petty_cash_trans_view_str(ST_PETTY_CASH_FLOAT_REIMBUR, $myrow['float_reimbursement_id']);
//label_cells(_("Reimbursement"), $link, "class='tableheader2'");

$link = get_petty_cash_float_reimbursement_details_view_str(ST_PETTY_CASH_FLOAT_ADJ, $id, number_format($myrow['reimbursed_amount'],2));
//$link = get_petty_cash_trans_view_str(ST_PETTY_CASH_FLOAT_REIMBUR, $myrow['reimbursed_amount']);
label_cells(_("Reimbursed Amount"), $link, "class='tableheader2'");

end_row();

end_table(2);

end_page(true, false, false, ST_WORKORDER, $woid);

?>
