{*
* 2007-2024 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author    PrestaShop SA <contact@prestashop.com>
*  @copyright 2007-2024 PrestaShop SA
*  @license   http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*}
<div id="product-prices" class="panel product-tab">
	<h3>{l s='Product price' d='Modules.Agilemultisellerpro.Product'}</h3>
	<div class="alert alert-info">
		{l s='You must enter either the pre-tax retail price, or the retail price with tax. The input field will be automatically calculated.' d='Modules.Agilemultisellerpro.Product'}
	</div>

	<div class="form-group row">
		<label class="col-md-3 form-control-label" for="priceTE">
			{l s='Retail price (tax excl.)' d='Modules.Agilemultisellerpro.Product'}
		</label>

		<div class="col-md-9 js-input-column">
			<input id="priceTEReal" name="price" value="{$product->price|floatval|string_format:'%.2f'}" type="hidden">
			<div class="input-group">
				<input id="priceTE" class="form-control" name="price" type="number" value="{$product->price|floatval|string_format:'%.2f'}" step="0.01"
					onchange="$('#priceTEReal').val(this.value);$('#priceType').val('TE');calcPriceTI();">
				<span class="input-group-addon">{$field.availableValues.currencyDefault->iso_code|escape:'htmlall':'UTF-8'}</span>
			</div>
		</div>
	</div>

	<div class="form-group row">
		<label class="col-md-3 form-control-label" for="id_tax_rules_group">
			{l s='Tax rule' d='Modules.Agilemultisellerpro.Product'}
		</label>

		<div class="col-md-9 js-input-column">
			<select id="id_tax_rules_group" class="form-control form-control-select" name="id_tax_rules_group" onChange="calcPrice(); unitPriceWithTax('unit');">
				<option value="0">{l s='No Tax' d='Modules.Agilemultisellerpro.Product'}</option>
				{foreach from=$field.availableValues.tax_rules_groups item=tax_rules_group}
					<option value="{$tax_rules_group.id_tax_rules_group|intval}"
						{if $product->getIdTaxRulesGroup() == $tax_rules_group.id_tax_rules_group}selected="selected"{/if}>
						{$tax_rules_group['name']|escape:'htmlall':'UTF-8'}
					</option>
				{/foreach}
			</select>
		</div>
	</div>

	<div class="form-group row" {if !$field.availableValues.ps_use_ecotax}style="display:none;"{/if}>
		<label class="col-md-3 form-control-label" for="ecotax">
			{l s='Eco-tax (tax incl.)' d='Modules.Agilemultisellerpro.Product'}
		</label>

		<div class="col-md-9 js-input-column">
			<input id="ecotax" class="form-control" name="ecotax" type="number" value="{$product->ecotax|floatval|string_format:'%.2f'}" step="0.01"
				onChange="$('#priceType').val('TI');calcPriceTE();">
		</div>
	</div>

	<div class="form-group row">
		<label class="col-md-3 form-control-label" for="ecotax">
			{l s='Retail price (tax incl.)' d='Modules.Agilemultisellerpro.Product'}
		</label>

		<div class="col-md-9 js-input-column">
			<div class="input-group">
				<input id="priceType" name="priceType" value="TE" type="hidden">
				<input id="priceTI" class="form-control" type="number" value="" step="0.01"
					onChange="$('#priceType').val('TI');calcPriceTE();">
				<span class="input-group-addon">{$field.availableValues.currencyDefault->iso_code|escape:'htmlall':'UTF-8'}</span>
			</div>
		</div>
	</div>

	<div class="form-group row">
		<label class="col-md-3 form-control-label" for="wholesale_price">
			{l s='Cost price (tax excl.)' d='Modules.Agilemultisellerpro.Product'}
		</label>

		<div class="col-md-9 js-input-column">
			<div class="input-group">
				<input id="wholesale_price" class="form-control" name="wholesale_price" type="number" value="{$product->wholesale_price|floatval|string_format:'%.2f'}" step="0.01">
				<span class="input-group-addon">{$field.availableValues.currencyDefault->iso_code|escape:'htmlall':'UTF-8'}</span>
			</div>
		</div>
	</div>

	<div class="form-group row">
		<label class="col-md-3 form-control-label" for="unit_price">
			{l s='Unit price (tax excl.)' d='Modules.Agilemultisellerpro.Product'}
		</label>

		<div class="col-md-9 js-input-column">
			<div class="input-group">
				<input id="unit_price" class="form-control" type="number" name="unit_price"
					value="{$product->unit_price|floatval|string_format:'%.2f'}"
					step="0.01"
					onChange="unitPriceWithTax('unit');">
				<span class="input-group-addon">{$field.availableValues.currencyDefault->iso_code|escape:'htmlall':'UTF-8'}</span>
				<span class="input-group-addon">/</span>
				<input id="unity" class="form-control" name="unity" value="{$product->unity|escape:'htmlall':'UTF-8'}" placeholder="{l s='Per kilo, per litre' d='Modules.Agilemultisellerpro.Product'}">
			</div>
		</div>
	</div>

	<div class="form-group row">
		<label class="col-md-3 form-control-label" for="on_sale"> </label>

		<div class="col-md-9 js-input-column">
			<span class="custom-checkbox">
				<label>
					<input name="on_sale" type="checkbox" value="1" {if $product->on_sale}checked="checked" {/if}>
					<span><i class="material-icons rtl-no-flip checkbox-checked"></i></span>
					{l s='Display the "On sale!" flag on the product page, and on product listings.' d='Modules.Agilemultisellerpro.Product'}
				</label>
		</span>
		</div>
	</div>

	<div class="form-group row">
		<div class="col-md-9 offset-md-3">
			<div class="alert alert-success">
				<strong>{l s='Final retail price' d='Modules.Agilemultisellerpro.Product'}</strong>
				<span {if !$field.availableValues.ps_tax}style="display:none"{/if}>
					<span id="finalPrice"></span>
					({l s='tax incl.' d='Modules.Agilemultisellerpro.Product'})
				</span>
				<span {if $field.availableValues.ps_tax}style="display:none;"{/if}>
					{if $field.availableValues.country_display_tax_label}
						/
					{/if}
					<span id="finalPriceWithoutTax"></span>
					{if $field.availableValues.country_display_tax_label}({l s='tax excl.' d='Modules.Agilemultisellerpro.Product'}){/if}</span>
				</span>
			</div>
		</div>
	</div>
	<div class="form-group row">
		<div class="col-md-9 offset-md-3">
			<div class="alert alert-info">
				{l s='All prices are in the default currency' d='Modules.Agilemultisellerpro.Product'}&nbsp;
				{$field.availableValues.currencyDefault->name|escape:'htmlall':'UTF-8'} ({$field.availableValues.currencyDefault->iso_code|escape:'htmlall':'UTF-8'})
			</div>
		</div>
	</div>
</div>
