<%
	require_relative './report_balance_sheet'
	from = session[controller_name].try(:[], :from)
	to = session[controller_name].try(:[], :to)
	userId = session[controller_name].try(:[], :user_id)
	groupId = session[controller_name].try(:[], :group_id)
	projId = session[controller_name].try(:[], :project_id)
	bs_report = Object.new.extend(ReportBalanceSheet)
	balSheet = bs_report.calcReportData(userId, groupId, projId, from, to)
%>
<%= stylesheet_link_tag 'application' , :media => "all" %>
<%= stylesheet_link_tag 'wk-time', :plugin => "redmine_wktime" %>
<style>
	body
	{
		margin-right: 30%;
		color:#000;
		font-family:Verdana, sans-serif;
		font-size:12px;
	}
</style>
<div id="attn-rpt-dlg", style="overflow-x:auto;">
	<table style="width:100%; border-collapse: collapse;">
		 <caption style="text-align:center"><b><%= getMainLocation %><br><%= l(:report_balance_sheet) %></b></br>
		 <%= l(:label_as_at) + " " + balSheet[:to] %>
		<thead bgcolor="#e6e6e6">
			<tr style="border-bottom: solid thin;border-top: solid thin;">
				<th align="left" width=65% style="padding-left: 25px;"></th>
				<th colspan="2" align="right" width=35%></th>
			</tr>
		</thead>
		<tbody>
			<%= render partial: "rpt_sections", locals: { from: 0, to: 4, title: l(:label_of_funds,l(:label_copy_source)) + " : ", mainEntriesHash: balSheet[:mainEntriesHash], subEntriesHash: balSheet[:subEntriesHash], mainTotalHash: balSheet[:mainTotalHash], ledgerArr: balSheet[:ledgerArr] }%>

			<%= render partial: "rpt_sections", locals: { from: 5, to: 6, title: l(:label_of_funds,l(:label_application)) + " : ", mainEntriesHash: balSheet[:mainEntriesHash], subEntriesHash: balSheet[:subEntriesHash], mainTotalHash: balSheet[:mainTotalHash], ledgerArr: balSheet[:ledgerArr] }%>
		</tbody>
	</table>
</div>