From 09685616f65f95b3189049855dfc53d2bf1ef271 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 12 Dec 2008 12:34:27 +0000 Subject: [PATCH] Bei Kreditorenbuchungsberichten in der Typ-Spalte auch Stornos gesondert ausweisen. --- SL/AP.pm | 6 +++--- bin/mozilla/ap.pl | 17 ++++++++++++++--- locale/de/all | 4 +++- locale/de/ap | 4 ++++ 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/SL/AP.pm b/SL/AP.pm index 763fd3374..1b7c1d84a 100644 --- a/SL/AP.pm +++ b/SL/AP.pm @@ -399,7 +399,7 @@ sub ap_transactions { my $query = qq|SELECT a.id, a.invnumber, a.transdate, a.duedate, a.amount, a.paid, | . qq| a.ordnumber, v.name, a.invoice, a.netamount, a.datepaid, a.notes, | . - qq| a.globalproject_id, | . + qq| a.globalproject_id, a.storno, a.storno_id, | . qq| pr.projectnumber AS globalprojectnumber, | . qq| e.name AS employee | . qq|FROM ap a | . @@ -407,7 +407,7 @@ sub ap_transactions { qq|LEFT JOIN employee e ON (a.employee_id = e.id) | . qq|LEFT JOIN project pr ON (a.globalproject_id = pr.id) |; - my $where = qq| WHERE COALESCE(storno, false) != true |; + my $where = ''; my @values; if ($form->{vendor_id}) { @@ -458,7 +458,7 @@ sub ap_transactions { } if ($where) { -# substr($where, 0, 4) = "WHERE"; + substr($where, 0, 4, " WHERE "); $query .= $where; } diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl index 086980d7f..2deb9cb5f 100644 --- a/bin/mozilla/ap.pl +++ b/bin/mozilla/ap.pl @@ -1493,9 +1493,20 @@ sub ap_transactions { map { $ap->{$_} = $form->format_amount(\%myconfig, $ap->{$_}, 2) } qw(netamount tax amount paid due); - $ap->{type} = - $ap->{invoice} ? $locale->text("Invoice (one letter abbreviation)") : - $locale->text("AP Transaction (abbreviation)"); + my $is_storno = $ap->{storno} && $ap->{storno_id}; + my $has_storno = $ap->{storno} && !$ap->{storno_id}; + + if ($ap->{invoice}) { + $ap->{type} = + $has_storno ? $locale->text("Invoice with Storno (abbreviation)") + : $is_storno ? $locale->text("Storno (one letter abbreviation)") + : $locale->text("Invoice (one letter abbreviation)"); + } else { + $ap->{type} = + $has_storno ? $locale->text("AP Transaction with Storno (abbreviation)") + : $is_storno ? $locale->text("AP Transaction Storno (one letter abbreviation)") + : $locale->text("AP Transaction (abbreviation)"); + } my $row = { }; diff --git a/locale/de/all b/locale/de/all index 23ea1505e..b24628009 100644 --- a/locale/de/all +++ b/locale/de/all @@ -42,6 +42,8 @@ $self->{texts} = { 'AP Aging' => 'Offene Verbindlichkeiten', 'AP Transaction' => 'Kreditorenbuchung', 'AP Transaction (abbreviation)' => 'K', + 'AP Transaction Storno (one letter abbreviation)' => 'S', + 'AP Transaction with Storno (abbreviation)' => 'K(S)', 'AP Transactions' => 'Kreditorenbuchungen', 'AR' => 'Verkauf', 'AR Aging' => 'Offene Forderungen', @@ -474,7 +476,6 @@ $self->{texts} = { 'Difference' => 'Differenz', 'Dimension unit' => 'Maßeinheit', 'Directory' => 'Verzeichnis', - 'direct debit' => 'Lastschrift', 'Discount' => 'Rabatt', 'Display' => 'Anzeigen', 'Display file' => 'Datei anzeigen', @@ -1679,6 +1680,7 @@ $self->{texts} = { 'debug' => 'Debug', 'delete' => 'Löschen', 'deliverydate' => 'Lieferdatum', + 'direct debit' => 'Lastschrift', 'disposed' => 'Entsorgung', 'done' => 'erledigt', 'down' => 'runter', diff --git a/locale/de/ap b/locale/de/ap index 338259eab..b0a9bd18d 100644 --- a/locale/de/ap +++ b/locale/de/ap @@ -6,6 +6,8 @@ $self->{texts} = { 'AP' => 'Einkauf', 'AP Transaction' => 'Kreditorenbuchung', 'AP Transaction (abbreviation)' => 'K', + 'AP Transaction Storno (one letter abbreviation)' => 'S', + 'AP Transaction with Storno (abbreviation)' => 'K(S)', 'AP Transactions' => 'Kreditorenbuchungen', 'AR' => 'Verkauf', 'AR Transaction' => 'Debitorenbuchung', @@ -106,6 +108,7 @@ $self->{texts} = { 'Invoice Date' => 'Rechnungsdatum', 'Invoice Date missing!' => 'Rechnungsdatum fehlt!', 'Invoice Number' => 'Rechnungsnummer', + 'Invoice with Storno (abbreviation)' => 'R(S)', 'Jan' => 'Jan', 'January' => 'Januar', 'Jul' => 'Jul', @@ -199,6 +202,7 @@ $self->{texts} = { 'Skip' => 'Überspringen', 'Source' => 'Beleg', 'Storno' => 'Storno', + 'Storno (one letter abbreviation)' => 'S', 'Storno Invoice' => 'Stornorechnung', 'Storno Packing List' => 'Stornolieferschein', 'Subject' => 'Betreff', -- 2.20.1