Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 866ed897

Von Jan Büren vor mehr als 3 Jahren hinzugefügt

  • ID 866ed897a3a06f239015f902fbc4eeb380fb4309
  • Vorgänger 4382b35e
  • Nachfolger b6f8a6b0

Kontoauszug verbuchen: Vorschlagsliste verbessern

- Kommentar stimmt nicht mit dem Code überein.
- Die Prüfung verhindert das Banktransaktionen mit einer Summe größer der
Rechnungssumme als Vorschlag zugewiesen werden. Das war wichtig,
weil der Payment-Helper zu Beginn immer die komplette Bankbewegung auf
einen Beleg gebucht hat. Das ist mittlerweile besser gelöst.

Unterschiede anzeigen:

SL/Controller/BankTransaction.pm
206 206
  # to qualify as a proposal there has to be
207 207
  # * agreement >= 5  TODO: make threshold configurable in configuration
208 208
  # * there must be only one exact match
209
  # * depending on whether sales or purchase the amount has to have the correct sign (so Gutschriften don't work?)
210 209
  my $proposal_threshold = 5;
211 210
  my @otherproposals = grep {
212 211
       ($_->{agreement} >= $proposal_threshold)
213 212
    && (1 == scalar @{ $_->{proposals} })
214
    && (@{ $_->{proposals} }[0]->is_sales ? abs(@{ $_->{proposals} }[0]->amount - $_->amount) < 0.01
215
                                          : abs(@{ $_->{proposals} }[0]->amount + $_->amount) < 0.01)
216 213
  } @{ $bank_transactions };
217 214

  
218 215
  push @proposals, @otherproposals;

Auch abrufbar als: Unified diff