[BACK]Return to pta_import.pl CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / pta

Diff for /pta/pta_import.pl between version 1.5 and 1.6

version 1.5, 2020/11/10 17:15:08 version 1.6, 2020/11/10 17:25:58
Line 19  use strict;
Line 19  use strict;
   
 # === SUBROUTINES  =====================================================  # === SUBROUTINES  =====================================================
   
 sub parse_import_file {  sub parse_import_file ($) {
         my $fn = $_[0];          my $fn = shift;
         my (@compiled, %bookings, %accounts, $import_type);          my (@compiled, %bookings, %accounts, $import_type);
         my $csv_account = "";          my $csv_account = "";
         if ($fn eq "import_chase_credit.txt") {          if ($fn eq "import_chase_credit.txt") {
Line 54  sub parse_import_file {
Line 54  sub parse_import_file {
         return (\%bookings, \%accounts, \@compiled, $csv_account, $import_type);          return (\%bookings, \%accounts, \@compiled, $csv_account, $import_type);
 }  }
   
 sub import_chase_credit_card {  sub import_chase_credit_card ($$$$) {
         my ($bookings_ref, $accounts_ref, $compiled_ref,          my ($bookings_ref, $accounts_ref, $compiled_ref,
             $csv_account) = @_;              $csv_account) = @_;
         my ($trans_date, $post_date, $description, $category,          my ($trans_date, $post_date, $description, $category,
Line 94  sub import_chase_credit_card {
Line 94  sub import_chase_credit_card {
         }          }
 }  }
   
 sub import_capital_one_credit_card {  sub import_capital_one_credit_card ($$$$) {
         my ($bookings_ref, $accounts_ref, $compiled_ref,          my ($bookings_ref, $accounts_ref, $compiled_ref,
             $csv_account) = @_;              $csv_account) = @_;
         my ($trans_date, $post_date, $card_num, $description,          my ($trans_date, $post_date, $card_num, $description,
Line 142  my $fn = "import_capital_one_credit.txt"; 
Line 142  my $fn = "import_capital_one_credit.txt"; 
 # This ends the user-editable section to select the formatting file.  # This ends the user-editable section to select the formatting file.
   
 my ($bookings_ref, $accounts_ref, $compiled_ref, $csv_account, $import_type) =  my ($bookings_ref, $accounts_ref, $compiled_ref, $csv_account, $import_type) =
     parse_import_file($fn);      parse_import_file $fn;
 if ($import_type eq "chase_credit") {  if ($import_type eq "chase_credit") {
         import_chase_credit_card($bookings_ref, $accounts_ref,          import_chase_credit_card $bookings_ref, $accounts_ref,
             $compiled_ref, $csv_account);              $compiled_ref, $csv_account;
 } elsif ($import_type eq "capital_one_credit") {  } elsif ($import_type eq "capital_one_credit") {
         import_capital_one_credit_card($bookings_ref, $accounts_ref,          import_capital_one_credit_card $bookings_ref, $accounts_ref,
         $compiled_ref, $csv_account);          $compiled_ref, $csv_account;
 } else {  } else {
         die "Undefined import type: $import_type";          die "Undefined import type: $import_type";
 }  }

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

CVSweb