Revision 8010b559
Von Tamino Steinert vor fast 2 Jahren hinzugefügt
SL/DB/ReclamationItem.pm | ||
---|---|---|
21 | 21 |
} |
22 | 22 |
}, |
23 | 23 |
); |
24 |
use SL::Helper::ShippedQty; |
|
25 | 24 |
|
26 | 25 |
__PACKAGE__->meta->initialize; |
27 | 26 |
|
28 | 27 |
__PACKAGE__->configure_acts_as_list(group_by => [qw(reclamation_id)]); |
29 | 28 |
|
30 |
sub shipped_qty { |
|
31 |
my ($self, %params) = @_; |
|
32 |
|
|
33 |
my $force = delete $params{force}; |
|
34 |
|
|
35 |
SL::Helper::ShippedQty->new(%params)->calculate($self)->write_to_objects if $force || !defined $self->{shipped_qty}; |
|
36 |
|
|
37 |
$self->{shipped_qty}; |
|
38 |
} |
|
39 |
|
|
40 | 29 |
sub is_linked_to_record { |
41 | 30 |
my ($self) = @_; |
42 | 31 |
|
... | ... | |
131 | 120 |
return $self->reclamation->customervendor; |
132 | 121 |
} |
133 | 122 |
|
134 |
sub delivered_qty { goto &shipped_qty } |
|
135 | 123 |
sub record { goto &reclamation } |
136 | 124 |
sub record_id { goto &reclamation_id } |
137 | 125 |
sub trans_id { goto &reclamation_id } |
... | ... | |
149 | 137 |
|
150 | 138 |
=head1 FUNCTIONS |
151 | 139 |
|
152 |
=over 4 |
|
153 |
|
|
154 |
=item C<shipped_qty PARAMS> |
|
155 |
|
|
156 |
Calculates the shipped qty for this reclamationitem (measured in the current unit) |
|
157 |
and returns it. |
|
158 |
|
|
159 |
Note that the shipped qty is expected not to change within the request and is |
|
160 |
cached in C<shipped_qty> once calculated. If C<< force => 1 >> is passed, the |
|
161 |
existibng cache is ignored. |
|
162 |
|
|
163 |
Given parameters will be passed to L<SL::Helper::ShippedQty>, so you can force |
|
164 |
the shipped/delivered distinction like this: |
|
165 |
|
|
166 |
$_->shipped_qty(require_stock_out => 0); |
|
167 |
|
|
168 |
Note however that calculating shipped_qty on individual Reclamationitems is generally |
|
169 |
a bad idea. See L<SL::Helper::ShippedQty> for way to compute these all at once. |
|
170 |
|
|
171 |
=item C<delivered_qty> |
|
172 |
|
|
173 |
Alias for L</shipped_qty>. |
|
174 |
|
|
175 |
=back |
|
176 |
|
|
177 | 140 |
=head1 AUTHORS |
178 | 141 |
|
179 | 142 |
G. Richardson E<lt>grichardson@kivitendo-premium.deE<gt> |
Auch abrufbar als: Unified diff
Reclamation: don't need shipped_qty