chart_id => $params{chart}->id,
chart_link => $params{chart}->link,
transdate => $self->transdate,
+ gldate => $self->gldate,
taxkey => $tax->taxkey,
tax_id => $tax->id,
project_id => $params{project_id},
chart_id => $tax->chart_id,
chart_link => $tax->chart->link,
transdate => $self->transdate,
+ gldate => $self->gldate,
taxkey => $tax->taxkey,
tax_id => $tax->id,
);
chart_id => $params{chart}->id,
chart_link => $params{chart}->link,
transdate => $self->transdate,
+ gldate => $self->gldate,
taxkey => $tax->taxkey,
tax_id => $tax->id,
project_id => $params{project_id},
chart_id => $tax->chart_id,
chart_link => $tax->chart->link,
transdate => $self->transdate,
+ gldate => $self->gldate,
taxkey => $tax->taxkey,
tax_id => $tax->id,
project_id => $params{project_id},
use strict;
-use Test::More tests => 6;
+use Test::More tests => 7;
use lib 't';
use Support::TestSetup;
is($number_of_acc_trans , 5 , "number of transactions");
is($inv->datepaid->to_kivitendo , DateTime->today->to_kivitendo , "datepaid");
is($inv->amount - $inv->paid , 0 , "paid = amount ");
+ is($inv->gldate->to_kivitendo, $inv->transactions->[0]->gldate->to_kivitendo, "gldate matches in ar and acc_trans");
} else {
ok 0, "couldn't find first invoice";
}
my $amount = $params{amount} || croak "ar needs param amount";
my $customer = $params{customer} || croak "ar needs param customer";
- my $date = $params{date} || DateTime->today;
+ my $transdate = $params{transdate} || DateTime->today;
+ my $gldate = $params{gldate} || DateTime->today->add(days => 1);
my $with_payment = $params{with_payment} || 0;
# SL::DB::Invoice has a _before_save_set_invnumber hook, so we don't need to pass invnumber
invoice => 0,
amount => $amount,
netamount => $amount,
- transdate => $date,
+ transdate => $transdate,
+ gldate => $gldate,
taxincluded => 'f',
customer_id => $customer->id,
taxzone_id => $customer->taxzone_id,
my $amount = $params{amount} || croak "ar needs param amount";
my $customer = $params{customer} || croak "ar needs param customer";
- my $date = $params{date} || DateTime->today;
+ my $transdate = $params{transdate} || DateTime->today;
+ my $gldate = $params{gldate} || DateTime->today->add(days => 1);
my $with_payment = $params{with_payment} || 0;
my $invoice = SL::DB::Invoice->new(
invoice => 0,
amount => $amount,
netamount => $amount,
- transdate => $date,
+ transdate => $transdate,
+ gldate => $gldate,
taxincluded => 'f',
customer_id => $customer->id,
taxzone_id => $customer->taxzone_id,