Revision f2029311
Von Jan Büren vor mehr als 3 Jahren hinzugefügt
SL/Helper/ShippedQty.pm | ||
---|---|---|
14 | 14 |
|
15 | 15 |
use Rose::Object::MakeMethods::Generic ( |
16 | 16 |
'scalar' => [ qw(objects objects_or_ids shipped_qty keep_matches) ], |
17 |
'scalar --get_set_init' => [ qw(oe_ids dbh require_stock_out fill_up item_identity_fields oi2oe oi_qty delivered matches) ], |
|
17 |
'scalar --get_set_init' => [ qw(oe_ids dbh require_stock_out fill_up item_identity_fields oi2oe oi_qty delivered matches |
|
18 |
services_deliverable) ], |
|
18 | 19 |
); |
19 | 20 |
|
20 | 21 |
my $no_stock_item_links_query = <<''; |
... | ... | |
221 | 222 |
} elsif ('SL::DB::Order' eq ref $obj) { |
222 | 223 |
if (defined $obj->{orderitems}) { |
223 | 224 |
$self->write_to($obj->{orderitems}); |
224 |
$obj->{delivered} = all { $_->{delivered} } grep { !$_->{optional} } @{ $obj->{orderitems} }; |
|
225 |
if ($self->services_deliverable) { |
|
226 |
$obj->{delivered} = all { $_->{delivered} } grep { !$_->{optional} } @{ $obj->{orderitems} }; |
|
227 |
} else { |
|
228 |
$obj->{delivered} = all { $_->{delivered} } grep { !$_->{optional} && !$_->part->is_service } @{ $obj->{orderitems} }; |
|
229 |
} |
|
225 | 230 |
} else { |
226 | 231 |
# don't force a load on items. just compute by oe_id directly |
227 | 232 |
$obj->{delivered} = $self->delivered->{$obj->id}; |
... | ... | |
302 | 307 |
sub init_item_identity_fields { [ grep $item_identity_fields{$_}, @{ $::instance_conf->get_shipped_qty_item_identity_fields } ] } |
303 | 308 |
sub init_fill_up { $::instance_conf->get_shipped_qty_fill_up } |
304 | 309 |
|
310 |
sub init_services_deliverable { |
|
311 |
my ($self) = @_; |
|
312 |
if ($::form->{type} =~ m/^sales_/) { |
|
313 |
$::instance_conf->get_sales_delivery_order_check_service; |
|
314 |
} elsif ($::form->{type} =~ m/^purchase_/) { |
|
315 |
$::instance_conf->get_purchase_delivery_order_check_service; |
|
316 |
} else { |
|
317 |
croak "wrong call, no customer or vendor object referenced"; |
|
318 |
} |
|
319 |
} |
|
320 |
|
|
305 | 321 |
1; |
306 | 322 |
|
307 | 323 |
__END__ |
Auch abrufbar als: Unified diff
S/H/ShippedQty Status Geliefert je nach Konfiguration Dienstleistung berechnen