@@ -1333,7 +1334,7 @@ $follow_ups_block
print qq||;
}
- # Löschen und Ändern von Buchungen nicht mehr möglich (GoB) nur am selben Tag möglich
+ # Löschen und Ãndern von Buchungen nicht mehr möglich (GoB) nur am selben Tag möglich
if (!$form->{locked} && $radieren) {
print qq|
@@ -1423,7 +1424,7 @@ sub yes {
if(!exists $form->{addition} && $form->{id} ne "") {
$form->{snumbers} = qq|ordnumber_| . $form->{ordnumber};
$form->{addition} = "DELETED";
- $form->save_history($form->dbconnect(\%myconfig));
+ $form->save_history;
}
# /saving the history
$form->redirect($locale->text('Transaction deleted!'))
@@ -1478,19 +1479,19 @@ sub post_transaction {
$form->{"credit_$i"} = 0;
$form->{"tax_$i"} = 0;
$creditcount--;
- $creditlock = 1;
+ $form->{creditlock} = 1;
}
if (($creditcount >= 2) && ($debitcount == 2)) {
$form->{"debit_$i"} = 0;
$form->{"tax_$i"} = 0;
$debitcount--;
- $debitlock = 1;
+ $form->{debitlock} = 1;
}
if (($creditcount == 1) && ($debitcount == 2)) {
- $creditlock = 1;
+ $form->{creditlock} = 1;
}
if (($creditcount == 2) && ($debitcount == 1)) {
- $debitlock = 1;
+ $form->{debitlock} = 1;
}
if ($debitcredit && $credittax) {
$form->{"taxchart_$i"} = "0--0.00";
@@ -1544,7 +1545,7 @@ sub post_transaction {
for my $i (1 .. $form->{rowcount}) {
my $dr = $form->{"debit_$i"};
my $cr = $form->{"credit_$i"};
- $tax = $form->{"tax_$i"};
+ my $tax = $form->{"tax_$i"};
if ($dr && $cr) {
$form->error($locale->text('Cannot post transaction with a debit and credit entry for the same account!'));
}
@@ -1581,7 +1582,7 @@ sub post_transaction {
$form->{snumbers} = qq|ordnumber_| . $form->{ordnumber};
$form->{addition} = "SAVED";
$form->{what_done} = $locale->text("Buchungsnummer") . " = " . $form->{id};
- $form->save_history($form->dbconnect(\%myconfig));
+ $form->save_history;
}
# /saving the history
@@ -1596,6 +1597,12 @@ sub post {
my $form = $main::form;
my $locale = $main::locale;
+ if ($::myconfig{mandatory_departments} && !$form->{department}) {
+ $form->{saved_message} = $::locale->text('You have to specify a department.');
+ update();
+ exit;
+ }
+
$form->{title} = $locale->text("$form->{title} General Ledger Transaction");
$form->{storno} = 0;
@@ -1603,7 +1610,7 @@ sub post {
remove_draft() if $form->{remove_draft};
- $form->{callback} = build_std_url("action=add", "show_details");
+ $form->{callback} = build_std_url("action=add&DONT_LOAD_DRAFT=1", "show_details");
$form->redirect($form->{callback});
$main::lxdebug->leave_sub();
@@ -1643,7 +1650,7 @@ sub storno {
if(!exists $form->{addition} && $form->{id} ne "") {
$form->{snumbers} = "ordnumber_$form->{ordnumber}";
$form->{addition} = "STORNO";
- $form->save_history($form->dbconnect(\%myconfig));
+ $form->save_history;
}
# /saving the history
|