Revision a906b008
Von Bernd Bleßmann vor etwa 3 Jahren hinzugefügt
t/db_helper/convert_invoice.t | ||
---|---|---|
1 |
use Test::More tests => 73;
|
|
1 |
use Test::More tests => 75;
|
|
2 | 2 |
|
3 | 3 |
use strict; |
4 | 4 |
|
... | ... | |
127 | 127 |
transdate => '06.03.2015', |
128 | 128 |
unit => $unit->name, |
129 | 129 |
) |
130 |
] |
|
130 |
], |
|
131 |
transaction_description => 'Liefervorgang', |
|
131 | 132 |
); |
132 | 133 |
|
133 | 134 |
|
... | ... | |
149 | 150 |
|
150 | 151 |
|
151 | 152 |
# convert this do to invoice |
152 |
my $invoice = $do1->convert_to_invoice(transdate => $transdate); |
|
153 |
my $invoice = $do1->convert_to_invoice(transdate => $transdate, attributes => {transaction_description => 'Rechnungsvorgang'});
|
|
153 | 154 |
|
154 | 155 |
sleep (300) if $VISUAL_TEST; # we can do a real visual test via gui login |
155 | 156 |
# test invoice afterwards |
... | ... | |
165 | 166 |
$invoice->load; |
166 | 167 |
|
167 | 168 |
is($invoice->cusordnumber , 'b84da' , 'cusordnumber check'); |
169 |
is($invoice->transaction_description, 'Rechnungsvorgang', 'transaction description (changed on conversion) check'); |
|
168 | 170 |
is($invoice->department->description , "Test Department" , 'department description ok'); |
169 | 171 |
is($invoice->amount , '1354.20000' , 'amount check'); |
170 | 172 |
is($invoice->marge_percent , '50.88666' , 'marge percent check'); |
... | ... | |
276 | 278 |
transdate => '06.03.2015', |
277 | 279 |
unit => $unit->name, |
278 | 280 |
) |
279 |
] |
|
281 |
], |
|
282 |
transaction_description => 'Auftragsvorgang', |
|
280 | 283 |
); |
281 | 284 |
|
282 | 285 |
|
... | ... | |
286 | 289 |
my $o1_item2 = $o1->orderitems->[1]; |
287 | 290 |
|
288 | 291 |
# convert this order to invoice |
289 |
$invoice = $o1->convert_to_invoice(transdate => $transdate); |
|
292 |
$invoice = $o1->convert_to_invoice(transdate => $transdate, attributes => {transaction_description => 'Rechnungsvorgang'});
|
|
290 | 293 |
$invoice->load; |
291 | 294 |
|
292 | 295 |
# test invoice afterwards |
... | ... | |
297 | 300 |
ok(($o1->closed) , 'convert form order: Order is closed after conversion'); |
298 | 301 |
is($invoice->payment_terms->description, "14Tage 2%Skonto, 30Tage netto", 'convert form order: payment term description check'); |
299 | 302 |
|
300 |
is($invoice->cusordnumber, 'b84da', 'convert form order: cusordnumber check'); |
|
301 |
is($invoice->department->description, "Test Department", 'convert form order: department description ok'); |
|
302 |
is($invoice->amount, '1354.20000', 'convert form order: amount check'); |
|
303 |
is($invoice->marge_percent, '50.88666', 'convert form order: marge percent check'); |
|
304 |
is($invoice->marge_total, '579.08000', 'convert form order: marge total check'); |
|
305 |
is($invoice->netamount, '1137.98000', 'convert form order: netamount check'); |
|
303 |
is($invoice->cusordnumber, 'b84da', 'convert form order: cusordnumber check'); |
|
304 |
is($invoice->transaction_description, 'Rechnungsvorgang', 'convert form order: transaction description (changed on conversion) check'); |
|
305 |
is($invoice->department->description, "Test Department", 'convert form order: department description ok'); |
|
306 |
is($invoice->amount, '1354.20000', 'convert form order: amount check'); |
|
307 |
is($invoice->marge_percent, '50.88666', 'convert form order: marge percent check'); |
|
308 |
is($invoice->marge_total, '579.08000', 'convert form order: marge total check'); |
|
309 |
is($invoice->netamount, '1137.98000', 'convert form order: netamount check'); |
|
306 | 310 |
|
307 | 311 |
# some item checks |
308 | 312 |
is($invoice->items_sorted->[0]->parts_id, $parts[0]->id , 'convert form order: invoiceitem 1 linked with part'); |
Auch abrufbar als: Unified diff
convert_invoice.t: Test für Änderung von Attributen bei Konvertierung