From fa654209d149de56340fa28d3f57678bb81562c9 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 4 May 2007 15:51:40 +0000 Subject: [PATCH] Funktion "show_invoices" auf die Verwendung von HTML-Vorlagen umgestellt. --- bin/mozilla/dn.pl | 181 ++---------------- locale/de/dn | 6 - .../webpages/dunning/show_invoices_de.html | 84 ++++++++ .../dunning/show_invoices_master.html | 84 ++++++++ 4 files changed, 179 insertions(+), 176 deletions(-) create mode 100644 templates/webpages/dunning/show_invoices_de.html create mode 100644 templates/webpages/dunning/show_invoices_master.html diff --git a/bin/mozilla/dn.pl b/bin/mozilla/dn.pl index 65b3bc36f..52f6cd55d 100644 --- a/bin/mozilla/dn.pl +++ b/bin/mozilla/dn.pl @@ -86,184 +86,25 @@ sub show_invoices { DN->get_invoices(\%myconfig, \%$form); $form->{title} = $locale->text('Start Dunning Process'); - if (@{ $form->{DUNNING_CONFIG} }) { - foreach $item (@{ $form->{DUNNING_CONFIG} }) { - $form->{selectdunning} .= - ""; - } - } - - - $form->{nextsub} = "save_dunning"; - - $form->{jsscript} = 1; - $form->{javascript} .= qq||; - - $form->{callback} = - "$form->{script}?action=show_invoices&login=$form->{login}&password=$form->{password}&customer=$form->{customer}&invnumber=$form->{invnumber}&ordnumber=$form->{ordnumber}&paymentuntil=$form->{paymentuntil}&groupinvoices=$form->{groupinvoices}&minamount=$form->{minamount}&dunning_level=$form->{dunning_level}¬es=$form->{notes}" - unless $form->{callback}; - - @column_index = qw(dunning_description dunning_description_next active email customername invnumber invdate inv_duedate amount next_duedate fee interest ); - - $column_header{dunning_description} = - qq|| - . $locale->text('Current / Next Level') - . qq||; - $column_header{active} = - qq|| - . NTI($cgi->checkbox('-name' => 'selectall_active', - '-label' => $locale->text('Active?'), - '-checked' => 0, - '-onclick' => "checkbox_check_all('selectall_active', 'active_', 1, " . scalar(@{ $form->{DUNNINGS} }) . ")")) - . qq||; - $column_header{email} = - qq|| - . NTI($cgi->checkbox('-name' => 'selectall_email', - '-label' => $locale->text('eMail?'), - '-checked' => 0, - '-onclick' => "checkbox_check_all('selectall_email', 'email_', 1, " . scalar(@{ $form->{DUNNINGS} }) . ")")) - . qq||; - $column_header{customername} = - qq|| - . $locale->text('Customername') - . qq||; - $column_header{invnumber} = - qq|| - . $locale->text('Invno.') - . qq||; - $column_header{inv_duedate} = - qq|| - . $locale->text('Inv. Duedate') - . qq||; - $column_header{next_duedate} = - qq|| - . $locale->text('Dunning Duedate') - . qq||; - $column_header{invdate} = - qq|| - . $locale->text('Invdate') - . qq||; - $column_header{amount} = - qq|| - . $locale->text('Amount') - . qq||; - $column_header{fee} = - qq|| - . $locale->text('Total Fees') - . qq||; - $column_header{interest} = - qq|| - . $locale->text('Interest') - . qq||; - - $form->header; - - - print qq| - - - -
{script}> + foreach my $row (@{ $form->{DUNNINGS} }) { + $row->{DUNNING_CONFIG} = [ map +{ %{ $_ } }, @{ $form->{DUNNING_CONFIG} } ]; - - - - - - - |; - map { print "$column_header{$_}\n" if $column_header{$_}; } @column_index; - - print qq| - -|; - my $i = 0; - foreach $ref (@{ $form->{DUNNINGS} }) { - - $i++; - my $j = $i % 2; - - print qq| - -|; - - $form->{selectdunning} =~ s/ selected//g; - if ($ref->{next_dunning_config_id} ne "") { - $form->{selectdunning} =~ s/value=$ref->{next_dunning_config_id}/value=$ref->{next_dunning_config_id} selected/; + if ($row->{next_dunning_config_id}) { + map { $_->{SELECTED} = $_->{id} == $row->{next_dunning_config_id} } @{ $row->{DUNNING_CONFIG } }; } - - $column_data{dunning_description} = - qq||; - $column_data{dunning_description_next} = - qq||; - my $active = ($ref->{active}) ? "checked" : ""; - $column_data{active} = - qq||; - my $email = ($ref->{email}) ? "checked" : ""; - $column_data{email} = - qq||; - $column_data{next_duedate} = qq||; - - $column_data{inv_duedate} = qq||; - $column_data{invdate} = qq||; - $column_data{invnumber} = qq||; - $column_data{customername} = qq||; - - map { $column_data{$_} = - qq|| - } qw(amount fee interest); - - map { print "$column_data{$_}\n" } @column_index; - - print qq| - -|; + map { $row->{$_} = $form->format_amount(\%myconfig, $row->{$_} * 1, -2) } qw(amount fee interest); } - $form->{rowcount} = $i; + $form->{rowcount} = scalar @{ $form->{DUNNINGS} }; + $form->{jsscript} = 1; + $form->{callback} ||= build_std_url("action=show_invoices", qw(login password customer invnumber ordnumber groupinvoices minamount dunning_level notes)); - print qq| -
$form->{title}
| - . qq|| - . qq|| - . ($ref->{dunning_level} ? $ref->{dunning_level} : " ") - . qq|| - . qq|| - . qq|$ref->{next_duedate}$ref->{duedate}$ref->{transdate}$ref->{invnumber}$ref->{customername}| - . H($form->format_amount(\%myconfig, $ref->{$_} * 1, -2)) - . qq|
- - - -
- -|; - print_options(); - print qq| -
-{script}> - - - - - - - -{login}> -{password}> - - - -
- - - -|; + $form->{PRINT_OPTIONS} = print_options(1); + $form->header(); + print $form->parse_html_template("dunning/show_invoices"); $lxdebug->leave_sub(); - } sub save { diff --git a/locale/de/dn b/locale/de/dn index 1b091657d..a14701cd5 100644 --- a/locale/de/dn +++ b/locale/de/dn @@ -2,7 +2,6 @@ $self->{texts} = { ' Date missing!' => ' Datum fehlt!', '*/' => '*/', 'ADDED' => 'Hinzugefügt', - 'Active?' => 'Aktiviert?', 'Add Purchase Order' => 'Lieferantenauftrag erfassen', 'Add Quotation' => 'Angebot erfassen', 'Add Request for Quotation' => 'Anfrage erfassen', @@ -27,7 +26,6 @@ $self->{texts} = { 'Could not create dunning copy!' => 'Eine Kopie der Zahlungserinnerung konnte nicht erstellt werden.', 'Country' => 'Land', 'Credit Note' => 'Gutschrift', - 'Current / Next Level' => 'Aktuelles / Nächstes Mahnlevel', 'Customer' => 'Kunde', 'Customer Number' => 'Kundennummer', 'Customer not on file or locked!' => 'Dieser Kunde existiert nicht oder ist gesperrt.', @@ -68,10 +66,8 @@ gestartet', 'History' => 'Historie', 'In-line' => 'im Text', 'Interest' => 'Zinsen', - 'Inv. Duedate' => 'Rg. Fälligkeit', 'Invdate' => 'Rechnungsdatum', 'Invdate from' => 'Rechnungen von', - 'Invno.' => 'Rg. Nr.', 'Invnumber' => 'Rechnungsnummer', 'Invoice' => 'Rechnung', 'Invoice Date missing!' => 'Rechnungsdatum fehlt!', @@ -181,7 +177,6 @@ gestartet', 'Subtotal' => 'Zwischensumme', 'Terms missing in row ' => '+Tage fehlen in Zeile ', 'The \'tag\' field must only consist of alphanumeric characters or the carachters - _ ( )' => 'Das Feld \'tag\' darf nur aus alphanumerischen Zeichen und den Zeichen - _ ( ) bestehen.', - 'The dunning process started' => 'Der Mahnprozess ist gestartet.', 'To' => 'An', 'Total Fees' => 'Kumulierte Gebühren', 'Trying to call a sub without a name' => 'Es wurde versucht, eine Unterfunktion ohne Namen aufzurufen.', @@ -196,7 +191,6 @@ gestartet', 'Zipcode' => 'PLZ', 'bin_list' => 'Lagerliste', 'button' => '?', - 'eMail?' => 'eMail?', 'emailed to' => 'gemailt an', 'invoice' => 'Rechnung', 'none (pricegroup)' => 'keine', diff --git a/templates/webpages/dunning/show_invoices_de.html b/templates/webpages/dunning/show_invoices_de.html new file mode 100644 index 000000000..ab2849d37 --- /dev/null +++ b/templates/webpages/dunning/show_invoices_de.html @@ -0,0 +1,84 @@ + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Aktuelles / Nächstes Mahnlevel + + + + + + KundennameRg. Nr.RechnungsdatumRg. FälligkeitBetragZahlbar bisKumulierte GebührenZinsen
+ + +   + + + checked>checked>
+ +
+ + + +
+ + + + + + + + + + + + + + + + diff --git a/templates/webpages/dunning/show_invoices_master.html b/templates/webpages/dunning/show_invoices_master.html new file mode 100644 index 000000000..5d3487b69 --- /dev/null +++ b/templates/webpages/dunning/show_invoices_master.html @@ -0,0 +1,84 @@ + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current / Next Level + + + + + + CustomernameInvno.InvdateInv. DuedateAmountDunning DuedateTotal FeesInterest
+ + +   + + + checked>checked>
+ +
+ + + +
+ + + + + + + + + + + + + + + + -- 2.20.1