From: Sven Schöling Date: Thu, 3 Dec 2020 15:59:43 +0000 (+0100) Subject: Test: Skonto in Kreditorenbuchungen X-Git-Tag: kivitendo-mebil_0.1-0~9^2~571 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=0307fa8aa5e0b4e6d19ec60e2d55d0a7fe3efc51;p=kivitendo-erp.git Test: Skonto in Kreditorenbuchungen --- diff --git a/t/bank/bank_transactions.t b/t/bank/bank_transactions.t index e2bb55207..4930726b7 100644 --- a/t/bank/bank_transactions.t +++ b/t/bank/bank_transactions.t @@ -1227,4 +1227,36 @@ sub test_closedto { } +sub test_skonto_exact_ap_transaction { + + my $testname = 'test_skonto_exact_ap_transaction'; + + $ap_transaction = test_ap_transaction(invnumber => 'ap transaction skonto', + payment_id => $payment_terms->id, + ); + + my $bt = create_bank_transaction(record => $ap_transaction, + bank_chart_id => $bank->id, + transdate => $dt, + valutadate => $dt, + amount => $ap_transaction->amount_less_skonto + ) or die "Couldn't create bank_transaction"; + + $::form->{invoice_ids} = { + $bt->id => [ $ap_transaction->id ] + }; + $::form->{invoice_skontos} = { + $bt->id => [ 'with_skonto_pt' ] + }; + + save_btcontroller_to_string(); + + $ap_transaction->load; + $bt->load; + is($ap_transaction->paid , '119.00000' , "$testname: ap transaction skonto was paid"); + is($ap_transaction->closed , 1 , "$testname: ap transaction skonto is closed"); + is($bt->invoice_amount , '113.05000' , "$testname: bt invoice amount was assigned"); + +}; + 1;