$::form->{$_} = $form_defaults->{$_} for keys %{ $form_defaults // {} };
flash('info', $::locale->text("The record template '#1' has been loaded.", $template->template_name));
+ flash('info', $::locale->text("Payment bookings disallowed. After the booking this record may be " .
+ "suggested with the amount of '#1' or otherwise has to be choosen manually." .
+ " No automatic payment booking will be done to chart '#2'.",
+ $form_defaults->{paid_1_suggestion},
+ $form_defaults->{AP_paid_1_suggestion},
+ )) if $::form->{no_payment_bookings};
update(
keep_rows_without_amount => 1,
$form->{what_done} = "invoice";
$form->save_history;
}
- # /saving the history
- # Dieser Text wird niemals ausgegeben: Probleme beim redirect?
- $form->redirect($locale->text('AP transaction posted.')) unless $inline;
+ # no restore_from_session_id needed. we like to have a newly generated
+ # list of invoices for bank transactions
+ print $form->redirect_header($form->{callback}) if ($form->{callback} =~ /BankTransaction/);
+ $form->redirect($locale->text('AP transaction posted.') . ' ' . $locale->text('ID') . ': ' . $form->{id}) unless $inline;
+ # TODO Add callback/return flag in myconfig
+ # With version 3.5 we can add documents, but only after posting. there should be a flag in myconfig for the user
+ # $form->{callback} ||= 'ap.pl?action=edit&id=' . $form->{id} if $myconfig{no_reset_arap};
+
} else {
$form->error($locale->text('Cannot post transaction!'));
}
my $closedto = $::form->datetonum($::form->{closedto}, \%::myconfig);
my $is_closed = $transdate <= $closedto;
- my $change_never = $::instance_conf->get_ar_changeable == 0;
- my $change_on_same_day_only = $::instance_conf->get_ar_changeable == 2 && ($::form->current_date(\%::myconfig) ne $::form->{gldate});
+ my $change_never = $::instance_conf->get_ap_changeable == 0;
+ my $change_on_same_day_only = $::instance_conf->get_ap_changeable == 2 && ($::form->current_date(\%::myconfig) ne $::form->{gldate});
my $is_storno = IS->is_storno(\%::myconfig, $::form, 'ap', $::form->{id});
my $has_storno = IS->has_storno(\%::myconfig, $::form, 'ap');