The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Finance::Bank::DE::DTA::Create - Creating DTA/DTAUS files for use in Banking Software or for sending to the bank. Works for inner German money transactions only (receiver and sender must have german bank accounts)

IMPORTANT NOTE

ALWAYS doublecheck the items, after importing the DTA file into your banking software prior to sending the order to your bank! You can also check your DTA-file here: https://www.xpecto.de/index.php?id=148,7

SYNOPSIS

        use Finance::Bank::DE::DTA::Create;
        my $dta = new Finance::Bank::DE::DTA::Create({
                type           => 'credit', #or debit, for 'Lastschrifteinzug'
                name           => $sendername,
                bank_code      => $senderbankcode,
                account_number => $senderaccount,
        });

        # add an item to the list
        $dta->addExchange(
                {
                        name           => "John Doe",
                        bank_code      => "12345678",
                        account_number => "1234567890",
                },
                100.45,
                [ "$purpose1", "$purpose2" ]
        );
        
        # add another item to the list
        $dta->addExchange(
                {
                        name           => "Jane Doe",
                        bank_code      => "87654321",
                        account_number => "0987654321",
                },
                99.75,
                $purpose3
        );      
        
        # save the dta file
        open(DAT, ">dta.txt") || die "$!";
        print DAT $dta->getContent();
        close DAT;
        

SUBROUTINES / METHODS

new()

The constructor. The parameters type, name, bank_code and account_number are all mandatory. If not set properly the module will return 0.

  • type - this parameter indicates whether you want to create a dta file with credits (you send money) or with debits (you collect money). Possible values: credit or debit.

  • name - in the new()-Method this represents the name of the account owner where the dta-file will be used (i.e. this is you).

  • bank_code - in the new()-Method this represents the routing number (BLZ) of the account where the dta-fill will be used.

  • account_number - in the new()-Method this represents the number of the account where the dta-fill will be used.

        my $dta = new Finance::Bank::DE::DTA::Create({
                type           => 'credit', #or debit, for 'Lastschrifteinzug' (collecting money)
                name           => $sendername,
                bank_code      => $senderbankcode,
                account_number => $senderaccount,
        });
        

addExchange()

With addExchange() you add an item to the list of transactions.

The first parameter to this method is a hash with the information of the account you are sending money to (or collect money from). This hash has the mandatory keys name, bank_code (BLZ) and account_number.

The second parameter is the amount you are sending or collecting.

The third parameter is for the purpose of the transaction. It may either be a string for just one purpose (one line), or an array with two purpose strings (two lines).

        $dta->addExchange(
                {
                        name           => "John Doe",
                        bank_code      => "12345678",
                        account_number => "1234567890",
                },
                100.45,
                [ "$purpose1", "$purpose2" ] #or just $purpose
        );

amount()

With amount() you can retrieve the total amount of all transactions, you already added.

items()

With items() you can retrieve the total number of transactions, you already added.

        $dta->addExchange(
                {
                        name           => "Jane Doe",
                        bank_code      => "87654321",
                        account_number => "0987654321",
                },
                100,
                $purpose
        );
        
        $dta->addExchange(
                {
                        name           => "John Doe",
                        bank_code      => "12345678",
                        account_number => "1234567890",
                },
                50,
                $purpose
        );

        print $dta->amount(); #would print 150
        
        print $dta->items(); #would print 2
        

getContent()

With getContent() you get the content of the dta-file.

        open(DAT, ">dta.txt") || die "$!";
        print DAT $dta->getContent();
        close DAT;
        

BUGS

I am aware of no bugs - if you find one, please let me know, preferably you already have a solution ;)

CREDITS

This module was mainly created by Robert Urban (http://www.webcrew.de), when we were working together and needed a solution to handle a lot of credits, without typing until the fingers bleed. I merely did some minor changes and all the CPAN-work.

AUTHOR

Ben Schnopp, <bsnoop at cpan.org>

LICENSE AND COPYRIGHT

Copyright 2010 Ben Schnopp.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 628:

You forgot a '=back' before '=head2'

Around line 726:

=back without =over