use SL::Dev::Record qw(create_invoice_item create_sales_invoice create_credit_note create_ap_transaction);
use SL::Dev::CustomerVendor qw(new_customer new_vendor);
use SL::Dev::Part qw(new_part);
+use SL::DB::BankTransaction;
+use SL::DB::BankTransactionAccTrans;
use SL::DB::Buchungsgruppe;
use SL::DB::Currency;
use SL::DB::Exchangerate;
use SL::DBUtils qw(selectfirst_array_query);
use Data::Dumper;
-my ($customer, $vendor, $currency_id, @parts, $buchungsgruppe, $buchungsgruppe7, $unit, $employee, $tax, $tax7, $tax_9, $taxzone, $payment_terms, $bank_account);
+my ($customer, $vendor, $currency_id, @parts, $buchungsgruppe, $buchungsgruppe7, $unit, $employee, $tax, $tax7, $tax_9, $taxzone, $payment_terms,
+ $bank_account, $bt);
my ($transdate1, $transdate2, $transdate3, $transdate4, $currency, $exchangerate, $exchangerate2, $exchangerate3, $exchangerate4);
my ($ar_chart,$bank,$ar_amount_chart, $ap_chart, $ap_amount_chart, $fxloss_chart, $fxgain_chart);
SL::DB::Manager::Part->delete_all(all => 1);
SL::DB::Manager::Customer->delete_all(all => 1);
SL::DB::Manager::Vendor->delete_all(all => 1);
+ SL::DB::Manager::BankTransactionAccTrans->delete_all(all => 1);
+ SL::DB::Manager::BankTransaction->delete_all(all => 1);
SL::DB::Manager::BankAccount->delete_all(all => 1);
SL::DB::Manager::PaymentTerm->delete_all(all => 1);
SL::DB::Manager::Exchangerate->delete_all(all => 1);
$bank = SL::DB::Manager::Chart->find_by( accno => '1200' ); # Bank
$ar_amount_chart = SL::DB::Manager::Chart->find_by( accno => '8400' ); # Erlöse
$ap_amount_chart = SL::DB::Manager::Chart->find_by( accno => '3400' ); # Wareneingang 19%
+
+ $bt = SL::DB::BankTransaction->new(
+ local_bank_account_id => $bank_account->id,
+ transdate => $transdate1,
+ valutadate => $transdate1,
+ amount => 27332.32,
+ purpose => 'dummy',
+ currency => $currency,
+ );
+ $bt->save || die $@;
+
}
sub new_ap_transaction {
);
# default values
- my %params = ( chart_id => $bank_account->chart_id,
+ my %params = ( chart_id => $bank_account->chart_id,
transdate => $transdate1,
+ bt_id => $bt->id,
);
$params{payment_type} = 'with_skonto_pt';
);
# default values
- my %params = ( chart_id => $bank_account->chart_id,
+ my %params = ( chart_id => $bank_account->chart_id,
transdate => $transdate1,
+ bt_id => $bt->id,
);
$params{payment_type} = 'with_skonto_pt';
payment_type => 'difference_as_skonto',
chart_id => $bank_account->chart_id,
transdate => $transdate1,
+ bt_id => $bt->id,
);
my ($number_of_payments, $paid_amount) = number_of_payments($invoice);
payment_type => 'difference_as_skonto',
chart_id => $bank_account->chart_id,
transdate => $transdate1,
+ bt_id => $bt->id,
);
my ($number_of_payments, $paid_amount) = number_of_payments($invoice);
payment_type => 'difference_as_skonto',
chart_id => $bank_account->chart_id,
transdate => $transdate1,
+ bt_id => $bt->id,
);
my ($number_of_payments, $paid_amount) = number_of_payments($invoice);
# default values
my %params = ( chart_id => $bank_account->chart_id,
transdate => $transdate1,
+ bt_id => $bt->id,
);
$params{amount} = '2.32';
# default values
my %params = ( chart_id => $bank_account->chart_id,
transdate => $transdate1,
+ bt_id => $bt->id,
);
$params{amount} = '6.95';
my $ap_transaction = new_ap_transaction();
- my %params = ( chart_id => $bank_account->chart_id,
+ my %params = ( chart_id => $bank_account->chart_id,
transdate => $transdate1,
+ bt_id => $bt->id,
);
# $params{amount} = '226'; # pass full amount
payment_type => 'difference_as_skonto',
chart_id => $bank_account->chart_id,
transdate => $transdate1,
+ bt_id => $bt->id,
);
my ($number_of_payments, $paid_amount) = number_of_payments($ap_transaction);
# default values
my %params = ( chart_id => $bank_account->chart_id,
transdate => $transdate1,
+ bt_id => $bt->id,
);
$params{amount} = $invoice->amount_less_skonto;
# default values
my %params = ( chart_id => $bank_account->chart_id,
transdate => $transdate1,
+ bt_id => $bt->id,
);
$params{amount} = $invoice->amount_less_skonto;
# default values
my %params = ( chart_id => $bank_account->chart_id,
transdate => $transdate1,
+ bt_id => $bt->id,
);
$params{amount} = $invoice->amount_less_skonto;
$invoice->pay_invoice( payment_type => 'difference_as_skonto',
chart_id => $bank_account->chart_id,
transdate => $transdate1,
+ bt_id => $bt->id,
);
my ($number_of_payments, $paid_amount) = number_of_payments($invoice);