{{if $aVariant.bNewVariant}}
	{{$sVariantFieldName = 'aNewVariants'}}
	{{$sVariantIdPrefix = 'newvariant'}}
{{else}}
	{{$sVariantFieldName = 'aVariants'}}
	{{$sVariantIdPrefix = 'variant'}}
{{/if}}

<tr class="product-variant">
	<td colspan="3">
		<table class="list product-variant-item" id="{{$sVariantIdPrefix}}-{{$aVariant.iProductVariant}}">
			<tbody>
				<tr>
					<td class="active"><input type="checkbox"  value="1" name="{{$sVariantFieldName}}[{{$aVariant.iProductVariant}}][iStatus]" {{if $aVariant.iStatus}}checked="checked"{{/if}} /></td>
					<td class="buy-price">
						<label class="gross">{{$lang.Gross}}: <input type="text" id="{{$sVariantIdPrefix}}-{{$aVariant.iProductVariant}}-BuyPrice" name="{{$sVariantFieldName}}[{{$aVariant.iProductVariant}}][fBuyPrice]" value="{{$aVariant.fBuyPrice}}" class="gross" /></label>
						<label class="netto">{{$lang.Netto}}: <input type="text" id="{{$sVariantIdPrefix}}-{{$aVariant.iProductVariant}}-BuyPriceN" class="netto" /></label>
					</td>
					<td class="margin">
						<input type="text" id="{{$sVariantIdPrefix}}-{{$aVariant.iProductVariant}}-Margin" name="{{$sVariantFieldName}}[{{$aVariant.iProductVariant}}][sMargin]" value="{{$aVariant.sMargin}}" /><br />
						<a href="#" class="margin-count-variant"><img src="{{$config.dir_templates}}admin/images/ico/margin-variant.png" alt="variant" title="{{$lang.Margin_variant}}" /></a>
						<a href="#" class="margin-count-product"><img src="{{$config.dir_templates}}admin/images/ico/margin-product.png" alt="product" title="{{$lang.Margin_product}}" /></a>
						<a href="#" class="margin-count-producer"><img src="{{$config.dir_templates}}admin/images/ico/margin-producer.png" alt="producer" title="{{$lang.Margin_producer}}" /></a>
						<a href="#" class="margin-count-category"><img src="{{$config.dir_templates}}admin/images/ico/margin-category.png" alt="category" title="{{$lang.Margin_category}}" /></a>
					</td>
					<td class="price">
						<label class="gross"><input type="text" id="{{$sVariantIdPrefix}}-{{$aVariant.iProductVariant}}-Price" name="{{$sVariantFieldName}}[{{$aVariant.iProductVariant}}][fPrice]" value="{{$aVariant.fPrice}}" class="gross" /></label>
						<label class="netto"><input type="text" id="{{$sVariantIdPrefix}}-{{$aVariant.iProductVariant}}-PriceN" class="netto" /></label>
					</td>
					<td class="price-old">
						<label class="gross"><input type="text" id="{{$sVariantIdPrefix}}-{{$aVariant.iProductVariant}}-PriceOld" name="{{$sVariantFieldName}}[{{$aVariant.iProductVariant}}][fPriceOld]" value="{{$aVariant.fPriceOld}}" class="gross" /></label>
						<label class="netto"><input type="text" id="{{$sVariantIdPrefix}}-{{$aVariant.iProductVariant}}-PriceOldN" class="netto" /></label>
					</td>
					<td class="price-time">
						<label class="gross"><input type="text" id="{{$sVariantIdPrefix}}-{{$aVariant.iProductVariant}}-PriceTime" name="{{$sVariantFieldName}}[{{$aVariant.iProductVariant}}][fPriceTimeValue]" value="{{$aVariant.fPriceTimeValue}}" class="gross" /></label>
						<label class="netto"><input type="text" id="{{$sVariantIdPrefix}}-{{$aVariant.iProductVariant}}-PriceTimeN" class="netto" /></label>
					</td>
					<td class="stock">
						<input type="text" id="{{$sVariantIdPrefix}}-{{$aVariant.iProductVariant}}-Stock" value="{{$aVariant.TiStock}}" readonly="readonly" />
						<a href="#" class="hide">Ukryj</a>
					</td>
					<td class="del">
						<input type="checkbox" id="{{$sVariantIdPrefix}}-{{$aVariant.iProductVariant}}-Delete" name="{{$sVariantFieldName}}[{{$aVariant.iProductVariant}}][iDelete]" value="1" />
					</td>
				</tr>
				{{foreach from=$aGeneralInfo.aStores item=sStore}}
					<tr class="variant-stores">
						<td colspan="2" class="store-active">
							<label>
								<input type="checkbox" value="1" name="{{$sVariantFieldName}}[{{$aVariant.iProductVariant}}][aStore][{{$sStore@key}}][iActive]" {{if isset( $aVariant.aStore[$sStore@key].iStock)}}checked="checked"{{/if}} />
								{{$sStore}}
							</label>
						</td>
						<td class="stock">
							{{$lang.Stock_level}}:
							<input type="text" id="{{$sVariantIdPrefix}}-{{$aVariant.iProductVariant}}-Store-{{$sStore@key}}-Stock" name="{{$sVariantFieldName}}[{{$aVariant.iProductVariant}}][aStore][{{$sStore@key}}][iStock]" value="{{if isset($aVariant.aStore[$sStore@key].iStock)}}{{$aVariant.aStore[$sStore@key].iStock}}{{else}}0{{/if}}" />
						</td>
						<td colspan="5" class="store-stock">
							<label>
								{{$lang.AvailableOnStock}}:
								<select id="{{$sVariantIdPrefix}}-{{$aVariant.iProductVariant}}-Store-{{$sStore@key}}-OnStock" name="{{$sVariantFieldName}}[{{$aVariant.iProductVariant}}][aStore][{{$sStore@key}}][iAvailableOnStock]">
									<option value="">{{$lang.Default}}</option>
									{{selectOptions aOptions=$aGeneralInfo.aAvailabilityOnStock mOption=$aVariant.aStore[$sStore@key].iAvailableOnStock}}
								</select>
							</label>
							<label>
								{{$lang.AvailableOutOfStock}}:
								<select id="{{$sVariantIdPrefix}}-{{$aVariant.iProductVariant}}-Store-{{$sStore@key}}-OutOfStock" name="{{$sVariantFieldName}}[{{$aVariant.iProductVariant}}][aStore][{{$sStore@key}}][iAvailableOutOfStock]">
									<option value="">{{$lang.Default}}</option>
									{{selectOptions aOptions=$aGeneralInfo.aAvailability mOption=$aVariant.aStore[$sStore@key].iAvailableOutOfStock}}
								</select>
							</label>
						</td>
					</tr>
				{{/foreach}}
				<tr class="variant-additional">
					<td colspan="3">
						<label>
							{{$lang.Description}}:
							<textarea name="{{$sVariantFieldName}}[{{$aVariant.iProductVariant}}][sShortDescription]" cols="50" rows="5">{{htmlspecialchars($aVariant.sShortDescription)}}</textarea>
						</label>
					</td>
					<td colspan="2">
						<label>{{$lang.OuterId}}: <input type="text" id="{{$sVariantIdPrefix}}-{{$aVariant.iProductVariant}}-OuterId" name="{{$sVariantFieldName}}[{{$aVariant.iProductVariant}}][sOuterId]" value="{{$aVariant.sOuterId}}" /></label><br/>
						<label>{{$lang.Code_EAN}}: <input type="text" id="{{$sVariantIdPrefix}}-{{$aVariant.iProductVariant}}-Ean" name="{{$sVariantFieldName}}[{{$aVariant.iProductVariant}}][sEan]" value="{{$aVariant.sEan}}" /></label><br/>
						<label>{{$lang.Weight}}: <input type="text" id="{{$sVariantIdPrefix}}-{{$aVariant.iProductVariant}}-Weight" class="weight" name="{{$sVariantFieldName}}[{{$aVariant.iProductVariant}}][sWeight]" value="{{$aVariant.sWeight}}" /></label><br/>
					</td>
					<td colspan="3">
						<label>{{$lang.Vat}}:
							<select id="{{$sVariantIdPrefix}}-{{$aVariant.iProductVariant}}-Vat" name="{{$sVariantFieldName}}[{{$aVariant.iProductVariant}}][iVat]" class="vat">
								<option value="">{{$lang.Default}}</option>
								{{selectOptions aOptions=$aGeneralInfo.aVatsForSelect mOption=$aVariant.iVat}}
							</select>
						</label><br/>
						<label>{{$lang.ActiveDiscount}}:
							<select id="{{$sVariantIdPrefix}}-{{$aVariant.iProductVariant}}-Discount" name="{{$sVariantFieldName}}[{{$aVariant.iProductVariant}}][iActiveDiscount]">
								<option value="">{{$lang.Default}}</option>
								{{selectOptions aOptions=$aGeneralInfo.aYesNo mOption=$aVariant.iActiveDiscount}}
							</select>
						</label><br/>
						<label>{{$lang.File}}:
							<select name="{{$sVariantFieldName}}[{{$aVariant.iProductVariant}}][iFile]">
								<option value="">{{$lang.none}}</option>
								{{foreach from=$aProduct.aFiles item=aFile}}{{if $aFile.iType == 7}}
									<option value="{{$aFile.iFile}}" {{if $aVariant.iFile == $aFile.iFile}}selected="selected"{{/if}}>{{$aFile.sFileName}}</option>
								{{/if}}{{/foreach}}
							</select>
						</label><br/>
						<label>{{$lang.Variant_move_desc}}: </label>
						<a href="admin.php?p=products-select&request_type={{$sVariantIdPrefix}}-{{$aVariant.iProductVariant}}" class="variant-move-select" >
							<img src="{{$config.dir_templates}}admin/images/ico/product-move.png" alt="{{$lang.Variant_move}}" title="{{$lang.Variant_move}}" />
						</a>
					</td>
				</tr>
				<tr>
					<td colspan="8">
						<a href="#" class="clone_variant" style="float: right;"><img src="{{$config.dir_templates}}admin/images/ico/clone.png" alt="{{$lang.Clone_variant}}" title="{{$lang.Clone_variant}}" /></a>
						<div id="{{$sVariantIdPrefix}}-{{$aVariant.iProductVariant}}-attributes" class="product-variant-attributes">
							<strong>{{$lang.Products_variants_attributes}}:</strong> 
							{{foreach from=$aProduct.aAttributes item=aAttribute}}
								<div class="product-variant-attribute" id="{{$sVariantIdPrefix}}-{{$aVariant.iProductVariant}}-attribute-{{$aAttribute.iAttribute}}">
									<div id="{{$sVariantIdPrefix}}_attribute_quick_add-{{$aVariant.iProductVariant}}-attribute-{{$aAttribute.iAttribute}}" class="dialog" title="{{$lang.New_attribute_value}}: {{$aAttribute.sName}}">
										<label>{{$lang.Attribute_value}}: <input type="text" name="sNewValue" /></label>
										<input type="hidden" class="rel_additional" value=".variant-attribute-{{$aAttribute.iAttribute}}" />
										<input type="hidden" class="rel" value="#{{$sVariantIdPrefix}}-{{$aVariant.iProductVariant}}-attribute-{{$aAttribute.iAttribute}}-select" />
										<input type="hidden" class="action" value="admin.php?p=attributes-ajax_value&iAttribute={{$aAttribute.iAttribute}}&sValue=" />
									</div>


									<span><label for="{{$sVariantIdPrefix}}-{{$aVariant.iProductVariant}}-attribute-{{$aAttribute.iAttribute}}-select">{{$aAttribute.sName}}</label></span>
									<span>
										<select id="{{$sVariantIdPrefix}}-{{$aVariant.iProductVariant}}-attribute-{{$aAttribute.iAttribute}}-select" name="{{$sVariantFieldName}}[{{$aVariant.iProductVariant}}][aAttributes][{{$aAttribute.iAttribute}}]" class="variant-attribute-{{$aAttribute.iAttribute}}">
											{{selectOptions aOptions=$aGeneralInfo.aAttributesAndValues[$aAttribute.iAttribute].aAValues mOption=$aVariant.aValues[$aAttribute.iAttribute]}}
										</select>
										<a href="#{{$sVariantIdPrefix}}_attribute_quick_add-{{$aVariant.iProductVariant}}-attribute-{{$aAttribute.iAttribute}}" class="dialog">
											<img src="{{$config.dir_templates}}admin/images/ico/add.png" alt="{{$lang.New_attribute_value}}" />
										</a>
									</span>
								</div>
							{{/foreach}}
						</div>
					</td>
				</tr>
			</tbody>
		</table>
	</td>
</tr>