$accno
$fx_transaction
|
+ . ($i + 6 + (($i - 1) * 8)) . qq| $debitreadonly>
|
+ . ($i + 7 + (($i - 1) * 8)) . qq| $creditreadonly>
|
$korrektur
@@ -1241,10 +1289,10 @@ sub form_header {
- | . $locale->text('Reference') . qq| |
+ | . $locale->text('Reference') . qq| |
|
-
+
| . $locale->text('Date') . qq| |
$button1
@@ -1258,7 +1306,7 @@ sub form_header {
| . $locale->text('Belegnummer') . qq| |
|
-
+
| . $locale->text('Buchungsdatum') . qq| |
{gldate} $readonly> |
@@ -1272,8 +1320,8 @@ sub form_header {
if ($form->{id}) {
print qq|
- | . $locale->text('Description') . qq| |
- $description |
+ | . $locale->text('Description') . qq| |
+ $description |
@@ -1294,8 +1342,8 @@ sub form_header {
} else {
print qq|
- | . $locale->text('Description') . qq| |
- $description |
+ | . $locale->text('Description') . qq| |
+ $description |
@@ -1308,6 +1356,7 @@ sub form_header {
}
print qq|
+
|
@@ -1343,11 +1392,19 @@ sub form_footer {
map {
$form->{$_} =
- $form->format_amount(\%myconfig, $form->{$_}, $decimalplaces, " ")
+ $form->format_amount(\%myconfig, $form->{$_}, 2, " ")
} qw(totaldebit totalcredit);
print qq|
+ |
+ |
+ $form->{totaldebit} |
+ $form->{totalcredit} |
+ |
+
+ |
+
{path}>
@@ -1463,11 +1520,16 @@ sub post {
# check project
&check_project;
- my @a = ();
- my $count = 0;
- my $debittax = 0;
- my $credittax = 0;
- my @flds =
+ my @a = ();
+ my $count = 0;
+ my $debittax = 0;
+ my $credittax = 0;
+ my $debitcount = 0;
+ my $creditcount = 0;
+ $creditlock = 0;
+ $debitlock = 0;
+
+ my @flds =
qw(accno debit credit projectnumber fx_transaction source memo tax taxchart);
for my $i (1 .. $form->{rowcount}) {
@@ -1480,6 +1542,37 @@ sub post {
push @a, {};
$debitcredit = ($form->{"debit_$i"} == 0) ? "0" : "1";
+
+ if ($debitcredit) {
+ $debitcount++;
+ } else {
+ $creditcount++;
+ }
+
+ if (($debitcount >= 2) && ($creditcount == 2)) {
+ $form->{"credit_$i"} = 0;
+ $form->{"tax_$i"} = 0;
+ $creditcount--;
+ $creditlock = 1;
+ }
+ if (($creditcount >= 2) && ($debitcount == 2)) {
+ $form->{"debit_$i"} = 0;
+ $form->{"tax_$i"} = 0;
+ $debitcount--;
+ $debitlock = 1;
+ }
+ if (($creditcount == 1) && ($debitcount == 2)) {
+ $creditlock = 1;
+ }
+ if (($creditcount == 2) && ($debitcount == 1)) {
+ $debitlock = 1;
+ }
+ if ($debitcredit && $credittax) {
+ $form->{"taxchart_$i"} = "0--0.00";
+ }
+ if (!$debitcredit && $debittax) {
+ $form->{"taxchart_$i"} = "0--0.00";
+ }
$amount =
($form->{"debit_$i"} == 0)
? $form->{"credit_$i"}
--
2.20.1
| | | | |