Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 60b170eb

Von Jan Büren vor fast 7 Jahren hinzugefügt

  • ID 60b170eb823d19d211db6412d2137129113e5c84
  • Vorgänger 12b50381
  • Nachfolger 97422880

SEPA-Export rückgängig machen

Noch nicht ausgeführte oder geschloßene SEPA-XML Exports
können wieder rückgängig gemacht werden, sodass der Anwender
hier die Chance hat Metadaten für die Banküberweisungen, z.B. IBAN
oder andere Fehleinträge, z.B Betrag, Termin erneut zu setzen.

Unterschiede anzeigen:

SL/SEPA.pm
11 11
use SL::DB;
12 12
use SL::Locale::String qw(t8);
13 13
use DateTime;
14
use Carp;
14 15

  
15 16
sub retrieve_open_invoices {
16 17
  $main::lxdebug->enter_sub();
......
291 292
  $main::lxdebug->leave_sub();
292 293
}
293 294

  
295
sub undo_export {
296
  $main::lxdebug->enter_sub();
297

  
298
  my $self     = shift;
299
  my %params   = @_;
300

  
301
  Common::check_params(\%params, qw(id));
302

  
303
  my $sepa_export = SL::DB::Manager::SepaExport->find_by(id => $params{id});
304

  
305
  croak "Not a valid SEPA Export id: $params{id}" unless $sepa_export;
306
  croak "Cannot undo closed exports."             if $sepa_export->closed;
307
  croak "Cannot undo executed exports."           if $sepa_export->executed;
308

  
309
  die "Could not undo $sepa_export->id" if !$sepa_export->delete();
310

  
311
  $main::lxdebug->leave_sub();
312
}
313

  
294 314
sub list_exports {
295 315
  $main::lxdebug->enter_sub();
296 316

  
......
525 545
}
526 546

  
527 547
1;
548

  
549

  
550
__END__
551

  
552
=head1 NAME
553

  
554
SL::SEPA - Base class for SEPA objects
555

  
556
=head1 SYNOPSIS
557

  
558
 # get all open invoices we like to pay via SEPA
559
 my $invoices = SL::SEPA->retrieve_open_invoices(vc => 'vendor');
560

  
561
 # add some IBAN and purposes for open transaction
562
 # and assign this to a SEPA export
563
 my $id = SL::SEPA->create_export('employee'       => $::myconfig{login},
564
                                 'bank_transfers' => \@bank_transfers,
565
                                 'vc'             => 'vendor');
566

  
567
=head1 DESCRIPTIONS
568

  
569
This is the base class for SEPA. SEPA and the underlying directories
570
(SEPA::XML etc) are used to genereate valid XML files for the SEPA
571
(Single European Payment Area) specification and offers this structure
572
as a download via a xml file.
573

  
574
An export can have one or more transaction which have to
575
comply to the specification (IBAN, BIC, amount, purpose, etc).
576

  
577
Furthermore kivitendo sepa exports have two
578
valid states: Open or closed and executed or not executed.
579

  
580
The state closed can be set via a user interface and the
581
state executed is automatically assigned if the action payment
582
is triggered.
583

  
584
=head1 FUNCTIONS
585

  
586
=head2 C<undo_export> $sepa_export_id
587

  
588
Needs a valid sepa_export id and deletes the sepa export if
589
the state of the export is neither executed nor closed.
590
Returns undef if the deletion was successfully.
591
Otherwise the function just dies with a short notice of the id.
592

  
593
=cut
594

  
595

  
596

  
597

  

Auch abrufbar als: Unified diff