my $dbh = $form->dbconnect($myconfig);
my $query = qq{
SELECT c.accno, c.description, c.charttype, c.category,
- c.link, c.pos_bilanz, c.pos_eur, c.new_chart_id, c.valid_from,
+ c.link, c.pos_bilanz, c.pos_eur, c.pos_er, c.new_chart_id, c.valid_from,
c.pos_bwa, datevautomatik,
tk.taxkey_id, tk.pos_ustva, tk.tax_id,
tk.tax_id || '--' || tk.taxkey_id AS tax, tk.startdate
pos_bwa = ?,
pos_bilanz = ?,
pos_eur = ?,
+ pos_er = ?,
new_chart_id = ?,
valid_from = ?,
datevautomatik = ?
conv_i($form->{pos_bwa}),
conv_i($form->{pos_bilanz}),
conv_i($form->{pos_eur}),
+ conv_i($form->{pos_er}),
conv_i($form->{new_chart_id}),
conv_date($form->{valid_from}),
($form->{datevautomatik} eq 'T') ? 'true':'false',
new_chart_id => { type => 'integer' },
pos_bilanz => { type => 'integer' },
pos_bwa => { type => 'integer' },
+ pos_er => { type => 'integer' },
pos_eur => { type => 'integer' },
taxkey_id => { type => 'integer' },
valid_from => { type => 'date' },
my ($inclusion);
if ($category eq 'I') {
- $inclusion = "AND pos_eur = NULL OR pos_eur > '0' AND pos_eur <= '5'";
+ $inclusion = "AND pos_er = NULL OR pos_er > '0' AND pos_er <= '5'";
} elsif ($category eq 'E') {
- $inclusion = "AND pos_eur = NULL OR pos_eur >= '6' AND pos_eur < '100'";
+ $inclusion = "AND pos_er = NULL OR pos_er >= '6' AND pos_er < '100'";
} else {
$inclusion = "";
}
}
my $select_eur = q|<option value=""> |. $locale->text('None') .q|</option>\n|;
- my %eur;
- if (($form->{country_mode} = SL::DB::Default->get->country_mode) eq 'CH') {
- %eur = (
- 1 => "Ertrag",
- 6 => "Aufwand",
- );
- } else {
- %eur = (
- 1 => "Umsatzerlöse",
- 2 => "sonstige Erlöse",
- 3 => "Privatanteile",
- 4 => "Zinserträge",
- 5 => "Ausserordentliche Erträge",
- 6 => "Vereinnahmte Umsatzst.",
- 7 => "Umsatzsteuererstattungen",
- 8 => "Wareneingänge",
- 9 => "Löhne und Gehälter",
- 10 => "Gesetzl. sozialer Aufw.",
- 11 => "Mieten",
- 12 => "Gas, Strom, Wasser",
- 13 => "Instandhaltung",
- 14 => "Steuern, Versich., Beiträge",
- 15 => "Kfz-Steuern",
- 16 => "Kfz-Versicherungen",
- 17 => "Sonst. Fahrzeugkosten",
- 18 => "Werbe- und Reisekosten",
- 19 => "Instandhaltung u. Werkzeuge",
- 20 => "Fachzeitschriften, Bücher",
- 21 => "Miete für Einrichtungen",
- 22 => "Rechts- und Beratungskosten",
- 23 => "Bürobedarf, Porto, Telefon",
- 24 => "Sonstige Aufwendungen",
- 25 => "Abschreibungen auf Anlagever.",
- 26 => "Abschreibungen auf GWG",
- 27 => "Vorsteuer",
- 28 => "Umsatzsteuerzahlungen",
- 29 => "Zinsaufwand",
- 30 => "Ausserordentlicher Aufwand",
- 31 => "Betriebliche Steuern",
- );
- }
+ my %eur = (
+ 1 => "Umsatzerlöse",
+ 2 => "sonstige Erlöse",
+ 3 => "Privatanteile",
+ 4 => "Zinserträge",
+ 5 => "Ausserordentliche Erträge",
+ 6 => "Vereinnahmte Umsatzst.",
+ 7 => "Umsatzsteuererstattungen",
+ 8 => "Wareneingänge",
+ 9 => "Löhne und Gehälter",
+ 10 => "Gesetzl. sozialer Aufw.",
+ 11 => "Mieten",
+ 12 => "Gas, Strom, Wasser",
+ 13 => "Instandhaltung",
+ 14 => "Steuern, Versich., Beiträge",
+ 15 => "Kfz-Steuern",
+ 16 => "Kfz-Versicherungen",
+ 17 => "Sonst. Fahrzeugkosten",
+ 18 => "Werbe- und Reisekosten",
+ 19 => "Instandhaltung u. Werkzeuge",
+ 20 => "Fachzeitschriften, Bücher",
+ 21 => "Miete für Einrichtungen",
+ 22 => "Rechts- und Beratungskosten",
+ 23 => "Bürobedarf, Porto, Telefon",
+ 24 => "Sonstige Aufwendungen",
+ 25 => "Abschreibungen auf Anlagever.",
+ 26 => "Abschreibungen auf GWG",
+ 27 => "Vorsteuer",
+ 28 => "Umsatzsteuerzahlungen",
+ 29 => "Zinsaufwand",
+ 30 => "Ausserordentlicher Aufwand",
+ 31 => "Betriebliche Steuern");
foreach my $item (sort({ $a <=> $b } keys(%eur))) {
my $text = H($::locale->{iconv_utf8}->convert($eur{$item}));
if ($item == $form->{pos_eur}) {
}
+ my $select_er = q|<option value=""> |. $locale->text('None') .q|</option>\n|;
+ my %er = (
+ 1 => "Ertrag",
+ 6 => "Aufwand");
+ foreach my $item (sort({ $a <=> $b } keys(%er))) {
+ my $text = H($::locale->{iconv_utf8}->convert($eur{$item}));
+ if ($item == $form->{pos_er}) {
+ $select_er .= qq|<option value=$item selected>|. sprintf("%.2d", $item) .qq|. $text</option>\n|;
+ } else {
+ $select_er .= qq|<option value=$item>|. sprintf("%.2d", $item) .qq|. $text</option>\n|;
+ }
+
+ }
+
my $select_bwa = q|<option value=""> |. $locale->text('None') .q|</option>\n|;
my %bwapos = (
select_bwa => $select_bwa,
select_bilanz => $select_bilanz,
select_eur => $select_eur,
+ select_er => $select_er,
};
# Ausgabe des Templates
--- /dev/null
+-- @tag: chart_pos_er
+-- @description: pos_er Feld in Konten für die Position ind er Erfolgsrechnung
+-- @depends: release_3_3_0
+-- @encoding: utf-8
+
+ALTER TABLE chart ADD COLUMN pos_er INTEGER;
DELETE FROM chart;
-INSERT INTO chart (accno, description, charttype, category, link, gifi_accno, taxkey_id, pos_ustva, pos_bwa, pos_bilanz, pos_eur, datevautomatik, valid_from) VALUES
+INSERT INTO chart (accno, description, charttype, category, link, gifi_accno, taxkey_id, pos_ustva, pos_bwa, pos_bilanz, pos_er, datevautomatik, valid_from) VALUES
('1', 'AKTIVEN','H','','','1',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'),
('10', 'UMLAUFSVERMÖGEN','H','','','10',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'),
('100', 'Flüssige Mittel','H','','','100',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'),
DELETE FROM chart;
-INSERT INTO chart (accno, description, charttype, category, link, gifi_accno, taxkey_id, pos_ustva, pos_bwa, pos_bilanz, pos_eur, datevautomatik, valid_from) VALUES
+INSERT INTO chart (accno, description, charttype, category, link, gifi_accno, taxkey_id, pos_ustva, pos_bwa, pos_bilanz, pos_er, datevautomatik, valid_from) VALUES
('1', 'AKTIVEN','H','','','1',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'),
('10', 'UMLAUFSVERMÖGEN','H','','','10',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'),
('100', 'Flüssige Mittel','H','','','100',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'),
<tr>
<th align="left">[% 'Taxkey' | $T8 %]</th>
<th align="left">[% 'valid from' | $T8 %]</th>
- [% IF country_mode != 'CH' %]
- <th align="left">[% 'pos_ustva' | $T8 %]</th>
- [% END %]
+ <th align="left">[% 'pos_ustva' | $T8 %]</th>
<th align="left">[% 'delete' | $T8 %] ? </th>
</tr>
[% FOREACH tk = ACCOUNT_TAXKEYS %]
<input type="hidden" name="taxkey_id_[% tk.runningnumber %]" value="[% tk.id %]">
<td><select name="taxkey_tax_[% tk.runningnumber %]">[% tk.selecttaxkey %]</select></td>
<td><input name="taxkey_startdate_[% tk.runningnumber %]" value="[% HTML.escape(tk.startdate) %]"></td>
- [% IF country_mode != 'CH' %]
- <td><select name="taxkey_pos_ustva_[% tk.runningnumber %]">[% tk.select_tax %]</select></td>
- [% END %]
+ <td><select name="taxkey_pos_ustva_[% tk.runningnumber %]">[% tk.select_tax %]</select></td>
<td><input name="taxkey_del_[% tk.runningnumber %]" type="checkbox"
class="checkbox" value="delete"></td>
[% ELSE %]
<input type="hidden" name="taxkey_id_[% tk.runningnumber %]" value="NEW">
<td><select name="taxkey_tax_[% tk.runningnumber %]">[% tk.selecttaxkey %]</select></td>
<td><input name="taxkey_startdate_[% tk.runningnumber %]" value="[% HTML.escape(tk.startdate) %]"></td>
- [% IF country_mode != 'CH' %]
- <td><select name="taxkey_pos_ustva_[% tk.runningnumber %]">[% tk.select_tax %]</select></td>
- [% END %]
+ <td><select name="taxkey_pos_ustva_[% tk.runningnumber %]">[% tk.select_tax %]</select></td>
<td> </td>
[% END %]
</tr>
<th align="left">[% 'EUER' | $T8 %]</th>
<td colspan="3"><select name="pos_eur">[% select_eur %]</select></td>
</tr>
- [% IF country_mode != 'CH' %]
+ <tr>
+ <th align="left">[% 'Erfolgsrechnung' | $T8 %]</th>
+ <td colspan="3"><select name="pos_er">[% select_er %]</select></td>
+ </tr>
<tr>
<th align="left">[% 'BWA' | $T8 %]</th>
<td colspan="3"><select name="pos_bwa">[% select_bwa %]</select></td>
<th align="left">[% 'Datevautomatik' | $T8 %]</th>
<td colspan="3"><input name="datevautomatik" type="checkbox" class="checkbox" value="T" [% IF datevautomatik %]checked [% END %]>[% 'If checked the taxkey will not be exported in the DATEV Export, but only IF chart taxkeys differ from general ledger taxkeys' | $T8 %] </td>
</tr>
- [% END %]
<tr>
<th align="left">[% 'Folgekonto' | $T8 %]</th>
<td><select name="new_chart_id">[% selectnewaccount %]</select></td>