X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/82515b2d93dc5632f24d6e0b6f8f05f3fd19fbb0..19f96ce52f5145d8bf54060f18ab854d3e9034ca:/SL/DB/Part.pm diff --git a/SL/DB/Part.pm b/SL/DB/Part.pm index 6ea2be9b1..52b7520fa 100644 --- a/SL/DB/Part.pm +++ b/SL/DB/Part.pm @@ -7,10 +7,6 @@ use SL::DBUtils; use SL::DB::MetaSetup::Part; use SL::DB::Manager::Part; -__PACKAGE__->attr_number('lastcost', places => -2); -__PACKAGE__->attr_number('listprice', places => -2); -__PACKAGE__->attr_number('sellprice', places => -2); - __PACKAGE__->meta->add_relationships( unit_obj => { type => 'one to one', @@ -63,37 +59,6 @@ sub get_ordered_qty { return $result{ $self->id }; } -sub get_uncommissioned_qty { - my $self = shift; - my %params = @_; - - confess "Missing part id" unless $self->id; - - my $query = < 0)), - 0) - - - COALESCE((SELECT SUM(i.qty) AS qty - FROM inventory i - LEFT JOIN warehouse wh ON (i.warehouse_id = wh.id) - WHERE (i.parts_id = ?) - AND COALESCE(wh.commission)), - 0) - AS qty -SQL - - my $result = selectfirst_hashref_query($::form, $self->dbh, $query, $self->id, $self->id); - return $result ? $result->{qty} : 0; -} - sub available_units { shift->unit_obj->convertible_units; }