Revision 866ed897
Von Jan Büren vor mehr als 4 Jahren hinzugefügt
SL/Controller/BankTransaction.pm | ||
---|---|---|
# to qualify as a proposal there has to be
|
||
# * agreement >= 5 TODO: make threshold configurable in configuration
|
||
# * there must be only one exact match
|
||
# * depending on whether sales or purchase the amount has to have the correct sign (so Gutschriften don't work?)
|
||
my $proposal_threshold = 5;
|
||
my @otherproposals = grep {
|
||
($_->{agreement} >= $proposal_threshold)
|
||
&& (1 == scalar @{ $_->{proposals} })
|
||
&& (@{ $_->{proposals} }[0]->is_sales ? abs(@{ $_->{proposals} }[0]->amount - $_->amount) < 0.01
|
||
: abs(@{ $_->{proposals} }[0]->amount + $_->amount) < 0.01)
|
||
} @{ $bank_transactions };
|
||
|
||
push @proposals, @otherproposals;
|
Auch abrufbar als: Unified diff
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.