Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision df183815

Von G. Richardson vor fast 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
362 362
    chart_id   => $params{chart}->id,
363 363
    chart_link => $params{chart}->link,
364 364
    transdate  => $self->transdate,
365
    gldate     => $self->gldate,
365 366
    taxkey     => $tax->taxkey,
366 367
    tax_id     => $tax->id,
367 368
    project_id => $params{project_id},
......
376 377
       chart_id   => $tax->chart_id,
377 378
       chart_link => $tax->chart->link,
378 379
       transdate  => $self->transdate,
380
       gldate     => $self->gldate,
379 381
       taxkey     => $tax->taxkey,
380 382
       tax_id     => $tax->id,
381 383
     );
SL/DB/PurchaseInvoice.pm
182 182
    chart_id   => $params{chart}->id,
183 183
    chart_link => $params{chart}->link,
184 184
    transdate  => $self->transdate,
185
    gldate     => $self->gldate,
185 186
    taxkey     => $tax->taxkey,
186 187
    tax_id     => $tax->id,
187 188
    project_id => $params{project_id},
......
196 197
       chart_id   => $tax->chart_id,
197 198
       chart_link => $tax->chart->link,
198 199
       transdate  => $self->transdate,
200
       gldate     => $self->gldate,
199 201
       taxkey     => $tax->taxkey,
200 202
       tax_id     => $tax->id,
201 203
       project_id => $params{project_id},
t/ar/ar.t
1 1
use strict;
2
use Test::More tests => 6;
2
use Test::More tests => 7;
3 3

  
4 4
use lib 't';
5 5
use Support::TestSetup;
......
56 56
  is($number_of_acc_trans                , 5                             , "number of transactions");
57 57
  is($inv->datepaid->to_kivitendo        , DateTime->today->to_kivitendo , "datepaid");
58 58
  is($inv->amount - $inv->paid           , 0                             , "paid = amount ");
59
  is($inv->gldate->to_kivitendo, $inv->transactions->[0]->gldate->to_kivitendo, "gldate matches in ar and acc_trans");
59 60
} else {
60 61
  ok 0, "couldn't find first invoice";
61 62
}
......
92 93

  
93 94
  my $amount       = $params{amount}       || croak "ar needs param amount";
94 95
  my $customer     = $params{customer}     || croak "ar needs param customer";
95
  my $date         = $params{date}         || DateTime->today;
96
  my $transdate    = $params{transdate}    || DateTime->today;
97
  my $gldate       = $params{gldate}       || DateTime->today->add(days => 1);
96 98
  my $with_payment = $params{with_payment} || 0;
97 99

  
98 100
  # SL::DB::Invoice has a _before_save_set_invnumber hook, so we don't need to pass invnumber
......
100 102
      invoice          => 0,
101 103
      amount           => $amount,
102 104
      netamount        => $amount,
103
      transdate        => $date,
105
      transdate        => $transdate,
106
      gldate           => $gldate,
104 107
      taxincluded      => 'f',
105 108
      customer_id      => $customer->id,
106 109
      taxzone_id       => $customer->taxzone_id,
......
144 147

  
145 148
  my $amount       = $params{amount}       || croak "ar needs param amount";
146 149
  my $customer     = $params{customer}     || croak "ar needs param customer";
147
  my $date         = $params{date}         || DateTime->today;
150
  my $transdate    = $params{transdate}    || DateTime->today;
151
  my $gldate       = $params{gldate}       || DateTime->today->add(days => 1);
148 152
  my $with_payment = $params{with_payment} || 0;
149 153

  
150 154
  my $invoice = SL::DB::Invoice->new(
151 155
    invoice          => 0,
152 156
    amount           => $amount,
153 157
    netamount        => $amount,
154
    transdate        => $date,
158
    transdate        => $transdate,
159
    gldate           => $gldate,
155 160
    taxincluded      => 'f',
156 161
    customer_id      => $customer->id,
157 162
    taxzone_id       => $customer->taxzone_id,

Auch abrufbar als: Unified diff