Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 97422880

Von Martin Helmling martin.helmling@octosoft.eu vor mehr als 7 Jahren hinzugefügt

  • ID 97422880ec1448b61c609c3d2a6257c1f5d582bf
  • Vorgänger 60b170eb
  • Nachfolger 5ab8e5d5

Filemanagement: Speichern der erzeugten Mahnungsdokumente

Die Dokumente werden nun bei der entsprechenden Rechnung abgespeichert.

Da ja Rechnungen zusammengefasst werden können, wäre die Zuordnung ggf bei den Kundendaten besser

impl redmine #274

Unterschiede anzeigen:

SL/Controller/File.pm
373 373
  my @files;
374 374
  $main::lxdebug->message(LXDebug->DEBUG2(), "do_list: object_id=".$self->object_id." object_type=".$self->object_type." file_type=".$self->file_type." json=".$json);
375 375
  if ( $self->file_type eq 'document' ) {
376
    my @object_types;
377
    push @object_types, $self->object_type;
378
    push @object_types, ('dunning','dunning1','dunning2','dunning3') if $self->object_type eq 'invoice';
376 379
    @files   = SL::File->get_all_versions(object_id   => $self->object_id  ,
377
                                          object_type => $self->object_type,
380
                                          object_type => \@object_types,
378 381
                                          file_type   => $self->file_type  );
379 382

  
380 383
    $main::lxdebug->message(LXDebug->DEBUG2(), "cnt1=".scalar(@files));
SL/DN.pm
837 837
         c.greeting,          c.contact,      c.phone,        c.fax,       c.homepage,
838 838
         c.email,             c.taxincluded,  c.business_id,  c.taxnumber, c.iban,
839 839
         c.ustid,
840
         ar.id AS invoice_id,
840 841
         co.*
841 842
       FROM dunning d
842 843
       LEFT JOIN ar          ON (d.trans_id = ar.id)
......
850 851

  
851 852
  $query =
852 853
    qq|SELECT
853
         cfg.interest_rate, cfg.template AS formname,
854
         cfg.interest_rate, cfg.template AS formname, cfg.dunning_level,
854 855
         cfg.email_subject, cfg.email_body, cfg.email_attachment,
855 856
         d.transdate AS dunning_date,
856 857
         (SELECT SUM(fee)
......
909 910
  $form->get_employee_data('prefix' => 'employee', 'id' => $form->{employee_id});
910 911
  $form->get_employee_data('prefix' => 'salesman', 'id' => $form->{salesman_id});
911 912

  
913
  $form->{attachment_type}    = "dunning";
914
  if ( $form->{dunning_level} ) {
915
    $form->{attachment_type} .= $form->{dunning_level} if $form->{dunning_level} < 4;
916
  }
917
  $form->{attachment_filename} = $form->get_formname_translation($form->{attachment_type}) . "_${dunning_id}.pdf";
918
  $form->{attachment_id} = $form->{invoice_id};
912 919
  $form->parse_template($myconfig);
913 920

  
914 921
  $main::lxdebug->leave_sub();
......
926 933
  $query =
927 934
    qq|SELECT
928 935
         d.fee_interest_ar_id,
929
         dcfg.template
936
         d.trans_id AS invoice_id,
937
         dcfg.template,
938
         dcfg.dunning_level
930 939
       FROM dunning d
931 940
       LEFT JOIN dunning_config dcfg ON (d.dunning_config_id = dcfg.id)
932 941
       WHERE d.dunning_id = ?|;
933
  my ($ar_id, $template) = selectrow_query($form, $dbh, $query, $dunning_id);
942
  my ($ar_id, $invoice_id, $template, $dunning_level) = selectrow_query($form, $dbh, $query, $dunning_id);
934 943

  
935 944
  if (!$ar_id) {
936 945
    $main::lxdebug->leave_sub();
......
998 1007

  
999 1008
  map { delete $form->{$_} } grep /^[a-z_]+_\d+$/, keys %{ $form };
1000 1009

  
1010
  $form->{attachment_filename} = $form->get_formname_translation('dunning_invoice') . "_${dunning_id}.pdf";
1011
  $form->{attachment_type}     = "dunning";
1012
  $form->{attachment_id}       = $form->{invoice_id};
1001 1013
  $form->parse_template($myconfig);
1002 1014

  
1003 1015
  restore_form($saved_form);
SL/Form.pm
1279 1279
    sales_delivery_order    => $main::locale->text('Delivery Order'),
1280 1280
    purchase_delivery_order => $main::locale->text('Delivery Order'),
1281 1281
    dunning                 => $main::locale->text('Dunning'),
1282
    dunning1                => $main::locale->text('Payment Reminder'),
1283
    dunning2                => $main::locale->text('Dunning'),
1284
    dunning3                => $main::locale->text('Last Dunning'),
1285
    dunning_invoice         => $main::locale->text('Dunning Invoice'),
1282 1286
    letter                  => $main::locale->text('Letter'),
1283 1287
    ic_supply               => $main::locale->text('Intra-Community supply'),
1284 1288
    statement               => $main::locale->text('Statement'),
SL/Helper/File.pm
11 11
  my ($self, $form) = @_;
12 12
  return unless $::instance_conf->get_doc_storage;
13 13
  my $type = $form->{type};
14
  $type = $form->{formname} if $form->{formname} && !$form->{type};
14
  $type = $form->{formname}        if $form->{formname} && !$form->{type};
15
  $type = $form->{attachment_type} if $form->{attachment_type};
15 16
  my $id = $form->{id};
16 17
  $id = $form->{attachment_id} if $form->{attachment_id} && !$form->{id};
17 18
  return if !$id || !$type;
......
83 84
 $self->append_general_pdf_attachments(filepath => $pdf_filename, type => $form->{type}) if ( $ext_for_format eq 'pdf' );
84 85

  
85 86
#It is also used in MassPrint Helper
86
# 
87
#
87 88

  
88 89
=head1 DESCRIPTION
89 90

  
......
151 152

  
152 153

  
153 154
=cut
154

  
locale/de/all
1040 1040
  'Dunning Description'         => 'Mahnstufenbeschreibung',
1041 1041
  'Dunning Description missing in row ' => 'Mahnstufenbeschreibung fehlt in Zeile ',
1042 1042
  'Dunning Duedate'             => 'Zahlbar bis',
1043
  'Dunning Invoice'             => 'Mahnrechnung',
1043 1044
  'Dunning Level'               => 'Mahnlevel',
1044 1045
  'Dunning Level missing in row ' => 'Mahnlevel fehlt in ',
1045 1046
  'Dunning Process Config saved!' => 'Mahnwesenkonfiguration gespeichert!',
......
1654 1655
  'Last Cost'                   => 'Einkaufspreis',
1655 1656
  'Last Credit Note Number'     => 'Letzte Gutschriftnummer',
1656 1657
  'Last Customer Number'        => 'Letzte Kundennummer',
1658
  'Last Dunning'                => 'Letzte Mahnung',
1657 1659
  'Last Invoice Number'         => 'Letzte Rechnungsnummer',
1658 1660
  'Last Purchase Delivery Order Number' => 'Letzte Lieferscheinnummer (Einkauf)',
1659 1661
  'Last Purchase Order Number'  => 'Letzte Lieferantenautragsnummer',

Auch abrufbar als: Unified diff