Revision 5a5ec009
Von Jan Büren vor mehr als 2 Jahren hinzugefügt
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
Testfall bank_transactions angepasst
- Payment-Helper keine uninit params
- skonto steuerkorrektur macht zwei weitere acc_trans verknüpfungen