Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision df183815

Von G. Richardson vor mehr als 5 Jahren hinzugefügt

  • ID df1838155963d6de56cfb001365982a292820f45
  • Vorgänger 578a40ba
  • Nachfolger b3346748

add_{ap|ar}_amount_row berücksichtigen gldate

Ansonsten konnte gldate in ar/ap und acc_trans abweichen, wenn gldate
explizit gesetzt war und nicht dem aktuellen Tag entsprach.

Unterschiede anzeigen:

SL/DB/Invoice.pm
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,
);
SL/DB/PurchaseInvoice.pm
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},
t/ar/ar.t
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,

Auch abrufbar als: Unified diff