$form->{title} |
-
+ | .
+
+ ($form->{saved_message} ? qq|
+
+ $form->{saved_message}
+ |
| : '') .
+
+qq|
@@ -1161,71 +1162,71 @@ sub form_header {
. " $form->{previous_gldate}"
. qq| |
-
- | . $locale->text('Reference') . qq| |
- |
-
-
+ |
+
|;
if ($form->{id}) {
print qq|
-
- | . $locale->text('Belegnummer') . qq| |
- |
-
-
- |
-
|;
+
+ | . $locale->text('Belegnummer') . qq| |
+ |
+
+
+ |
+
|;
}
print qq|
- $department|;
+ $department|;
if ($form->{id}) {
print qq|
-
- | . $locale->text('Description') . qq| |
- $description |
+
+ | . $locale->text('Description') . qq| |
+ $description |
-
- |
-
-
- |
-
|;
+
+
+
+
+ |
+ |;
} else {
print qq|
-
- | . $locale->text('Description') . qq| |
- $description |
-
-
- |
-
|;
+
+ | . $locale->text('Description') . qq| |
+ $description |
+
+
+ |
+
|;
}
print qq|
@@ -1247,13 +1248,13 @@ sub form_header {
-
- |
+ |
+ |
. $locale->text('Account') . qq| |
- | . $locale->text('Chart balance') . qq| |
- |
+ | | . $locale->text('Chart balance') . qq| |
+ |
. $locale->text('Debit') . qq| |
- |
+ | |
. $locale->text('Credit') . qq| |
|
. $locale->text('Tax') . qq| |
@@ -1262,14 +1263,14 @@ sub form_header {
if ($form->{show_details}) {
print qq|
- | . $locale->text('Source') . qq| |
- | . $locale->text('Memo') . qq| |
- | . $locale->text('Project Number') . qq| |
+ | . $locale->text('Source') . qq| |
+ | . $locale->text('Memo') . qq| |
+ | . $locale->text('Project Number') . qq| |
|;
}
print qq|
-
+
$jsscript
|;
@@ -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|
@@ -1422,8 +1423,8 @@ sub yes {
# saving the history
if(!exists $form->{addition} && $form->{id} ne "") {
$form->{snumbers} = qq|ordnumber_| . $form->{ordnumber};
- $form->{addition} = "DELETED";
- $form->save_history($form->dbconnect(\%myconfig));
+ $form->{addition} = "DELETED";
+ $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
|