Products in Order Form now dynamic
This commit is contained in:
+277
-40
@@ -408,7 +408,7 @@
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="card-body" id="products-form">
|
||||
<h4>Produkte</h4>
|
||||
|
||||
<div class="row col-12 mt-2 mb-2">
|
||||
@@ -416,6 +416,7 @@
|
||||
</div>
|
||||
<div></div>
|
||||
|
||||
<?php $i = 1; ?>
|
||||
<?php if(is_array($order->products) && count($order->products)): ?>
|
||||
<?php foreach($order->products as $product): ?>
|
||||
<?php
|
||||
@@ -424,22 +425,25 @@
|
||||
if($product->product->external == 1) {
|
||||
$includes_external_product = true;
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
<div class="row product-container" id="position-<?=$product->id?>">
|
||||
<input type="hidden" name="products[<?=$product->id?>][delete]" id="products-<?=$product->id?>-delete" value="0" />
|
||||
<div class="col-md-1 product-<?=$product->id?>">
|
||||
<div class="row product-container" id="position-<?=$i?>">
|
||||
<input type="hidden" name="products[<?=$i?>][delete]" id="products-<?=$i?>-delete" value="0" />
|
||||
<input type="hidden" name="products[<?=$i?>][orderproduct_id]" value="<?=$product->id?>" />
|
||||
<div class="col-md-1 product-<?=$i?>">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<!-- pos number -->
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="pos-<?=$product->id?>">Position</label>
|
||||
<input type="number" class="form-control" name="products[<?=$product->id?>][pos]" id="pos-<?=$product->id?>" value="<?=$product->pos?>" placeholder="Position" />
|
||||
<label class="form-label" for="pos-<?=$i?>">Position</label>
|
||||
<input type="number" class="form-control" name="products[<?=$i?>][pos]" id="pos-<?=$i?>" value="<?=$i?>" placeholder="Position" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 delete-button-container">
|
||||
<i class="btn btn-outline-danger fas fa-trash-can pointer" style="font-size: 1.5em" onclick="toggleDeletePos(<?=$product->id?>)"></i>
|
||||
<i class="btn btn-outline-danger fas fa-trash-can pointer" style="font-size: 1.5em" onclick="toggleDeletePos(<?=$i?>)"></i>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -451,8 +455,8 @@
|
||||
<div class="row">
|
||||
<!-- line 1 -->
|
||||
<div class="col-4">
|
||||
<label class="form-label" for="product_id-<?=$product->id?>">Produkt</label>
|
||||
<select name="products[<?=$product->id?>][product_id]" id="product_id-<?=$product->id?>" class="form-control" onchange="updateProduct(<?=$product->id?>)">
|
||||
<label class="form-label" for="product_id-<?=$i?>">Produkt</label>
|
||||
<select name="products[<?=$i?>][product_id]" id="product_id-<?=$i?>" class="form-control select2" onchange="updateProduct(<?=$i?>)">
|
||||
<option></option>
|
||||
<?php foreach($products as $p): ?>
|
||||
<option value="<?=$p->id?>" <?=($p->id == $product->product_id) ? "selected='selected'" : ""?>><?=$p->name?></option>
|
||||
@@ -461,23 +465,23 @@
|
||||
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<label class="form-label" for="amount-<?=$product->id?>">Anzahl/Menge</label>
|
||||
<input type="number" class="form-control" name="products[<?=$product->id?>][amount]" id="amount-<?=$product->id?>" value="<?=($product) ? $product->formatAmount() : ""?>" placeholder="Anzahl/Menge" />
|
||||
<label class="form-label" for="amount-<?=$i?>">Anzahl/Menge</label>
|
||||
<input type="number" class="form-control" name="products[<?=$i?>][amount]" id="amount-<?=$i?>" value="<?=($product) ? $product->formatAmount() : ""?>" placeholder="Anzahl/Menge" />
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<label class="form-label" for="billing_period-<?=$product->id?>">Verrechungsperiode</label>
|
||||
<select class="form-control" name="products[<?=$product->id?>][billing_period]" id="billing_period-<?=$product->id?>" placeholder="Verrechnungsperiode">
|
||||
<label class="form-label" for="billing_period-<?=$i?>">Verrechungsperiode</label>
|
||||
<select class="form-control" name="products[<?=$i?>][billing_period]" id="billing_period-<?=$i?>" placeholder="Verrechnungsperiode">
|
||||
<option value="1" <?=($product->billing_period == 1) ? "selected='selected'" : ""?>>Monatlich</option>
|
||||
<option value="12" <?=($product->billing_period == 12) ? "selected='selected'" : ""?>>Jährlich</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<label class="form-label" for="price-<?=$product->id?>">Preis p. Periode</label>
|
||||
<input type="text" class="form-control" name="products[<?=$product->id?>][price]" id="price-<?=$product->id?>" value="<?=$this::dotToComma($product->price)?>" placeholder="Preis p. Periode" />
|
||||
<label class="form-label" for="price-<?=$i?>">Preis p. Periode</label>
|
||||
<input type="text" class="form-control" name="products[<?=$i?>][price]" id="price-<?=$i?>" value="<?=$this::dotToComma($product->price)?>" placeholder="Preis p. Periode" />
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<label class="form-label" for="price_setup-<?=$product->id?>">Preis Setup</label>
|
||||
<input type="text" class="form-control" name="products[<?=$product->id?>][price_setup]" id="price_setup-<?=$product->id?>" value="<?=$this::dotToComma($product->price_setup)?>" placeholder="Preis Setup" />
|
||||
<label class="form-label" for="price_setup-<?=$i?>">Preis Setup</label>
|
||||
<input type="text" class="form-control" name="products[<?=$i?>][price_setup]" id="price_setup-<?=$i?>" value="<?=$this::dotToComma($product->price_setup)?>" placeholder="Preis Setup" />
|
||||
</div>
|
||||
|
||||
|
||||
@@ -489,14 +493,14 @@
|
||||
&& $product->product->attributes[TT_ATTRIB_TERMINATION_REQUIRED_NAME]->value == 1)
|
||||
|| $product->termination_id
|
||||
): ?>
|
||||
<div class="row mt-1 mb-2" id="termination_id-<?=$product->id?>-line">
|
||||
<div class="row mt-1 mb-2" id="termination_id-<?=$i?>-line">
|
||||
<?php else: ?>
|
||||
<div class="row mt-1 mb-2 hidden" id="termination_id-<?=$product->id?>-line">
|
||||
<div class="row mt-1 mb-2 hidden" id="termination_id-<?=$i?>-line">
|
||||
<?php endif; ?>
|
||||
<!-- line to choose termination -->
|
||||
<div class="col-12">
|
||||
<label class="form-label" for="termination_id-<?=$product->id?>">Anschluss</label>
|
||||
<select name="products[<?=$product->id?>][termination_id]" id="termination_id-<?=$product->id?>" class="form-control select2">
|
||||
<label class="form-label" for="termination_id-<?=$i?>">Anschluss</label>
|
||||
<select name="products[<?=$i?>][termination_id]" id="termination_id-<?=$i?>" class="form-control select2">
|
||||
<option></option>
|
||||
<?php foreach($terminations as $t): ?>
|
||||
<option value="<?=$t->id?>" <?=($t->id == $product->termination_id) ? "selected='selected'" : ""?>><?=$t->code?> - <?=$t->getAddress()?></option>
|
||||
@@ -510,35 +514,137 @@
|
||||
<div class="row mt-1 mb-2">
|
||||
<!-- line 2 -->
|
||||
<div class="col-8">
|
||||
<label class="form-label" for="description-<?=$product->id?>" >Zusatztext</label>
|
||||
<textarea class="form-control" name="products[<?=$product->id?>][description]" id="description-<?=$product->id?>" placeholder="Zusatztext"><?=$product->description?></textarea>
|
||||
<label class="form-label" for="description-<?=$i?>" >Zusatztext</label>
|
||||
<textarea class="form-control" name="products[<?=$i?>][description]" id="description-<?=$i?>" placeholder="Zusatztext"><?=$product->description?></textarea>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<label class="form-label" for="billing_delay-<?=$product->id?>" >Verzögerter Verrechnungsstart</label>
|
||||
<input type="number" class="form-control" name="products[<?=$product->id?>][billing_delay]" id="billing_delay-<?=$product->id?>" value="<?=$product->billing_delay?>" placeholder="Freimonate" />
|
||||
<label class="form-label" for="billing_delay-<?=$i?>" >Verzögerter Verrechnungsstart</label>
|
||||
<input type="number" class="form-control" name="products[<?=$i?>][billing_delay]" id="billing_delay-<?=$i?>" value="<?=$product->billing_delay?>" placeholder="Freimonate" />
|
||||
<small>Max. 6 Monate</small>
|
||||
</div>
|
||||
<?php if($me->is("Admin")): ?>
|
||||
<div class="col-1">
|
||||
<label class="form-label" for="price_nne-<?=$product->id?>">Preis NNE</label>
|
||||
<input type="text" class="form-control" name="products[<?=$product->id?>][price_nne]" id="price_nne-<?=$product->id?>" value="<?=$this::dotToComma($product->price_nne)?>" placeholder="NNE" />
|
||||
<label class="form-label" for="price_nne-<?=$i?>">Preis NNE</label>
|
||||
<input type="text" class="form-control" name="products[<?=$i?>][price_nne]" id="price_nne-<?=$i?>" value="<?=$this::dotToComma($product->price_nne)?>" placeholder="NNE" />
|
||||
</div>
|
||||
<div class="col-1">
|
||||
<label class="form-label" for="price_nbe-<?=$product->id?>">Preis NBE</label>
|
||||
<input type="text" class="form-control" name="products[<?=$product->id?>][price_nbe]" id="price_nne-<?=$product->id?>" value="<?=$this::dotToComma($product->price_nbe)?>" placeholder="NBE" />
|
||||
<label class="form-label" for="price_nbe-<?=$i?>">Preis NBE</label>
|
||||
<input type="text" class="form-control" name="products[<?=$i?>][price_nbe]" id="price_nne-<?=$i?>" value="<?=$this::dotToComma($product->price_nbe)?>" placeholder="NBE" />
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php $i++; ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="row product-container">
|
||||
|
||||
<!-- New position -->
|
||||
<div class="row product-container" id="position-<?=$i?>">
|
||||
<div class="col-md-1 product-<?=$i?>">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<!-- pos number -->
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="pos-<?=$i?>">Position</label>
|
||||
<input type="number" class="form-control" name="products[<?=$i?>][pos]" id="pos-<?=$i?>" value="<?=$i?>" placeholder="Position" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 delete-button-container">
|
||||
<i class="btn btn-outline-info fas fa-trash-can pointer" title="Inhalte löschen" style="font-size: 1.5em" onclick="clearNewPos(<?=$i?>)"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-11">
|
||||
<!-- product lines -->
|
||||
<div class="row">
|
||||
<!-- line 1 -->
|
||||
<div class="col-4">
|
||||
<label class="form-label" for="product_id-<?=$i?>">Produkt</label>
|
||||
<select name="products[<?=$i?>][product_id]" id="product_id-<?=$i?>" class="form-control select2" onchange="updateProduct(<?=$i?>)">
|
||||
<option></option>
|
||||
<?php foreach($products as $p): ?>
|
||||
<option value="<?=$p->id?>"><?=$p->name?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<label class="form-label" for="amount-<?=$i?>">Anzahl/Menge</label>
|
||||
<input type="number" class="form-control" name="products[<?=$i?>][amount]" id="amount-<?=$i?>" value="" placeholder="Anzahl/Menge" />
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<label class="form-label" for="billing_period-<?=$i?>">Verrechungsperiode</label>
|
||||
<select class="form-control" name="products[<?=$i?>][billing_period]" id="billing_period-<?=$i?>" placeholder="Verrechnungsperiode">
|
||||
<option value="1">Monatlich</option>
|
||||
<option value="12">Jährlich</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<label class="form-label" for="price-<?=$i?>">Preis p. Periode</label>
|
||||
<input type="text" class="form-control" name="products[<?=$i?>][price]" id="price-<?=$i?>" value="" placeholder="Preis p. Periode" />
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<label class="form-label" for="price_setup-<?=$i?>">Preis Setup</label>
|
||||
<input type="text" class="form-control" name="products[<?=$i?>][price_setup]" id="price_setup-<?=$i?>" value="" placeholder="Preis Setup" />
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row mt-1 mb-2 hidden" id="termination_id-<?=$i?>-line">
|
||||
<!-- line to choose termination -->
|
||||
<div class="col-12">
|
||||
<label class="form-label" for="termination_id-<?=$i?>">Anschluss</label>
|
||||
<select name="products[<?=$i?>][termination_id]" id="termination_id-<?=$i?>" class="form-control select2">
|
||||
<option></option>
|
||||
<?php foreach($terminations as $t): ?>
|
||||
<option value="<?=$t->id?>"><?=$t->code?> - <?=$t->getAddress()?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="row mt-1 mb-2">
|
||||
<!-- line 2 -->
|
||||
<div class="col-8">
|
||||
<label class="form-label" for="description-<?=$i?>" >Zusatztext</label>
|
||||
<textarea class="form-control" name="products[<?=$i?>][description]" id="description-<?=$i?>" placeholder="Zusatztext"></textarea>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<label class="form-label" for="billing_delay-<?=$i?>" >Verzögerter Verrechnungsstart</label>
|
||||
<input type="number" class="form-control" name="products[<?=$i?>][billing_delay]" id="billing_delay-<?=$i?>" value="" placeholder="Freimonate" />
|
||||
<small>Max. 6 Monate</small>
|
||||
</div>
|
||||
<?php if($me->is("Admin")): ?>
|
||||
<div class="col-1">
|
||||
<label class="form-label" for="price_nne-<?=$i?>">Preis NNE</label>
|
||||
<input type="text" class="form-control" name="products[<?=$i?>][price_nne]" id="price_nne-<?=$i?>" value="" placeholder="NNE" />
|
||||
</div>
|
||||
<div class="col-1">
|
||||
<label class="form-label" for="price_nbe-<?=$i?>">Preis NBE</label>
|
||||
<input type="text" class="form-control" name="products[<?=$i?>][price_nbe]" id="price_nne-<?=$i?>" value="" placeholder="NBE" />
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!--<div class="row product-container" id="position-<?=$i?>">
|
||||
|
||||
<div class="col-md-1 product-new">
|
||||
<!-- pos number -->
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="pos-new" >Position</label>
|
||||
<input type="number" class="form-control" name="products[new][pos]" id="pos-new" value="<?=$order->products['new']['pos']?>" placeholder="Position" />
|
||||
@@ -546,9 +652,9 @@
|
||||
</div>
|
||||
|
||||
<div class="col-md-11">
|
||||
<!-- product lines -->
|
||||
|
||||
<div class="row">
|
||||
<!-- line 1 -->
|
||||
|
||||
<div class="col-4">
|
||||
<label class="form-label" for="product_id-new">Produkt</label>
|
||||
<select name="products[new][product_id]" id="product_id-new" class="form-control" onchange="updateProduct('new')">
|
||||
@@ -584,7 +690,7 @@
|
||||
</div>
|
||||
|
||||
<div class="row mt-1 mb-2 <?=($order->action != "Save") ? "hidden" : ""?>" id="termination_id-new-line">
|
||||
<!-- line to choose termination -->
|
||||
|
||||
<div class="col-12">
|
||||
<label class="form-label" for="termination_id-new">Anschluss</label>
|
||||
<select name="products[new][termination_id]" id="termination_id-new" class="form-control">
|
||||
@@ -597,7 +703,7 @@
|
||||
</div>
|
||||
|
||||
<div class="row mt-1 mb-2">
|
||||
<!-- line 2 -->
|
||||
|
||||
<div class="col-8">
|
||||
<label class="form-label" for="description-new" >Zusatztext</label>
|
||||
<textarea class="form-control" name="products[new][description]" id="description-new" placeholder="Zusatztext"><?=$order->products['new']['description']?></textarea>
|
||||
@@ -623,7 +729,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -739,7 +845,8 @@
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2"></label>
|
||||
<div class="col-lg-10">
|
||||
<button type="submit" class="btn btn-primary">Speichern</button>
|
||||
<button type="submit" name="return" value="form" class="btn btn-primary mr-1">Speichern</button>
|
||||
<button type="submit" name="return" value="index" class="btn btn-primary">Speichern und zur Übersicht</button>
|
||||
<span id="form-error" class="text-danger hidden">Bitte alle benötigten Felder ausfüllen!</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -758,10 +865,10 @@
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
/*$("#owner_id").select2({
|
||||
$(".select2").select2({
|
||||
allowClear: true,
|
||||
placeholder: ""
|
||||
});*/
|
||||
});
|
||||
/*$("#billingaddress_id").select2({
|
||||
allowClear: true,
|
||||
placeholder: ""
|
||||
@@ -1004,6 +1111,8 @@
|
||||
},
|
||||
'json');
|
||||
|
||||
addNewProductLine(Number(id) + 1);
|
||||
|
||||
}
|
||||
|
||||
/*********************
|
||||
@@ -1197,7 +1306,11 @@
|
||||
$("#files-table a.delete-button").removeAttr("href").removeAttr("onclick");
|
||||
$("#contract-readonly-notice").show();
|
||||
<?php endif; ?>
|
||||
});
|
||||
|
||||
$('.product-container input').each(function() {
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
function toggleDeletePos(id) {
|
||||
@@ -1230,6 +1343,130 @@
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function addNewProductLine(i) {
|
||||
if(!i) {
|
||||
return;
|
||||
}
|
||||
|
||||
console.log("new_line num " + i);
|
||||
|
||||
if($('#position-' + i).length) {
|
||||
console.log("gibts scho");
|
||||
return;
|
||||
}
|
||||
|
||||
var new_line = '<div class="row product-container" id="position-' + i +'"> \
|
||||
<div class="col-md-1 product-' + i +'"> \
|
||||
<div class="row"> \
|
||||
<div class="col-md-12"> \
|
||||
<div class="form-group"> \
|
||||
<label class="form-label" for="pos-' + i +'">Position</label> \
|
||||
<input type="number" class="form-control" name="products[' + i +'][pos]" id="pos-' + i +'" value="' + i +'" placeholder="Position" /> \
|
||||
</div> \
|
||||
</div> \
|
||||
</div> \
|
||||
<div class="row"> \
|
||||
<div class="col-md-12 delete-button-container"> \
|
||||
<i class="btn btn-outline-info fas fa-trash-can pointer" title="Inhalte löschen" style="font-size: 1.5em" onclick="clearNewPos(' + i +')"></i> \
|
||||
</div> \
|
||||
</div> \
|
||||
</div> \
|
||||
\
|
||||
<div class="col-md-11"> \
|
||||
<!-- product lines --> \
|
||||
<div class="row"> \
|
||||
<!-- line 1 --> \
|
||||
<div class="col-4"> \
|
||||
<label class="form-label" for="product_id-' + i +'">Produkt</label> \
|
||||
<select name="products[' + i +'][product_id]" id="product_id-' + i +'" class="form-control select2" onchange="updateProduct(' + i +')"> \
|
||||
<option></option>';
|
||||
<?php foreach($products as $p): ?>
|
||||
new_line += '<option value="<?=$p->id?>"><?=$p->name?></option>';
|
||||
<?php endforeach; ?>
|
||||
|
||||
new_line += '</select> \
|
||||
\
|
||||
</div> \
|
||||
<div class="col-2"> \
|
||||
<label class="form-label" for="amount-' + i +'">Anzahl/Menge</label> \
|
||||
<input type="number" class="form-control" name="products[' + i +'][amount]" id="amount-' + i +'" value="" placeholder="Anzahl/Menge" /> \
|
||||
</div> \
|
||||
<div class="col-2"> \
|
||||
<label class="form-label" for="billing_period-' + i +'">Verrechungsperiode</label> \
|
||||
<select class="form-control" name="products[' + i +'][billing_period]" id="billing_period-' + i +'" placeholder="Verrechnungsperiode"> \
|
||||
<option value="1">Monatlich</option> \
|
||||
<option value="12">Jährlich</option> \
|
||||
</select> \
|
||||
</div> \
|
||||
<div class="col-2"> \
|
||||
<label class="form-label" for="price-' + i +'">Preis p. Periode</label> \
|
||||
<input type="text" class="form-control" name="products[' + i +'][price]" id="price-' + i +'" value="" placeholder="Preis p. Periode" /> \
|
||||
</div> \
|
||||
<div class="col-2"> \
|
||||
<label class="form-label" for="price_setup-' + i +'">Preis Setup</label> \
|
||||
<input type="text" class="form-control" name="products[' + i +'][price_setup]" id="price_setup-' + i +'" value="" placeholder="Preis Setup" /> \
|
||||
</div> \
|
||||
</div> \
|
||||
\
|
||||
<div class="row mt-1 mb-2 hidden" id="termination_id-' + i +'-line"> \
|
||||
<!-- line to choose termination --> \
|
||||
<div class="col-12"> \
|
||||
<label class="form-label" for="termination_id-' + i +'">Anschluss</label> \
|
||||
<select name="products[' + i +'][termination_id]" id="termination_id-' + i +'" class="form-control select2"> \
|
||||
<option></option>';
|
||||
|
||||
<?php foreach($terminations as $t): ?>
|
||||
new_line += '<option value="<?=$t->id?>"><?=$t->code?> - <?=$t->getAddress(true)?></option>';
|
||||
<?php endforeach; ?>
|
||||
new_line += '</select> \
|
||||
</div> \
|
||||
</div> \
|
||||
\
|
||||
<div class="row mt-1 mb-2"> \
|
||||
<!-- line 2 --> \
|
||||
<div class="col-8"> \
|
||||
<label class="form-label" for="description-' + i +'" >Zusatztext</label> \
|
||||
<textarea class="form-control" name="products[' + i +'][description]" id="description-' + i +'" placeholder="Zusatztext"></textarea> \
|
||||
</div> \
|
||||
<div class="col-2"> \
|
||||
<label class="form-label" for="billing_delay-' + i +'" >Verzögerter Verrechnungsstart</label> \
|
||||
<input type="number" class="form-control" name="products[' + i +'][billing_delay]" id="billing_delay-' + i + '" value="" placeholder="Freimonate" /> \
|
||||
<small>Max. 6 Monate</small> \
|
||||
</div> \
|
||||
<?php if($me->is("Admin")): ?>
|
||||
<div class="col-1"> \
|
||||
<label class="form-label" for="price_nne-' + i +'">Preis NNE</label> \
|
||||
<input type="text" class="form-control" name="products[' + i +'][price_nne]" id="price_nne-' + i +'" value="" placeholder="NNE" /> \
|
||||
</div> \
|
||||
<div class="col-1"> \
|
||||
<label class="form-label" for="price_nbe-' + i +'">Preis NBE</label> \
|
||||
<input type="text" class="form-control" name="products[' + i +'][price_nbe]" id="price_nne-' + i +'" value="" placeholder="NBE" /> \
|
||||
</div> \
|
||||
<?php endif; ?>
|
||||
\
|
||||
</div> \
|
||||
</div> \
|
||||
</div> \
|
||||
';
|
||||
|
||||
$('#products-form').append(new_line);
|
||||
|
||||
$("#product_id-" + i).select2({
|
||||
allowClear: true,
|
||||
placeholder: ""
|
||||
});
|
||||
}
|
||||
|
||||
function clearNewPos(i) {
|
||||
if(!$('#position-' + i).length) {
|
||||
return;
|
||||
}
|
||||
|
||||
$('#position-' + i).remove();
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/footer.php"); ?>
|
||||
|
||||
Reference in New Issue
Block a user