1 package SL::Presenter::SepaExport;
 
   5 use parent qw(Exporter);
 
   7 use Exporter qw(import);
 
   8 our @EXPORT = qw(sepa_export);
 
  13   my ($self, $sepa_export, %params) = @_;
 
  15   $params{display} ||= 'inline';
 
  17   croak "Unknown display type '$params{display}'" unless $params{display} =~ m/^(?:inline|table-cell)$/;
 
  20     $params{no_link} ? '' : '<a href="sepa.pl?action=bank_transfer_edit&vc=' . $self->escape($sepa_export->vc) . '&id=' . $self->escape($sepa_export->id) . '">',
 
  21     $self->escape($sepa_export->id),
 
  22     $params{no_link} ? '' : '</a>',
 
  24   return $self->escaped_text($text);
 
  37 SL::Presenter::SepaExport - Presenter module for Rose::DB objects
 
  38 for SEPA transfers and collections
 
  42   # Collections from an invoice:
 
  43   my $invoice = SL::DB::Invoice->new(id => 123)->load;
 
  44   my $object  = $invoice->sepa_export_items->[0]->sepa_export;
 
  45   my $html    = SL::Presenter->get->sepa_export($object, display => 'inline');
 
  47   # Transfers from a purchase invoice:
 
  48   my $invoice = SL::DB::PurchaseInvoice->new(id => 123)->load;
 
  49   my $object  = $invoice->sepa_export_items->[0]->sepa_export;
 
  50   my $html    = SL::Presenter->get->sepa_export($object, display => 'inline');
 
  56 =item C<sepa_export $object, %params>
 
  58 Returns a rendered version (actually an instance of
 
  59 L<SL::Presenter::EscapedText>) of the SEPA collection/transfer object
 
  62 C<%params> can include:
 
  68 Either C<inline> (the default) or C<table-cell>. At the moment both
 
  69 representations are identical and produce the objects's delivery
 
  70 order number linked to the corresponding 'edit' action.
 
  74 If falsish (the default) then the delivery order number will be linked
 
  75 to the "edit SEPA transfer" dialog from the 'cash' menu.
 
  87 Moritz Bunkus E<lt>m.bunkus@linet-services.deE<gt>