Revision 42ed89f3
Von Philip Reetz vor mehr als 16 Jahren hinzugefügt
bin/mozilla/am.pl | ||
---|---|---|
55 | 55 |
sub save { call_sub("save_$form->{type}"); } |
56 | 56 |
sub edit { call_sub("edit_$form->{type}"); } |
57 | 57 |
sub continue { call_sub($form->{"nextsub"}); } |
58 |
sub save_as_new { call_sub("save_as_new_$form->{type}"); } |
|
58 | 59 |
|
59 | 60 |
sub add_account { |
60 | 61 |
$lxdebug->enter_sub(); |
... | ... | |
373 | 374 |
. $locale->text('Delete') . qq|">|; |
374 | 375 |
} |
375 | 376 |
|
377 |
if ($form->{id} && $form->{type} eq "account") { |
|
378 |
print qq| |
|
379 |
<input class=submit type=submit name=action value="| |
|
380 |
. $locale->text('Save as new') . qq|">|; |
|
381 |
} |
|
382 |
|
|
376 | 383 |
print qq| |
377 | 384 |
</form> |
378 | 385 |
|
... | ... | |
402 | 409 |
$lxdebug->leave_sub(); |
403 | 410 |
} |
404 | 411 |
|
412 |
sub save_as_new_account { |
|
413 |
$lxdebug->enter_sub(); |
|
414 |
|
|
415 |
$auth->assert('config'); |
|
416 |
|
|
417 |
$form->isblank("accno", $locale->text('Account Number missing!')); |
|
418 |
$form->isblank("description", $locale->text('Account Description missing!')); |
|
419 |
|
|
420 |
if ($form->{charttype} eq 'A'){ |
|
421 |
$form->isblank("category", $locale->text('Account Type missing!')); |
|
422 |
} |
|
423 |
|
|
424 |
for my $taxkey (0 .. 9) { |
|
425 |
if ($form->{"taxkey_id_$taxkey"}) { |
|
426 |
$form->{"taxkey_id_$taxkey"} = "NEW"; |
|
427 |
} |
|
428 |
} |
|
429 |
|
|
430 |
$form->{id} = 0; |
|
431 |
if ($form->{"original_accno"} && |
|
432 |
($form->{"accno"} eq $form->{"original_accno"})) { |
|
433 |
$form->error($locale->text('Account Number already used!')); |
|
434 |
} |
|
435 |
$form->redirect($locale->text('Account saved!')) |
|
436 |
if (AM->save_account(\%myconfig, \%$form)); |
|
437 |
$form->error($locale->text('Cannot save account!')); |
|
438 |
|
|
439 |
$lxdebug->leave_sub(); |
|
440 |
} |
|
441 |
|
|
405 | 442 |
sub list_account { |
406 | 443 |
$lxdebug->enter_sub(); |
407 | 444 |
|
Auch abrufbar als: Unified diff
Beim Bearbeiten von Konten die Funktion "als neu speichern" hinzugefuegt, um ein Konto mit allen Einstelungen zu klonen