}
+sub _get_radieren {
+ return ($::instance_conf->get_gl_changeable == 2) ? ($::form->current_date(\%::myconfig) eq $::form->{gldate}) : ($::instance_conf->get_gl_changeable == 1);
+}
+
sub form_header {
$::lxdebug->enter_sub;
$::auth->assert('general_ledger');
$::form->header;
print $::form->parse_html_template('gl/form_header', {
hide_title => $title,
+ readonly => $::form->{id} && ($::form->{locked} || !_get_radieren()),
});
$::lxdebug->leave_sub;
$follow_ups_due = sum map { $_->{due} * 1 } @{ $follow_ups || [] };
}
- my $radieren = ($::instance_conf->get_gl_changeable == 2)
- ? ($::form->current_date(\%::myconfig) eq $::form->{gldate})
- : ($::instance_conf->get_gl_changeable == 1);
-
print $::form->parse_html_template('gl/form_footer', {
- radieren => $radieren,
+ radieren => _get_radieren(),
follow_ups => $follow_ups,
follow_ups_due => $follow_ups_due,
});
</tr>
<tr>
<th align=right>[% 'Reference' | $T8 %]</th>
- <td>[% L.input_tag('reference', reference, size=20, readonly=id) %]</td>
+ <td>[% L.input_tag('reference', reference, size=20, readonly=readonly) %]</td>
<td align=left>
<table>
<tr>
<th align=right width=50% nowrap>[% 'Date' | $T8 %]</th>
- <td>[% L.date_tag('transdate', transdate, readonly=id) %]</td>
+ <td>[% L.date_tag('transdate', transdate, readonly=readonly) %]</td>
</tr>
</table>
</td>
[%- IF id %]
<tr>
<th align=right>[% 'Belegnummer' | $T8 %]</th>
- <td>[% L.input_tag('id', id, size=20, readonly=id) %]</td>
+ <td>[% L.input_tag('id', id, size=20, readonly=readonly) %]</td>
<td align=left>
<table>
<tr>
<th align=right width=50%>[% 'Buchungsdatum' | $T8 %]</th>
- <td align=left>[% L.date_tag('gldate', gldate, readonly=id) %]</td>
+ <td align=left>[% L.date_tag('gldate', gldate, readonly=1) %]</td>
</tr>
</table>
</td>
<tr>
<th align=right width=1%>[% 'Description' | $T8 %]</th>
- <td width=1%>[% L.areainput_tag('description', description, cols=50, readonly=id) %]</td>
+ <td width=1%>[% L.areainput_tag('description', description, cols=50, readonly=readonly) %]</td>
<td>
<table>
<tr>
<table width=100%>
<tr>
<th align=right width=50%>[% 'Mitarbeiter' | $T8 %]</th>
- <td align=left>[% L.input_tag('employee', employee, size=20, readonly=id) %]</td>
+ <td align=left>[% L.input_tag('employee', employee, size=20, readonly=readonly) %]</td>
</tr>
</table>
</td>