clear_up();
- $transdate1 = DateTime->today;
- $transdate2 = DateTime->today->add(days => 1);
- $transdate3 = DateTime->today->add(days => 2);
- $transdate4 = DateTime->today->add(days => 3);
+ $transdate1 = DateTime->today_local;
+ $transdate1->set_year(2019) if $transdate1->year == 2020; # hardcode for 2019 in 2020, because of tax rate change in Germany
+ $transdate2 = $transdate1->clone->add(days => 1);
+ $transdate3 = $transdate1->clone->add(days => 2);
+ $transdate4 = $transdate1->clone->add(days => 3);
$buchungsgruppe = SL::DB::Manager::Buchungsgruppe->find_by(description => 'Standard 19%') || croak "No accounting group";
$buchungsgruppe7 = SL::DB::Manager::Buchungsgruppe->find_by(description => 'Standard 7%') || croak "No accounting group for 7\%";
my $title = 'default invoice, one item, 19% tax, without_skonto';
my $item = create_invoice_item(part => $parts[0], qty => 2.5);
my $invoice = create_sales_invoice(
+ transdate => $transdate1,
taxincluded => 0,
invoiceitems => [ $item ],
payment_id => $payment_terms->id,
# default values
my %params = ( chart_id => $bank_account->chart_id,
- transdate => DateTime->today_local->to_kivitendo
+ transdate => $transdate1,
);
$params{amount} = '6.96';
my $item = create_invoice_item(part => $parts[0], qty => 2.5);
my $invoice = create_sales_invoice(
taxincluded => 0,
+ transdate => $transdate1,
invoiceitems => [ $item ],
payment_id => $payment_terms->id,
);
# default values
my %params = ( chart_id => $bank_account->chart_id,
- transdate => DateTime->today_local->to_kivitendo
+ transdate => $transdate1,
);
$params{amount} = '16.96';
my $item2 = create_invoice_item(part => $parts[1], qty => 1.2);
my $invoice = create_sales_invoice(
taxincluded => 0,
+ transdate => $transdate1,
invoiceitems => [ $item1, $item2 ],
payment_id => $payment_terms->id,
);
# default values
my %params = ( chart_id => $bank_account->chart_id,
- transdate => DateTime->today_local->to_kivitendo
+ transdate => $transdate1,
);
$params{payment_type} = 'with_skonto_pt';
my $item1 = create_invoice_item(part => $parts[0], qty => 2.5);
my $item2 = create_invoice_item(part => $parts[1], qty => 1.2);
my $invoice = create_sales_invoice(
+ transdate => $transdate1,
taxincluded => 1,
invoiceitems => [ $item1, $item2 ],
payment_id => $payment_terms->id,
# default values
my %params = ( chart_id => $bank_account->chart_id,
- transdate => DateTime->today_local->to_kivitendo
+ transdate => $transdate1,
);
$params{payment_type} = 'with_skonto_pt';
my $item1 = create_invoice_item(part => $parts[0], qty => 2.5);
my $item2 = create_invoice_item(part => $parts[1], qty => 1.2);
my $invoice = create_sales_invoice(
+ transdate => $transdate1,
taxincluded => 0,
invoiceitems => [ $item1, $item2 ],
payment_id => $payment_terms->id,
# default values
my %params = ( chart_id => $bank_account->chart_id,
- transdate => DateTime->today_local->to_kivitendo
+ transdate => $transdate1,
);
$params{amount} = '19.44'; # pass full amount
my $item2 = create_invoice_item(part => $parts[1], qty => 1.2);
my $invoice = create_sales_invoice(
taxincluded => 0,
+ transdate => $transdate1,
invoiceitems => [ $item1, $item2 ],
payment_id => $payment_terms->id,
);
$invoice->pay_invoice( amount => '9.44',
payment_type => 'without_skonto',
chart_id => $bank_account->chart_id,
- transdate => DateTime->today_local->to_kivitendo,
+ transdate => $transdate1,
);
my ($number_of_payments, $paid_amount) = number_of_payments($invoice);
my $item1 = create_invoice_item(part => $parts[0], qty => 2.5);
my $item2 = create_invoice_item(part => $parts[1], qty => 1.2);
my $invoice = create_sales_invoice(
+ transdate => $transdate1,
taxincluded => 0,
invoiceitems => [ $item1, $item2 ],
payment_id => $payment_terms->id,
$invoice->pay_invoice( amount => '9.44',
payment_type => 'without_skonto',
chart_id => $bank_account->chart_id,
- transdate => DateTime->today_local->to_kivitendo
+ transdate => $transdate1,
);
$invoice->pay_invoice( amount => '10.00',
chart_id => $bank_account->chart_id,
- transdate => DateTime->today_local->to_kivitendo
+ transdate => $transdate1,
);
my ($number_of_payments, $paid_amount) = number_of_payments($invoice);
my $item2 = create_invoice_item(part => $parts[1], qty => 1.2);
my $invoice = create_sales_invoice(
taxincluded => 0,
+ transdate => $transdate1,
invoiceitems => [ $item1, $item2 ],
payment_id => $payment_terms->id,
);
$invoice->pay_invoice( amount => '9.44',
payment_type => 'without_skonto',
chart_id => $bank_account->chart_id,
- transdate => DateTime->today_local->to_kivitendo
+ transdate => $transdate1,
);
$invoice->pay_invoice( amount => '8.73',
payment_type => 'without_skonto',
chart_id => $bank_account->chart_id,
- transdate => DateTime->today_local->to_kivitendo
+ transdate => $transdate1,
);
$invoice->pay_invoice( amount => $invoice->open_amount,
payment_type => 'difference_as_skonto',
chart_id => $bank_account->chart_id,
- transdate => DateTime->today_local->to_kivitendo
+ transdate => $transdate1,
);
my ($number_of_payments, $paid_amount) = number_of_payments($invoice);
my $item2 = create_invoice_item(part => $parts[1], qty => 1.2);
my $invoice = create_sales_invoice(
taxincluded => 0,
+ transdate => $transdate1,
invoiceitems => [ $item1, $item2 ],
payment_id => $payment_terms->id,
);
$invoice->pay_invoice( amount => '19.42',
payment_type => 'without_skonto',
chart_id => $bank_account->chart_id,
- transdate => DateTime->today_local->to_kivitendo
+ transdate => $transdate1,
);
$invoice->pay_invoice( amount => $invoice->open_amount,
payment_type => 'difference_as_skonto',
chart_id => $bank_account->chart_id,
- transdate => DateTime->today_local->to_kivitendo
+ transdate => $transdate1,
);
my ($number_of_payments, $paid_amount) = number_of_payments($invoice);
my $item2 = create_invoice_item(part => $parts[1], qty => 1.2);
my $invoice = create_sales_invoice(
taxincluded => 0,
+ transdate => $transdate1,
invoiceitems => [ $item1, $item2 ],
payment_id => $payment_terms->id,
);
$invoice->pay_invoice( amount => '19.42',
payment_type => 'without_skonto',
chart_id => $bank_account->chart_id,
- transdate => DateTime->today_local->to_kivitendo
+ transdate => $transdate1,
);
$invoice->pay_invoice( amount => $invoice->open_amount,
payment_type => 'difference_as_skonto',
chart_id => $bank_account->chart_id,
- transdate => DateTime->today_local->to_kivitendo
+ transdate => $transdate1,
);
my ($number_of_payments, $paid_amount) = number_of_payments($invoice);
my $item = create_invoice_item(part => $parts[0], qty => 2.5);
my $invoice = create_sales_invoice(
taxincluded => 0,
+ transdate => $transdate1,
invoiceitems => [ $item ],
payment_id => $payment_terms->id,
);
# default values
my %params = ( chart_id => $bank_account->chart_id,
- transdate => DateTime->today_local->to_kivitendo
+ transdate => $transdate1,
);
$params{amount} = '2.32';
my $item = create_invoice_item(part => $parts[0], qty => 2.5);
my $invoice = create_sales_invoice(
taxincluded => 0,
+ transdate => $transdate1,
invoiceitems => [ $item ],
payment_id => $payment_terms->id,
);
# default values
my %params = ( chart_id => $bank_account->chart_id,
- transdate => DateTime->today_local->to_kivitendo
+ transdate => $transdate1,
);
$params{amount} = '6.95';
my $ap_transaction = new_ap_transaction();
my %params = ( chart_id => $bank_account->chart_id,
- transdate => DateTime->today_local->to_kivitendo
+ transdate => $transdate1,
);
$params{amount} = '226'; # pass full amount
my $ap_transaction = new_ap_transaction();
my %params = ( chart_id => $bank_account->chart_id,
- transdate => DateTime->today_local->to_kivitendo
+ transdate => $transdate1,
);
# $params{amount} = '226'; # pass full amount
amount => ( $ap_transaction->amount / 3 * 2),
payment_type => 'without_skonto',
chart_id => $bank_account->chart_id,
- transdate => DateTime->today_local->to_kivitendo
+ transdate => $transdate1,
);
my ($number_of_payments, $paid_amount) = number_of_payments($ap_transaction);
my $total = total_amount($ap_transaction);
amount => ( $ap_transaction->amount / 3 * 2),
payment_type => 'without_skonto',
chart_id => $bank_account->chart_id,
- transdate => DateTime->today_local->to_kivitendo
+ transdate => $transdate1,
);
$ap_transaction->pay_invoice(
amount => ( $ap_transaction->amount / 5 ),
payment_type => 'without_skonto',
chart_id => $bank_account->chart_id,
- transdate => DateTime->today_local->to_kivitendo
+ transdate => $transdate1,
);
$ap_transaction->pay_invoice(
payment_type => 'difference_as_skonto',
chart_id => $bank_account->chart_id,
- transdate => DateTime->today_local->to_kivitendo
+ transdate => $transdate1,
);
my ($number_of_payments, $paid_amount) = number_of_payments($ap_transaction);
my $item2 = create_invoice_item(part => $parts[3], qty => 1);
my $invoice = create_sales_invoice(
taxincluded => 0,
+ transdate => $transdate1,
invoiceitems => [ $item1, $item2 ],
payment_id => $payment_terms->id,
);
# default values
my %params = ( chart_id => $bank_account->chart_id,
- transdate => DateTime->today_local->to_kivitendo
+ transdate => $transdate1,
);
$params{amount} = $invoice->amount_less_skonto;
my $item4 = create_invoice_item(part => $parts[3], qty => 0.5);
my $invoice = create_sales_invoice(
taxincluded => 0,
+ transdate => $transdate1,
invoiceitems => [ $item1, $item2, $item3, $item4 ],
payment_id => $payment_terms->id,
);
# default values
my %params = ( chart_id => $bank_account->chart_id,
- transdate => DateTime->today_local->to_kivitendo
+ transdate => $transdate1,
);
$params{amount} = $invoice->amount_less_skonto;
my $item4 = create_invoice_item(part => $parts[3], qty => 0.5);
my $invoice = create_sales_invoice(
taxincluded => 1,
+ transdate => $transdate1,
invoiceitems => [ $item1, $item2, $item3, $item4 ],
payment_id => $payment_terms->id,
);
# default values
my %params = ( chart_id => $bank_account->chart_id,
- transdate => DateTime->today_local->to_kivitendo
+ transdate => $transdate1,
);
$params{amount} = $invoice->amount_less_skonto;
my $item4 = create_invoice_item(part => $parts[3], qty => 0.5);
my $invoice = create_sales_invoice(
taxincluded => 0,
+ transdate => $transdate1,
invoiceitems => [ $item1, $item2, $item3, $item4 ],
payment_id => $payment_terms->id,
);
$invoice->pay_invoice( amount => '90',
payment_type => 'without_skonto',
chart_id => $bank_account->chart_id,
- transdate => DateTime->today_local->to_kivitendo
+ transdate => $transdate1,
);
$invoice->pay_invoice( payment_type => 'difference_as_skonto',
chart_id => $bank_account->chart_id,
- transdate => DateTime->today_local->to_kivitendo
+ transdate => $transdate1,
);
my ($number_of_payments, $paid_amount) = number_of_payments($invoice);
my $item2 = create_invoice_item(part => $parts[1], qty => 3);
my $invoice = create_credit_note(
invnumber => 'cn1',
+ transdate => $transdate1,
taxincluded => 0,
invoiceitems => [ $item1, $item2 ],
);
# default values
my %params = ( chart_id => $bank_account->chart_id,
- transdate => DateTime->today_local->to_kivitendo,
+ transdate => $transdate1,
);
$params{amount} = $invoice->amount,