Merge branch 'fronkdev' of code.fronk.at:fronk/thetool into fronkdev
This commit is contained in:
@@ -34,6 +34,8 @@ endforeach;
|
|||||||
type="text/css"/>
|
type="text/css"/>
|
||||||
<link href="<?= self::getResourcePath() ?>css/pages/Calendar/View.css?<?= $git_merge_ts ?>" rel="stylesheet"
|
<link href="<?= self::getResourcePath() ?>css/pages/Calendar/View.css?<?= $git_merge_ts ?>" rel="stylesheet"
|
||||||
type="text/css"/>
|
type="text/css"/>
|
||||||
|
<link href="<?= self::getResourcePath() ?>plugins/summernote/summernote-bs4.min.css" rel="stylesheet">
|
||||||
|
|
||||||
<script type="text/javascript"
|
<script type="text/javascript"
|
||||||
src="<?= self::getResourcePath() ?>assets/js/calendar/rrule/rrule.min.js?<?= $git_merge_ts ?>"></script>
|
src="<?= self::getResourcePath() ?>assets/js/calendar/rrule/rrule.min.js?<?= $git_merge_ts ?>"></script>
|
||||||
<script type="text/javascript"
|
<script type="text/javascript"
|
||||||
@@ -645,7 +647,10 @@ endforeach;
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="output"></div>
|
<div id="output"></div>
|
||||||
<script type="text/javascript" src="<?= self::getResourcePath() ?>plugins/select2/js/i18n/de.js"></script>
|
<script type="text/javascript" src="<?= self::getResourcePath() ?>plugins/select2/js/i18n/de.js?<?= $git_merge_ts ?>"></script>
|
||||||
|
<script type="text/javascript" src="<?=self::getResourcePath()?>plugins/summernote/summernote-bs4.min.js?<?= $git_merge_ts ?>"></script>
|
||||||
|
<script type="text/javascript" src="<?=self::getResourcePath()?>plugins/summernote/lang/summernote-de-DE.min.js?<?= $git_merge_ts ?>"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
let requestUrl = "<?= self::getUrl("Calendar", "api", ['do' => 'getCalendarEvents']) ?>";
|
let requestUrl = "<?= self::getUrl("Calendar", "api", ['do' => 'getCalendarEvents']) ?>";
|
||||||
let requestEventUrl = "<?= self::getUrl("Calendar", "api", ['do' => 'getCalendarEvent']) ?>";
|
let requestEventUrl = "<?= self::getUrl("Calendar", "api", ['do' => 'getCalendarEvent']) ?>";
|
||||||
@@ -669,7 +674,7 @@ endforeach;
|
|||||||
var birthdays = [];
|
var birthdays = [];
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$counter = 10000;
|
$counter = 1000000;
|
||||||
foreach ($timerecordingholidays as $timerecordingholiday) :?>
|
foreach ($timerecordingholidays as $timerecordingholiday) :?>
|
||||||
holiDays.push({
|
holiDays.push({
|
||||||
id: <?= $counter ?>,
|
id: <?= $counter ?>,
|
||||||
|
|||||||
@@ -269,6 +269,8 @@
|
|||||||
<p>Energie Steiermark Breitband GmbH</p>
|
<p>Energie Steiermark Breitband GmbH</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="page"> </div>
|
||||||
|
|
||||||
<div class="page">
|
<div class="page">
|
||||||
|
|
||||||
<p class="text-right">
|
<p class="text-right">
|
||||||
@@ -410,7 +412,7 @@
|
|||||||
<div class="borderpoint">
|
<div class="borderpoint">
|
||||||
<h3>Übersichtsplan / Planskizze</h3>
|
<h3>Übersichtsplan / Planskizze</h3>
|
||||||
|
|
||||||
<?php if($consent->file): ?>
|
<?php if($consent->file && $consent->file->file_id && $consent->file->file->fileExists()): ?>
|
||||||
<img src="<?=$consent->file->file->asDataUrl()?>" style="max-width: 640px; max-height: 640px; border: 1px solid #000" />
|
<img src="<?=$consent->file->file->asDataUrl()?>" style="max-width: 640px; max-height: 640px; border: 1px solid #000" />
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -55,9 +55,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label class="col-lg-2 col-form-label" for="name">Name</label>
|
<label class="col-lg-2 col-form-label" for="name">Name*</label>
|
||||||
<div class="col-lg-10">
|
<div class="col-lg-10">
|
||||||
<input type="text" class="form-control" name="name" id="name" value="<?=(isset($item)) ? $item->name : ""?>" placeholder="z.B. Straße oder Adresse" />
|
<input type="text" class="form-control" name="name" id="name" value="<?=(isset($item)) ? $item->name : ""?>" placeholder="z.B. Straße oder Adresse" data-toggle="popover" data-trigger="focus" data-placement="left" data-content="Wird in der Zustimmungserklärung in der Objektanschrift verwendet." />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -119,6 +119,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr />
|
<hr />
|
||||||
|
|
||||||
|
<div id="usage-container">
|
||||||
<h4>Nutzung</h4>
|
<h4>Nutzung</h4>
|
||||||
|
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
@@ -128,6 +130,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id="usage-checkbox-container" class="<?=(isset($item) && $item->object_type == "building") ? "hidden": ""?>">
|
||||||
<div class="form-group row mt-3">
|
<div class="form-group row mt-3">
|
||||||
<div class="col-lg-2"></div>
|
<div class="col-lg-2"></div>
|
||||||
<div class="col-lg-10">
|
<div class="col-lg-10">
|
||||||
@@ -168,8 +171,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr />
|
</div>
|
||||||
|
|
||||||
|
<hr />
|
||||||
<h4>Planskizze / Bilddatei</h4>
|
<h4>Planskizze / Bilddatei</h4>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label class="col-lg-2 col-form-label"></label>
|
<label class="col-lg-2 col-form-label"></label>
|
||||||
@@ -197,18 +201,10 @@
|
|||||||
|
|
||||||
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<h5 class="card-header">Plan Vorschau</h5>
|
<h5 class="card-header">Plan Vorschau <button type='button' id="delete-rimo-plan" class='ml-2 btn btn-sm btn-outline-danger pointer <?=($item->file && $item->file->file && $item->file->file->fileExists()) ? "" : "hidden" ?>' onclick='deletePlan()'><i class='fas fa-fw fa-trash'></i> Plan löschen</button></h5>
|
||||||
<div class="card-body" id="rimo-plan-container">
|
<div class="card-body" id="rimo-plan-container">
|
||||||
<input type="hidden" name="submit_plan_file_id" id="submit_plan_file_id" value="" />
|
<input type="hidden" name="submit_plan_file_id" id="submit_plan_file_id" value="" />
|
||||||
<img id="plan_preview" style="max-width: 1200px;" <?=($item->file) ? "src=".$item->file->file->asDataUrl()."" : "" ?> />
|
<img id="plan_preview" style="max-width: 1200px;" <?=($item->file && $item->file->file && $item->file->file->fileExists()) ? "src=".$item->file->file->asDataUrl()."" : "" ?> />
|
||||||
<div class="row mt-2">
|
|
||||||
<div class="col">
|
|
||||||
<button type="button" class="btn btn-outline-danger hidden" id="delete-rimo-plan" onclick="deleteRimoPlan()">
|
|
||||||
<i class="far fa-fw fa-trash-alt"></i> Plan löschen
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -268,11 +264,13 @@
|
|||||||
$("#adb_hausnummer_id").val("").change();
|
$("#adb_hausnummer_id").val("").change();
|
||||||
|
|
||||||
$("#street-search").show();
|
$("#street-search").show();
|
||||||
|
$("#usage-checkbox-container").show();
|
||||||
} else {
|
} else {
|
||||||
$("#street-search").hide();
|
$("#street-search").hide();
|
||||||
$("#adb_strasse_id").val("").change();
|
$("#adb_strasse_id").val("").change();
|
||||||
|
|
||||||
$("#address-search").show();
|
$("#address-search").show();
|
||||||
|
$("#usage-checkbox-container").hide();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -363,6 +361,7 @@
|
|||||||
var [file] = $("#consent_plan_image").prop("files");
|
var [file] = $("#consent_plan_image").prop("files");
|
||||||
if(file) {
|
if(file) {
|
||||||
$("#plan_preview").attr("src", URL.createObjectURL(file));
|
$("#plan_preview").attr("src", URL.createObjectURL(file));
|
||||||
|
$("#delete-rimo-plan").show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -371,11 +370,19 @@
|
|||||||
$("#adb_strasse_id").val("").change();
|
$("#adb_strasse_id").val("").change();
|
||||||
});
|
});
|
||||||
|
|
||||||
function deleteRimoPlan() {
|
function deletePlan() {
|
||||||
$('#plan_adb_hausnummer_id').val("");
|
$('#plan_adb_hausnummer_id').val("").change();
|
||||||
$("#submit_plan_file_id").val();
|
$("#submit_plan_file_id").val("");
|
||||||
$("#plan_preview").attr("src", "");
|
$("#plan_preview").attr("src", "");
|
||||||
$("#delete-rimo-plan").hide();
|
$("#delete-rimo-plan").hide();
|
||||||
|
$("#consent_plan_image").val("");
|
||||||
|
|
||||||
|
<?php if(isset($item) && $item->id): ?>
|
||||||
|
$.post("<?=self::getUrl("ConstructionConsent", "api")?>", {
|
||||||
|
do: "deleteRimoPlan",
|
||||||
|
id: <?=$item->id?>
|
||||||
|
});
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -391,6 +398,30 @@
|
|||||||
$("#gstnr").val(kg + gst);
|
$("#gstnr").val(kg + gst);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$(window).bind("paste", (e) => {
|
||||||
|
var files = e.originalEvent.clipboardData.files;
|
||||||
|
if(files.length > 0) {
|
||||||
|
$("#consent_plan_image").prop("files", files);
|
||||||
|
$("#consent_plan_image").change();
|
||||||
|
window.notify("info", "Plan aus Zwischenablage übernommen.");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$(document).ready(function(){
|
||||||
|
$('[data-toggle="popover"]').popover();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
<style>
|
||||||
|
.popover {
|
||||||
|
background-color: #ffff99;
|
||||||
|
}
|
||||||
|
.popover .arrow::after {
|
||||||
|
border-top-color: #ffff99;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|
||||||
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>
|
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>
|
||||||
@@ -112,11 +112,7 @@ $pagination_entity_name = "Zustimmungserklärungen";
|
|||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Objekttyp</th>
|
<th>Objekttyp</th>
|
||||||
<th>Objektadresse</th>
|
<th>Objektadresse</th>
|
||||||
<!-- <th title="Grundstücksnummer">GST-Nr.</th>-->
|
<th>GST-Nr.</th>
|
||||||
<!-- <th title="Grundbuch Einlagezahl">EZ</th>-->
|
|
||||||
<!-- <th>Besitzer</th>-->
|
|
||||||
<!-- <th>Besitzer Adresse</th>-->
|
|
||||||
<!-- <th>Besitzer Kontakt</th>-->
|
|
||||||
<th>Anfragestatus</th>
|
<th>Anfragestatus</th>
|
||||||
<th>Anfrageresultat</th>
|
<th>Anfrageresultat</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
@@ -137,24 +133,7 @@ $pagination_entity_name = "Zustimmungserklärungen";
|
|||||||
<?=$item->adb_hausnummer->strasse->gemeinde->name?>
|
<?=$item->adb_hausnummer->strasse->gemeinde->name?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</td>
|
</td>
|
||||||
<!-- <td>--><?php //=$item->gstnr?><!--</td>-->
|
<td><?=$item->gst?></td>
|
||||||
<!-- <td>--><?php //=$item->ez?><!--</td>-->
|
|
||||||
<!-- <td>--><?php //=$item->owner_name?><!--</td>-->
|
|
||||||
<!-- <td>-->
|
|
||||||
<!-- --><?php //=$item->owner_street?><!--<br />-->
|
|
||||||
<!-- --><?php //=$item->owner_zip?><!-- --><?php //=$item->owner_city?><!--<br />-->
|
|
||||||
<!-- </td>-->
|
|
||||||
<!-- <td>-->
|
|
||||||
<!-- --><?php //if($item->phone): ?>
|
|
||||||
<!-- Tel: --><?php //=$item->phone?><!--<br />-->
|
|
||||||
<!-- --><?php //endif; ?>
|
|
||||||
<!-- --><?php //if($item->fax): ?>
|
|
||||||
<!-- Fax: --><?php //=$item->fax?><!--<br />-->
|
|
||||||
<!-- --><?php //endif; ?>
|
|
||||||
<!-- --><?php //if($item->email): ?>
|
|
||||||
<!-- Email: --><?php //=$item->email?>
|
|
||||||
<!-- --><?php //endif; ?>
|
|
||||||
<!-- </td>-->
|
|
||||||
<td><?=($item->status) ? __($item->status,"consent") : ""?></td>
|
<td><?=($item->status) ? __($item->status,"consent") : ""?></td>
|
||||||
<td>
|
<td>
|
||||||
<?php
|
<?php
|
||||||
@@ -177,9 +156,8 @@ $pagination_entity_name = "Zustimmungserklärungen";
|
|||||||
<?php if(!$item->result): ?>
|
<?php if(!$item->result): ?>
|
||||||
<a href="<?=self::getUrl("ConstructionConsent", "edit", ["id" => $item->id])?>"><i class="far fa-edit" title="Bearbeiten"></i></a>
|
<a href="<?=self::getUrl("ConstructionConsent", "edit", ["id" => $item->id])?>"><i class="far fa-edit" title="Bearbeiten"></i></a>
|
||||||
|
|
||||||
<?php if($item->status == "new"): ?>
|
|
||||||
<a href="<?=self::getUrl("ConstructionConsent", "delete", ["id" => $item->id])?>" onclick="if(!confirm('Zustimmungserklärung wirklich löschen?')) return false;" class="text-danger" title="Löschen"><i class="fas fa-trash"></i></a>
|
<a href="<?=self::getUrl("ConstructionConsent", "delete", ["id" => $item->id])?>" onclick="if(!confirm('Zustimmungserklärung wirklich löschen?')) return false;" class="text-danger" title="Löschen"><i class="fas fa-trash"></i></a>
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|||||||
@@ -95,6 +95,10 @@ $mindate = date("Y-m-d", strtotime("+ 1 Month", $closedmonth));
|
|||||||
.holiday-text {
|
.holiday-text {
|
||||||
color: #d70000;
|
color: #d70000;
|
||||||
}
|
}
|
||||||
|
.height-unset
|
||||||
|
{
|
||||||
|
height: unset;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
<!-- start page title -->
|
<!-- start page title -->
|
||||||
@@ -314,16 +318,12 @@ $mindate = date("Y-m-d", strtotime("+ 1 Month", $closedmonth));
|
|||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="col text-center">
|
<div class="col text-center">
|
||||||
<div class="input-group ">
|
<div class="input-group ">
|
||||||
<label class="col-form-label form-control"><span
|
<label class="col-form-label form-control height-unset"><span class="text-bold">Sollzeit: </span><span id="must-time" class="ml-1 text-normal"></span></label>
|
||||||
class="text-bold">Sollzeit: </span><span id="must-time"
|
|
||||||
class="ml-1 text-normal"></span></label>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col text-center">
|
<div class="col text-center">
|
||||||
<div class="input-group ">
|
<div class="input-group ">
|
||||||
<label class="col-form-label form-control"><span class="text-bold">Istzeit: </span><span
|
<label class="col-form-label form-control height-unset"><span class="text-bold">Istzeit: </span><span id="is-time" class="ml-1 text-normal"></span></label>
|
||||||
id="is-time"
|
|
||||||
class="ml-1 text-normal"></span></label>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -332,19 +332,32 @@ $mindate = date("Y-m-d", strtotime("+ 1 Month", $closedmonth));
|
|||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="col text-center">
|
<div class="col text-center">
|
||||||
<div class="input-group ">
|
<div class="input-group ">
|
||||||
<label class="col-form-label form-control fixed-state"><span
|
<label class="col-form-label form-control fixed-state height-unset"><span
|
||||||
class="text-bold">Urlaubstage: </span><span id="holidays"
|
class="text-bold">Urlaubstage: </span><span id="holidays"
|
||||||
class="ml-1 text-normal"></span></label>
|
class="ml-1 text-normal"></span></label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col text-center">
|
<div class="col text-center">
|
||||||
<div class="input-group ">
|
<div class="input-group ">
|
||||||
<label id="plushours-label" class="col-form-label form-control fixed-state"><span
|
<label id="plushours-label" class="col-form-label form-control fixed-state height-unset"><span
|
||||||
class="text-bold">Gutzeit: </span><span
|
class="text-bold">Gutzeit: </span><span
|
||||||
id="plushours"
|
id="plushours"
|
||||||
class="ml-1 text-normal"></span></label>
|
class="ml-1 text-normal"></span></label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-2" id="AllHours-div" style="display: none">
|
||||||
|
<div class="form-row">
|
||||||
|
<div class="col text-center">
|
||||||
|
<div class="input-group ">
|
||||||
|
<label class="col-form-label form-control height-unset"><span
|
||||||
|
class="text-bold">Gesamtzeit: </span><span id="AllHours"
|
||||||
|
class="ml-1 text-normal"></span></label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -17,10 +17,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.customer-details {
|
.customer-details {
|
||||||
vertical-align: bottom;
|
vertical-align: top;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
padding-left: 30pt;
|
|
||||||
width: 35%;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.invoice-details {
|
.invoice-details {
|
||||||
@@ -58,8 +56,8 @@
|
|||||||
|
|
||||||
<table style="width: 100%; border-collapse: collapse;">
|
<table style="width: 100%; border-collapse: collapse;">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="customer-details" style="float: left">
|
<td class="customer-details">
|
||||||
<h3>Lieferant</h3>
|
<h3>{{ addressLine_header }}</h3>
|
||||||
<div>{{ addressLine_1 }}</div>
|
<div>{{ addressLine_1 }}</div>
|
||||||
<div>{{ addressLine_2 }}</div>
|
<div>{{ addressLine_2 }}</div>
|
||||||
<div>{{ addressLine_3 }}</div>
|
<div>{{ addressLine_3 }}</div>
|
||||||
@@ -67,8 +65,15 @@
|
|||||||
<div style="margin-bottom: 12pt"></div>
|
<div style="margin-bottom: 12pt"></div>
|
||||||
<div>{{ externalReference }}</div>
|
<div>{{ externalReference }}</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="customer-details" align="top">
|
<td class="customer-details">
|
||||||
<h3>Rechnungsadresse</h3>
|
<h3>{{ shippingAddressLine_header }}</h3>
|
||||||
|
<div>{{ shippingAddressLine_1 }}</div>
|
||||||
|
<div>{{ shippingAddressLine_2 }}</div>
|
||||||
|
<div>{{ shippingAddressLine_3 }}</div>
|
||||||
|
<div>{{ shippingAddressLine_4 }}</div>
|
||||||
|
</td>
|
||||||
|
<td class="customer-details">
|
||||||
|
<h3>{{ billingAddressLine_header }}</h3>
|
||||||
<div>{{ billingAddressLine_1 }}</div>
|
<div>{{ billingAddressLine_1 }}</div>
|
||||||
<div>{{ billingAddressLine_2 }}</div>
|
<div>{{ billingAddressLine_2 }}</div>
|
||||||
<div>{{ billingAddressLine_3 }}</div>
|
<div>{{ billingAddressLine_3 }}</div>
|
||||||
@@ -76,12 +81,6 @@
|
|||||||
<div>{{ billingAddressLine_5 }}</div>
|
<div>{{ billingAddressLine_5 }}</div>
|
||||||
<div>{{ billingAddressLine_6 }}</div>
|
<div>{{ billingAddressLine_6 }}</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="customer-details" style="float: right">
|
|
||||||
<div>{{ shippingAddressLine_1 }}</div>
|
|
||||||
<div>{{ shippingAddressLine_2 }}</div>
|
|
||||||
<div>{{ shippingAddressLine_3 }}</div>
|
|
||||||
<div>{{ shippingAddressLine_4 }}</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|||||||
@@ -6,12 +6,50 @@
|
|||||||
* @var Array $textElements
|
* @var Array $textElements
|
||||||
*/
|
*/
|
||||||
$this->setReturnValue(['filename' => $order["id"] . ".pdf"]);
|
$this->setReturnValue(['filename' => $order["id"] . ".pdf"]);
|
||||||
|
|
||||||
|
|
||||||
|
$texts = [
|
||||||
|
'EN' => [
|
||||||
|
'header' => 'XINON Supplier Order from ' . date("d.m.Y", $order["create"]),
|
||||||
|
'sum' => 'Sum',
|
||||||
|
'vat' => '20% VAT',
|
||||||
|
'total' => 'Total',
|
||||||
|
'taxFree' => 'Please provide tax-free delivery according to § 6a UStG (Austrian Sales tax law).<br>Our VAT ID number: ATU68711968. Delivery to Austria.',
|
||||||
|
'orderConfirmation' => 'Please send the order confirmation to office@xinon.at',
|
||||||
|
'table' => [
|
||||||
|
'pos' => 'POS',
|
||||||
|
'article' => 'Article',
|
||||||
|
'articleNumber' => 'Dist. art. nr.',
|
||||||
|
'amount' => 'Amount',
|
||||||
|
'unitPrice' => 'Unit price',
|
||||||
|
'totalPrice' => 'Total price'
|
||||||
|
]
|
||||||
|
],
|
||||||
|
'DE' => [
|
||||||
|
'header' => 'XINON Lieferantenbestellung vom ' . date("d.m.Y", $order["create"]),
|
||||||
|
'sum' => 'Summe',
|
||||||
|
'vat' => '20% MwSt',
|
||||||
|
'total' => 'Gesamt',
|
||||||
|
'taxFree' => 'Bitte um steuerfreie Lieferung gemäß § 6a UStG.<br> Unsere UID-Nr.: ATU68711968. Lieferung nach Österreich.',
|
||||||
|
'orderConfirmation' => 'Wir bitten um Zusendung der Auftragsbestätigung für die Bestellung an office@xinon.at.',
|
||||||
|
'table' => [
|
||||||
|
'pos' => 'POS',
|
||||||
|
'article' => 'Artikel',
|
||||||
|
'articleNumber' => 'Art.-Nr. Lieferant',
|
||||||
|
'amount' => 'Menge',
|
||||||
|
'unitPrice' => 'Einzelpreis',
|
||||||
|
'totalPrice' => 'Gesamtpreis'
|
||||||
|
]
|
||||||
|
]];
|
||||||
|
|
||||||
|
$text = $texts[in_array($distributorCountryText, ["Österreich", "Deutschland", "Schweiz"]) ? "DE" : "EN"];
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Bestellung</title>
|
<title><?= $text['header'] ?></title>
|
||||||
<meta charset="utf-8"/>
|
<meta charset="utf-8"/>
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
@@ -76,23 +114,19 @@ $this->setReturnValue(['filename' => $order["id"] . ".pdf"]);
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div>
|
<div>
|
||||||
<!--
|
<h2 style="text-align: center;color: #005384"><?= $text['header'] ?></h2>
|
||||||
TODO: enable option for showing prices
|
|
||||||
vertauschen
|
|
||||||
Die gelieferte Ware bleibt bis zur vollständigen Bezahlung in unserem Eigentum.
|
|
||||||
-->
|
|
||||||
<h2 style="text-align: center;color: #005384">XINON Lieferantenbestellung vom <?=date("d.m.Y", $order["create"])?></h2>
|
|
||||||
|
|
||||||
<table style="border-collapse: collapse; width: 100%;" id="invoiceTable">
|
<table style="border-collapse: collapse; width: 100%;" id="invoiceTable">
|
||||||
<tr style="font-weight: bold; border-bottom: 1px solid black;" class="uneven">
|
<tr style="font-weight: bold; border-bottom: 1px solid black;" class="uneven">
|
||||||
<th style="text-align: center;padding-right: 6pt">Position</th>
|
<th style="text-align: center;padding-right: 6pt"><?= $text['table']['pos'] ?></th>
|
||||||
<th style="text-align: center;padding-right: 6pt">Artikel</th>
|
<th style="text-align: center;padding-right: 6pt"><?= $text['table']['article'] ?></th>
|
||||||
<th style="text-align: center;padding-right: 6pt">Art.-Nr. Lieferant</th>
|
<th style="text-align: center;padding-right: 6pt"><?= $text['table']['articleNumber'] ?></th>
|
||||||
<th style="text-align: right">Menge</th>
|
<th style="text-align: right"><?= $text['table']['amount'] ?></th>
|
||||||
<th style="text-align: right">Einzelpreis</th>
|
<th style="text-align: right"><?= $text['table']['unitPrice'] ?></th>
|
||||||
<th style="text-align: right;padding-right: 8pt">Gesamtpreis</th>
|
<th style="text-align: right;padding-right: 8pt"><?= $text['table']['totalPrice'] ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
<?php $i = 0; foreach($order['positions'] as $p):?>
|
<?php $i = 0;
|
||||||
|
foreach ($order['positions'] as $p): ?>
|
||||||
|
|
||||||
<tr class="position <?= ($i % 2 == 0) ? "even" : "uneven" ?>">
|
<tr class="position <?= ($i % 2 == 0) ? "even" : "uneven" ?>">
|
||||||
<td style="text-align: center;"><?= $i + 1 ?></td>
|
<td style="text-align: center;"><?= $i + 1 ?></td>
|
||||||
@@ -102,8 +136,18 @@ TODO: enable option for showing prices
|
|||||||
<td style="text-align: right"><?= number_format($p["buyPrice"], 2, ",", ".") ?> €</td>
|
<td style="text-align: right"><?= number_format($p["buyPrice"], 2, ",", ".") ?> €</td>
|
||||||
<td style="text-align: right;padding-right: 8pt"><?= number_format($p["amount"] * $p["buyPrice"], 2, ",", ".") ?> €</td>
|
<td style="text-align: right;padding-right: 8pt"><?= number_format($p["amount"] * $p["buyPrice"], 2, ",", ".") ?> €</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<tr class="<?= ($i % 2 == 0) ? "even" : "uneven" ?>">
|
||||||
|
<td></td>
|
||||||
|
<td style="text-align: left;max-width: 200px"><?= $p["articleDescription"] ?></td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
<?php $i++; endforeach; ?>
|
<?php $i++; endforeach; ?>
|
||||||
<!-- display a grey like header sum with top border to differentiate 2nd last td = Summe , last td is the calculated value both bold-->
|
|
||||||
|
|
||||||
<tr class="uneven">
|
<tr class="uneven">
|
||||||
<?php
|
<?php
|
||||||
@@ -114,20 +158,34 @@ TODO: enable option for showing prices
|
|||||||
?>
|
?>
|
||||||
<td colspan="5" style="text-align: right;border-top: 1px solid black;font-weight: bold
|
<td colspan="5" style="text-align: right;border-top: 1px solid black;font-weight: bold
|
||||||
;border-bottom: 1px solid black;
|
;border-bottom: 1px solid black;
|
||||||
">Summe</td>
|
"><?= $text['sum'] ?>
|
||||||
|
</td>
|
||||||
<td style="text-align: right;border-top: 1px solid black;font-weight: bold
|
<td style="text-align: right;border-top: 1px solid black;font-weight: bold
|
||||||
;border-bottom: 1px solid black;
|
;border-bottom: 1px solid black;
|
||||||
"><?=number_format($sum, 2, ",", ".")?> €</td>
|
"><?= number_format($sum, 2, ",", ".") ?> €
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<?php if ($distributorCountryText === "Österreich"): ?>
|
||||||
|
<tr style="font-weight: bold; border-bottom: 1px solid black; background-color: #ebebeb;">
|
||||||
|
<td colspan="5" style="text-align: right;font-weight: bold;">20% MwSt</td>
|
||||||
|
<td style="text-align: right;font-weight: bold;"><?= number_format($sum * 0.2, 2, ",", ".") ?> €</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="uneven" style="font-weight: bold; border-bottom: 3px double black; background-color: #ebebeb;">
|
||||||
|
<td colspan="5" style="text-align: right;font-weight: bold;"><?= $text['total'] ?></td>
|
||||||
|
<td style="text-align: right;font-weight: bold;"><?= number_format($sum * 1.2, 2, ",", ".") ?> €</td>
|
||||||
|
</tr>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<h3>Anmerkungen</h3>
|
<?php if ($distributorCountryText !== "Österreich"): ?>
|
||||||
<p>
|
<?= $text['taxFree'] ?>
|
||||||
<?=$order["note"]?>
|
<?php endif; ?>
|
||||||
</p>
|
|
||||||
|
<?= $text['orderConfirmation'] ?>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -11,6 +11,9 @@
|
|||||||
</a>
|
</a>
|
||||||
<ul class="submenu">
|
<ul class="submenu">
|
||||||
<li><a href="<?=self::getUrl("Preorder")?>"><i class="far fa-fw fa-calendar-lines text-info"></i> Vorbestellung</a></li>
|
<li><a href="<?=self::getUrl("Preorder")?>"><i class="far fa-fw fa-calendar-lines text-info"></i> Vorbestellung</a></li>
|
||||||
|
<?php if($me->is(["Admin","netowner","salespartner"]) && in_array($me->address_id, [1,209,5908,2187])): ?>
|
||||||
|
<li><a href="<?=self::getUrl("ConstructionConsentProject")?>"><i class="far fa-fw fa-clipboard-question text-info"></i> Zustimmungserklärungen</a></li>
|
||||||
|
<?php endif; ?>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
@@ -198,7 +201,7 @@
|
|||||||
<?php if($me->is(["Admin","salespartner"]) && $me->can("Order")): ?>
|
<?php if($me->is(["Admin","salespartner"]) && $me->can("Order")): ?>
|
||||||
<li><a href="<?=self::getUrl("Order")?>"><i class="far fa-fw fa-file-signature text-info"></i> Bestellungen</a></li>
|
<li><a href="<?=self::getUrl("Order")?>"><i class="far fa-fw fa-file-signature text-info"></i> Bestellungen</a></li>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if($me->is(["Admin","netowner","salespartner"]) && in_array($me->address_id, [1,209,5908])): ?>
|
<?php if($me->is(["Admin","netowner","salespartner"]) && in_array($me->address_id, [1,209,5908,2187])): ?>
|
||||||
<li><a href="<?=self::getUrl("ConstructionConsentProject")?>"><i class="far fa-fw fa-clipboard-question text-info"></i> Zustimmungserklärungen</a></li>
|
<li><a href="<?=self::getUrl("ConstructionConsentProject")?>"><i class="far fa-fw fa-clipboard-question text-info"></i> Zustimmungserklärungen</a></li>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -61,6 +61,8 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/sortablejs@1.14.0/Sortable.min.js"></script>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/vue-draggable-next@2.1.0"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
baseurl = '<?=self::getResourcePath()?>';
|
baseurl = '<?=self::getResourcePath()?>';
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -34,6 +34,33 @@ class ConstructionConsent extends mfBaseModel {
|
|||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function beforeDelete() {
|
||||||
|
if(!$this->id) return true;
|
||||||
|
// delete owners
|
||||||
|
foreach($this->getProperty("owners") as $owner) {
|
||||||
|
$owner->delete();
|
||||||
|
}
|
||||||
|
// delete contacts
|
||||||
|
foreach($this->getProperty("contacts") as $contact) {
|
||||||
|
$contact->delete();
|
||||||
|
}
|
||||||
|
// delete journals
|
||||||
|
foreach($this->getProperty("journal") as $journal) {
|
||||||
|
$journal->delete();
|
||||||
|
}
|
||||||
|
// delete history
|
||||||
|
foreach($this->getProperty("history") as $history) {
|
||||||
|
$history->delete();
|
||||||
|
}
|
||||||
|
// delete files
|
||||||
|
if($this->getProperty("file")) {
|
||||||
|
$this->getProperty("file")->delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
protected function afterSave() {
|
protected function afterSave() {
|
||||||
$this->createHistory();
|
$this->createHistory();
|
||||||
}
|
}
|
||||||
@@ -181,7 +208,7 @@ class ConstructionConsent extends mfBaseModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($name == "file") {
|
if($name == "file") {
|
||||||
if(!$this->id) return [];
|
if(!$this->id) return null;
|
||||||
$file = ConstructionConsentFile::getFirst(["constructionconsent_id" => $this->id]);
|
$file = ConstructionConsentFile::getFirst(["constructionconsent_id" => $this->id]);
|
||||||
if($file) {
|
if($file) {
|
||||||
$this->file = $file;
|
$this->file = $file;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class ConstructionConsentController extends mfBaseController {
|
|||||||
$this->me = $me;
|
$this->me = $me;
|
||||||
$this->layout()->set("me", $me);
|
$this->layout()->set("me", $me);
|
||||||
|
|
||||||
if (!($me->is(["Admin","netowner","salespartner"]) && in_array($me->address_id, [1,209,5908]))) $this->redirect("Dashboard");
|
if (!($me->is(["Admin","netowner","salespartner"]) && in_array($me->address_id, [1,209,5908,2187]))) $this->redirect("Dashboard");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function indexAction() : void {
|
protected function indexAction() : void {
|
||||||
@@ -70,7 +70,7 @@ class ConstructionConsentController extends mfBaseController {
|
|||||||
$pagination['maxItems'] = ConstructionConsent::count($filter);
|
$pagination['maxItems'] = ConstructionConsent::count($filter);
|
||||||
$this->layout()->set("pagination", $pagination);
|
$this->layout()->set("pagination", $pagination);
|
||||||
|
|
||||||
$items = ConstructionConsent::search($filter);
|
$items = ConstructionConsent::search($filter, $pagination);
|
||||||
$this->layout->set("items", $items);
|
$this->layout->set("items", $items);
|
||||||
|
|
||||||
if(array_key_exists("project_id", $filter) && $filter["project_id"]) {
|
if(array_key_exists("project_id", $filter) && $filter["project_id"]) {
|
||||||
@@ -217,7 +217,7 @@ class ConstructionConsentController extends mfBaseController {
|
|||||||
$data["usage_manhole"] = $r->usage_manhole ? 1 : 0;
|
$data["usage_manhole"] = $r->usage_manhole ? 1 : 0;
|
||||||
$data["usage_owner"] = $r->usage_owner ? 1 : 0;
|
$data["usage_owner"] = $r->usage_owner ? 1 : 0;
|
||||||
|
|
||||||
if($r->object_type == "street") {
|
if($r->object_type == "building") {
|
||||||
$data["usage_length"] = 1;
|
$data["usage_length"] = 1;
|
||||||
$data["usage_pipe_on_plot"] = 1;
|
$data["usage_pipe_on_plot"] = 1;
|
||||||
$data["usage_pipe_in_building"] = 1;
|
$data["usage_pipe_in_building"] = 1;
|
||||||
@@ -320,6 +320,25 @@ class ConstructionConsentController extends mfBaseController {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function deleteAction() {
|
||||||
|
$id = $this->request->id;
|
||||||
|
if(!is_numeric($id) || $id < 1) {
|
||||||
|
$this->layout()->setFlash("Zustimmungserklärung nicht gefunden", "error");
|
||||||
|
$this->redirect("ConstructionConsent");
|
||||||
|
}
|
||||||
|
|
||||||
|
$item = new ConstructionConsent($id);
|
||||||
|
if(!$item->id) {
|
||||||
|
$this->layout()->setFlash("Zustimmungserklärung nicht gefunden", "error");
|
||||||
|
$this->redirect("ConstructionConsent");
|
||||||
|
}
|
||||||
|
|
||||||
|
$item->delete();
|
||||||
|
|
||||||
|
$this->layout()->setFlash("Zustimmungserklärung erfolgreich gelöscht", "success");
|
||||||
|
$this->redirect("ConstructionConsent");
|
||||||
|
}
|
||||||
|
|
||||||
protected function saveDate() {
|
protected function saveDate() {
|
||||||
$r = $this->request;
|
$r = $this->request;
|
||||||
|
|
||||||
@@ -470,6 +489,9 @@ class ConstructionConsentController extends mfBaseController {
|
|||||||
case "saveCheckbox":
|
case "saveCheckbox":
|
||||||
$return = $this->saveCheckboxApi();
|
$return = $this->saveCheckboxApi();
|
||||||
break;
|
break;
|
||||||
|
case "deleteRimoPlan":
|
||||||
|
$return = $this->deleteRimoPlanApi();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
$this->log->warn(__METHOD__ . ": Called API function '$do' does not exist");
|
$this->log->warn(__METHOD__ . ": Called API function '$do' does not exist");
|
||||||
$return = false;
|
$return = false;
|
||||||
@@ -870,9 +892,17 @@ class ConstructionConsentController extends mfBaseController {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function saveRimoPlanPreviewApi() {
|
private function deleteRimoPlanApi() {
|
||||||
$adb_hausnummer_id = $this->request->building_id;
|
$consent_id = $this->request->id;
|
||||||
$consent_id = $this->request->constructionconsent_id;
|
|
||||||
|
$consent = new ConstructionConsent($consent_id);
|
||||||
|
if(!$consent->id) return false;
|
||||||
|
|
||||||
|
if($consent->file && $consent->file->file_id) {
|
||||||
|
$consent->file->delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
return ["message" => "Plan deleted successfully"];
|
||||||
}
|
}
|
||||||
|
|
||||||
private function saveCheckboxApi() {
|
private function saveCheckboxApi() {
|
||||||
|
|||||||
@@ -5,6 +5,12 @@ class ConstructionConsentFile extends mfBaseModel {
|
|||||||
private $creator;
|
private $creator;
|
||||||
private $editor;
|
private $editor;
|
||||||
|
|
||||||
|
protected function beforeDelete() {
|
||||||
|
if(!$this->id) return true;
|
||||||
|
$this->getProperty("file")->delete();
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public function getProperty($name) {
|
public function getProperty($name) {
|
||||||
if($this->$name == null) {
|
if($this->$name == null) {
|
||||||
|
|||||||
@@ -10,6 +10,15 @@ class ConstructionConsentOwner extends mfBaseModel {
|
|||||||
$this->createHistory();
|
$this->createHistory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function beforeDelete() {
|
||||||
|
if(!$this->id) return true;
|
||||||
|
foreach($this->getProperty("files") as $file) {
|
||||||
|
$file->delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
protected function beforeUpdate($data) {
|
protected function beforeUpdate($data) {
|
||||||
if(!array_key_exists("edit_by", $data)) {
|
if(!array_key_exists("edit_by", $data)) {
|
||||||
$me = new User();
|
$me = new User();
|
||||||
@@ -45,13 +54,16 @@ class ConstructionConsentOwner extends mfBaseModel {
|
|||||||
if($this->$name == null) {
|
if($this->$name == null) {
|
||||||
|
|
||||||
if($name == "files") {
|
if($name == "files") {
|
||||||
if(!$this->id) return null;
|
if(!$this->id) return [];
|
||||||
$files = ConstructionConsentOwnerFile::search(["constructionconsentowner_id" => $this->id]);
|
$files = ConstructionConsentOwnerFile::search(["constructionconsentowner_id" => $this->id]);
|
||||||
if(count($files)) {
|
|
||||||
|
if(!count($files)) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
foreach($files as $file) {
|
foreach($files as $file) {
|
||||||
$this->files[$file->filename] = $file;
|
$this->files[$file->filename] = $file;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return $this->files;
|
return $this->files;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class ConstructionConsentProjectController extends mfBaseController {
|
|||||||
$this->me = $me;
|
$this->me = $me;
|
||||||
$this->layout()->set("me", $me);
|
$this->layout()->set("me", $me);
|
||||||
|
|
||||||
if (!($me->is(["Admin","netowner","salespartner"]) && in_array($me->address_id, [1,209,5908]))) $this->redirect("Dashboard");
|
if (!($me->is(["Admin","netowner","salespartner"]) && in_array($me->address_id, [1,209,5908,2187]))) $this->redirect("Dashboard");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function indexAction() : void {
|
protected function indexAction() : void {
|
||||||
|
|||||||
@@ -417,7 +417,9 @@ class DeviceController extends mfBaseController
|
|||||||
|
|
||||||
private function getDevices()
|
private function getDevices()
|
||||||
{
|
{
|
||||||
|
if (!$this->me->is(["Admin"])) {
|
||||||
if ($this->allowedPops === null) return [];
|
if ($this->allowedPops === null) return [];
|
||||||
|
}
|
||||||
$devices = DeviceModel::search(['popIds' => $this->allowedPops]);
|
$devices = DeviceModel::search(['popIds' => $this->allowedPops]);
|
||||||
|
|
||||||
foreach ($devices as $device) {
|
foreach ($devices as $device) {
|
||||||
|
|||||||
@@ -680,6 +680,7 @@ class TimerecordingController extends mfBaseController
|
|||||||
$holiDays = 0;
|
$holiDays = 0;
|
||||||
$plusHours = 0;
|
$plusHours = 0;
|
||||||
$startdate = time();
|
$startdate = time();
|
||||||
|
$allhours=0;
|
||||||
if (!$userid) {
|
if (!$userid) {
|
||||||
$userid = $this->me->id;
|
$userid = $this->me->id;
|
||||||
}
|
}
|
||||||
@@ -697,6 +698,10 @@ class TimerecordingController extends mfBaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$overtime = $employee[0]->overtime_now;
|
$overtime = $employee[0]->overtime_now;
|
||||||
|
if ($employee[0]->only_admin) {
|
||||||
|
$getAllHours=TimerecordingModel::getAllHours($userid);
|
||||||
|
$getAllHours=$getAllHours[0]->gesamt_summe;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$workinghours = TimerecordingEmployeeWorkingHourModel::search(['user_id' => $userid]);
|
$workinghours = TimerecordingEmployeeWorkingHourModel::search(['user_id' => $userid]);
|
||||||
$holidays = TimerecordingHolidayModel::getAll();
|
$holidays = TimerecordingHolidayModel::getAll();
|
||||||
@@ -1155,6 +1160,7 @@ class TimerecordingController extends mfBaseController
|
|||||||
$json['time']['must'] = sprintf('%02dh:%02dm', floor($mustSeconds / 3600), floor($mustSeconds / 60 % 60));
|
$json['time']['must'] = sprintf('%02dh:%02dm', floor($mustSeconds / 3600), floor($mustSeconds / 60 % 60));
|
||||||
$json['time']['holidays'] = $holiDays;
|
$json['time']['holidays'] = $holiDays;
|
||||||
$json['time']['plushours'] = $plusHours;
|
$json['time']['plushours'] = $plusHours;
|
||||||
|
$json['time']['AllHours'] = sprintf('%02dh:%02dm', floor($getAllHours / 3600), floor($getAllHours / 60 % 60));;
|
||||||
$json['data'] = $rows;
|
$json['data'] = $rows;
|
||||||
$json['recordsFiltered'] = $responsecount;
|
$json['recordsFiltered'] = $responsecount;
|
||||||
$json['recordsTotal'] = $responsecount;
|
$json['recordsTotal'] = $responsecount;
|
||||||
|
|||||||
@@ -73,6 +73,21 @@ class TimerecordingModel
|
|||||||
}
|
}
|
||||||
return $item;
|
return $item;
|
||||||
}
|
}
|
||||||
|
public static function getAllHours($user_id)
|
||||||
|
{
|
||||||
|
$items = [];
|
||||||
|
|
||||||
|
$db = FronkDB::singleton();
|
||||||
|
$sql="SELECT SUM(`end` - `start`) AS gesamt_summe FROM Timerecording where user_id=$user_id AND `timerecordingCategory_id` =1";
|
||||||
|
$res = $db->query($sql);
|
||||||
|
if ($db->num_rows($res)) {
|
||||||
|
while ($data = $db->fetch_object($res)) {
|
||||||
|
$items[] = new Timerecording($data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $items;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public static function getAll()
|
public static function getAll()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -30,6 +30,10 @@ class WarehouseOfferController extends TTCrud {
|
|||||||
['key' => 'sendOffer', 'title' => 'Angebot senden', 'class' => 'fas fa-paper-plane text-success']
|
['key' => 'sendOffer', 'title' => 'Angebot senden', 'class' => 'fas fa-paper-plane text-success']
|
||||||
];
|
];
|
||||||
|
|
||||||
|
protected array $additionalJS = ['
|
||||||
|
https://cdn.jsdelivr.net/npm/sortablejs@1.14.0/Sortable.min.js
|
||||||
|
https://cdn.jsdelivr.net/npm/vue-draggable-next@2.1.0'];
|
||||||
|
|
||||||
protected array $infoMessages = [
|
protected array $infoMessages = [
|
||||||
'create' => 'Angebot wurde erfolgreich erstellt.',
|
'create' => 'Angebot wurde erfolgreich erstellt.',
|
||||||
'update' => 'Angebot wurde aktualisiert.',
|
'update' => 'Angebot wurde aktualisiert.',
|
||||||
|
|||||||
@@ -9,18 +9,18 @@ class WarehouseOrderController extends TTCrud {
|
|||||||
protected array $columns = [
|
protected array $columns = [
|
||||||
['key' => 'id', 'text' => 'ID', 'modal' => false, 'table' => false],
|
['key' => 'id', 'text' => 'ID', 'modal' => false, 'table' => false],
|
||||||
['key' => 'orderNumber', 'text' => 'Bestellnummer', 'required' => true, 'modal' => false],
|
['key' => 'orderNumber', 'text' => 'Bestellnummer', 'required' => true, 'modal' => false],
|
||||||
['key' => 'distributor', 'text' => 'Lieferant', 'required' => false, 'modal' => false, 'table' => ['filter' => false]],
|
['key' => 'distributorId', 'text' => 'Lieferant', 'required' => false, 'modal' => ['type' => 'select', 'items' => []], 'table' => ['filter' => 'select']],
|
||||||
['key' => 'delAddrCity', 'text' => 'Stadt', 'required' => true, 'modal' => false, 'table' => false],
|
['key' => 'delAddrCity', 'text' => 'Stadt', 'required' => true, 'modal' => false, 'table' => false],
|
||||||
['key' => 'delAddrEMail', 'text' => 'E-Mail', 'required' => true, 'modal' => false, 'table' => false],
|
['key' => 'delAddrEMail', 'text' => 'E-Mail', 'required' => true, 'modal' => false, 'table' => false],
|
||||||
['key' => 'delAddrLine', 'text' => 'Adresse', 'required' => true, 'modal' => false, 'table' => false],
|
['key' => 'delAddrLine', 'text' => 'Adresse', 'required' => true, 'modal' => false, 'table' => false],
|
||||||
['key' => 'delAddrName', 'text' => 'Name', 'required' => true, 'modal' => false, 'table' => false],
|
['key' => 'delAddrName', 'text' => 'Name', 'required' => true, 'modal' => false, 'table' => false],
|
||||||
['key' => 'delAddrPLZ', 'text' => 'PLZ', 'required' => true, 'modal' => false, 'table' => false],
|
['key' => 'delAddrPLZ', 'text' => 'PLZ', 'required' => true, 'modal' => false, 'table' => false],
|
||||||
['key' => 'editor', 'text' => 'Bearbeiter', 'required' => true, 'modal' => ['type' => 'select'], 'table' => ['filter' => 'select']],
|
['key' => 'editor', 'text' => 'Bearbeiter', 'required' => true, 'modal' => ['type' => 'select'], 'table' => ['filter' => 'select']],
|
||||||
['key' => 'note', 'text' => 'Notiz', 'required' => true, 'modal' => false, 'table' => false],
|
['key' => 'note', 'text' => 'Notiz', 'required' => false, 'modal' => false, 'table' => false],
|
||||||
['key' => 'sum', 'text' => 'Summe', 'required' => false, 'modal' => false, 'table' => ['class' => 'text-right']],
|
['key' => 'sum', 'text' => 'Summe', 'required' => false, 'modal' => false, 'table' => ['class' => 'text-right']],
|
||||||
['key' => 'status', 'text' => 'Status', 'required' => false, 'modal' => ['type' => 'select', 'items' => []], 'table' => ['filter' => 'select']],
|
['key' => 'status', 'text' => 'Status', 'required' => false, 'modal' => ['type' => 'select', 'items' => []], 'table' => ['filter' => 'select']],
|
||||||
['key' => 'positions', 'text' => 'Positionen', 'required' => true, 'modal' => false, 'table' => false],
|
['key' => 'positions', 'text' => 'Positionen', 'required' => true, 'modal' => false, 'table' => false],
|
||||||
['key' => 'extReference', 'text' => 'Externe Referenz', 'required' => true, 'modal' => false],
|
['key' => 'extReference', 'text' => 'Externe Referenz', 'required' => false, 'modal' => false],
|
||||||
['key' => 'createBy', 'text' => 'Erstellt von', 'required' => true, 'modal' => ['type' => 'select'], 'table' => ['filter' => 'select']],
|
['key' => 'createBy', 'text' => 'Erstellt von', 'required' => true, 'modal' => ['type' => 'select'], 'table' => ['filter' => 'select']],
|
||||||
['key' => 'create', 'text' => 'Erstellt', 'required' => true, 'modal' => false],
|
['key' => 'create', 'text' => 'Erstellt', 'required' => true, 'modal' => false],
|
||||||
['key' => 'actions', 'text' => 'Aktionen', 'required' => false, 'modal' => false, 'table' => ['filter' => false, 'sortable' => false, 'class' => 'text-center']],
|
['key' => 'actions', 'text' => 'Aktionen', 'required' => false, 'modal' => false, 'table' => ['filter' => false, 'sortable' => false, 'class' => 'text-center']],
|
||||||
@@ -32,6 +32,8 @@ class WarehouseOrderController extends TTCrud {
|
|||||||
'delete' => 'Bestellung wurde gelöscht',
|
'delete' => 'Bestellung wurde gelöscht',
|
||||||
'noChanges' => 'Keine Änderungen',];
|
'noChanges' => 'Keine Änderungen',];
|
||||||
|
|
||||||
|
protected array $additionalActions = [['key' => 'openpdf', 'title' => 'PDF öffnen', 'class' => 'fas fa-file-pdf', 'color' => 'primary']];
|
||||||
|
|
||||||
protected function prepareCrudConfig(): void {
|
protected function prepareCrudConfig(): void {
|
||||||
$editorColumnIndex = array_search('editor', array_column($this->columns, 'key'));
|
$editorColumnIndex = array_search('editor', array_column($this->columns, 'key'));
|
||||||
$this->columns[$editorColumnIndex]['modal']['items'] = array_map(function ($user) {
|
$this->columns[$editorColumnIndex]['modal']['items'] = array_map(function ($user) {
|
||||||
@@ -48,6 +50,11 @@ class WarehouseOrderController extends TTCrud {
|
|||||||
['value' => 'fullyDelivered', 'text' => 'Geliefert'],
|
['value' => 'fullyDelivered', 'text' => 'Geliefert'],
|
||||||
['value' => 'cancelled', 'text' => 'Storniert'],
|
['value' => 'cancelled', 'text' => 'Storniert'],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
$distributorIndex = array_search('distributorId', array_column($this->columns, 'key'));
|
||||||
|
$this->columns[$distributorIndex]['modal']['items'] = array_map(function ($distributor) {
|
||||||
|
return ['value' => intval($distributor->id), 'text' => $distributor->name];
|
||||||
|
}, WarehouseDistributorModel::getAll());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function beforeCreate(): bool {
|
protected function beforeCreate(): bool {
|
||||||
@@ -91,40 +98,43 @@ class WarehouseOrderController extends TTCrud {
|
|||||||
// we need to get the article name and distributor name for the pdf
|
// we need to get the article name and distributor name for the pdf
|
||||||
$position['distributorName'] = WarehouseDistributorModel::get($position['distributorId'])->name;
|
$position['distributorName'] = WarehouseDistributorModel::get($position['distributorId'])->name;
|
||||||
$position['articleName'] = WarehouseArticleModel::get($position['article'])->title;
|
$position['articleName'] = WarehouseArticleModel::get($position['article'])->title;
|
||||||
|
$position['articleDescription'] = WarehouseArticleModel::get($position['article'])->description;
|
||||||
|
|
||||||
$order['positions'][$key] = $position;
|
$order['positions'][$key] = $position;
|
||||||
}
|
}
|
||||||
|
|
||||||
$pdf_vars = ['order' => $order,
|
$pdf_vars = ['order' => $order,
|
||||||
'distributor' => WarehouseDistributorModel::get($distributorId),
|
'distributor' => WarehouseDistributorModel::get($distributorId),
|
||||||
|
'distributorCountryText' => (new Country(WarehouseDistributorModel::get($distributorId)->countryId))->name,
|
||||||
"bank_iban" => TT_INVOICE_BANK_IBAN,
|
"bank_iban" => TT_INVOICE_BANK_IBAN,
|
||||||
"bank_bic" => TT_INVOICE_BANK_BIC,
|
"bank_bic" => TT_INVOICE_BANK_BIC,
|
||||||
"bank_bank" => TT_INVOICE_BANK_BANK,
|
"bank_bank" => TT_INVOICE_BANK_BANK,
|
||||||
"bank_owner" => TT_INVOICE_BANK_OWNER];
|
"bank_owner" => TT_INVOICE_BANK_OWNER];
|
||||||
|
|
||||||
|
$countryText = (new Country(WarehouseDistributorModel::get($distributorId)->countryId))->name;
|
||||||
$countryText = CountryModel::search(['id' => WarehouseDistributorModel::get($distributorId)->countryId])[0]->name;
|
$shouldGenerateEnglisch = !in_array($countryText, ['Österreich', 'Deutschland', 'Schweiz']);
|
||||||
|
|
||||||
$headerHtml = file_get_contents(BASEDIR . "/Layout/default/WarehouseOrder/PDF_HEADER.html");
|
$headerHtml = file_get_contents(BASEDIR . "/Layout/default/WarehouseOrder/PDF_HEADER.html");
|
||||||
$headerHtml = str_replace("{{ basedir }}", BASEDIR, $headerHtml);
|
$headerHtml = str_replace("{{ basedir }}", BASEDIR, $headerHtml);
|
||||||
$headerHtml = str_replace("{{ externalReference }}","<strong>Ihre Referenz:</strong> ". $order['extReference'], $headerHtml);
|
$headerHtml = str_replace("{{ externalReference }}", count($order['extReference']) > 0 ? "<strong>Ext. Ref.:</strong> ". $order['extReference'] : "", $headerHtml);
|
||||||
|
|
||||||
|
$headerHtml = str_replace("{{ addressLine_header }}", $shouldGenerateEnglisch ? "Supplier" : "Lieferant", $headerHtml);
|
||||||
$headerHtml = str_replace("{{ addressLine_1 }}", WarehouseDistributorModel::get($distributorId)->name, $headerHtml);
|
$headerHtml = str_replace("{{ addressLine_1 }}", WarehouseDistributorModel::get($distributorId)->name, $headerHtml);
|
||||||
$headerHtml = str_replace("{{ addressLine_2 }}", WarehouseDistributorModel::get($distributorId)->address, $headerHtml);
|
$headerHtml = str_replace("{{ addressLine_2 }}", WarehouseDistributorModel::get($distributorId)->address, $headerHtml);
|
||||||
$headerHtml = str_replace("{{ addressLine_3 }}", WarehouseDistributorModel::get($distributorId)->plz . " " . WarehouseDistributorModel::get($distributorId)->city, $headerHtml);
|
$headerHtml = str_replace("{{ addressLine_3 }}", WarehouseDistributorModel::get($distributorId)->plz . " " . WarehouseDistributorModel::get($distributorId)->city, $headerHtml);
|
||||||
$headerHtml = str_replace("{{ addressLine_4 }}", $countryText, $headerHtml);
|
$headerHtml = str_replace("{{ addressLine_4 }}", $countryText, $headerHtml);
|
||||||
|
|
||||||
|
$headerHtml = str_replace("{{ billingAddressLine_header }}", $shouldGenerateEnglisch ? "Billing Address" : "Rechnungsadresse", $headerHtml);
|
||||||
$headerHtml = str_replace("{{ billingAddressLine_1 }}", "Xinon GmbH", $headerHtml);
|
$headerHtml = str_replace("{{ billingAddressLine_1 }}", "Xinon GmbH", $headerHtml);
|
||||||
$headerHtml = str_replace("{{ billingAddressLine_2 }}", "Fladnitz im Raabtal 150", $headerHtml);
|
$headerHtml = str_replace("{{ billingAddressLine_2 }}", "Fladnitz im Raabtal 150", $headerHtml);
|
||||||
$headerHtml = str_replace("{{ billingAddressLine_3 }}", "8322 Studenzen", $headerHtml);
|
$headerHtml = str_replace("{{ billingAddressLine_3 }}", "A-8322 Studenzen", $headerHtml);
|
||||||
$headerHtml = str_replace("{{ billingAddressLine_4 }}", "Österreich", $headerHtml);
|
$headerHtml = str_replace("{{ billingAddressLine_4 }}", "UID: ATU68711968", $headerHtml);
|
||||||
$headerHtml = str_replace("{{ billingAddressLine_5 }}", "einkauf@xinon.at", $headerHtml);
|
$headerHtml = str_replace("{{ billingAddressLine_5 }}", "EORI-Nr.: ATEOS1000085074", $headerHtml);
|
||||||
$headerHtml = str_replace("{{ billingAddressLine_6 }}", "<strong>Referenz: ". $order["orderNumber"] . "</strong>", $headerHtml);
|
$headerHtml = str_replace("{{ billingAddressLine_6 }}", "<strong>Referenz: ". $order["orderNumber"] . "</strong>", $headerHtml);
|
||||||
|
|
||||||
// if order dellAddrLine is Fladnitz im Raabtal 150 we need to set all template strings to empty
|
|
||||||
|
|
||||||
$chk = $order['delAddrLine'] == "Fladnitz im Raabtal 150";
|
$chk = $order['delAddrLine'] == "Fladnitz im Raabtal 150";
|
||||||
|
|
||||||
|
$headerHtml = str_replace("{{ shippingAddressLine_header }}", $chk ? "" : ($shouldGenerateEnglisch ? "Shipping Address" : "Lieferadresse"), $headerHtml);
|
||||||
$headerHtml = str_replace("{{ shippingAddressLine_1 }}", $chk ? "" : $order['delAddrName'], $headerHtml);
|
$headerHtml = str_replace("{{ shippingAddressLine_1 }}", $chk ? "" : $order['delAddrName'], $headerHtml);
|
||||||
$headerHtml = str_replace("{{ shippingAddressLine_2 }}", $chk ? "" : $order['delAddrLine'], $headerHtml);
|
$headerHtml = str_replace("{{ shippingAddressLine_2 }}", $chk ? "" : $order['delAddrLine'], $headerHtml);
|
||||||
$headerHtml = str_replace("{{ shippingAddressLine_3 }}", $chk ? "" : $order['delAddrPLZ'] . " " . $order['delAddrCity'], $headerHtml);
|
$headerHtml = str_replace("{{ shippingAddressLine_3 }}", $chk ? "" : $order['delAddrPLZ'] . " " . $order['delAddrCity'], $headerHtml);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
class WarehouseOrderModel extends TTCrudBaseModel {
|
class WarehouseOrderModel extends TTCrudBaseModel {
|
||||||
public int $id;
|
public int $id;
|
||||||
public string $orderNumber;
|
public string $orderNumber;
|
||||||
public string $extReference;
|
public ?string $extReference;
|
||||||
public int $distributorId;
|
public int $distributorId;
|
||||||
public string $delAddrCity;
|
public string $delAddrCity;
|
||||||
public string $delAddrEMail;
|
public string $delAddrEMail;
|
||||||
@@ -31,7 +31,7 @@ class WarehouseOrderModel extends TTCrudBaseModel {
|
|||||||
public string $delAddrName;
|
public string $delAddrName;
|
||||||
public string $delAddrPLZ;
|
public string $delAddrPLZ;
|
||||||
public int $editor;
|
public int $editor;
|
||||||
public string $note;
|
public ?string $note;
|
||||||
public string $positions;
|
public string $positions;
|
||||||
public int $create;
|
public int $create;
|
||||||
public int $createBy;
|
public int $createBy;
|
||||||
|
|||||||
@@ -8,12 +8,17 @@ class WarehouseShippingNoteController extends TTCrud {
|
|||||||
protected array $columns = [
|
protected array $columns = [
|
||||||
['key' => 'id', 'text' => 'LS-Nr.', 'required' => false, 'modal' => false, 'table' => ['class' => 'text-nowrap']],
|
['key' => 'id', 'text' => 'LS-Nr.', 'required' => false, 'modal' => false, 'table' => ['class' => 'text-nowrap']],
|
||||||
['key' => 'billingAddressId', 'text' => 'Rechnungsadresse', 'required' => true, 'type' => 'autocomplete', 'table' => ['class' => 'text-nowrap', 'filter' => 'autocomplete'], 'modal' => ['apiUrl' => 'Address/api?do=findAddress', 'items' => '/Address/Api?do=findAddress', 'type' => 'autocomplete']],
|
['key' => 'billingAddressId', 'text' => 'Rechnungsadresse', 'required' => true, 'type' => 'autocomplete', 'table' => ['class' => 'text-nowrap', 'filter' => 'autocomplete'], 'modal' => ['apiUrl' => 'Address/api?do=findAddress', 'items' => '/Address/Api?do=findAddress', 'type' => 'autocomplete']],
|
||||||
|
['key' => 'status', 'text' => 'Status', 'required' => true, 'table' => ['filter' => 'iconSelect'], 'modal' => ['type' => 'iconSelect', 'items' => [
|
||||||
|
['value' => 'new', 'text' => 'Neu', 'icon' => 'fas fa-star text-primary'],
|
||||||
|
['value' => 'in_progress', 'text' => 'In Bearbeitung', 'icon' => 'fas fa-cog text-warning'],
|
||||||
|
['value' => 'accepted', 'text' => 'Akzeptiert', 'icon' => 'fas fa-check text-success'],
|
||||||
|
['value' => 'invoiced', 'text' => 'In Rechnung gestellt', 'icon' => 'fas fa-file-invoice-dollar text-info'],
|
||||||
|
]]],
|
||||||
['key' => 'deliveryAddressName', 'text' => 'L.-Adr. Name', 'required' => true],
|
['key' => 'deliveryAddressName', 'text' => 'L.-Adr. Name', 'required' => true],
|
||||||
['key' => 'deliveryAddressLine', 'text' => 'L.-Adr.', 'required' => true],
|
['key' => 'deliveryAddressLine', 'text' => 'L.-Adr.', 'required' => true],
|
||||||
['key' => 'deliveryAddressPLZ', 'text' => 'L.-Adr. PLZ', 'required' => true],
|
['key' => 'deliveryAddressPLZ', 'text' => 'L.-Adr. PLZ', 'required' => true],
|
||||||
['key' => 'deliveryAddressEMail', 'text' => 'L.-Adr. EMail', 'required' => false, 'table' => false],
|
['key' => 'deliveryAddressEMail', 'text' => 'L.-Adr. EMail', 'required' => false, 'table' => false],
|
||||||
['key' => 'note', 'text' => 'Art der Arbeit', 'required' => true, 'table' => false],
|
['key' => 'note', 'text' => 'Art der Arbeit', 'required' => true, 'table' => false],
|
||||||
['key' => 'status', 'text' => 'Status', 'required' => true, 'table' => ['filter' => 'select'], 'modal' => ['type' => 'select', 'items' => [['value' => 'new', 'text' => 'Neu'], ['value' => 'in_progress', 'text' => 'In Bearbeitung'], ['value' => 'accepted', 'text' => 'Akzeptiert'], ['value' => 'invoiced', 'text' => 'In Rechnung gestellt'],]]],
|
|
||||||
['key' => 'positions', 'text' => 'Positionen', 'required' => true, 'table' => false, 'modal' => false],
|
['key' => 'positions', 'text' => 'Positionen', 'required' => true, 'table' => false, 'modal' => false],
|
||||||
['key' => 'create', 'text' => 'Erstellt', 'required' => false, 'modal' => ['visible' => false], 'table' => ['filter' => 'date']],
|
['key' => 'create', 'text' => 'Erstellt', 'required' => false, 'modal' => ['visible' => false], 'table' => ['filter' => 'date']],
|
||||||
['key' => 'createBy', 'text' => 'Erstellt von', 'required' => false, 'type' => 'autocomplete', 'table' => ['class' => 'text-nowrap', 'filter' => 'select'], 'modal' => ['items' => [], 'type' => 'select',]],
|
['key' => 'createBy', 'text' => 'Erstellt von', 'required' => false, 'type' => 'autocomplete', 'table' => ['class' => 'text-nowrap', 'filter' => 'select'], 'modal' => ['items' => [], 'type' => 'select',]],
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ class Mapbox_StaticImageApi {
|
|||||||
$pin_part .= "+$pin_color($pin_gps_long,$pin_gps_lat)";
|
$pin_part .= "+$pin_color($pin_gps_long,$pin_gps_lat)";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$initial_path_count = 0;
|
||||||
|
$path_count = 0;
|
||||||
$path_parts = [];
|
$path_parts = [];
|
||||||
if(is_array($paths) && count($paths)) {
|
if(is_array($paths) && count($paths)) {
|
||||||
$path_stroke_width = $paths["line_width"];
|
$path_stroke_width = $paths["line_width"];
|
||||||
@@ -37,8 +39,8 @@ class Mapbox_StaticImageApi {
|
|||||||
$path_fill_color = $paths["line_fill_color"];
|
$path_fill_color = $paths["line_fill_color"];
|
||||||
$path_fill_opacity = $paths["line_fill_opacity"];
|
$path_fill_opacity = $paths["line_fill_opacity"];
|
||||||
|
|
||||||
$path_count = 0;
|
|
||||||
$initial_path_count = 0;
|
|
||||||
foreach($paths["coords"] as $path) {
|
foreach($paths["coords"] as $path) {
|
||||||
$initial_path_count++;
|
$initial_path_count++;
|
||||||
//mfLoghandler::singleton()->debug(print_r($paths, true));
|
//mfLoghandler::singleton()->debug(print_r($paths, true));
|
||||||
@@ -101,7 +103,7 @@ class Mapbox_StaticImageApi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(is_array($url_opt_parts)) {
|
if(is_array($url_opt_parts) && count($url_opt_parts)) {
|
||||||
$url .= "/".implode(",", $url_opt_parts);
|
$url .= "/".implode(",", $url_opt_parts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,12 @@
|
|||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.dashboard-buttons {
|
||||||
|
display: flex;
|
||||||
|
gap: 1rem;
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@media (min-width: 768px) {
|
@media (min-width: 768px) {
|
||||||
.dashboard-cards {
|
.dashboard-cards {
|
||||||
|
|||||||
@@ -190,6 +190,39 @@ Vue.component('tt-timeline-chart', {
|
|||||||
|
|
||||||
Vue.component('dashboard-default', {
|
Vue.component('dashboard-default', {
|
||||||
props: ['dashboardData'],
|
props: ['dashboardData'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
selectedTimeframe: 'all',
|
||||||
|
window: window,
|
||||||
|
moment: moment
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
exportTimeline() {
|
||||||
|
// we need all timelines with "ONT installiert", "Leerrohr", "Bestellungen"
|
||||||
|
const data = this.dashboardData.timeline[0].map((item, index) => ({
|
||||||
|
date: item.date,
|
||||||
|
bestellungen: item.value,
|
||||||
|
leerrohr: this.dashboardData.timeline_leerrohr[0][index].value,
|
||||||
|
ont_installiert: this.dashboardData.timeline_ont_installed[0][index].value
|
||||||
|
}));
|
||||||
|
|
||||||
|
// dont use any library for the csv
|
||||||
|
const csv = [
|
||||||
|
['Datum', 'Bestellungen', 'Leerrohr', 'ONT installiert'],
|
||||||
|
...data.map(item => [item.date, item.bestellungen, item.leerrohr, item.ont_installiert])
|
||||||
|
].map(row => row.join(';')).join('\n');
|
||||||
|
|
||||||
|
const blob = new Blob([csv], {type: 'text/csv'});
|
||||||
|
const url = URL.createObjectURL(blob);
|
||||||
|
const a = document.createElement('a');
|
||||||
|
|
||||||
|
a.href = url;
|
||||||
|
a.download = 'timeline.csv';
|
||||||
|
a.click();
|
||||||
|
URL.revokeObjectURL(url);
|
||||||
|
}
|
||||||
|
},
|
||||||
template: `
|
template: `
|
||||||
<div>
|
<div>
|
||||||
<h4 class="mt-4">Bestellungen</h4>
|
<h4 class="mt-4">Bestellungen</h4>
|
||||||
@@ -307,13 +340,25 @@ Vue.component('dashboard-default', {
|
|||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
<h4 class="mt-4">Bestellverlauf</h4>
|
<h4 class="mt-4">Bestellverlauf</h4>
|
||||||
|
|
||||||
|
<!-- add 4 new buttons here tt-button "Letzten 4 Wochen, Letzte 3 Monate, Letzten 6 Monate-->
|
||||||
|
<div class="dashboard-buttons">
|
||||||
|
<tt-button text="CSV Download" additional-class="btn-success" @click="exportTimeline" icon="fas fa-download"/>
|
||||||
|
<tt-button text="Letzten 4 Wochen" additional-class="btn-primary" @click="selectedTimeframe = '4 weeks'" v-if="selectedTimeframe !== '4 weeks'"/>
|
||||||
|
<tt-button text="Letzte 3 Monate" additional-class="btn-primary" @click="selectedTimeframe = '3 months'" v-if="selectedTimeframe !== '3 months'"/>
|
||||||
|
<tt-button text="Letzte 6 Monate" additional-class="btn-primary" @click="selectedTimeframe = '6 months'" v-if="selectedTimeframe !== '6 months'"/>
|
||||||
|
<tt-button text="Alle" additional-class="btn-primary" @click="selectedTimeframe = 'all'" v-if="selectedTimeframe !== 'all'"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="dashboard-chart">
|
<div class="dashboard-chart">
|
||||||
<tt-timeline-chart
|
<tt-timeline-chart
|
||||||
v-if="dashboardData.timeline.length > 0"
|
v-if="dashboardData.timeline.length > 0"
|
||||||
:datasets="[
|
:datasets="[
|
||||||
{
|
{
|
||||||
label: 'Bestellungen',
|
label: 'Bestellungen',
|
||||||
data: dashboardData.timeline[0],
|
data: dashboardData.timeline[0].filter(item => {
|
||||||
|
return selectedTimeframe === 'all' || moment(item.date).isAfter(moment().subtract(selectedTimeframe.split(' ')[0], selectedTimeframe.split(' ')[1]))
|
||||||
|
}),
|
||||||
color: 'rgb(75, 192, 192)',
|
color: 'rgb(75, 192, 192)',
|
||||||
fill: true,
|
fill: true,
|
||||||
yAxisID: 'y',
|
yAxisID: 'y',
|
||||||
@@ -321,7 +366,7 @@ Vue.component('dashboard-default', {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Leerrohr',
|
label: 'Leerrohr',
|
||||||
data: dashboardData.timeline_leerrohr[0],
|
data: dashboardData.timeline_leerrohr[0].filter(item => selectedTimeframe === 'all' || moment(item.date).isAfter(moment().subtract(selectedTimeframe.split(' ')[0], selectedTimeframe.split(' ')[1]))),
|
||||||
color: 'rgb(255, 99, 132)',
|
color: 'rgb(255, 99, 132)',
|
||||||
fill: false,
|
fill: false,
|
||||||
yAxisID: 'y',
|
yAxisID: 'y',
|
||||||
@@ -329,7 +374,7 @@ Vue.component('dashboard-default', {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'ONT installiert',
|
label: 'ONT installiert',
|
||||||
data: dashboardData.timeline_ont_installed[0],
|
data: dashboardData.timeline_ont_installed[0].filter(item => selectedTimeframe === 'all' || moment(item.date).isAfter(moment().subtract(selectedTimeframe.split(' ')[0], selectedTimeframe.split(' ')[1]))),
|
||||||
color: 'rgb(54, 162, 235)',
|
color: 'rgb(54, 162, 235)',
|
||||||
fill: false,
|
fill: false,
|
||||||
yAxisID: 'y',
|
yAxisID: 'y',
|
||||||
@@ -347,6 +392,39 @@ Vue.component('dashboard-default', {
|
|||||||
|
|
||||||
Vue.component('dashboard-rml', {
|
Vue.component('dashboard-rml', {
|
||||||
props: ['dashboardData'],
|
props: ['dashboardData'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
selectedTimeframe: 'all',
|
||||||
|
window: window,
|
||||||
|
moment: moment
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
exportTimeline() {
|
||||||
|
// we need all timelines with "ONT installiert", "Leerrohr", "Bestellungen"
|
||||||
|
const data = this.dashboardData.timeline[0].map((item, index) => ({
|
||||||
|
date: item.date,
|
||||||
|
bestellungen: item.value,
|
||||||
|
leerrohr: this.dashboardData.timeline_leerrohr[0][index].value,
|
||||||
|
ont_installiert: this.dashboardData.timeline_ont_installed[0][index].value
|
||||||
|
}));
|
||||||
|
|
||||||
|
// dont use any library for the csv
|
||||||
|
const csv = [
|
||||||
|
['Datum', 'Bestellungen', 'Leerrohr', 'ONT installiert'],
|
||||||
|
...data.map(item => [item.date, item.bestellungen, item.leerrohr, item.ont_installiert])
|
||||||
|
].map(row => row.join(';')).join('\n');
|
||||||
|
|
||||||
|
const blob = new Blob([csv], {type: 'text/csv'});
|
||||||
|
const url = URL.createObjectURL(blob);
|
||||||
|
const a = document.createElement('a');
|
||||||
|
|
||||||
|
a.href = url;
|
||||||
|
a.download = 'timeline.csv';
|
||||||
|
a.click();
|
||||||
|
URL.revokeObjectURL(url);
|
||||||
|
}
|
||||||
|
},
|
||||||
template: `
|
template: `
|
||||||
<div>
|
<div>
|
||||||
<h4 class="mt-4">Bestellungen</h4>
|
<h4 class="mt-4">Bestellungen</h4>
|
||||||
@@ -439,45 +517,55 @@ Vue.component('dashboard-rml', {
|
|||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
<h4 class="mt-4">Bestellverlauf</h4>
|
<h4 class="mt-4">Bestellverlauf</h4>
|
||||||
|
<div class="dashboard-buttons">
|
||||||
|
<tt-button text="CSV Download" additional-class="btn-success" @click="exportTimeline" icon="fas fa-download"/>
|
||||||
|
<tt-button text="Letzten 4 Wochen" additional-class="btn-primary" @click="selectedTimeframe = '4 weeks'" v-if="selectedTimeframe !== '4 weeks'"/>
|
||||||
|
<tt-button text="Letzte 3 Monate" additional-class="btn-primary" @click="selectedTimeframe = '3 months'" v-if="selectedTimeframe !== '3 months'"/>
|
||||||
|
<tt-button text="Letzte 6 Monate" additional-class="btn-primary" @click="selectedTimeframe = '6 months'" v-if="selectedTimeframe !== '6 months'"/>
|
||||||
|
<tt-button text="Alle" additional-class="btn-primary" @click="selectedTimeframe = 'all'" v-if="selectedTimeframe !== 'all'"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="dashboard-chart">
|
<div class="dashboard-chart">
|
||||||
<tt-timeline-chart
|
<tt-timeline-chart
|
||||||
v-if="dashboardData.timeline.length > 0"
|
v-if="dashboardData.timeline.length > 0"
|
||||||
:datasets="[
|
:datasets="[
|
||||||
{
|
{
|
||||||
label: 'Bestellungen',
|
label: 'Bestellungen',
|
||||||
data: dashboardData.timeline[0],
|
data: dashboardData.timeline[0].filter(item => {
|
||||||
color: 'rgb(23, 162, 184)',
|
return selectedTimeframe === 'all' || moment(item.date).isAfter(moment().subtract(selectedTimeframe.split(' ')[0], selectedTimeframe.split(' ')[1]))
|
||||||
|
}),
|
||||||
|
color: 'rgb(75, 192, 192)',
|
||||||
fill: true,
|
fill: true,
|
||||||
yAxisID: 'y',
|
yAxisID: 'y',
|
||||||
order: 5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Summe von 244+245',
|
|
||||||
data: dashboardData.timeline_inhouse_kabel_verlegt_efh[0],
|
|
||||||
color: 'rgb(0, 123, 255)',
|
|
||||||
fill: false,
|
|
||||||
yAxisID: 'y',
|
|
||||||
order: 4
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Status 500 Energie Steiermark',
|
|
||||||
data: dashboardData.timeline_status_500_energie_steiermark[0],
|
|
||||||
color: 'rgb(40, 167, 69)',
|
|
||||||
fill: false,
|
|
||||||
yAxisID: 'y',
|
|
||||||
order: 3
|
order: 3
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Status 500 Magenta',
|
label: 'Summe von 244+245',
|
||||||
data: dashboardData.timeline_status_500_magenta[0],
|
data: dashboardData.timeline_inhouse_kabel_verlegt_efh[0].filter(item => selectedTimeframe === 'all' || moment(item.date).isAfter(moment().subtract(selectedTimeframe.split(' ')[0], selectedTimeframe.split(' ')[1]))),
|
||||||
color: 'rgb(226, 0, 116)',
|
color: 'rgb(0, 123, 255)',
|
||||||
fill: false,
|
fill: false,
|
||||||
yAxisID: 'y',
|
yAxisID: 'y',
|
||||||
order: 2
|
order: 2
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: 'Status 500 Energie Steiermark',
|
||||||
|
data: dashboardData.timeline_status_500_energie_steiermark[0].filter(item => selectedTimeframe === 'all' || moment(item.date).isAfter(moment().subtract(selectedTimeframe.split(' ')[0], selectedTimeframe.split(' ')[1]))),
|
||||||
|
color: 'rgb(40, 167, 69)',
|
||||||
|
fill: false,
|
||||||
|
yAxisID: 'y',
|
||||||
|
order: 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Status 500 Magenta',
|
||||||
|
data: dashboardData.timeline_status_500_magenta[0].filter(item => selectedTimeframe === 'all' || moment(item.date).isAfter(moment().subtract(selectedTimeframe.split(' ')[0], selectedTimeframe.split(' ')[1]))),
|
||||||
|
color: 'rgb(226, 0, 116)',
|
||||||
|
fill: false,
|
||||||
|
yAxisID: 'y',
|
||||||
|
order: 1
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: 'Status 500 Salzburg AG',
|
label: 'Status 500 Salzburg AG',
|
||||||
data: dashboardData.timeline_status_500_salzburg_ag[0],
|
data: dashboardData.timeline_status_500_salzburg_ag[0].filter(item => selectedTimeframe === 'all' || moment(item.date).isAfter(moment().subtract(selectedTimeframe.split(' ')[0], selectedTimeframe.split(' ')[1]))),
|
||||||
color: 'rgb(0, 102, 179)',
|
color: 'rgb(0, 102, 179)',
|
||||||
fill: false,
|
fill: false,
|
||||||
yAxisID: 'y',
|
yAxisID: 'y',
|
||||||
@@ -487,9 +575,9 @@ Vue.component('dashboard-rml', {
|
|||||||
label="KW"
|
label="KW"
|
||||||
:showGrid="false"
|
:showGrid="false"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> `
|
||||||
`
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -15,29 +15,27 @@ Vue.component('warehouse-offer-modal', {
|
|||||||
sm
|
sm
|
||||||
row
|
row
|
||||||
v-model="offer.editor"/>
|
v-model="offer.editor"/>
|
||||||
<tt-input label="Kundennummer" v-model="offer.customerNumber" sm row/>
|
|
||||||
|
<tt-autocomplete label="Kunde" v-model="offer.customerNumber" sm row :api-url="billAddrAutoCompleteUrl"/>
|
||||||
<tt-input label="Kundenreferenz" v-model="offer.reference" sm row/>
|
<tt-input label="Kundenreferenz" v-model="offer.reference" sm row/>
|
||||||
<tt-textarea label="Angebotszweck" v-model="offer.purpose" sm row/>
|
<tt-textarea label="Angebotszweck" v-model="offer.purpose" sm row/>
|
||||||
<hr>
|
<hr>
|
||||||
<h4 class="text-center">Kundenadresse</h4>
|
<h4 class="text-center">Kundenadresse</h4>
|
||||||
<div style="display: grid; grid-gap: 10px; grid-template-columns: 2fr 2fr 1fr 1fr 2fr;">
|
<div style="display: grid; grid-gap: 10px; grid-template-columns: 2fr 1fr 2fr 1fr 1fr;">
|
||||||
<tt-input label="Name" v-model="offer.customerName" sm/>
|
<tt-input label="Name" v-model="offer.customerName" sm/>
|
||||||
|
<tt-input label="Kontakt" v-model="offer.contactPerson" sm/>
|
||||||
<tt-input label="Straße" v-model="offer.customerStreet" sm/>
|
<tt-input label="Straße" v-model="offer.customerStreet" sm/>
|
||||||
<tt-input label="PLZ" v-model="offer.customerZip" sm/>
|
<tt-input label="PLZ" v-model="offer.customerZip" sm/>
|
||||||
<tt-input label="Ort" v-model="offer.customerCity" sm/>
|
<tt-input label="Ort" v-model="offer.customerCity" sm/>
|
||||||
<tt-input label="UID" v-model="offer.customerVAT" sm/>
|
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
<h4 class="text-center">Positionen</h4>
|
<h4 class="text-center">Positionen</h4>
|
||||||
<tt-positions-manager ref="positionsManager" v-model="offer.positions" :config="positionsConfig" @updateField-article="fetchArticleData"/>
|
<tt-positions-manager group-mode ref="positionsManager" v-model="offer.positions" :config="positionsConfig" @updateField-article="fetchArticleData"/>
|
||||||
<hr>
|
|
||||||
<h4 class="text-center">Alternative Artikel</h4>
|
|
||||||
<tt-positions-manager ref="alternativePositionsManager" v-model="offer.alternativePositions" :config="alternativePositionsConfig"/>
|
|
||||||
<hr>
|
<hr>
|
||||||
<tt-input label="Gesamtrabatt (%)" v-model="offer.totalDiscount" sm row type="number"/>
|
<tt-input label="Gesamtrabatt (%)" v-model="offer.totalDiscount" sm row type="number"/>
|
||||||
<tt-select label="Zahlungskonditionen" :options="paymentTerms" sm row v-model="offer.paymentTerms"/>
|
<tt-select label="Zahlungskonditionen" :options="paymentTerms" sm row v-model="offer.paymentTerms"/>
|
||||||
<tt-select label="Lieferkonditionen" :options="deliveryTerms" sm row v-model="offer.deliveryTerms"/>
|
<tt-select label="Lieferkonditionen" :options="deliveryTerms" sm row v-model="offer.deliveryTerms"/>
|
||||||
<tt-select label="Schlusstext" :options="closingTexts" sm row v-model="offer.closingText"/>
|
<tt-textarea label="Schlusstext" sm rows="11" row v-model="offer.closingText"/>
|
||||||
<hr>
|
<hr>
|
||||||
<tt-textarea label="Notizen" v-model="offer.notes" sm row/>
|
<tt-textarea label="Notizen" v-model="offer.notes" sm row/>
|
||||||
</div>
|
</div>
|
||||||
@@ -45,6 +43,7 @@ Vue.component('warehouse-offer-modal', {
|
|||||||
`,
|
`,
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
billAddrAutoCompleteUrl: window.TT_CONFIG['BASE_PATH'] + '/Address/Api?do=findAddress&fibu_primary_account=1',
|
||||||
window: window,
|
window: window,
|
||||||
positionsConfig: {
|
positionsConfig: {
|
||||||
fields: {
|
fields: {
|
||||||
@@ -57,6 +56,7 @@ Vue.component('warehouse-offer-modal', {
|
|||||||
amount: {type: 'input', label: 'Menge', inputType: 'number'},
|
amount: {type: 'input', label: 'Menge', inputType: 'number'},
|
||||||
unit: {type: 'input', label: 'Einheit'},
|
unit: {type: 'input', label: 'Einheit'},
|
||||||
articleNumber: {type: 'input', label: 'Artikelnummer'},
|
articleNumber: {type: 'input', label: 'Artikelnummer'},
|
||||||
|
isAlternative: {type: 'checkbox', label: 'Alternativposition'},
|
||||||
unitPrice: {type: 'input', label: 'Einzelpreis', inputType: 'number'},
|
unitPrice: {type: 'input', label: 'Einzelpreis', inputType: 'number'},
|
||||||
discount: {type: 'input', label: 'Rabatt (%)', inputType: 'number'},
|
discount: {type: 'input', label: 'Rabatt (%)', inputType: 'number'},
|
||||||
},
|
},
|
||||||
@@ -71,12 +71,6 @@ Vue.component('warehouse-offer-modal', {
|
|||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
alternativePositionsConfig: {
|
|
||||||
fields: {
|
|
||||||
article: {type: 'input', label: 'Artikel'},
|
|
||||||
description: {type: 'textarea', label: 'Beschreibung'},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
paymentTerms: [
|
paymentTerms: [
|
||||||
{value: 'net30', text: '30 Tage netto'},
|
{value: 'net30', text: '30 Tage netto'},
|
||||||
{value: 'net60', text: '60 Tage netto'},
|
{value: 'net60', text: '60 Tage netto'},
|
||||||
@@ -87,11 +81,6 @@ Vue.component('warehouse-offer-modal', {
|
|||||||
{value: 'free_delivery', text: 'Frei Haus'},
|
{value: 'free_delivery', text: 'Frei Haus'},
|
||||||
{value: 'fob', text: 'FOB'},
|
{value: 'fob', text: 'FOB'},
|
||||||
],
|
],
|
||||||
closingTexts: [
|
|
||||||
{value: 'standard', text: 'Standardtext'},
|
|
||||||
{value: 'custom1', text: 'Angepasster Text 1'},
|
|
||||||
{value: 'custom2', text: 'Angepasster Text 2'},
|
|
||||||
],
|
|
||||||
offer: {
|
offer: {
|
||||||
editor: window.TT_CONFIG['USER_ID'],
|
editor: window.TT_CONFIG['USER_ID'],
|
||||||
customerNumber: '',
|
customerNumber: '',
|
||||||
@@ -107,7 +96,18 @@ Vue.component('warehouse-offer-modal', {
|
|||||||
totalDiscount: 0,
|
totalDiscount: 0,
|
||||||
paymentTerms: 'net30',
|
paymentTerms: 'net30',
|
||||||
deliveryTerms: 'ex_works',
|
deliveryTerms: 'ex_works',
|
||||||
closingText: 'standard',
|
closingText: 'Sollten sich die Rohstoffpreise bzw. die Preise unserer Zulieferer um mehr als 10% innerhalb der Angebots bzw.\n' +
|
||||||
|
'\n' +
|
||||||
|
'Auftragsgültigkeit erhöhen (Stichtag Datum), sind wir gezwungen die Preise anzupassen.\n' +
|
||||||
|
'\n' +
|
||||||
|
'Diese Angebot hat eine Gültigkeit von 4 Wochen.\n' +
|
||||||
|
'\n' +
|
||||||
|
'Verrechnung erfolgt nach tatsächlichem Aufwand.\n' +
|
||||||
|
'\n' +
|
||||||
|
'Wir sind sicher, Ihnen ein konkurenzfähiges Angebot unterbreitet zu haben und sehen gern Ihrer Bestellung entgegen.\n' +
|
||||||
|
'\n' +
|
||||||
|
'Sollten Sie noch Fragen oder weitere Informationen benötigen stehen wir Ihnen jederzeit gern zu Verfügung.\n' +
|
||||||
|
' ',
|
||||||
notes: '',
|
notes: '',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -218,19 +218,20 @@ Vue.component('warehouse-order', {
|
|||||||
<tt-card>
|
<tt-card>
|
||||||
<warehouse-order-modal v-if="orderModalId" :id="orderModalId" @close="closeOrderModal"/>
|
<warehouse-order-modal v-if="orderModalId" :id="orderModalId" @close="closeOrderModal"/>
|
||||||
<button @click="orderModalId = 'create'" class="btn btn-primary">Bestellung erstellen</button>
|
<button @click="orderModalId = 'create'" class="btn btn-primary">Bestellung erstellen</button>
|
||||||
<tt-table-crud emit-edit @edit="orderModalId = $event.id" ref="table">
|
<tt-table-crud emit-edit
|
||||||
|
@openpdf="window.open(window.TT_CONFIG['BASE_PATH'] + '/WarehouseOrder/createPDF?id=' + $event.id)"
|
||||||
|
@edit="orderModalId = $event.id" ref="table">
|
||||||
<template v-slot:expandedRow="{ row }">
|
<template v-slot:expandedRow="{ row }">
|
||||||
<warehouse-order-detail :id="row['id']"/>
|
<warehouse-order-detail :id="row['id']"/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-slot:sum="{ row }">{{ calculateSum(JSON.parse(row["positions"])).toFixed(2)}} €</template>
|
<template v-slot:sum="{ row }">{{ calculateSum(JSON.parse(row["positions"])).toFixed(2)}} €</template>
|
||||||
<!-- TODO: think of a way here prob we add it to the database as field-->
|
|
||||||
<template v-slot:distributor="{ row }">{{ row.id % 2 == 0 ? 'Triotronik' : 'Discomp' }}</template>
|
|
||||||
</tt-table-crud>
|
</tt-table-crud>
|
||||||
</tt-card>
|
</tt-card>
|
||||||
`,
|
`,
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
window: window,
|
||||||
orderModalId: null,
|
orderModalId: null,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -87,6 +87,10 @@ table = $('#datatable').DataTable({
|
|||||||
$('#must-time').text(json.time.must);
|
$('#must-time').text(json.time.must);
|
||||||
$('#holidays').text(json.time.holidays);
|
$('#holidays').text(json.time.holidays);
|
||||||
$('#plushours').text(json.time.plushours);
|
$('#plushours').text(json.time.plushours);
|
||||||
|
if (json.time.AllHours!="00h:00m") {
|
||||||
|
$('#AllHours-div').show();
|
||||||
|
$('#AllHours').text(json.time.AllHours);
|
||||||
|
}
|
||||||
if ($("#plushours").text().includes("-")) {
|
if ($("#plushours").text().includes("-")) {
|
||||||
$('#plushours-label').css('background-color', '#fda7a7');
|
$('#plushours-label').css('background-color', '#fda7a7');
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ Vue.component('tt-modal', {
|
|||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
style="background: rgba(0, 0, 0, 0.5);"
|
style="background: rgba(0, 0, 0, 0.5);"
|
||||||
ref="modal"
|
ref="modal"
|
||||||
@mousedown="!isMobile ? $emit('update:show', false) : null"
|
|
||||||
@keydown.esc="$emit('update:show', false)"
|
@keydown.esc="$emit('update:show', false)"
|
||||||
v-if="show">
|
v-if="show">
|
||||||
<div class="modal-dialog modal-lg modal-dialog-scrollable" role="document" @mousedown.stop>
|
<div class="modal-dialog modal-lg modal-dialog-scrollable" role="document" @mousedown.stop>
|
||||||
|
|||||||
@@ -1,13 +1,42 @@
|
|||||||
|
Vue.component('tt-resolver', {
|
||||||
|
props: {
|
||||||
|
value: {type: Number, required: true},
|
||||||
|
reference: {type: String, required: true},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
window: window,
|
||||||
|
loading: true,
|
||||||
|
text: '',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
template: `
|
||||||
|
<div v-if="loading" class="d-flex justify-content-center align-items-center">
|
||||||
|
<div class="spinner-border spinner-border-sm text-primary" role="status">
|
||||||
|
<span class="sr-only">Loading...</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<span v-else>{{ text }}</span>
|
||||||
|
`,
|
||||||
|
async created() {
|
||||||
|
const entry = await axios.get(window.TT_CONFIG['BASE_PATH'] + '/' + this.reference + '/getById?id=' + this.value);
|
||||||
|
this.text = entry.data.name ?? entry.data.title ?? entry.data.text ?? '[E] Key not found';
|
||||||
|
this.loading = false;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
Vue.component('tt-positions-manager', {
|
Vue.component('tt-positions-manager', {
|
||||||
props: {
|
props: {
|
||||||
value: {type: Array, required: false},
|
value: {type: Array, required: false},
|
||||||
config: {type: Object, required: true},
|
config: {type: Object, required: true},
|
||||||
|
groupMode: {type: Boolean, default: false},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
window: window,
|
window: window,
|
||||||
positions: this.value,
|
positions: this.value,
|
||||||
formData: {},
|
formData: {},
|
||||||
|
groupName: '',
|
||||||
selectedIndex: null,
|
selectedIndex: null,
|
||||||
resolvingFields: {},
|
resolvingFields: {},
|
||||||
}
|
}
|
||||||
@@ -63,6 +92,12 @@ Vue.component('tt-positions-manager', {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-container" v-if="groupMode">
|
||||||
|
<tt-input label="Gruppenname" v-model="groupName" sm/>
|
||||||
|
<tt-button @click="addGroup" sm text="Gruppe hinzufügen" additional-class="btn-primary"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<table class="table table-striped table-sm">
|
<table class="table table-striped table-sm">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -71,6 +106,28 @@ Vue.component('tt-positions-manager', {
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
<template v-if="groupMode">
|
||||||
|
<template v-for="(groupPositions, groupName) in groupedPositions">
|
||||||
|
<tr>
|
||||||
|
<td colspan="100%">
|
||||||
|
<h4 style="text-align: center;">{{ groupName }}</h4>
|
||||||
|
</td>
|
||||||
|
<tr v-for="(position, index) in groupPositions" :key="groupName + index">
|
||||||
|
<td v-for="(field, key) in config.fields">
|
||||||
|
<tt-resolver v-if="field.customFieldReference" :reference="field.customFieldReference" :value="position[key]"/>
|
||||||
|
<span v-else>{{ formatFieldValue(position[key], field) }}</span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<select v-model="position._group" @change="$set(position, '_group', $event.target.value)">
|
||||||
|
<option v-for="group in allGroups" :value="group">{{ group }}</option>
|
||||||
|
</select>
|
||||||
|
<button @click="editEntry(index)" class="btn btn-sm btn-primary">Editieren</button>
|
||||||
|
<button @click="deleteEntry(index)" class="btn btn-sm btn-danger">Löschen</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
<tr v-for="(position, index) in positions" :key="index">
|
<tr v-for="(position, index) in positions" :key="index">
|
||||||
<td v-for="(field, key) in config.fields">
|
<td v-for="(field, key) in config.fields">
|
||||||
<template v-if="resolvingFields[index + key] === true">
|
<template v-if="resolvingFields[index + key] === true">
|
||||||
@@ -85,10 +142,14 @@ Vue.component('tt-positions-manager', {
|
|||||||
<span v-else>{{ formatFieldValue(position[key], field) }}</span>
|
<span v-else>{{ formatFieldValue(position[key], field) }}</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
<select v-model="position._group" @change="position._group = $event">
|
||||||
|
<option v-for="group in allGroups" :value="group">{{ group }}</option>
|
||||||
|
</select>
|
||||||
<button @click="editEntry(index)" class="btn btn-sm btn-primary">Editieren</button>
|
<button @click="editEntry(index)" class="btn btn-sm btn-primary">Editieren</button>
|
||||||
<button @click="deleteEntry(index)" class="btn btn-sm btn-danger">Löschen</button>
|
<button @click="deleteEntry(index)" class="btn btn-sm btn-danger">Löschen</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</template>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
@@ -110,6 +171,10 @@ Vue.component('tt-positions-manager', {
|
|||||||
this.$emit('input', this.positions);
|
this.$emit('input', this.positions);
|
||||||
this.resetForm();
|
this.resetForm();
|
||||||
},
|
},
|
||||||
|
addGroup() {
|
||||||
|
this.positions.push({_group: this.groupName});
|
||||||
|
this.groupName = '';
|
||||||
|
},
|
||||||
editEntry(index) {
|
editEntry(index) {
|
||||||
this.selectedIndex = index;
|
this.selectedIndex = index;
|
||||||
this.formData = {...this.positions[index]};
|
this.formData = {...this.positions[index]};
|
||||||
@@ -133,7 +198,7 @@ Vue.component('tt-positions-manager', {
|
|||||||
this.$set(this.resolvingFields, i + key, true);
|
this.$set(this.resolvingFields, i + key, true);
|
||||||
const textValue = await this.config.fields[key].customFieldResolver(this.positions[i][key]);
|
const textValue = await this.config.fields[key].customFieldResolver(this.positions[i][key]);
|
||||||
this.$set(this.resolvingFields, i + key, textValue);
|
this.$set(this.resolvingFields, i + key, textValue);
|
||||||
} else if (this.config.fields[key].customFieldReference) {
|
} else if (this.config.fields[key].customFieldReference && this.positions[i][key]) {
|
||||||
this.$set(this.resolvingFields, i + key, true);
|
this.$set(this.resolvingFields, i + key, true);
|
||||||
if (this.config.fields[key].customFieldReference) {
|
if (this.config.fields[key].customFieldReference) {
|
||||||
const entry = await axios.get(window.TT_CONFIG['BASE_PATH'] +
|
const entry = await axios.get(window.TT_CONFIG['BASE_PATH'] +
|
||||||
@@ -153,6 +218,20 @@ Vue.component('tt-positions-manager', {
|
|||||||
created() {
|
created() {
|
||||||
if (this.config.customMethods) Object.assign(this, this.config.customMethods);
|
if (this.config.customMethods) Object.assign(this, this.config.customMethods);
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
groupedPositions() {
|
||||||
|
const groups = {};
|
||||||
|
for (const position of this.positions) {
|
||||||
|
const group = position._group ?? 'Keine Gruppe';
|
||||||
|
if (!groups[group]) groups[group] = [];
|
||||||
|
if (Object.keys(position).length !== 1) groups[group].push(position);
|
||||||
|
}
|
||||||
|
return groups;
|
||||||
|
},
|
||||||
|
allGroups() {
|
||||||
|
return Object.keys(this.groupedPositions);
|
||||||
|
}
|
||||||
|
},
|
||||||
watch: {
|
watch: {
|
||||||
positions: {
|
positions: {
|
||||||
handler() {
|
handler() {
|
||||||
|
|||||||
Reference in New Issue
Block a user