added onetime payment in Order/Form
This commit is contained in:
@@ -605,6 +605,7 @@
|
||||
<select class="form-control" name="products[<?=$i?>][billing_period]" id="billing_period-<?=$i?>" placeholder="Rechnungsperiode">
|
||||
<option value="1" <?=($product->billing_period == 1) ? "selected='selected'" : ""?>>Monatlich</option>
|
||||
<option value="12" <?=($product->billing_period == 12) ? "selected='selected'" : ""?>>Jährlich</option>
|
||||
<option value="0" <?=($product->billing_period == 0) ? "selected='selected'" : ""?>>Einmalig</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
@@ -772,6 +773,7 @@
|
||||
<select class="form-control" name="products[<?=$i?>][billing_period]" id="billing_period-<?=$i?>" placeholder="Rechnungsperiode">
|
||||
<option value="1">Monatlich</option>
|
||||
<option value="12">Jährlich</option>
|
||||
<option value="0">Einmalig</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
@@ -1244,7 +1246,15 @@
|
||||
$('#price_setup-' + id).val(p.price_setup);
|
||||
$('#price_nne-' + id).val(p.price_nne);
|
||||
$('#price_nbe-' + id).val(p.price_nbe);
|
||||
|
||||
|
||||
var period = Number.parseInt(p.billing_period);
|
||||
var price = Number.parseFloat(p.price);
|
||||
if(!period && !price) {
|
||||
$('#price-' + id).prop("disabled", true);
|
||||
} else {
|
||||
$('#price-' + id).prop("disabled", false);
|
||||
}
|
||||
|
||||
console.log(p.attributes);
|
||||
console.log("form_id: " + id);
|
||||
if(typeof p.attributes === 'object' && "termination_required" in p.attributes && p.attributes.termination_required == 1) {
|
||||
@@ -1266,6 +1276,7 @@
|
||||
} else {
|
||||
$('#voicenumber-' + id + '-line').hide();
|
||||
}
|
||||
|
||||
},
|
||||
'json');
|
||||
|
||||
@@ -1671,6 +1682,7 @@
|
||||
<select class="form-control" name="products[' + i +'][billing_period]" id="billing_period-' + i +'" placeholder="Rechnungsperiode"> \
|
||||
<option value="1">Monatlich</option> \
|
||||
<option value="12">Jährlich</option> \
|
||||
<option value="0">Einmalig</option> \
|
||||
</select> \
|
||||
</div> \
|
||||
<div class="col-2"> \
|
||||
|
||||
@@ -177,9 +177,13 @@
|
||||
<?php else: ?>
|
||||
Nur Sonderprodukte/Projekte
|
||||
<?php endif; ?>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<?=self::getUrl("Order", "Upgrades", ["filter" => $filter])?>">
|
||||
Upgrades
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<?php if($showSpecial) $lonelyOrders = $special_orders ?>
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -153,8 +153,7 @@
|
||||
<td><?=$product->producttech->name?><?=(is_array($product->attributes) && array_key_exists(TT_ATTRIB_RTRTECHCODE_NAME, $product->attributes)) ? " (".$product->attributes[TT_ATTRIB_RTRTECHCODE_NAME]->value.")" : "" ?></td>
|
||||
<td><?=__($product->producttech->customer_type)?></td>
|
||||
<td><?=$product->price?></td>
|
||||
<td><?=__($product->billing_period, "billing_period")?>
|
||||
</td>
|
||||
<td><?=__($product->billing_period, "billing_period")?></td>
|
||||
<td><?=$product->sla->name?></td>
|
||||
<td><?=$product->ivt_id?></td>
|
||||
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;">
|
||||
|
||||
Reference in New Issue
Block a user