bug 1071 Warum sollte bei Erreichen eines neuen Jahres die Kontenübersicht nur noch...
[kivitendo-erp.git] / SL / AP.pm
index ad8749f..aaf2d5e 100644 (file)
--- a/SL/AP.pm
+++ b/SL/AP.pm
@@ -38,6 +38,8 @@ use SL::DBUtils;
 use SL::IO;
 use SL::MoreCommon;
 
+use Data::Dumper;
+
 use strict;
 
 sub post_transaction {
@@ -68,7 +70,7 @@ sub post_transaction {
       (split(/--/, $form->{"AP_amount_$i"}))[0];
   }
   ($form->{AP_amounts}{payables}) = split(/--/, $form->{APselected});
-  ($form->{AP}{payables})         = split(/--/, $form->{APselected});
+  ($form->{AP_payables})          = split(/--/, $form->{APselected});
 
   # reverse and parse amounts
   for my $i (1 .. $form->{rowcount}) {
@@ -270,7 +272,7 @@ sub post_transaction {
 
       # get paid account
 
-      ($form->{AP}{"paid_$i"}) = split(/--/, $form->{"AP_paid_$i"});
+      ($form->{"AP_paid_account_$i"}) = split(/--/, $form->{"AP_paid_$i"});
       $form->{"datepaid_$i"} = $form->{transdate}
         unless ($form->{"datepaid_$i"});
 
@@ -287,9 +289,9 @@ sub post_transaction {
           qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, project_id, taxkey) | .
           qq|VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, ?, | .
           qq|        (SELECT taxkey_id FROM chart WHERE accno = ?))|;
-        @values = ($form->{id}, $form->{AP}{payables}, $amount,
+        @values = ($form->{id}, $form->{AP_payables}, $amount,
                    conv_date($form->{"datepaid_$i"}), $project_id,
-                   $form->{AP}{payables});
+                   $form->{AP_payables});
         do_query($form, $dbh, $query, @values);
       }
       $form->{payables} = $amount;
@@ -299,9 +301,9 @@ sub post_transaction {
         qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, source, memo, project_id, taxkey) | .
         qq|VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, ?, ?, ?, | .
         qq|        (SELECT taxkey_id FROM chart WHERE accno = ?))|;
-      @values = ($form->{id}, $form->{AP}{"paid_$i"}, $form->{"paid_$i"},
+      @values = ($form->{id}, $form->{"AP_paid_account_$i"}, $form->{"paid_$i"},
                  conv_date($form->{"datepaid_$i"}), $form->{"source_$i"},
-                 $form->{"memo_$i"}, $project_id, $form->{AP}{"paid_$i"});
+                 $form->{"memo_$i"}, $project_id, $form->{"AP_paid_account_$i"});
       do_query($form, $dbh, $query, @values);
 
       # add exchange rate difference
@@ -313,9 +315,9 @@ sub post_transaction {
           qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, fx_transaction, cleared, project_id, taxkey) | .
           qq|VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, 't', 'f', ?, | .
           qq|        (SELECT taxkey_id FROM chart WHERE accno = ?))|;
-        @values = ($form->{id}, $form->{AP}{"paid_$i"}, $amount,
+        @values = ($form->{id}, $form->{"AP_paid_account_$i"}, $amount,
                    conv_date($form->{"datepaid_$i"}), $project_id,
-                   $form->{AP}{"paid_$i"});
+                   $form->{"AP_paid_account_$i"});
         do_query($form, $dbh, $query, @values);
       }