1 <% include( 'elements/browse.html',
2 title => emt('Real Estate Inventory'),
3 name => 'real estate inventory',
6 'Edit locations' => "${p}browse/realestate_location.html",
7 'Add a new location' => "${p}edit/realestate_location.html",
8 'Add a new unit' => "${p}edit/realestate_unit.html",
12 table => 'realestate_unit',
13 select => join(', ',qw(
15 realestate_location.location_title
21 LEFT JOIN realestate_location
22 ON realestate_location.realestatelocnum
23 = realestate_unit.realestatelocnum
24 LEFT JOIN svc_realestate
25 ON realestate_unit.realestatenum = svc_realestate.realestatenum
27 ON svc_realestate.svcnum = cust_svc.svcnum
29 ON cust_svc.pkgnum = cust_pkg.pkgnum
31 ON cust_pkg.custnum = cust_main.custnum
33 order_by => "ORDER BY location_title, unit_title"
36 count_query => 'SELECT COUNT(*) FROM realestate_unit',
38 header => [ 'Location', 'Unit', 'Customer' ],
43 return '' unless $_[0]->custnum;
44 return encode_entities( $_[0]->company ) if $_[0]->company;
45 return encode_entities( $_[0]->first.' '.$_[0]->last );
49 ["${p}edit/realestate_location.html?", 'realestatelocnum' ],
50 ["${p}edit/realestate_unit.html?", 'realestatenum' ],
51 ["${p}view/cust_main.cgi?", 'custnum' ]
62 my $curuser = $FS::CurrentUser::CurrentUser;
64 unless $curuser->access_right('Edit inventory')
65 || $curuser->access_right('Edit global inventory')
66 || $curuser->access_right('Configuration');