Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision b62eb8f4

Von Tamino Steinert vor etwa 1 Jahr hinzugefügt

  • ID b62eb8f49153a319129b913af02f3ccde4a44993
  • Vorgänger dabbe57f
  • Nachfolger 55a65cad

Workflow: E-Mail → VK Rechnung/Gutschrift überarbeitet

Unterschiede anzeigen:

bin/mozilla/io.pl
1018 1018
sub order {
1019 1019
  $main::lxdebug->enter_sub();
1020 1020

  
1021
  $::form->{email_journal_id}    = delete $::form->{workflow_email_journal_id};
1022
  $::form->{email_attachment_id} = delete $::form->{workflow_email_attachment_id};
1023

  
1021 1024
  _order();
1022 1025

  
1023 1026
  if ($::instance_conf->get_feature_experimental_order) {
......
1220 1223
    controller => 'Reclamation',
1221 1224
    action     => 'add_from_record',
1222 1225
    type       => 'sales_reclamation',
1226
    email_journal_id    => $::form->{workflow_email_journal_id},
1227
    email_attachment_id => $::form->{workflow_email_attachment_id},
1223 1228
    from_id    => $id,
1224 1229
    from_type  => $type,
1225 1230
  );
......
1235 1240
    controller => 'Reclamation',
1236 1241
    action     => 'add_from_record',
1237 1242
    type       => 'purchase_reclamation',
1243
    email_journal_id    => $::form->{workflow_email_journal_id},
1244
    email_attachment_id => $::form->{workflow_email_attachment_id},
1238 1245
    from_id    => $id,
1239 1246
    from_type  => $type,
1240 1247
  );
bin/mozilla/is.pl
54 54
use SL::DB::Invoice;
55 55
use SL::DB::PaymentTerm;
56 56
use SL::DB::Reclamation;
57
use SL::DB::EmailJournal;
57 58
use SL::DB::ValidityToken;
58 59
use SL::Helper::QrBillFunctions qw(get_ref_number_formatted);
59 60

  
......
122 123
  $main::lxdebug->leave_sub();
123 124
}
124 125

  
126
sub add_from_email_journal {
127
  die "No 'email_journal_id' was given." unless ($::form->{email_journal_id});
128
  &add;
129
}
130

  
131
sub edit_with_email_journal_workflow {
132
  my ($self) = @_;
133
  die "No 'email_journal_id' was given." unless ($::form->{email_journal_id});
134
  $::form->{workflow_email_journal_id}    = delete $::form->{email_journal_id};
135
  $::form->{workflow_email_attachment_id} = delete $::form->{email_attachment_id};
136

  
137
  &edit;
138
}
139

  
125 140
sub edit {
126 141
  $main::lxdebug->enter_sub();
127 142

  
......
1212 1227
    $form->save_history;
1213 1228
  }
1214 1229

  
1230
  if ($form->{email_journal_id} && $form->{id} ne "") {
1231
    my $invoice = SL::DB::Invoice->new(id => $form->{id})->load;
1232
    my $email_journal = SL::DB::EmailJournal->new(
1233
      id => delete $form->{email_journal_id}
1234
    )->load;
1235
    $email_journal->link_to_record_with_attachment($invoice, delete $::form->{email_attachment_id});
1236
  }
1237

  
1215 1238
  if (!$form->{no_redirect_after_post}) {
1216 1239
    $form->{action} = 'edit';
1217 1240
    $form->{script} = 'is.pl';
......
1247 1270

  
1248 1271
  $main::auth->assert('invoice_edit');
1249 1272

  
1273
  $form->{email_journal_id}    = delete $form->{workflow_email_journal_id};
1274
  $form->{email_attachment_id} = delete $form->{workflow_email_attachment_id};
1275

  
1250 1276
  delete @{ $form }{qw(printed emailed queued invnumber invdate exchangerate forex deliverydate id datepaid_1 gldate_1 acc_trans_id_1 source_1 memo_1 paid_1 exchangerate_1 AP_paid_1 storno locked qr_unstructured_message)};
1251 1277
  $form->{rowcount}--;
1252 1278
  $form->{paidaccounts} = 1;
......
1272 1298

  
1273 1299
  $main::auth->assert('invoice_edit');
1274 1300

  
1301
  $form->{email_journal_id}    = delete $form->{workflow_email_journal_id};
1302
  $form->{email_attachment_id} = delete $form->{workflow_email_attachment_id};
1303

  
1275 1304
  delete @{ $form }{qw(printed emailed queued invnumber invdate exchangerate forex deliverydate datepaid_1 gldate_1 acc_trans_id_1 source_1 memo_1 paid_1 exchangerate_1 AP_paid_1 storno locked)};
1276 1305
  $form->{convert_from_ar_ids} = $form->{id};
1277 1306
  $form->{id}                  = '';
......
1296 1325

  
1297 1326
  $main::auth->assert('invoice_edit');
1298 1327

  
1328
  $form->{email_journal_id}    = delete $form->{workflow_email_journal_id};
1329
  $form->{email_attachment_id} = delete $form->{workflow_email_attachment_id};
1330

  
1299 1331
  my $related_invoices = IS->_get_invoices_for_advance_payment($form->{id});
1300 1332

  
1301 1333
  delete @{ $form }{qw(printed emailed queued invnumber invdate exchangerate forex deliverydate datepaid_1 gldate_1 acc_trans_id_1 source_1 memo_1 paid_1 exchangerate_1 AP_paid_1 storno locked)};
......
1368 1400
  $form->{addition}  = "STORNO";
1369 1401
  $form->save_history;
1370 1402

  
1403
  my $email_journal_id    = delete $form->{workflow_email_journal_id};
1404
  my $email_attachment_id = delete $form->{workflow_email_attachment_id};
1371 1405
  map({ my $key = $_; delete($form->{$key}) unless (grep({ $key eq $_ } qw(id login password type))); } keys(%{ $form }));
1372 1406

  
1407
  $form->{email_journal_id}    = $email_journal_id;
1408
  $form->{email_attachment_id} = $email_attachment_id;
1409

  
1373 1410
  invoice_links();
1374 1411
  prepare_invoice();
1375 1412
  relink_accounts();
......
1423 1460

  
1424 1461
  $main::auth->assert('invoice_edit');
1425 1462

  
1463
  $form->{email_journal_id}    = delete $form->{workflow_email_journal_id};
1464
  $form->{email_attachment_id} = delete $form->{workflow_email_attachment_id};
1465

  
1426 1466
  $form->{form_validity_token} = SL::DB::ValidityToken->create(scope => SL::DB::ValidityToken::SCOPE_SALES_INVOICE_POST())->token;
1427 1467

  
1428 1468
  $form->{transdate} = $form->{invdate} = $form->current_date(\%myconfig);
templates/design40_webpages/is/form_header.html
9 9
<script type="text/javascript" src="js/calculate_qty.js"></script>
10 10
<script type="text/javascript" src="js/follow_up.js"></script>
11 11

  
12
<h1>[% title %]</h1>
12
<h1>
13
  [% IF workflow_email_journal_id; LxERP.t8("Email Journal Workflow") _ " - "; END; %]
14
  [% title %]
15
</h1>
13 16

  
14 17
<form method="post" id='form' name="invoice" action="[% script %]">
15 18

  
......
29 32
[% IF !id %]
30 33
[%   L.hidden_tag('form_validity_token', form_validity_token) %]
31 34
[% END %]
35
[% L.hidden_tag('email_journal_id',             email_journal_id) %]
36
[% L.hidden_tag('email_attachment_id',          email_attachment_id) %]
37
[% L.hidden_tag('workflow_email_journal_id',    workflow_email_journal_id) %]
38
[% L.hidden_tag('workflow_email_attachment_id', workflow_email_attachment_id) %]
32 39

  
33 40
[% IF saved_message != '' %]<p>[% saved_message %]</p>[% END %]
34 41

  
......
38 45
<div id="is_tabs" class="tabwidget">
39 46
  <ul class="ui-tabs-nav">
40 47
    <li><a href="#ui-tabs-basic-data" class="ui-tabs">[% 'Basic Data' | $T8 %]</a></li>
48
    [% IF email_attachment_id || workflow_email_attachment_id %]
49
      <li><a href="controller.pl?action=EmailJournal/attachment_preview&attachment_id=[% HTML.url(email_attachment_id || workflow_email_attachment_id) %]">[% 'Email Attachment Preview' | $T8 %]</a></li>
50
    [% END %]
41 51
    [% IF INSTANCE_CONF.get_webdav %]
42 52
      <li><a href="#ui-tabs-webdav">[% 'WebDAV' | $T8 %]</a></li>
43 53
    [% END %]
......
58 68

  
59 69
<div id="ui-tabs-basic-data" class="ui-tabs-panel">
60 70

  
71
[% IF email_attachment_id || workflow_email_attachment_id%]
72
  <div class="wrapper" id="email_attachment_wrapper">
73
    [%
74
      BLOCK panel_1;
75
        P.email_journal.attachment_preview(
76
             email_attachment_id || workflow_email_attachment_id,
77
             style="height:600px"
78
             );
79
      END;
80
      INCLUDE 'common/toggle_panel.html'
81
        block_name='panel_1'
82
        button_closed  = LxERP.t8('Show Attachment')
83
        button_open    = LxERP.t8('Hide Attachment')
84
        ;
85
    %]
86
  </div>
87
[% END %]
88

  
61 89
<div class="wrapper" id="wrapper-1">
62 90
  [% INCLUDE 'generic/toggle_wrapper.html' %]
63 91
  <table class="tbl-horizontal">
templates/webpages/is/form_header.html
26 26
[% IF !id %]
27 27
[%   L.hidden_tag('form_validity_token', form_validity_token) %]
28 28
[% END %]
29
[% L.hidden_tag('email_journal_id',             email_journal_id) %]
30
[% L.hidden_tag('email_attachment_id',          email_attachment_id) %]
31
[% L.hidden_tag('workflow_email_journal_id',    workflow_email_journal_id) %]
32
[% L.hidden_tag('workflow_email_attachment_id', workflow_email_attachment_id) %]
29 33

  
30
<h1>[% title %]</h1>
34
<h1>
35
  [% IF workflow_email_journal_id; LxERP.t8("Email Journal Workflow") _ " - "; END; %]
36
  [% title %]
37
</h1>
31 38

  
32 39
<p>[% saved_message %]</p>
33 40

  
......
37 44
<div id="is_tabs" class="tabwidget">
38 45
 <ul>
39 46
  <li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
47
[% IF email_attachment_id || workflow_email_attachment_id %]
48
  <li><a href="controller.pl?action=EmailJournal/attachment_preview&attachment_id=[% HTML.url(email_attachment_id || workflow_email_attachment_id) %]">[% 'Email Attachment Preview' | $T8 %]</a></li>
49
[% END %]
40 50
[%- IF INSTANCE_CONF.get_webdav %]
41 51
  <li><a href="#ui-tabs-webdav">[% 'WebDAV' | $T8 %]</a></li>
42 52
[%- END %]

Auch abrufbar als: Unified diff