redesign for mulituser

change validation concept (client and server)
using entities
This commit is contained in:
Markus
2026-10-06 08:55:35 +02:00
parent 14e050e4ba
commit 995e2ec111
41 changed files with 2402 additions and 1223 deletions

View File

@@ -2,13 +2,13 @@
<div class="card text-bg-dark">
<div class="card-content">
<div class="card-body">
<form class="form form-vertical" id="editaccount" method="post" action="<?= base_url() ?>/editAccount">
<form class="form form-vertical" id="editaccount" method="post" action="<?= base_url() ?>/viewAccounts">
<input type="hidden" value="<?= $id??0 ?>" name="id" id="id">
<?php if (! empty($validation)) : ?>
<?php if (! empty($errors)) : ?>
<div class='alert alert-danger mt-2'>
<div class="errors" role="alert">
<ul>
<?php foreach ($validation as $error) : ?>
<?php foreach ($errors as $error) : ?>
<li><?= esc($error) ?></li>
<?php endforeach ?>
</ul>
@@ -26,33 +26,36 @@
<div class="col-12">
<div class="form-group">
<label for="parent">Überkonto:</label>
<?= form_dropdown('parent', $ddlist, $parent??0,'id="parent" class="form-select"'); ?>
<select name="parent" class="form-select" required id="parent" >
<option value="0">----</option>
<?php foreach ($ddlist as $key => $value): ?>
<option value="<?= $key ?>" <?= ($key == ($parent??0))?'selected':'' ?>><?= $value ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
<div class="col-12">
<div class="form-check form-check-inline">
<input class="form-check-input" type="checkbox" id="typeAccount" value="account" name="type" <?= set_radio('type', 'account') ?>>
<label class="form-check-label" for="inlineCheckbox1">Konto</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="checkbox" id="typeInput" value="input" name="type" <?= set_radio('type', 'input') ?> >
<label class="form-check-label" for="inlineCheckbox2">Einnahmen</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="checkbox" id="typeOutput" value="output" name="type" <?= set_radio('type', 'output', true) ?> >
<label class="form-check-label" for="inlineCheckbox3">Ausgaben</label>
<div class="form-check form-switch">
<label class="form-check-label" for="account">Typ Konto</label>
<input class="form-check-input" type="checkbox" id="account" name="account" <?= set_checkbox('account', 'on', $account??false) ?> >
</div>
</div>
<div class="col-12">
<div class="form-check form-switch">
<label class="form-check-label" for="bookable">Buchbarkeit</label>
<input class="form-check-input" type="checkbox" id="bookable" value="bookable" name="bookable" <?= set_checkbox('bookable', 'on', (($bookable??"f")=="t")?true:false) ?> >
<input class="form-check-input" type="checkbox" id="bookable" value="bookable" name="bookable" <?= set_checkbox('bookable', 'on', $bookable??false) ?> >
</div>
</div>
<div class="col-12">
<div class="form-check form-switch">
<label class="form-check-label" for="lkz">lkz</label>
<input class="form-check-input" type="checkbox" id="lkz" value="1" name="lkz" <?= set_checkbox('lkz', '1', $lkz??false) ?>>
<label class="form-check-label" for="monitor">Monitor</label>
<input class="form-check-input" type="checkbox" id="monitor" name="monitor" <?= set_checkbox('monitor', 'on', $monitor??false) ?> >
</div>
</div>
<div class="col-12">
<div class="form-check form-switch">
<label class="form-check-label" for="deleted_at">Gelöscht</label>
<input class="form-check-input" type="checkbox" id="deleted_at" value="1" name="deleted_at" <?= set_checkbox('deleted_at', '1', $deleted_at??false) ?>>
</div>
</div>
<div class="col-12">

View File

@@ -3,31 +3,49 @@
<?= $this->section('css'); ?>
<link rel="stylesheet" href="/css/mawim.css">
<link rel="stylesheet" href="/assets/jquery-ui-1.13.2.custom/jquery-ui.css">
<?= $this->endSection(); ?>
<?= $this->section('menu'); ?>
<?= $this->include('sidebar') ?>
<?= $this->endSection(); ?>
<?= $this->section('content'); ?>
<?php if (!function_exists('printBool')) {
function printBool(bool $var){
return ($var)?"true":"false";
}
}
?>
<?php function printsub($id, $all){
<?php if (!function_exists('printsub')) { function printsub(int $id, $all){
$liste = '';
$ret='';
foreach($all as $ele){
$class ="";
$vis ="d-none";
if ($ele->parent_id == $id){
if ($ele->lkz) $class = "text-bg-danger";
else if ($ele->bookable == "f") $class = "text-bg-warning";
$toolt ="bookable: $ele->bookable; lkz: $ele->lkz; Id: $ele->id; PID:$ele->parent_id";
$liste .= "<li><span data-bs-toggle='tooltip' data-bs-html=true title='$toolt'";
if ($ele->deleted_at) {
$class = "text-bg-danger";
$vis="d-none";
}
else {
$vis="";
if (!$ele->bookable)
$class = "text-bg-warning";
}
$toolt = ($ele->bookable)?"":"not ";
$toolt .= "bookable; ";
$toolt .= ($ele->deleted_at)?"gelöscht; ":"";
$toolt .="Id: $ele->id; PID:$ele->parent_id";
$liste .= "<li class=\"$vis\"><i class=\"fa-solid\"></i> <span data-bs-toggle='tooltip' data-bs-html=true title='$toolt'";
$liste .= "data-id=\"$ele->id\"";
$liste .= "data-pid=\"$ele->parent_id\"";
$liste .= "data-bookable=\"$ele->bookable\"";
$liste .= "data-lkz=\"$ele->lkz\"";
$liste .= "data-type=\"$ele->type\"";
$liste .= "data-bookable=\"".printBool($ele->bookable)."\"";
$liste .= "data-account=\"".printBool($ele->account)."\"";
$liste .= "data-monitor=\"".printBool($ele->monitor)."\"";
$liste .= "data-deleted=\"$ele->deleted_at\"";
$liste .= "data-description=\"$ele->description\"";
$liste .= "class='$class'>$ele->description</span></li>";
$liste .= "class='$class'>$ele->description</span>";
$liste .= printsub($ele->id, $all);
$liste .= "</li>";
}
}
if ($liste !=''){
@@ -36,33 +54,53 @@
$ret .= "</ul>";
}
return $ret;
} ?>
}} ?>
<div class="page-heading">
<h3> Kategorien bearbeiten</h3>
<?php if ($saveDB??false) : ?>
<div class='alert <?= $saveDB["mode"] ?> mt-2'>
<?= $saveDB["message"] ?>
</div>
<?php endif; ?>
</div>
<div class="row">
<div class="col-md-3 col-12" id="tree">
<div class="card text-bg-dark">
<div class="card-content">
<div class="card-body">
<div><a class="btn btn-info multi" onclick="newCat();" role="button">Neue Kategorie</a></div>
<div class="d-flex justify-content-between">
<div class="col-sm-12 col-md-6">
<a class="btn btn-info multi" onclick="newCat();" role="button"> + Neue Kategorie</a>
</div>
<div class="col-sm-12 col-md-6 form-check form-check-reverse form-switch justify-content-end">
<input class="form-check-input" type="checkbox" id="viewdeleted" value="1" name="viewdeleted">
<label class="form-check-label" for="viewdeleted">Gelöschte</label>
</div>
</div>
<div class="tree">
<ul>
<?php foreach($parents as $parent): ?>
<?php $class='';
if ($parent->lkz) $class = "text-bg-danger";
else if ($parent->bookable == "f") $class = "text-bg-warning"; ?>
<li> <span data-bs-toggle='tooltip'
<?php $class=''; $vis ="d-none";
if ($parent->deleted_at) {
$class = "text-bg-danger";
$vis = "d-none";
} else {
$vis = "";
if (!$parent->bookable) $class = "text-bg-warning";
}?>
<li class="<?=$vis?>"><i class="fa-solid"></i> <span data-bs-toggle='tooltip'
data-bs-html=true
data-id="<?=$parent->id?>"
data-pid="0"
data-bookable="<?=$parent->bookable?>"
data-lkz=" <?= $parent->lkz?>"
data-type="<?= $parent->type?>"
data-bookable=<?=printBool($parent->bookable)?>
data-monitor=<?=printBool($parent->monitor)?>
data-account=<?=printBool($parent->account)?>
data-deleted="<?= $parent->deleted_at?>"
data-description="<?= $parent->description?>";
title="bookable: <?=$parent->bookable?>; lkz: <?= $parent->lkz?>; Id: <?=$parent->id?>;" class="<?=$class?>"><?=$parent->description?></span>
title="<?=($parent->bookable)?"":"not "?>bookable; <?= ($parent->deleted_at)?"gelöscht; ":""?>Id: <?=$parent->id?>;"
class="<?=$class?>"><?=$parent->description?></span>
<?= printsub($parent->id, $all); ?>
<li>
<?php endforeach; ?>
</ul>
</div>
@@ -70,13 +108,11 @@
</div>
</div>
</div>
<div class="col-md-3 col-12 d-none" id="editor">
<div class="col-md-3 col-12 <?= (empty($errors))?"d-none" :"" ?>" id="editor">
<?= $this->include('accountsform') ?>
</div>
</section>
<?= $this->endSection(); ?>
<?= $this->section('scripts'); ?>
<script src="/assets/jquery-ui-1.13.2.custom/jquery-ui.js"></script>
<script></script>
<script src="/js/accounts.js"></script>
<?= $this->endSection(); ?>

View File

@@ -1,7 +1,6 @@
<?= $this->extend('layout'); ?>
<?= $this->section('css'); ?>
<link rel="stylesheet" href="/assets/jquery-ui-1.13.2.custom/jquery-ui.css">
<link rel="stylesheet" href="/css/mawim.css">
<?= $this->endSection(); ?>
<?= $this->section('menu'); ?>
@@ -13,71 +12,40 @@
<div class="row">
<div class="col-xxl-8 col-12">
<div class="text-white-50"><h2>Verlauf</h2></div>
<form class="form row row-cols align-items-bottom" id="getData" method="post" action="<?= base_url() ?>/Ajax/getTabelData">
<form class="form row row-cols align-items-bottom" id="getData" method="post" action="/getActivitiesData">
<div class="row">
<div class="col-lg-3 col-12">
<input type="text" class="form-control" id="datepickers" data-date-format="mm.dd.yyyy" name="datum_start" placeholder="Datum Start" value="<?= $datum_start??$start ?>"/>
<input type="date" class="form-control" name="datum_start" placeholder="Datum Start" value="<?= $datum_start??$start ?>"/>
</div>
<div class="col-lg-3 col-12">
<input type="text" class="form-control" id="datepickere" data-date-format="mm.dd.yyyy" name="datum_ende" placeholder="Datum Ende" value="<?= $datum_ende??$ende ?>"/>
<input type="date" class="form-control" name="datum_ende" placeholder="Datum Ende" value="<?= $datum_ende??$ende ?>"/>
</div>
<div class="col-lg-3 col-12">
<div class="form-group">
<?= form_dropdown('source', $sourcelist, $source,'id="source" class="form-select"'); ?>
<select name="source" class="form-select">
<option value="0">----</option>
<?php foreach ($sourcelist as $key => $value): ?>
<option value="<?= $key ?>" <?= ($key == $source)?'selected':'' ?>><?= $value ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
<div class="col-lg-3 col-12">
<a class="btn btn-primary" onclick="datatable.ajax.reload();" role="button">Aktualisieren</a>
<a class="btn btn-primary" onclick="loadActivityData();" role="button">Aktualisieren</a>
</div>
</div>
</form>
<table class="table table-sm table-striped" id="bookings" cellspacing="0"></table>
<table id="activities" cellspacing="0"></table>
</div>
<div class="col-xxl-4 col-12 d-none d-xxl-block">
<div class="text-white-50"><h2>Aktuelle Kontostände</h2></div>
<table class="table table-striped table-sm" id="accounts" cellspacing="0"></table>
<table id="accounts" cellspacing="0"></table>
</div>
</div>
</div>
<?= $this->endSection(); ?>
<?= $this->section('scripts'); ?>
<script src="/assets/jquery-ui-1.13.2.custom/jquery-ui.js"></script>
<script>
$.datepicker.regional['de'] = {clearText: 'löschen', clearStatus: 'aktuelles Datum löschen',
closeText: 'schließen', closeStatus: 'ohne Änderungen schließen',
prevText: '<zurück', prevStatus: 'letzten Monat zeigen',
nextText: 'Vor>', nextStatus: 'nächsten Monat zeigen',
currentText: 'heute', currentStatus: '',
monthNames: ['Januar','Februar','März','April','Mai','Juni',
'Juli','August','September','Oktober','November','Dezember'],
monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun',
'Jul','Aug','Sep','Okt','Nov','Dez'],
monthStatus: 'anderen Monat anzeigen', yearStatus: 'anderes Jahr anzeigen',
weekHeader: 'Wo', weekStatus: 'Woche des Monats',
dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],
dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'],
dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'],
dayStatus: 'Setze DD als ersten Wochentag', dateStatus: 'Wähle D, M d',
dateFormat: 'dd.mm.yy', firstDay: 1,
initStatus: 'Wähle ein Datum', isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['de']);
$('#datepickers').datepicker(
{
format: "dd.mm.yyyy",
language: 'de-DE',
weekStart: 1,
autoclose: true,
todayHighlight: false});
$('#datepickere').datepicker(
{
format: "dd.mm.yyyy",
language: 'de-DE',
weekStart: 1,
autoclose: true,
todayHighlight: false});
</script>
<script src="/js/tables.js"></script>
<script src="/js/tab_accounts.js"></script>
<script src="/js/activities.js"></script>
<script src="/js/tab_activities.js"></script>
<?= $this->endSection(); ?>

View File

@@ -0,0 +1,56 @@
<?php
if (!$template) {
$parentList = $booking['cat_parent'][$i];
$subList = $booking['cat_sub'][$i];
$account_id = $booking['account_id'][$i];
$parent_id = $booking['parent_id'][$i];
$comment = $booking['comment'][$i];
$input = $booking['input'][$i];
$output = $booking['output'][$i];
$sid = $booking['sid'][$i];
} else {
$i = 0;
$account_id = 0;
$parent_id = 0;
$parentList = $booking['category']['parent'];
$subList = $booking['category']['subs']->{$parent_id};
$comment = '';
$input = '';
$output = '';
$sid = 0;
}
?>
<div <?=(($template)?'id="template"':'')?> class="row <?=(($template)?'d-none':'')?>">
<input type="hidden" value="<?= $sid ?>" name="sid[]">
<div class="col-lg-3 col-6 col-md-6 <?=(($i>0)?'multi':'')?> order-sm-2 px-0">
<select name="parent_id[]" class="form-select parent" <?=(($i==0 && !$template)?'required':'')?>>
<option value="">----</option>
<?php foreach ($parentList as $key => $value): ?>
<option value="<?= $key ?>" <?= ($key == $parent_id)?'selected':'' ?>><?= $value ?></option>
<?php endforeach; ?>
</select>
</div>
<div class="col-lg-3 col-6 col-md-6 <?=(($i>0)?'multi':'')?> order-sm-2 px-0" <?=(($i==0 && !$template)?'required':'')?>>
<select name="account_id[]" class="form-select sub">
<?php foreach ($subList as $key => $value): ?>
<option value="<?= $key ?>" <?= ($key == $account_id && $account_id>0)?'selected':'' ?>><?= $value ?></option>
<?php endforeach; ?>
</select>
</div>
<div class="w-100 d-md-none"></div>
<div class="col-lg-2 col-6 <?=(($i>0)?'multi':'')?> <?= ($booking['transfer']?' d-none':'') ?> px-0 order-sm-2">
<input type="text" name="input[]" class="form-control dt-subamount input" placeholder="Einnahme" value="<?= $input ?>"
pattern="[0-9\*\(\)\-\+\/,.]*"
oninput="if (!this.checkValidity()) this.value = this.value.slice(0, -1)">
</div>
<div class="<?= ($booking['transfer']?'col-lg-4 col-12':'col-lg-2 col-6') ?> <?=(($i>0)?'multi':'')?> px-0 order-sm-2">
<input type="text" name="output[]" placeholder="Ausgabe" value="<?= $output ?>"
pattern="[0-9\*\(\)\-\+\/,.]*"
oninput="if (!this.checkValidity()) this.value = this.value.slice(0, -1)" class="form-control dt-subamount output text-danger" >
</div>
<div class="col-lg-2 col-12 col-md-12 <?=(($i>0)?'multi':'')?> order-sm-1 px-0 mb-3 mb-md-0">
<input type="text" name="comment[]" class="form-control" placeholder="Kommentar" value="<?= $comment ?>">
</div>
</div>

View File

@@ -0,0 +1,19 @@
<div class="col-12 scheduled <?=($booking['scheduled']?'':'d-none')?>">
<div class="form-group">
<label for="scheduledNum">Scheduled:</label>
<div class="input-group">
<select name="scheduledNum" id="scheduledNum" class="form-select" required>
<option value="">----</option>
<?php foreach ($booking['schedule_lists']['NumList'] as $key => $value): ?>
<option value="<?= $key ?>" <?= ($key == $booking['scheduledNum'])?'selected':'' ?>><?= $value ?></option>
<?php endforeach; ?>
</select>
<select name="scheduledType" id="scheduledType" class="form-select" required>
<option value="">----</option>
<?php foreach ($booking['schedule_lists']['TypeList'] as $key => $value): ?>
<option value="<?= $key ?>" <?= ($key == $booking['scheduledType'])?'selected':'' ?>><?= $value ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
</div>

View File

@@ -8,18 +8,14 @@
<meta name="description" content="Adminpage for Finanzen" />
<meta name="author" content="Wimpissinger Markus" />
<?= $this->renderSection('css_first') ?>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;600;700;800&display=swap" rel="stylesheet">
<link href="/assets/bootstrap-5.3.0-alpha1-dist/css/bootstrap.min.css" rel="stylesheet" />
<link href="/assets/fontawesome6.4.0/css/fontawesome.css" rel="stylesheet">
<link href="/assets/fontawesome6.4.0/css/solid.css" rel="stylesheet">
<link href="/assets/fontawesome6.4.0/css/brands.css" rel="stylesheet">
<link href="/assets/fontawesome6.4.0/css/regular.css" rel="stylesheet">
<!-- <link rel="stylesheet" href="/assets/vendors/perfect-scrollbar/perfect-scrollbar.css"> -->
<link href="/assets/bootstrap/css/bootstrap.css" rel="stylesheet" />
<link href="/assets/font-awesome/css/fontawesome.css" rel="stylesheet">
<link href="/assets/font-awesome/css/solid.css" rel="stylesheet">
<link href="/assets/font-awesome/css/brands.css" rel="stylesheet">
<link href="/assets/font-awesome/css/regular.css" rel="stylesheet">
<link rel="stylesheet" href="/assets/css/app.css">
<link href="/assets/DataTables/datatables.min.css" rel="stylesheet"/>
<!-- <script src="https://cdn.jsdelivr.net/npm/simple-datatables@latest" type="text/javascript"></script> -->
<?= $this->renderSection('css') ?>
<!-- <link rel="shortcut icon" href="/assets/images/favicon.svg" type="image/x-icon"> -->
</head>
<body>
@@ -34,20 +30,41 @@
</a>
</header>
<?= $this->renderSection('content') ?>
<div class="modal" id="mymodal" tabindex="-1">
<div class="modal fade" id="mymodal" tabindex="-1">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header d-none">
<h1 class="modal-title fs-5" id="modalTitle">Modal Title</h1>
</div>
<div class="modal-body">
<h5 class="modal-title"></h5>
<p>Wirklich löschen?</p>
<p>Modal body</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Abbruch</button>
<button type="button" id="modal_ok" class="btn btn-primary">Löschen</button>
<div class ="mx-auto">
<button type="button" id="modal_ok" data-bs-dismiss="modal" class="btn btn-primary">Ok</button>
</div>
</div>
</div>
</div>
</div>
<div class="modal" id="mymodalDelete" tabindex="-1">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title fs-5" id="modalDelTitle">Wirklich löschen?</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body d-none">
<p class="modal-text">Wirklich löschen?</p>
</div>
<div class="modal-footer">
<div class ="mx-auto">
<button type="button" id="modal_delete" class="btn btn-primary" data-bs-target="#mymodal" data-bs-toggle="modal">Löschen</button>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="mySnycModal" tabindex="-1" aria-labelledby="Snc Result Window" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
@@ -82,16 +99,14 @@
</div>
</div>
</div>
<!-- <script src="/assets/vendors/perfect-scrollbar/perfect-scrollbar.min.js"></script>
<script src="/assets/js/bootstrap.bundle.min.js"></script> -->
<script src="/assets/jquery-3.6.4.min.js" type="text/javascript"></script>
<script src="/assets/bootstrap-5.3.0-alpha1-dist/js/bootstrap.bundle.js" type="text/javascript"></script>
<script defer src="/assets/fontawesome6.4.0/js/solid.js"></script>
<script defer src="/assets/fontawesome6.4.0/js/brands.js"></script>
<script defer src="/assets/fontawesome6.4.0/js/regular.js"></script>
<script src="/assets/DataTables/datatables.min.js"></script>
<!-- <script src="/assets/vendors/perfect-scrollbar/perfect-scrollbar.min.js"></script> -->
<script src="/assets/bootstrap/js/bootstrap.bundle.js" type="text/javascript"></script>
<script src="/assets/fiduswriter/simple-datatables.js" type="text/javascript"></script>
<!-- <script defer src="/assets/fontawesome/js/solid.js"></script>
<script defer src="/assets/fontawesome/js/brands.js"></script>
<script defer src="/assets/fontawesome/js/regular.js"></script> -->
<script src="/js/menue.js"></script>
<script src="/assets/js/main.js"></script>
<script src="/assets/js/main.js"></script>
<?= $this->renderSection('scripts') ?>
</body>

View File

@@ -14,10 +14,10 @@
<div class="col-md-8 col-12">
<div class="card">
<div class="card-header pb-0">
<?php if ($id) : ?>
<h4 class="card-title"><?= ($transfer?'Transfer bearbeiten':($isScheduled?'Terminbuchung bearbeiten':'Rechnung bearbeiten'))?></h4>
<?php if ($booking['id']) : ?>
<h4 class="card-title"><?= ($booking['transfer']?'Transfer '.$booking['id'].' bearbeiten':($booking['scheduled']?'Terminbuchung '.$booking['id'].' bearbeiten':'Rechnung '.$booking['id'].' bearbeiten'))?></h4>
<?php else: ?>
<h4 class="card-title"><?= ($transfer?'Neuer Transfer':($isScheduled?'Neue Terminbuchung':'Neue Rechnung'))?></h4>
<h4 class="card-title"><?= ($booking['transfer']?'Neuer Transfer':($booking['scheduled']?'Neue Terminbuchung':'Neue Rechnung'))?></h4>
<?php endif; ?>
<?php if (! empty($validation)) : ?>
@@ -34,27 +34,25 @@
</div>
<div class="card-content">
<div class="card-body">
<?= form_open_multipart('newBill','class="form form-vertical" onsubmit="logData(event)" id="newbill"') ?>
<?= view("bill_bookingline",['booking'=>$booking, 'template'=>true]); ?>
<form id="newbill" action="/edit" class="form form-vertical needs-validation" method="post" enctype="multipart/form-data" onsubmit="checkForm(event,this)" novalidate>
<!-- <form class="form form-vertical" id="newbill" method="post" enctype="multipart/form-data" onsubmit="logData(event)" action="<?= base_url() ?>newBill"> -->
<input type="hidden" value="<?= $id ?>" name="id">
<input type="hidden" value="<?= $transfer?'1':'0' ?>" name="transfer">
<input type="hidden" value="<?= $booking['id'] ?>" name="id">
<input type="hidden" value="<?= $booking['amount']??0.0 ?>" name="amount">
<input type="hidden" value="<?= $booking['transfer']?'1':'0' ?>" name="transfer">
<input type="hidden" value="<?= ($booking['scheduled']??false)?'1':'0' ?>" name="scheduled">
<div class="form-body">
<div class="row">
<div class="col-12 <?= ($transfer?' d-none':'') ?>">
<div class="form-check form-switch">
<label class="form-check-label" for="multi">Multi Rechnung</label>
<input class="form-check-input" type="checkbox" id="multi" value="on" name="multi" <?= set_checkbox('multi', 'on', $multi??false) ?>>
</div>
</div>
<div class="col-12 <?= ($transfer?' d-none':($isScheduled?' d-none':'')) ?>">
<div class="col-12 <?= ($booking['transfer']?' d-none':(($booking['scheduled']??false)?' d-none':'')) ?>">
<label for="billfile">Rechnung:</label>
<input type="file" id="billfile" name="billfile" class="form-control <?= (!isset($billfile))?'':'d-none' ?>" capture="environment" accept="image/*, application/pdf">
<?php if (isset($billfile)): ?>
<a href="/viewBill/<?= $billfile ?>" id="billfileRef"><?= $billfile ?></a>
<input type="file" id="billfile" name="billfile" class="form-control <?= (!isset($booking['rechnung']))?'':'d-none' ?>" capture="environment" accept="image/*, application/pdf">
<?php if (isset($booking['rechnung'])): ?>
<a href="/viewInvoice/<?= $booking['rechnung'] ?>" id="billfileRef" target="_blank"> <?= $booking['rechnung'] ?></a>
<a class="" onclick="removeBillFile(this);"><i class="fa fa-trash"></i></a>
<?php endif; ?>
</div>
<div class="col-12 <?= ($transfer?' d-none':'d-none') ?>">
<div class="col-12 <?= ($booking['transfer']?' d-none':'d-none') ?>">
<div class='form-check'>
<div class="checkbox">
<label for="renummer">Re-Nr.</label>
@@ -64,76 +62,64 @@
</div>
<div class="col-12">
<label for="datum">Datum</label>
<input type="date" class="form-control" id="datum" name="datum" value="<?= $datum ?>" onclick="openBox(this);"/>
<input type="date" class="form-control" id="datum" name="datum" value="<?= $booking['datum'] ?>" onclick="openBox(this);"/>
</div>
</div>
<div class="col-12 <?= ($transfer?' d-none':'') ?>">
<div class="col-12 <?= ($booking['transfer']?' d-none':'') ?>">
<div class="form-group">
<label for="receiver">Empfänger</label>
<input type="text" class="form-control" id="receiver" name="receiver" value="<?= $receiver ?>">
<input type="text" class="form-control" id="receiver" name="receiver" <?=(($booking['transfer'])?'':'required')?> value="<?= $booking['receiver'] ?>">
</div>
</div>
<div class="col-12">
<div class="form-group">
<label for="source">Konto:</label>
<?= form_dropdown('source', $sourcelist, $source,'id="source" class="form-select"'); ?>
<label for="sourceID">Konto:</label>
<select name="source_id" class="form-select" required id="sourceID" >
<option value="">----</option>
<?php foreach ($booking['sourcelist'] as $key => $value): ?>
<option value="<?= $key ?>" <?= ($key == $booking['source_id'])?'selected':'' ?>><?= $value ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
<div class="col-12 multi">
<div class="input-group">
<input type="text" class="form-control dt-amount" id="total_in" name="total_in" placeholder="Einnahme" maxlength=120 value="<?= $total_in ?>">
<input type="text" class="form-control dt-amount text-danger" id="total_out" name="total_out" placeholder="Ausgabe" maxlength=120 value="<?= $total_out ?>">
</div>
</div>
<div class="col-12 scheduled <?=($isScheduled?'':'d-none')?>">
<div class="form-group">
<label for="scheduledNum">Scheduled:</label>
<div class="input-group">
<input type="hidden" value="<?= $isScheduled?'1':'0' ?>" name="scheduled">
<?= form_dropdown("scheduledNum", $scheduled['NumList'], $scheduledNum,$scheduled['style']); ?>
<?= form_dropdown("scheduledType",$scheduled['TypeList'], $scheduledType,$scheduled['style']); ?>
</div>
<div class="input-group has-validation">
<input type="text" id="total_in" name="total_in" value="<?= $booking['total_in'] ?>"
class="form-control dt-amount input"
pattern="[0-9\*\(\)\-\+\/,.]*"
oninput="if (!this.checkValidity()) this.value = this.value.slice(0, -1)"
placeholder="Einnahme" maxlength=120 ">
<input type="text" id="total_out" name="total_out" value="<?= $booking['total_out'] ?>"
class="form-control dt-amount output text-danger"
pattern="[0-9\*\(\)\-\+\/,.]*"
oninput="if (!this.checkValidity()) this.value = this.value.slice(0, -1)"
placeholder="Ausgabe" maxlength=120>
</div>
</div>
<?php if ($booking['scheduled']??false)
echo view("bill_scheduled",['booking'=>$booking]);
?>
<div class="col-12 d-none multi">
<div class="form-group">
<label for="openamount">Offener Betrag:</label>
<input type="text" class="form-control dt-amount" readonly="readonly" id="openamount" name="openamount">
<div class="invalid-feedback"></div>
</div>
</div>
<div class="col-12" id="linecont">
<?php for ($i=0;$i<10;$i++): ?>
<div class="row <?= (($i<3 || $input[$i]>0 || $output[$i]>0)?'':' d-none')?>">
<input type="hidden" value="<?= $sid[$i] ?>" name="sid[<?=$i?>]">
<div class="col-lg-3 col-6 col-md-6 <?=(($i>0)?'multi':'')?> order-sm-2 px-0">
<?= form_dropdown("category_parent[$i]", $subsparent[$i], $category_parent[$i], 'class="form-select parent"'); ?>
</div>
<div class="col-lg-3 col-6 col-md-6 <?=(($i>0)?'multi':'')?> order-sm-2 px-0 sub">
<?= form_dropdown("category[$i]", $subscategory[$i], $category[$i], 'class="form-select"'); ?>
</div>
<div class="w-100 d-md-none"></div>
<div class="col-lg-2 col-6 <?=(($i>0)?'multi':'')?> <?= ($transfer?' d-none':'') ?> px-0 order-sm-2">
<input type="text" name="input[<?=$i?>]" class="form-control dt-subamount" placeholder="Einnahme" value="<?= $input[$i] ?>">
</div>
<div class="<?= ($transfer?'col-lg-4 col-12':'col-lg-2 col-6') ?> <?=(($i>0)?'multi':'')?> px-0 order-sm-2">
<input type="text" name="output[<?=$i?>]" class="form-control dt-subamount text-danger" placeholder="Ausgabe" value="<?= $output[$i] ?>">
</div>
<div class="col-lg-2 col-12 col-md-12 <?=(($i>0)?'multi':'')?> order-sm-1 px-0 mb-3 mb-md-0">
<input type="text" name="comment[<?=$i?>]" class="form-control" placeholder="Kommentar" value="<?= $comment[$i] ?>">
</div>
</div>
<?php endfor; ?>
<?php $i = 0; foreach ($booking['sid'] as $_sid) :
echo view("bill_bookingline",['booking'=>$booking, 'i'=>$i,'template'=>false]);
?>
<?php $i++; endforeach; ?>
</div>
<div class="col-12 d-flex" role="group">
<a class="btn btn-info multi" onclick="addLine();" role="button">+ Zeile</a>
<input type="checkbox" id="validate" name="validate" value="1" class='btn-check' autocomplete="off" <?= set_checkbox('validate', '1', (($validate??"f")=="t")?true:false) ?>>
<a id="multiadd" class="btn btn-info <?= ($booking['transfer']?' d-none':'') ?>" onclick="addLine();" role="button">+ Zeile</a>
<input type="checkbox" id="validate" name="validate" value="1" class='btn-check' autocomplete="off" <?= set_checkbox('validate', '1', ($booking['validate'])?true:false) ?>>
<label class="btn btn-outline-danger" for="validate">Entwurf</label>
<?php if ($id) : ?>
<a class="btn btn-danger" data-bs-toggle="modal" data-bs-id="<?= $id ?>" data-bs-target="#mymodal"><i class="fa fa-trash"></i></a>
<?php if ($booking['id']) : ?>
<a class="btn btn-danger" data-bs-toggle="modal" data-bs-table="<?= ($booking['scheduled']??false)?'scheduled':'bill'?>" data-bs-id="<?= $booking['id'] ?>" data-bs-target="#mymodalDelete"><i class="fa fa-trash"></i></a>
<?php endif; ?>
<button type="submit" class="btn btn-primary">Submit</button>
<a class="btn btn-secondary" onclick="history.back();" role="button"><i class="fa-solid fa-rotate-left"></i></a>
</div>
</div>
</div>
@@ -149,7 +135,7 @@
function openBox(e) {
e.showPicker();
}
subsdata = <?= $subsdata; ?>;
subsdata = <?= json_encode($booking['category']['subs']) ?>;
</script>
<script src="/js/billing.js"></script>
<?= $this->endSection(); ?>

View File

@@ -1,31 +1,29 @@
<?= $this->extend('layout'); ?>
<?= $this->section('css'); ?>
<link rel="stylesheet" href="/assets/jquery-ui-1.13.2.custom/jquery-ui.css">
<link rel="stylesheet" href="/css/mawim.css">
<?= $this->endSection(); ?>
<?= $this->section('menu'); ?>
<?= $this->include('sidebar') ?>
<?= $this->endSection(); ?>
<?= $this->section('content'); ?>
<?php session()->set('redirect_url',base_url('show-passwords')); ?>
<?php session()->set('redirect_url',base_url('viewScheduled')); ?>
<div class="page-content">
<div class="row">
<div class="col-xxl-8 col-12">
<div class="text-white-50"><h2>Terminbuchungen</h2></div>
<table class="table table-striped table-sm" id="scheduled" cellspacing="0"></table>
<table id="scheduled" cellspacing="0"></table>
</div>
<div class="col-xxl-4 col-12 d-none d-xxl-block">
<div class="text-white-50"><h2>Aktuelle Kontostände</h2></div>
<table class="table table-striped table-sm" id="accounts" cellspacing="0"></table>
<table id="accounts" cellspacing="0"></table>
</div>
</div>
</div>
<?= $this->endSection(); ?>
<?= $this->section('scripts'); ?>
<script src="/assets/jquery-ui-1.13.2.custom/jquery-ui.js"></script>
<script src="/js/tables.js"></script>
<script src="/js/tab_accounts.js"></script>
<script src="/js/scheduled.js"></script>
<script src="/js/tab_scheduled.js"></script>
<?= $this->endSection(); ?>

View File

@@ -30,10 +30,10 @@
</a>
</li>
<li class="sidebar-item active">
<a href="javascript:syncScheduled()" class='sidebar-link'>
<a class="sidebar-link" data-bs-toggle="modal" role="button" data-bs-target="#mySnycModal" onclick="syncScheduled(this)">
<i class="fa-solid fa-pen-to-square"></i>
<span>Sync Automatische</span>
</a>
</a>
</li>
<li class="sidebar-item active">
<a href="/viewAccounts" class='sidebar-link'>

View File

@@ -1,4 +1,4 @@
<?= $this->extend('layout'); ?>
<?= $this->extend('layout'); ?>
<?= $this->section('css'); ?>
<link rel="stylesheet" href="/css/mawim.css">
@@ -15,21 +15,21 @@
<div class="col-xl-4 col-md-8 col-sm-12">
<div class="text-white-50"><h2>Aktuelle Buchungen</h2></div>
<div class="">
<table class="table table-striped table-sm" id="bookings" cellspacing="0">
<table id="bookings" cellspacing="0">
</table>
</div>
</div>
<div class="col-xl-4 col-md-8 col-sm-12">
<div class="text-white-50"><h2>Aktuelle Kontostände</h2></div>
<div class="">
<table class="table table-striped table-sm" id="accounts" cellspacing="0">
<table id="accounts" cellspacing="0">
</table>
</div>
</div>
<div class="col-xl-4 col-md-8 col-sm-12">
<div class="text-white-50"><h2>Überfällige</h2></div>
<div class="">
<table class="table table-striped table-sm" id="todos" cellspacing="0">
<table id="todos" cellspacing="0">
</table>
</div>
</div>
@@ -40,6 +40,7 @@
<?= $this->section('scripts'); ?>
<script src="/js/tables.js"></script>
<script src="/js/tab_accounts.js"></script>
<script src="/js/tabs_overview.js"></script>
<script src="/js/tab_todos.js"></script>
<script src="/js/tab_overview.js"></script>
<?= $this->endSection(); ?>