Revision 9ddaeed0
Von Tamino Steinert vor etwa 1 Jahr hinzugefügt
bin/mozilla/ar.pl | ||
---|---|---|
53 | 53 |
use SL::DB::InvoiceItem; |
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::Helper::Flash qw(flash flash_later); |
58 | 59 |
use SL::Locale::String qw(t8); |
... | ... | |
263 | 264 |
|
264 | 265 |
AR->get_transdate(\%myconfig, $form); |
265 | 266 |
$form->{initial_transdate} = $form->{transdate}; |
267 |
$form->{initial_customer_id} = $form->{customer_id}; |
|
266 | 268 |
create_links(dont_save => 1); |
267 | 269 |
$form->{transdate} = $form->{initial_transdate}; |
270 |
$form->{customer_id} = $form->{initial_customer_id} if $form->{initial_customer_id}; |
|
268 | 271 |
|
269 | 272 |
if ($form->{customer_id}) { |
270 | 273 |
my $last_used_ar_chart = SL::DB::Customer->load_cached($form->{customer_id})->last_used_ar_chart; |
... | ... | |
279 | 282 |
$main::lxdebug->leave_sub(); |
280 | 283 |
} |
281 | 284 |
|
285 |
sub add_from_email_journal { |
|
286 |
die "No 'email_journal_id' was given." unless ($::form->{email_journal_id}); |
|
287 |
&add; |
|
288 |
} |
|
289 |
|
|
290 |
sub edit_with_email_journal_workflow { |
|
291 |
my ($self) = @_; |
|
292 |
die "No 'email_journal_id' was given." unless ($::form->{email_journal_id}); |
|
293 |
$::form->{workflow_email_journal_id} = delete $::form->{email_journal_id}; |
|
294 |
$::form->{workflow_email_attachment_id} = delete $::form->{email_attachment_id}; |
|
295 |
|
|
296 |
&edit; |
|
297 |
} |
|
298 |
|
|
282 | 299 |
sub edit { |
283 | 300 |
$main::lxdebug->enter_sub(); |
284 | 301 |
|
... | ... | |
862 | 879 |
} |
863 | 880 |
# /saving the history |
864 | 881 |
|
882 |
if ($form->{email_journal_id} && $form->{id} ne "") { |
|
883 |
my $ar_transaction = SL::DB::Invoice->new(id => $form->{id})->load; |
|
884 |
my $email_journal = SL::DB::EmailJournal->new( |
|
885 |
id => delete $form->{email_journal_id} |
|
886 |
)->load; |
|
887 |
$email_journal->link_to_record_with_attachment($ar_transaction, delete $::form->{email_attachment_id}); |
|
888 |
} |
|
889 |
|
|
865 | 890 |
if (!$inline) { |
866 | 891 |
my $msg = $locale->text("AR transaction '#1' posted (ID: #2)", $form->{invnumber}, $form->{id}); |
867 | 892 |
if ($::instance_conf->get_ar_add_doc && $::instance_conf->get_doc_storage) { |
... | ... | |
886 | 911 |
my $form = $main::form; |
887 | 912 |
my %myconfig = %main::myconfig; |
888 | 913 |
|
914 |
$form->{email_journal_id} = delete $form->{workflow_email_journal_id}; |
|
915 |
$form->{email_attachment_id} = delete $form->{workflow_email_attachment_id}; |
|
916 |
|
|
889 | 917 |
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); |
890 | 918 |
$form->{paidaccounts} = 1; |
891 | 919 |
$form->{rowcount}--; |
Auch abrufbar als: Unified diff
Workflow: E-Mail → Debitorenbuchung hinzugefügt