From: Moritz Bunkus Date: Thu, 12 Jul 2007 14:51:51 +0000 (+0000) Subject: Zahlungskonditionen: X-Git-Tag: release-2.4.3^2~11 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=52ee8da657d1d16b350d8b386a10d5f84b388204;p=kivitendo-erp.git Zahlungskonditionen: 1. Neue Variablen <%invtotal_wo_skonto%> und <%total_wo_skonto%> hinzugefügt, die die Belegsumme bzw. die noch offene Summe abzüglich des Skontobetrags beinhalten. 2. Die Variablen <%total%> und <%invtotal%> waren nur bei Rechnungen gefüllt, nicht aber bei Angeboten und Aufträgen. --- diff --git a/SL/Form.pm b/SL/Form.pm index b9ef3e1d4..7e5c8736d 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -1370,12 +1370,29 @@ sub set_payment_options { ($self->{netto_date}, $self->{skonto_date}) = selectrow_query($self, $dbh, $query, $transdate, $self->{terms_netto}, $transdate, $self->{terms_skonto}); - my $total = ($self->{invtotal}) ? $self->{invtotal} : $self->{ordtotal}; - my $skonto_amount = $self->parse_amount($myconfig, $total) * - $self->{percent_skonto}; + my ($invtotal, $total); + my (%amounts, %formatted_amounts); - $self->{skonto_amount} = - $self->format_amount($myconfig, $skonto_amount, 2); + if ($self->{type} =~ /_order$/) { + $amounts{invtotal} = $self->{ordtotal}; + $amounts{total} = $self->{ordtotal}; + + } elsif ($self->{type} =~ /_quotation$/) { + $amounts{invtotal} = $self->{quototal}; + $amounts{total} = $self->{quototal}; + + } else { + $amounts{invtotal} = $self->{invtotal}; + $amounts{total} = $self->{total}; + } + + map { $amounts{$_} = $self->parse_amount($myconfig, $amounts{$_}) } keys %amounts; + + $amounts{skonto_amount} = $amounts{invtotal} * $self->{percent_skonto}; + $amounts{invtotal_wo_skonto} = $amounts{invtotal} * (1 - $self->{percent_skonto}); + $amounts{total_wo_skonto} = $amounts{total} * (1 - $self->{percent_skonto}); + + map { $formatted_amounts{$_} = $self->format_amount($myconfig, $amounts{$_}, 2) } keys %amounts; if ($self->{"language_id"}) { $query = @@ -1403,23 +1420,21 @@ sub set_payment_options { ($output_numberformat ne $myconfig->{"numberformat"})) { my $saved_numberformat = $myconfig->{"numberformat"}; $myconfig->{"numberformat"} = $output_numberformat; - $self->{skonto_amount} = - $self->format_amount($myconfig, $skonto_amount, 2); + map { $formatted_amounts{$_} = $self->format_amount($myconfig, $amounts{$_}) } keys %amounts; $myconfig->{"numberformat"} = $saved_numberformat; } } $self->{payment_terms} =~ s/<%netto_date%>/$self->{netto_date}/g; $self->{payment_terms} =~ s/<%skonto_date%>/$self->{skonto_date}/g; - $self->{payment_terms} =~ s/<%skonto_amount%>/$self->{skonto_amount}/g; - $self->{payment_terms} =~ s/<%total%>/$self->{total}/g; - $self->{payment_terms} =~ s/<%invtotal%>/$self->{invtotal}/g; $self->{payment_terms} =~ s/<%currency%>/$self->{currency}/g; $self->{payment_terms} =~ s/<%terms_netto%>/$self->{terms_netto}/g; $self->{payment_terms} =~ s/<%account_number%>/$self->{account_number}/g; $self->{payment_terms} =~ s/<%bank%>/$self->{bank}/g; $self->{payment_terms} =~ s/<%bank_code%>/$self->{bank_code}/g; + map { $self->{payment_terms} =~ s/<%${_}%>/$formatted_amounts{$_}/g; } keys %formatted_amounts; + $main::lxdebug->leave_sub(); } diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl index 87ec9b30d..7f9887753 100644 --- a/bin/mozilla/am.pl +++ b/bin/mozilla/am.pl @@ -2299,8 +2299,12 @@ sub payment_header {
  • | . $locale->text("<%skonto_amount%> -- The deductible amount") . qq|
  • | . $locale->text("<%total%> -- Amount payable") +. qq|
  • +
  • | . $locale->text("<%total_wo_skonto%> -- Amount payable less discount") . qq|
  • | . $locale->text("<%invtotal%> -- Invoice total") +. qq|
  • +
  • | . $locale->text("<%invtotal_wo_skonto%> -- Invoice total less discount") . qq|
  • | . $locale->text("<%currency%> -- The selected currency") . qq|
  • diff --git a/doc/changelog b/doc/changelog index 49a9f7dc0..90c1dd914 100644 --- a/doc/changelog +++ b/doc/changelog @@ -7,6 +7,9 @@ Neue Features und Verbesserungen: + - Zahlungskonditionen: Neue Variablen <%invtotal_wo_skonto%> und + <%total_wo_skonto%> hinzugefügt, die die Belegsumme bzw. die noch + offene Summe abzüglich des Skontobetrags beinhalten. - Verkauf: Es wird der Ertrag (Marge) pro Position und gesamt angezeigt. - Bei allen Listenansichten/Berichten Buttons zum Export der Liste @@ -117,6 +120,9 @@ Bugfixes: + - Zahlungskonditionen: Die Variablen <%total%> und <%invtotal%> + waren nur bei Rechnungen gefüllt, nicht aber bei Angeboten und + Aufträgen. - Es wurde verhindert, dass durch Manipulation von $form->{callback} beliebiger Code ausgeführt werden kann. - Webdav: Wenn eine Pfadkomponente Leerzeichen enthielt diff --git a/locale/de/all b/locale/de/all index 8c823a058..82c4a9968 100644 --- a/locale/de/all +++ b/locale/de/all @@ -13,11 +13,13 @@ $self->{texts} = { '<%bank_code%> -- Your bank code' => '<%bank_code%> -- Die Bankleitzahl Ihrer Bank', '<%currency%> -- The selected currency' => '<%currency%> -- Die ausgewählte Währung', '<%invtotal%> -- Invoice total' => '<%invtotal%> -- Die Rechnungssumme', + '<%invtotal_wo_skonto%> -- Invoice total less discount' => '<%invtotal_wo_skonto%> -- Rechnungssumme abzüglich Skonto', '<%netto_date%> -- Date the payment is due in full' => '<%netto_date%> -- Das Datum, bis die Rechnung in voller Höhe bezahlt werden muss', '<%skonto_amount%> -- The deductible amount' => '<%skonto_amount%> -- Der abziehbare Skontobetrag', '<%skonto_date%> -- Date the payment is due with discount' => '<%skonto_date%> -- Das Datum, bis die Rechnung unter Abzug von Skonto bezahlt werden kann', '<%terms_netto%> -- The number of days for full payment' => '<%terms_netto%> -- Die Anzahl Tage, bis die Rechnung in voller Höhe bezahlt werden muss', '<%total%> -- Amount payable' => '<%total%> -- Noch zu bezahlender Betrag', + '<%total_wo_skonto%> -- Amount payable less discount' => '<%total_wo_skonto%> -- Noch zu bezahlender Betrag abzüglich Skonto', '*/' => '*/', '...done' => '...fertig', '1. Quarter' => '1. Quartal', diff --git a/locale/de/am b/locale/de/am index 18a0a909c..8e32167ba 100644 --- a/locale/de/am +++ b/locale/de/am @@ -4,11 +4,13 @@ $self->{texts} = { '<%bank_code%> -- Your bank code' => '<%bank_code%> -- Die Bankleitzahl Ihrer Bank', '<%currency%> -- The selected currency' => '<%currency%> -- Die ausgewählte Währung', '<%invtotal%> -- Invoice total' => '<%invtotal%> -- Die Rechnungssumme', + '<%invtotal_wo_skonto%> -- Invoice total less discount' => '<%invtotal_wo_skonto%> -- Rechnungssumme abzüglich Skonto', '<%netto_date%> -- Date the payment is due in full' => '<%netto_date%> -- Das Datum, bis die Rechnung in voller Höhe bezahlt werden muss', '<%skonto_amount%> -- The deductible amount' => '<%skonto_amount%> -- Der abziehbare Skontobetrag', '<%skonto_date%> -- Date the payment is due with discount' => '<%skonto_date%> -- Das Datum, bis die Rechnung unter Abzug von Skonto bezahlt werden kann', '<%terms_netto%> -- The number of days for full payment' => '<%terms_netto%> -- Die Anzahl Tage, bis die Rechnung in voller Höhe bezahlt werden muss', '<%total%> -- Amount payable' => '<%total%> -- Noch zu bezahlender Betrag', + '<%total_wo_skonto%> -- Amount payable less discount' => '<%total_wo_skonto%> -- Noch zu bezahlender Betrag abzüglich Skonto', 'A unit with this name does already exist.' => 'Eine Einheit mit diesem Namen existiert bereits.', 'ADDED' => 'Hinzugefügt', 'Account' => 'Konto',