mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-11-15 04:27:14 +01:00
fibu_buchungen vorschlag now includes saldo info
This commit is contained in:
parent
3dfba163df
commit
7aab51a390
@ -2,7 +2,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li><a href="#tabs-1"><!--[TABTEXT]--></a></li>
|
<li><a href="#tabs-1"><!--[TABTEXT]--></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<div id="tabs-1">
|
<div id="tabs-1">
|
||||||
[MESSAGE]
|
[MESSAGE]
|
||||||
[FORMHANDLEREVENT]
|
[FORMHANDLEREVENT]
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -11,6 +11,20 @@
|
|||||||
<div class="inside inside-full-height">
|
<div class="inside inside-full-height">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>{|Offene Einzelsalden|}</legend>
|
<legend>{|Offene Einzelsalden|}</legend>
|
||||||
|
<div class="filter-box filter-usersave">
|
||||||
|
<div class="filter-block filter-inline">
|
||||||
|
<div class="filter-title">{|Filter|}</div>
|
||||||
|
<ul class="filter-list">
|
||||||
|
<li class="filter-item">
|
||||||
|
<label for="vorschlagfilter" class="switch">
|
||||||
|
<input type="checkbox" id="vorschlagfilter">
|
||||||
|
<span class="slider round"></span>
|
||||||
|
</label>
|
||||||
|
<label for="vorschlagfilter">{|Vorschläge|}</label>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<form action="" method="post" id="buchungenform">
|
<form action="" method="post" id="buchungenform">
|
||||||
[TAB1]
|
[TAB1]
|
||||||
</form>
|
</form>
|
||||||
|
@ -196,7 +196,7 @@ class Fibu_buchungen {
|
|||||||
|
|
||||||
$linkstart = '<table cellpadding=0 cellspacing=0><tr><td nowrap><a href="index.php?module=fibu_buchungen&action=edit&';
|
$linkstart = '<table cellpadding=0 cellspacing=0><tr><td nowrap><a href="index.php?module=fibu_buchungen&action=edit&';
|
||||||
$linkend = '"><img src="./themes/'.$app->Conf->WFconf['defaulttheme'].'/images/forward.svg" border=0></a></td></tr></table>';
|
$linkend = '"><img src="./themes/'.$app->Conf->WFconf['defaulttheme'].'/images/forward.svg" border=0></a></td></tr></table>';
|
||||||
|
|
||||||
$typ = $this->app->User->GetParameter('fibu_buchungen_doc_typ');
|
$typ = $this->app->User->GetParameter('fibu_buchungen_doc_typ');
|
||||||
|
|
||||||
$objektlink = array (
|
$objektlink = array (
|
||||||
@ -233,6 +233,8 @@ class Fibu_buchungen {
|
|||||||
['sql' => $this->app->erp->FormatUCfirst('COALESCE(fo.typ,\'\')')],
|
['sql' => $this->app->erp->FormatUCfirst('COALESCE(fo.typ,\'\')')],
|
||||||
' ',
|
' ',
|
||||||
['sql' => 'COALESCE(fo.info,\'\')'],
|
['sql' => 'COALESCE(fo.info,\'\')'],
|
||||||
|
' ',
|
||||||
|
['sql' => "if (SUM(fbd.betrag) IS NULL,'',CONCAT('(Saldo ',".$this->app->erp->FormatMenge('SUM(fbd.betrag)',2).",')'))"],
|
||||||
'</a> ',
|
'</a> ',
|
||||||
'<input type="text" name="vorschlaege[]" value="',
|
'<input type="text" name="vorschlaege[]" value="',
|
||||||
['sql' => 'COALESCE(fo.typ,\'\')'],
|
['sql' => 'COALESCE(fo.typ,\'\')'],
|
||||||
@ -264,9 +266,9 @@ class Fibu_buchungen {
|
|||||||
['sql' => 'salden.id'],
|
['sql' => 'salden.id'],
|
||||||
);
|
);
|
||||||
|
|
||||||
$sql = "SELECT
|
$sql = "SELECT
|
||||||
'' as dummy,
|
'' AS dummy,
|
||||||
'' as dummy2,
|
'' AS dummy2,
|
||||||
auswahl,
|
auswahl,
|
||||||
datum,
|
datum,
|
||||||
objektlink,
|
objektlink,
|
||||||
@ -274,53 +276,110 @@ class Fibu_buchungen {
|
|||||||
waehrung,
|
waehrung,
|
||||||
wert,
|
wert,
|
||||||
vorschlag,
|
vorschlag,
|
||||||
doc
|
doc,
|
||||||
FROM (SELECT
|
doc_id
|
||||||
'' as dummy,
|
FROM
|
||||||
".$this->app->erp->ConcatSQL($auswahl)." as auswahl,
|
(
|
||||||
salden.datum,
|
SELECT
|
||||||
salden.typ,
|
'' AS dummy,
|
||||||
salden.id,
|
".$this->app->erp->ConcatSQL($auswahl)." AS auswahl,
|
||||||
salden.info,
|
salden.datum,
|
||||||
salden.saldo,
|
salden.typ,
|
||||||
salden.objektlink,
|
salden.id,
|
||||||
salden.saldonum,
|
salden.info,
|
||||||
".$this->app->erp->ConcatSQL($vorschlaege)." as vorschlag,
|
salden.saldo,
|
||||||
".$this->app->erp->ConcatSQL($werte)." as wert,
|
salden.objektlink,
|
||||||
".$this->app->erp->ConcatSQL($waehrungen)." as waehrung,
|
salden.saldonum,
|
||||||
fo.typ as doc_typ,
|
".$this->app->erp->ConcatSQL($vorschlaege)." AS vorschlag,
|
||||||
fo.id as doc_id,
|
".$this->app->erp->ConcatSQL($werte)." AS wert,
|
||||||
fo.info as doc_info,
|
".$this->app->erp->ConcatSQL($waehrungen)." AS waehrung,
|
||||||
".$this->app->erp->ConcatSQL($doc)." as doc
|
fo.typ AS doc_typ,
|
||||||
FROM
|
fo.id AS doc_id,
|
||||||
(
|
fo.info AS doc_info,
|
||||||
SELECT
|
SUM(fbd.betrag) as doc_saldo,
|
||||||
".$this->app->erp->FormatDate("fb.datum")." as datum,
|
".$this->app->erp->ConcatSQL($doc)." AS doc
|
||||||
fb.typ,
|
FROM
|
||||||
fb.id,
|
(
|
||||||
fo.info,
|
SELECT
|
||||||
".$this->app->erp->ConcatSQL($objektlink)." AS objektlink,
|
".$this->app->erp->FormatDate(" fb.datum ")." AS datum,
|
||||||
".$this->app->erp->FormatMenge('SUM(COALESCE(fb.betrag,0))',2)."AS saldo,
|
fb.typ,
|
||||||
SUM(betrag) AS saldonum,
|
fb.id,
|
||||||
fb.waehrung
|
fo.info,
|
||||||
FROM
|
".$this->app->erp->ConcatSQL($objektlink)." AS objektlink,
|
||||||
`fibu_buchungen_alle` fb
|
".$this->app->erp->FormatMenge('SUM(COALESCE(fb.betrag,0))',2)." AS saldo,
|
||||||
INNER JOIN fibu_objekte fo ON
|
SUM(betrag) AS saldonum,
|
||||||
fb.typ = fo.typ AND fb.id = fo.id
|
fb.waehrung
|
||||||
WHERE (fb.typ = '".$typ."' OR '".$typ."' = '')
|
FROM
|
||||||
GROUP BY
|
`fibu_buchungen_alle` fb
|
||||||
fb.typ,
|
INNER JOIN fibu_objekte fo ON
|
||||||
fb.id,
|
fb.typ = fo.typ AND fb.id = fo.id
|
||||||
fb.waehrung
|
WHERE
|
||||||
) salden
|
(
|
||||||
LEFT JOIN fibu_objekte fo ON
|
fb.typ = '".$typ."' OR '".$typ."' = ''
|
||||||
salden.info LIKE CONCAT('%', fo.info, '%')
|
)
|
||||||
AND
|
GROUP BY
|
||||||
salden.typ <> fo.typ AND fo.info <> ''
|
fb.typ,
|
||||||
WHERE salden.saldonum <> 0) as erg
|
fb.id,
|
||||||
|
fb.waehrung
|
||||||
|
) salden
|
||||||
|
LEFT JOIN(
|
||||||
|
SELECT
|
||||||
|
fo.typ,
|
||||||
|
fo.id,
|
||||||
|
fo.info
|
||||||
|
FROM
|
||||||
|
fibu_objekte fo
|
||||||
|
GROUP BY
|
||||||
|
fo.typ,
|
||||||
|
fo.id,
|
||||||
|
fo.info
|
||||||
|
) AS fo
|
||||||
|
ON
|
||||||
|
salden.info LIKE CONCAT('%', fo.info, '%') AND salden.typ <> fo.typ AND fo.info <> ''
|
||||||
|
LEFT JOIN
|
||||||
|
fibu_buchungen_alle fbd
|
||||||
|
ON
|
||||||
|
fbd.typ = fo.typ AND fbd.id = fo.id
|
||||||
|
WHERE
|
||||||
|
salden.saldonum <> 0
|
||||||
|
GROUP BY
|
||||||
|
salden.typ,
|
||||||
|
salden.id
|
||||||
|
) AS erg
|
||||||
";
|
";
|
||||||
|
|
||||||
$where = "1";
|
$where = "1";
|
||||||
|
|
||||||
|
// Toggle filters
|
||||||
|
$this->app->Tpl->Add('JQUERYREADY', "$('#vorschlagfilter').click( function() { fnFilterColumn1( 0 ); } );");
|
||||||
|
|
||||||
|
for ($r = 1;$r <= 4;$r++) {
|
||||||
|
$this->app->Tpl->Add('JAVASCRIPT', '
|
||||||
|
function fnFilterColumn' . $r . ' ( i )
|
||||||
|
{
|
||||||
|
if(oMoreData' . $r . $name . '==1)
|
||||||
|
oMoreData' . $r . $name . ' = 0;
|
||||||
|
else
|
||||||
|
oMoreData' . $r . $name . ' = 1;
|
||||||
|
|
||||||
|
$(\'#' . $name . '\').dataTable().fnFilter(
|
||||||
|
\'\',
|
||||||
|
i,
|
||||||
|
0,0
|
||||||
|
);
|
||||||
|
}
|
||||||
|
');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$more_data1 = $this->app->Secure->GetGET("more_data1");
|
||||||
|
if ($more_data1 == 1) {
|
||||||
|
$where .= " AND doc_id IS NOT NULL";
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
// END Toggle filters
|
||||||
|
|
||||||
|
|
||||||
// $count = "SELECT count(DISTINCT id) FROM fibu_buchungen_alle WHERE $where";
|
// $count = "SELECT count(DISTINCT id) FROM fibu_buchungen_alle WHERE $where";
|
||||||
$groupby = "GROUP BY typ, id";
|
$groupby = "GROUP BY typ, id";
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user