Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision fca94606

Von Jan Büren vor etwa 6 Jahren hinzugefügt

  • ID fca946068709229a086497380cdc62d874a8e795
  • Vorgänger 9e30e4f6
  • Nachfolger 69e03937

Redundanten Template-Code in bank_transactions/invoices.html aufgeräumt

Unterschiede anzeigen:

SL/Controller/BankTransaction.pm
# create an HTML blob to be used by the js function add_invoices in templates/webpages/bank_transactions/list.html
# and return encoded as JSON
my $bt = SL::DB::Manager::BankTransaction->find_by( id => $::form->{bt_id} );
my $invoice = SL::DB::Manager::Invoice->find_by( id => $::form->{prop_id} ) || SL::DB::Manager::PurchaseInvoice->find_by( id => $::form->{prop_id} );
croak("Need bt_id") unless $::form->{bt_id};
die unless $bt and $invoice;
my $invoice = SL::DB::Manager::Invoice->find_by( id => $::form->{prop_id} ) || SL::DB::Manager::PurchaseInvoice->find_by( id => $::form->{prop_id} );
my @select_options = $invoice->get_payment_select_options_for_bank_transaction($::form->{bt_id});
croak("No valid invoice found") unless $invoice;
my $html;
$html = $self->render(
my $html = $self->render(
'bank_transactions/_payment_suggestion', { output => 0 },
bt_id => $::form->{bt_id},
prop_id => $::form->{prop_id},
invoice => $invoice,
SELECT_OPTIONS => \@select_options,
);
$self->render(\ SL::JSON::to_json( { 'html' => "$html" } ), { layout => 0, type => 'json', process => 0 });

Auch abrufbar als: Unified diff