Skip to content

Commit

Permalink
#111 update ui to handle OPTIONAL_UNLIMITED_AMOUNT policy
Browse files Browse the repository at this point in the history
  • Loading branch information
syjer committed May 22, 2017
1 parent 4e8ac23 commit d9f50ec
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,17 @@ public boolean getVatIncluded() {
}

public boolean getMandatoryOneForTicket() {
return additionalService.getSupplementPolicy() == AdditionalService.SupplementPolicy.MANDATORY_ONE_FOR_TICKET;
return getSupplementPolicy() == AdditionalService.SupplementPolicy.MANDATORY_ONE_FOR_TICKET;
}

public boolean getUnlimitedAmount() {
return getSupplementPolicy() == AdditionalService.SupplementPolicy.OPTIONAL_UNLIMITED_AMOUNT;
}

public boolean getLimitedAmount() {
return getSupplementPolicy() == null ||
getSupplementPolicy() == AdditionalService.SupplementPolicy.OPTIONAL_MAX_AMOUNT_PER_RESERVATION ||
getSupplementPolicy() == AdditionalService.SupplementPolicy.OPTIONAL_MAX_AMOUNT_PER_TICKET;
}

public BigDecimal getVatPercentage() {
Expand Down
7 changes: 5 additions & 2 deletions src/main/webapp/WEB-INF/templates/event/additional-service.ms
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,14 @@
{{#mandatoryOneForTicket}}
{{#i18n}}show-event.mandatoryOneForTicket{{/i18n}}
{{/mandatoryOneForTicket}}
{{^mandatoryOneForTicket}}
{{#unlimitedAmount}}
<input type="number" min="0" step="1" aria-labelledby="{{id}}-label" name="additionalService[{{index}}].quantity" class="form-control" placeholder="0" autocomplete="off">
{{/unlimitedAmount}}
{{#limitedAmount}}
<select aria-labelledby="{{id}}-label" name="additionalService[{{index}}].quantity" class="form-control text-align-center" placeholder="0" autocomplete="off">
{{#amountOfTickets}}<option value="{{this}}">{{this}}</option>{{/amountOfTickets}}
</select>
{{/mandatoryOneForTicket}}
{{/limitedAmount}}
{{/fixPrice}}
{{^fixPrice}}
<input type="number" min="0" step="any" name="additionalService[{{index}}].amount" class="form-control" title="">
Expand Down

0 comments on commit d9f50ec

Please sign in to comment.