]> wagnertech.de Git - mfinanz.git/blobdiff - SL/Controller/CsvImport/BankTransaction.pm
Payment-Helper pay_invoice um Rückgabewert der acc_trans_ids erweitert
[mfinanz.git] / SL / Controller / CsvImport / BankTransaction.pm
index 50a89d89bdfc3e3caf494ccf3de37f1810cad7f1..db22be0638aad5d2639f1362b672d77fc885cca8 100644 (file)
@@ -74,8 +74,9 @@ sub check_existing {
     # * transdate
     # * remote_account_number  (may be empty for records of our own bank)
     # * amount
     # * transdate
     # * remote_account_number  (may be empty for records of our own bank)
     # * amount
+    # * local_bank_account_id (case flatrate bank charges for two accounts in one bank: same purpose, transdate, remote_account_number(empty), amount. Just different local_bank_account_id)
     my $num;
     my $num;
-    if ( $num = SL::DB::Manager::BankTransaction->get_all_count(query =>[ remote_account_number => $object->remote_account_number, transdate => $object->transdate, purpose => $object->purpose, amount => $object->amount] ) ) {
+    if ( $num = SL::DB::Manager::BankTransaction->get_all_count(query =>[ remote_account_number => $object->remote_account_number, transdate => $object->transdate, purpose => $object->purpose, amount => $object->amount, local_bank_account_id => $object->local_bank_account_id] ) ) {
       push(@{$entry->{errors}}, $::locale->text('Skipping due to existing bank transaction in database'));
     };
   } else {
       push(@{$entry->{errors}}, $::locale->text('Skipping due to existing bank transaction in database'));
     };
   } else {
@@ -96,7 +97,21 @@ sub _displayable_columns {
    { name => 'currency',              description => $::locale->text('Currency') },
    { name => 'currency_id',           description => $::locale->text('Currency (database ID)')          },
    { name => 'remote_name',           description => $::locale->text('Name of the goal/source (if field names remote_name and remote_name_1 exist they will be combined into field "remote_name")') },
    { name => 'currency',              description => $::locale->text('Currency') },
    { name => 'currency_id',           description => $::locale->text('Currency (database ID)')          },
    { name => 'remote_name',           description => $::locale->text('Name of the goal/source (if field names remote_name and remote_name_1 exist they will be combined into field "remote_name")') },
-   { name => 'purpose',               description => $::locale->text('Purpose (if field names purpose, purpose1, purpose2 ... exist they will all combined into the field "purpose")') }
+   { name => 'remote_name_1',          description => $::locale->text('Name of the goal/source (if field names remote_name and remote_name_1 exist they will be combined into field "remote_name")') },
+   { name => 'purpose',               description => $::locale->text('Purpose (if field names purpose, purpose1, purpose2 ... exist they will all combined into the field "purpose")') },
+   { name => 'purpose1',              description => $::locale->text('Purpose (if field names purpose, purpose1, purpose2 ... exist they will all combined into the field "purpose")') },
+   { name => 'purpose2',              description => $::locale->text('Purpose (if field names purpose, purpose1, purpose2 ... exist they will all combined into the field "purpose")') },
+   { name => 'purpose3',              description => $::locale->text('Purpose (if field names purpose, purpose1, purpose2 ... exist they will all combined into the field "purpose")') },
+   { name => 'purpose4',              description => $::locale->text('Purpose (if field names purpose, purpose1, purpose2 ... exist they will all combined into the field "purpose")') },
+   { name => 'purpose5',              description => $::locale->text('Purpose (if field names purpose, purpose1, purpose2 ... exist they will all combined into the field "purpose")') },
+   { name => 'purpose6',              description => $::locale->text('Purpose (if field names purpose, purpose1, purpose2 ... exist they will all combined into the field "purpose")') },
+   { name => 'purpose7',              description => $::locale->text('Purpose (if field names purpose, purpose1, purpose2 ... exist they will all combined into the field "purpose")') },
+   { name => 'purpose8',              description => $::locale->text('Purpose (if field names purpose, purpose1, purpose2 ... exist they will all combined into the field "purpose")') },
+   { name => 'purpose9',              description => $::locale->text('Purpose (if field names purpose, purpose1, purpose2 ... exist they will all combined into the field "purpose")') },
+   { name => 'purpose10',             description => $::locale->text('Purpose (if field names purpose, purpose1, purpose2 ... exist they will all combined into the field "purpose")') },
+   { name => 'purpose11',             description => $::locale->text('Purpose (if field names purpose, purpose1, purpose2 ... exist they will all combined into the field "purpose")') },
+   { name => 'purpose12',             description => $::locale->text('Purpose (if field names purpose, purpose1, purpose2 ... exist they will all combined into the field "purpose")') },
+   { name => 'purpose13',             description => $::locale->text('Purpose (if field names purpose, purpose1, purpose2 ... exist they will all combined into the field "purpose")') }
  );
 }
 
  );
 }
 
@@ -160,7 +175,7 @@ sub join_purposes {
 
   my $object = $entry->{object};
 
 
   my $object = $entry->{object};
 
-  my $purpose = join('', $entry->{raw_data}->{purpose},
+  my $purpose = join(' ', $entry->{raw_data}->{purpose},
                          $entry->{raw_data}->{purpose1},
                          $entry->{raw_data}->{purpose2},
                          $entry->{raw_data}->{purpose3},
                          $entry->{raw_data}->{purpose1},
                          $entry->{raw_data}->{purpose2},
                          $entry->{raw_data}->{purpose3},
@@ -171,7 +186,9 @@ sub join_purposes {
                          $entry->{raw_data}->{purpose8},
                          $entry->{raw_data}->{purpose9},
                          $entry->{raw_data}->{purpose10},
                          $entry->{raw_data}->{purpose8},
                          $entry->{raw_data}->{purpose9},
                          $entry->{raw_data}->{purpose10},
-                         $entry->{raw_data}->{purpose11} );
+                         $entry->{raw_data}->{purpose11},
+                         $entry->{raw_data}->{purpose12},
+                         $entry->{raw_data}->{purpose13} );
   $object->purpose($purpose);
 
 }
   $object->purpose($purpose);
 
 }
@@ -181,7 +198,7 @@ sub join_remote_names {
 
   my $object = $entry->{object};
 
 
   my $object = $entry->{object};
 
-  my $remote_name = join('', $entry->{raw_data}->{remote_name},
+  my $remote_name = join(' ', $entry->{raw_data}->{remote_name},
                              $entry->{raw_data}->{remote_name_1} );
   $object->remote_name($remote_name);
 }
                              $entry->{raw_data}->{remote_name_1} );
   $object->remote_name($remote_name);
 }