<%--
/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * The contents of this file are subject to the terms of the Liferay Enterprise
 * Subscription License ("License"). You may not use this file except in
 * compliance with the License. You can obtain a copy of the License by
 * contacting Liferay, Inc. See the License for the specific language governing
 * permissions and limitations under the License, including but not limited to
 * distribution rights of the Software.
 *
 *
 *
 */
--%>

<div class="row">
	<div class="col-12">
		<liferay-ui:error exception="<%= CommerceDiscountCouponCodeException.class %>" message="please-enter-a-valid-coupon-code" />
		<liferay-ui:error exception="<%= DuplicateCommerceDiscountException.class %>" message="there-is-another-discount-with-the-same-coupon-code" />

		<commerce-ui:panel
			bodyClasses="flex-fill"
			collapsed="<%= !commerceDiscount.isUseCouponCode() %>"
			collapseLabel='<%= LanguageUtil.get(request, "enabled") %>'
			collapseSwitchName='<%= liferayPortletResponse.getNamespace() + "useCouponCode" %>'
			title='<%= LanguageUtil.get(request, "coupon-code") %>'
		>
			<div class="row">
				<div class="col-4">
					<aui:input label="coupon-code" name="couponCode" type="text" value="<%= commerceDiscount.getCouponCode() %>">
					</aui:input>
				</div>

				<div class="col-4">
					<aui:input helpMessage="define-the-total-number-of-times-this-coupon-code-can-be-used" label="maximum-total-uses" name="limitationTimes" type="text" value="<%= commerceDiscount.getLimitationTimes() %>">
						<aui:validator name="min">0</aui:validator>
						<aui:validator name="number" />
					</aui:input>
				</div>

				<div class="col-4">
					<aui:input helpMessage="define-the-maximum-number-of-times-this-coupon-code-can-be-used-by-an-account" label="maximum-uses-per-account" name="limitationTimesPerAccount" type="text" value="<%= commerceDiscount.getLimitationTimesPerAccount() %>">
						<aui:validator name="min">0</aui:validator>
						<aui:validator name="number" />
					</aui:input>
				</div>
			</div>
		</commerce-ui:panel>
	</div>
</div>