Revision 4dabc760
Von Tamino Steinert vor mehr als 1 Jahr hinzugefügt
SL/DB/Part.pm | ||
---|---|---|
8 | 8 |
use Rose::DB::Object::Helpers qw(as_tree); |
9 | 9 |
|
10 | 10 |
use SL::Locale::String qw(t8); |
11 |
use SL::Helper::Inventory; |
|
11 | 12 |
use SL::DBUtils; |
12 | 13 |
use SL::DB::MetaSetup::Part; |
13 | 14 |
use SL::DB::Manager::Part; |
... | ... | |
91 | 92 |
|
92 | 93 |
__PACKAGE__->meta->initialize; |
93 | 94 |
|
95 |
use Rose::Object::MakeMethods::Generic ( |
|
96 |
'scalar --get_set_init' => [ qw(onhandqty stockqty get_open_ordered_qty) ], |
|
97 |
); |
|
94 | 98 |
__PACKAGE__->attr_html('notes'); |
95 | 99 |
__PACKAGE__->attr_sorted({ unsorted => 'makemodels', position => 'sortorder' }); |
96 | 100 |
__PACKAGE__->attr_sorted({ unsorted => 'customerprices', position => 'sortorder' }); |
... | ... | |
578 | 582 |
return 1; |
579 | 583 |
} |
580 | 584 |
|
585 |
sub init_onhandqty{ |
|
586 |
my ($self) = @_; |
|
587 |
my $qty = SL::Helper::Inventory::get_onhand(part => $self->id) || 0; |
|
588 |
return $qty; |
|
589 |
} |
|
590 |
|
|
591 |
sub init_stockqty{ |
|
592 |
my ($self) = @_; |
|
593 |
my $qty = SL::Helper::Inventory::get_stock(part => $self->id) || 0; |
|
594 |
return $qty; |
|
595 |
} |
|
596 |
|
|
597 |
sub init_get_open_ordered_qty { |
|
598 |
my ($self) = @_; |
|
599 |
my $result = SL::DB::Manager::Part->get_open_ordered_qty($self->id); |
|
600 |
|
|
601 |
return $result; |
|
602 |
} |
|
603 |
|
|
581 | 604 |
1; |
582 | 605 |
|
583 | 606 |
__END__ |
Auch abrufbar als: Unified diff
Part: um Helferfunktionen für den Warenstand erweitert