Fix zu Bug 252: Rechnungsnummern wurden nicht hochgezaehlt bei neu buchen (post as new)
$form->{id} = 0 if $form->{postasnew};
- $form->{invnumber} = $form->update_defaults(\%myconfig, "invnumber")
- unless $form->{invnumber};
+ # get new invnumber in sequence if no invnumber is given or if posasnew was requested
+ if (!$form->{invnumber} || $form->{postasnew}) {
+ $form->{invnumber} = $form->update_defaults(\%myconfig, "invnumber")
+ }
if ($print_post) {
if (!(IS->post_invoice(\%myconfig, \%$form))) {
$form->error($locale->text('Cannot post invoice!'));