Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 6c922eec

Von Tamino Steinert vor 11 Monaten hinzugefügt

  • ID 6c922eec3c63d977e4a78425dd0f6a751ee9d82f
  • Vorgänger 0d758a9d
  • Nachfolger 95bec27f

Workflow: E-Mail → Kreditorenbuchung hinzugefügt

Unterschiede anzeigen:

bin/mozilla/ap.pl
53 53
use SL::DB::PurchaseInvoice;
54 54
use SL::DB::RecordTemplate;
55 55
use SL::DB::Tax;
56
use SL::DB::EmailJournal;
56 57
use SL::DB::ValidityToken;
57 58
use SL::Presenter::ItemsList;
58 59
use SL::Webdav;
......
296 297

  
297 298
  AP->get_transdate(\%myconfig, $form);
298 299
  $form->{initial_transdate} = $form->{transdate};
300
  $form->{initial_vendor_id} = $form->{vendor_id};
299 301
  create_links(dont_save => 1);
300 302
  $form->{transdate} = $form->{initial_transdate};
303
  $form->{vendor_id} = $form->{initial_vendor_id} if $form->{initial_vendor_id};
301 304

  
302 305
  if ($form->{vendor_id}) {
303 306
    my $vendor = SL::DB::Vendor->load_cached($form->{vendor_id});
......
1001 1004
      }
1002 1005
    }
1003 1006

  
1007
    if ($form->{email_journal_id}) {
1008
      my $ap_transaction = SL::DB::PurchaseInvoice->new(id => $form->{id})->load;
1009
      my $email_journal = SL::DB::EmailJournal->new(
1010
        id => delete $form->{email_journal_id}
1011
      )->load;
1012
      $email_journal->link_to_record_with_attachment($ap_transaction, delete $::form->{email_attachment_id});
1013
    }
1014

  
1004 1015
    if (!$inline) {
1005 1016
      my $msg = $locale->text("AP transaction '#1' posted (ID: #2)", $form->{invnumber}, $form->{id});
1006 1017
      if ($form->{callback} =~ /BankTransaction/) {
......
1048 1059

  
1049 1060
  $main::auth->assert('ap_transactions');
1050 1061

  
1062
  $form->{email_journal_id}    = delete $form->{workflow_email_journal_id};
1063
  $form->{email_attachment_id} = delete $form->{workflow_email_attachment_id};
1064

  
1051 1065
  map { delete $form->{$_} } qw(printed emailed queued invnumber deliverydate id datepaid_1 gldate_1 acc_trans_id_1 source_1 memo_1 paid_1 exchangerate_1 AP_paid_1 storno convert_from_oe_id);
1052 1066
  $form->{paidaccounts} = 1;
1053 1067
  $form->{rowcount}--;
......
1436 1450
  );
1437 1451
}
1438 1452

  
1453
sub add_from_email_journal {
1454
  die "No 'email_journal_id' was given." unless ($::form->{email_journal_id});
1455
  &add;
1456
}
1457

  
1458
sub edit_with_email_journal_workflow {
1459
  my ($self) = @_;
1460
  die "No 'email_journal_id' was given." unless ($::form->{email_journal_id});
1461
  $::form->{workflow_email_journal_id}    = delete $::form->{email_journal_id};
1462
  $::form->{workflow_email_attachment_id} = delete $::form->{email_attachment_id};
1463

  
1464
  &edit;
1465
}
1466

  
1439 1467
sub setup_ap_search_action_bar {
1440 1468
  my %params = @_;
1441 1469

  

Auch abrufbar als: Unified diff