Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 54ae2899

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

  • ID 54ae2899252302bf9e5dff99f2327cc081a66cce
  • Vorgänger f0d5e4bb
  • Nachfolger 69bfa40a

SEPA Agreement Regel wieder aktivieren

Sehr präziser und gut kommentieren Geoffrey-Code sollte
man prinzipiell fördern - Oder wenn man den wegwirft,
auch einen ädequaten Ersatz schaffen und testen.
Aber man kann auch das Bein amputieren wenn der Patient
Schmerzen im dicken Zeh hat.
Ich schraub das Bein erstmal wieder dran.

Unterschiede anzeigen:

SL/DB/BankTransaction.pm
210 210
  };
211 211

  
212 212
#  # if there is exactly one non-executed sepa_export_item for the invoice
213
#  if ( my $seis = $invoice->find_sepa_export_items({ executed => 0 }) ) {
214
#    if ( scalar @$seis == 1 ) {
215
#      my $sei = $seis->[0];
216
#
217
#      # test for amount and id matching only, sepa transfer date and bank
218
#      # transaction date needn't match
219
#      my $arap = $invoice->is_sales ? 'ar' : 'ap';
220
#      if (    abs($self->amount) == ($sei->amount)
221
#          && $invoice->id        == $sei->arap_id
222
#         ) {
223
#        $agreement += $points{sepa_export_item};
224
#          $rule_matches .= 'sepa_export_item(' . $points{'sepa_export_item'} . ') ';
225
#      };
226
#    } else {
227
#      # zero or more than one sepa_export_item, do nothing for this invoice
228
#      # zero: do nothing, no sepa_export_item exists, no match
229
#      # more than one: does this ever apply? Currently you can't create sepa
230
#      # exports for invoices that already have a non-executed sepa_export
231
#    };
232
#  };
213
  if ( my $seis = $invoice->find_sepa_export_items({ executed => 0 }) ) {
214
    if ( scalar @$seis == 1 ) {
215
      my $sei = $seis->[0];
216

  
217
      # test for amount and id matching only, sepa transfer date and bank
218
      # transaction date needn't match
219
      my $arap = $invoice->is_sales ? 'ar' : 'ap';
220
      if (    abs($self->amount) == ($sei->amount)
221
          && $invoice->id        == $sei->arap_id
222
         ) {
223
        $agreement += $points{sepa_export_item};
224
          $rule_matches .= 'sepa_export_item(' . $points{'sepa_export_item'} . ') ';
225
      };
226
    } else {
227
      # zero or more than one sepa_export_item, do nothing for this invoice
228
      # zero: do nothing, no sepa_export_item exists, no match
229
      # more than one: does this ever apply? Currently you can't create sepa
230
      # exports for invoices that already have a non-executed sepa_export
231
    };
232
  };
233 233

  
234 234
  return ($agreement,$rule_matches);
235 235
};

Auch abrufbar als: Unified diff