Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 503fabbf

Von Martin Helmling martin.helmling@octosoft.eu vor fast 7 Jahren hinzugefügt

  • ID 503fabbf4b2c77b2aab2dc1940f1eec0842cd490
  • Vorgänger e79aba17
  • Nachfolger ae47d060

BankTransaction: Überarbeitung von "Kontoauszug verbuchen" , SEPA-Export wieder integriert

Die Punktebewertung findet wieder ausschließlich in "get_agreement_with_bank_transactions" statt,
auch die SEPA-Sammelüberweisung. Diese bekommt dor extra Punkte, da ggf. für bestimmte Rechnungen negative Punkte entstehen.
Auch gibt es dort keine Remote Banknummer etc.

Die Testdatei t/bank/bank_transactions.t wurde um zwei Tests erweitert,
1. ein Test der das Verbuchen ohne SEPA-Export macht,
2. ein Test mit SEPA-Export

fixt #277

Unterschiede anzeigen:

SL/DB/BankTransaction.pm
47 47
  return [ @linked_invoices ];
48 48
}
49 49

  
50
sub is_collective_transaction {
51
  $_[0]->transaction_code eq "191";
52
}
53

  
54

  
50 55
sub get_agreement_with_invoice {
51 56
  my ($self, $invoice) = @_;
52 57

  
......
73 78
    skonto_exact_amount         => 5,
74 79
    wrong_sign                  => -1,
75 80
    sepa_export_item            => 5,
81
    collective_sepa_transaction => 20,
76 82
  );
77 83

  
78 84
  my ($agreement,$rule_matches);
79 85

  
86
  if ( $self->is_collective_transaction && $self->{sepa_export_ok}) {
87
    $agreement += $points{collective_sepa_transaction};
88
    $rule_matches .= 'collective_sepa_transaction(' . $points{'collective_sepa_transaction'} . ') ';
89
  }
90

  
80 91
  # compare banking arrangements
81 92
  my ($iban, $bank_code, $account_number);
82 93
  $bank_code      = $invoice->customer->bank_code      if $invoice->is_sales;
......
210 221
  };
211 222

  
212 223
  # 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) {
224
  if ( my $seis = $invoice->{sepa_export_item} ) {
225
      if (scalar @$seis == 1) {
215 226
      my $sei = $seis->[0];
216 227

  
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

  
221
      if (abs($self->amount) == ($sei->amount) && $invoice->id == $sei->arap_id) {
228
      if ( abs(abs($self->amount) - abs($sei->amount)) < 0.01 ) {
222 229
        $agreement    += $points{sepa_export_item};
223 230
        $rule_matches .= 'sepa_export_item(' . $points{'sepa_export_item'} . ') ';
224 231
      }

Auch abrufbar als: Unified diff