43 |
43 |
use SL::DB::ReconciliationLink;
|
44 |
44 |
use SL::DB::BankTransactionAccTrans;
|
45 |
45 |
use SL::DB::Tax;
|
|
46 |
use SL::DB::ValidityToken;
|
46 |
47 |
use SL::FU;
|
47 |
48 |
use SL::GL;
|
48 |
49 |
use SL::Helper::Flash qw(flash flash_later);
|
... | ... | |
148 |
149 |
|
149 |
150 |
flash('info', $::locale->text("The record template '#1' has been loaded.", $template->template_name));
|
150 |
151 |
|
|
152 |
$::form->{form_validity_token} = SL::DB::ValidityToken->create(scope => SL::DB::ValidityToken::SCOPE_GL_TRANSACTION_POST())->token;
|
|
153 |
|
151 |
154 |
update(
|
152 |
155 |
keep_rows_without_amount => 1,
|
153 |
156 |
dont_add_new_row => 1,
|
... | ... | |
240 |
243 |
|
241 |
244 |
$form->{show_details} = $myconfig{show_form_details} unless defined $form->{show_details};
|
242 |
245 |
|
|
246 |
if (!$form->{form_validity_token}) {
|
|
247 |
$form->{form_validity_token} = SL::DB::ValidityToken->create(scope => SL::DB::ValidityToken::SCOPE_GL_TRANSACTION_POST())->token;
|
|
248 |
}
|
|
249 |
|
243 |
250 |
&display_form(1);
|
244 |
251 |
$main::lxdebug->leave_sub();
|
245 |
252 |
|
... | ... | |
659 |
666 |
sub show_draft {
|
660 |
667 |
$::form->{transdate} = DateTime->today_local->to_kivitendo if !$::form->{transdate};
|
661 |
668 |
$::form->{gldate} = $::form->{transdate} if !$::form->{gldate};
|
|
669 |
$::form->{form_validity_token} = SL::DB::ValidityToken->create(scope => SL::DB::ValidityToken::SCOPE_GL_TRANSACTION_POST())->token;
|
662 |
670 |
update();
|
663 |
671 |
}
|
664 |
672 |
|
... | ... | |
1448 |
1456 |
my $form = $main::form;
|
1449 |
1457 |
my $locale = $main::locale;
|
1450 |
1458 |
|
|
1459 |
my $validity_token;
|
|
1460 |
if (!$form->{id}) {
|
|
1461 |
$validity_token = SL::DB::Manager::ValidityToken->fetch_valid_token(
|
|
1462 |
scope => SL::DB::ValidityToken::SCOPE_GL_TRANSACTION_POST(),
|
|
1463 |
token => $form->{form_validity_token},
|
|
1464 |
);
|
|
1465 |
|
|
1466 |
$form->error($::locale->text('The form is not valid anymore.')) if !$validity_token;
|
|
1467 |
}
|
|
1468 |
|
1451 |
1469 |
if ($::myconfig{mandatory_departments} && !$form->{department_id}) {
|
1452 |
1470 |
$form->error($locale->text('You have to specify a department.'));
|
1453 |
1471 |
}
|
... | ... | |
1456 |
1474 |
$form->{storno} = 0;
|
1457 |
1475 |
|
1458 |
1476 |
post_transaction();
|
|
1477 |
|
|
1478 |
# If we get here, the transaction is posted.
|
|
1479 |
$validity_token->delete if $validity_token;
|
|
1480 |
delete $form->{form_validity_token};
|
|
1481 |
|
1459 |
1482 |
if ($::instance_conf->get_webdav) {
|
1460 |
1483 |
SL::Webdav->new(type => 'general_ledger',
|
1461 |
1484 |
number => $form->{id},
|
Gültigkeitstoken: Dialogbuchung