Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 2f3b969e

Von Jan Büren vor fast 7 Jahren hinzugefügt

  • ID 2f3b969e3f315ad23225d9661c5dd8bc9ffd95ef
  • Vorgänger 944d0062
  • Nachfolger 413651d0

behebt #300 negative Einkaufsrechnungen per Kontenimport verbucht

Unterschiede anzeigen:

SL/Controller/BankTransaction.pm
101 101
      @where
102 102
    ],
103 103
  );
104

  
104
 $::lxdebug->log_time('asdf');
105 105
  # credit notes have a negative amount, treat differently
106 106
  my $all_open_ar_invoices = SL::DB::Manager::Invoice        ->get_all(where => [ or => [ amount => { gt => \'paid' },
107 107
                                                                                          and => [ type    => 'credit_note',
......
115 115
  my $all_open_sepa_export_items = SL::DB::Manager::SepaExportItem->get_all(where => [chart_id => $bank_account->chart_id ,
116 116
                                                                             'sepa_export.executed' => 0, 'sepa_export.closed' => 0 ], with_objects => ['sepa_export']);
117 117

  
118
  $::lxdebug->log_time('asdf 2');
118 119
  my @all_open_invoices;
119 120
  # filter out invoices with less than 1 cent outstanding
120 121
  push @all_open_invoices, map { $_->{is_ar}=1 ; $_ } grep { abs($_->amount - $_->paid) >= 0.01 } @{ $all_open_ar_invoices };
......
140 141
    }
141 142
  }
142 143

  
144
 $::lxdebug->log_time('asdf 4');
143 145
  # try to match each bank_transaction with each of the possible open invoices
144 146
  # by awarding points
145 147
  my @proposals;
......
200 202
        push(@{$bt->{rule_matches}}, $_->{rule_matches});
201 203
      };
202 204
    };
205
  $::lxdebug->log_time('asdf 5');
203 206
  }  # finished one bt
204 207
  # finished all bt
205 208

  
......
658 661
          # so $amount_of_transaction is negative but needs positive
659 662
          $amount_of_transaction *= -1;
660 663

  
661
        } elsif (!$invoice->is_sales && $invoice->invoice_type eq 'ap_transaction' ) {
664
        } elsif (!$invoice->is_sales && $invoice->invoice_type =~ m/ap_transaction|purchase_invoice/) {
662 665
          # $invoice->open_amount may be negative for ap_transaction but may be positiv for negativ ap_transaction
663 666
          # if $invoice->open_amount is negative $bank_transaction->amount is positve
664 667
          # if $invoice->open_amount is positive $bank_transaction->amount is negative

Auch abrufbar als: Unified diff