Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 5a5ec009

Von Jan Büren vor fast 3 Jahren hinzugefügt

  • ID 5a5ec009b3d3bd4d24b65dba4f61c23f69a51770
  • Vorgänger da3cca7d
  • Nachfolger 11185756

Testfall bank_transactions angepasst

- Payment-Helper keine uninit params
- skonto steuerkorrektur macht zwei weitere acc_trans verknüpfungen

Unterschiede anzeigen:

SL/DB/Helper/Payment.pm
583 583
  croak "no banktransaction.id passed to skonto_charts"        unless $params{bt_id};
584 584
  croak "no banktransaction.transdate passed to skonto_charts" unless ref $params{transdate_obj} eq 'DateTime';
585 585

  
586
  $params{memo}   //= '';
587
  $params{source} //= '';
588

  
589

  
586 590
  my $is_sales = $self->is_sales;
587 591
  my (@skonto_charts, $inv_calc, $total_skonto_rounded);
588 592

  
t/bank/bank_transactions.t
1
use Test::More tests => 291;
1
use Test::More tests => 293;
2 2

  
3 3
use strict;
4 4

  
......
177 177

  
178 178
sub test_ar_transaction {
179 179
  my (%params) = @_;
180
  my $netamount = $params{amount} || 100;
180
  my $netamount = $::form->round_amount($params{amount}, 2) || 100;
181 181
  my $amount    = $::form->round_amount($netamount * 1.19,2);
182 182
  my $invoice   = SL::DB::Invoice->new(
183 183
      invoice      => 0,
......
335 335
  $::form->{invoice_skontos} = {
336 336
    $bt->id => [ 'with_skonto_pt' ]
337 337
  };
338

  
338
  is($ar_transaction->netamount, $::form->round_amount(168.58/1.19, 2), "$testname: Net Amount assigned");
339
  is($ar_transaction->amount, 168.58, "$testname: Amount assigned");
339 340
  is($ar_transaction->paid   , '0' , "$testname: salesinv is not paid");
340 341

  
341 342
  # generate an error for testing rollback mechanism
......
626 627
  is($bt->invoice_amount   , '299.29000' , "$testname: bt invoice amount was assigned partially paid amount");
627 628
  is($bt->amount           , '299.29000' , "$testname: bt amount is stil there");
628 629
  is(scalar @{ SL::DB::Manager::BankTransactionAccTrans->get_all(where => [bank_transaction_id => $bt->id ] )},
629
       7, "$testname 7 acc_trans entries created");
630
       9, "$testname 9 acc_trans entries created");
630 631

  
631 632
  # same loop as above, but only for the 3rd ar_id
632 633
  foreach my $acc_trans_id_entry (@{ SL::DB::Manager::BankTransactionAccTrans->get_all(where => [ar_id => $ar_transaction_skonto->id ] )}) {

Auch abrufbar als: Unified diff