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/DB/Helper/Payment.pm
sub get_payment_select_options_for_bank_transaction {
my ($self, $bt_id, %params) = @_;
# no skonto date -> no select option
return { payment_type => 'without_skonto', display => t8('without skonto') , selected => 1 } unless $self->skonto_date;
my $bt = SL::DB::BankTransaction->new(id => $bt_id)->load;
# CAVEAT template code expects with_skonto_pt at position 1 for visual help
my @options;
if(!$self->skonto_date) {
push(@options, { payment_type => 'without_skonto', display => t8('without skonto'), selected => 1 });
# wrong call to presenter or not implemented? disabled option is ignored
# push(@options, { payment_type => 'with_skonto_pt', display => t8('with skonto acc. to pt'), disabled => 1 });
return @options;
}
# valid skonto date, check if skonto is preferred
my $bt = SL::DB::BankTransaction->new(id => $bt_id)->load;
if ($self->skonto_date && $self->within_skonto_period($bt->transdate)) {
push(@options, { payment_type => 'without_skonto', display => t8('without skonto') });
push(@options, { payment_type => 'with_skonto_pt', display => t8('with skonto acc. to pt'), selected => 1 });

Auch abrufbar als: Unified diff