Skip to content

Commit

Permalink
#388 - allow modifications for billing address, as the VIES webservic…
Browse files Browse the repository at this point in the history
…e can sometimes return incomplete results

- always display VAT Number on Invoice, if present
  • Loading branch information
cbellone committed Feb 14, 2018
1 parent ca0c298 commit adec050
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
4 changes: 4 additions & 0 deletions src/main/java/alfio/model/TicketReservation.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ public boolean getHasBeenPaid() {
return status == TicketReservationStatus.COMPLETE;
}

public boolean getHasVatNumber() {
return StringUtils.isNotEmpty(vatNr);
}

public List<String> getLineSplittedBillingAddress() {
if(billingAddress == null) {
return Collections.emptyList();
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/alfio/templates/invoice.ms
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
<p>{{.}}</p>
{{/ticketReservation.lineSplittedBillingAddress}}
{{/ticketReservation.hasBillingAddress}}
{{^orderSummary.displayVat}}{{#i18n}}invoice.vat{{/i18n}} {{ticketReservation.vatNr}}{{/orderSummary.displayVat}}
{{#ticketReservation.hasVatNumber}}{{#i18n}}invoice.vat{{/i18n}} {{ticketReservation.vatNr}}{{/ticketReservation.hasVatNumber}}
</td>
</tr>
</table>
Expand Down
6 changes: 0 additions & 6 deletions src/main/webapp/WEB-INF/templates/event/reservation-page.ms
Original file line number Diff line number Diff line change
Expand Up @@ -324,13 +324,7 @@
<div class="col-xs-12 {{#vatNrIsLinked}}col-md-8{{/vatNrIsLinked}}">
<div class="form-group {{#field-has-error}}[billingAddress] has-error{{/field-has-error}}" id="billing-address-container">
<label for="billing-address" class="control-label">{{#i18n}}{{billingAddressLabel}}{{/i18n}}</label>
{{^vatNrIsLinked}}
<textarea name="billingAddress" id="billing-address" class="form-control" maxlength="450" {{#invoiceIsAllowed}}data-invoice-enabled="true"{{/invoiceIsAllowed}}>{{paymentForm.billingAddress}}</textarea>
{{/vatNrIsLinked}}
{{#vatNrIsLinked}}
<input type="hidden" name="billingAddress" value="{{paymentForm.billingAddress}}"/>
<div class="form-control-static preformatted">{{paymentForm.billingAddress}}</div>
{{/vatNrIsLinked}}
{{#field-has-error}}[billingAddress]<span class="help-block text-danger">{{#i18n}}{{#field-error}}billingAddress{{/field-error}}{{/i18n}}</span>{{/field-has-error}}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/resources/js/event/reservation-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@


function disableBillingFields() {
$('#vatNr,#vatCountryCode,#billing-address[data-invoice-enabled]').attr('required', false).attr('disabled', '');
$('#vatNr,#vatCountryCode').attr('required', false).attr('disabled', '');
}

disableBillingFields();
Expand Down

0 comments on commit adec050

Please sign in to comment.