Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 13b4fc7a

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

  • ID 13b4fc7a4f14f36a98b15c9cfc1c075e28dfc67c
  • Vorgänger a3263b66
  • Nachfolger 97bf5ec4

Änderungen Testfall tax. bt_id ist jetzt zwingend erforderlich

pay_invoice mit Skonto erwartet die bank_transaction.id

Unterschiede anzeigen:

t/tax/tax.t
9 9
use Support::TestSetup;
10 10
use Test::Exception;
11 11

  
12
use SL::DB::BankTransaction;
13
use SL::DB::BankTransactionAccTrans;
12 14
use SL::DB::Customer;
13 15
use SL::DB::Vendor;
14 16
use SL::DB::Invoice;
......
32 34
#  neue Konten für 5% anlegen
33 35
#  Leistungszeitraum vs. Datum Zuord. Steuerperiodest
34 36

  
37

  
38

  
39

  
35 40
note('checking if all tax entries exist for Konjunkturprogramm');
36 41

  
37 42
# create dates to test on
......
40 45
my $date_2020_2 = DateTime->new(year => 2020, month => 7, day => 15);
41 46
my $date_2021   = DateTime->new(year => 2021, month => 1, day => 15);
42 47

  
48
# dummy bt_id
49
my $bank_account     =  SL::DB::BankAccount->new(
50
    account_number  => '123',
51
    bank_code       => '123',
52
    iban            => '123',
53
    bic             => '123',
54
    bank            => '123',
55
    chart_id        => SL::DB::Manager::Chart->find_by( description => 'Bank' )->id,
56
    name            => SL::DB::Manager::Chart->find_by( description => 'Bank' )->description,
57
  )->save;
58

  
59

  
60
my $currency_id     = $::instance_conf->get_currency_id;
61
my  $bt = SL::DB::BankTransaction->new(
62
    local_bank_account_id => $bank_account->id,
63
    transdate             => $date_2021,
64
    valutadate            => $date_2021,
65
    amount                => 27332.32,
66
    purpose               => 'dummy',
67
    currency              => $currency_id,
68
  );
69
  $bt->save || die $@;
70

  
71

  
43 72
# The only way to discern the pre-2007 16% tax from the 2020 16% tax is by
44 73
# their configured automatic tax charts, so look them up here:
45 74

  
......
403 432

  
404 433
my %params = ( chart_id     => $chart_bank->id,
405 434
               payment_type => 'with_skonto_pt',
435
               bt_id        => $bt->id,
406 436
             );
407 437

  
408 438
$sales_invoice_2020_2->pay_invoice( %params,
......
585 615
}
586 616

  
587 617
sub clear_up {
618
  SL::DB::Manager::BankTransactionAccTrans->delete_all(all => 1);
619
  SL::DB::Manager::BankTransaction->delete_all(all => 1);
620
  SL::DB::Manager::BankAccount->delete_all(all => 1);
588 621
  SL::DB::Manager::OrderItem->delete_all(all => 1);
589 622
  SL::DB::Manager::Order->delete_all(all => 1);
590 623
  SL::DB::Manager::InvoiceItem->delete_all(all => 1);

Auch abrufbar als: Unified diff