Skip to content

Commit 4df0731

Browse files
committed
#464 hide billing fields for _not_ invoice only mode
1 parent ef7b44f commit 4df0731

File tree

2 files changed

+37
-9
lines changed

2 files changed

+37
-9
lines changed

src/main/webapp/WEB-INF/templates/event/reservation-page.ms

+33-5
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@
8585
<div class="page-header">
8686
<h2>{{#i18n}}reservation-page.your-details{{/i18n}}</h2>
8787
</div>
88+
89+
{{#onlyInvoice}}
8890
<div class="row">
8991
<div class="col-xs-12">
9092
<div class="form-group {{#field-has-error}}[billingAddressCompany] has-error{{/field-has-error}}">
@@ -94,6 +96,7 @@
9496
</div>
9597
</div>
9698
</div>
99+
{{/onlyInvoice}}
97100

98101

99102
{{#useFirstAndLastName}}
@@ -133,6 +136,7 @@
133136
</div>
134137
</div>
135138

139+
{{#onlyInvoice}}
136140
<div class="row">
137141
<div class="col-xs-12">
138142
<div class="form-group {{#field-has-error}}[billingAddressLine1] has-error{{/field-has-error}}">
@@ -185,17 +189,41 @@
185189
</optgroup>
186190
</select>
187191
</div>
188-
189192
</div>
190-
</div>
191-
192-
{{#customerReferenceEnabled}}
193+
{{#customerReferenceEnabled}}
193194
<div class="form-group {{#field-has-error}}[customerReference] has-error{{/field-has-error}}">
194195
<label for="customerReference" class="control-label">{{#i18n}}common.customer-reference{{/i18n}}</label>
195196
<input type="text" name="customerReference" id="customerReference" class="form-control" maxlength="255" value="{{paymentForm.customerReference}}">
196197
{{#field-has-error}}[customerReference]<span class="help-block text-danger">{{#i18n}}{{#field-error}}customerReference{{/field-error}}{{/i18n}}</span>{{/field-has-error}}
197198
</div>
198-
{{/customerReferenceEnabled}}
199+
{{/customerReferenceEnabled}}
200+
</div>
201+
<div class="row">
202+
<div class="col-xs-12">
203+
<input type="hidden" name="invoiceRequested" id="invoice-requested" value="true">
204+
<div class="checkbox wMarginTop">
205+
<label>
206+
<input type="checkbox" name="addCompanyBillingDetails" id="add-company-billing-details" value="true" {{#paymentForm.addCompanyBillingDetails}}checked{{/paymentForm.addCompanyBillingDetails}}>
207+
{{#i18n}}reservation.add-company-billing-details [{{vatTranslation}}]{{/i18n}}
208+
</label>
209+
</div>
210+
</div>
211+
</div>
212+
<div class="row">
213+
<div id="vat-number-container">
214+
<div class="col-xs-12">
215+
<div class="form-group {{#field-has-error}}[vatNr] has-error{{/field-has-error}}">
216+
<label for="vatNr">{{#i18n}}invoice.vat [{{vatTranslation}}]{{/i18n}}</label>
217+
<div class="input-group">
218+
<div class="input-group-addon" id="selected-country-code"></div>
219+
<input id="vatNr" type="text" name="vatNr" class="form-control" value="{{paymentForm.vatNr}}"/>
220+
</div>
221+
{{#field-has-error}}[vatNr]<span class="help-block text-danger">{{#i18n}}{{#field-error}}vatNr{{/field-error}}{{/i18n}}</span>{{/field-has-error}}
222+
</div>
223+
</div>
224+
</div>
225+
</div>
226+
{{/onlyInvoice}}
199227

200228
<div class="page-header">
201229
<h2>{{#i18n}}reservation-page.attendees{{/i18n}}</h2>

src/main/webapp/resources/js/event/reservation-page.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@
200200
}
201201

202202

203-
function disableBillingFields() {
203+
/*function disableBillingFields() {
204204
$('#vatNr,#vatCountryCode').attr('required', false).attr('disabled', '');
205205
}
206206
@@ -344,7 +344,7 @@
344344
},
345345
data:frm.serialize()
346346
});
347-
});
347+
});*/
348348

349349
$("select").map(function() {
350350
var value = $(this).attr('value');
@@ -355,7 +355,7 @@
355355

356356
});
357357

358-
window.recaptchaLoadCallback = function() {
358+
/*window.recaptchaLoadCallback = function() {
359359
window.recaptchaReady = true;
360360
var methods = $('input[name=paymentMethod]');
361361
if(methods.length === 1) {
@@ -381,7 +381,7 @@
381381
});
382382
} catch(x) {}
383383
}
384-
};
384+
};*/
385385

386386

387387
})();

0 commit comments

Comments
 (0)