Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 35648bc6

Von Moritz Bunkus vor mehr als 17 Jahren hinzugefügt

  • ID 35648bc621535a6010d415ba2b3218a37ab2da07
  • Vorgänger a939b727
  • Nachfolger 15b4d5a3

Umstellung der Listenansicht der bestehenden Mahnungen auf die Verwendung der neuen ReportGenerator-Klasse.

Unterschiede anzeigen:

bin/mozilla/dn.pl
36 36
use SL::IS;
37 37
use SL::PE;
38 38
use SL::DN;
39
use SL::ReportGenerator;
39 40

  
40 41
require "bin/mozilla/common.pl";
42
require "bin/mozilla/report_generator.pl";
41 43
require "bin/mozilla/io.pl";
42 44
require "bin/mozilla/arap.pl";
43 45

  
......
155 157
    $form->{addition} = "SAVED FOR DUNNING";
156 158
  	$form->save_history($form->dbconnect(\%myconfig));
157 159
  }
158
  # /saving the history 
160
  # /saving the history
159 161
  $form->redirect($locale->text('Dunning Process Config saved!'));
160 162

  
161 163
  $lxdebug->leave_sub();
......
269 271
sub show_dunning {
270 272
  $lxdebug->enter_sub();
271 273

  
272
  DN->get_dunning(\%myconfig, \%$form);
273

  
274
  my $odd_even = 0;
275
  my ($previous_dunning_id, $first_row_for_dunning);
274
  my @filter_field_list = qw(customer_id customer dunning_level department_id invnumber ordnumber
275
                             transdatefrom transdateto dunningfrom dunningto notes showold);
276 276

  
277
  foreach $ref (@{ $form->{DUNNINGS} }) {
278
    if ($previous_dunning_id != $ref->{dunning_id}) {
279
      $odd_even = ($odd_even + 1) % 2;
280
      $ref->{first_row_for_dunning} = 1;
281

  
282
    } else {
283
      $ref->{first_row_for_dunning} = 0;
284
    }
285

  
286
    $previous_dunning_id     = $ref->{dunning_id};
287
    $ref->{listrow_odd_even} = $odd_even;
288
  }
277
  DN->get_dunning(\%myconfig, \%$form);
289 278

  
290 279
  if (!$form->{callback}) {
291
    $form->{callback} =
292
      build_std_url("action=show_dunning", qw(customer_id customer dunning_level department_id invnumber ordnumber
293
                                              transdatefrom transdateto dunningfrom dunningto notes showold));
280
    $form->{callback} = build_std_url("action=show_dunning", @filter_field_list);
294 281
  }
295 282

  
296 283
  $form->get_lists('printers'  => 'printers',
......
304 291
                                           'no_opendocument' => 1, });
305 292
  $form->{title}         = $locale->text('Dunning overview');
306 293

  
307
  $form->header();
294
  my $report = SL::ReportGenerator->new(\%myconfig, $form);
295

  
296
  $report->set_options('std_column_visibility' => 1,
297
                       'title'                 => $form->{title});
298
  $report->set_export_options('show_dunning', @filter_field_list);
299

  
300
  $report->set_columns(
301
    'checkbox'            => { 'text' => '', 'visible' => 'HTML' },
302
    'dunning_description' => { 'text' => $locale->text('Dunning Level') },
303
    'customername'        => { 'text' => $locale->text('Customername') },
304
    'invnumber'           => { 'text' => $locale->text('Invnumber') },
305
    'transdate'           => { 'text' => $locale->text('Invdate') },
306
    'duedate'             => { 'text' => $locale->text('Invoice Duedate') },
307
    'amount'              => { 'text' => $locale->text('Amount') },
308
    'dunning_date'        => { 'text' => $locale->text('Dunning Date') },
309
    'dunning_duedate'     => { 'text' => $locale->text('Dunning Duedate') },
310
    'fee'                 => { 'text' => $locale->text('Total Fees') },
311
    'interest'            => { 'text' => $locale->text('Interest') },
312
  );
313

  
314
  $report->set_column_order(qw(checkbox dunning_description customername invnumber transdate
315
                               duedate amount dunning_date dunning_duedate fee interest));
316

  
317
  my $edit_url  = build_std_url('script=is.pl', 'action=edit', 'callback') . '&id=';
318
  my $print_url = build_std_url('action=print_dunning', 'format=pdf', 'media=screen') . '&dunning_id=';
319

  
320
  my %alignment = map { $_ => 'right' } qw(transdate duedate amount dunning_date dunning_duedate fee interest);
321

  
322
  my ($current_dunning_rows, $previous_dunning_id, $first_row_for_dunning);
323

  
324
  $current_dunning_rows  = [];
325
  $first_row_for_dunning = 1;
326
  $form->{rowcount}      = scalar @{ $form->{DUNNINGS} };
308 327

  
309
  print $form->parse_html_template("dunning/show_dunning");
328
  my $i = 0;
329

  
330
  foreach $ref (@{ $form->{DUNNINGS} }) {
331
    $i++;
332

  
333
    if ($previous_dunning_id != $ref->{dunning_id}) {
334
      $report->add_data($current_dunning_rows) if (scalar @{ $current_dunning_rows });
335
      $current_dunning_rows  = [];
336
      $first_row_for_dunning = 1;
337
    }
338

  
339
    my $row = { };
340
    foreach my $column (keys %{ $ref }) {
341
      $row->{$column} = {
342
        'data'  => $first_row_for_dunning || (($column ne 'dunning_description') && ($column ne 'customername')) ? $ref->{$column} : '',
343

  
344
        'align' => $alignment{$column},
345

  
346
        'link'  => ($column eq 'invnumber'           ? $edit_url  . E($ref->{id})         :
347
                    $column eq 'dunning_description' ? $print_url . E($ref->{dunning_id}) : ''),
348
      };
349
    }
350

  
351
    $row->{checkbox} = {
352
      'raw_data' =>   $cgi->hidden('-name' => "dunning_id_$i", '-value' => $ref->{dunning_id})
353
                    . $cgi->checkbox('-name' => "selected_$i", '-value' => 1, '-label' => ''),
354
      'valign'   => 'center',
355
      'align'    => 'center',
356
    };
357

  
358
    push @{ $current_dunning_rows }, $row;
359

  
360
    $previous_dunning_id   = $ref->{dunning_id};
361
    $first_row_for_dunning = 0;
362
  }
363

  
364
  $report->add_data($current_dunning_rows) if (scalar @{ $current_dunning_rows });
365

  
366
  $report->set_options('raw_top_info_text'    => $form->parse_html_template('dunning/show_dunning_top'),
367
                       'raw_bottom_info_text' => $form->parse_html_template('dunning/show_dunning_bottom'),
368
                       'output_format'        => 'HTML',
369
                       'attachment_basename'  => strftime('dunning_report_%Y%m%d', localtime time),
370
    );
371

  
372
  $report->set_options_from_form();
373

  
374
  $report->generate_with_headers();
310 375

  
311 376
  $lxdebug->leave_sub();
312 377

  
......
359 424
}
360 425

  
361 426
# end of main
362

  
locale/de/dn
7 7
  'Add Request for Quotation'   => 'Anfrage erfassen',
8 8
  'Add Sales Order'             => 'Auftrag erfassen',
9 9
  'Address'                     => 'Adresse',
10
  'Amount'                      => 'Betrag',
10 11
  'Apr'                         => 'Apr',
11 12
  'April'                       => 'April',
12 13
  'Attachment'                  => 'als Anhang',
......
18 19
  'Bin'                         => 'Lagerplatz',
19 20
  'Bin List'                    => 'Lagerliste',
20 21
  'CANCELED'                    => 'Storniert',
22
  'CSV export -- options'       => 'CSV-Export -- Optionen',
21 23
  'City'                        => 'Stadt',
22 24
  'Company Name'                => 'Firmenname',
23 25
  'Confirmation'                => 'Auftragsbest?tigung',
......
25 27
  'Continue'                    => 'Weiter',
26 28
  'Could not print dunning.'    => 'Die Mahnungen konnten nicht gedruckt werden.',
27 29
  'Could not spawn ghostscript.' => 'Die Anwendung "ghostscript" konnte nicht gestartet werden.',
30
  'Could not spawn html2ps or GhostScript.' => 'html2ps oder GhostScript konnte nicht gestartet werden.',
28 31
  'Could not spawn the printer command.' => 'Die Druckanwendung konnte nicht gestartet werden.',
32
  'Could not write the html2ps config file.' => 'Die temporäre html2ps-Konfigurationsdatei konnte nicht geschrieben werden.',
33
  'Could not write the temporary HTML file.' => 'Eine temporäre HTML-Datei konnte nicht geschrieben werden.',
29 34
  'Country'                     => 'Land',
30 35
  'Credit Note'                 => 'Gutschrift',
31 36
  'Customer Number'             => 'Kundennummer',
32 37
  'Customer details'            => 'Kundendetails',
33 38
  'Customer not on file or locked!' => 'Dieser Kunde existiert nicht oder ist gesperrt.',
34 39
  'Customer not on file!'       => 'Kunde ist nicht in der Datenbank!',
40
  'Customername'                => 'Kundenname',
35 41
  'DELETED'                     => 'Gel?scht',
36 42
  'DUNNING STARTED'             => 'Mahnprozess gestartet',
37 43
  'Dataset upgrade'             => 'Datenbankaktualisierung',
......
42 48
  'Dependency loop detected:'   => 'Schleife in den Abhängigkeiten entdeckt:',
43 49
  'Description'                 => 'Beschreibung',
44 50
  'Discount'                    => 'Rabatt',
51
  'Dunning Date'                => 'Mahndatum',
45 52
  'Dunning Description missing in row ' => 'Mahnstufenbeschreibung fehlt in Zeile ',
53
  'Dunning Duedate'             => 'Zahlbar bis',
54
  'Dunning Level'               => 'Mahnlevel',
46 55
  'Dunning Level missing in row ' => 'Mahnlevel fehlt in ',
47 56
  'Dunning Process Config saved!' => 'Mahnwesenkonfiguration gespeichert!',
48 57
  'Dunning Process started for selected invoices!' => 'Mahnprozess f?r selektierte Rechnungen gestartet',
......
61 70
  'Group'                       => 'Warengruppe',
62 71
  'History'                     => 'Historie',
63 72
  'In-line'                     => 'im Text',
73
  'Interest'                    => 'Zinsen',
74
  'Invdate'                     => 'Rechnungsdatum',
75
  'Invnumber'                   => 'Rechnungsnummer',
64 76
  'Invoice'                     => 'Rechnung',
65 77
  'Invoice Date missing!'       => 'Rechnungsdatum fehlt!',
78
  'Invoice Duedate'             => 'F?lligkeitsdatum',
66 79
  'Invoice Number missing!'     => 'Rechnungsnummer fehlt!',
67 80
  'Item not on file!'           => 'Dieser Artikel ist nicht in der Datenbank!',
68 81
  'Jan'                         => 'Jan',
......
105 118
  'PAYMENT POSTED'              => 'Rechung gebucht',
106 119
  'PDF'                         => 'PDF',
107 120
  'PDF (OpenDocument/OASIS)'    => 'PDF (OpenDocument/OASIS)',
121
  'PDF export -- options'       => 'PDF-Export -- Optionen',
108 122
  'POSTED'                      => 'Gebucht',
109 123
  'POSTED AS NEW'               => 'Als neu gebucht',
110 124
  'PRINTED'                     => 'Gedruckt',
......
170 184
  'Terms missing in row '       => '+Tage fehlen in Zeile ',
171 185
  'The \'tag\' field must only consist of alphanumeric characters or the carachters - _ ( )' => 'Das Feld \'tag\' darf nur aus alphanumerischen Zeichen und den Zeichen - _ ( ) bestehen.',
172 186
  'The dunnings have been printed.' => 'Die Mahnung(en) wurden gedruckt.',
187
  'Total Fees'                  => 'Kumulierte Geb?hren',
173 188
  'Trying to call a sub without a name' => 'Es wurde versucht, eine Unterfunktion ohne Namen aufzurufen.',
174 189
  'Unit'                        => 'Einheit',
175 190
  'Unknown dependency \'%s\'.'  => 'Unbekannte Abhängigkeit \'%s\'.',
......
190 205
  'pick_list'                   => 'Entnahmeliste',
191 206
  'proforma'                    => 'Proforma',
192 207
  'purchase_order'              => 'Auftrag',
208
  'report_generator_nextsub is not defined.' => 'report_generator_nextsub ist nicht definiert.',
193 209
  'request_quotation'           => 'Angebotsanforderung',
194 210
  'sales_order'                 => 'Kundenauftrag',
195 211
  'sales_quotation'             => 'Verkaufsangebot',
......
222 238
  'edit_config'                 => 'edit_config',
223 239
  'edit_e_mail'                 => 'edit_e_mail',
224 240
  'employee_selection_internal' => 'employee_selection_internal',
241
  'export_as_csv'               => 'export_as_csv',
242
  'export_as_pdf'               => 'export_as_pdf',
225 243
  'format_dates'                => 'format_dates',
226 244
  'gl_transaction'              => 'gl_transaction',
227 245
  'invoicetotal'                => 'invoicetotal',
......
243 261
  'quotation'                   => 'quotation',
244 262
  'reformat_numbers'            => 'reformat_numbers',
245 263
  'relink_accounts'             => 'relink_accounts',
264
  'report_generator_do'         => 'report_generator_do',
246 265
  'request_for_quotation'       => 'request_for_quotation',
247 266
  'sales_invoice'               => 'sales_invoice',
248 267
  'save'                        => 'save',
......
270 289
  'vendor_invoice'              => 'vendor_invoice',
271 290
  'vendor_selection'            => 'vendor_selection',
272 291
  'weiter'                      => 'continue',
292
  'als_csv_exportieren'         => 'export_as_csv',
293
  'als_pdf_exportieren'         => 'export_as_pdf',
273 294
  'drucken'                     => 'print',
274 295
  'speichern'                   => 'save',
275 296
};
templates/webpages/dunning/show_dunning_bottom_de.html
1
  <input type="hidden" name="rowcount" value="<TMPL_VAR rowcount>">
2

  
3
  <p><TMPL_VAR PRINT_OPTIONS></p>
4

  
5
  <p>
6
   Mahnungen<br>
7
   <input type="hidden" name="print_nextsub" value="print_multiple">
8
   <input type="submit" class="submit" name="action" value="Drucken">
9
  </p>
10

  
11
 </form>
templates/webpages/dunning/show_dunning_bottom_master.html
1
  <input type="hidden" name="rowcount" value="<TMPL_VAR rowcount>">
2

  
3
  <p><TMPL_VAR PRINT_OPTIONS></p>
4

  
5
  <p>
6
   <translate>Dunnings</translate><br>
7
   <input type="hidden" name="print_nextsub" value="print_multiple">
8
   <input type="submit" class="submit" name="action" value="<translate>Print</translate>">
9
  </p>
10

  
11
 </form>
templates/webpages/dunning/show_dunning_de.html
1
<body>
2

  
3
 <script type="text/javascript" src="js/common.js"></script>
4
 <script type="text/javascript" src="js/dunning.js"></script>
5

  
6
 <div class="listtop" width="100%"><TMPL_VAR title></div>
7

  
8
 <form method="post" action="dn.pl">
9

  
10
  <input type="hidden" name="login" value="<TMPL_VAR login ESCAPE=HTML>">
11
  <input type="hidden" name="password" value="<TMPL_VAR password ESCAPE=HTML>">
12

  
13
  <p>
14
   <table width="100%">
15
    <tr>
16
     <th class="listheading">&nbsp;</th>
17
     <th class="listheading">Mahnlevel</th>
18
     <th class="listheading">Kundenname</th>
19
     <th class="listheading">Rechnungsnummer</th>
20
     <th class="listheading">Rechnungsdatum</th>
21
     <th class="listheading">F?lligkeitsdatum</th>
22
     <th class="listheading">Betrag</th>
23
     <th class="listheading">Mahndatum</th>
24
     <th class="listheading">Zahlbar bis</th>
25
     <th class="listheading">Kumulierte Geb?hren</th>
26
     <th class="listheading">Zinsen</th>
27
    </tr>
28

  
29
    <!-- Ausgabe der einzelnen Zeilen -->
30

  
31
    <TMPL_LOOP DUNNINGS>
32
     <tr class="listrow<TMPL_VAR listrow_odd_even>">
33
      <td>
34
       <TMPL_IF first_row_for_dunning>
35
        <input type="checkbox" name="selected_<TMPL_VAR __counter__>" value="1">
36
        <input type="hidden" name="dunning_id_<TMPL_VAR __counter__>" value="<TMPL_VAR dunning_id ESCAPE=HTML>">
37
       </TMPL_IF>
38
      </td>
39

  
40
      <td>
41
       <TMPL_IF first_row_for_dunning>
42
        <a href="dn.pl?action=print_dunning&format=pdf&media=screen&dunning_id=<TMPL_VAR dunning_id ESCAPE=URL>&login=<TMPL_VAR login ESCAPE=URL>&password=<TMPL_VAR password ESCAPE=URL>&callback=<TMPL_VAR callback ESCAPE=URL>">
43
         <TMPL_VAR dunning_description ESCAPE=HTML>
44
        </a>
45
        <TMPL_ELSE>
46
        &nbsp;
47
       </TMPL_IF>
48
      </td>
49

  
50
      <td><TMPL_IF first_row_for_dunning><TMPL_VAR customername ESCAPE=HTML><TMPL_ELSE>&nbsp;</TMPL_IF></td>
51

  
52
      <td><a href="is.pl?action=edit&id=<TMPL_VAR id ESCAPE=URL>&login=<TMPL_VAR login ESCAPE=URL>&password=<TMPL_VAR password ESCAPE=URL>&callback=<TMPL_VAR callback ESCAPE=URL>"><TMPL_VAR invnumber ESCAPE=HTML></a></td>
53

  
54
      <td align="right"><TMPL_VAR transdate ESCAPE=HTML></td>
55
      <td align="right"><TMPL_VAR duedate ESCAPE=HTML></td>
56
      <td align="right"><TMPL_VAR amount ESCAPE=HTML></td>
57
      <td align="right"><TMPL_VAR dunning_date ESCAPE=HTML></td>
58
      <td align="right"><TMPL_VAR dunning_duedate ESCAPE=HTML></td>
59
      <td align="right"><TMPL_VAR fee ESCAPE=HTML></td>
60
      <td align="right"><TMPL_VAR interest ESCAPE=HTML></td>
61
     </tr>
62

  
63
     <TMPL_IF __last__><input type="hidden" name="rowcount" value="<TMPL_VAR __counter__>"></TMPL_IF>
64
    </TMPL_LOOP>
65
    <tr><td colspan="11"><hr size="3" noshade></td></tr>
66
   </table>
67
  </p>
68

  
69

  
70
  <p><TMPL_VAR PRINT_OPTIONS></p>
71

  
72
  <p>
73
   <input type="hidden" name="print_nextsub" value="print_multiple">
74
   <input type="submit" class="submit" name="action" value="Drucken">
75
  </p>
76

  
77
 </form>
78

  
79
</body>
templates/webpages/dunning/show_dunning_master.html
1
<body>
2

  
3
 <script type="text/javascript" src="js/common.js"></script>
4
 <script type="text/javascript" src="js/dunning.js"></script>
5

  
6
 <div class="listtop" width="100%"><TMPL_VAR title></div>
7

  
8
 <form method="post" action="dn.pl">
9

  
10
  <input type="hidden" name="login" value="<TMPL_VAR login ESCAPE=HTML>">
11
  <input type="hidden" name="password" value="<TMPL_VAR password ESCAPE=HTML>">
12

  
13
  <p>
14
   <table width="100%">
15
    <tr>
16
     <th class="listheading">&nbsp;</th>
17
     <th class="listheading"><translate>Dunning Level</translate></th>
18
     <th class="listheading"><translate>Customername</translate></th>
19
     <th class="listheading"><translate>Invnumber</translate></th>
20
     <th class="listheading"><translate>Invdate</translate></th>
21
     <th class="listheading"><translate>Invoice Duedate</translate></th>
22
     <th class="listheading"><translate>Amount</translate></th>
23
     <th class="listheading"><translate>Dunning Date</translate></th>
24
     <th class="listheading"><translate>Dunning Duedate</translate></th>
25
     <th class="listheading"><translate>Total Fees</translate></th>
26
     <th class="listheading"><translate>Interest</translate></th>
27
    </tr>
28

  
29
    <!-- Ausgabe der einzelnen Zeilen -->
30

  
31
    <TMPL_LOOP DUNNINGS>
32
     <tr class="listrow<TMPL_VAR listrow_odd_even>">
33
      <td>
34
       <TMPL_IF first_row_for_dunning>
35
        <input type="checkbox" name="selected_<TMPL_VAR __counter__>" value="1">
36
        <input type="hidden" name="dunning_id_<TMPL_VAR __counter__>" value="<TMPL_VAR dunning_id ESCAPE=HTML>">
37
       </TMPL_IF>
38
      </td>
39

  
40
      <td>
41
       <TMPL_IF first_row_for_dunning>
42
        <a href="dn.pl?action=print_dunning&format=pdf&media=screen&dunning_id=<TMPL_VAR dunning_id ESCAPE=URL>&login=<TMPL_VAR login ESCAPE=URL>&password=<TMPL_VAR password ESCAPE=URL>&callback=<TMPL_VAR callback ESCAPE=URL>">
43
         <TMPL_VAR dunning_description ESCAPE=HTML>
44
        </a>
45
        <TMPL_ELSE>
46
        &nbsp;
47
       </TMPL_IF>
48
      </td>
49

  
50
      <td><TMPL_IF first_row_for_dunning><TMPL_VAR customername ESCAPE=HTML><TMPL_ELSE>&nbsp;</TMPL_IF></td>
51

  
52
      <td><a href="is.pl?action=edit&id=<TMPL_VAR id ESCAPE=URL>&login=<TMPL_VAR login ESCAPE=URL>&password=<TMPL_VAR password ESCAPE=URL>&callback=<TMPL_VAR callback ESCAPE=URL>"><TMPL_VAR invnumber ESCAPE=HTML></a></td>
53

  
54
      <td align="right"><TMPL_VAR transdate ESCAPE=HTML></td>
55
      <td align="right"><TMPL_VAR duedate ESCAPE=HTML></td>
56
      <td align="right"><TMPL_VAR amount ESCAPE=HTML></td>
57
      <td align="right"><TMPL_VAR dunning_date ESCAPE=HTML></td>
58
      <td align="right"><TMPL_VAR dunning_duedate ESCAPE=HTML></td>
59
      <td align="right"><TMPL_VAR fee ESCAPE=HTML></td>
60
      <td align="right"><TMPL_VAR interest ESCAPE=HTML></td>
61
     </tr>
62

  
63
     <TMPL_IF __last__><input type="hidden" name="rowcount" value="<TMPL_VAR __counter__>"></TMPL_IF>
64
    </TMPL_LOOP>
65
    <tr><td colspan="11"><hr size="3" noshade></td></tr>
66
   </table>
67
  </p>
68

  
69

  
70
  <p><TMPL_VAR PRINT_OPTIONS></p>
71

  
72
  <p>
73
   <input type="hidden" name="print_nextsub" value="print_multiple">
74
   <input type="submit" class="submit" name="action" value="<translate>Print</translate>">
75
  </p>
76

  
77
 </form>
78

  
79
</body>
templates/webpages/dunning/show_dunning_top_de.html
1
 <script type="text/javascript" src="js/common.js"></script>
2
 <script type="text/javascript" src="js/dunning.js"></script>
3

  
4
 <form method="post" action="dn.pl">
5

  
6
  <input type="hidden" name="login" value="<TMPL_VAR login ESCAPE=HTML>">
7
  <input type="hidden" name="password" value="<TMPL_VAR password ESCAPE=HTML>">
8

  
templates/webpages/dunning/show_dunning_top_master.html
1
 <script type="text/javascript" src="js/common.js"></script>
2
 <script type="text/javascript" src="js/dunning.js"></script>
3

  
4
 <form method="post" action="dn.pl">
5

  
6
  <input type="hidden" name="login" value="<TMPL_VAR login ESCAPE=HTML>">
7
  <input type="hidden" name="password" value="<TMPL_VAR password ESCAPE=HTML>">
8

  

Auch abrufbar als: Unified diff