Revision 2a10bda6
Von G. Richardson vor mehr als 13 Jahren hinzugefügt
SL/AM.pm | ||
---|---|---|
199 | 199 |
sub save_account { |
200 | 200 |
$main::lxdebug->enter_sub(); |
201 | 201 |
|
202 |
# TODO: it should be forbidden to change an account to a heading if there |
|
203 |
# have been bookings to this account in the past |
|
204 |
|
|
202 | 205 |
my ($self, $myconfig, $form) = @_; |
203 | 206 |
|
204 | 207 |
# connect to database, turn off AutoCommit |
... | ... | |
242 | 245 |
|
243 | 246 |
my @values; |
244 | 247 |
|
248 |
|
|
245 | 249 |
if ($form->{id}) { |
250 |
|
|
251 |
# if charttype is heading make sure certain values are empty |
|
252 |
# specifically, if charttype is changed from an existing account, empty the |
|
253 |
# fields unnecessary for headings, so that e.g. heading doesn't appear in |
|
254 |
# drop-down menues due to still having a valid "link" entry |
|
255 |
|
|
256 |
if ( $form->{charttype} eq 'H' ) { |
|
257 |
$form->{link} = ''; |
|
258 |
$form->{pos_bwa} = ''; |
|
259 |
$form->{pos_bilanz} = ''; |
|
260 |
$form->{pos_eur} = ''; |
|
261 |
$form->{new_chart_id} = ''; |
|
262 |
$form->{valid_from} = ''; |
|
263 |
}; |
|
264 |
|
|
246 | 265 |
$query = qq|UPDATE chart SET |
247 | 266 |
accno = ?, |
248 | 267 |
description = ?, |
... | ... | |
272 | 291 |
$form->{id}, |
273 | 292 |
); |
274 | 293 |
|
294 |
|
|
275 | 295 |
} |
276 | 296 |
|
277 | 297 |
do_query($form, $dbh, $query, @values); |
Auch abrufbar als: Unified diff
Bugfix 1626: changing charttype from account to heading
Empty certain values in chart before saving to database when converting an
account from chart to heading, so that for example link is empty.
Added a TODO: make sure that accounts that have been booked can't be converted
to a heading