added onetime payment in Order/Form

This commit is contained in:
Frank Schubert
2024-07-30 15:43:52 +02:00
parent 75277d3f82
commit b66c85bd06
4 changed files with 32 additions and 6 deletions

View File

@@ -180,7 +180,7 @@
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="price">Verkaufspreis Netto (Periodisch) *</label>
<div class="col-lg-10">
<input type="text" name="price" id="price" class="form-control" value="<?=$this::dotToComma($product->price)?>" />
<input type="text" name="price" id="price" class="form-control" value="<?=$this::dotToComma($product->price)?>" <?=(!$product->billing_period && !(float)$product->price) ? "disabled='disabled'" : ""?> />
</div>
</div>
<div class="form-group row">
@@ -334,7 +334,18 @@
$('#producttech_form').hide();
}
});
$("#billing_period").change(() => {
var price = Number.parseFloat($("#price").val().replace(",","."));
var period = Number.parseInt($("#billing_period").val());
if(!period && !price) {
$("#price").prop("disabled", true);
} else {
$("#price").prop("disabled", false);
}
});
// disable mousewheel on input number field when in focus
$('form').on('focus', 'input[type=number]', function (e) {
$(this).on('wheel.disableScroll', function (e) {