Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 3dfe100d

Von Tamino Steinert vor etwa 1 Jahr hinzugefügt

  • ID 3dfe100daf712e6149666d577449d5cb239cae3d
  • Vorgänger 430ff87e
  • Nachfolger ec92748b

SL::DB::SepaExportItem: einfacher Presenter für SEPA-Überweisungen

Unterschiede anzeigen:

SL/Presenter/SepaExportItem.pm
1
package SL::Presenter::SepaExportItem;
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 sepa_export_item);
11

  
12
use Carp;
13

  
14
sub show {goto &sepa_export_item};
15

  
16
sub sepa_export_item {
17
  my ($sepa_export_item) = @_;
18

  
19
  my ($title, $source, $destination) = $sepa_export_item->ap_id ?
20
      (t8('Bank transfer via SEPA'), 'our', 'vc')
21
    : (t8('Bank collections via SEPA'), 'vc', 'our')
22
  ;
23

  
24
  my $source_bic       = "${source}_bic";
25
  my $source_iban      = "${source}_iban";
26
  my $destination_bic  = "${destination}_bic";
27
  my $destination_iban = "${destination}_iban";
28

  
29
  escape(join ' ', (
30
     $title,
31
     $sepa_export_item->sepa_export_id . ":",
32
     t8('Execution date'), $sepa_export_item->execution_date,
33
     "-",
34
     t8('Export date'), $sepa_export_item->sepa_export->itime->to_kivitendo,
35
     "-",
36
     $sepa_export_item->$source_bic,
37
     $sepa_export_item->$source_iban,
38
     "→",
39
     $sepa_export_item->$destination_bic,
40
     $sepa_export_item->$destination_iban,
41
     "-",
42
     t8('Amount'), $sepa_export_item->amount,
43
  ));
44
}
45

  
46
1;
47

  
48
__END__
49

  
50
=pod
51

  
52
=encoding utf8
53

  
54
=head1 NAME
55

  
56
SL::Presenter::SepaExportItem - Presenter module for SL::DB::SepaExportItem objects
57

  
58
=head1 SYNOPSIS
59

  
60
  my $object = SL::DB::Manager::SepaExportItem->get_first();
61
  my $html   = SL::Presenter::SepaExportItem::sepa_export_item($object);
62

  
63
=head1 FUNCTIONS
64

  
65
=over 4
66

  
67
=item C<show $object>
68

  
69
Alias for C<sepa_export_item $object>.
70

  
71
=item C<sepa_export_item $object>
72

  
73
Returns a rendered version (actually an instance of
74
L<SL::Presenter::EscapedText>) of the sepa export item object
75
C<$object>.
76

  
77
=back
78

  
79
=head1 BUGS
80

  
81
Nothing here yet.
82

  
83
=head1 AUTHOR
84

  
85
Tamino Steinert E<lt>tamino.steinert@tamino.stE<gt>
86

  
87
=cut

Auch abrufbar als: Unified diff