<inp2:adm_SetPopupSize width="820" height="570"/>

<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" prefix="ord" section="in-commerce:orders" title_preset="orders_edit_general" tab_preset="Default"/>

<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
	<tr>
  	<td>
  		<script type="text/javascript">
				a_toolbar = new ToolBar();
				a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
							submit_event('ord','<inp2:ord_SaveEvent/>');
						}
					) );
				a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
							submit_event('ord','OnCancelEdit');
						}
				 ) );

				a_toolbar.AddButton( new ToolBarSeparator('sep1') );

				a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>', function() {
							go_to_id('ord', '<inp2:ord_PrevId/>');
						}
				 ) );
				a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
							go_to_id('ord', '<inp2:ord_NextId/>');
						}
				 ) );

//				a_toolbar.AddButton( new ToolBarSeparator('sep2') );

				a_toolbar.Render();

				<inp2:m_if check="ord_IsSingle" >
					a_toolbar.HideButton('prev');
					a_toolbar.HideButton('next');
					a_toolbar.HideButton('sep1');
//					a_toolbar.HideButton('sep2');
				<inp2:m_else/>
					<inp2:m_if check="ord_IsLast" >
						a_toolbar.DisableButton('next');
					</inp2:m_if>
					<inp2:m_if check="ord_IsFirst" >
						a_toolbar.DisableButton('prev');
					</inp2:m_if>
				</inp2:m_if>
			</script>
		</td>
	</tr>
</tbody>
</table>

<inp2:m_RenderElement name="inp_edit_hidden" prefix="ord" field="Status" db="db"/>

<inp2:ord_SaveWarning name="grid_save_warning"/>
<inp2:ord_ErrorWarning name="form_error_warning"/>

<div id="scroll_container">
	<table class="edit-form">
		<inp2:m_RenderElement name="subsection" title="!la_section_General!"/>

			<inp2:m_RenderElement name="inp_id_label" prefix="ord" field="OrderId" title="!la_fld_OrderId!"/>

			<inp2:m_if check="ord_OrderEditable">
				<inp2:m_if check="ord_FieldVisible" field="Number">
					<tr class="<inp2:m_odd_even odd='edit-form-odd' even='edit-form-even'/>">
						<inp2:m_RenderElement name="inp_edit_field_caption" prefix="ord" field="Number" title="!la_fld_OrderNumber!"/>
						<td class="control-cell">
							<input type="text" name="<inp2:ord_InputName field='Number'/>" id="<inp2:ord_InputName field='Number'/>" value="<inp2:ord_Field field='Number' db='db'/>" tabindex="<inp2:m_get param='tab_index'/>" size="6" maxlength="6" class="text">
							-<inp2:m_inc param="tab_index" by="1"/>
							<input type="text" name="<inp2:ord_InputName field='SubNumber'/>" id="<inp2:ord_InputName field='SubNumber' db='db'/>" value="<inp2:ord_Field field='SubNumber'/>" tabindex="<inp2:m_get param='tab_index'/>" size="2" maxlength="3" class="text">
						</td>
						<inp2:m_RenderElement name="inp_edit_error" prefix="ord" field="OrderNumber"/>
					</tr>
				</inp2:m_if>

				<inp2:m_if check="m_IsDebugMode" >
					<inp2:m_RenderElement name="inp_edit_options" prefix="ord" field="Status" title="!la_fld_Status!"/>
				<inp2:m_else/>
					<inp2:m_RenderElement name="inp_label" prefix="ord" field="Status" title="!la_fld_Status!"/>
				</inp2:m_if>

				<inp2:m_RenderElement name="inp_edit_date_time" prefix="ord" field="OrderDate" title="!la_fld_Date!"/>

				<inp2:m_RenderElement name="inp_edit_user" prefix="ord" field="PortalUserId" title="!la_fld_Username!" size="15"/>
				<inp2:m_RenderElement name="inp_label" prefix="ord" field="OrderIP" title="!la_fld_OrderIP!"/>
				<inp2:m_RenderElement name="inp_edit_checkbox" prefix="ord" field="OnHold" title="la_fld_OnHold"/>

				<inp2:m_RenderElement name="subsection" title="!la_section_Affiliate!"/>
					<inp2:m_if check="ord_FieldEquals" field="AffiliateId" value="0">
						<inp2:m_RenderElement name="inp_label" prefix="ord" field="AffiliateId" title="!la_fld_AffiliateUser!" as_label="1"/>
					<inp2:m_else/>
						<inp2:m_RenderElement name="inp_label" prefix="ord" field="AffiliateId" title="!la_fld_AffiliateUser!"/>
					</inp2:m_if>
					<inp2:m_RenderElement name="inp_label" prefix="ord" field="AffiliateCommission" title="!la_fld_AffiliateCommission!" currency="selected"/>

				<inp2:m_RenderElement name="subsection" title="!la_section_Comments!"/>
					<inp2:m_RenderElement name="inp_edit_textarea" prefix="ord" field="UserComment" title="!la_fld_UserComment!" control_options="{min_height: 100}" rows="10" cols="40"/>
					<inp2:m_RenderElement name="inp_edit_textarea" prefix="ord" field="AdminComment" title="!la_fld_AdminComment!" control_options="{min_height: 100}" rows="10" cols="40"/>
			<inp2:m_else/>
				<inp2:m_if check="ord_FieldVisible" field="Number">
					<tr class="<inp2:m_odd_even odd='edit-form-odd' even='edit-form-even'/>">
						<inp2:m_RenderElement name="inp_edit_field_caption" prefix="ord" field="Number" title="!la_fld_OrderNumber!"/>
						<td class="control-cell">
							<inp2:ord_Field field="Number"/>-<inp2:ord_Field field="SubNumber"/>
						</td>
						<inp2:m_RenderElement name="inp_edit_error" prefix="ord" field="OrderNumber"/>
					</tr>
				</inp2:m_if>

				<inp2:m_RenderElement name="inp_label" prefix="ord" field="Status" title="!la_fld_Status!"/>
				<inp2:m_RenderElement name="inp_label" prefix="ord" field="OrderDate" title="!la_fld_Date!"/>
				<inp2:m_RenderElement name="inp_label" prefix="ord" field="PortalUserId" title="!la_fld_Username!" size="15"/>

				<inp2:m_RenderElement name="inp_label" prefix="ord" field="OrderIP" title="!la_fld_OrderIP!"/>
				<inp2:m_RenderElement name="inp_edit_checkbox" prefix="ord" field="OnHold" title="la_fld_OnHold"/>

				<inp2:m_RenderElement name="subsection" title="!la_section_Affiliate!"/>
					<inp2:m_if check="ord_FieldEquals" field="AffiliateId" value="0">
						<inp2:m_RenderElement name="inp_label" prefix="ord" field="AffiliateId" title="!la_fld_AffiliateUser!" as_label="1"/>
					<inp2:m_else/>
						<inp2:m_RenderElement name="inp_label" prefix="ord" field="AffiliateId" title="!la_fld_AffiliateUser!"/>
					</inp2:m_if>
					<inp2:m_RenderElement name="inp_label" prefix="ord" field="AffiliateCommission" title="!la_fld_AffiliateCommission!" currency="selected"/>

				<inp2:m_RenderElement name="subsection" title="!la_section_Comments!"/>
					<inp2:m_RenderElement name="inp_label" prefix="ord" field="UserComment" title="!la_fld_UserComment!" control_options="{min_height: 100}" rows="10" cols="40"/>
					<inp2:m_RenderElement name="inp_edit_textarea" prefix="ord" field="AdminComment" title="!la_fld_AdminComment!" control_options="{min_height: 100}" rows="10" cols="40"/>
			</inp2:m_if>
		<inp2:m_RenderElement name="inp_edit_filler"/>
	</table>
</div>

<inp2:m_include t="incs/footer"/>