Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 26c66e2c

Von Kivitendo Admin vor fast 10 Jahren hinzugefügt

  • ID 26c66e2caae4a9af6464223cbde41a74203f59ec
  • Vorgänger 048f2af4
  • Nachfolger 3bd01861

Presenter für GL Transaction

analog zu invoice und purchase_invoice

Unterschiede anzeigen:

SL/Presenter.pm
12 12
use SL::Presenter::DeliveryOrder;
13 13
use SL::Presenter::EscapedText;
14 14
use SL::Presenter::Invoice;
15
use SL::Presenter::GL;
15 16
use SL::Presenter::Order;
16 17
use SL::Presenter::Part;
17 18
use SL::Presenter::Project;
SL/Presenter/GL.pm
1
package SL::Presenter::GL;
2

  
3
use strict;
4

  
5
use parent qw(Exporter);
6

  
7
use Exporter qw(import);
8
our @EXPORT = qw(gl_transaction);
9

  
10
use Carp;
11

  
12
sub gl_transaction {
13
  my ($self, $gl_transaction, %params) = @_;
14

  
15
  $params{display} ||= 'inline';
16

  
17
  croak "Unknown display type '$params{display}'" unless $params{display} =~ m/^(?:inline|table-cell)$/;
18

  
19
  my $text = join '', (
20
    $params{no_link} ? '' : '<a href="gl.pl?action=edit&amp;id=' . $self->escape($gl_transaction->id) . '">',
21
    $self->escape($gl_transaction->id),
22
    $params{no_link} ? '' : '</a>',
23
  );
24
  return $self->escaped_text($text);
25
}
26

  
27
1;
28

  
29
__END__
30

  
31
=pod
32

  
33
=encoding utf8
34

  
35
=head1 NAME
36

  
37
SL::Presenter::GL - Presenter module for GL transaction
38

  
39
=head1 SYNOPSIS
40

  
41
  my $object = SL::DB::Manager::GLTransaction->get_first();
42
  my $html   = SL::Presenter->get->gl_transaction($object, display => 'inline');
43

  
44
=head1 FUNCTIONS
45

  
46
=over 4
47

  
48
=item C<gl_transaction $object, %params>
49

  
50
Returns a rendered version (actually an instance of
51
L<SL::Presenter::EscapedText>) of a gl object C<$object>.
52

  
53
C<%params> can include:
54

  
55
=over 2
56

  
57
=item * display
58

  
59
Either C<inline> (the default) or C<table-cell>. At the moment both
60
representations are identical and produce the trans_id number linked
61
to the corresponding 'edit' action.
62

  
63
=item * no_link
64

  
65
If falsish (the default) then the trans_id number will be linked to the
66
"edit gl" dialog.
67

  
68

  
69
=back
70

  
71
=head1 BUGS
72

  
73
Nothing here yet.
74

  
75
=head1 AUTHOR
76

  
77
G. Richardson E<lt>information@kivitendo-premium.deE<gt>
78

  
79
=cut

Auch abrufbar als: Unified diff