From 69e481a4a9191b9912d6bb8202627a5dc75f74ce Mon Sep 17 00:00:00 2001 From: Mitch Jackson Date: Thu, 11 Jan 2018 20:05:34 -0600 Subject: rt# 74031 implement svc_realestate --- httemplate/browse/realestate_location.html | 43 +++++++++++++ httemplate/browse/realestate_unit.html | 70 +++++++++++++++++++++ httemplate/docs/part_svc-table.html | 7 ++- httemplate/edit/process/realestate_location.html | 14 +++++ httemplate/edit/process/realestate_unit.html | 13 ++++ httemplate/edit/realestate_location.html | 72 ++++++++++++++++++++++ httemplate/edit/realestate_unit.html | 48 +++++++++++++++ httemplate/elements/menu.html | 6 +- .../elements/select-realestate_location.html | 32 ++++++++++ httemplate/elements/select-realestate_unit.html | 59 ++++++++++++++++++ .../elements/tr-select-realestate_location.html | 17 +++++ httemplate/elements/tr-select-realestate_unit.html | 5 ++ 12 files changed, 384 insertions(+), 2 deletions(-) create mode 100644 httemplate/browse/realestate_location.html create mode 100644 httemplate/browse/realestate_unit.html create mode 100644 httemplate/edit/process/realestate_location.html create mode 100644 httemplate/edit/process/realestate_unit.html create mode 100644 httemplate/edit/realestate_location.html create mode 100644 httemplate/edit/realestate_unit.html create mode 100644 httemplate/elements/select-realestate_location.html create mode 100644 httemplate/elements/select-realestate_unit.html create mode 100644 httemplate/elements/tr-select-realestate_location.html create mode 100644 httemplate/elements/tr-select-realestate_unit.html (limited to 'httemplate') diff --git a/httemplate/browse/realestate_location.html b/httemplate/browse/realestate_location.html new file mode 100644 index 000000000..be2cd11f8 --- /dev/null +++ b/httemplate/browse/realestate_location.html @@ -0,0 +1,43 @@ +<% include( 'elements/browse.html', + title => emt('Real Estate Locations'), + name => 'real estate locations', + + menubar => [ + 'Edit units' => "${p}browse/realestate_unit.html", + 'Add a new location' => "${p}edit/realestate_location.html", + 'Add a new unit' => "${p}edit/realestate_unit.html", + ], + + query => { table => 'realestate_location' }, + count_query => 'SELECT COUNT(*) FROM realestate_location', + + header => [ 'Location', 'Address', 'Address 2', 'City', 'State', 'Zip' ], + fields => [ + 'location_title', + 'address1', + 'address2', + 'city', + 'state', + 'zip' + ], + links => [ + ["${p}edit/realestate_location.html?", 'realestatelocnum' ], + ], + + agent_virt => 1, + agent_pos => 0, + disableable => 1, +) +%> +<%init> + + +my $curuser = $FS::CurrentUser::CurrentUser; +die("access denied") + unless $curuser->access_right('Edit inventory') + || $curuser->access_right('Edit global inventory') + || $curuser->access_right('Configuration'); + + + + diff --git a/httemplate/browse/realestate_unit.html b/httemplate/browse/realestate_unit.html new file mode 100644 index 000000000..399cd2583 --- /dev/null +++ b/httemplate/browse/realestate_unit.html @@ -0,0 +1,70 @@ +<% include( 'elements/browse.html', + title => emt('Real Estate Inventory'), + name => 'real estate inventory', + + menubar => [ + 'Edit locations' => "${p}browse/realestate_location.html", + 'Add a new location' => "${p}edit/realestate_location.html", + 'Add a new unit' => "${p}edit/realestate_unit.html", + ], + + query => { + table => 'realestate_unit', + select => join(', ',qw( + realestate_unit.* + realestate_location.location_title + cust_main.first + cust_main.last + cust_main.company + )), + addl_from => " + LEFT JOIN realestate_location + ON realestate_location.realestatelocnum + = realestate_unit.realestatelocnum + LEFT JOIN svc_realestate + ON realestate_unit.realestatenum = svc_realestate.realestatenum + LEFT JOIN cust_svc + ON svc_realestate.svcnum = cust_svc.svcnum + LEFT JOIN cust_pkg + ON cust_svc.pkgnum = cust_pkg.pkgnum + LEFT JOIN cust_main + ON cust_pkg.custnum = cust_main.custnum + ", + order_by => "ORDER BY location_title, unit_title" + }, + + count_query => 'SELECT COUNT(*) FROM realestate_unit', + + header => [ 'Location', 'Unit', 'Customer' ], + fields => [ + 'location_title', + 'unit_title', + sub { + return '' unless $_[0]->custnum; + return $_[0]->company if $_[0]->company; + return $_[0]->first.' '.$_[0]->last; + }, + ], + links => [ + ["${p}edit/realestate_location.html?", 'realestatelocnum' ], + ["${p}edit/realestate_unit.html?", 'realestatenum' ], + ["${p}view/cust_main.cgi?", 'custnum' ] + ], + + agent_virt => 1, + agent_pos => 0, + disableable => 1, +) +%> +<%init> + + +my $curuser = $FS::CurrentUser::CurrentUser; +die("access denied") + unless $curuser->access_right('Edit inventory') + || $curuser->access_right('Edit global inventory') + || $curuser->access_right('Configuration'); + + + + diff --git a/httemplate/docs/part_svc-table.html b/httemplate/docs/part_svc-table.html index 820d0b9cc..56a4d0e8c 100644 --- a/httemplate/docs/part_svc-table.html +++ b/httemplate/docs/part_svc-table.html @@ -39,6 +39,7 @@ Hosting Colocation + Real Estate + + +