Added sla_id in Contract/Form

This commit is contained in:
Frank Schubert
2024-07-30 16:36:31 +02:00
parent b66c85bd06
commit 48f3866bc7
4 changed files with 35 additions and 7 deletions

View File

@@ -118,6 +118,18 @@
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="sla_id">SLA</label>
<div class="col-lg-10">
<select class="form-control" name="sla_id" id="sla_id">
<?php foreach(SlaModel::getAll("name DESC") as $sla): ?>
<option value="<?=$sla->id?>" <?=($contract && $contract->sla_id == $sla->id) ? "selected='selected'" : ""?>><?=$sla->name?></option>
<?php endforeach; ?>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="vatgroup_id">Umsatzsteuergruppe</label>
<div class="col-lg-10">
@@ -313,6 +325,14 @@
autoclose: true
});
$('#order_date').datepicker({
language: 'de',
format: "dd.mm.yyyy",
showWeekDays: true,
todayBtn: 'linked',
autoclose: true
});
$(".select2").select2({
allowClear: true,
placeholder: ""
@@ -422,6 +442,7 @@
p = success.result.product;
$("#vatgroup_id").val(p.vatgroup_id);
$("#price").val(p.price);
$("#sla_id").val(p.sla_id);
$("#price_setup").val(p.price_setup);
$("#price_nne").val(p.price_nne);
$("#price_nbe").val(p.price_nbe);

View File

@@ -56,6 +56,11 @@
<input type="text" class="form-control" name="filter[product_name]" id="filter_product_name" value="<?=$filter['product_name']?>" />
</div>
<div class="col-1">
<label class="form-label" for="filter_matchcode">Matchcode</label>
<input type="text" class="form-control" name="filter[matchcode]" id="filter_matchcode" value="<?=$filter['matchcode']?>" />
</div>
<div class="col-2">
<label class="form-label" for="filter_show_canceled">Gekündigte Produkte</label>
<select class="form-control" name="filter[show_canceled]" id="filter_show_canceled">

View File

@@ -749,6 +749,7 @@ class ContractController extends mfBaseController
$contract_data["product_info"] = $r->product_info;
$contract_data['amount'] = ($r->amount) ? (float)$r->amount : 1;
$contract_data['vatgroup_id'] = $r->vatgroup_id;
$contract_data['sla_id'] = (float)$r->sla_id;
$contract_data['price'] = (float)$r->price;
$contract_data['price_setup'] = (float)$r->price_setup;
$contract_data['price_nne'] = (float)$r->price_nne;
@@ -790,10 +791,6 @@ class ContractController extends mfBaseController
//var_dump($contract_data);exit;
if ($mode == "add") {

View File

@@ -48,12 +48,17 @@ class SlaModel {
return $item;
}
public static function getAll() {
public static function getAll($order = false) {
$items = [];
$_order = "name";
if($order) {
$_order = $order;
}
$db = FronkDB::singleton();
$res = $db->select("Sla", "*", "1 = 1 ORDER BY name");
$res = $db->select("Sla", "*", "1 = 1 ORDER BY $_order");
if($db->num_rows($res)) {
while($data = $db->fetch_object($res)) {
$items[] = new Sla($data);