mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-11-14 20:17:14 +01:00
fibu_buchungen usability improvements
This commit is contained in:
parent
17bdb1c5e1
commit
64d6b90312
@ -117363,7 +117363,7 @@
|
||||
{
|
||||
"name": "fibu_objekte_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`.`parent_typ` AS `parent_typ`,`fo`.`parent_id` AS `parent_id`,`fo`.`parent_info` AS `parent_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`,'adresse' AS `parent_typ`,`auftrag`.`adresse` AS `parent_id`,`auftrag`.`name` AS `parent_info` 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`,'adresse' AS `parent_type`,`rechnung`.`adresse` AS `parent_id`,`rechnung`.`name` AS `parent_info` 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`,'adresse' AS `parent_type`,`gutschrift`.`adresse` AS `parent_id`,`gutschrift`.`name` AS `parent_info` 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`,'adresse' AS `parent_type`,`verbindlichkeit`.`adresse` AS `parent_id`,`adresse`.`name` AS `name` from (`verbindlichkeit` join `adresse` on(`verbindlichkeit`.`adresse` = `adresse`.`id`)) 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`,'konten' AS `parent_type`,`kontoauszuege`.`konto` AS `parent_id`,`konten`.`bezeichnung` AS `bezeichnung` 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`.`parent_typ` AS `parent_typ`,`fo`.`parent_id` AS `parent_id`,`fo`.`parent_info` AS `parent_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`,'adresse' AS `parent_typ`,`auftrag`.`adresse` AS `parent_id`,`auftrag`.`name` AS `parent_info` from `auftrag` where `auftrag`.`belegnr` <> '' union select `rechnung`.`datum` AS `datum`,'rechnung' AS `typ`,`rechnung`.`id` AS `id`,`rechnung`.`belegnr` AS `info`,'adresse' AS `parent_type`,`rechnung`.`adresse` AS `parent_id`,`rechnung`.`name` AS `parent_info` 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`,'adresse' AS `parent_type`,`gutschrift`.`adresse` AS `parent_id`,`gutschrift`.`name` AS `parent_info` 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`,'adresse' AS `parent_type`,`verbindlichkeit`.`adresse` AS `parent_id`,`adresse`.`name` AS `name` from (`verbindlichkeit` join `adresse` on(`verbindlichkeit`.`adresse` = `adresse`.`id`)) 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`,'konten' AS `parent_type`,`kontoauszuege`.`konto` AS `parent_id`,`konten`.`bezeichnung` AS `bezeichnung` 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",
|
||||
|
@ -3434,7 +3434,7 @@ class Auftrag extends GenAuftrag
|
||||
$zahlung['datum'],
|
||||
"<a href=\"index.php?module=".$zahlung['doc_typ']."&action=edit&id=".$zahlung['doc_id']."\">
|
||||
".ucfirst($zahlung['doc_typ'])."
|
||||
".$zahlung['doc_belegnr']."
|
||||
".$zahlung['doc_info']."
|
||||
</a>",
|
||||
$zahlung['betrag'],
|
||||
$zahlung['waehrung']
|
||||
|
@ -17,7 +17,7 @@
|
||||
<div class="col-xs-12 col-md-12 col-md-height">
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset>
|
||||
<legend>{|Buchung|}</legend>
|
||||
<legend>{|Einzelbuchung bearbeiten.|}</legend>
|
||||
<table width="100%" border="0" class="mkTableFormular">
|
||||
<tr>
|
||||
<tr>
|
||||
|
@ -9,18 +9,24 @@
|
||||
<div class="row-height">
|
||||
<div class="col-xs-12 col-md-12 col-md-height">
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset>
|
||||
<legend>
|
||||
{|Buchung|}
|
||||
</legend>
|
||||
<legend>
|
||||
Saldo: <u>[DOC_SALDO]</u><br>
|
||||
"[DOC_ZUORDNUNG]"
|
||||
</legend>
|
||||
<form action="" method="post" id="buchungenform">
|
||||
[TAB1]
|
||||
</form>
|
||||
</fieldset>
|
||||
<form action="" method="post" id="buchungenform">
|
||||
<fieldset>
|
||||
<legend>{|Einzelsaldo zuordnen und auf mehrere Gegenbelege oder Sachkonto verbuchen.|}</legend>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
"[DOC_ZUORDNUNG]"
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Saldo: <u>[DOC_SALDO]</u>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
[TAB1]
|
||||
</form>
|
||||
<fieldset>
|
||||
<table>
|
||||
<legend>Stapelverarbeitung</legend>
|
||||
@ -32,13 +38,18 @@
|
||||
<select form="buchungenform" id="sel_aktion" name="sel_aktion">
|
||||
<option value="buchen">{|auf Ausgewählte buchen|}</option>
|
||||
<option value="buchen_diff_sachkonto">{|auf Ausgewählte buchen, Gegenbeleg auf Sachkonto ausgleichen|}</option>
|
||||
</select>
|
||||
</select> Sachkonto:
|
||||
<input type="text" form="buchungenform" id="sachkonto" name="sachkonto" value="">
|
||||
<button name="submit" form="buchungenform" value="BUCHEN" class="ui-button-icon">{|BUCHEN|}</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<form action="" method="post">
|
||||
<td>
|
||||
<input type="number" name="abschlag" id="abschlag" form="neuberechnen" value=[ABSCHLAG] />% Abschlag auf Buchungsbetrag</td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<form action="" method="post" id="neuberechnen">
|
||||
<td>
|
||||
<button name="submit" value="neuberechnen" class="ui-button-icon" style="width:100%;">
|
||||
{|Buchungen neu berechnen|}
|
||||
|
@ -4,7 +4,7 @@
|
||||
<li><a href="#tabs-2">Buchungen</a></li>
|
||||
</ul>
|
||||
<div id="tabs-1">
|
||||
<legend>Salden müssen über Gegenbuchungen ausgeglichen werden.</legend>
|
||||
<legend>Saldenübersicht. Salden müssen über Gegenbuchungen ausgeglichen werden.<br><br></legend>
|
||||
<form action="" enctype="multipart/form-data" method="POST">
|
||||
[MESSAGE]
|
||||
<div class="row">
|
||||
@ -12,7 +12,6 @@
|
||||
<div class="col-xs-12 col-md-10 col-md-height">
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset>
|
||||
<legend>{|Offene Einzelsalden|}</legend>
|
||||
[TAB1]
|
||||
</fieldset>
|
||||
</div>
|
||||
|
@ -10,7 +10,7 @@
|
||||
<div class="col-xs-12 col-md-12 col-md-height">
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset>
|
||||
<legend>{|Einzelsalden|}</legend>
|
||||
<legend>{|Einzelsalden zuordnen und auf Gegenbelege oder Sachkonto verbuchen.|}</legend>
|
||||
<div class="filter-box filter-usersave">
|
||||
<div class="filter-block filter-inline">
|
||||
<div class="filter-title">{|Filter|}</div>
|
||||
@ -42,10 +42,10 @@
|
||||
<tr>
|
||||
<td><input type="checkbox" value="1" id="autoalle" /> alle markieren
|
||||
<select form="buchungenform" id="sel_aktion" name="sel_aktion">
|
||||
<option value="vorschlag">{|auf Vorschläge buchen|}</option>
|
||||
<option value="vorschlag_diff_sachkonto">{|auf Vorschläge buchen, Gegenbeleg auf Sachkonto ausgleichen|}</option>
|
||||
<option value="vorschlag">{|auf Vorschlag buchen|}</option>
|
||||
<option value="vorschlag_diff_sachkonto">{|auf Vorschlag buchen, Gegenbeleg auf Sachkonto ausgleichen|}</option>
|
||||
<option value="sachkonto">{|auf Sachkonto buchen|}</option>
|
||||
</select>
|
||||
</select> Sachkonto:
|
||||
<input type="text" form="buchungenform" id="sachkonto" name="sachkonto" value="">
|
||||
<button name="submit" form="buchungenform" value="BUCHEN" class="ui-button-icon">{|BUCHEN|}</button>
|
||||
</td>
|
||||
|
@ -235,7 +235,7 @@ class Fibu_buchungen {
|
||||
' ',
|
||||
['sql' => 'COALESCE(fo.info,\'\')'],
|
||||
' ',
|
||||
['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).",')'))"],
|
||||
['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).",', ',".$this->app->erp->FormatMenge('(SUM(fbd.betrag)+saldonum)/SUM(fbd.betrag)*100',0).",'%)'))"],
|
||||
'</a> ',
|
||||
'<input type="text" name="vorschlaege[]" value="',
|
||||
['sql' => 'COALESCE(fo.typ,\'\')'],
|
||||
@ -244,6 +244,8 @@ class Fibu_buchungen {
|
||||
'" hidden/>'
|
||||
);
|
||||
|
||||
// ['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).",')'))"],
|
||||
|
||||
$werte = array (
|
||||
'<input type="number" step="0.01" name="werte[]" value="',
|
||||
['sql' => 'salden.saldonum'],
|
||||
@ -411,10 +413,10 @@ class Fibu_buchungen {
|
||||
case 'fibu_buchungen_einzelzuordnen':
|
||||
|
||||
$allowed['fibu_buchungen_einzelzuordnen'] = array('list');
|
||||
$heading = array('','Datum','Typ', 'Info', 'Übergeordnet', 'Saldo','Währung','Buchungsbetrag', 'Menü');
|
||||
$heading = array('','Datum','Typ', 'Info', 'Übergeordnet', 'Saldo','Währung','Berechnet','Buchungsbetrag', 'Menü');
|
||||
$width = array( );
|
||||
|
||||
$findcols = array('fo.id','fo.datum','fo.typ','fo.info','fo.parent_info','fba.betrag','waehrung','fba.betrag','fo.id');
|
||||
$findcols = array('fo.id','fo.datum','fo.typ','fo.info','fo.parent_info','fba.betrag','waehrung','fba.betrag','fba.betrag','fo.id');
|
||||
$searchsql = array('fo.typ','fo.info','fo.parent_info');
|
||||
|
||||
$defaultorder = 1;
|
||||
@ -427,6 +429,11 @@ class Fibu_buchungen {
|
||||
|
||||
$doc_typ = $this->app->User->GetParameter('fibu_buchungen_doc_typ');
|
||||
$doc_id = $this->app->User->GetParameter('fibu_buchungen_doc_id');
|
||||
$abschlag = $this->app->User->GetParameter('fibu_buchungen_abschlag');
|
||||
|
||||
if (!is_numeric($abschlag)) {
|
||||
$abschlag = 0;
|
||||
}
|
||||
|
||||
$auswahl = array (
|
||||
'<input type=\"text\" name=\"ids[]\" value=\"',
|
||||
@ -462,9 +469,11 @@ class Fibu_buchungen {
|
||||
'</a>'
|
||||
);
|
||||
|
||||
$calculated = 'CONVERT(COALESCE(-SUM(fba.betrag*(1-('.$abschlag.'/100))),0),DECIMAL(12,2))';
|
||||
|
||||
$werte = array (
|
||||
'<input type="number" step="0.01" name="werte[]" value="',
|
||||
['sql' => 'COALESCE(-SUM(fba.betrag),0)'],
|
||||
['sql' => $calculated],
|
||||
/* '" min="',
|
||||
['sql' => 'if(COALESCE(-SUM(fba.betrag),0) < 0,COALESCE(-SUM(fba.betrag),0),0)'],
|
||||
'" max="',
|
||||
@ -479,8 +488,9 @@ class Fibu_buchungen {
|
||||
".$this->app->erp->FormatUCfirst("fo.typ")." as typ,
|
||||
".$this->app->erp->ConcatSQL($objektlink)." AS info,
|
||||
".$this->app->erp->ConcatSQL($parentlink)." AS parent_info,
|
||||
SUM(fba.betrag) as saldonum,
|
||||
".$this->app->erp->FormatMenge('SUM(fba.betrag)',2)." as saldonum,
|
||||
waehrung,
|
||||
".$this->app->erp->FormatMenge($calculated,2)." as calculated,
|
||||
".$this->app->erp->ConcatSQL($werte)." AS werte
|
||||
FROM
|
||||
fibu_objekte fo
|
||||
@ -498,7 +508,7 @@ class Fibu_buchungen {
|
||||
|
||||
//echo($sql." WHERE ".$where." ".$groupby);
|
||||
|
||||
$sumcol= array(6);
|
||||
$sumcol= array(6,8);
|
||||
|
||||
break;
|
||||
}
|
||||
@ -567,8 +577,7 @@ class Fibu_buchungen {
|
||||
|
||||
/*
|
||||
* Edit fibu_buchungen item
|
||||
* If id is empty, create a new one
|
||||
*/
|
||||
*/
|
||||
|
||||
function fibu_buchungen_edit() {
|
||||
$id = $this->app->Secure->GetGET('id');
|
||||
@ -597,14 +606,14 @@ class Fibu_buchungen {
|
||||
$this->app->Tpl->Set('ID', $id);
|
||||
|
||||
$this->app->erp->MenuEintrag("index.php?module=fibu_buchungen&action=edit&id=$id", "Details");
|
||||
$this->app->erp->MenuEintrag("index.php?module=fibu_buchungen&action=list", "Zurück zur Übersicht");
|
||||
$this->app->erp->MenuEintrag("index.php?module=fibu_buchungen&action=list#tabs-2", "Zurück zur Übersicht");
|
||||
$id = $this->app->Secure->GetGET('id');
|
||||
$input = $this->GetInput();
|
||||
$submit = $this->app->Secure->GetPOST('submit');
|
||||
|
||||
if (empty($id)) {
|
||||
// New item
|
||||
$id = 'NULL';
|
||||
$this->fibu_buchungen_list();
|
||||
return;
|
||||
}
|
||||
|
||||
if ($submit != '')
|
||||
@ -648,6 +657,7 @@ class Fibu_buchungen {
|
||||
} else {
|
||||
$this->app->Tpl->Set('MESSAGE', "<div class=\"success\">Die Einstellungen wurden erfolgreich übernommen.</div>");
|
||||
}
|
||||
$this->fibu_rebuild_tables();
|
||||
}
|
||||
|
||||
|
||||
@ -871,6 +881,7 @@ class Fibu_buchungen {
|
||||
$doc_typ = $this->app->Secure->GetGET('typ');
|
||||
$this->app->User->SetParameter('fibu_buchungen_doc_typ', $doc_typ);
|
||||
|
||||
$this->app->erp->Headlines('Buchhaltung','zuordnen '.strtoupper($doc_typ));
|
||||
|
||||
$this->app->YUI->TableSearch('TAB1', 'fibu_buchungen_zuordnen', "show", "", "", basename(__FILE__), __CLASS__);
|
||||
$this->app->YUI->TableSearch('TAB2', 'fibu_buchungen_list', "show", "", "", basename(__FILE__), __CLASS__);
|
||||
@ -905,6 +916,8 @@ class Fibu_buchungen {
|
||||
$this->app->User->SetParameter('fibu_buchungen_doc_id', $von_id);
|
||||
$aktion = $this->app->Secure->GetPOST('sel_aktion');
|
||||
$sachkonto = $this->app->Secure->GetPOST('sachkonto');
|
||||
$abschlag = $this->app->Secure->GetPOST('abschlag');
|
||||
$this->app->User->SetParameter('fibu_buchungen_abschlag', $abschlag);
|
||||
|
||||
$account_id = null;
|
||||
if (!empty($sachkonto)) {
|
||||
@ -1006,15 +1019,19 @@ class Fibu_buchungen {
|
||||
}
|
||||
|
||||
// Reload after booking
|
||||
$sql = "SELECT doc_typ, doc_id, doc_info, waehrung, sum(betrag) as saldonum,".$this->app->erp->FormatMenge("sum(betrag)",2)." as saldo FROM fibu_buchungen_alle WHERE typ = '".$von_typ."' AND id = '".$von_id."'";
|
||||
$von_row = $this->app->DB->SelectArr($sql)[0];
|
||||
$von_info = $von_row['doc_info'];
|
||||
$von_saldonum = $von_row['saldonum'];
|
||||
$von_saldo = $von_row['saldo'];
|
||||
$von_waehrung = $von_row['waehrung'];
|
||||
$sql = "SELECT fo.info, fb.waehrung, sum(fb.betrag) as saldonum,".$this->app->erp->FormatMenge("sum(fb.betrag)",2)." as saldo FROM fibu_buchungen_alle fb INNER JOIN fibu_objekte fo ON fb.typ = fo.typ AND fb.id = fo.id WHERE fb.typ = '".$von_typ."' AND fb.id = '".$von_id."'";
|
||||
$row = $this->app->DB->SelectArr($sql)[0];
|
||||
|
||||
$this->app->Tpl->Set('DOC_ZUORDNUNG', ucfirst($von_typ)." ".$von_info);
|
||||
$this->app->Tpl->Set('DOC_SALDO',$von_saldo." ".$von_waehrung);
|
||||
$saldonum = $row['saldonum'];
|
||||
$saldo = $row['saldo'];
|
||||
$waehrung = $row['waehrung'];
|
||||
$info = $row['info'];
|
||||
|
||||
$this->app->Tpl->Set('DOC_ZUORDNUNG', ucfirst($von_typ)." ".$info);
|
||||
$this->app->Tpl->Set('DOC_SALDO',$saldo." ".$waehrung);
|
||||
$this->app->Tpl->Set('ABSCHLAG',$abschlag);
|
||||
|
||||
$this->app->erp->Headlines('Buchhaltung','Einzelzuordnung '.strtoupper($von_typ));
|
||||
|
||||
$this->app->YUI->TableSearch('TAB1', 'fibu_buchungen_einzelzuordnen', "show", "", "", basename(__FILE__), __CLASS__);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user