Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 993874c3

Von Tamino Steinert vor 11 Monaten hinzugefügt

  • ID 993874c35a0000d4e2a4c6f8d61e1ff5eb6ab3eb
  • Vorgänger d2a38472
  • Nachfolger 0d758a9d

Workflow: E-Mail → EK Rechnung/Gutschrift hinzugefügt

Unterschiede anzeigen:

bin/mozilla/ir.pl
43 43
use SL::DB::Department;
44 44
use SL::DB::Project;
45 45
use SL::DB::PurchaseInvoice;
46
use SL::DB::EmailJournal;
46 47
use SL::DB::ValidityToken;
47 48
use SL::DB::Vendor;
48 49
use SL::DB::Tax;
......
102 103
  $main::lxdebug->leave_sub();
103 104
}
104 105

  
106
sub add_from_email_journal {
107
  die "No 'email_journal_id' was given." unless ($::form->{email_journal_id});
108
  &add;
109
}
110

  
111
sub edit_with_email_journal_workflow {
112
  my ($self) = @_;
113
  die "No 'email_journal_id' was given." unless ($::form->{email_journal_id});
114
  $::form->{workflow_email_journal_id}    = delete $::form->{email_journal_id};
115
  $::form->{workflow_email_attachment_id} = delete $::form->{email_attachment_id};
116

  
117
  &edit;
118
}
119

  
105 120
sub edit {
106 121
  $main::lxdebug->enter_sub();
107 122

  
......
818 833

  
819 834
  $main::auth->assert('vendor_invoice_edit');
820 835

  
836
  $form->{email_journal_id}    = delete $form->{workflow_email_journal_id};
837
  $form->{email_attachment_id} = delete $form->{workflow_email_attachment_id};
838

  
821 839
  if ($form->{storno}) {
822 840
    $form->error($locale->text('Cannot storno storno invoice!'));
823 841
  }
......
876 894

  
877 895
  $main::auth->assert('vendor_invoice_edit');
878 896

  
897
  $form->{email_journal_id}    = delete $form->{workflow_email_journal_id};
898
  $form->{email_attachment_id} = delete $form->{workflow_email_attachment_id};
899

  
879 900
  map { delete $form->{$_} } qw(printed emailed queued invnumber invdate deliverydate id datepaid_1 gldate_1 acc_trans_id_1 source_1 memo_1 paid_1 exchangerate_1 AP_paid_1 storno);
880 901
  $form->{paidaccounts} = 1;
881 902
  $form->{rowcount}--;
......
1046 1067
    }
1047 1068
    # /saving the history
1048 1069

  
1070
    if ($form->{email_journal_id}) {
1071
      my $purchase_invoice = SL::DB::PurchaseInvoice->new(id => $form->{id})->load;
1072
      my $email_journal = SL::DB::EmailJournal->new(
1073
        id => delete $form->{email_journal_id}
1074
      )->load;
1075
      $email_journal->link_to_record_with_attachment($purchase_invoice, delete $::form->{email_attachment_id});
1076
    }
1077

  
1049 1078
    my $redirect_url;
1050 1079
    if ('doc-tab' eq $form->{after_action}) {
1051 1080
      $redirect_url = build_std_url("script=ir.pl", 'action=edit', 'id=' . E($form->{id}), 'fragment=ui-tabs-docs');

Auch abrufbar als: Unified diff