Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 63c87487

Von Tamino Steinert vor etwa 1 Jahr hinzugefügt

  • ID 63c87487d1b030cd563338837fc75f47b0f37717
  • Vorgänger 743249b4
  • Nachfolger 49deab8a

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;
......
357 358

  
358 359
  AP->get_transdate(\%myconfig, $form);
359 360
  $form->{initial_transdate} = $form->{transdate};
361
  $form->{initial_vendor_id} = $form->{vendor_id};
360 362
  create_links(dont_save => 1);
361 363
  $form->{transdate} = $form->{initial_transdate};
364
  $form->{vendor_id} = $form->{initial_vendor_id} if $form->{initial_vendor_id};
362 365

  
363 366
  if ($form->{vendor_id}) {
364 367
    my $vendor = SL::DB::Vendor->load_cached($form->{vendor_id});
......
1061 1064
      }
1062 1065
    }
1063 1066

  
1067
    if ($form->{email_journal_id}) {
1068
      my $ap_transaction = SL::DB::PurchaseInvoice->new(id => $form->{id})->load;
1069
      my $email_journal = SL::DB::EmailJournal->new(
1070
        id => delete $form->{email_journal_id}
1071
      )->load;
1072
      $email_journal->link_to_record_with_attachment($ap_transaction, delete $::form->{email_attachment_id});
1073
    }
1074

  
1064 1075
    if (!$inline) {
1065 1076
      my $msg = $locale->text("AP transaction '#1' posted (ID: #2)", $form->{invnumber}, $form->{id});
1066 1077
      if ($form->{callback} =~ /BankTransaction/) {
......
1108 1119

  
1109 1120
  $main::auth->assert('ap_transactions');
1110 1121

  
1122
  $form->{email_journal_id}    = delete $form->{workflow_email_journal_id};
1123
  $form->{email_attachment_id} = delete $form->{workflow_email_attachment_id};
1124

  
1111 1125
  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);
1112 1126
  $form->{paidaccounts} = 1;
1113 1127
  $form->{rowcount}--;
......
1496 1510
  );
1497 1511
}
1498 1512

  
1513
sub add_from_email_journal {
1514
  die "No 'email_journal_id' was given." unless ($::form->{email_journal_id});
1515
  &add;
1516
}
1517

  
1518
sub edit_with_email_journal_workflow {
1519
  my ($self) = @_;
1520
  die "No 'email_journal_id' was given." unless ($::form->{email_journal_id});
1521
  $::form->{workflow_email_journal_id}    = delete $::form->{email_journal_id};
1522
  $::form->{workflow_email_attachment_id} = delete $::form->{email_attachment_id};
1523

  
1524
  &edit;
1525
}
1526

  
1499 1527
sub setup_ap_search_action_bar {
1500 1528
  my %params = @_;
1501 1529

  

Auch abrufbar als: Unified diff