{% if has_inventory_block %}
						     
						   
	                
	                <div class="col s12 m6">
					<ul class="collection">
					<li class="collection-item" field-name="enabled" field-group="inventory_settings">
						      		
						      <b>Enable Inventory Block: </b><br>
						      <div class="details_content">
						      <span class=" flow-text">{% if module_settings.inventory.enabled is defined and module_settings.inventory.enabled %}On{% else %}Off{% endif %}</span></div>
						        <div class="edit_content hide">
								      <div class="switch">
									    <label>Off 
									    <input type="checkbox" name="settings[enabled]" {% if module_settings.inventory.enabled is defined and module_settings.inventory.enabled %}checked="checked" value="1" {% endif %} param-name="enabled">
									    <span class="lever"></span> On
									    </label>
									  </div>
						      </div>
						      </li>
					
					
					<li class="collection-item" field-name="line_fields" field-group="inventory_settings">
						      <b>Inventory Line Fields: </b><br>
						      <div class="details_content">
							    {% if module_settings.inventory.line_fields is defined %}
						      	{% for fieldname in module_settings.inventory.line_fields %}
						      		<a class="btn {{themebasiccolor}} btn-small">{{field_labels[fieldname]|trans}}</a> 
						      	{% endfor %} 
						      	{% endif %}
						      </div>
						      <div class="edit_content hide">
							      <select name="settings[line_fields]" class="chosen-select" multiple sort-order="{% if module_settings.inventory.line_fields is defined %}{{module_settings.inventory.line_fields|join(',')}}{% else %}[]{% endif %}" param-name="line_fields" required >
								      {% for fieldname,fieldlabel in module_params['inventory_line_fields'] %}
								      	{% if fieldname!="id"  %}
								      		<option value="{{fieldname}}" {% if ( module_settings.inventory.line_fields is defined and fieldname in module_settings.inventory.line_fields) or fieldname in ['sequence_no'] %}selected {% endif %}>{{fieldlabel|trans}} {% if fieldname in ['sequence_no'] %}*{% endif %}</option>
								      	{% endif %}	
								      {% endfor %}
							      </select>
						      </div>
							  </li>
						    </ul>
					</div>
					<div class="col s12 m6">
		               <ul class="collection">
			               
			               <li class="collection-item" field-name="currency_field" field-group="inventory_settings">
						      <b>Inventory Currency Field: </b><br>
						      <div class="details_content">
						      <span class=" flow-text">
						      {% if module_settings.inventory.currency_field is defined %}
						      	{% if field_labels[module_settings.inventory.currency_field] is defined %}
						      		{{field_labels[module_settings.inventory.currency_field]|trans}}
						      	{% else %}
						      		{{module_settings.inventory.currency_field|trans}}
						      	{% endif %}
						      {% endif %}
						      </span>
						      </div>
						      
						      <div class="edit_content hide">
						      <select name="settings[currency_field]" class=""  param-name="currency_field" required>
								      {% for field in module_params['fields'] %}
								      	
								      	{% if field.type.name=="reference" and "Currency" in field.type.refersTo %}
								      		<option value="{{field.name}}" {% if module_settings.inventory.currency_field is defined and field.name == module_settings.inventory.currency_field %}selected {% endif %}>{{field.label|trans}}</option>
								      	{% endif %}	
								      {% endfor %}
								      
								      <option value="default">Default</option>

							      </select>	
						      </div>
						    
						      </li>
			               
					<li class="collection-item" field-name="total_fields" field-group="inventory_settings">
						      <b>Totals Fields: </b><br>
						      <div class="details_content">
							    {% if module_settings.inventory.total_fields is defined %}
						      	{% for fieldname in module_settings.inventory.total_fields %}
						      		<a class="btn {{themebasiccolor}} btn-small">{{field_labels[fieldname]|trans}}</a> 
						      	{% endfor %}
						      	{% endif %} 
						      </div>
						      <div class="edit_content hide">
							      <select name="settings[total_fields]" class="chosen-select" multiple sort-order="{% if module_settings.inventory.total_fields is defined %}{{module_settings.inventory.total_fields|join(',')}}{% endif %}" param-name="total_fields">
								      {% for field in module_params['fields'] %}
								      	{% if field.name!="id" and  field.type.name in ["double","currency"] %}
								      		<option value="{{field.name}}" {% if module_settings.inventory.total_fields is defined and field.name in module_settings.inventory.total_fields  %}selected {% endif %}>{{field.label|trans}}</option>
								      	{% endif %}	
								      {% endfor %}
							      </select>	
						      </div>
							  </li>
						    </ul>
	                </div>
                
                <div class="col s12 m12 center-align">
		                <a class="btn red edit-group-btn" field-group="inventory_settings"><i class="material-icons left">edit</i>Edit</a>
			            <a class="btn green save-group-btn hide" field-group="inventory_settings">Save</a>
			            <a class="btn grey hide cancel-group-btn" field-group="inventory_settings"><i class="material-icons left">close</i>Cancel</a><br><br>
	                </div>
                
                  {% else %}
						     <div class="col s12 m12">
						      <div class="card-panel red">
						          <span class="white-text">
						          This module has no inventory block so this feature could not be used
						          </span>
						        </div>
						     </div>
						     {% endif %} 
                
