<h2><%= l(:label_ledger) %></h2>
<% wkaccounting_helper = Object.new.extend(WkaccountingHelper) %>
<% ledgerType = wkaccounting_helper.getLedgerTypeHash %>
<div class="autoscroll">
<%= form_tag({:controller => controller_name, :action => 'update'}, :method => :get, :id => 'query_form') do %>
	<fieldset class="box tabular" >
		<legend><%= l(:label_ledger_information) %></legend>	
		<%=h hidden_field_tag('ledger_id', @ledgersDetail[0].blank? ? "" : @ledgersDetail[0].id) %>
		<table >
			<tr>
				<th align="left"><%= l(:field_name) %></th>
				<td align="left" style="padding-left:40px;"><%=h text_field_tag("name", (@ledgersDetail[0].blank? ? "" : @ledgersDetail[0].name),:size => 20) %> </td>
			</tr>
			<% if @ledgersDetail[0].blank? || @ledgersDetail[0].ledger_type != 'SY' %>
				<tr>
					<th align="left"><%= l(:field_type) %></th>
					<td align="left" style="padding-left:40px;">
						<%=h select_tag("ledger_type", options_for_select(ledgerType.invert,:selected => (@ledgersDetail[0].blank? ? "" : @ledgersDetail[0].ledger_type) ), :style => "width:160px; float:left;") %>
					</td>			   
				</tr>
			<% end %>
			<tr>
				<th align="left"><%= l(:label_opening_balance)  %></th>
				<td align="left" style="padding-left:40px;"><%= (@ledgersDetail[0].blank? || @ledgersDetail[0].currency.blank? ? Setting.plugin_redmine_wktime['wktime_currency'] : @ledgersDetail[0].currency) + " "  %><%=h text_field_tag("opening_balance", (@ledgersDetail[0].blank? ? "" : @ledgersDetail[0].opening_balance),:size => 20, :maxlength => 14) %> </td>			   
			</tr>
		</table>	
	</fieldset>
<% if validateERPPermission("A_ACC_PRVLG") %>	
	<%= submit_tag l(:button_save), :class => "small", :name => nil %>
<% end %>
<% end %>
</div>