Revision c7cabbb2
Von Sven Schöling vor etwa 13 Jahren hinzugefügt
t/wh/transfer.t | ||
---|---|---|
52 | 52 |
|
53 | 53 |
is $r1->{qty}, $r2->{qty} + 4, 'transfer one way'; |
54 | 54 |
|
55 |
################################################# |
|
56 |
|
|
55 | 57 |
WH->transfer({ |
56 | 58 |
transfer_type => 'transfer', |
57 | 59 |
parts_id => $part->id, |
... | ... | |
68 | 70 |
|
69 | 71 |
is $r2->{qty}, $r3->{qty} - 4, 'and back'; |
70 | 72 |
|
73 |
############################################## |
|
74 |
|
|
75 |
use_ok 'SL::DB::TransferType'; |
|
76 |
|
|
77 |
# object interface test |
|
78 |
|
|
79 |
WH->transfer({ |
|
80 |
transfer_type => SL::DB::Manager::TransferType->find_by(description => 'transfer'), |
|
81 |
parts => $part, |
|
82 |
src_bin => $bin1, |
|
83 |
dst_bin => $bin2, |
|
84 |
qty => 6.2, |
|
85 |
chargenumber => '', |
|
86 |
}); |
|
87 |
|
|
88 |
my $r4 = $report->(); |
|
89 |
|
|
90 |
is $r3->{qty}, $r4->{qty} + 6.2, 'object transfer one way'; |
|
91 |
|
|
92 |
############################################# |
|
93 |
|
|
94 |
WH->transfer({ |
|
95 |
transfer_type => SL::DB::Manager::TransferType->find_by(description => 'transfer'), |
|
96 |
parts => $part, |
|
97 |
src_bin => $bin2, |
|
98 |
src_warehouse => $wh, |
|
99 |
dst_bin => $bin1, |
|
100 |
dst_warehouse => $wh, |
|
101 |
qty => 6.2, |
|
102 |
chargenumber => '', |
|
103 |
}); |
|
104 |
|
|
105 |
my $r5 = $report->(); |
|
106 |
|
|
107 |
is $r4->{qty}, $r5->{qty} - 6.2, 'full object transfer back'; |
|
108 |
|
|
71 | 109 |
done_testing; |
72 | 110 |
|
73 | 111 |
|
Auch abrufbar als: Unified diff
WH->transfer - Interface akzeptiert jetzt Rose Objekte.
Ausserdem transfer dokumentiert und Tests erweitert.