X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=Test%2Fperl%2Ftest_action.pl;h=069cc1491943b143f04d248f21713bcfc73c19b6;hb=5349a1ed016ae603b39d73747eccc6792707db1c;hp=4e78f919fa0b315e6b06457a0ac04d942c20ae55;hpb=2577cacd03a8c97ee2217a2ff3ef90958c94542e;p=kivitendo-erp.git diff --git a/Test/perl/test_action.pl b/Test/perl/test_action.pl index 4e78f919f..069cc1491 100755 --- a/Test/perl/test_action.pl +++ b/Test/perl/test_action.pl @@ -1,15 +1,39 @@ #!/usr/bin/perl use strict; -use SL::Controller::Mebil; -use SL::DB; +use lib "/opt/kivitendo-erp"; use SL::LXDebug; +use SL::mebil::Mapping; +use Test::perl::ErrorChannel; $::lxdebug = new LXDebug; -my $db = new SL::DB; +SL::DB->register_db( + domain => 'KIVITENDO', + type => 'KIVITENDO', + driver => 'Pg', + database => 'firma', + host => 'localhost', + username => 'kivitendo', + password => 'kivitendo', +); -my $dbi = $db->dbi_connect("dbname=firma;host=localhost;port=5432", "kivitendo", "kivitendo"); +my $db = SL::DB->new(domain => 'KIVITENDO', + type => 'KIVITENDO',); +my $dbh = $db->dbh; -my $m = new SL::Controller::Mebil; -$m->action_calcmap; +my $errch = new ErrorChannel; +my $mapper = new SL::mebil::Mapping($errch, $dbh); + +my $command = $ARGV[0]; +if ($command eq "GetMapping") { + my $mapping = $mapper->get_mapping(); + foreach (@$mapping) { + print $_->{fromacc}."\n"; + } + die ("Kein Mapping vorhanden.") unless (scalar(@$mapping) > 0); +} elsif ($command eq "CalcMapping") { + die ("NIY."); +} else { + die "Invalid command: $command"; +}