Index: Order.pm =================================================================== --- Order.pm (revision 433) +++ Order.pm (revision 434) @@ -25,6 +25,7 @@ _payment_filter _uid_filter + _company_filter _manager_filter _vault_filter _postman_filter @@ -74,6 +75,16 @@ 'db_opts' => "not null default 0", 'default' => 0, }, + { + 'attr' => 'company_id', + 'type' => 'integer', + 'rusname' => 'ID компании', + 'hidden' => 1, + 'db_field' => 'company_id', + 'db_type' => 'integer', + 'db_opts' => "not null default 0", + 'default' => 0, + }, { # User ID 'attr' => 'manager_id', 'type' => 'string', @@ -211,6 +222,12 @@ return &SQL::Common::_generic_int_filter('d.uid', $opts{uid}); } +sub _company_filter { + my ($self,%opts)=@_; + return undef unless ( exists $opts{company_id} ); + return &SQL::Common::_generic_int_filter('d.company_id', $opts{company_id}); +} + sub _manager_filter { my ($self,%opts)=@_; return undef unless ( exists $opts{manager} );