epic-s6g
[kivitendo-erp.git] / Test / perl / test_action.pl
index 069cc14..abf7379 100755 (executable)
@@ -2,9 +2,10 @@
 use strict;
 
 use lib "/opt/kivitendo-erp";
+use lib "perl";
 use SL::LXDebug;
 use SL::mebil::Mapping;
-use Test::perl::ErrorChannel;
+use ErrorChannel;
 
 $::lxdebug = new LXDebug;
 
@@ -26,14 +27,14 @@ my $errch = new ErrorChannel;
 my $mapper = new SL::mebil::Mapping($errch, $dbh);
 
 my $command = $ARGV[0];
-if ($command eq "GetMapping") {
+if ($command eq "ShowMapping") {
        my $mapping = $mapper->get_mapping();
        foreach (@$mapping) {
                print $_->{fromacc}."\n";
        }
        die ("Kein Mapping vorhanden.") unless (scalar(@$mapping) > 0);
 } elsif ($command eq "CalcMapping") {
-       die ("NIY.");
+       (my $fromacc, my $toacc) = $mapper->calc_mapping(2022);
 } else {
        die "Invalid command: $command";
 }