Skip to content

Commit

Permalink
fix #453 - add country in billing address if data has been validated …
Browse files Browse the repository at this point in the history
…from VAT Checker
  • Loading branch information
cbellone committed May 25, 2018
1 parent 62fb6cb commit 9e419bb
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import java.util.stream.Collectors;

import static alfio.model.PriceContainer.VatStatus.*;
import static org.apache.commons.lang3.StringUtils.isNotBlank;
import static org.apache.commons.lang3.StringUtils.isNotEmpty;

@RestController
Expand Down Expand Up @@ -144,6 +145,9 @@ public ResponseEntity<VatDetail> validateEUVat(@PathVariable("eventName") String
.ifPresent(t -> {
VatDetail vd = t.getRight();
String billingAddress = vd.getName() + "\n" + vd.getAddress();
if(isNotBlank(vd.getName()) || isNotBlank(vd.getAddress())) {
billingAddress = billingAddress.trim() + "\n" + new Locale("", country).getDisplayCountry(locale);
}
PriceContainer.VatStatus vatStatus = determineVatStatus(t.getLeft().getVatStatus(), t.getRight().isVatExempt());
ticketReservationRepository.updateBillingData(vatStatus, vd.getVatNr(), country, paymentForm.isInvoiceRequested(), reservationId);
OrderSummary orderSummary = ticketReservationManager.orderSummaryForReservationId(reservationId, t.getLeft(), Locale.forLanguageTag(t.getMiddle().getUserLanguage()));
Expand Down

0 comments on commit 9e419bb

Please sign in to comment.