Revision 69bfa40a
Von Jan Büren vor mehr als 7 Jahren hinzugefügt
SL/DB/BankTransaction.pm | ||
---|---|---|
211 | 211 |
|
212 | 212 |
# # if there is exactly one non-executed sepa_export_item for the invoice |
213 | 213 |
if ( my $seis = $invoice->find_sepa_export_items({ executed => 0 }) ) { |
214 |
if ( scalar @$seis == 1 ) {
|
|
214 |
if (scalar @$seis == 1) {
|
|
215 | 215 |
my $sei = $seis->[0]; |
216 | 216 |
|
217 | 217 |
# test for amount and id matching only, sepa transfer date and bank |
218 | 218 |
# transaction date needn't match |
219 | 219 |
my $arap = $invoice->is_sales ? 'ar' : 'ap'; |
220 |
if ( abs($self->amount) == ($sei->amount) |
|
221 |
&& $invoice->id == $sei->arap_id |
|
222 |
) { |
|
220 |
|
|
221 |
if (abs($self->amount) == ($sei->amount) && $invoice->id == $sei->arap_id) { |
|
223 | 222 |
$agreement += $points{sepa_export_item}; |
224 |
$rule_matches .= 'sepa_export_item(' . $points{'sepa_export_item'} . ') ';
|
|
225 |
};
|
|
223 |
$rule_matches .= 'sepa_export_item(' . $points{'sepa_export_item'} . ') '; |
|
224 |
} |
|
226 | 225 |
} else { |
227 | 226 |
# zero or more than one sepa_export_item, do nothing for this invoice |
228 | 227 |
# zero: do nothing, no sepa_export_item exists, no match |
229 | 228 |
# more than one: does this ever apply? Currently you can't create sepa |
230 | 229 |
# exports for invoices that already have a non-executed sepa_export |
231 |
};
|
|
232 |
};
|
|
230 |
} |
|
231 |
} |
|
233 | 232 |
|
234 | 233 |
return ($agreement,$rule_matches); |
235 | 234 |
}; |
Auch abrufbar als: Unified diff
DB/BankTransaction: Kosmetik Fall SEPA-Check