Revision 2cd78592
Von G. Richardson vor mehr als 4 Jahren hinzugefügt
t/db_helper/convert_invoice.t | ||
---|---|---|
25 | 25 |
use SL::Dev::ALL qw(:ALL); |
26 | 26 |
|
27 | 27 |
my ($customer, $employee, $payment_do, $unit, @parts, $department); |
28 |
my ($transdate); |
|
28 | 29 |
|
29 | 30 |
my $VISUAL_TEST = 0; # just a sleep to click around |
30 | 31 |
|
... | ... | |
40 | 41 |
|
41 | 42 |
clear_up(); |
42 | 43 |
|
44 |
$transdate = DateTime->today_local; |
|
45 |
$transdate->set_year(2019) if $transdate->year == 2020; # use year 2019 in 2020, because of tax rate change in Germany |
|
46 |
|
|
43 | 47 |
$unit = SL::DB::Manager::Unit->find_by(name => 'kg') || die "Can't find unit 'kg'"; |
44 | 48 |
$customer = new_customer()->save; |
45 | 49 |
|
... | ... | |
91 | 95 |
# we create L20199 with two items |
92 | 96 |
my $do1 = create_sales_delivery_order( |
93 | 97 |
'department_id' => $department->id, |
98 |
'transdate' => $transdate, |
|
94 | 99 |
'donumber' => 'L20199', |
95 | 100 |
'employee_id' => $employee->id, |
96 | 101 |
'intnotes' => 'some intnotes', |
... | ... | |
144 | 149 |
|
145 | 150 |
|
146 | 151 |
# convert this do to invoice |
147 |
my $invoice = $do1->convert_to_invoice(); |
|
152 |
my $invoice = $do1->convert_to_invoice(transdate => $transdate);
|
|
148 | 153 |
|
149 | 154 |
sleep (300) if $VISUAL_TEST; # we can do a real visual test via gui login |
150 | 155 |
# test invoice afterwards |
... | ... | |
234 | 239 |
|
235 | 240 |
1; |
236 | 241 |
|
237 |
|
|
238 | 242 |
# vim: ft=perl |
239 | 243 |
# set emacs to perl mode |
240 | 244 |
# Local Variables: |
Auch abrufbar als: Unified diff
convert_invoice.t - in 2020 das Jahr 2019 nehmen