mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-11-14 20:17:14 +01:00
fibu_buchungen check saldo for vorschlag
This commit is contained in:
parent
e79f2839e2
commit
828af9ab50
@ -117352,7 +117352,7 @@
|
|||||||
{
|
{
|
||||||
"name": "fibu_objekte_view",
|
"name": "fibu_objekte_view",
|
||||||
"type": "VIEW",
|
"type": "VIEW",
|
||||||
"Create": "CREATE VIEW `fibu_objekte_view` AS select `fo`.`datum` AS `datum`,`fo`.`typ` AS `typ`,`fo`.`id` AS `id`,`fo`.`info` AS `info`,`fo`.`typ` in ('rechnung','gutschrift','verbindlichkeit','auftrag') AS `is_beleg` from (select `auftrag`.`datum` AS `datum`,'auftrag' AS `typ`,`auftrag`.`id` AS `id`,`auftrag`.`belegnr` AS `info` from `auftrag` where `auftrag`.`belegnr` <> '' union select `rechnung`.`datum` AS `datum`,'rechnung' AS `typ`,`rechnung`.`id` AS `id`,`rechnung`.`belegnr` AS `info` from `rechnung` where `rechnung`.`belegnr` <> '' union select `gutschrift`.`datum` AS `datum`,'gutschrift' AS `gutschrift`,`gutschrift`.`id` AS `id`,`gutschrift`.`belegnr` AS `belegnr` from `gutschrift` where `gutschrift`.`belegnr` <> '' union select `verbindlichkeit`.`rechnungsdatum` AS `rechnungsdatum`,'verbindlichkeit' AS `verbindlichkeit`,`verbindlichkeit`.`id` AS `id`,`verbindlichkeit`.`rechnung` AS `belegnr` from `verbindlichkeit` where `verbindlichkeit`.`belegnr` <> '' union select `kontoauszuege`.`buchung` AS `buchung`,'kontoauszuege' AS `kontoauszuege`,`kontoauszuege`.`id` AS `id`,concat(`konten`.`kurzbezeichnung`,' - ',`kontoauszuege`.`buchungstext`) AS `buchungstext` from (`kontoauszuege` left join `konten` on(`konten`.`id` = `kontoauszuege`.`konto`)) union select '' AS `datum`,'kontorahmen' AS `'kontorahmen'`,`kontorahmen`.`id` AS `id`,concat(`kontorahmen`.`sachkonto`,' - ',`kontorahmen`.`beschriftung`) AS `beschriftung` from `kontorahmen`) `fo` where `fo`.`datum` >= (select `firmendaten_werte`.`wert` from `firmendaten_werte` where `firmendaten_werte`.`name` = 'fibu_buchungen_startdatum') or `fo`.`datum` = ''"
|
"Create": "CREATE VIEW `fibu_objekte_view` AS select `fo`.`datum` AS `datum`,`fo`.`typ` AS `typ`,`fo`.`id` AS `id`,`fo`.`info` AS `info`,`fo`.`adresse` AS `adresse`,`fo`.`typ` in ('rechnung','gutschrift','verbindlichkeit','auftrag') AS `is_beleg` from (select `auftrag`.`datum` AS `datum`,'auftrag' AS `typ`,`auftrag`.`id` AS `id`,`auftrag`.`belegnr` AS `info`,`auftrag`.`adresse` AS `adresse` from `auftrag` where `auftrag`.`belegnr` <> '' and `auftrag`.`status` <> 'abgeschlossen' union select `rechnung`.`datum` AS `datum`,'rechnung' AS `typ`,`rechnung`.`id` AS `id`,`rechnung`.`belegnr` AS `info`,`rechnung`.`adresse` AS `adresse` from `rechnung` where `rechnung`.`belegnr` <> '' and `rechnung`.`zahlungsstatus` <> 'bezahlt' union select `gutschrift`.`datum` AS `datum`,'gutschrift' AS `gutschrift`,`gutschrift`.`id` AS `id`,`gutschrift`.`belegnr` AS `belegnr`,`gutschrift`.`adresse` AS `adresse` from `gutschrift` where `gutschrift`.`belegnr` <> '' and `gutschrift`.`zahlungsstatus` <> 'bezahlt' union select `verbindlichkeit`.`rechnungsdatum` AS `rechnungsdatum`,'verbindlichkeit' AS `verbindlichkeit`,`verbindlichkeit`.`id` AS `id`,`verbindlichkeit`.`rechnung` AS `belegnr`,`verbindlichkeit`.`adresse` AS `adresse` from `verbindlichkeit` where `verbindlichkeit`.`belegnr` <> '' and `verbindlichkeit`.`status` <> 'bezahlt' union select `kontoauszuege`.`buchung` AS `buchung`,'kontoauszuege' AS `kontoauszuege`,`kontoauszuege`.`id` AS `id`,concat(`konten`.`kurzbezeichnung`,' - ',`kontoauszuege`.`buchungstext`) AS `buchungstext`,'' from (`kontoauszuege` left join `konten` on(`konten`.`id` = `kontoauszuege`.`konto`)) union select '' AS `datum`,'kontorahmen' AS `'kontorahmen'`,`kontorahmen`.`id` AS `id`,concat(`kontorahmen`.`sachkonto`,' - ',`kontorahmen`.`beschriftung`) AS `beschriftung`,'' from `kontorahmen`) `fo` where `fo`.`datum` >= (select `firmendaten_werte`.`wert` from `firmendaten_werte` where `firmendaten_werte`.`name` = 'fibu_buchungen_startdatum') or `fo`.`datum` = ''"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "fibu_buchungen_alle_view",
|
"name": "fibu_buchungen_alle_view",
|
||||||
|
@ -22,6 +22,13 @@
|
|||||||
</label>
|
</label>
|
||||||
<label for="vorschlagfilter">{|Vorschläge|}</label>
|
<label for="vorschlagfilter">{|Vorschläge|}</label>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="filter-item">
|
||||||
|
<label for="checkedfilter" class="switch">
|
||||||
|
<input type="checkbox" id="checkedfilter">
|
||||||
|
<span class="slider round"></span>
|
||||||
|
</label>
|
||||||
|
<label for="checkedfilter">{|Betrag korrekt|}</label>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -183,10 +183,10 @@ class Fibu_buchungen {
|
|||||||
case 'fibu_buchungen_zuordnen':
|
case 'fibu_buchungen_zuordnen':
|
||||||
|
|
||||||
$allowed['fibu_buchungen_zuordnung'] = array('list');
|
$allowed['fibu_buchungen_zuordnung'] = array('list');
|
||||||
$heading = array('','','Datum', 'Info', 'Betrag', 'Währung', 'Buchungsbetrag','Vorschlag', 'Menü');
|
$heading = array('','','Datum','Typ', 'Info', 'Betrag', 'Währung', 'Buchungsbetrag','Vorschlag', 'Menü');
|
||||||
$width = array( );
|
$width = array( );
|
||||||
|
|
||||||
$findcols = array('','auswahl','datum','objektlink','saldo','waehrung','buchwert_input','vorschlag');
|
$findcols = array('','auswahl','datum','typ','objektlink','saldo','waehrung','buchwert_input','vorschlag');
|
||||||
$searchsql = array();
|
$searchsql = array();
|
||||||
|
|
||||||
$defaultorder = 1;
|
$defaultorder = 1;
|
||||||
@ -209,6 +209,8 @@ class Fibu_buchungen {
|
|||||||
'</a>'
|
'</a>'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$check_sql = "(fo.info <> '' AND salden.saldonum = -SUM(fbd.betrag))";
|
||||||
|
|
||||||
$auswahl = array (
|
$auswahl = array (
|
||||||
'<input type=\"text\" name=\"ids[]\" value=\"',
|
'<input type=\"text\" name=\"ids[]\" value=\"',
|
||||||
['sql' => 'salden.typ'],
|
['sql' => 'salden.typ'],
|
||||||
@ -220,7 +222,7 @@ class Fibu_buchungen {
|
|||||||
'_',
|
'_',
|
||||||
['sql' => 'salden.id'],
|
['sql' => 'salden.id'],
|
||||||
'"',
|
'"',
|
||||||
['sql' => "if(fo.info <> '','checked','')"],
|
['sql' => "if(".$check_sql.",'checked','')"],
|
||||||
' />'
|
' />'
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -234,7 +236,7 @@ class Fibu_buchungen {
|
|||||||
' ',
|
' ',
|
||||||
['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).",')'))"],
|
['sql' => "if (SUM(fbd.betrag) IS NULL,'',CONCAT('(Saldo ',".$this->app->erp->FormatMenge('SUM(fbd.betrag)',2).",', Diff. ',".$this->app->erp->FormatMenge('SUM(fbd.betrag)+saldonum',2).",')'))"],
|
||||||
'</a> ',
|
'</a> ',
|
||||||
'<input type="text" name="vorschlaege[]" value="',
|
'<input type="text" name="vorschlaege[]" value="',
|
||||||
['sql' => 'COALESCE(fo.typ,\'\')'],
|
['sql' => 'COALESCE(fo.typ,\'\')'],
|
||||||
@ -271,13 +273,16 @@ class Fibu_buchungen {
|
|||||||
'' AS dummy2,
|
'' AS dummy2,
|
||||||
auswahl,
|
auswahl,
|
||||||
datum,
|
datum,
|
||||||
|
".$this->app->erp->FormatUCfirst("typ").",
|
||||||
objektlink,
|
objektlink,
|
||||||
saldo,
|
saldo,
|
||||||
waehrung,
|
waehrung,
|
||||||
wert,
|
wert,
|
||||||
vorschlag,
|
vorschlag,
|
||||||
doc,
|
doc,
|
||||||
doc_id
|
doc_id,
|
||||||
|
doc_saldo,
|
||||||
|
checked
|
||||||
FROM
|
FROM
|
||||||
(
|
(
|
||||||
SELECT
|
SELECT
|
||||||
@ -297,7 +302,8 @@ class Fibu_buchungen {
|
|||||||
fo.id AS doc_id,
|
fo.id AS doc_id,
|
||||||
fo.info AS doc_info,
|
fo.info AS doc_info,
|
||||||
SUM(fbd.betrag) as doc_saldo,
|
SUM(fbd.betrag) as doc_saldo,
|
||||||
".$this->app->erp->ConcatSQL($doc)." AS doc
|
if(".$check_sql.",'1','0') AS checked,
|
||||||
|
".$this->app->erp->ConcatSQL($doc)." AS doc
|
||||||
FROM
|
FROM
|
||||||
(
|
(
|
||||||
SELECT
|
SELECT
|
||||||
@ -326,9 +332,14 @@ class Fibu_buchungen {
|
|||||||
SELECT
|
SELECT
|
||||||
fo.typ,
|
fo.typ,
|
||||||
fo.id,
|
fo.id,
|
||||||
fo.info
|
fo.info,
|
||||||
|
SUM(fob.betrag) as doc_saldo
|
||||||
FROM
|
FROM
|
||||||
fibu_objekte fo
|
fibu_objekte fo
|
||||||
|
INNER JOIN
|
||||||
|
fibu_buchungen_alle fob
|
||||||
|
ON
|
||||||
|
fo.typ = fob.typ AND fo.id = fob.id
|
||||||
WHERE fo.is_beleg = 1
|
WHERE fo.is_beleg = 1
|
||||||
GROUP BY
|
GROUP BY
|
||||||
fo.typ,
|
fo.typ,
|
||||||
@ -345,7 +356,9 @@ class Fibu_buchungen {
|
|||||||
salden.saldonum <> 0
|
salden.saldonum <> 0
|
||||||
GROUP BY
|
GROUP BY
|
||||||
salden.typ,
|
salden.typ,
|
||||||
salden.id
|
salden.id,
|
||||||
|
fo.typ,
|
||||||
|
fo.id
|
||||||
) AS erg
|
) AS erg
|
||||||
";
|
";
|
||||||
|
|
||||||
@ -353,6 +366,7 @@ class Fibu_buchungen {
|
|||||||
|
|
||||||
// Toggle filters
|
// Toggle filters
|
||||||
$this->app->Tpl->Add('JQUERYREADY', "$('#vorschlagfilter').click( function() { fnFilterColumn1( 0 ); } );");
|
$this->app->Tpl->Add('JQUERYREADY', "$('#vorschlagfilter').click( function() { fnFilterColumn1( 0 ); } );");
|
||||||
|
$this->app->Tpl->Add('JQUERYREADY', "$('#checkedfilter').click( function() { fnFilterColumn2( 0 ); } );");
|
||||||
|
|
||||||
for ($r = 1;$r <= 4;$r++) {
|
for ($r = 1;$r <= 4;$r++) {
|
||||||
$this->app->Tpl->Add('JAVASCRIPT', '
|
$this->app->Tpl->Add('JAVASCRIPT', '
|
||||||
@ -378,12 +392,22 @@ class Fibu_buchungen {
|
|||||||
$where .= " AND doc_id IS NOT NULL";
|
$where .= " AND doc_id IS NOT NULL";
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$more_data2 = $this->app->Secure->GetGET("more_data2");
|
||||||
|
if ($more_data2 == 1) {
|
||||||
|
$where .= " AND checked = 1";
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
|
||||||
// END Toggle filters
|
// 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";
|
||||||
|
|
||||||
|
//echo($sql." WHERE ".$where." ".$groupby);
|
||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user