<?php
/****************************************
/*  Author 	: Kvvaradha
/*  Module 	: Kvcodes CRM
/*  E-mail 	: admin@kvcodes.com
/*  Version : 1.0
/*  Http 	: www.kvcodes.com
*****************************************/

$page_security = 'SA_OPEN';
$path_to_root="../../..";

include($path_to_root . "/includes/session.inc");
include($path_to_root . "/modules/KvcodesCRM/includes/crm.inc" );
include_once($path_to_root . "/includes/data_checks.inc");
include_once($path_to_root . "/includes/ui.inc");
include_once($path_to_root . "/modules/KvcodesCRM/reports/reports_classes.inc");

$version_id = get_company_prefs('version_id');

$js = '';
if($version_id['version_id'] == '2.4.1'){
	if ($SysPrefs->use_popup_windows) 
		$js .= get_js_open_window(900, 500);	

	if (user_use_date_picker()) 
		$js .= get_js_date_picker();
	
}else{
	if ($use_popup_windows)
		$js .= get_js_open_window(900, 500);
	if ($use_date_picker)
		$js .= get_js_date_picker();
}

add_js_file('reports.js');

page(_($help_context = "Reports and Analysis"), false, false, "", $js);

$reports = new BoxReports;

$dim = get_company_pref('use_dimension');

$reports->addReportClass(_("CRM Reports"), RC_KVCODESCRM);
//$reports->addReportClass(_("Allowances"), RC_ALLOWANCES);
$reports->addReport(RC_KVCODESCRM, 120, _('Print Estimates'),
       array( _('From') => 'ESTIMATES',
			_('To') => 'ESTIMATES',
			_('Currency Filter') => 'CURRENCY',
			_('Email Customers') => 'YES_NO',
			_('Comments') => 'TEXTBOX',
			_('Orientation') => 'ORIENTATION'));
    $reports->addReport(RC_KVCODESCRM, 121, _('Print Proposal'),
       array( _('From') => 'PROPOSALS',
			_('To') => 'PROPOSALS',
			_('Currency Filter') => 'CURRENCY',
			_('Email Customers') => 'YES_NO',
			_('Comments') => 'TEXTBOX',
			_('Orientation') => 'ORIENTATION'));
	$reports->addReport(RC_KVCODESCRM, 122, _('Print Project Invoice'),
       array( _('From') => 'INVOICES',
			_('To') => 'INVOICES',
			_('Currency Filter') => 'CURRENCY',
			_('Email Customers') => 'YES_NO',
			_('Comments') => 'TEXTBOX',
			_('Orientation') => 'ORIENTATION'));
			
/*$reports->addReport(RC_EMPLOYEES, 6, _("Professional Tax"),
	array(	_("Year") => 'KV_TRANS_YEARS', 
			_("Months") => 'MONTHS',			
			_("Comments") => 'TEXTBOX'));	*/		
/*$result = get_allowances();	

while ($myrow = db_fetch($result)) {	
	if($myrow['Tax'] != 1) {
		$reports->addReport(RC_ALLOWANCES, $myrow['id'], _($myrow['description']),
		array(	_("Year") => 'KV_TRANS_YEARS',
			_("Months") => 'MONTHS',			
			_("Comments") => 'TEXTBOX'));		
	}
}	*/	
add_custom_reports($reports);

echo $reports->getDisplay(); 
end_page(); ?>