Revision 9269bdc8
Von Tamino Steinert vor etwa 1 Jahr hinzugefügt
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'); |
templates/design40_webpages/ir/form_header.html | ||
---|---|---|
4 | 4 |
[% USE L %] |
5 | 5 |
[% USE P %] |
6 | 6 |
|
7 |
<h1>[% title %]</h1> |
|
7 |
<h1> |
|
8 |
[% IF workflow_email_journal_id; LxERP.t8("Email Journal Workflow") _ " - "; END; %] |
|
9 |
[% title %] |
|
10 |
</h1> |
|
8 | 11 |
|
9 | 12 |
[% SET follow_up_trans_info = invnumber _ ' (' _ vendor_obj.name _ ')' %] |
10 | 13 |
<script type="text/javascript" src="js/common.js"></script> |
... | ... | |
26 | 29 |
[% IF !id %] |
27 | 30 |
[% L.hidden_tag('form_validity_token', form_validity_token) %] |
28 | 31 |
[% END %] |
32 |
[% L.hidden_tag('email_journal_id', email_journal_id) %] |
|
33 |
[% L.hidden_tag('email_attachment_id', email_attachment_id) %] |
|
34 |
[% L.hidden_tag('workflow_email_journal_id', workflow_email_journal_id) %] |
|
35 |
[% L.hidden_tag('workflow_email_attachment_id', workflow_email_attachment_id) %] |
|
29 | 36 |
|
30 | 37 |
[% INCLUDE 'common/flash.html' %] |
31 | 38 |
[% INCLUDE 'generic/set_longdescription.html' %] |
... | ... | |
34 | 41 |
|
35 | 42 |
<ul> |
36 | 43 |
<li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li> |
44 |
[% IF email_attachment_id || workflow_email_attachment_id %] |
|
45 |
<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> |
|
46 |
[% END %] |
|
37 | 47 |
[% IF INSTANCE_CONF.get_webdav %] |
38 | 48 |
<li><a href="#ui-tabs-webdav">[% 'WebDAV' | $T8 %]</a></li> |
39 | 49 |
[% END %] |
... | ... | |
55 | 65 |
|
56 | 66 |
<div id="ui-tabs-basic-data"> |
57 | 67 |
|
68 |
[% IF email_attachment_id || workflow_email_attachment_id%] |
|
69 |
<div class="wrapper" id="email_attachment_wrapper"> |
|
70 |
[% |
|
71 |
BLOCK panel_1; |
|
72 |
P.email_journal.attachment_preview( |
|
73 |
email_attachment_id || workflow_email_attachment_id, |
|
74 |
style="height:600px" |
|
75 |
); |
|
76 |
END; |
|
77 |
INCLUDE 'common/toggle_panel.html' |
|
78 |
block_name='panel_1' |
|
79 |
button_closed = LxERP.t8('Show Attachment') |
|
80 |
button_open = LxERP.t8('Hide Attachment') |
|
81 |
; |
|
82 |
%] |
|
83 |
</div> |
|
84 |
[% END %] |
|
85 |
|
|
58 | 86 |
<div class="wrapper" id="wrapper-1"> |
59 | 87 |
[% INCLUDE 'generic/toggle_wrapper.html' %] |
60 | 88 |
|
templates/webpages/ir/form_header.html | ||
---|---|---|
2 | 2 |
[%- USE HTML %] |
3 | 3 |
[%- USE LxERP %] |
4 | 4 |
[%- USE L %][%- USE P -%] |
5 |
<h1>[% title %]</h1> |
|
5 |
|
|
6 |
<h1> |
|
7 |
[% IF workflow_email_journal_id; LxERP.t8("Email Journal Workflow") _ " - "; END; %] |
|
8 |
[% title %] |
|
9 |
</h1> |
|
6 | 10 |
|
7 | 11 |
[%- SET follow_up_trans_info = invnumber _ ' (' _ vendor_obj.name _ ')' %] |
8 | 12 |
<script type="text/javascript" src="js/common.js"></script> |
... | ... | |
24 | 28 |
[% IF !id %] |
25 | 29 |
[% L.hidden_tag('form_validity_token', form_validity_token) %] |
26 | 30 |
[% END %] |
31 |
[% L.hidden_tag('email_journal_id', email_journal_id) %] |
|
32 |
[% L.hidden_tag('email_attachment_id', email_attachment_id) %] |
|
33 |
[% L.hidden_tag('workflow_email_journal_id', workflow_email_journal_id) %] |
|
34 |
[% L.hidden_tag('workflow_email_attachment_id', workflow_email_attachment_id) %] |
|
27 | 35 |
|
28 | 36 |
[%- INCLUDE 'common/flash.html' %] |
29 | 37 |
[%- INCLUDE 'generic/set_longdescription.html' %] |
... | ... | |
31 | 39 |
<div id="ir_tabs" class="tabwidget"> |
32 | 40 |
<ul> |
33 | 41 |
<li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li> |
42 |
[% IF email_attachment_id || workflow_email_attachment_id %] |
|
43 |
<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> |
|
44 |
[% END %] |
|
34 | 45 |
[%- IF INSTANCE_CONF.get_webdav %] |
35 | 46 |
<li><a href="#ui-tabs-webdav">[% 'WebDAV' | $T8 %]</a></li> |
36 | 47 |
[%- END %] |
Auch abrufbar als: Unified diff
Workflow: E-Mail → EK Rechnung/Gutschrift hinzugefügt