Merge branch 'master' into fronkdev

This commit is contained in:
Frank Schubert
2025-02-11 14:32:51 +01:00
70 changed files with 3710 additions and 1165 deletions
+1
View File
@@ -27,6 +27,7 @@
<a href="<?=self::getUrl("Address","edit", ['id' => $address->id, 's' => $s, 'f' => "view"])?>" class="btn btn-outline-success"><i class="fas fa-edit"></i> Adresse bearbeiten</a>
</div>
<div class="float-right">
<a href="<?=self::getUrl("Address","tickets", ["address_id" => $address->id])?>" class="btn btn-purple mr-1"><i class="far fa-user-headset"></i> Tickets</a>
<a href="<?=self::getUrl("Address","invoice", ["address_id" => $address->id])?>" class="btn btn-purple mr-1"><i class="far fa-file-invoice-dollar"></i> Rechungsübersicht</a>
</div>
</div>
+22 -4
View File
@@ -33,10 +33,10 @@ $pagination_entity_name = "Zustimmungserklärungen";
<form method="get" action="<?=self::getUrl("ConstructionConsent")?>">
<div class="row">
<div class="col-2">
<div class="col-3">
<label class="form-label" for="filter_project_id">Projekt</label>
<select name="filter[project_id]" id="filter_project_id" class="form-control">
<option></option>
<option value="">Alle</option>
<?php foreach(ConstructionConsentProject::getAll() as $p): ?>
<option value="<?=$p->id?>" <?=(is_array($filter) && array_key_exists("project_id", $filter) && $p->id == $filter["project_id"]) ? "selected='selected'" : ""?>><?=$p->name?></option>
<?php endforeach; ?>
@@ -46,13 +46,31 @@ $pagination_entity_name = "Zustimmungserklärungen";
<div class="col-2">
<label class="form-label" for="filter_object_type">Objektart</label>
<select name="filter[object_type]" id="filter_object_type" class="form-control">
<option></option>
<option value="">Alle</option>
<option value="building" <?=(array_key_exists("object_type", $filter) && $filter["object_type"] == "building") ? "selected='selected'" : ""?>>Gebäude</option>
<option value="street" <?=(array_key_exists("object_type", $filter) && $filter["object_type"] == "street") ? "selected='selected'" : ""?>>Straße</option>
</select>
</div>
<div class="col-1">
<div class="col-2">
<label class="form-label" for="filter_network">Netzgebiet</label>
<select name="filter[network]" id="filter_network" class="form-control">
<option value="">Alle</option>
<?php
$networks = array_key_exists("project_id", $filter) && $filter["project_id"] ? ConstructionConsentNetwork::search(["constructionconsentproject_id" => $filter["project_id"]]) : ConstructionConsentNetwork::getAll();
$networkOptions = [];
foreach($networks as $network):
if (array_key_exists($network->adb_netzgebiet_id, $networkOptions)) continue;
$networkOptions[$network->adb_netzgebiet_id] = $network;?>
<option value="<?=$network->adb_netzgebiet_id?>" <?=(is_array($filter) && array_key_exists("network", $filter) && $network->adb_netzgebiet_id == $filter["network"]) ? "selected='selected'" : ""?>><?=$network->adb_netzgebiet->name?></option>
<?php endforeach;
?>
</select>
</div>
<div class="col-2">
<label class="form-label" for="filter_address">Objektadresse</label>
<input type="text" class="form-control" name="filter[address]" id="filter_address" value="<?=(array_key_exists('address', $filter)) ? $filter['address'] : ""?>" />
</div>
+69 -60
View File
@@ -1,6 +1,3 @@
<?php
?>
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/header.php"); ?>
<link href="<?= self::getResourcePath() ?>assets/css/datatables-std.css" rel="stylesheet"
type="text/css"/>
@@ -154,11 +151,14 @@
</ol>
</div>
<h4 class="page-title">Device: <span class="font-weight-normal ml-1"><?= $devices->data->name ?></span>
<span class="ml-2">
<?php if ($me->is('Admin')) : ?>
<span class="ml-2">
<a href="<?= self::getUrl("Device", "edit", ["id" => $devices->id, 'returnto' => "device-detail"]) ?>">
<button class="btn btn-primary">Bearbeiten</button>
</a>
</span></h4>
</span>
<?php endif; ?>
</h4>
</div>
</div>
</div>
@@ -275,7 +275,7 @@ foreach ($devicesall as $deviceall) {
}
?>
<div class="col-12 col-lg-4 card-border">
<div class="col-12 <?= ($me->is('Admin')) ? 'col-lg-4' : 'col-lg-7' ?> card-border">
<div>
<h4><?= $StdHeader ?></h4>
</div>
@@ -289,7 +289,7 @@ foreach ($devicesall as $deviceall) {
<tr>
<th class="w-30">Pop Name</th>
<td>
<a href="<?= self::getUrl("Pop", "Detail", ["id" => $devices->pop->id]) ?>"><?= $devices->pop->name ?></a>
<?= ($me->is('Admin')) ? '<a href="' . self::getUrl("Pop", "Detail", ["id" => $devices->pop->id]) . '">' . $devices->pop->name . '</a>' : $devices->pop->name ?>
</td>
</tr>
<tr>
@@ -338,67 +338,75 @@ foreach ($devicesall as $deviceall) {
}
?>
</div>
<div class="col-12 col-lg-3 card-border">
<div class="overflow-auto">
<h4 class="float-left">Config Backups</h4>
<?php if ($devices->devicetype->devicemanufactor->config_backup > count()): ?>
<span><i title="Switch config" class="fa-light fa-rectangle-code code-ico"
data-toggle="modal" data-target="#configCode"></i></span>
<?php endif; ?>
<div class="float-right">
<a id="create-backup-href"
href="<?= self::getUrl("Device", "api", ['do' => 'createconfig', 'ip' => $devices->ip, 'id' => $devices->id]) ?>"
<button class="btn btn-primary "><span id="create-backup-button-text">Backup erstellen</span>
<span id="create-backup-load"></i></span></button>
</a></div>
</div>
<?php
if ($devicesconfig->success == "true" && $devicesconfig->data > count()) {
?>
<div>
<table class="table table-sm">
<thead>
<tr>
<th>Datum/Uhrzeit</th>
<th></th>
</tr>
</thead>
<tbody>
<?php foreach ($devicesconfig->data as $config) :
$configfileCleartext = trim($config->config_cleartext);
$configfileCompressed = trim($config->config_compressed);
$configid = $config->id;
if ($configfileCleartext && $configfileCompressed) :
<?php if ($me->is('Admin')) : ?>
<div class="col-12 col-lg-3 card-border">
<div class="overflow-auto">
<h4 class="float-left">Config Backups</h4>
<?php if ($devices->devicetype->devicemanufactor->config_backup > count()): ?>
<span><i title="Switch config" class="fa-light fa-rectangle-code code-ico"
data-toggle="modal" data-target="#configCode"></i></span>
<?php endif;
if ($me->is('Admin')):
?>
<div class="float-right">
<a id="create-backup-href"
href="<?= self::getUrl("Device", "api", ['do' => 'createconfig', 'ip' => $devices->ip, 'id' => $devices->id]) ?>"
<button class="btn btn-primary "><span id="create-backup-button-text">Backup erstellen</span>
<span id="create-backup-load"></i></span></button>
</a></div>
<?php endif; ?>
</div>
<?php
if ($devicesconfig->success == "true" && $devicesconfig->data > count()) {
?>
<div>
<table class="table table-sm">
<thead>
<tr>
<th>Datum/Uhrzeit</th>
<th></th>
</tr>
</thead>
<tbody>
<?php foreach ($devicesconfig->data as $config) :
$configfileCleartext = trim($config->config_cleartext);
$configfileCompressed = trim($config->config_compressed);
$configid = $config->id;
if ($configfileCleartext && $configfileCompressed) :
$configLinks = '<a href="' . self::getUrl("Device", "api", ['do' => 'getconfig', 'id' => $configid, 'format' => 'txt', 'filename' => $configfileCleartext]) . '">
$configLinks = '<a href="' . self::getUrl("Device", "api", ['do' => 'getconfig', 'id' => $configid, 'format' => 'txt', 'filename' => $configfileCleartext]) . '">
TXT</a> / <a href="' . self::getUrl("Device", "api", ['do' => 'getconfig', 'id' => $configid, 'format' => 'xml', 'filename' => $configfileCompressed]) . '">
XML</a>';
elseif ($configfileCleartext || $configfileCompressed) :
$configLinks = '<a href="' . self::getUrl("Device", "api", ['do' => 'getconfig', 'id' => $configid, 'format' => 'txt', 'filename' => $configfileCleartext . $configfileCompressed]) . '">
elseif ($configfileCleartext || $configfileCompressed) :
$configLinks = '<a href="' . self::getUrl("Device", "api", ['do' => 'getconfig', 'id' => $configid, 'format' => 'txt', 'filename' => $configfileCleartext . $configfileCompressed]) . '">
TXT</a>';
endif;
?>
<tr>
<td><?= date("d.m.Y/H:i", $config->config_timestamp); ?></td>
<td><?= $configLinks; ?></td>
endif;
?>
<tr>
<td><?= date("d.m.Y/H:i", $config->config_timestamp); ?></td>
<td><?= $configLinks; ?></td>
</tr>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php
} else {
</tbody>
</table>
</div>
<?php
} else {
?>
<div class="mt-1">
<h5 class="text-center">Keine Configs vorhanden</h5>
</div>
<?php
}
?>
<div class="mt-1">
<h5 class="text-center">Keine Configs vorhanden</h5>
</div>
<?php
}
?>
</div>
</div>
<?php
endif
?>
</div>
<?php
if ($devices->devicetype->olt && TT_MBI_API_ENABLE) :
@@ -647,6 +655,7 @@ foreach ($devicesall as $deviceall) {
$config = str_replace("&&YEAR&&", $year, $config);
$config = str_replace("&&MONTH&&", $month, $config);
$config = str_replace("&&DAY&&", $day, $config);
$config = str_replace("&&IP&&", $devices->ip, $config);
?>
+2 -2
View File
@@ -55,7 +55,7 @@ $pagination_entity_name = "Rechnungen";
<input type="text" class="form-control" name="filter[customer_number]" id="filter_customer_number" value="<?=(array_key_exists("customer_number", $filter)) ? $filter['customer_number'] : ""?>"/>
</div>
<div class="col-1">
<label class="form-label" for="filter_fibu_account_number">FIBU Konten</label>
<label class="form-label" for="filter_fibu_account_number">FIBU</label>
<input type="text" class="form-control" name="filter[fibu_account_number]" id="filter_fibu_account_number" value="<?=(array_key_exists("fibu_account_number", $filter)) ? $filter['fibu_account_number'] : ""?>"/>
</div>
<div class="col-1">
@@ -474,4 +474,4 @@ $pagination_entity_name = "Rechnungen";
</script>
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>
+2
View File
@@ -738,7 +738,9 @@ $pagination_entity_name = "Vorbestellungen";
var marker_popup_content = '<?php include(realpath(dirname(__FILE__))."/include/preorder_popup.php");?>';
// popup fields
const preorder_view_url = `<?=self::getUrl("Preorder")?>/Index?filter[ucode]=${preorder.ucode}#preorder=${preorder.id}`;
[
["PREORDER_URL", preorder_view_url],
["street", preorder.adb_strasse],
["hausnummer", preorder.adb_hausnummer],
["zip", preorder.adb_plz],
@@ -37,6 +37,11 @@ ob_start();
<th class="font-weight-bold">Email:</th>
<td>{{EMAIL}}</td>
</tr>
</table>
<a href="{{PREORDER_URL}}" class="btn btn-primary text-white" target="_blank">
<i class="fas fa-eye"></i> Bestellung ansehen
</a>
<?=str_replace("\n"," ",ob_get_clean())?>
+182 -2
View File
@@ -4,6 +4,7 @@ foreach ($days as $key => $day) {
$daysSelect .= '<option value="' . $key . '">' . $day . '</option>';
}
$daysSelect .= "</select>";
?>
<script>
var daysselect = `<?= $daysSelect ?>`;
@@ -29,6 +30,15 @@ $daysSelect .= "</select>";
margin-left: 7px;
margin-top: 8px;
}
.remove-wh-history {
cursor: pointer;
color: #ff0606;
font-size: 17px;
float: right;
margin-left: 7px;
}
</style>
<!-- start page title -->
<div class="row">
@@ -214,6 +224,12 @@ $daysSelect .= "</select>";
<label class="col-form-label" for="workinghours"><span
id="workinghours-text">0 Stunden 0 Minuten</span></label>
</div>
<div class="col-lg-2 text-center">
<button type="button" id="change-workinghours" data-toggle="modal"
data-target="#closeWorkingHoursModal" class="btn btn-danger">
Arbeitszeit Abschluss
</button>
</div>
</div>
<?php
@@ -251,25 +267,113 @@ $daysSelect .= "</select>";
?>
</div>
</div>
</div>
<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>
<a href="<?= self::getUrl("TimerecordingEmployee") ?>">
<button type="button" class="btn btn-secondary">Abbrechen</button>
</a>
<button type="submit" class="btn btn-primary">Speichern</button>
</div>
</div>
</form>
</div>
<?php if ($timerecordingworkinghourshistory) : ?>
<div class="card-body">
<div class="card no-shadow">
<div class="card-body">
<div class="row">
<div class="col-lg-6">
<h4 class="header-title mb-2">Arbeitszeiten Historie</h4>
<table id="datatable" class="table table-sm ">
<thead>
<tr>
<th class="text-center">Arbeitszeiten</th>
<th class="text-center">Wochenstunden</th>
<th class="text-center">Bis</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
foreach ($timerecordingworkinghourshistory as $key => $timerecordingworkinghours):
if (!$timerecordingworkinghours['workinghours']) {
$historyworkingkours = '0 Stunden';
$historyworkingkoursText = "keine";
} else {
$historyworkingkoursText = $timerecordingworkinghours['workinghours'];
$hours = $timerecordingworkinghours['workingtime'] / 3600;
$historyworkingkours = $hours . ' Stunden';
}
?>
<tr>
<td class="text-center"><?= $historyworkingkoursText ?></td>
<td class="text-center"><?= $historyworkingkours ?></td>
<td class="text-center"><?= date('d.m.Y', $key) ?></td>
<td><i class="fa-regular fa-circle-minus remove-wh-history" data-id="<?= $timerecordingworkinghours['id'] ?>"></i>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<?php endif; ?>
</div>
</div>
</div>
<div class="modal fade" id="closeWorkingHoursModal" tabindex="-1" role="dialog"
aria-labelledby="closeWorkingHoursModalTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLongTitle">Arbeitszeit abschließen</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="form-group row justify-content-center ">
<label class="col-lg-5 col-form-label" for="user_id">Letzter Tag</label>
<div class="col-lg-5">
<input type="date" id="workingHoursCloseDate" class="form-control required">
</div>
</div>
<div class="form-group row justify-content-center ">
<div class="col-lg-12 row justify-content-center"><h4 class="p-0 m-1">Arbeitszeiten</h4></div>
<div class="col-lg-12 row justify-content-center"><h5 class="p-0 m-1"
id="workingHoursTime"></h5></div>
<div id="old-workingHours" class="col-lg-10">
<table class="table table-sm">
</table>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success" id="save-close-workingHours">Abschließen</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Abbrechen</button>
</div>
</div>
</div>
</div>
<script type="text/javascript">
function checktime() {
var sum = 0;
@@ -320,7 +424,83 @@ $daysSelect .= "</select>";
})
$(document).ready(function () {
checktime();
$('#closeWorkingHoursModal').on('shown.bs.modal', function () {
$('#old-workingHours table').empty();
$('#workingHoursCloseDate').val('');
$('#workingHoursTime').text($('#workinghours-text').text());
if ($(".wtime").length > 0) {
$(".wtime").each(function (index) {
var day = $(this).find('select').val();
var start = $(this).find('.timestart').val();
var end = $(this).find('.timeend').val();
var dayname = $(this).find('select option:selected').text();
var html = '<tr><td>' + dayname + '</td><td>' + start + '</td><td>' + end + '</td></tr>';
$('#old-workingHours table').append(html);
});
} else {
$('#old-workingHours table').append('<tr><td class="text-center" colspan="3">Keine Arbeitszeiten</td></tr>');
}
$(".wtime").each(function (index) {
});
})
//old-workingHours
$('body').on('click', '#save-close-workingHours', function () {
let reqworkingHoursSaveUrl = '<?= self::getUrl("TimerecordingEmployee", "api", ['do' => 'saveWorkingHours']) ?>';
let workingHours = [];
$(".wtime").each(function (index) {
var day = $(this).find('select').val();
var start = $(this).find('.timestart').val();
var end = $(this).find('.timeend').val();
workingHours.push({day: day, start: start, end: end});
});
let required = true;
$('.required').each(function () {
if ($(this).val() == '') {
required = false;
$(this).addClass('is-invalid');
} else {
$(this).removeClass('is-invalid');
}
});
if (!required) {
return;
}
$.ajax({
url: reqworkingHoursSaveUrl,
type: 'POST',
data: {
workingHours: workingHours,
enddate: $('#workingHoursCloseDate').val(),
userid: <?= $timerecordinguser[0]->id ?>
},
success: function (data) {
$('#closeWorkingHoursModal').modal('hide');
location.reload();
}
});
});
$('body').on('click', '.remove-wh-history', function () {
let reqworkingHoursSaveUrl = '<?= self::getUrl("TimerecordingEmployee", "api", ['do' => 'deleteWorkingHours']) ?>';
let id = $(this).data('id');
if (!confirm('Arbeitszeitänderung löschen?')) {
return;
}
$.ajax({
url: reqworkingHoursSaveUrl,
type: 'POST',
data: {
id: id,
userid: <?= $timerecordinguser[0]->id ?>
},
success: function (data) {
location.reload();
}
});
});
});
</script>
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>
+15 -32
View File
@@ -1,64 +1,47 @@
<?php
if (!isset($vueViewName)) {
die("vueViewName is not set");
}
if (!isset($mfLayoutPackage)) {
die("mfLayoutPackage is not set");
}
if (!isset($vueViewName)) die("vueViewName is not set");
if (!isset($mfLayoutPackage)) die("mfLayoutPackage is not set");
$additionalCSS = $additionalCSS ?? [];
$additionalJS = $additionalJS ?? [];
$vueViewPath = BASEDIR . "/public/js/pages/$vueViewName";
$additionalJS = [
"bundler.php",
...$additionalJS,
];
$additionalJS = ["bundler.php", ...$additionalJS];
if (is_dir($vueViewPath)) {
$files = scandir($vueViewPath);
foreach ($files as $file) {
if ($file === '.' || $file === '..') {
continue;
}
foreach (scandir($vueViewPath) as $file) {
if ($file === '.' || $file === '..') continue;
$fileExtension = pathinfo($file, PATHINFO_EXTENSION);
if ($fileExtension === 'css') {
$additionalCSS[] = "js/pages/$vueViewName/$file";
} else if ($fileExtension === 'js') {
$additionalJS[] = "js/pages/$vueViewName/$file";
}
if ($fileExtension === 'css') $additionalCSS[] = "js/pages/$vueViewName/$file";
else if ($fileExtension === 'js') $additionalJS[] = "js/pages/$vueViewName/$file";
}
}
$additionalCSS = [
...$additionalCSS,
...$additionalCSS,
'plugins/daterangepicker/daterangepicker.css',
'plugins/vue/tt-components/css/tt-table.css',
'plugins/vue/tt-components/css/tt-loader.css',
'plugins/vue/tt-components/css/tt-position-manager.css',
];
/**
* Convert PascalCase to snake_case (e.g. PascalCase to pascal-case)
* @param $str string PascalCase string
* @param string $str PascalCase string
* @return string snake-case string
*/
function pascalToSnakeCase(string $str): string {
$snakeCase = preg_replace('/(?<!^)([A-Z])/', '-$1', $str);
return strtolower($snakeCase);
return strtolower(preg_replace('/(?<!^)([A-Z])/', '-$1', $str));
}
$vueTagName = pascalToSnakeCase($vueViewName);
$vueHeaderPath = realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/vueHeader.php";
if(!file_exists($vueHeaderPath)) {
if (!file_exists($vueHeaderPath))
$vueHeaderPath = realpath(dirname(__FILE__) . "/../../default") . "/vueHeader.php";
}
include($vueHeaderPath); ?>
<div id="app">
<tt-page-title
v-if="window['TT_CONFIG'] && window['TT_CONFIG']['PAGE_TITLE'] && window['TT_CONFIG']['PATH']"
@@ -66,11 +49,11 @@ include($vueHeaderPath); ?>
:path="window['TT_CONFIG']['PATH']">
</tt-page-title>
<<?php echo $vueTagName; ?>></<?php echo $vueTagName; ?>>
<<?php echo $vueTagName; ?>>
</<?php echo $vueTagName; ?>>
</div>
<script>
const view = new Vue({el: '#app', data: {window: window}});
</script>
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>
@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html>
<head>
<title>Xinon Rechnung</title>
<meta charset="utf-8" />
</head>
<body style="border:0; margin: 0;font-family: sans-serif, Verdana;font-size: 11px;" onload="subst()">
<script>
function subst() {
var vars = {};
var query_strings_from_url = document.location.search.substring(1).split('&');
for (var query_string in query_strings_from_url) {
if (query_strings_from_url.hasOwnProperty(query_string)) {
var temp_var = query_strings_from_url[query_string].split('=', 2);
vars[temp_var[0]] = decodeURI(temp_var[1]);
}
}
var css_selector_classes = ['page', 'frompage', 'topage', 'webpage', 'section', 'subsection', 'date', 'isodate', 'time', 'title', 'doctitle', 'sitepage', 'sitepages'];
for (var css_class in css_selector_classes) {
if (css_selector_classes.hasOwnProperty(css_class)) {
var element = document.getElementsByClassName(css_selector_classes[css_class]);
for (var j = 0; j < element.length; ++j) {
element[j].textContent = vars[css_selector_classes[css_class]];
}
}
}
}
</script>
<div style="margin-bottom: 16px;height: 1px"></div>
<div style="color:grey;text-align: center;margin-bottom: 0">
<span>XINON GmbH | Fladnitz 150 | 8322 Studenzen</span><br>
<span>Tel.: +43 3115 40800 | E-Mail: office@xinon.at</span><br>
<span>UID: ATU68711968 | FN: 416556h | LG: Feldbach</span><br>
<span>IBAN: {{ bank_iban }} | BIC: {{ bank_bic }}</span><br>
</div>
<div style="text-align: right">Seite <span class="page"></span> von <span class="topage"></span></div>
<div style="margin-top: 16px;height: 1px"></div>
</body>
</html>
@@ -0,0 +1,92 @@
<!DOCTYPE html>
<html>
<head>
<title>XINON Shipping Note Header</title>
<meta charset="utf-8" />
<style>
body {
border: 0;
margin: 0;
font-family: sans-serif, Verdana;
font-size: 12px;
}
.info-table {
border-collapse: collapse;
width: 100%;
}
.customer-details {
vertical-align: bottom;
font-size: 14px;
padding-left: 30pt;
width: 35%;
}
.invoice-details {
border: 2px solid #e1e1e1;
padding: 6px;
}
.invoice-details td {
text-align: left;
}
.invoice-details td:first-child {
text-align: right;
}
.separator {
margin-top: 24px;
height: 1px;
}
#topSpacer {
margin-bottom: 32px;
height: 20px;
}
</style>
</head>
<body>
<div id="topSpacer"></div>
<div style="height: 50px; margin-bottom: 48px">
<img alt="Xinon Logo" src="{{ basedir }}/public/assets/images/xinon-full.png" style="text-align:left;height: 85px;">
</div>
<table style="width: 100%; border-collapse: collapse;">
<tr>
<td class="customer-details" style="float: left">
<h3>Lieferant</h3>
<div>{{ addressLine_1 }}</div>
<div>{{ addressLine_2 }}</div>
<div>{{ addressLine_3 }}</div>
<div>{{ addressLine_4 }}</div>
<div style="margin-bottom: 12pt"></div>
<div>{{ externalReference }}</div>
</td>
<td class="customer-details" align="top">
<h3>Rechnungsadresse</h3>
<div>{{ billingAddressLine_1 }}</div>
<div>{{ billingAddressLine_2 }}</div>
<div>{{ billingAddressLine_3 }}</div>
<div>{{ billingAddressLine_4 }}</div>
<div>{{ billingAddressLine_5 }}</div>
<div>{{ billingAddressLine_6 }}</div>
</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>
</table>
<div class="separator"></div>
</body>
</html>
+133
View File
@@ -0,0 +1,133 @@
<?php
/**
* @var string $ressourcePathPrefix
* @var WarehouseOrderModel $order
* @var Array $positions
* @var Array $textElements
*/
$this->setReturnValue(['filename' => $order["id"] . ".pdf"]);
?>
<!DOCTYPE html>
<html>
<head>
<title>Bestellung</title>
<meta charset="utf-8" />
<style>
body {
margin-top: 0;
/*padding-top: 20pt;*/
font-family: "Open Sans", sans-serif, Verdana;
font-size: 12px;
}
tr {
page-break-inside: avoid;
}
.uneven {
background-color: #ebebeb;
}
table tr td:last-child {
text-align: right;
}
.additionalRow td:first-child {
text-align: left;
padding-left: 20pt;
}
th {
height: 28px;
}
#invoiceTable tr *:nth-child(5),
#invoiceTable tr *:nth-child(4),
#invoiceTable tr *:nth-child(3) {
text-align: right;
}
#invoiceTable tr *:not(:first-child) {
padding: 4px 0;
}
#invoiceTable tr td {
font-size: 11px;
}
tr.position td {
vertical-align: top;
}
tr.position td:first-child {
vertical-align: middle !important;
padding-left: 4pt;
}
#invoiceTable tr td:first-child {
max-width: 200pt;
}
</style>
</head>
<body>
<div>
<!--
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">
<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">Artikel</th>
<th style="text-align: center;padding-right: 6pt">Art.-Nr. Lieferant</th>
<th style="text-align: right">Menge</th>
<th style="text-align: right">Einzelpreis</th>
<th style="text-align: right;padding-right: 8pt">Gesamtpreis</th>
</tr>
<?php $i = 0; foreach($order['positions'] as $p):?>
<tr class="position <?=($i%2 == 0) ? "even" : "uneven" ?>">
<td style="text-align: center;"><?= $i + 1 ?></td>
<td style="text-align: left;padding-right: 8pt"><?=$p["articleName"]?></td>
<td style="text-align: center;padding-right: 8pt"><?=$p["distributorArticleNumber"]?></td>
<td style="text-align: right"><?=$p["amount"]?></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>
</tr>
<?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">
<?php
$sum = 0;
foreach($order['positions'] as $p){
$sum += $p["amount"] * $p["buyPrice"];
}
?>
<td colspan="5" style="text-align: right;border-top: 1px solid black;font-weight: bold
;border-bottom: 1px solid black;
">Summe</td>
<td style="text-align: right;border-top: 1px solid black;font-weight: bold
;border-bottom: 1px solid black;
"><?=number_format($sum, 2, ",", ".")?> €</td>
</tr>
</table>
<div>
<h3>Anmerkungen</h3>
<p>
<?=$order["note"]?>
</p>
</div>
</body>
</html>
+6 -2
View File
@@ -49,7 +49,7 @@
</ul>
</li>
<?php endif; ?>
<?php if($me->is(["Admin"]) || ($me->is("netowner") && $me->hasGwrNetworks())): ?>
<?php if($me->is(["Admin"]) || ($me->is("netowner","lineplanner","pipeplanner","pipeworker","lineworker","salespartner"))): ?>
<li class="has-submenu">
<a href="#">
<i class="far fa-fw fa-database"></i>Stammdaten <div class="arrow-down"></div>
@@ -64,7 +64,11 @@
<li class="mobile-hide"><a href="<?=self::getUrl("Network")?>"><i class="fad fa-fw fa-network-wired text-info"></i> Netzgebiete</a></li>
<li class="" ><a href="<?=self::getUrl("Pop")?>"><i class="fad fa-fw fa-house text-info"></i> Pops</a></li>
<?php endif; ?>
<?php if($me->is(["Admin"]) || ($me->is("netowner","lineplanner","pipeplanner","pipeworker","lineworker","salespartner"))): ?>
<li class=""><a href="<?=self::getUrl("Device")?>"><i class="fad fa-fw fa-router text-info "></i> Devices</a></li>
<?php endif; ?>
<?php if($me->is(["Admin"])): ?>
<li class="has-sub-submenu"><a href="<?=self::getUrl("User")?>"><i class="fad fa-fw fa-users text-info"></i> Benutzer</a></li>
<li class="has-sub-submenu font-weight-bold mt-1 mobile-hide"><a>Grundstammdaten</a></li>
<?php endif; ?>
@@ -194,7 +198,7 @@
<?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>
<?php endif; ?>
<?php if($me->is(["Admin","netowner","salespartner"]) && in_array($me->address_id, [1,209])): ?>
<?php if($me->is(["Admin","netowner","salespartner"]) && in_array($me->address_id, [1,209,5908])): ?>
<li><a href="<?=self::getUrl("ConstructionConsentProject")?>"><i class="far fa-fw fa-clipboard-question text-info"></i> Zustimmungserklärungen</a></li>
<?php endif; ?>
</ul>