Billing address can be empty if owner address is set

This commit is contained in:
Frank Schubert
2021-08-09 16:47:48 +02:00
parent 93c4d036d1
commit 38d13c3326

View File

@@ -293,8 +293,8 @@
<label class="col-lg-2 col-form-label" for="billing_type">Verrechnungsart</label>
<div class="col-lg-10">
<select class="form-control" name="billing_type" id="billing_type">
<option value="invoice" <?=($order->billing_type == "invoice") ? "selected='selected'" : ""?>>Rechnung</option>
<option value="sepa" <?=($order->billing_type == "sepa") ? "selected='selected'" : ""?>>SEPA Bankeinzug</option>
<option value="invoice" <?=($order->billing_type != "sepa") ? "selected='selected'" : ""?>>Rechnung</option>
</select>
</div>
</div>
@@ -834,10 +834,15 @@
checkEmpty.push("billing_phone");
checkEmpty.push("billing_email");
}
//alert("error: " + error);
if(!$('#billingaddress_id :selected').val()) {
$('#billingaddress_id').addClass("invalid");
$('#billingaddress_id').next().find('.select2-selection').addClass('invalid');
error = true;
if(!$('#owner_id :selected').val()) {
$('#billingaddress_id').addClass("invalid");
$('#billingaddress_id').next().find('.select2-selection').addClass('invalid');
error = true;
}
}
// check bankdaten
@@ -856,7 +861,7 @@
if(checkEmpty.length) {
checkEmpty.forEach(function(field) {
if(!$("#" + field).val().length) {
console(field + " empty");
console.log(field + " empty");
$("#" + field).addClass("invalid");
error = true;
}