<div id="offerDiscountDiv_{$idOffer}_{$idOfferItem}" style="display:none;" class="offerItemDiscountsDiv">

	{$_LANG.reservations.serviceOffers.tpl.discount.appiesFrom}
	<select size="1" name="discountPercentSource[{$idOffer}][{$idOfferItem}]" style="width:170px;" id="discountPercentSource_{$idOffer}_{$idOfferItem}"
		onchange="
			//computeOffer('{$idOffer}', '{$idOfferItem}', 'supplierValue');

			// copy this value to all the profiles
			var key=0;
			$('offerItems_{$idOffer}').select('td[supplier=\'{$idOffer}\'] select').each(
				function(select) {
					$('discountPercentSource_{$idOffer}_'+key).value=$F('discountPercentSource_{$idOffer}_{$idOfferItem}');
					computeOffer('{$idOffer}', key, 'supplierValue');
					key++;
				}
			);

		"
	>
		<option value="servicePrice" {if $offerDetails.discountPercentSource=='servicePrice'}selected="1"{/if}>{$_LANG.reservations.serviceOffers.tpl.discount.percentSource.servicePrice}</option>
		<option value="supplier" {if $offerDetails.discountPercentSource=='supplier'}selected="1"{/if}>{$_LANG.reservations.serviceOffers.tpl.discount.percentSource.supplier}</option>
		<option value="commission" {if $offerDetails.discountPercentSource=='commission'}selected="1"{/if}>{$_LANG.reservations.serviceOffers.tpl.discount.percentSource.commission}</option>
		<option value="serviceFee" {if $offerDetails.discountPercentSource=='serviceFee'}selected="1"{/if}>{$_LANG.reservations.serviceOffers.tpl.discount.percentSource.serviceFee}</option>
		<option value="servicePrice+serviceFee" {if $offerDetails.discountPercentSource=='servicePrice+serviceFee'}selected="1"{/if}>{$_LANG.reservations.serviceOffers.tpl.discount.percentSource.servicePriceAndserviceFee}</option>
		<option value="commission+serviceFee" {if $offerDetails.discountPercentSource=='commission+serviceFee'}selected="1"{/if}>{$_LANG.reservations.serviceOffers.tpl.discount.percentSource.commissionAndserviceFee}</option>
	</select>

	<button type="button"
		onclick="
			$(lastOpenedOfferDiscountFields).hide();
			lastOpenedOfferDiscountFields='0';
		"
	>{$_LANG.reservations.serviceOffers.tpl.closeButton}</button>
				
</div>
