projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
better scalability for token checks, RT#71513
[freeside.git]
/
FS
/
FS
/
inventory_item.pm
diff --git
a/FS/FS/inventory_item.pm
b/FS/FS/inventory_item.pm
index
3bba1cd
..
eef8880
100644
(file)
--- a/
FS/FS/inventory_item.pm
+++ b/
FS/FS/inventory_item.pm
@@
-1,13
+1,7
@@
package FS::inventory_item;
package FS::inventory_item;
+use base qw( FS::cust_main_Mixin FS::Record );
use strict;
use strict;
-use vars qw( @ISA );
-use FS::Record qw( dbh qsearch qsearchs );
-use FS::cust_main_Mixin;
-use FS::inventory_class;
-use FS::cust_svc;
-
-@ISA = qw( FS::cust_main_Mixin FS::Record );
=head1 NAME
=head1 NAME
@@
-106,8
+100,12
@@
sub check {
my $error =
$self->ut_numbern('itemnum')
|| $self->ut_foreign_key('classnum', 'inventory_class', 'classnum' )
my $error =
$self->ut_numbern('itemnum')
|| $self->ut_foreign_key('classnum', 'inventory_class', 'classnum' )
+ #|| $self->ut_foreign_keyn('agentnum', 'agent', 'agentnum' )
+ || $self->ut_agentnum_acl('agentnum', ['Configuration',
+ 'Edit global inventory'] )
|| $self->ut_text('item')
|| $self->ut_foreign_keyn('svcnum', 'cust_svc', 'svcnum' )
|| $self->ut_text('item')
|| $self->ut_foreign_keyn('svcnum', 'cust_svc', 'svcnum' )
+ || $self->ut_alphan('svc_field')
;
return $error if $error;
;
return $error if $error;
@@
-119,13
+117,9
@@
sub check {
Returns the customer service associated with this inventory item, if the
item has been used (see L<FS::cust_svc>).
Returns the customer service associated with this inventory item, if the
item has been used (see L<FS::cust_svc>).
-=
cut
+=
item agent
-sub cust_svc {
- my $self = shift;
- return '' unless $self->svcnum;
- qsearchs( 'cust_svc', { 'svcnum' => $self->svcnum } );
-}
+Returns the associated agent for this event, if any, as an FS::agent object.
=back
=back
@@
-142,7
+136,7
@@
sub process_batch_import {
my $opt = { 'table' => 'inventory_item',
#'params' => [ 'itembatch', 'classnum', ],
my $opt = { 'table' => 'inventory_item',
#'params' => [ 'itembatch', 'classnum', ],
- 'params' => [ 'classnum', ],
+ 'params' => [ 'classnum',
'agentnum',
],
'formats' => { 'default' => [ 'item' ] },
'default_csv' => 1,
};
'formats' => { 'default' => [ 'item' ] },
'default_csv' => 1,
};