Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision cfe41859

Von Tamino Steinert vor 12 Monaten hinzugefügt

  • ID cfe41859e6ee97e29f7166da7ad0ead4d771d84e
  • Vorgänger 8d425838
  • Nachfolger 5353aec5

SL::Presenter::BankTransaction: einfacher Presenter für Bankbuchungen

Unterschiede anzeigen:

SL/Presenter/ALL.pm
25 25
use SL::Presenter::Text;
26 26
use SL::Presenter::Tag;
27 27
use SL::Presenter::BankAccount;
28
use SL::Presenter::BankTransaction;
28 29
use SL::Presenter::MaterialComponents;
29 30

  
30 31
our %presenters = (
......
51 52
  text                        => 'SL::Presenter::Text',
52 53
  tag                         => 'SL::Presenter::Tag',
53 54
  bank_account                => 'SL::Presenter::BankAccount',
55
  bank_transaction            => 'SL::Presenter::BankTransaction',
54 56
  M                           => 'SL::Presenter::MaterialComponents',
55 57
);
56 58

  
SL/Presenter/BankTransaction.pm
1
package SL::Presenter::BankTransaction;
2

  
3
use strict;
4
use utf8;
5

  
6
use SL::Locale::String qw(t8);
7
use SL::Presenter::EscapedText qw(escape);
8

  
9
use Exporter qw(import);
10
our @EXPORT_OK = qw(show bank_transaction);
11

  
12
use Carp;
13

  
14
sub show {goto &bank_account};
15

  
16
sub bank_transaction {
17
  my ($bank_transaction) = @_;
18
  my $bank_account = $bank_transaction->local_bank_account;
19

  
20
  escape(join ' ', (
21
    t8('Bank transaction'),
22
    $bank_transaction->transdate . ":",
23
    $bank_account->bank_code,
24
    $bank_account->account_number,
25
    "→",
26
    $bank_transaction->remote_bank_code,
27
    $bank_transaction->remote_account_number,
28
    "-",
29
    $bank_transaction->amount . $bank_transaction->currency->name,
30
  ));
31
}
32

  
33
1;
34

  
35
__END__
36

  
37
=pod
38

  
39
=encoding utf8
40

  
41
=head1 NAME
42

  
43
SL::Presenter::BankTransaction - Presenter module for SL::DB::BankTransaction objects
44

  
45
=head1 SYNOPSIS
46

  
47
  my $object = SL::DB::Manager::BankTransaction->get_first();
48
  my $html   = SL::Presenter::BankTransaction::bank_transaction($object);
49
  # or
50
  my $html   = $object->presenter->show();
51

  
52
=head1 FUNCTIONS
53

  
54
=over 4
55

  
56
=item C<show $object>
57

  
58
Alias for C<bank_transaction $object>.
59

  
60
=item C<bank_transaction $object>
61

  
62
Returns a rendered version (actually an instance of
63
L<SL::Presenter::EscapedText>) of the bank transaction object
64
C<$object>.
65

  
66
=back
67

  
68
=head1 BUGS
69

  
70
Nothing here yet.
71

  
72
=head1 AUTHOR
73

  
74
Tamino Steinert E<lt>tamino.steinert@tamino.stE<gt>
75

  
76
=cut

Auch abrufbar als: Unified diff