Revision 023755f2
Von G. Richardson vor fast 5 Jahren hinzugefügt
SL/Dev/Record.pm | ||
---|---|---|
359 | 359 |
|
360 | 360 |
my $dec = delete $params{dec} // 2; |
361 | 361 |
|
362 |
my $transdate = delete $params{transdate} // DateTime->today; |
|
362 |
my $today = DateTime->today_local; |
|
363 |
my $transdate = delete $params{transdate} // $today; |
|
363 | 364 |
die "transdate hat to be DateTime object" unless ref($transdate) eq 'DateTime'; |
364 | 365 |
|
366 |
my $gldate = delete $params{gldate} // $today; |
|
367 |
die "gldate hat to be DateTime object" unless ref($gldate) eq 'DateTime'; |
|
368 |
|
|
365 | 369 |
my $ap_chart = delete $params{ap_chart} // SL::DB::Manager::Chart->find_by( accno => '1600' ); |
366 | 370 |
die "no ap_chart found or not an AP chart" unless $ap_chart and $ap_chart->link eq 'AP'; |
367 | 371 |
|
... | ... | |
373 | 377 |
invnumber => delete $params{invnumber} // 'test ap_transaction', |
374 | 378 |
notes => delete $params{notes} // 'test ap_transaction', |
375 | 379 |
transdate => $transdate, |
380 |
gldate => $gldate, |
|
376 | 381 |
taxincluded => $taxincluded, |
377 | 382 |
taxzone_id => $vendor->taxzone_id, # taxzone_id shouldn't have any effect on ap transactions |
378 | 383 |
currency_id => $::instance_conf->get_currency_id, |
... | ... | |
474 | 479 |
|
475 | 480 |
my $dec = delete $params{dec} // 2; |
476 | 481 |
|
477 |
my $transdate = delete $params{transdate} // DateTime->today; |
|
482 |
my $today = DateTime->today_local; |
|
483 |
my $transdate = delete $params{transdate} // $today; |
|
478 | 484 |
die "transdate hat to be DateTime object" unless ref($transdate) eq 'DateTime'; |
479 | 485 |
|
486 |
my $gldate = delete $params{gldate} // $today; |
|
487 |
die "gldate hat to be DateTime object" unless ref($gldate) eq 'DateTime'; |
|
488 |
|
|
480 | 489 |
my $ar_chart = delete $params{ar_chart} // SL::DB::Manager::Chart->find_by( accno => '1400' ); |
481 | 490 |
die "no ar_chart found or not an AR chart" unless $ar_chart and $ar_chart->link eq 'AR'; |
482 | 491 |
|
... | ... | |
488 | 497 |
invnumber => delete $params{invnumber} // 'test ar_transaction', |
489 | 498 |
notes => delete $params{notes} // 'test ar_transaction', |
490 | 499 |
transdate => $transdate, |
500 |
gldate => $gldate, |
|
491 | 501 |
taxincluded => $taxincluded, |
492 | 502 |
taxzone_id => $customer->taxzone_id, # taxzone_id shouldn't have any effect on ar transactions |
493 | 503 |
currency_id => $::instance_conf->get_currency_id, |
... | ... | |
555 | 565 |
|
556 | 566 |
my $today = DateTime->today_local; |
557 | 567 |
my $transdate = delete $params{transdate} // $today; |
568 |
my $gldate = delete $params{gldate} // $today; |
|
558 | 569 |
|
559 | 570 |
my $reference = delete $params{reference} // 'reference'; |
560 | 571 |
my $description = delete $params{description} // 'description'; |
... | ... | |
590 | 601 |
reference => $reference, |
591 | 602 |
description => $description, |
592 | 603 |
transdate => $transdate, |
593 |
gldate => $today,
|
|
604 |
gldate => $gldate,
|
|
594 | 605 |
taxincluded => $taxincluded, |
595 | 606 |
type => undef, |
596 | 607 |
ob_transaction => $ob_transaction, |
Auch abrufbar als: Unified diff
Dev Record : create_{ar|ap|gl}_transaction mit gldate
Damit man Belege für Tests mit abweichendem Erfassungsdatum erstellen
kann.