+ # add some more data to $results:
+ # create drop-down data for payment types and suggest amount to be paid according
+ # to open amount or skonto
+
+ foreach my $result ( @$results ) {
+ my $invoice = $vc eq 'customer' ? SL::DB::Manager::Invoice->find_by( id => $result->{id} )
+ : SL::DB::Manager::PurchaseInvoice->find_by( id => $result->{id} );
+
+ $invoice->get_payment_suggestions(sepa => 1); # consider amounts of open entries in sepa_export_items
+ $result->{skonto_amount} = $invoice->skonto_amount;
+ $result->{within_skonto_period} = $invoice->within_skonto_period;
+ $result->{invoice_amount_suggestion} = $invoice->{invoice_amount_suggestion};
+ $result->{payment_select_options} = $invoice->{payment_select_options};
+ };
+