my %myconfig = %main::myconfig;
my $locale = $main::locale;
+ open(FH, ">/tmp/lx.dump");
+ print FH Dumper($form);
+ close FH;
$main::auth->assert('invoice_edit');
$form->{transdate} = $form->{invdate} = $form->current_date(\%myconfig);
$form->{creditremaining} -= ($form->{oldinvtotal} - $form->{ordtotal});
+ # bei Gutschriften werden Zahlungseingänge aus Rechnung nicht übernommen
+ for my $i (1 .. $form->{paidaccounts}) {
+ delete $form->{"paid_$i"};
+ delete $form->{"source_$i"};
+ delete $form->{"memo_$i"};
+ delete $form->{"datepaid_$i"};
+ delete $form->{"AR_paid_$i"};
+ };
+ $form->{paidaccounts} = 1;
+
&prepare_invoice;