<?php

namespace DataView;

class Fop_fints_buchung {
  
  

  
  

    // --- Statische Methoden ---
  
  public static function renderScript() { 
    
    
    // --- BLOCK: main ---
    
								\FOP\I18n::ensureIsLoaded();
								?>
								<script type="text/javascript">
									
    function changefilter_fop_fints_buchung_kontoListMultiFilter(val, cb) {
		  if (val) {
			  querySet('filter_fop_fints_buchung_konto', val, cb.checked);
		  } else {
			  delete query['filter_fop_fints_buchung_konto'];
		  }reloadfop_fints_buchung();
        
    }

		var i816a8238efb5844aaae05f053a27867fb873f2634161e31dc74540ea4e67a5ectimeout = null;
		function changefilter_fop_fints_buchung_kontoSearchFilter(val, callback) {
			if(i816a8238efb5844aaae05f053a27867fb873f2634161e31dc74540ea4e67a5ectimeout) clearTimeout(i816a8238efb5844aaae05f053a27867fb873f2634161e31dc74540ea4e67a5ectimeout);

			i816a8238efb5844aaae05f053a27867fb873f2634161e31dc74540ea4e67a5ectimeout = setTimeout(function() {
				$.getJSON(reloadfop_fints_buchung({action: 'getfilter_fop_fints_buchung_kontoItemsByString', 'fstr': val}, true), function(r) {
					callback(r);
					query['filter_fop_fints_buchung_konto_orig'] = val;
				});
			}, 300);
		}

	function getfilter_fop_fints_buchung_kontoListMultiFilter() {
		var gui = $("<div class='fop-floatsorter'></div>");
		// TODO: usability #1866 auf ajax warten bevor ENTER behandelt wird
		var fstr = <?php echo(isset($_GET['filter_fop_fints_buchung_konto_orig']) ? json_encode($_GET['filter_fop_fints_buchung_konto_orig']) : '""') ?>;
		var search = $('<div class="mdl-textfield mdl-js-textfield">' + 
			'<input value="" class="mdl-textfield__input" id="816a8238efb5844aaae05f053a27867fb873f2634161e31dc74540ea4e67a5ec" type="text">' +
			'<label class="mdl-textfield__label" for="816a8238efb5844aaae05f053a27867fb873f2634161e31dc74540ea4e67a5ec">Filter...</label>' +
			'</div>');
		search.find('input').val(fstr).keyup(function (event) {
			var self = this;
			if ((event.keyCode || e.which) == 13) {
				var hasChecked = false;
				if (this.value) {
					// search value + tick all search results
					checkboxes.find('input').each(function (i, inp) {
						if (!inp.checked && $(inp).data('value')) {
							inp.checked = true;
							querySet('filter_fop_fints_buchung_konto', $(inp).data('value'), true);
							hasChecked = true;
						}
					});
				} else {
					// untick all
					search.find('input').val('');
					query['filter_fop_fints_buchung_konto_orig'] = '';
					delete query['filter_fop_fints_buchung_konto'];
					reload('', items);
					hasChecked = true;
				}
				if (hasChecked) {reloadfop_fints_buchung();
					
				} else {
					$('#table_fop_fints_buchung').find('.fop-table-row:first').click();
				}
			} else {
				changefilter_fop_fints_buchung_kontoSearchFilter(this.value, function (result) {
					reload(self.value, result);
				});
			}
		});
		gui.append(search);

		var checkboxes = $("<div></div>").css({maxHeight: '200px', overflow: 'auto'});
		var items = <?php
			// TODO: deps-Variable füllen mit DV-Parametern vom DataView id
			echo json_encode(\DataView\Fop_fints_buchung::getfilter_fop_fints_buchung_kontoItemsByStringAction(''));
		?>;

		function reload(fstr, items) {
			// rerender checkbox list
			checkboxes.empty();
			checkboxes.append($('<i style="cursor: pointer;"><?php echo _('show all'); ?></i>').click(function () {
				search.find('input').val('');
				query['filter_fop_fints_buchung_konto_orig'] = '';
				delete query['filter_fop_fints_buchung_konto'];
				reload('', items);reloadfop_fints_buchung();
				
			})).append('<br/>');
			// NULL-Wert auch suchbar #2057 (kommt als ID=0 an, muss für die idlist in _null geändert werden)
			for (var i = 0; i < items.length; i++) {
				let value = (items[i].ID === '0' ? '_null' : items[i].ID);
				let descr = items[i].description;
				let checked = querySet('filter_fop_fints_buchung_konto', value);
				if (!fstr || checked || descr.toLowerCase().includes(fstr.toLowerCase())) {
					checkboxes.append($('<input type=\'checkbox\'  onclick=\'changefilter_fop_fints_buchung_kontoListMultiFilter("' + value + '", this)\' ' + (checked ? ' checked>': '> ')).data('value', value)).append($('<span></span>').text(descr).prepend('&nbsp;')).append('<br/>');
				}
			 }
		}
		reload(fstr, items);
		gui.append(checkboxes);

		return gui;
	}
									
    function changefilter_fop_fints_buchung_kontoListMultiFilter(val, cb) {
		  if (val) {
			  querySet('filter_fop_fints_buchung_konto', val, cb.checked);
		  } else {
			  delete query['filter_fop_fints_buchung_konto'];
		  }reloadfop_fints_buchung();
        
    }

		var i816a8238efb5844aaae05f053a27867fb873f2634161e31dc74540ea4e67a5ectimeout = null;
		function changefilter_fop_fints_buchung_kontoSearchFilter(val, callback) {
			if(i816a8238efb5844aaae05f053a27867fb873f2634161e31dc74540ea4e67a5ectimeout) clearTimeout(i816a8238efb5844aaae05f053a27867fb873f2634161e31dc74540ea4e67a5ectimeout);

			i816a8238efb5844aaae05f053a27867fb873f2634161e31dc74540ea4e67a5ectimeout = setTimeout(function() {
				$.getJSON(reloadfop_fints_buchung({action: 'getfilter_fop_fints_buchung_kontoItemsByString', 'fstr': val}, true), function(r) {
					callback(r);
					query['filter_fop_fints_buchung_konto_orig'] = val;
				});
			}, 300);
		}

	function getfilter_fop_fints_buchung_kontoListMultiFilter() {
		var gui = $("<div class='fop-floatsorter'></div>");
		// TODO: usability #1866 auf ajax warten bevor ENTER behandelt wird
		var fstr = <?php echo(isset($_GET['filter_fop_fints_buchung_konto_orig']) ? json_encode($_GET['filter_fop_fints_buchung_konto_orig']) : '""') ?>;
		var search = $('<div class="mdl-textfield mdl-js-textfield">' + 
			'<input value="" class="mdl-textfield__input" id="816a8238efb5844aaae05f053a27867fb873f2634161e31dc74540ea4e67a5ec" type="text">' +
			'<label class="mdl-textfield__label" for="816a8238efb5844aaae05f053a27867fb873f2634161e31dc74540ea4e67a5ec">Filter...</label>' +
			'</div>');
		search.find('input').val(fstr).keyup(function (event) {
			var self = this;
			if ((event.keyCode || e.which) == 13) {
				var hasChecked = false;
				if (this.value) {
					// search value + tick all search results
					checkboxes.find('input').each(function (i, inp) {
						if (!inp.checked && $(inp).data('value')) {
							inp.checked = true;
							querySet('filter_fop_fints_buchung_konto', $(inp).data('value'), true);
							hasChecked = true;
						}
					});
				} else {
					// untick all
					search.find('input').val('');
					query['filter_fop_fints_buchung_konto_orig'] = '';
					delete query['filter_fop_fints_buchung_konto'];
					reload('', items);
					hasChecked = true;
				}
				if (hasChecked) {reloadfop_fints_buchung();
					
				} else {
					$('#table_fop_fints_buchung').find('.fop-table-row:first').click();
				}
			} else {
				changefilter_fop_fints_buchung_kontoSearchFilter(this.value, function (result) {
					reload(self.value, result);
				});
			}
		});
		gui.append(search);

		var checkboxes = $("<div></div>").css({maxHeight: '200px', overflow: 'auto'});
		var items = <?php
			// TODO: deps-Variable füllen mit DV-Parametern vom DataView id
			echo json_encode(\DataView\Fop_fints_buchung::getfilter_fop_fints_buchung_kontoItemsByStringAction(''));
		?>;

		function reload(fstr, items) {
			// rerender checkbox list
			checkboxes.empty();
			checkboxes.append($('<i style="cursor: pointer;"><?php echo _('show all'); ?></i>').click(function () {
				search.find('input').val('');
				query['filter_fop_fints_buchung_konto_orig'] = '';
				delete query['filter_fop_fints_buchung_konto'];
				reload('', items);reloadfop_fints_buchung();
				
			})).append('<br/>');
			// NULL-Wert auch suchbar #2057 (kommt als ID=0 an, muss für die idlist in _null geändert werden)
			for (var i = 0; i < items.length; i++) {
				let value = (items[i].ID === '0' ? '_null' : items[i].ID);
				let descr = items[i].description;
				let checked = querySet('filter_fop_fints_buchung_konto', value);
				if (!fstr || checked || descr.toLowerCase().includes(fstr.toLowerCase())) {
					checkboxes.append($('<input type=\'checkbox\'  onclick=\'changefilter_fop_fints_buchung_kontoListMultiFilter("' + value + '", this)\' ' + (checked ? ' checked>': '> ')).data('value', value)).append($('<span></span>').text(descr).prepend('&nbsp;')).append('<br/>');
				}
			 }
		}
		reload(fstr, items);
		gui.append(checkboxes);

		return gui;
	}
									function updateNumberfop_fints_buchung(col) {
										//var checklist = window.DataViewChecked['fop_fints_buchung'][col];
										//if (checklist.id) {
											// checklist is online
											// TODO: check if cache is alive, otherwise reload from ajax, delay execution and return now
											//checklist.ranges = [[1,10000000]]; // mostly we use indirect idlists to tick all marks; so this is an approximation
										//}
										// checkboxes aktualisieren
										if (window.DataViewChecked && window.DataViewChecked['fop_fints_buchung'] && window.DataViewChecked['fop_fints_buchung'][col].ranges.length > 0) {
											$('.fop_fints_buchung__mass-action').css('visibility', 'visible');
											$('.fop_fints_buchung__action').css('visibility', 'hidden');
										} else {
											$('.fop_fints_buchung__mass-action').css('visibility', 'hidden');
											$('.fop_fints_buchung__action').css('visibility', 'visible');
										}
										$('.fop_fints_buchung__checkbox').each(function (idx, x) {
											for (var cssclass of x.classList) {
												if (cssclass.startsWith('fop_fints_buchung__checkbox-'+col+'-')) {
													var my_id = cssclass.substr(('fop_fints_buchung__checkbox-'+col+'-').length);
													if (window.DataViewChecked) {
														x.MaterialCheckbox[checklist.has(my_id) ? 'check' : 'uncheck']();
													}
												}
											}
										});
									}
									function reloadfop_fints_buchung (params, returnUrl, onlyScroll, addPadding = 0) {
										// copy query
										let nq = JSON.parse(JSON.stringify(query));
										nq['parent_request'] = <?php echo json_encode(strtok(\FOP\Util::getBackUrl(), '?')); ?>;
										<?php if (isset($_GET['select'])) { ?>nq['select'] = 'select';<?php } ?>
										
										if (params) {
											for (var i in params) nq[i] = params[i];
											var action = nq['action'];
											delete nq['action'];
											let querystr = "DataView/Fop_fints_buchung/" + action + "?" + Object.keys(nq).map(function(k){ return k + "=" +  encodeURIComponent(nq[k]); }).join("&");
											// direkt aufrufen (ist wohl ein Download oder so)
											if (returnUrl) return querystr;
											window.location.href = querystr;
										} else {
											let querystr;
											
											
											<?php if (((\FOP\User::getBuchhaltung()) && (\FOP\User::getBuchhaltung())) && (!\FOP\User::getIsGuest())) { ?>
											delete nq['action'];
											querystr = "DataView/Fop_fints_buchung/renderTabTable?" + Object.keys(nq).map(function(k){ return k + "=" +  encodeURIComponent(nq[k]); }).join("&");
											// per Ajax laden
											if(!$("#fop_fints_buchung-table")?.parent()?.parent()?.hasClass('fop-form-feature-collapsed') || $("#fop_fints_buchung-table")?.parent()?.parent()?.hasClass('fop-form-feature-mode-area')) {
											$.get(querystr, function(data){
												var tab = $("#fop_fints_buchung-table");
												var top = tab.find('.fop-table-body-inner');
												var el;
												if (onlyScroll && (el = $('<div class="tabcontent">' + data + '</div>').find('.fop-table-body-inner'))) {
													// nur Scroll-Bereich ersetzen
													var paddingTop = parseInt(el.css('paddingTop') || '0px', 10);
													var minHeight = parseInt(el.css('minHeight'), 10)
													paddingTop += addPadding;
													minHeight += addPadding;
													top.css({paddingTop: paddingTop.toString()+'px', minHeight: minHeight.toString()+'px'}); // Offset
													el = el.children();
													top.empty();
													top.append(el);
													el = top; // top-upgrade doppelt machen, dadurch vermeiden wir das Array-upgrade => Performance
												} else {
													// gesamten Tab ersetzen
													tab.children().remove();
													el = tab.html('<div class="tabcontent">' + data + '</div>');
												}
												try {
													for (var i = 0; i < el.length; i++) upgradeDOM(el[i]);
												} catch (e) {
													console.log(e);
												}
												upgradeTable(el.find('.fop-table .fop-table-header')); // Falls es Tabellen-Layout ist: Spalten-Order anpassen
												flushURL(); // Neue URL in Titelleiste eintragen

												// Checkbox-Auswahl ankreuzen
												updateNumberfop_fints_buchung('ID');
											});
											} else {
												// gesamten Tab ersetzen
												var tab = $("#fop_fints_buchung-table");
												tab.children().remove();
												el = tab.html('<div class="fop-lazy-reload" onclick="reloadfop_fints_buchung()"></div>');
											}
											<?php } ?>
											
										}
									}
									function checkfop_fints_buchung (id, col, checked) {
										// ID-Liste aufbauen
										if (!window.DataViewChecked) window.DataViewChecked = {};
										if (!window.DataViewChecked['fop_fints_buchung']) window.DataViewChecked['fop_fints_buchung'] = {};
										if (!window.DataViewChecked['fop_fints_buchung'][col]) window.DataViewChecked['fop_fints_buchung'][col] = new IDList();

										// Abfrage aller gecheckten IDs für eine Tabelle
										if (!id) {
											return window.DataViewChecked['fop_fints_buchung'][col].toString();
										}

										// check all, check id
										if (id == 'all') {
											// TODO: umbauen #1289: 'all' auch nur auf ne idlist reduzieren
											if (checked) {
												$.get(reloadfop_fints_buchung({action: 'getids', col: col}, true), function (ids) {
													window.DataViewChecked['fop_fints_buchung'][col] = new IDList(ids);
													updateNumberfop_fints_buchung(col);
												});
											} else {
												window.DataViewChecked['fop_fints_buchung'][col] = new IDList();
												updateNumberfop_fints_buchung(col);
											}
										} else {
											var ids = new IDList(id);
											var allcb = $('#fop_fints_buchung__all-checkbox');
											if (allcb[0]) {
												allcb[0].parentElement.MaterialCheckbox.uncheck(); // TODO: prüfen, ob Gruppen-CBs voll werden
											}
											if (checked == 'set') {
												window.DataViewChecked['fop_fints_buchung'][col] = ids;
											} else for (id of ids.all()) {
												if (checked) {
													window.DataViewChecked['fop_fints_buchung'][col].push(id);
												} else {
													window.DataViewChecked['fop_fints_buchung'][col].remove(id);
												}
											}
											updateNumberfop_fints_buchung(col);
										}
									}
								</script><?php

    
  }

  public static function renderSpecialFilters() { 
    
    
    // --- BLOCK: main ---
    ?>
	
	<script type"text/javascript">
		function updateSpecialFilter(param, val) {
			query[param] = val.toString();reloadfop_fints_buchung();
			
		}

	</script>
	<?php
	
    
  }

  public static function renderTabTableAction() { 
    
    
    // --- BLOCK: access ---
    
    // --- BLOCK: main ---
     ?><div class='fop-dv-buttonbar'><?php if((!\FOP\User::getIsGuest())) { ?>
	<?php if ((true) && (true)) { ?>
	<div class='fop-dv-aggregate' data-column='betrag' title='<?php echo(_('Betrag')); ?>'>
		<div class='fop-dv-aggregate-caption' style='text-align: right'><?php echo(_('Betrag')); ?></div>
		<div class='fop-dv-aggregate-value'>-...-</div>
	</div>
	<?php } ?><?php }if(((false) && (\FOP\User::getBuchhaltung()) && (\FOP\User::getBuchhaltung())) && (!\FOP\User::getIsGuest())) { ?><a class="mdl-button mdl-js-button mdl-button--raised mdl-button--colored" onclick="
		var self = this;
		event.preventDefault();
		$.get(reloadfop_fints_buchung({action: 'open', fop_table: 'fop_fints_buchung', fop_id: '_', fop_from: location.href}, true))
		.then(function () {
			window.open_url(self.href, false);
		});" href="<?php echo htmlentities(\TablesRouter\Fop_fints_buchung::createURL2(['from' => $_GET['from'] ?? null, 'popup' => $_GET['popup'] ?? null])); ?>"><i class="material-icons">add</i> <?php echo(sprintf(_('create %s'), _('Buchung'))); ?></a><?php } ?></div><?php 
								\FOP\User::getIsGuest();
								$itemheight = 32;
								$itemsperpage = ceil(1080 / $itemheight * 0.8);
								$page = (isset($_GET['page_fop_fints_buchung']) ? intval($_GET['page_fop_fints_buchung']) : 0);
								$addlines = (isset($_GET['addlines_fop_fints_buchung']) ? intval($_GET['addlines_fop_fints_buchung']) : 0);
								$firstitem = $page * $itemsperpage;
								$sqladdon = ' LIMIT ' . ($itemsperpage * 2) . ' OFFSET ' . ($firstitem);
								$data = self::getData($sqladdon, $_GET);
								$arr = $data["items"];
								$itemcount = $data["itemcount"];
								$lastPage = ceil($itemcount/$itemsperpage-1);
								// calculate width of first column: 67px + 32px for each shortcut
								$firstColumnWidth = 66 + 34 + 34;
								$additionalLines = 0;
								$renderAggregateRow = function ($item) use (&$columns, $firstColumnWidth) {
										if (!(true)) {
											return; // no access
										}
										?><div class="fop-table-row fop-table-row-aggregate">
											<div class="fop-table-column noprint" style="width: <?php echo json_encode($firstColumnWidth); ?>px;"><?php echo $item['::cnt']; ?> x</div><?php
											foreach ($columns AS $col) {
												$col['renderSum']($item);
											} ?>
										</div><?php
								};
								$checkAggregates = function ($last, $current) use ($data, $renderAggregateRow) {
									
								};

									// Spaltenliste zuerst aufbauen, damit sie noch umsortiert werden kann
									$order = 1000;
									$columns = [];
									
										if(true){
											$col = [
												'id' => 'forderungDone',
												'desc' => _('Forderung behandelt'),
												'order' => ++$order,
												'width' => 40, // default value
												'collapsed' => 0

											];
											$columns['forderungDone'] = $col;
										}
									
										if(true){
											$col = [
												'id' => 'konto',
												'desc' => _('Konto'),
												'order' => ++$order,
												'width' => 180, // default value
												'collapsed' => 0

											];
											$columns['konto'] = $col;
										}
									
										if(true){
											$col = [
												'id' => 'bdate',
												'desc' => _('Buchungsdatum'),
												'order' => ++$order,
												'width' => 100, // default value
												'collapsed' => 0

											];
											$columns['bdate'] = $col;
										}
									
										if(true){
											$col = [
												'id' => 'date',
												'desc' => _('Wertstellungsdatum'),
												'order' => ++$order,
												'width' => 100, // default value
												'collapsed' => 0

											];
											$columns['date'] = $col;
										}
									
										if(true){
											$col = [
												'id' => 'betrag',
												'desc' => _('Betrag'),
												'order' => ++$order,
												'width' => 120, // default value
												'collapsed' => 0

											];
											$columns['betrag'] = $col;
										}
									
										if(true){
											$col = [
												'id' => 'saldo',
												'desc' => _('Saldo'),
												'order' => ++$order,
												'width' => 120, // default value
												'collapsed' => 0

											];
											$columns['saldo'] = $col;
										}
									
										if(true){
											$col = [
												'id' => 'iban',
												'desc' => _('IBAN'),
												'order' => ++$order,
												'width' => 180, // default value
												'collapsed' => 0

											];
											$columns['iban'] = $col;
										}
									
										if(true){
											$col = [
												'id' => 'name_firma',
												'desc' => _('Name, Vorname/Firma'),
												'order' => ++$order,
												'width' => 180, // default value
												'collapsed' => 0

											];
											$columns['name_firma'] = $col;
										}
									
										if(true){
											$col = [
												'id' => 'vzweck',
												'desc' => _('Verwendungszweck'),
												'order' => ++$order,
												'width' => 180, // default value
												'collapsed' => 0

											];
											$columns['vzweck'] = $col;
										}
									
										if(true){
											$col = [
												'id' => 'endtoend',
												'desc' => _('End to End-Referenz'),
												'order' => ++$order,
												'width' => 180, // default value
												'collapsed' => 0

											];
											$columns['endtoend'] = $col;
										}
									
										if(true){
											$col = [
												'id' => 'umsatzart',
												'desc' => _('Umsatzart'),
												'order' => ++$order,
												'width' => 180, // default value
												'collapsed' => 0

											];
											$columns['umsatzart'] = $col;
										}
									
										if((false)){
											$col = [
												'id' => 'hash',
												'desc' => _('Hashcode'),
												'order' => ++$order,
												'width' => 180, // default value
												'collapsed' => 0

											];
											$columns['hash'] = $col;
										}
									

									// gespeicherte Spaltenanordnung
									foreach (\FOP\Database::query('SELECT * FROM fop_dataview WHERE '.qi('user').' = ' . \FOP\Database::quote(\FOP\User::getID()) . ' AND dataview = ' . \FOP\Database::quote('fop_fints_buchung'))->fetchAll(\PDO::FETCH_ASSOC) AS $column => $c) {
										if (isset($columns[$c['column']])) {
											$columns[$c['column']]['order'] = $c['order']; // order, width, collapsed
											$columns[$c['column']]['width'] = $c['width']; // order, width, collapsed
											$columns[$c['column']]['collapsed'] = $c['collapsed']; // order, width, collapsed
										}
									}

									// DOM vor-rendern
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='forderungDone'
												data-order='<?php echo intval($columns['forderungDone']['order']); ?>'
												data-width='<?php echo intval($columns['forderungDone']['width']); ?>'
												data-collapsed='<?php echo intval($columns['forderungDone']['collapsed']); ?>'
												style='width: <?php echo intval($columns['forderungDone']['width']); ?>px; <?php if ($columns['forderungDone']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloadfop_fints_buchung(); 
		}});
		win
	.append($('<input type=\'checkbox\'' + (querySet('filter_fop_fints_buchung_forderungDone', '0') ? ' checked>': '>')).change(function (){querySet('filter_fop_fints_buchung_forderungDone', '0', $(this).prop('checked')); delete query['page_fop_fints_buchung']; changed=true;})).append(' <?php echo(_('off')); ?><br/>')
	.append($('<input type=\'checkbox\'' + (querySet('filter_fop_fints_buchung_forderungDone', '1') ? ' checked>': '>')).change(function (){querySet('filter_fop_fints_buchung_forderungDone', '1', $(this).prop('checked')); delete query['page_fop_fints_buchung']; changed=true;})).append(' <?php echo(_('on')); ?><br/>')
;
		return false;
	">
													<span class='title-title' title='<?php echo(_('Forderung behandelt')); ?>'><?php echo(_('Forderung behandelt')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_fop_fints_buchung']) && $_GET['sort_fop_fints_buchung'] == 'forderungDone ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_fop_fints_buchung']) && $_GET['sort_fop_fints_buchung'] == 'forderungDone DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_fop_fints_buchung_forderungDone']) || isset($_GET['range_max_fop_fints_buchung_forderungDone']) || isset($_GET['deps_fop_fints_buchung_forderungDone']) || isset($_GET['fullsearch_fop_fints_buchung_forderungDone']) || isset($_GET['dynamic_fop_fints_buchung_forderungDone']) || isset($_GET['search_fop_fints_buchung_forderungDone']) || isset($_GET['searchnot_fop_fints_buchung_forderungDone']) || isset($_GET['filter_fop_fints_buchung_forderungDone'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['forderungDone']['header'] = ob_get_contents(); ob_end_clean();
											$columns['forderungDone']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['forderungDone']['width']); ?>px; <?php if ($columns['forderungDone']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='forderungDone'><?php if($item['forderungDone'] == 1){ ?>✓<?php }else{ ?><?php }?></div><?php
											};
											$columns['forderungDone']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='forderungDone'
													data-order='<?php echo intval($columns['forderungDone']['order']); ?>'
													data-width='<?php echo intval($columns['forderungDone']['width']); ?>'
													data-collapsed='<?php echo intval($columns['forderungDone']['collapsed']); ?>'
													style='width: <?php echo intval($columns['forderungDone']['width']); ?>px; <?php if ($columns['forderungDone']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='konto'
												data-order='<?php echo intval($columns['konto']['order']); ?>'
												data-width='<?php echo intval($columns['konto']['width']); ?>'
												data-collapsed='<?php echo intval($columns['konto']['collapsed']); ?>'
												style='width: <?php echo intval($columns['konto']['width']); ?>px; <?php if ($columns['konto']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloadfop_fints_buchung(); 
		}});
		
		win.append(getfilter_fop_fints_buchung_kontoListMultiFilter()); win.find('input').first().focus();
		return false;
	">
													<span class='title-title' title='<?php echo(_('Konto')); ?>'><?php echo(_('Konto')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_fop_fints_buchung']) && $_GET['sort_fop_fints_buchung'] == 'konto ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_fop_fints_buchung']) && $_GET['sort_fop_fints_buchung'] == 'konto DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_fop_fints_buchung_konto']) || isset($_GET['range_max_fop_fints_buchung_konto']) || isset($_GET['deps_fop_fints_buchung_konto']) || isset($_GET['fullsearch_fop_fints_buchung_konto']) || isset($_GET['dynamic_fop_fints_buchung_konto']) || isset($_GET['search_fop_fints_buchung_konto']) || isset($_GET['searchnot_fop_fints_buchung_konto']) || isset($_GET['filter_fop_fints_buchung_konto'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['konto']['header'] = ob_get_contents(); ob_end_clean();
											$columns['konto']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['konto']['width']); ?>px; <?php if ($columns['konto']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='konto'><?php
	
	call_user_func(function () use ($item) {
	$id = $item['konto'];
	$val = $item['konto::description'];
	$canView = $item['konto::canView'];
	if ($val !== null) {
		if ($canView) echo "<a tabindex=\"-1\" class=\"mdl-button mdl-button-small tbl-link\" data-tbl=\"fop_fints_konto\" data-id=\"".htmlentities($id)."\" onclick=\"event.stopPropagation(); event.preventDefault(); open_url(this.href, false);\" href=\"" . \TablesRouter\Fop_fints_konto::viewURL($id, ['from' => \FOP\Util::getBackURL()]) . "\">(…)</a>";echo htmlentities($val);
	} else {
		echo htmlentities(_('') ?: '-');
	}
	});
	
?>
</div><?php
											};
											$columns['konto']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='konto'
													data-order='<?php echo intval($columns['konto']['order']); ?>'
													data-width='<?php echo intval($columns['konto']['width']); ?>'
													data-collapsed='<?php echo intval($columns['konto']['collapsed']); ?>'
													style='width: <?php echo intval($columns['konto']['width']); ?>px; <?php if ($columns['konto']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='bdate'
												data-order='<?php echo intval($columns['bdate']['order']); ?>'
												data-width='<?php echo intval($columns['bdate']['width']); ?>'
												data-collapsed='<?php echo intval($columns['bdate']['collapsed']); ?>'
												style='width: <?php echo intval($columns['bdate']['width']); ?>px; <?php if ($columns['bdate']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloadfop_fints_buchung(); 
		}}, 600);
		date_filter(win, 'fop_fints_buchung', 'bdate', <?php echo htmlentities(json_encode(_('period'))); ?>, <?php echo htmlentities(json_encode(\FOP\I18n::getShortLocale())); ?>, <?php echo htmlentities(json_encode(_('dateformat_moment'))); ?>, function() { reloadfop_fints_buchung();  reloadfop_fints_buchung(); });
	var icon, sortbtn	= $('<a class=\'mdl-button mdl-js-button mdl-button--icon mdl-button--colored\' style=\'display: inline-block;\'></a>')
		.append(icon = $('<i class=\'material-icons\'></i>').text('unfold_more'))
		.click(function() {
		 if (query['sort_fop_fints_buchung'] == 'bdate ASC') {
			query['sort_fop_fints_buchung'] = 'bdate DESC';
		 } else if (query['sort_fop_fints_buchung'] == 'bdate DESC') {
		 	delete query['sort_fop_fints_buchung'];
		 } else {
			query['sort_fop_fints_buchung'] = 'bdate ASC';
		 }
		 reloadfop_fints_buchung();
		 return false;
	});
	if (win.children().first().hasClass('fop-floatsorter')) {
		// floating layout
		win.prepend(sortbtn.css({float: 'right', margin: '0px'}));
	} else {
		// append to the end
		win.append(sortbtn);
	}
		return false;
	">
													<span class='title-title' title='<?php echo(_('Buchungsdatum')); ?>'><?php echo(_('Buchungsdatum')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_fop_fints_buchung']) && $_GET['sort_fop_fints_buchung'] == 'bdate ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_fop_fints_buchung']) && $_GET['sort_fop_fints_buchung'] == 'bdate DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_fop_fints_buchung_bdate']) || isset($_GET['range_max_fop_fints_buchung_bdate']) || isset($_GET['deps_fop_fints_buchung_bdate']) || isset($_GET['fullsearch_fop_fints_buchung_bdate']) || isset($_GET['dynamic_fop_fints_buchung_bdate']) || isset($_GET['search_fop_fints_buchung_bdate']) || isset($_GET['searchnot_fop_fints_buchung_bdate']) || isset($_GET['filter_fop_fints_buchung_bdate'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['bdate']['header'] = ob_get_contents(); ob_end_clean();
											$columns['bdate']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['bdate']['width']); ?>px; <?php if ($columns['bdate']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='bdate'><span class='overflow-text' title="<?php echo htmlentities(($item['bdate']) ? strftime(_('dateformat_php2'), intval($item['bdate'])) : ''); ?>"><?php echo htmlentities(($item['bdate']) ? strftime(_('dateformat_php2'), intval($item['bdate'])) : ''); ?></span></div><?php
											};
											$columns['bdate']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='bdate'
													data-order='<?php echo intval($columns['bdate']['order']); ?>'
													data-width='<?php echo intval($columns['bdate']['width']); ?>'
													data-collapsed='<?php echo intval($columns['bdate']['collapsed']); ?>'
													style='width: <?php echo intval($columns['bdate']['width']); ?>px; <?php if ($columns['bdate']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='date'
												data-order='<?php echo intval($columns['date']['order']); ?>'
												data-width='<?php echo intval($columns['date']['width']); ?>'
												data-collapsed='<?php echo intval($columns['date']['collapsed']); ?>'
												style='width: <?php echo intval($columns['date']['width']); ?>px; <?php if ($columns['date']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloadfop_fints_buchung(); 
		}}, 600);
		date_filter(win, 'fop_fints_buchung', 'date', <?php echo htmlentities(json_encode(_('period'))); ?>, <?php echo htmlentities(json_encode(\FOP\I18n::getShortLocale())); ?>, <?php echo htmlentities(json_encode(_('dateformat_moment'))); ?>, function() { reloadfop_fints_buchung();  reloadfop_fints_buchung(); });
	var icon, sortbtn	= $('<a class=\'mdl-button mdl-js-button mdl-button--icon mdl-button--colored\' style=\'display: inline-block;\'></a>')
		.append(icon = $('<i class=\'material-icons\'></i>').text('unfold_more'))
		.click(function() {
		 if (query['sort_fop_fints_buchung'] == 'date ASC') {
			query['sort_fop_fints_buchung'] = 'date DESC';
		 } else if (query['sort_fop_fints_buchung'] == 'date DESC') {
		 	delete query['sort_fop_fints_buchung'];
		 } else {
			query['sort_fop_fints_buchung'] = 'date ASC';
		 }
		 reloadfop_fints_buchung();
		 return false;
	});
	if (win.children().first().hasClass('fop-floatsorter')) {
		// floating layout
		win.prepend(sortbtn.css({float: 'right', margin: '0px'}));
	} else {
		// append to the end
		win.append(sortbtn);
	}
		return false;
	">
													<span class='title-title' title='<?php echo(_('Wertstellungsdatum')); ?>'><?php echo(_('Wertstellungsdatum')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_fop_fints_buchung']) && $_GET['sort_fop_fints_buchung'] == 'date ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_fop_fints_buchung']) && $_GET['sort_fop_fints_buchung'] == 'date DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_fop_fints_buchung_date']) || isset($_GET['range_max_fop_fints_buchung_date']) || isset($_GET['deps_fop_fints_buchung_date']) || isset($_GET['fullsearch_fop_fints_buchung_date']) || isset($_GET['dynamic_fop_fints_buchung_date']) || isset($_GET['search_fop_fints_buchung_date']) || isset($_GET['searchnot_fop_fints_buchung_date']) || isset($_GET['filter_fop_fints_buchung_date'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['date']['header'] = ob_get_contents(); ob_end_clean();
											$columns['date']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['date']['width']); ?>px; <?php if ($columns['date']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='date'><span class='overflow-text' title="<?php echo htmlentities(($item['date']) ? strftime(_('dateformat_php2'), intval($item['date'])) : ''); ?>"><?php echo htmlentities(($item['date']) ? strftime(_('dateformat_php2'), intval($item['date'])) : ''); ?></span></div><?php
											};
											$columns['date']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='date'
													data-order='<?php echo intval($columns['date']['order']); ?>'
													data-width='<?php echo intval($columns['date']['width']); ?>'
													data-collapsed='<?php echo intval($columns['date']['collapsed']); ?>'
													style='width: <?php echo intval($columns['date']['width']); ?>px; <?php if ($columns['date']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='betrag'
												data-order='<?php echo intval($columns['betrag']['order']); ?>'
												data-width='<?php echo intval($columns['betrag']['width']); ?>'
												data-collapsed='<?php echo intval($columns['betrag']['collapsed']); ?>'
												style='width: <?php echo intval($columns['betrag']['width']); ?>px; <?php if ($columns['betrag']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloadfop_fints_buchung(); 
		}});
		var von, bis; win.append('<div class=\'fop-floatsorter\'>' + window.i18n_von + '</div>').append(von = $('<input type=\'number\' step=\'any\'><br>').val(query['range_min_fop_fints_buchung_betrag']).on('change keyup paste', function () { query['range_min_fop_fints_buchung_betrag'] = von.val(); delete query['page_fop_fints_buchung']; changed = true; }))
.append('<div>' + window.i18n_bis + '</div>').append(bis = $('<input type=\'number\' step=\'any\'>').val(query['range_max_fop_fints_buchung_betrag']).on('change keyup paste', function () { query['range_max_fop_fints_buchung_betrag'] = bis.val(); delete query['page_fop_fints_buchung']; changed = true; }))
; von.focus(); von.select();
	var icon, sortbtn	= $('<a class=\'mdl-button mdl-js-button mdl-button--icon mdl-button--colored\' style=\'display: inline-block;\'></a>')
		.append(icon = $('<i class=\'material-icons\'></i>').text('unfold_more'))
		.click(function() {
		 if (query['sort_fop_fints_buchung'] == 'betrag ASC') {
			query['sort_fop_fints_buchung'] = 'betrag DESC';
		 } else if (query['sort_fop_fints_buchung'] == 'betrag DESC') {
		 	delete query['sort_fop_fints_buchung'];
		 } else {
			query['sort_fop_fints_buchung'] = 'betrag ASC';
		 }
		 reloadfop_fints_buchung();
		 return false;
	});
	if (win.children().first().hasClass('fop-floatsorter')) {
		// floating layout
		win.prepend(sortbtn.css({float: 'right', margin: '0px'}));
	} else {
		// append to the end
		win.append(sortbtn);
	}
		return false;
	" style='text-align: right;'>
													<span class='title-title' title='<?php echo(_('Betrag')); ?>'><?php echo(_('Betrag')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_fop_fints_buchung']) && $_GET['sort_fop_fints_buchung'] == 'betrag ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_fop_fints_buchung']) && $_GET['sort_fop_fints_buchung'] == 'betrag DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_fop_fints_buchung_betrag']) || isset($_GET['range_max_fop_fints_buchung_betrag']) || isset($_GET['deps_fop_fints_buchung_betrag']) || isset($_GET['fullsearch_fop_fints_buchung_betrag']) || isset($_GET['dynamic_fop_fints_buchung_betrag']) || isset($_GET['search_fop_fints_buchung_betrag']) || isset($_GET['searchnot_fop_fints_buchung_betrag']) || isset($_GET['filter_fop_fints_buchung_betrag'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['betrag']['header'] = ob_get_contents(); ob_end_clean();
											$columns['betrag']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['betrag']['width']); ?>px; <?php if ($columns['betrag']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='betrag'><span style="white-space: nowrap; width: 100%; display: inline-block; text-align: right;"><?php echo htmlentities(\Types\Euro::print($item['betrag'])); ?><?php echo '&nbsp;' .  htmlentities('€'); ?>
	</span></div><?php
											};
											$columns['betrag']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='betrag'
													data-order='<?php echo intval($columns['betrag']['order']); ?>'
													data-width='<?php echo intval($columns['betrag']['width']); ?>'
													data-collapsed='<?php echo intval($columns['betrag']['collapsed']); ?>'
													style='width: <?php echo intval($columns['betrag']['width']); ?>px; <?php if ($columns['betrag']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													<b><span style="white-space: nowrap; width: 100%; display: inline-block; text-align: right;"><?php echo htmlentities(\Types\Euro::print($item['betrag'])); ?><?php echo '&nbsp;' .  htmlentities('€'); ?>
	</span></b></div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='saldo'
												data-order='<?php echo intval($columns['saldo']['order']); ?>'
												data-width='<?php echo intval($columns['saldo']['width']); ?>'
												data-collapsed='<?php echo intval($columns['saldo']['collapsed']); ?>'
												style='width: <?php echo intval($columns['saldo']['width']); ?>px; <?php if ($columns['saldo']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloadfop_fints_buchung(); 
		}});
		var von, bis; win.append('<div class=\'fop-floatsorter\'>' + window.i18n_von + '</div>').append(von = $('<input type=\'number\' step=\'any\'><br>').val(query['range_min_fop_fints_buchung_saldo']).on('change keyup paste', function () { query['range_min_fop_fints_buchung_saldo'] = von.val(); delete query['page_fop_fints_buchung']; changed = true; }))
.append('<div>' + window.i18n_bis + '</div>').append(bis = $('<input type=\'number\' step=\'any\'>').val(query['range_max_fop_fints_buchung_saldo']).on('change keyup paste', function () { query['range_max_fop_fints_buchung_saldo'] = bis.val(); delete query['page_fop_fints_buchung']; changed = true; }))
; von.focus(); von.select();
	var icon, sortbtn	= $('<a class=\'mdl-button mdl-js-button mdl-button--icon mdl-button--colored\' style=\'display: inline-block;\'></a>')
		.append(icon = $('<i class=\'material-icons\'></i>').text('unfold_more'))
		.click(function() {
		 if (query['sort_fop_fints_buchung'] == 'saldo ASC') {
			query['sort_fop_fints_buchung'] = 'saldo DESC';
		 } else if (query['sort_fop_fints_buchung'] == 'saldo DESC') {
		 	delete query['sort_fop_fints_buchung'];
		 } else {
			query['sort_fop_fints_buchung'] = 'saldo ASC';
		 }
		 reloadfop_fints_buchung();
		 return false;
	});
	if (win.children().first().hasClass('fop-floatsorter')) {
		// floating layout
		win.prepend(sortbtn.css({float: 'right', margin: '0px'}));
	} else {
		// append to the end
		win.append(sortbtn);
	}
		return false;
	" style='text-align: right;'>
													<span class='title-title' title='<?php echo(_('Saldo')); ?>'><?php echo(_('Saldo')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_fop_fints_buchung']) && $_GET['sort_fop_fints_buchung'] == 'saldo ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_fop_fints_buchung']) && $_GET['sort_fop_fints_buchung'] == 'saldo DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_fop_fints_buchung_saldo']) || isset($_GET['range_max_fop_fints_buchung_saldo']) || isset($_GET['deps_fop_fints_buchung_saldo']) || isset($_GET['fullsearch_fop_fints_buchung_saldo']) || isset($_GET['dynamic_fop_fints_buchung_saldo']) || isset($_GET['search_fop_fints_buchung_saldo']) || isset($_GET['searchnot_fop_fints_buchung_saldo']) || isset($_GET['filter_fop_fints_buchung_saldo'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['saldo']['header'] = ob_get_contents(); ob_end_clean();
											$columns['saldo']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['saldo']['width']); ?>px; <?php if ($columns['saldo']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='saldo'><span style="white-space: nowrap; width: 100%; display: inline-block; text-align: right;"><?php echo htmlentities(\Types\Euro::print($item['saldo'])); ?><?php echo '&nbsp;' .  htmlentities('€'); ?>
	</span></div><?php
											};
											$columns['saldo']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='saldo'
													data-order='<?php echo intval($columns['saldo']['order']); ?>'
													data-width='<?php echo intval($columns['saldo']['width']); ?>'
													data-collapsed='<?php echo intval($columns['saldo']['collapsed']); ?>'
													style='width: <?php echo intval($columns['saldo']['width']); ?>px; <?php if ($columns['saldo']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='iban'
												data-order='<?php echo intval($columns['iban']['order']); ?>'
												data-width='<?php echo intval($columns['iban']['width']); ?>'
												data-collapsed='<?php echo intval($columns['iban']['collapsed']); ?>'
												style='width: <?php echo intval($columns['iban']['width']); ?>px; <?php if ($columns['iban']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloadfop_fints_buchung(); 
		}});
		
		var el = $('<div class=\'mdl-textfield mdl-js-textfield mdl-textfield--floating-label fop-floatsorter\' style=\'width: calc(100% - 42px);\'><input class=\'mdl-textfield__input\' style=\'display: inline-block;\' type=\'text\'><label class=\'mdl-textfield__input\'><?php echo(_('search')); ?></label></div>');
		win.append(el);
		var text = el.find('input');
		text.val(query['search_fop_fints_buchung_iban'])
		text.on('change keyup paste', function () { if (text.val()) { query['search_fop_fints_buchung_iban'] = text.val(); } else { delete query['search_fop_fints_buchung_iban']; } changed = true; });
		text.focus();
		text.select();
		text.keydown(function (event) {if ((event.keyCode || event.which) == 13) {$('#table_fop_fints_buchung').find('.fop-table-row:first').click();} if (event.key === 'Escape') { win.close(); }});

		var el2 = $('<div class=\'mdl-textfield mdl-js-textfield mdl-textfield--floating-label\'><input class=\'mdl-textfield__input\' style=\'display: inline-block;\' type=\'text\'><label class=\'mdl-textfield__input\'><?php echo(htmlentities(htmlentities(_('filter_contains_not')))); ?></label></div>');
		win.append(el2);
		var text2 = el2.find('input');
		text2.val(query['searchnot_fop_fints_buchung_iban'])
		text2.on('change keyup paste', function () { if (text2.val()) { query['searchnot_fop_fints_buchung_iban'] = text2.val(); } else { delete query['searchnot_fop_fints_buchung_iban']; } changed = true; });
		text2.keydown(function (event) {if ((event.keyCode || event.which) == 13) {$('#table_fop_fints_buchung').find('.fop-table-row:first').click();} if (event.key === 'Escape') { win.close(); }});
	
	var icon, sortbtn	= $('<a class=\'mdl-button mdl-js-button mdl-button--icon mdl-button--colored\' style=\'display: inline-block;\'></a>')
		.append(icon = $('<i class=\'material-icons\'></i>').text('unfold_more'))
		.click(function() {
		 if (query['sort_fop_fints_buchung'] == 'iban ASC') {
			query['sort_fop_fints_buchung'] = 'iban DESC';
		 } else if (query['sort_fop_fints_buchung'] == 'iban DESC') {
		 	delete query['sort_fop_fints_buchung'];
		 } else {
			query['sort_fop_fints_buchung'] = 'iban ASC';
		 }
		 reloadfop_fints_buchung();
		 return false;
	});
	if (win.children().first().hasClass('fop-floatsorter')) {
		// floating layout
		win.prepend(sortbtn.css({float: 'right', margin: '0px'}));
	} else {
		// append to the end
		win.append(sortbtn);
	}
		return false;
	">
													<span class='title-title' title='<?php echo(_('IBAN')); ?>'><?php echo(_('IBAN')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_fop_fints_buchung']) && $_GET['sort_fop_fints_buchung'] == 'iban ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_fop_fints_buchung']) && $_GET['sort_fop_fints_buchung'] == 'iban DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_fop_fints_buchung_iban']) || isset($_GET['range_max_fop_fints_buchung_iban']) || isset($_GET['deps_fop_fints_buchung_iban']) || isset($_GET['fullsearch_fop_fints_buchung_iban']) || isset($_GET['dynamic_fop_fints_buchung_iban']) || isset($_GET['search_fop_fints_buchung_iban']) || isset($_GET['searchnot_fop_fints_buchung_iban']) || isset($_GET['filter_fop_fints_buchung_iban'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['iban']['header'] = ob_get_contents(); ob_end_clean();
											$columns['iban']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['iban']['width']); ?>px; <?php if ($columns['iban']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='iban'><span class='overflow-text' title="<?php echo htmlentities($item['iban']); ?>"><?php echo htmlentities($item['iban']); ?></span></div><?php
											};
											$columns['iban']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='iban'
													data-order='<?php echo intval($columns['iban']['order']); ?>'
													data-width='<?php echo intval($columns['iban']['width']); ?>'
													data-collapsed='<?php echo intval($columns['iban']['collapsed']); ?>'
													style='width: <?php echo intval($columns['iban']['width']); ?>px; <?php if ($columns['iban']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='name_firma'
												data-order='<?php echo intval($columns['name_firma']['order']); ?>'
												data-width='<?php echo intval($columns['name_firma']['width']); ?>'
												data-collapsed='<?php echo intval($columns['name_firma']['collapsed']); ?>'
												style='width: <?php echo intval($columns['name_firma']['width']); ?>px; <?php if ($columns['name_firma']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloadfop_fints_buchung(); 
		}});
		
		var el = $('<div class=\'mdl-textfield mdl-js-textfield mdl-textfield--floating-label fop-floatsorter\' style=\'width: calc(100% - 42px);\'><input class=\'mdl-textfield__input\' style=\'display: inline-block;\' type=\'text\'><label class=\'mdl-textfield__input\'><?php echo(_('search')); ?></label></div>');
		win.append(el);
		var text = el.find('input');
		text.val(query['search_fop_fints_buchung_name_firma'])
		text.on('change keyup paste', function () { if (text.val()) { query['search_fop_fints_buchung_name_firma'] = text.val(); } else { delete query['search_fop_fints_buchung_name_firma']; } changed = true; });
		text.focus();
		text.select();
		text.keydown(function (event) {if ((event.keyCode || event.which) == 13) {$('#table_fop_fints_buchung').find('.fop-table-row:first').click();} if (event.key === 'Escape') { win.close(); }});

		var el2 = $('<div class=\'mdl-textfield mdl-js-textfield mdl-textfield--floating-label\'><input class=\'mdl-textfield__input\' style=\'display: inline-block;\' type=\'text\'><label class=\'mdl-textfield__input\'><?php echo(htmlentities(htmlentities(_('filter_contains_not')))); ?></label></div>');
		win.append(el2);
		var text2 = el2.find('input');
		text2.val(query['searchnot_fop_fints_buchung_name_firma'])
		text2.on('change keyup paste', function () { if (text2.val()) { query['searchnot_fop_fints_buchung_name_firma'] = text2.val(); } else { delete query['searchnot_fop_fints_buchung_name_firma']; } changed = true; });
		text2.keydown(function (event) {if ((event.keyCode || event.which) == 13) {$('#table_fop_fints_buchung').find('.fop-table-row:first').click();} if (event.key === 'Escape') { win.close(); }});
	
	var icon, sortbtn	= $('<a class=\'mdl-button mdl-js-button mdl-button--icon mdl-button--colored\' style=\'display: inline-block;\'></a>')
		.append(icon = $('<i class=\'material-icons\'></i>').text('unfold_more'))
		.click(function() {
		 if (query['sort_fop_fints_buchung'] == 'name_firma ASC') {
			query['sort_fop_fints_buchung'] = 'name_firma DESC';
		 } else if (query['sort_fop_fints_buchung'] == 'name_firma DESC') {
		 	delete query['sort_fop_fints_buchung'];
		 } else {
			query['sort_fop_fints_buchung'] = 'name_firma ASC';
		 }
		 reloadfop_fints_buchung();
		 return false;
	});
	if (win.children().first().hasClass('fop-floatsorter')) {
		// floating layout
		win.prepend(sortbtn.css({float: 'right', margin: '0px'}));
	} else {
		// append to the end
		win.append(sortbtn);
	}
		return false;
	">
													<span class='title-title' title='<?php echo(_('Name, Vorname/Firma')); ?>'><?php echo(_('Name, Vorname/Firma')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_fop_fints_buchung']) && $_GET['sort_fop_fints_buchung'] == 'name_firma ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_fop_fints_buchung']) && $_GET['sort_fop_fints_buchung'] == 'name_firma DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_fop_fints_buchung_name_firma']) || isset($_GET['range_max_fop_fints_buchung_name_firma']) || isset($_GET['deps_fop_fints_buchung_name_firma']) || isset($_GET['fullsearch_fop_fints_buchung_name_firma']) || isset($_GET['dynamic_fop_fints_buchung_name_firma']) || isset($_GET['search_fop_fints_buchung_name_firma']) || isset($_GET['searchnot_fop_fints_buchung_name_firma']) || isset($_GET['filter_fop_fints_buchung_name_firma'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['name_firma']['header'] = ob_get_contents(); ob_end_clean();
											$columns['name_firma']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['name_firma']['width']); ?>px; <?php if ($columns['name_firma']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='name_firma'><span class='overflow-text' title="<?php echo htmlentities($item['name_firma']); ?>"><?php echo htmlentities($item['name_firma']); ?></span></div><?php
											};
											$columns['name_firma']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='name_firma'
													data-order='<?php echo intval($columns['name_firma']['order']); ?>'
													data-width='<?php echo intval($columns['name_firma']['width']); ?>'
													data-collapsed='<?php echo intval($columns['name_firma']['collapsed']); ?>'
													style='width: <?php echo intval($columns['name_firma']['width']); ?>px; <?php if ($columns['name_firma']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='vzweck'
												data-order='<?php echo intval($columns['vzweck']['order']); ?>'
												data-width='<?php echo intval($columns['vzweck']['width']); ?>'
												data-collapsed='<?php echo intval($columns['vzweck']['collapsed']); ?>'
												style='width: <?php echo intval($columns['vzweck']['width']); ?>px; <?php if ($columns['vzweck']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloadfop_fints_buchung(); 
		}});
		
		var el = $('<div class=\'mdl-textfield mdl-js-textfield mdl-textfield--floating-label fop-floatsorter\' style=\'width: calc(100% - 42px);\'><input class=\'mdl-textfield__input\' style=\'display: inline-block;\' type=\'text\'><label class=\'mdl-textfield__input\'><?php echo(_('search')); ?></label></div>');
		win.append(el);
		var text = el.find('input');
		text.val(query['search_fop_fints_buchung_vzweck'])
		text.on('change keyup paste', function () { if (text.val()) { query['search_fop_fints_buchung_vzweck'] = text.val(); } else { delete query['search_fop_fints_buchung_vzweck']; } changed = true; });
		text.focus();
		text.select();
		text.keydown(function (event) {if ((event.keyCode || event.which) == 13) {$('#table_fop_fints_buchung').find('.fop-table-row:first').click();} if (event.key === 'Escape') { win.close(); }});

		var el2 = $('<div class=\'mdl-textfield mdl-js-textfield mdl-textfield--floating-label\'><input class=\'mdl-textfield__input\' style=\'display: inline-block;\' type=\'text\'><label class=\'mdl-textfield__input\'><?php echo(htmlentities(htmlentities(_('filter_contains_not')))); ?></label></div>');
		win.append(el2);
		var text2 = el2.find('input');
		text2.val(query['searchnot_fop_fints_buchung_vzweck'])
		text2.on('change keyup paste', function () { if (text2.val()) { query['searchnot_fop_fints_buchung_vzweck'] = text2.val(); } else { delete query['searchnot_fop_fints_buchung_vzweck']; } changed = true; });
		text2.keydown(function (event) {if ((event.keyCode || event.which) == 13) {$('#table_fop_fints_buchung').find('.fop-table-row:first').click();} if (event.key === 'Escape') { win.close(); }});
	
	var icon, sortbtn	= $('<a class=\'mdl-button mdl-js-button mdl-button--icon mdl-button--colored\' style=\'display: inline-block;\'></a>')
		.append(icon = $('<i class=\'material-icons\'></i>').text('unfold_more'))
		.click(function() {
		 if (query['sort_fop_fints_buchung'] == 'vzweck ASC') {
			query['sort_fop_fints_buchung'] = 'vzweck DESC';
		 } else if (query['sort_fop_fints_buchung'] == 'vzweck DESC') {
		 	delete query['sort_fop_fints_buchung'];
		 } else {
			query['sort_fop_fints_buchung'] = 'vzweck ASC';
		 }
		 reloadfop_fints_buchung();
		 return false;
	});
	if (win.children().first().hasClass('fop-floatsorter')) {
		// floating layout
		win.prepend(sortbtn.css({float: 'right', margin: '0px'}));
	} else {
		// append to the end
		win.append(sortbtn);
	}
		return false;
	">
													<span class='title-title' title='<?php echo(_('Verwendungszweck')); ?>'><?php echo(_('Verwendungszweck')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_fop_fints_buchung']) && $_GET['sort_fop_fints_buchung'] == 'vzweck ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_fop_fints_buchung']) && $_GET['sort_fop_fints_buchung'] == 'vzweck DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_fop_fints_buchung_vzweck']) || isset($_GET['range_max_fop_fints_buchung_vzweck']) || isset($_GET['deps_fop_fints_buchung_vzweck']) || isset($_GET['fullsearch_fop_fints_buchung_vzweck']) || isset($_GET['dynamic_fop_fints_buchung_vzweck']) || isset($_GET['search_fop_fints_buchung_vzweck']) || isset($_GET['searchnot_fop_fints_buchung_vzweck']) || isset($_GET['filter_fop_fints_buchung_vzweck'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['vzweck']['header'] = ob_get_contents(); ob_end_clean();
											$columns['vzweck']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['vzweck']['width']); ?>px; <?php if ($columns['vzweck']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='vzweck'><span class='overflow-text' title="<?php echo htmlentities($item['vzweck']); ?>"><?php echo htmlentities($item['vzweck']); ?></span></div><?php
											};
											$columns['vzweck']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='vzweck'
													data-order='<?php echo intval($columns['vzweck']['order']); ?>'
													data-width='<?php echo intval($columns['vzweck']['width']); ?>'
													data-collapsed='<?php echo intval($columns['vzweck']['collapsed']); ?>'
													style='width: <?php echo intval($columns['vzweck']['width']); ?>px; <?php if ($columns['vzweck']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='endtoend'
												data-order='<?php echo intval($columns['endtoend']['order']); ?>'
												data-width='<?php echo intval($columns['endtoend']['width']); ?>'
												data-collapsed='<?php echo intval($columns['endtoend']['collapsed']); ?>'
												style='width: <?php echo intval($columns['endtoend']['width']); ?>px; <?php if ($columns['endtoend']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloadfop_fints_buchung(); 
		}});
		
		var el = $('<div class=\'mdl-textfield mdl-js-textfield mdl-textfield--floating-label fop-floatsorter\' style=\'width: calc(100% - 42px);\'><input class=\'mdl-textfield__input\' style=\'display: inline-block;\' type=\'text\'><label class=\'mdl-textfield__input\'><?php echo(_('search')); ?></label></div>');
		win.append(el);
		var text = el.find('input');
		text.val(query['search_fop_fints_buchung_endtoend'])
		text.on('change keyup paste', function () { if (text.val()) { query['search_fop_fints_buchung_endtoend'] = text.val(); } else { delete query['search_fop_fints_buchung_endtoend']; } changed = true; });
		text.focus();
		text.select();
		text.keydown(function (event) {if ((event.keyCode || event.which) == 13) {$('#table_fop_fints_buchung').find('.fop-table-row:first').click();} if (event.key === 'Escape') { win.close(); }});

		var el2 = $('<div class=\'mdl-textfield mdl-js-textfield mdl-textfield--floating-label\'><input class=\'mdl-textfield__input\' style=\'display: inline-block;\' type=\'text\'><label class=\'mdl-textfield__input\'><?php echo(htmlentities(htmlentities(_('filter_contains_not')))); ?></label></div>');
		win.append(el2);
		var text2 = el2.find('input');
		text2.val(query['searchnot_fop_fints_buchung_endtoend'])
		text2.on('change keyup paste', function () { if (text2.val()) { query['searchnot_fop_fints_buchung_endtoend'] = text2.val(); } else { delete query['searchnot_fop_fints_buchung_endtoend']; } changed = true; });
		text2.keydown(function (event) {if ((event.keyCode || event.which) == 13) {$('#table_fop_fints_buchung').find('.fop-table-row:first').click();} if (event.key === 'Escape') { win.close(); }});
	
	var icon, sortbtn	= $('<a class=\'mdl-button mdl-js-button mdl-button--icon mdl-button--colored\' style=\'display: inline-block;\'></a>')
		.append(icon = $('<i class=\'material-icons\'></i>').text('unfold_more'))
		.click(function() {
		 if (query['sort_fop_fints_buchung'] == 'endtoend ASC') {
			query['sort_fop_fints_buchung'] = 'endtoend DESC';
		 } else if (query['sort_fop_fints_buchung'] == 'endtoend DESC') {
		 	delete query['sort_fop_fints_buchung'];
		 } else {
			query['sort_fop_fints_buchung'] = 'endtoend ASC';
		 }
		 reloadfop_fints_buchung();
		 return false;
	});
	if (win.children().first().hasClass('fop-floatsorter')) {
		// floating layout
		win.prepend(sortbtn.css({float: 'right', margin: '0px'}));
	} else {
		// append to the end
		win.append(sortbtn);
	}
		return false;
	">
													<span class='title-title' title='<?php echo(_('End to End-Referenz')); ?>'><?php echo(_('End to End-Referenz')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_fop_fints_buchung']) && $_GET['sort_fop_fints_buchung'] == 'endtoend ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_fop_fints_buchung']) && $_GET['sort_fop_fints_buchung'] == 'endtoend DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_fop_fints_buchung_endtoend']) || isset($_GET['range_max_fop_fints_buchung_endtoend']) || isset($_GET['deps_fop_fints_buchung_endtoend']) || isset($_GET['fullsearch_fop_fints_buchung_endtoend']) || isset($_GET['dynamic_fop_fints_buchung_endtoend']) || isset($_GET['search_fop_fints_buchung_endtoend']) || isset($_GET['searchnot_fop_fints_buchung_endtoend']) || isset($_GET['filter_fop_fints_buchung_endtoend'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['endtoend']['header'] = ob_get_contents(); ob_end_clean();
											$columns['endtoend']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['endtoend']['width']); ?>px; <?php if ($columns['endtoend']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='endtoend'><span class='overflow-text' title="<?php echo htmlentities($item['endtoend']); ?>"><?php echo htmlentities($item['endtoend']); ?></span></div><?php
											};
											$columns['endtoend']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='endtoend'
													data-order='<?php echo intval($columns['endtoend']['order']); ?>'
													data-width='<?php echo intval($columns['endtoend']['width']); ?>'
													data-collapsed='<?php echo intval($columns['endtoend']['collapsed']); ?>'
													style='width: <?php echo intval($columns['endtoend']['width']); ?>px; <?php if ($columns['endtoend']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='umsatzart'
												data-order='<?php echo intval($columns['umsatzart']['order']); ?>'
												data-width='<?php echo intval($columns['umsatzart']['width']); ?>'
												data-collapsed='<?php echo intval($columns['umsatzart']['collapsed']); ?>'
												style='width: <?php echo intval($columns['umsatzart']['width']); ?>px; <?php if ($columns['umsatzart']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloadfop_fints_buchung(); 
		}});
		
		var el = $('<div class=\'mdl-textfield mdl-js-textfield mdl-textfield--floating-label fop-floatsorter\' style=\'width: calc(100% - 42px);\'><input class=\'mdl-textfield__input\' style=\'display: inline-block;\' type=\'text\'><label class=\'mdl-textfield__input\'><?php echo(_('search')); ?></label></div>');
		win.append(el);
		var text = el.find('input');
		text.val(query['search_fop_fints_buchung_umsatzart'])
		text.on('change keyup paste', function () { if (text.val()) { query['search_fop_fints_buchung_umsatzart'] = text.val(); } else { delete query['search_fop_fints_buchung_umsatzart']; } changed = true; });
		text.focus();
		text.select();
		text.keydown(function (event) {if ((event.keyCode || event.which) == 13) {$('#table_fop_fints_buchung').find('.fop-table-row:first').click();} if (event.key === 'Escape') { win.close(); }});

		var el2 = $('<div class=\'mdl-textfield mdl-js-textfield mdl-textfield--floating-label\'><input class=\'mdl-textfield__input\' style=\'display: inline-block;\' type=\'text\'><label class=\'mdl-textfield__input\'><?php echo(htmlentities(htmlentities(_('filter_contains_not')))); ?></label></div>');
		win.append(el2);
		var text2 = el2.find('input');
		text2.val(query['searchnot_fop_fints_buchung_umsatzart'])
		text2.on('change keyup paste', function () { if (text2.val()) { query['searchnot_fop_fints_buchung_umsatzart'] = text2.val(); } else { delete query['searchnot_fop_fints_buchung_umsatzart']; } changed = true; });
		text2.keydown(function (event) {if ((event.keyCode || event.which) == 13) {$('#table_fop_fints_buchung').find('.fop-table-row:first').click();} if (event.key === 'Escape') { win.close(); }});
	
	var icon, sortbtn	= $('<a class=\'mdl-button mdl-js-button mdl-button--icon mdl-button--colored\' style=\'display: inline-block;\'></a>')
		.append(icon = $('<i class=\'material-icons\'></i>').text('unfold_more'))
		.click(function() {
		 if (query['sort_fop_fints_buchung'] == 'umsatzart ASC') {
			query['sort_fop_fints_buchung'] = 'umsatzart DESC';
		 } else if (query['sort_fop_fints_buchung'] == 'umsatzart DESC') {
		 	delete query['sort_fop_fints_buchung'];
		 } else {
			query['sort_fop_fints_buchung'] = 'umsatzart ASC';
		 }
		 reloadfop_fints_buchung();
		 return false;
	});
	if (win.children().first().hasClass('fop-floatsorter')) {
		// floating layout
		win.prepend(sortbtn.css({float: 'right', margin: '0px'}));
	} else {
		// append to the end
		win.append(sortbtn);
	}
		return false;
	">
													<span class='title-title' title='<?php echo(_('Umsatzart')); ?>'><?php echo(_('Umsatzart')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_fop_fints_buchung']) && $_GET['sort_fop_fints_buchung'] == 'umsatzart ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_fop_fints_buchung']) && $_GET['sort_fop_fints_buchung'] == 'umsatzart DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_fop_fints_buchung_umsatzart']) || isset($_GET['range_max_fop_fints_buchung_umsatzart']) || isset($_GET['deps_fop_fints_buchung_umsatzart']) || isset($_GET['fullsearch_fop_fints_buchung_umsatzart']) || isset($_GET['dynamic_fop_fints_buchung_umsatzart']) || isset($_GET['search_fop_fints_buchung_umsatzart']) || isset($_GET['searchnot_fop_fints_buchung_umsatzart']) || isset($_GET['filter_fop_fints_buchung_umsatzart'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['umsatzart']['header'] = ob_get_contents(); ob_end_clean();
											$columns['umsatzart']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['umsatzart']['width']); ?>px; <?php if ($columns['umsatzart']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='umsatzart'><span class='overflow-text' title="<?php echo htmlentities($item['umsatzart']); ?>"><?php echo htmlentities($item['umsatzart']); ?></span></div><?php
											};
											$columns['umsatzart']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='umsatzart'
													data-order='<?php echo intval($columns['umsatzart']['order']); ?>'
													data-width='<?php echo intval($columns['umsatzart']['width']); ?>'
													data-collapsed='<?php echo intval($columns['umsatzart']['collapsed']); ?>'
													style='width: <?php echo intval($columns['umsatzart']['width']); ?>px; <?php if ($columns['umsatzart']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if((false)){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='hash'
												data-order='<?php echo intval($columns['hash']['order']); ?>'
												data-width='<?php echo intval($columns['hash']['width']); ?>'
												data-collapsed='<?php echo intval($columns['hash']['collapsed']); ?>'
												style='width: <?php echo intval($columns['hash']['width']); ?>px; <?php if ($columns['hash']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloadfop_fints_buchung(); 
		}});
		
		var el = $('<div class=\'mdl-textfield mdl-js-textfield mdl-textfield--floating-label fop-floatsorter\' style=\'width: calc(100% - 42px);\'><input class=\'mdl-textfield__input\' style=\'display: inline-block;\' type=\'text\'><label class=\'mdl-textfield__input\'><?php echo(_('search')); ?></label></div>');
		win.append(el);
		var text = el.find('input');
		text.val(query['search_fop_fints_buchung_hash'])
		text.on('change keyup paste', function () { if (text.val()) { query['search_fop_fints_buchung_hash'] = text.val(); } else { delete query['search_fop_fints_buchung_hash']; } changed = true; });
		text.focus();
		text.select();
		text.keydown(function (event) {if ((event.keyCode || event.which) == 13) {$('#table_fop_fints_buchung').find('.fop-table-row:first').click();} if (event.key === 'Escape') { win.close(); }});

		var el2 = $('<div class=\'mdl-textfield mdl-js-textfield mdl-textfield--floating-label\'><input class=\'mdl-textfield__input\' style=\'display: inline-block;\' type=\'text\'><label class=\'mdl-textfield__input\'><?php echo(htmlentities(htmlentities(_('filter_contains_not')))); ?></label></div>');
		win.append(el2);
		var text2 = el2.find('input');
		text2.val(query['searchnot_fop_fints_buchung_hash'])
		text2.on('change keyup paste', function () { if (text2.val()) { query['searchnot_fop_fints_buchung_hash'] = text2.val(); } else { delete query['searchnot_fop_fints_buchung_hash']; } changed = true; });
		text2.keydown(function (event) {if ((event.keyCode || event.which) == 13) {$('#table_fop_fints_buchung').find('.fop-table-row:first').click();} if (event.key === 'Escape') { win.close(); }});
	
	var icon, sortbtn	= $('<a class=\'mdl-button mdl-js-button mdl-button--icon mdl-button--colored\' style=\'display: inline-block;\'></a>')
		.append(icon = $('<i class=\'material-icons\'></i>').text('unfold_more'))
		.click(function() {
		 if (query['sort_fop_fints_buchung'] == 'hash ASC') {
			query['sort_fop_fints_buchung'] = 'hash DESC';
		 } else if (query['sort_fop_fints_buchung'] == 'hash DESC') {
		 	delete query['sort_fop_fints_buchung'];
		 } else {
			query['sort_fop_fints_buchung'] = 'hash ASC';
		 }
		 reloadfop_fints_buchung();
		 return false;
	});
	if (win.children().first().hasClass('fop-floatsorter')) {
		// floating layout
		win.prepend(sortbtn.css({float: 'right', margin: '0px'}));
	} else {
		// append to the end
		win.append(sortbtn);
	}
		return false;
	">
													<span class='title-title' title='<?php echo(_('Hashcode')); ?>'><?php echo(_('Hashcode')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_fop_fints_buchung']) && $_GET['sort_fop_fints_buchung'] == 'hash ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_fop_fints_buchung']) && $_GET['sort_fop_fints_buchung'] == 'hash DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_fop_fints_buchung_hash']) || isset($_GET['range_max_fop_fints_buchung_hash']) || isset($_GET['deps_fop_fints_buchung_hash']) || isset($_GET['fullsearch_fop_fints_buchung_hash']) || isset($_GET['dynamic_fop_fints_buchung_hash']) || isset($_GET['search_fop_fints_buchung_hash']) || isset($_GET['searchnot_fop_fints_buchung_hash']) || isset($_GET['filter_fop_fints_buchung_hash'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['hash']['header'] = ob_get_contents(); ob_end_clean();
											$columns['hash']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['hash']['width']); ?>px; <?php if ($columns['hash']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='hash'><span class='overflow-text' title="<?php echo htmlentities($item['hash']); ?>"><?php echo htmlentities($item['hash']); ?></span></div><?php
											};
											$columns['hash']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='hash'
													data-order='<?php echo intval($columns['hash']['order']); ?>'
													data-width='<?php echo intval($columns['hash']['width']); ?>'
													data-collapsed='<?php echo intval($columns['hash']['collapsed']); ?>'
													style='width: <?php echo intval($columns['hash']['width']); ?>px; <?php if ($columns['hash']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									

									// sort by order
									uasort($columns, function ($a, $b) {
										return $a['order'] - $b['order'];
									});
									?>
									<style type='text/css'>
										#fop_fints_buchung-table .fop-table-header {
											height: <?php echo 32; ?>px;
										}
										#fop_fints_buchung-table .fop-table-header .fop-table-column .title,
										#fop_fints_buchung-table .fop-column-handle,
										#fop_fints_buchung-table .fop-table-row,
										#fop_fints_buchung-table .fop-table-row .fop-table-column,
										#fop_fints_buchung-table .fop-table-column-multicontrol,
										#fop_fints_buchung-table .fop-filter-button {
											height: 32px;
											line-height: 32px;
										}
										</style>
											<div class="fop-table" data-table-id="fop_fints_buchung">
											<div class="fop-legend"></div>
											<div class="fop-filter-string-wrapper"><div class="fop-filter-string"><label>Filter:</label> <span><?php echo self::getFilterHTML($_GET); ?></span></div></div>
											
											<?php if (isset($_GET['select'])) { echo '<br>'; } ?>
											<div class="fop-table-header">
											<?php if (!isset($_GET['select'])) { ?>
												<div class="fop-table-column noprint" style="width: <?php echo json_encode($firstColumnWidth); ?>px;">
													
													<div class="fop-table-column-multicontrol">
													<label class="mdl-checkbox mdl-js-checkbox"  style='width: auto;' for="fop_fints_buchung__all-checkbox">
														<input class="mdl-checkbox__input" id="fop_fints_buchung__all-checkbox" type="checkbox" onchange="checkfop_fints_buchung('all', 'ID', this.checked);">
														</label>
														<button type="button" class="mdl-button mdl-js-button mdl-button--icon fop_fints_buchung__mass-action" style='visibility: hidden;' onclick="$.get('DataView/Fop_fints_buchung/permissions?id=' + checkfop_fints_buchung(null, 'ID'), function (data) { for (var method in data) if (method != '__cnt') { var btn = $('[data-interaction-name=&quot;' + method + '&quot;]'); if (data[method] >= 1) btn.show(); else btn.hide(); btn.find('.cnt').text(data[method]); }; }); dropDownFixPosition($(this), $(this).next())">
															<i class="material-icons">more_vert</i>
														</button>
														<ul class="mdl-list mdl-card mdl-shadow--4dp fop-scroll-menu">
															<?php
		if(true) { ?>
			<span class="mdl-list__item mdl-button">
				<span class="mdl-list__item mdl-button" data-interaction-name="filterall" style="margin-right:auto; text-align:left;"
					onclick="for (key in query) if (key.indexOf('range_min_fop_fints_buchung_') == 0 || key.indexOf('range_max_fop_fints_buchung_') == 0 || key.indexOf('deps_fop_fints_buchung_') == 0 || key.indexOf('fullsearch_fop_fints_buchung_') == 0 || key.indexOf('dynamic_fop_fints_buchung_') == 0 || key.indexOf('search_fop_fints_buchung_') == 0 || key.indexOf('searchnot_fop_fints_buchung_') == 0 || key.indexOf('filter_fop_fints_buchung_') == 0) delete query[key]; reloadfop_fints_buchung(); $(this).closest('.overlay').click(); return false;">
					<span style="float:left;"><i class="material-icons">list</i></span><span class="fop-menu-caption" title="<?php echo(_('view all elements')); ?>"><?php echo(_('view all elements')); ?> 
					</span>
				</span>
			</span>
		<?php } ?><?php
		if(true) { ?>
			<span class="mdl-list__item mdl-button">
				<span class="mdl-list__item mdl-button" data-interaction-name="filteronly" style="margin-right:auto; text-align:left;"
					onclick="query['filter_fop_fints_buchung_ID'] = checkfop_fints_buchung(null, 'ID'); delete query['page_fop_fints_buchung']; reloadfop_fints_buchung(); $(this).closest('.overlay').click(); return false;">
					<span style="float:left;"><i class="material-icons">arrow_forward</i></span><span class="fop-menu-caption" title="<?php echo(_('view only these elements')); ?>"><?php echo(_('view only these elements')); ?> (<span class='cnt'></span>)
					</span>
				</span>
			</span>
		<?php } ?><?php
		if(true) { ?>
			<span class="mdl-list__item mdl-button">
				<span class="mdl-list__item mdl-button" data-interaction-name="filterrange" style="margin-right:auto; text-align:left;"
					onclick="
		var ticks = new IDList(checkfop_fints_buchung(null, 'ID'));
		var range = prompt('Bitte geben Sie den Bereich ein', '1-' + ticks.count());
		var newticks = new IDList();
		if (range) {
			range = range.split('-');
			if (range.length == 1) {
				range.push(range[0]);
			}
			var skip = (range[0] || 1) - 1;
			var take = (range[1] || Infinity) - skip;
			for (var item of ticks.all()) {
				if (skip > 0) {
					skip--;
				} else if (take > 0) {
					newticks.push(item);
					take--;
				} else break;
			}
			checkfop_fints_buchung(newticks, 'ID', 'set');
		} $(this).closest('.overlay').click(); return false;">
					<span style="float:left;"><i class="material-icons">colorize</i></span><span class="fop-menu-caption" title="<?php echo(_('limit range')); ?>"><?php echo(_('limit range')); ?> (<span class='cnt'></span>)
					</span>
				</span>
			</span>
		<?php } ?><?php
		if(true && ((\FOP\User::getBuchhaltung()) && (\FOP\User::getBuchhaltung()))) { ?>
			<span class="mdl-list__item mdl-button">
				<span class="mdl-list__item mdl-button" data-interaction-name="forderung_ignore" style="margin-right:auto; text-align:left;"
					onclick="location.href = 'Tables/Fop_fints_buchung/ignoreForderung?ajax&from=<?php echo urlencode(\FOP\Util::getBackUrl()); ?>&ids=' + escape(checkfop_fints_buchung(null, 'ID')); $(this).closest('.overlay').click(); return false;">
					<span style="float:left;"><i class="material-icons">visibility_off</i></span><span class="fop-menu-caption" title="<?php echo(_('Ignorieren')); ?>"><?php echo(_('Ignorieren')); ?> (<span class='cnt'></span>)
					</span>
				</span>
			</span>
		<?php } ?><?php
		if(true && ((false) && (\FOP\User::getBuchhaltung()) && (\FOP\User::getBuchhaltung()))) { ?>
			<span class="mdl-list__item mdl-button">
				<span class="mdl-list__item mdl-button" data-interaction-name="delete" style="margin-right:auto; text-align:left;"
					onclick="if(!confirm(<?php echo htmlentities(json_encode(_('confirmdelete'))); ?>)) return;$.get('Tables/Fop_fints_buchung/delete?ajax&from=<?php echo urlencode(\FOP\Util::getBackUrl()); ?>&id=' + escape(checkfop_fints_buchung(null, 'ID'))).then(function () { reloadfop_fints_buchung(); }, function (err) { if (err.responseText.startsWith('http')) { window.location.href = err.responseText; } else {alert(err.responseText); }}); $(this).closest('.overlay').click(); return false;">
					<span style="float:left;"><i class="material-icons">delete</i></span><span class="fop-menu-caption" title="<?php echo(_('delete')); ?>"><?php echo(_('delete')); ?> (<span class='cnt'></span>)
					</span>
				</span>
			</span>
		<?php } ?>
														</ul>
														<!-- column hide -->
														<button type="button" class="mdl-button mdl-js-button mdl-button--icon" onclick="dropDownFixPosition($(this), $(this).next())">
															<i class="material-icons">visibility</i>
														</button>
														<ul class="mdl-list mdl-card mdl-shadow--4dp fop-scroll-menu">
															<?php foreach ($columns AS $col) { ?>
																<li class="mdl-list__item mdl-button" onclick="
																	var isVisible = this.firstElementChild.innerText !== 'clear';
																	this.firstElementChild.innerText = isVisible ? 'clear' : 'visibility'; // switch icon
																	tableColumnVisibility('fop_fints_buchung', <?php echo htmlentities(json_encode($col['id'])); ?>, !isVisible); // the rest is up to a helper function in layout/tables.fop
																	">
																	<i class="material-icons"><?php if ($col['collapsed']) { echo 'clear'; } else { echo 'visibility'; }?></i>
																	<?php echo htmlentities($col['desc']); ?>
																</li>
															<?php } ?>
															<li class="mdl-list__item mdl-button" onclick="
																$.get('FOP/Index/dataview?data='+encodeURIComponent(JSON.stringify({dataview: 'fop_fints_buchung', reset: true}))).then(function () { location.reload(); });
																">
																<i class="material-icons">refresh</i>
																<?php echo _('reset all'); ?>
															</li>
														</ul>
													</div>
												</div><?php }
												
												foreach ($columns AS $col) {
													// Spalten-Überschrift rendern
													echo $col['header'];
												} ?>
											 </div>
											
											<div class="fop-table-body" id="table_fop_fints_buchung" <?php \EasyEditor\Navigation::printScroll('dv.Fop_fints_buchung', '/* scroll horiz */ this.nextElementSibling.firstElementChild.style.marginLeft = this.previousElementSibling.firstElementChild.style.marginLeft = \'-\' + this.scrollLeft + \'px\';
												/* scroll verti */
												var self = this;
												if (window.DataViewScrollReloadTimeout) clearTimeout(window.DataViewScrollReloadTimeout);
												window.DataViewScrollReloadTimeout = setTimeout(function () {
													var currentPage = parseInt(query[\'page_fop_fints_buchung\'] || 0);
													var paddingTop = parseInt( self.lastElementChild.style.paddingTop, 10);
													var wantedPage = Math.max(0, currentPage + Math.floor((self.scrollTop - paddingTop) / ' . ($itemheight * $itemsperpage) . '));
													if (wantedPage != currentPage) {
														query[\'page_fop_fints_buchung\'] = wantedPage;
														reloadfop_fints_buchung(undefined, undefined, true);
													}
												}, 50);
											'); ?>>
												<div class="fop-table-body-inner" style="min-height: <?php echo 12 + $itemheight * ($itemcount + $additionalLines); ?>px; padding-top: <?php echo $itemheight * $itemsperpage * $page; ?>px;">
												<?php foreach($arr as $itempos => $item) {
													
													if ($itempos != 0) $checkAggregates(null, $item);?>
													<div class="fop-table-row" style="" data-fop_fints_buchung-id="<?php echo htmlentities($item['ID']); ?>"<?php if (isset($item['ID'])){
														if (isset($_GET['select']) && isset($_GET['from'])) {
															echo 'onclick="event.preventDefault(); if (!window.getSelection().toString()) window.location.href=' . htmlentities(json_encode($_GET['from'] . '&colvalue=' . urlencode($item['ID']))) . ';" ';
														} else {
															echo 'onclick="event.preventDefault(); if (!window.getSelection().toString()) open_url(reloadfop_fints_buchung({action: \'open\', fop_table: \'fop_fints_buchung\', fop_id: ' .  htmlentities(json_encode($item['ID'])) . ', fop_from: location.href}, true), false);"';
														}
													}?> >

													<?php if (!isset($_GET['select'])) { ?>
													<div class='fop-table-column noprint' style="width: <?php echo json_encode($firstColumnWidth); ?>px;" onclick="$(this).find('input[type=checkbox]').first().click(); event.stopPropagation();">
													<label onclick="event.stopPropagation();" class="mdl-checkbox mdl-js-checkbox fop_fints_buchung__checkbox fop_fints_buchung__checkbox fop_fints_buchung__checkbox-ID-<?php echo htmlentities($item['ID']); ?>" style="width: auto;" for="fop_fints_buchung__<?php echo htmlentities($itempos); ?>-checkbox">
													<input class="mdl-checkbox__input" id="fop_fints_buchung__<?php echo htmlentities($itempos); ?>-checkbox" type="checkbox" onchange="<?php if (isset($item['ID'])) echo 'checkfop_fints_buchung(' . htmlentities(json_encode($item['ID'])) . ', \'ID\', this.checked); ' ?>">
													</label><button type="button" class="mdl-button mdl-js-button mdl-button--icon fop_fints_buchung__action" onclick="
														event.stopPropagation();
														dropDownFixPosition($(this), $(this).next());
														">
														<i class="material-icons">more_vert</i>
													</button><ul class="mdl-list mdl-card mdl-shadow--4dp fop-scroll-menu" id="fop-scroll-menu-fop_fints_buchung-action-<?php echo $item['ID'] ?? 0; ?>">
														<?php
		if(isset($item['ID']) && $item['operation::view']) { ?>
			<a class="mdl-list__item mdl-button" data-interaction-name="view" style="margin-right:auto; text-align:left;" href="<?php echo htmlentities(\TablesRouter\Fop_fints_buchung::viewURL($item['ID'], ['from' => \FOP\Util::getBackUrl()])); ?>"
				onclick=" if (!event.ctrlKey) { open_url(reloadfop_fints_buchung({action: 'open', fop_table: 'fop_fints_buchung', fop_id: <?php echo htmlentities(json_encode($item['ID'])); ?>, fop_from: location.href}, true), false); return false; } $(this).closest('.overlay').click(); return false;  
					open_url(this.href, false);
					$(this).closest('.overlay').click();
					return false;">
				<span><i class="material-icons">find_in_page</i></span><span class="fop-menu-caption" title="<?php echo(_('open')); ?>"><?php echo(_('open')); ?></span>
			</a>
		<?php } ?><?php
		if(isset($item['ID']) && $item['operation::view'] && $item['operation::edit']) { ?>
			<a class="mdl-list__item mdl-button" data-interaction-name="edit" style="margin-right:auto; text-align:left;" href="<?php echo htmlentities(\TablesRouter\Fop_fints_buchung::editURL($item['ID'], ['from' => \FOP\Util::getBackUrl()])); ?>"
				onclick="   
					open_url(this.href, false);
					$(this).closest('.overlay').click();
					return false;">
				<span><i class="material-icons">edit</i></span><span class="fop-menu-caption" title="<?php echo(_('edit')); ?>"><?php echo(_('edit')); ?></span>
			</a>
		<?php } ?><?php
		if(isset($item['ID']) && $item['operation::view']) { ?>
			<a class="mdl-list__item mdl-button" data-interaction-name="forderung_ignore" style="margin-right:auto; text-align:left;" href="<?php echo htmlentities(\TablesRouter\Fop_fints_buchung::ignoreForderungURL2(['ids' => $item['ID'], 'from' => \FOP\Util::getBackUrl()])); ?>"
				onclick="   
					open_url(this.href, false);
					$(this).closest('.overlay').click();
					return false;">
				<span><i class="material-icons">visibility_off</i></span><span class="fop-menu-caption" title="<?php echo(_('Ignorieren')); ?>"><?php echo(_('Ignorieren')); ?></span>
			</a>
		<?php } ?><?php
		if(isset($item['ID']) && $item['operation::view']) { ?>
			<a class="mdl-list__item mdl-button" data-interaction-name="to_mitglied" style="margin-right:auto; text-align:left;" href="<?php echo htmlentities(\TablesRouter\Mitglied::assignIbanURL2(['buchung' => $item['ID'], 'from' => \FOP\Util::getBackUrl()])); ?>"
				onclick="   
					open_url(this.href, false);
					$(this).closest('.overlay').click();
					return false;">
				<span><i class="material-icons">shuffle</i></span><span class="fop-menu-caption" title="<?php echo(_('Mitglied zuordnen')); ?>"><?php echo(_('Mitglied zuordnen')); ?></span>
			</a>
		<?php } ?><?php
		if(isset($item['ID']) && (!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest()) && ((\FOP\User::getBuchhaltung()) && (\FOP\User::getGruppe())) && (!\FOP\User::getIsGuest())) { ?>
			<a class="mdl-list__item mdl-button" data-interaction-name="to_single" style="margin-right:auto; text-align:left;" href="<?php echo htmlentities(\TablesRouter\MitgliedBuchung::createURL2(['buchung' => $item['ID'], 'from' => \FOP\Util::getBackUrl()])); ?>"
				onclick="   
					open_url(this.href, false);
					$(this).closest('.overlay').click();
					return false;">
				<span><i class="material-icons">arrow_forward</i></span><span class="fop-menu-caption" title="<?php echo(_('Einzelbuchung')); ?>"><?php echo(_('Einzelbuchung')); ?></span>
			</a>
		<?php } ?><?php
		if(isset($item['ID']) && $item['operation::delete']) { ?>
			<a class="mdl-list__item mdl-button" data-interaction-name="delete" style="margin-right:auto; text-align:left;" href="#"
				onclick="if(!confirm(<?php echo htmlentities(json_encode(_('confirmdelete'))); ?>)) return false;   $.get('Tables/Fop_fints_buchung/delete?ajax&id=<?php echo htmlentities($item['ID']);?>&from=<?php echo htmlentities(\FOP\Util::getBackUrl());?>').then(function () { reloadfop_fints_buchung(); }, function (err) { if (err.responseText.startsWith('http')) { window.location.href = err.responseText; } else {alert(err.responseText); }}); $(this).closest('.overlay').click(); return false;
					open_url(this.href, false);
					$(this).closest('.overlay').click();
					return false;">
				<span><i class="material-icons">delete</i></span><span class="fop-menu-caption" title="<?php echo(_('delete')); ?>"><?php echo(_('delete')); ?></span>
			</a>
		<?php } ?>
													</ul><?php
		if(isset($item['ID']) && $item['operation::view'] && $item['operation::edit']) {
			?><a class="mdl-button mdl-js-button mdl-button--icon tbl-link" data-tbl="fop_fints_buchung" data-id="<?php echo htmlentities($item['ID']); ?>" data-interaction-name="edit" href="<?php echo htmlentities(\TablesRouter\Fop_fints_buchung::editURL($item['ID'], ['from' => \FOP\Util::getBackUrl()])); ?>"
				onclick="event.stopPropagation();    reloadfop_fints_buchung();
					$(this).closest('.overlay').click();
					if (this.href != '#') {
						open_url(this.href, false);
					}
					event.preventDefault();"
				title="<?php echo(_('edit')); ?>">
				<i class="material-icons">edit</i>
			</a><?php } ?><?php
		if(isset($item['ID']) && $item['operation::view']) {
			?><a class="mdl-button mdl-js-button mdl-button--icon tbl-link" data-tbl="fop_fints_buchung" data-id="<?php echo htmlentities($item['ID']); ?>" data-interaction-name="view" href="<?php echo htmlentities(\TablesRouter\Fop_fints_buchung::viewURL($item['ID'], ['from' => \FOP\Util::getBackUrl()])); ?>"
				onclick="event.stopPropagation();  if (!event.ctrlKey) { open_url(reloadfop_fints_buchung({action: 'open', fop_table: 'fop_fints_buchung', fop_id: <?php echo htmlentities(json_encode($item['ID'])); ?>, fop_from: location.href}, true), false); return false; }  reloadfop_fints_buchung();
					$(this).closest('.overlay').click();
					if (this.href != '#') {
						open_url(this.href, false);
					}
					event.preventDefault();"
				title="<?php echo(_('open')); ?>">
				<i class="material-icons">find_in_page</i>
			</a><?php } ?>
													</div><?php } ?><?php
													
													foreach ($columns AS $col) {
														$col['render']($item);
													}
													?></div>
												 <?php }
												$checkAggregates(null, null);?>

													</div>
												</div>
												<?php
												// allerletzte Zeile
												$renderAggregateRow($data['aggregate']);
												?>

												
												
												</div><?php
												
	
    
  }

  public static function getidsAction($col) { 
    
    
    // --- BLOCK: access ---
    
    // --- BLOCK: main ---
    
			$q = \FOP\Database::query('SELECT t.'.qi($col).' '.self::getSQL($_GET));
			$result = new \FOP\IDList();
			while ($item = $q->fetchColumn()) {
				$result->push($item);
			}
			die($result->toString());

    
  }

  public static function permissionsAction($id) { 
    
    
    // --- BLOCK: access ---
    
    // --- BLOCK: main ---
    
		$ids = new \FOP\IDList($id);
		header('Content-Type: application/json');
		
		$perms = \FOP\Database::query('SELECT COUNT(*) AS __cnt, SUM(CASE (('.\FOP\Database::quote(\FOP\User::getBuchhaltung()).') AND (COALESCE((SELECT ('.\FOP\Database::quote(\FOP\User::getBuchhaltung()).') FROM '.qi('fop_fints_konto').' '.qi('ztZvmiXX').' WHERE '.qi('ztZvmiXX').'.'.qi('ID').' = '.qi('fop_fints_buchung').'.'.qi('konto').' LIMIT 1), FALSE)) AND ('.\FOP\Database::quote(\FOP\User::getBuchhaltung()).')) WHEN TRUE THEN 1 ELSE 0 END) AS '.qi('forderung_ignore').', SUM(CASE (TRUE) WHEN TRUE THEN 1 ELSE 0 END) AS '.qi('filteronly').', SUM(CASE (TRUE) WHEN TRUE THEN 1 ELSE 0 END) AS '.qi('filterrange').', SUM(CASE (TRUE) WHEN TRUE THEN 1 ELSE 0 END) AS '.qi('filterall').', SUM(CASE ((FALSE) AND ('.\FOP\Database::quote(\FOP\User::getBuchhaltung()).') AND (COALESCE((SELECT ('.\FOP\Database::quote(\FOP\User::getBuchhaltung()).') FROM '.qi('fop_fints_konto').' '.qi('vBKfwiB4').' WHERE '.qi('vBKfwiB4').'.'.qi('ID').' = '.qi('fop_fints_buchung').'.'.qi('konto').' LIMIT 1), FALSE)) AND ('.\FOP\Database::quote(\FOP\User::getBuchhaltung()).')) WHEN TRUE THEN 1 ELSE 0 END) AS '.qi('delete').' FROM '.qi('fop_fints_buchung').' WHERE ' . $ids->toSQL(qi('ID')))->fetch(\PDO::FETCH_ASSOC);
		
		return $perms;
	
    
  }

  public static function getSQL($params) { 
    
    
    // --- BLOCK: dependency-fop_fints_buchung ---
    
		if (isset($params['select']) && $params['select'] == 'fop_fints_buchung') {
			$deps = [];
		}
	
    // --- BLOCK: main ---
    
								// returns a sql snippet 'FROM (...) AS t WHERE' where you can prepend your select clauses and append your ORDER LIMIT
								$sql = 'FROM (SELECT /* ID */ '.qi('ID').' AS '.qi('ID').',
									/* bdate */ '.qi('bdate').' AS '.qi('bdate').',
									/* betrag */ '.qi('betrag').' AS '.qi('betrag').',
									/* date */ '.qi('date').' AS '.qi('date').',
									/* endtoend */ '.qi('endtoend').' AS '.qi('endtoend').',
									/* forderungDone */ '.qi('forderungDone').' AS '.qi('forderungDone').',
									/* hash */ '.qi('hash').' AS '.qi('hash').',
									/* iban */ '.qi('iban').' AS '.qi('iban').',
									/* konto */ '.qi('konto').' AS '.qi('konto').',
									/* konto::canView */ '.qi('ref:konto').'.'.qi('konto:canView').' AS '.qi('konto::canView').',
									/* konto::description */ '.qi('ref:konto').'.'.qi('konto:description').' AS '.qi('konto::description').',
									/* name_firma */ '.qi('name_firma').' AS '.qi('name_firma').',
									/* operation::create */ (FALSE) AND ('.\FOP\Database::quote(\FOP\User::getBuchhaltung()).') AND (COALESCE((SELECT ('.\FOP\Database::quote(\FOP\User::getBuchhaltung()).') FROM '.qi('fop_fints_konto').' '.qi('2ZJnnPGF').' WHERE '.qi('2ZJnnPGF').'.'.qi('ID').' = '.qi('fop_fints_buchung').'.'.qi('konto').' LIMIT 1), FALSE)) AND ('.\FOP\Database::quote(\FOP\User::getBuchhaltung()).') AS '.qi('operation::create').',
									/* operation::delete */ (FALSE) AND ('.\FOP\Database::quote(\FOP\User::getBuchhaltung()).') AND (COALESCE((SELECT ('.\FOP\Database::quote(\FOP\User::getBuchhaltung()).') FROM '.qi('fop_fints_konto').' '.qi('vBKfwiB4').' WHERE '.qi('vBKfwiB4').'.'.qi('ID').' = '.qi('fop_fints_buchung').'.'.qi('konto').' LIMIT 1), FALSE)) AND ('.\FOP\Database::quote(\FOP\User::getBuchhaltung()).') AS '.qi('operation::delete').',
									/* operation::edit */ ('.\FOP\Database::quote(\FOP\User::getBuchhaltung()).') AND (COALESCE((SELECT ('.\FOP\Database::quote(\FOP\User::getBuchhaltung()).') FROM '.qi('fop_fints_konto').' '.qi('56VmsVdP').' WHERE '.qi('56VmsVdP').'.'.qi('ID').' = '.qi('fop_fints_buchung').'.'.qi('konto').' LIMIT 1), FALSE)) AND ('.\FOP\Database::quote(\FOP\User::getBuchhaltung()).') AS '.qi('operation::edit').',
									/* operation::index */ ' . (!\FOP\User::getIsGuest() ? 1 : 0) . ' AS '.qi('operation::index').',
									/* operation::view */ ('.\FOP\Database::quote(\FOP\User::getBuchhaltung()).') AND (COALESCE((SELECT ('.\FOP\Database::quote(\FOP\User::getBuchhaltung()).') FROM '.qi('fop_fints_konto').' '.qi('ztZvmiXX').' WHERE '.qi('ztZvmiXX').'.'.qi('ID').' = '.qi('fop_fints_buchung').'.'.qi('konto').' LIMIT 1), FALSE)) AND ('.\FOP\Database::quote(\FOP\User::getBuchhaltung()).') AS '.qi('operation::view').',
									/* saldo */ '.qi('saldo').' AS '.qi('saldo').',
									/* umsatzart */ '.qi('umsatzart').' AS '.qi('umsatzart').',
									/* vzweck */ '.qi('vzweck').' AS '.qi('vzweck').',
									1
								FROM '.qi('fop_fints_buchung').' '.qi('fop_fints_buchung').'
								LEFT JOIN (SELECT '.qi('ID').' AS '.qi('konto:ID').', '.qi('fop_fints_konto').'.'.qi('kontoname').' AS '.qi('konto:description').', (('.\FOP\Database::quote(\FOP\User::getBuchhaltung()).')) AS '.qi('konto:canView').' FROM '.qi('fop_fints_konto').') '.qi('ref:konto').' ON '.qi('ref:konto').'.'.qi('konto:ID').' = '.qi('konto').'
								WHERE ((('.\FOP\Database::quote(\FOP\User::getBuchhaltung()).') AND (COALESCE((SELECT ('.\FOP\Database::quote(\FOP\User::getBuchhaltung()).') FROM '.qi('fop_fints_konto').' '.qi('ztZvmiXX').' WHERE '.qi('ztZvmiXX').'.'.qi('ID').' = '.qi('fop_fints_buchung').'.'.qi('konto').' LIMIT 1), FALSE)) AND ('.\FOP\Database::quote(\FOP\User::getBuchhaltung()).')))
									AND (' . (isset($_GET['select']) && $_GET['select'] == 'fop_fints_buchung' ? 'TRUE' : 'TRUE') . ')) AS t
								WHERE ' . (isset($params['range_min_fop_fints_buchung_betrag']) ? ($params['range_min_fop_fints_buchung_betrag'] !== '' && is_numeric($params['range_min_fop_fints_buchung_betrag']) ? 't.'.qi('betrag').' >= ' . \FOP\Database::quote($params['range_min_fop_fints_buchung_betrag']) . ' AND ' : '') : '') . 
								(isset($params['range_min_fop_fints_buchung_saldo']) ? ($params['range_min_fop_fints_buchung_saldo'] !== '' && is_numeric($params['range_min_fop_fints_buchung_saldo']) ? 't.'.qi('saldo').' >= ' . \FOP\Database::quote($params['range_min_fop_fints_buchung_saldo']) . ' AND ' : '') : '') . 
								(isset($params['range_min_fop_fints_buchung_bdate']) ? ($params['range_min_fop_fints_buchung_bdate'] !== '' && is_numeric($params['range_min_fop_fints_buchung_bdate']) ? 't.'.qi('bdate').' >= ' . \FOP\Database::quote($params['range_min_fop_fints_buchung_bdate']) . ' AND ' : '') : '') . 
								(isset($params['range_min_fop_fints_buchung_date']) ? ($params['range_min_fop_fints_buchung_date'] !== '' && is_numeric($params['range_min_fop_fints_buchung_date']) ? 't.'.qi('date').' >= ' . \FOP\Database::quote($params['range_min_fop_fints_buchung_date']) . ' AND ' : '') : '') . 
								(isset($params['range_max_fop_fints_buchung_betrag']) ? ($params['range_max_fop_fints_buchung_betrag'] !== '' && is_numeric($params['range_max_fop_fints_buchung_betrag']) ? 't.'.qi('betrag').' <= ' . \FOP\Database::quote($params['range_max_fop_fints_buchung_betrag']) . ' AND ' : '') : '') . 
								(isset($params['range_max_fop_fints_buchung_saldo']) ? ($params['range_max_fop_fints_buchung_saldo'] !== '' && is_numeric($params['range_max_fop_fints_buchung_saldo']) ? 't.'.qi('saldo').' <= ' . \FOP\Database::quote($params['range_max_fop_fints_buchung_saldo']) . ' AND ' : '') : '') . 
								(isset($params['range_max_fop_fints_buchung_bdate']) ? ($params['range_max_fop_fints_buchung_bdate'] !== '' && is_numeric($params['range_max_fop_fints_buchung_bdate']) ? 't.'.qi('bdate').' <= ' . \FOP\Database::quote($params['range_max_fop_fints_buchung_bdate']) . ' AND ' : '') : '') . 
								(isset($params['range_max_fop_fints_buchung_date']) ? ($params['range_max_fop_fints_buchung_date'] !== '' && is_numeric($params['range_max_fop_fints_buchung_date']) ? 't.'.qi('date').' <= ' . \FOP\Database::quote($params['range_max_fop_fints_buchung_date']) . ' AND ' : '') : '') . 
								(isset($params['filter_fop_fints_buchung_forderungDone']) ? ($params['filter_fop_fints_buchung_forderungDone'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_fints_buchung_forderungDone']))->toSQL('t.'.qi('forderungDone').'') . ') AND ') : '') : '') . 
								(isset($params['filter_fop_fints_buchung_konto']) ? ($params['filter_fop_fints_buchung_konto'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_fints_buchung_konto']))->toSQL('t.'.qi('konto').'') . ') AND ') : '') : '') . 
								(isset($params['filter_fop_fints_buchung_bdate']) ? ($params['filter_fop_fints_buchung_bdate'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_fints_buchung_bdate']))->toSQL('t.'.qi('bdate').'') . ') AND ') : '') : '') . 
								(isset($params['filter_fop_fints_buchung_date']) ? ($params['filter_fop_fints_buchung_date'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_fints_buchung_date']))->toSQL('t.'.qi('date').'') . ') AND ') : '') : '') . 
								(isset($params['filter_fop_fints_buchung_betrag']) ? ($params['filter_fop_fints_buchung_betrag'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_fints_buchung_betrag']))->toSQL('t.'.qi('betrag').'') . ') AND ') : '') : '') . 
								(isset($params['filter_fop_fints_buchung_saldo']) ? ($params['filter_fop_fints_buchung_saldo'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_fints_buchung_saldo']))->toSQL('t.'.qi('saldo').'') . ') AND ') : '') : '') . 
								(isset($params['filter_fop_fints_buchung_iban']) ? ($params['filter_fop_fints_buchung_iban'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_fints_buchung_iban']))->toSQL('t.'.qi('iban').'') . ') AND ') : '') : '') . 
								(isset($params['filter_fop_fints_buchung_name_firma']) ? ($params['filter_fop_fints_buchung_name_firma'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_fints_buchung_name_firma']))->toSQL('t.'.qi('name_firma').'') . ') AND ') : '') : '') . 
								(isset($params['filter_fop_fints_buchung_vzweck']) ? ($params['filter_fop_fints_buchung_vzweck'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_fints_buchung_vzweck']))->toSQL('t.'.qi('vzweck').'') . ') AND ') : '') : '') . 
								(isset($params['filter_fop_fints_buchung_endtoend']) ? ($params['filter_fop_fints_buchung_endtoend'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_fints_buchung_endtoend']))->toSQL('t.'.qi('endtoend').'') . ') AND ') : '') : '') . 
								(isset($params['filter_fop_fints_buchung_umsatzart']) ? ($params['filter_fop_fints_buchung_umsatzart'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_fints_buchung_umsatzart']))->toSQL('t.'.qi('umsatzart').'') . ') AND ') : '') : '') . 
								(isset($params['filter_fop_fints_buchung_hash']) ? ($params['filter_fop_fints_buchung_hash'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_fints_buchung_hash']))->toSQL('t.'.qi('hash').'') . ') AND ') : '') : '') . 
								(isset($params['filter_fop_fints_buchung_ID']) ? ($params['filter_fop_fints_buchung_ID'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_fints_buchung_ID']))->toSQL('t.'.qi('ID').'') . ') AND ') : '') : '') . 
								(isset($params['search_fop_fints_buchung_iban']) ? 't.'.qi('iban').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_fop_fints_buchung_iban'] . '%') . ' AND ' : '') . 
								(isset($params['search_fop_fints_buchung_name_firma']) ? 't.'.qi('name_firma').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_fop_fints_buchung_name_firma'] . '%') . ' AND ' : '') . 
								(isset($params['search_fop_fints_buchung_vzweck']) ? 't.'.qi('vzweck').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_fop_fints_buchung_vzweck'] . '%') . ' AND ' : '') . 
								(isset($params['search_fop_fints_buchung_endtoend']) ? 't.'.qi('endtoend').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_fop_fints_buchung_endtoend'] . '%') . ' AND ' : '') . 
								(isset($params['search_fop_fints_buchung_umsatzart']) ? 't.'.qi('umsatzart').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_fop_fints_buchung_umsatzart'] . '%') . ' AND ' : '') . 
								(isset($params['search_fop_fints_buchung_hash']) ? 't.'.qi('hash').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_fop_fints_buchung_hash'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_fop_fints_buchung_iban']) ? 'NOT t.'.qi('iban').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_fop_fints_buchung_iban'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_fop_fints_buchung_name_firma']) ? 'NOT t.'.qi('name_firma').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_fop_fints_buchung_name_firma'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_fop_fints_buchung_vzweck']) ? 'NOT t.'.qi('vzweck').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_fop_fints_buchung_vzweck'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_fop_fints_buchung_endtoend']) ? 'NOT t.'.qi('endtoend').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_fop_fints_buchung_endtoend'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_fop_fints_buchung_umsatzart']) ? 'NOT t.'.qi('umsatzart').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_fop_fints_buchung_umsatzart'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_fop_fints_buchung_hash']) ? 'NOT t.'.qi('hash').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_fop_fints_buchung_hash'] . '%') . ' AND ' : '') . 
								(isset($params['search_fop_fints_buchung']) ? '(' . 't.'.qi('iban').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_fop_fints_buchung'] . '%') . ' OR ' . 't.'.qi('name_firma').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_fop_fints_buchung'] . '%') . ' OR ' . 't.'.qi('vzweck').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_fop_fints_buchung'] . '%') . ' OR ' . 't.'.qi('endtoend').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_fop_fints_buchung'] . '%') . ' OR ' . 't.'.qi('umsatzart').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_fop_fints_buchung'] . '%') . ' OR ' . 't.'.qi('hash').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_fop_fints_buchung'] . '%') . ') AND ' : '') . 
								'
								 TRUE ';
								return $sql;
	
    
  }

  public static function getfilter_fop_fints_buchung_kontoItemsByStringAction($fstr) { 
    
    
    // --- BLOCK: access ---
    
    // --- BLOCK: main ---
    
		// Auf aktive DataView-Items einschränken
		$params = $_GET;
		unset($params['filter_fop_fints_buchung_konto']);
		return \Types\Fop_fints_konto::getItems(null, -1, $fstr, ''.qi('ID').' IN (SELECT DISTINCT t.'.qi('konto').''.self::getSQL($params).')');
	

    
  }

  public static function getData($sqladdon, $params, $stream = false ) { 
    
    
    // --- BLOCK: main ---
    
								$sql = self::getSQL($params);

								$order = (\FOP\Util::array_value(array(
									'name_firma ASC' => 'ORDER BY t.'.qi('name_firma').' ASC',
									'vzweck ASC' => 'ORDER BY t.'.qi('vzweck').' ASC',
									'endtoend ASC' => 'ORDER BY t.'.qi('endtoend').' ASC',
									'umsatzart ASC' => 'ORDER BY t.'.qi('umsatzart').' ASC',
									'hash ASC' => 'ORDER BY t.'.qi('hash').' ASC',
									'iban ASC' => 'ORDER BY t.'.qi('iban').' ASC',
									'betrag ASC' => 'ORDER BY t.'.qi('betrag').' ASC',
									'saldo ASC' => 'ORDER BY t.'.qi('saldo').' ASC',
									'bdate ASC' => 'ORDER BY t.'.qi('bdate').' ASC',
									'date ASC' => 'ORDER BY t.'.qi('date').' ASC',
									'name_firma DESC' => 'ORDER BY t.'.qi('name_firma').' DESC',
									'vzweck DESC' => 'ORDER BY t.'.qi('vzweck').' DESC',
									'endtoend DESC' => 'ORDER BY t.'.qi('endtoend').' DESC',
									'umsatzart DESC' => 'ORDER BY t.'.qi('umsatzart').' DESC',
									'hash DESC' => 'ORDER BY t.'.qi('hash').' DESC',
									'iban DESC' => 'ORDER BY t.'.qi('iban').' DESC',
									'betrag DESC' => 'ORDER BY t.'.qi('betrag').' DESC',
									'saldo DESC' => 'ORDER BY t.'.qi('saldo').' DESC',
									'bdate DESC' => 'ORDER BY t.'.qi('bdate').' DESC',
									'date DESC' => 'ORDER BY t.'.qi('date').' DESC',
									'' => ''), isset($params['sort_fop_fints_buchung']) ? $params['sort_fop_fints_buchung'] : '') ?: 'ORDER BY '.qi('t').'.'.qi('bdate').' DESC, '.qi('t').'.'.qi('ID').' DESC');
								// wenn sqladdon bereits ein ORDER enthält, kein order aufbauen
								if (strpos($sqladdon, 'ORDER') !== false) {
									$order = '';
								}
								if ($stream) {
									// als Stream (währenddessen darf keine weitere SQL-Query laufen) für große Datenmengen und Statistiken
									$result = (function () use ($sql, $order, $sqladdon) {
										$stream = \FOP\Database::query('SELECT t.* ' . $sql . $order . $sqladdon);
										while ($item = $stream->fetch(\PDO::FETCH_ASSOC)) {
											$item['forderungDone'] = \FOP\Util::BoolSanitizer($item['forderungDone']);
											$item['konto'] = \FOP\Sanitizers::null_converter($item['konto']);
											$item['bdate'] = intval($item['bdate']);
											$item['date'] = intval($item['date']);
											$item['betrag'] = \Types\Euro::unpack($item['betrag']);
											$item['saldo'] = \Types\Euro::unpack($item['saldo']);
											$item['iban'] = \FOP\Sanitizers::a_text($item['iban']);
											
											yield $item;
										}
									})();
								} else {
									// als RAM-Array
									$result = \FOP\Database::query('SELECT t.* ' . $sql . $order . $sqladdon);
									$arr = $result->fetchAll(\PDO::FETCH_ASSOC);
									$itemcount = count($arr);

									foreach($arr as $i => &$item){
										$item['forderungDone'] = \FOP\Util::BoolSanitizer($item['forderungDone']);
										$item['konto'] = \FOP\Sanitizers::null_converter($item['konto']);
										$item['bdate'] = intval($item['bdate']);
										$item['date'] = intval($item['date']);
										$item['betrag'] = \Types\Euro::unpack($item['betrag']);
										$item['saldo'] = \Types\Euro::unpack($item['saldo']);
										$item['iban'] = \FOP\Sanitizers::a_text($item['iban']);
										
									}
									unset($item);

									$result = ["items" => $arr, "itemcount" => $itemcount];

									
										$result['aggregate'] = \FOP\Database::query('SELECT COUNT(*) AS '.qi('::cnt').', SUM(t.'.qi('betrag').') AS '.qi('betrag').' ' . $sql)->fetch(\PDO::FETCH_ASSOC);
										$result['aggregate']['betrag'] = \Types\Euro::unpack($result['aggregate']['betrag']);
										
									
								}

								return $result;
	
    
  }

  public static function getFilterHTML($params, $delimiter = ', ' , $showButton = true ) { 
    
    
    // --- BLOCK: main ---
    
		// Contract: ist showButton == false, sollten keine HTML-Tags im Output enthalten sein (Verwendung in Dateinamen!!)
		$filters = [];
		
	if (isset($params['range_min_fop_fints_buchung_betrag']) && isset($params['range_max_fop_fints_buchung_betrag'])) {
		array_push($filters, _('Betrag') . ': ' . (\Types\Euro::print($params['range_min_fop_fints_buchung_betrag']) .  ' €'
	) . ' ' . _('filters_between') . ' ' . (\Types\Euro::print($params['range_max_fop_fints_buchung_betrag']) .  ' €'
	));
	} else if (isset($params['range_min_fop_fints_buchung_betrag'])) {
		array_push($filters, _('Betrag') . ': ' . _('filters_from') . ' ' . (\Types\Euro::print($params['range_min_fop_fints_buchung_betrag']) .  ' €'
	));
	} else if (isset($params['range_max_fop_fints_buchung_betrag'])) {
		array_push($filters, _('Betrag') . ': ' . _('filters_to') . ' ' . (\Types\Euro::print($params['range_max_fop_fints_buchung_betrag']) .  ' €'
	));
	}
	if (isset($params['range_min_fop_fints_buchung_saldo']) && isset($params['range_max_fop_fints_buchung_saldo'])) {
		array_push($filters, _('Saldo') . ': ' . (\Types\Euro::print($params['range_min_fop_fints_buchung_saldo']) .  ' €'
	) . ' ' . _('filters_between') . ' ' . (\Types\Euro::print($params['range_max_fop_fints_buchung_saldo']) .  ' €'
	));
	} else if (isset($params['range_min_fop_fints_buchung_saldo'])) {
		array_push($filters, _('Saldo') . ': ' . _('filters_from') . ' ' . (\Types\Euro::print($params['range_min_fop_fints_buchung_saldo']) .  ' €'
	));
	} else if (isset($params['range_max_fop_fints_buchung_saldo'])) {
		array_push($filters, _('Saldo') . ': ' . _('filters_to') . ' ' . (\Types\Euro::print($params['range_max_fop_fints_buchung_saldo']) .  ' €'
	));
	}
	
	if ( // Corner Case: Monat
		isset($params['range_min_fop_fints_buchung_bdate'])
		&& isset($params['range_max_fop_fints_buchung_bdate'])
		&& (date('d', $params['range_min_fop_fints_buchung_bdate']) == '01') //check first day of month
		&& (date('d', $params['range_max_fop_fints_buchung_bdate']) == date('t', $params['range_max_fop_fints_buchung_bdate'])) //check last day of month
		&& (date('Y-m', $params['range_min_fop_fints_buchung_bdate']) == date('Y-m', $params['range_max_fop_fints_buchung_bdate'])) //check if same year and month
	) {
		array_push($filters, [
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_fop_fints_buchung_bdate&apos;] = &apos;'.strtotime('first day of last month', $params['range_min_fop_fints_buchung_bdate']).'&apos;;
				query[&apos;range_max_fop_fints_buchung_bdate&apos;] = &apos;'.strtotime('last day of last month', $params['range_min_fop_fints_buchung_bdate']).'&apos;;
				reloadfop_fints_buchung(); ">remove_circle_outline</i>' : ''),
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_fop_fints_buchung_bdate&apos;] = &apos;'.strtotime('first day of next month', $params['range_min_fop_fints_buchung_bdate']).'&apos;;
				query[&apos;range_max_fop_fints_buchung_bdate&apos;] = &apos;'.strtotime('last day of next month', $params['range_min_fop_fints_buchung_bdate']).'&apos;;
				reloadfop_fints_buchung(); ">add_circle_outline</i>' : ''),
			htmlentities(_('Buchungsdatum') . ': ' . strftime('%B', $params['range_min_fop_fints_buchung_bdate']) . ' ' . date('Y', $params['range_min_fop_fints_buchung_bdate']))
		]);
	} else if ( // Corner Case: Tag
		isset($params['range_min_fop_fints_buchung_bdate'])
		&& isset($params['range_max_fop_fints_buchung_bdate'])
		&& (date('Y-m-d', $params['range_min_fop_fints_buchung_bdate']) == (date('Y-m-d', $params['range_max_fop_fints_buchung_bdate'])))
	) {
		array_push($filters, [
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_fop_fints_buchung_bdate&apos;] = &apos;'.strtotime('last day', $params['range_min_fop_fints_buchung_bdate']).'&apos;;
				query[&apos;range_max_fop_fints_buchung_bdate&apos;] = &apos;'.strtotime('last day', $params['range_min_fop_fints_buchung_bdate']).'&apos;;
				reloadfop_fints_buchung(); ">remove_circle_outline</i>' : ''),
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_fop_fints_buchung_bdate&apos;] = &apos;'.strtotime('next day', $params['range_min_fop_fints_buchung_bdate']).'&apos;;
				query[&apos;range_max_fop_fints_buchung_bdate&apos;] = &apos;'.strtotime('next day', $params['range_min_fop_fints_buchung_bdate']).'&apos;;
				reloadfop_fints_buchung(); ">add_circle_outline</i>' : ''),
			htmlentities(_('Buchungsdatum') . ': ' . date('d.m.Y', $params['range_min_fop_fints_buchung_bdate']))
		]);
	} else if ( // Corner Case: Jahr
		isset($params['range_min_fop_fints_buchung_bdate'])
		&& isset($params['range_max_fop_fints_buchung_bdate'])
		&& (date('Y', $params['range_min_fop_fints_buchung_bdate']) == (date('Y', $params['range_max_fop_fints_buchung_bdate'])))
		&& ((date('m-d', $params['range_min_fop_fints_buchung_bdate']) == '01-01'))
		&& ((date('m-d', $params['range_max_fop_fints_buchung_bdate']) == '12-31'))
	) {
		array_push($filters, [
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_fop_fints_buchung_bdate&apos;] = &apos;'.strtotime('first day of January last year', $params['range_min_fop_fints_buchung_bdate']).'&apos;;
				query[&apos;range_max_fop_fints_buchung_bdate&apos;] = &apos;'.strtotime('last day of December last year', $params['range_min_fop_fints_buchung_bdate']).'&apos;;
				reloadfop_fints_buchung(); ">remove_circle_outline</i>' : ''),
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_fop_fints_buchung_bdate&apos;] = &apos;'.strtotime('first day of January next year', $params['range_min_fop_fints_buchung_bdate']).'&apos;;
				query[&apos;range_max_fop_fints_buchung_bdate&apos;] = &apos;'.strtotime('last day of December next year', $params['range_min_fop_fints_buchung_bdate']).'&apos;;
				reloadfop_fints_buchung(); ">add_circle_outline</i>' : ''),
			htmlentities(_('Buchungsdatum') . ': ' . date('Y', $params['range_min_fop_fints_buchung_bdate']))
		]);
	} else if ( // Corner Case: Quartal
		isset($params['range_min_fop_fints_buchung_bdate'])
		&& isset($params['range_max_fop_fints_buchung_bdate'])
		&& ( (
		 ((date('m-d', $params['range_min_fop_fints_buchung_bdate']) == '01-01'))
		&& ((date('m-d', $params['range_max_fop_fints_buchung_bdate']) == '03-31')) )
		|| (
		 ((date('m-d', $params['range_min_fop_fints_buchung_bdate']) == '04-01'))
		&& ((date('m-d', $params['range_max_fop_fints_buchung_bdate']) == '06-30')) )
		|| (
		 ((date('m-d', $params['range_min_fop_fints_buchung_bdate']) == '07-01'))
		&& ((date('m-d', $params['range_max_fop_fints_buchung_bdate']) == '09-30')) )
		|| (
		 ((date('m-d', $params['range_min_fop_fints_buchung_bdate']) == '10-01'))
		&& ((date('m-d', $params['range_max_fop_fints_buchung_bdate']) == '12-31')) )
	) ) {
		array_push($filters, [
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
					query[&apos;range_min_fop_fints_buchung_bdate&apos;] = &apos;'.strtotime('first day of -3 months', $params['range_min_fop_fints_buchung_bdate']).'&apos;;
					query[&apos;range_max_fop_fints_buchung_bdate&apos;] = &apos;'.strtotime('last day of -3 months', $params['range_max_fop_fints_buchung_bdate']).'&apos;;
					reloadfop_fints_buchung(); ">remove_circle_outline</i>' : ''),
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_fop_fints_buchung_bdate&apos;] = &apos;'.strtotime('first day of +3 months', $params['range_min_fop_fints_buchung_bdate']).'&apos;;
				query[&apos;range_max_fop_fints_buchung_bdate&apos;] = &apos;'.strtotime('last day of +3 months', $params['range_max_fop_fints_buchung_bdate']).'&apos;;
				reloadfop_fints_buchung(); ">add_circle_outline</i>' : ''),	
			htmlentities(_('Buchungsdatum') . ': Q' . (ceil((date('m', $params['range_min_fop_fints_buchung_bdate']))/3)) . ' (' . date('d.m.', $params['range_min_fop_fints_buchung_bdate']) . ' - ' . date('d.m.Y', $params['range_max_fop_fints_buchung_bdate']) . ')')
		]);
	}
	else if (isset($params['range_min_fop_fints_buchung_bdate']) && isset($params['range_max_fop_fints_buchung_bdate'])) {
		array_push($filters, _('Buchungsdatum') . ': ' . (($params['range_min_fop_fints_buchung_bdate']) ? strftime(_('dateformat_php2'), intval($params['range_min_fop_fints_buchung_bdate'])) : '') . ' ' . _('filters_between') . ' ' . (($params['range_max_fop_fints_buchung_bdate']) ? strftime(_('dateformat_php2'), intval($params['range_max_fop_fints_buchung_bdate'])) : ''));
	} else if (isset($params['range_min_fop_fints_buchung_bdate'])) {
		array_push($filters, _('Buchungsdatum') . ': ' . _('filters_from') . ' ' . (($params['range_min_fop_fints_buchung_bdate']) ? strftime(_('dateformat_php2'), intval($params['range_min_fop_fints_buchung_bdate'])) : ''));
	} else if (isset($params['range_max_fop_fints_buchung_bdate'])) {
		array_push($filters, _('Buchungsdatum') . ': ' . _('filters_to') . ' ' . (($params['range_max_fop_fints_buchung_bdate']) ? strftime(_('dateformat_php2'), intval($params['range_max_fop_fints_buchung_bdate'])) : ''));
	}
	
	if ( // Corner Case: Monat
		isset($params['range_min_fop_fints_buchung_date'])
		&& isset($params['range_max_fop_fints_buchung_date'])
		&& (date('d', $params['range_min_fop_fints_buchung_date']) == '01') //check first day of month
		&& (date('d', $params['range_max_fop_fints_buchung_date']) == date('t', $params['range_max_fop_fints_buchung_date'])) //check last day of month
		&& (date('Y-m', $params['range_min_fop_fints_buchung_date']) == date('Y-m', $params['range_max_fop_fints_buchung_date'])) //check if same year and month
	) {
		array_push($filters, [
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_fop_fints_buchung_date&apos;] = &apos;'.strtotime('first day of last month', $params['range_min_fop_fints_buchung_date']).'&apos;;
				query[&apos;range_max_fop_fints_buchung_date&apos;] = &apos;'.strtotime('last day of last month', $params['range_min_fop_fints_buchung_date']).'&apos;;
				reloadfop_fints_buchung(); ">remove_circle_outline</i>' : ''),
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_fop_fints_buchung_date&apos;] = &apos;'.strtotime('first day of next month', $params['range_min_fop_fints_buchung_date']).'&apos;;
				query[&apos;range_max_fop_fints_buchung_date&apos;] = &apos;'.strtotime('last day of next month', $params['range_min_fop_fints_buchung_date']).'&apos;;
				reloadfop_fints_buchung(); ">add_circle_outline</i>' : ''),
			htmlentities(_('Wertstellungsdatum') . ': ' . strftime('%B', $params['range_min_fop_fints_buchung_date']) . ' ' . date('Y', $params['range_min_fop_fints_buchung_date']))
		]);
	} else if ( // Corner Case: Tag
		isset($params['range_min_fop_fints_buchung_date'])
		&& isset($params['range_max_fop_fints_buchung_date'])
		&& (date('Y-m-d', $params['range_min_fop_fints_buchung_date']) == (date('Y-m-d', $params['range_max_fop_fints_buchung_date'])))
	) {
		array_push($filters, [
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_fop_fints_buchung_date&apos;] = &apos;'.strtotime('last day', $params['range_min_fop_fints_buchung_date']).'&apos;;
				query[&apos;range_max_fop_fints_buchung_date&apos;] = &apos;'.strtotime('last day', $params['range_min_fop_fints_buchung_date']).'&apos;;
				reloadfop_fints_buchung(); ">remove_circle_outline</i>' : ''),
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_fop_fints_buchung_date&apos;] = &apos;'.strtotime('next day', $params['range_min_fop_fints_buchung_date']).'&apos;;
				query[&apos;range_max_fop_fints_buchung_date&apos;] = &apos;'.strtotime('next day', $params['range_min_fop_fints_buchung_date']).'&apos;;
				reloadfop_fints_buchung(); ">add_circle_outline</i>' : ''),
			htmlentities(_('Wertstellungsdatum') . ': ' . date('d.m.Y', $params['range_min_fop_fints_buchung_date']))
		]);
	} else if ( // Corner Case: Jahr
		isset($params['range_min_fop_fints_buchung_date'])
		&& isset($params['range_max_fop_fints_buchung_date'])
		&& (date('Y', $params['range_min_fop_fints_buchung_date']) == (date('Y', $params['range_max_fop_fints_buchung_date'])))
		&& ((date('m-d', $params['range_min_fop_fints_buchung_date']) == '01-01'))
		&& ((date('m-d', $params['range_max_fop_fints_buchung_date']) == '12-31'))
	) {
		array_push($filters, [
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_fop_fints_buchung_date&apos;] = &apos;'.strtotime('first day of January last year', $params['range_min_fop_fints_buchung_date']).'&apos;;
				query[&apos;range_max_fop_fints_buchung_date&apos;] = &apos;'.strtotime('last day of December last year', $params['range_min_fop_fints_buchung_date']).'&apos;;
				reloadfop_fints_buchung(); ">remove_circle_outline</i>' : ''),
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_fop_fints_buchung_date&apos;] = &apos;'.strtotime('first day of January next year', $params['range_min_fop_fints_buchung_date']).'&apos;;
				query[&apos;range_max_fop_fints_buchung_date&apos;] = &apos;'.strtotime('last day of December next year', $params['range_min_fop_fints_buchung_date']).'&apos;;
				reloadfop_fints_buchung(); ">add_circle_outline</i>' : ''),
			htmlentities(_('Wertstellungsdatum') . ': ' . date('Y', $params['range_min_fop_fints_buchung_date']))
		]);
	} else if ( // Corner Case: Quartal
		isset($params['range_min_fop_fints_buchung_date'])
		&& isset($params['range_max_fop_fints_buchung_date'])
		&& ( (
		 ((date('m-d', $params['range_min_fop_fints_buchung_date']) == '01-01'))
		&& ((date('m-d', $params['range_max_fop_fints_buchung_date']) == '03-31')) )
		|| (
		 ((date('m-d', $params['range_min_fop_fints_buchung_date']) == '04-01'))
		&& ((date('m-d', $params['range_max_fop_fints_buchung_date']) == '06-30')) )
		|| (
		 ((date('m-d', $params['range_min_fop_fints_buchung_date']) == '07-01'))
		&& ((date('m-d', $params['range_max_fop_fints_buchung_date']) == '09-30')) )
		|| (
		 ((date('m-d', $params['range_min_fop_fints_buchung_date']) == '10-01'))
		&& ((date('m-d', $params['range_max_fop_fints_buchung_date']) == '12-31')) )
	) ) {
		array_push($filters, [
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
					query[&apos;range_min_fop_fints_buchung_date&apos;] = &apos;'.strtotime('first day of -3 months', $params['range_min_fop_fints_buchung_date']).'&apos;;
					query[&apos;range_max_fop_fints_buchung_date&apos;] = &apos;'.strtotime('last day of -3 months', $params['range_max_fop_fints_buchung_date']).'&apos;;
					reloadfop_fints_buchung(); ">remove_circle_outline</i>' : ''),
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_fop_fints_buchung_date&apos;] = &apos;'.strtotime('first day of +3 months', $params['range_min_fop_fints_buchung_date']).'&apos;;
				query[&apos;range_max_fop_fints_buchung_date&apos;] = &apos;'.strtotime('last day of +3 months', $params['range_max_fop_fints_buchung_date']).'&apos;;
				reloadfop_fints_buchung(); ">add_circle_outline</i>' : ''),	
			htmlentities(_('Wertstellungsdatum') . ': Q' . (ceil((date('m', $params['range_min_fop_fints_buchung_date']))/3)) . ' (' . date('d.m.', $params['range_min_fop_fints_buchung_date']) . ' - ' . date('d.m.Y', $params['range_max_fop_fints_buchung_date']) . ')')
		]);
	}
	else if (isset($params['range_min_fop_fints_buchung_date']) && isset($params['range_max_fop_fints_buchung_date'])) {
		array_push($filters, _('Wertstellungsdatum') . ': ' . (($params['range_min_fop_fints_buchung_date']) ? strftime(_('dateformat_php2'), intval($params['range_min_fop_fints_buchung_date'])) : '') . ' ' . _('filters_between') . ' ' . (($params['range_max_fop_fints_buchung_date']) ? strftime(_('dateformat_php2'), intval($params['range_max_fop_fints_buchung_date'])) : ''));
	} else if (isset($params['range_min_fop_fints_buchung_date'])) {
		array_push($filters, _('Wertstellungsdatum') . ': ' . _('filters_from') . ' ' . (($params['range_min_fop_fints_buchung_date']) ? strftime(_('dateformat_php2'), intval($params['range_min_fop_fints_buchung_date'])) : ''));
	} else if (isset($params['range_max_fop_fints_buchung_date'])) {
		array_push($filters, _('Wertstellungsdatum') . ': ' . _('filters_to') . ' ' . (($params['range_max_fop_fints_buchung_date']) ? strftime(_('dateformat_php2'), intval($params['range_max_fop_fints_buchung_date'])) : ''));
	}if (isset($params['filter_fop_fints_buchung_forderungDone'])) {
		if ($params['filter_fop_fints_buchung_forderungDone'] == '_null') {
			array_push($filters, _('Forderung behandelt') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_fop_fints_buchung_forderungDone']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Forderung behandelt') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_fop_fints_buchung_bdate'])) {
		if ($params['filter_fop_fints_buchung_bdate'] == '_null') {
			array_push($filters, _('Buchungsdatum') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_fop_fints_buchung_bdate']))->all() AS $val) {
				$value = ($val) ? strftime(_('dateformat_php2'), intval($val)) : '';
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Buchungsdatum') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_fop_fints_buchung_date'])) {
		if ($params['filter_fop_fints_buchung_date'] == '_null') {
			array_push($filters, _('Wertstellungsdatum') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_fop_fints_buchung_date']))->all() AS $val) {
				$value = ($val) ? strftime(_('dateformat_php2'), intval($val)) : '';
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Wertstellungsdatum') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_fop_fints_buchung_betrag'])) {
		if ($params['filter_fop_fints_buchung_betrag'] == '_null') {
			array_push($filters, _('Betrag') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_fop_fints_buchung_betrag']))->all() AS $val) {
				$value = \Types\Euro::print($val) .  ' €'
	;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Betrag') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_fop_fints_buchung_saldo'])) {
		if ($params['filter_fop_fints_buchung_saldo'] == '_null') {
			array_push($filters, _('Saldo') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_fop_fints_buchung_saldo']))->all() AS $val) {
				$value = \Types\Euro::print($val) .  ' €'
	;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Saldo') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_fop_fints_buchung_iban'])) {
		if ($params['filter_fop_fints_buchung_iban'] == '_null') {
			array_push($filters, _('IBAN') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_fop_fints_buchung_iban']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('IBAN') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_fop_fints_buchung_name_firma'])) {
		if ($params['filter_fop_fints_buchung_name_firma'] == '_null') {
			array_push($filters, _('Name, Vorname/Firma') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_fop_fints_buchung_name_firma']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Name, Vorname/Firma') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_fop_fints_buchung_vzweck'])) {
		if ($params['filter_fop_fints_buchung_vzweck'] == '_null') {
			array_push($filters, _('Verwendungszweck') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_fop_fints_buchung_vzweck']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Verwendungszweck') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_fop_fints_buchung_endtoend'])) {
		if ($params['filter_fop_fints_buchung_endtoend'] == '_null') {
			array_push($filters, _('End to End-Referenz') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_fop_fints_buchung_endtoend']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('End to End-Referenz') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_fop_fints_buchung_umsatzart'])) {
		if ($params['filter_fop_fints_buchung_umsatzart'] == '_null') {
			array_push($filters, _('Umsatzart') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_fop_fints_buchung_umsatzart']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Umsatzart') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_fop_fints_buchung_hash'])) {
		if ($params['filter_fop_fints_buchung_hash'] == '_null') {
			array_push($filters, _('Hashcode') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_fop_fints_buchung_hash']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Hashcode') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_fop_fints_buchung_konto'])) {
		if ($params['filter_fop_fints_buchung_konto'] == '_null') {
			array_push($filters, _('Konto') . ': ' . _(''));
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_fop_fints_buchung_konto']))->all() AS $val) {
				$value = 
  \FOP\Database::query('SELECT '.qi('fop_fints_konto').'.'.qi('kontoname').' AS description FROM '.qi('fop_fints_konto').' WHERE '.qi('ID').' = ' . \FOP\Database::quote($val))->fetchColumn() ?: _('')
;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Konto') . ': ' . implode(', ', $values));
		}
	}if (isset($params['search_fop_fints_buchung_iban'])) {
		array_push($filters, _('iban') . ' ' . _('filter_contains') . ' ' . $params['search_fop_fints_buchung_iban']);
	}if (isset($params['search_fop_fints_buchung_name_firma'])) {
		array_push($filters, _('name_firma') . ' ' . _('filter_contains') . ' ' . $params['search_fop_fints_buchung_name_firma']);
	}if (isset($params['search_fop_fints_buchung_vzweck'])) {
		array_push($filters, _('vzweck') . ' ' . _('filter_contains') . ' ' . $params['search_fop_fints_buchung_vzweck']);
	}if (isset($params['search_fop_fints_buchung_endtoend'])) {
		array_push($filters, _('endtoend') . ' ' . _('filter_contains') . ' ' . $params['search_fop_fints_buchung_endtoend']);
	}if (isset($params['search_fop_fints_buchung_umsatzart'])) {
		array_push($filters, _('umsatzart') . ' ' . _('filter_contains') . ' ' . $params['search_fop_fints_buchung_umsatzart']);
	}if (isset($params['search_fop_fints_buchung_hash'])) {
		array_push($filters, _('hash') . ' ' . _('filter_contains') . ' ' . $params['search_fop_fints_buchung_hash']);
	}if (isset($params['searchnot_fop_fints_buchung_iban'])) {
		array_push($filters, _('iban') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_fop_fints_buchung_iban']);
	}if (isset($params['searchnot_fop_fints_buchung_name_firma'])) {
		array_push($filters, _('name_firma') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_fop_fints_buchung_name_firma']);
	}if (isset($params['searchnot_fop_fints_buchung_vzweck'])) {
		array_push($filters, _('vzweck') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_fop_fints_buchung_vzweck']);
	}if (isset($params['searchnot_fop_fints_buchung_endtoend'])) {
		array_push($filters, _('endtoend') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_fop_fints_buchung_endtoend']);
	}if (isset($params['searchnot_fop_fints_buchung_umsatzart'])) {
		array_push($filters, _('umsatzart') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_fop_fints_buchung_umsatzart']);
	}if (isset($params['searchnot_fop_fints_buchung_hash'])) {
		array_push($filters, _('hash') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_fop_fints_buchung_hash']);
	}
		if (count($filters)) {
			$result = implode($delimiter, array_map(function ($filter) {
				if (is_array($filter)) {
					return implode('', $filter);
				}
				return htmlentities($filter);
			}, $filters))
			// Button, um Filter zu entfernen
			. ($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="for (var q in query) {if (q.includes(\'_fop_fints_buchung_\')) delete query[q];} reloadfop_fints_buchung(); ">clear</i>' : '');
		} else {
			$result = _('no_filter');
		}
		return $result;
	
    
  }

  public static function openAction($fop_table, $fop_id, $fop_from) { 
    
    
    // --- BLOCK: access ---
    
    // --- BLOCK: main ---
    

if ($fop_table == 'fop_fints_buchung') {
	\FOP\Session::setPayload('dv-fop_fints_buchung', [
		'id' => 'fop_fints_buchung',
		'tbl' => 'fop_fints_buchung',
		'idcol' => 'ID',
		'prev' => \DataViewRouter\Fop_fints_buchung::stepURL('fop_fints_buchung', 'XXX', -1),
		'next' => \DataViewRouter\Fop_fints_buchung::stepURL('fop_fints_buchung', 'XXX',  1),
		'from' => $fop_from
	]);
	
	if ($fop_id == '_') return; // nur Rückreferenz setzen, nicht öffnen
	$params = [];
	if (isset($_GET['popup'])) $params['popup'] = true;
	if (isset($_GET['from'])) $params['from'] = $_GET['from'];
	$params['id'] = $fop_id;
	
	$url = \TablesRouter\Fop_fints_buchung::viewURL2($params);
	header('Location: ' . $url);
}

die();
    
  }

  public static function stepAction($tbl, $id, $step) { 
    
    
    // --- BLOCK: access ---
    
    // --- BLOCK: main ---
    
	$dv = \FOP\Session::getPayload('dv-'.$tbl);
	$url = $dv['from'];
	$parts = parse_url($url);
	parse_str($parts['query'], $query);
	$data = self::getData('', $query);
	$col = $dv['idcol'];
	$ids = array_map(function ($x) use ($col) {return $x[$col];}, $data['items']);
	if (!count($ids)) {
		header('Location: ' . \FOP\Util::getCurrentBaseurl() . 'Tables/' . preg_replace('/[^a-zA-Z0-9_]/', '_', ucfirst($dv['tbl'])));
		die();
	}
	$idx = array_search($id, $ids);
	$idx += count($ids) + $step;
	$idx = $idx % count($ids);
	header('Location: ' . \FOP\Util::getCurrentBaseurl() . 'Tables/' . preg_replace('/[^a-zA-Z0-9_]/', '_', ucfirst($dv['tbl'])) . '/view?id=' . urlencode($ids[$idx]));
	die();

    
  }


  
  

  
  
}



