1. Einige Spalten nur dann anzeigen, wenn "Details anzeigen" aktiv ist.
2. Automatisch den eingegebenen Wert aus der ersten Zeile "Soll" in die zweite Zeile "Haben" kopieren, wenn er verändert wird.
Patch von Rainer Guempelein.
} (@{ $form->{all_departments} });
}
} (@{ $form->{all_departments} });
}
+ $form->{show_details} = $myconfig{show_form_details} unless defined $form->{show_details};
+
&display_form(1);
$lxdebug->leave_sub();
&display_form(1);
$lxdebug->leave_sub();
+ $form->{show_details} = $myconfig{show_form_details} unless defined $form->{show_details};
+
form_header();
display_rows();
form_footer();
form_header();
display_rows();
form_footer();
my ($init) = @_;
$lxdebug->enter_sub();
my ($init) = @_;
$lxdebug->enter_sub();
+ $form->{debit_1} = 0 if !$form->{"debit_1"};
$form->{totaldebit} = 0;
$form->{totalcredit} = 0;
$form->{totaldebit} = 0;
$form->{totalcredit} = 0;
'-labels' => \%project_labels,
'-default' => $form->{"project_id_$i"} ));
'-labels' => \%project_labels,
'-default' => $form->{"project_id_$i"} ));
+ my $copy2credit = 'onkeyup="copy_debit_to_credit()"' if $i == 1;
+
print qq|<tr valign=top>
$accno
$fx_transaction
print qq|<tr valign=top>
$accno
$fx_transaction
- <td><input name="debit_$i" size=8 value="$form->{"debit_$i"}" accesskey=$i $debitreadonly></td>
+ <td><input name="debit_$i" size="8" value="$form->{"debit_$i"}" accesskey=$i $copy2credit $debitreadonly></td>
<td><input name="credit_$i" size=8 value="$form->{"credit_$i"}" $creditreadonly></td>
<td><input name="tax_$i" size=6 value="$form->{"tax_$i"}"></td>
$korrektur
<td><input name="credit_$i" size=8 value="$form->{"credit_$i"}" $creditreadonly></td>
<td><input name="tax_$i" size=6 value="$form->{"tax_$i"}"></td>
$korrektur
+ $tax|;
+
+ if ($form->{show_details}) {
+ print qq|
$source
$memo
<td>$projectnumber</td>
$source
$memo
<td>$projectnumber</td>
}
$form->hide_form(qw(rowcount selectaccno));
}
$form->hide_form(qw(rowcount selectaccno));
$form->{title} = $locale->text("$title General Ledger Transaction");
$readonly = ($form->{id}) ? "readonly" : "";
$form->{title} = $locale->text("$title General Ledger Transaction");
$readonly = ($form->{id}) ? "readonly" : "";
+ $show_details_checked = "checked" if $form->{show_details};
+
# $locale->text('Add General Ledger Transaction')
# $locale->text('Edit General Ledger Transaction')
map { $form->{$_} =~ s/\"/"/g }
qw(reference description chart taxchart);
# $locale->text('Add General Ledger Transaction')
# $locale->text('Edit General Ledger Transaction')
map { $form->{$_} =~ s/\"/"/g }
qw(reference description chart taxchart);
$form->{javascript} = qq|<script type="text/javascript">
<!--
function setTaxkey(accno, row) {
$form->{javascript} = qq|<script type="text/javascript">
<!--
function setTaxkey(accno, row) {
+
+ function copy_debit_to_credit() {
+ var txt = document.getElementsByName('debit_1')[0].value;
+ document.getElementsByName('credit_2')[0].value = txt;
+ };
+
+ $form->{javascript} .= qq|<script type="text/javascript" src="js/show_form_details.js"></script>|;
$form->{selectdepartment} =~ s/ selected//;
$form->{selectdepartment} =~
$form->{selectdepartment} =~ s/ selected//;
$form->{selectdepartment} =~
}
# use JavaScript Calendar or not
}
# use JavaScript Calendar or not
- $form->{jsscript} = $jscalendar;
$jsscript = "";
if ($form->{jsscript}) {
$jsscript = "";
if ($form->{jsscript}) {
+
+ print qq|<tr>
+ <td width="1%" align="right" nowrap>| . $locale->text('Show details') . qq|</td>
+ <td width="1%"><input type="checkbox" onclick="show_form_details();" name="show_details" value="1" $show_details_checked></td>
+ </tr>|;
+
print qq|
<tr>
<td colspan=4>
print qq|
<tr>
<td colspan=4>
<th class=listheading style="width:5%">|
. $locale->text('Korrektur') . qq|</th>
<th class=listheading style="width:10%">|
<th class=listheading style="width:5%">|
. $locale->text('Korrektur') . qq|</th>
<th class=listheading style="width:10%">|
- . $locale->text('Taxkey') . qq|</th>
- <th class=listheading style="width:20%">|
- . $locale->text('Source') . qq|</th>
+ . $locale->text('Taxkey') . qq|</th>|;
+
+ if ($form->{show_details}) {
+ print qq|
+ <th class=listheading style="width:20%">| . $locale->text('Source') . qq|</th>
<th class=listheading style="width:20%">| . $locale->text('Memo') . qq|</th>
<th class=listheading style="width:20%">| . $locale->text('Memo') . qq|</th>
- <th class=listheading style="width:20%">|
- . $locale->text('Project Number') . qq|</th>
+ <th class=listheading style="width:20%">| . $locale->text('Project Number') . qq|</th>
+|;
+ }
+
+ print qq|
# }
} else {
if ($transdate > $closedto) {
# }
} else {
if ($transdate > $closedto) {
- print qq|<input class=submit type=submit name=action value="|
+ print qq|<input class=submit type=submit name=action id=update_button value="|
. $locale->text('Update') . qq|">
<input class=submit type=submit name=action value="|
. $locale->text('Post') . qq|">|;
. $locale->text('Update') . qq|">
<input class=submit type=submit name=action value="|
. $locale->text('Post') . qq|">|;
sub post {
$lxdebug->enter_sub();
sub post {
$lxdebug->enter_sub();
+ $form->{title} = $locale->text("$form->{title} General Ledger Transaction");
+
# check if there is something in reference and date
$form->isblank("reference", $locale->text('Reference missing!'));
$form->isblank("transdate", $locale->text('Transaction Date missing!'));
# check if there is something in reference and date
$form->isblank("reference", $locale->text('Reference missing!'));
$form->isblank("transdate", $locale->text('Transaction Date missing!'));
$form->save_history($form->dbconnect(\%myconfig));
}
# /saving the history
$form->save_history($form->dbconnect(\%myconfig));
}
# /saving the history
- $form->redirect("Buchung gespeichert. Buchungsnummer = " . $form->{id});
+
+ $form->{callback} = build_std_url("action=add", "show_details");
+ $form->redirect($form->{callback});
+
'Select from one of the projects below' => 'Wählen Sie eines der untenstehenden Projekte',
'Sep' => 'Sep',
'September' => 'September',
'Select from one of the projects below' => 'Wählen Sie eines der untenstehenden Projekte',
'Sep' => 'Sep',
'September' => 'September',
+ 'Show details' => 'Details anzeigen',
'Source' => 'Beleg',
'Storno' => 'Storno',
'Storno Invoice' => 'Stornorechnung',
'Source' => 'Beleg',
'Storno' => 'Storno',
'Storno Invoice' => 'Stornorechnung',