my $curuser = $FS::CurrentUser::CurrentUser;
+# saved searches
+tie my %report_saved_searches, 'Tie::IxHash';
+if ( my @searches = grep { $_->disabled eq '' } $curuser->saved_search ) {
+ foreach my $search (@searches) {
+ $report_saved_searches{ $search->searchname } = [
+ # don't use query_string here; we don't want to override the format
+ $fsurl . $search->path . '?' . $search->params , ''
+ ];
+ }
+ $report_saved_searches{'separator'} = '';
+ $report_saved_searches{'My saved searches'} =
+ [ $fsurl. 'browse/saved_search.html',
+ 'Manage saved searches and subscriptions' ];
+}
+
#XXX Active tickets not assigned to a customer
tie my %report_prospects, 'Tie::IxHash';
if $conf->config('ticket_system');
$report_customers_lists{'with USPS-unvalidated addresses'} = [ $fsurl. 'search/cust_main.cgi?browse=uspsunvalid', '' ]
if $conf->config('usps_webtools-userid') && $conf->config('usps_webtools-password');
+$report_customers_lists{'with referrals'} = [ $fsurl. 'search/cust_main.html?with_referrals=1' ];
tie my %report_customers, 'Tie::IxHash';
$report_customers{'List customers'} = [ \%report_customers_lists, 'List customers' ]
if $curuser->access_right('List all customers');
-$report_customers{'Zip code distribution'} = [ $fsurl. 'search/report_cust_main-zip.html', 'Zip codes by number of customers' ];
-$report_customers{'Customer signup report'} = [ $fsurl. 'graph/report_cust_signup.html', 'New customer signups by date' ];
-$report_customers{'Customer churn report'} = [ $fsurl.'graph/report_cust_churn.html', 'New customers, suspensions, and cancellations summary' ];
+$report_customers{'Zip code distribution'} = [ $fsurl. 'search/report_cust_main-zip.html', 'Zip codes by number of customers' ]
+ if $curuser->access_right('List zip codes');
+$report_customers{'Customer signup report'} = [ $fsurl. 'graph/report_cust_signup.html', 'New customer signups by date' ]
+ if $curuser->access_right('Financial reports');
+$report_customers{'Customer churn report'} = [ $fsurl.'graph/report_cust_churn.html', 'New customers, suspensions, and cancellations summary' ]
+ if $curuser->access_right('Customers: Customer churn report');
$report_customers{'Signup date report'} = [ $fsurl. 'graph/report_signupdate.html', 'Signup date report (by date of signup)' ];
$report_customers{'Advanced customer reports'} = [ $fsurl. 'search/report_cust_main.html', 'by status, signup date, agent, etc.' ]
if $curuser->access_right('Advanced customer search');
if ( $curuser->access_right('List contacts') ) {
$report_customers{'separator'} = '';
$report_customers{'Customer contacts'} = [ $fsurl. 'search/report_contact.html?link=cust_main' ];
+ $report_customers{'Customer timespan'} = [ $fsurl. 'search/report_cust_timespan.html' ];
}
tie my %report_invoices_open, 'Tie::IxHash',
$report_packages{'Customer packages with unconfigured services'} = [ $fsurl.'search/cust_pkg.cgi?APKG_pkgnum', 'List packages which have provisionable services' ];
$report_packages{'FCC Form 477'} = [ $fsurl.'search/report_477.html' ]
if $conf->exists('part_pkg-show_fcc_options');
+$report_packages{'Contract end dates'} = [ $fsurl.'search/report_cust_pkg-date.html?date=contract_end', 'Show packages by contract end date' ];
$report_packages{'Advanced package reports'} = [ $fsurl.'search/report_cust_pkg.html', 'by agent, date range, status, package definition' ];
tie my %report_inventory, 'Tie::IxHash',
if $curuser->access_right('Employees: Audit Report');
;
-tie my %report_bill_event, 'Tie::IxHash',
- 'All billing events' => [ $fsurl.'search/report_cust_event.html', 'All billing events for a date range' ],
- 'Billing event errors' => [ $fsurl.'search/report_cust_event.html?failed=1', 'Failed credit cards, processor or printer problems, etc.' ],
-# 'All invoice events' => [ $fsurl.'search/cust_bill_event.html', 'Reports on deprecated, old-style invoice events for a date range' ],
-# 'Invoice event errors' => [ $fsurl.'search/cust_bill_event.html?failed=1', 'Reports on deprecated, old-style events for failed credit cards, processor or printer problems, etc.' ],
-;
-
-tie my %report_payments, 'Tie::IxHash',
- 'Payments' => [ $fsurl.'search/report_cust_pay.html', 'Payment report (by type and/or date range)' ],
- 'Payment application detail' => [ $fsurl.'search/report_cust_bill_pay_pkg.html', 'Line item application detail' ],
-;
+tie my %report_payments, 'Tie::IxHash';
+$report_payments{'Payments'} = [ $fsurl.'search/report_cust_pay.html', 'Payment report (by type and/or date range)' ]
+ if $curuser->access_right('Basic payment and refund reports');
+$report_payments{'Payment application detail'} = [ $fsurl.'search/report_cust_bill_pay_pkg.html', 'Line item application detail' ]
+ if $curuser->access_right('Financial reports');
$report_payments{'Pending Payments'} = [ $fsurl.'search/cust_pay_pending.html?magic=_date;statusNOT=done', 'Pending real-time payments' ]
if $curuser->access_right('View customer pending payments');
-$report_payments{'Unapplied Payments'} = [ $fsurl.'search/report_cust_pay.html?unapplied=1', 'Unapplied payment report (by type and/or date range)' ];
+$report_payments{'Unapplied Payments'} = [ $fsurl.'search/report_cust_pay.html?unapplied=1', 'Unapplied payment report (by type and/or date range)' ]
+ if $curuser->access_right('Financial reports'); #not enforced
$report_payments{'Voided Payments'} = [ $fsurl.'search/report_cust_pay.html?void=1', 'Voided payment report (by type and/or date range)' ]
- if $curuser->access_right('View customer pending payments');
+ if $curuser->access_right('Financial reports'); #not enforced
$report_payments{'Payment Batches'} = [ $fsurl.'search/pay_batch.html', 'Payment batches (by status and/or date range)' ]
- if $conf->exists('batch-enable') || $conf->config('batch-enable_payby');
-$report_payments{'Unapplied Payment Aging'} = [ $fsurl.'search/report_unapplied_cust_pay.html', 'Unapplied payment aging report' ];
+ if ( $conf->exists('batch-enable') || $conf->config('batch-enable_payby') )
+ && $curuser->access_right('Financial reports');
+$report_payments{'Unapplied Payment Aging'} = [ $fsurl.'search/report_unapplied_cust_pay.html', 'Unapplied payment aging report' ]
+ if $curuser->access_right('Financial reports');
$report_payments{'Deleted Payments / Payment history table'} = [ $fsurl.'search/report_h_cust_pay.html', 'Deleted payments / payment history table' ]
- if $conf->exists('payment-history-report');
+ if $conf->exists('payment-history-report')
+ && $curuser->access_right('Financial reports');
tie my %report_credits, 'Tie::IxHash',
'Credit Report' => [ $fsurl.'search/report_cust_credit.html', 'Credit report (by employee and/or date range)' ],
;
$report_commissions{'Employee Commissions'} = [ $fsurl.'search/report_employee_commission.html', '' ]
if $curuser->access_right('Employees: Commission Report');
+$report_commissions{'Agent Credits and Payments'} = [ $fsurl.'search/report_agent_credit_payment.html' ];
tie my %report_financial, 'Tie::IxHash';
if( $curuser->access_right('Financial reports') ) {
|| $curuser->access_right('Configuration');
tie my %report_menu, 'Tie::IxHash';
+$report_menu{'Saved searches'} = [ \%report_saved_searches, 'My saved searches' ]
+ if keys(%report_saved_searches);
$report_menu{'Prospects'} = [ \%report_prospects, 'Prospect reports' ]
if $curuser->access_right('List prospects')
|| $curuser->access_right('List contacts');
if $curuser->access_right('List quotations');
$report_menu{'Customers'} = [ \%report_customers, 'Customer reports' ]
if $curuser->access_right('List customers')
- || $curuser->access_right('List contacts');
+ || $curuser->access_right('List contacts')
+ || $curuser->access_right('Advanced customer search')
+ || $curuser->access_right('List zip codes')
+ || $curuser->access_right('Financial reports')
+ || $curuser->access_right('Customers: Customer churn report');
$report_menu{'Invoices'} = [ \%report_invoices, 'Invoice reports' ]
if $curuser->access_right('List invoices');
$report_menu{'Discounts'} = [ \%report_discounts, 'Discount reports' ]
if $curuser->access_right('Financial reports');
$report_menu{'Payments'} = [ \%report_payments, 'Payment reports' ]
- if $curuser->access_right('Financial reports');
+ if keys %report_payments;
$report_menu{'Packages'} = [ \%report_packages, 'Package reports' ]
if $curuser->access_right('List packages');
$report_menu{'Services'} = [ \%report_services, 'Services reports' ]
;#&& FS::TicketSystem->access_right(\%session, 'Something');
$report_menu{'Employees'} = [ \%report_employees, 'Employee reports' ]
if keys %report_employees;
-$report_menu{'Billing events'} = [ \%report_bill_event, 'Billing events' ]
+$report_menu{'Billing events'} = [ $fsurl.'search/report_cust_event.html', 'Search billing events by date and status' ]
if $curuser->access_right('Billing event reports');
$report_menu{'Financial'} = [ \%report_financial, 'Financial reports' ]
if $curuser->access_right('Financial reports')
tie my %tools_customers, 'Tie::IxHash', ();
$tools_customers{'Appointments'} = [ $fsurl.'rt/Search/Schedule.html?LengthMin=0', 'View appointment schedule' ]
if $curuser->access_right('View appointments');
-$tools_customers{'Attachments'} = [ $fsurl.'browse/cust_attachment.html', 'View customer attachments' ]
- if !$conf->config('disable_cust_attachment') and $curuser->access_right('View attachments') and $curuser->access_right('Browse attachments');
-$tools_customers{'Customer email settings'} = [ $fsurl.'misc/manage_cust_email.html' ]
- if $curuser->access_right('Edit customer');
-
-tie my %tools_billing, 'Tie::IxHash', ();
-$tools_billing{'Quick payment entry'} = [ $fsurl.'misc/batch-cust_pay.html', 'Enter multiple payments in a batch' ]
- if $curuser->access_right('Post payment batch');
-$tools_billing{'Process payment batches'} = [ $fsurl.'search/pay_batch.cgi?magic=_date;open=1;intransit=1', 'Process credit card and electronic check batches' ]
- if ( $conf->exists('batch-enable') || $conf->config('batch-enable_payby') )
- && $curuser->access_right('Process batches');
-$tools_billing{'Download invoice batches'} = [ $fsurl.'search/bill_batch.cgi' ]
- if $curuser->access_right('Process invoice batches')
- || $curuser->access_right('Process global invoice batches')
- || $curuser->access_right('Configuration'); #XXX remove in 2.5
- #now there's a standalone event#if $conf->exists('invoice_print_pdf');
tie my %tools_importing, 'Tie::IxHash',
'Customers' => [ $fsurl.'misc/cust_main-import.cgi', '' ],
'Package definitions' => [ $fsurl.'misc/part_pkg-import.html', '' ],
'Customer packages' => [ $fsurl.'misc/cust_pkg-import.html', '' ],
'Customer comments' => [ $fsurl.'misc/cust_main_note-import.html', '' ],
+ 'Customer notes' => [ $fsurl.'misc/cust_main_note-import.html', '' ],
+ 'Customer Contacts' => [ $fsurl.'misc/contact-import.cgi', '' ],
'One-time charges' => [ $fsurl.'misc/cust_main-import_charges.cgi', '' ],
'Payments' => [ $fsurl.'misc/cust_pay-import.cgi', '' ],
'Credits' => [ $fsurl.'misc/cust_credit-import.html', '' ],
}
}
-tie my %tools_misc, 'Tie::IxHash', ();
-$tools_misc{'Bulk DID Orders'} = [ $fsurl.'browse/did_order.html', 'View/manage bulk DID orders' ]
- if $curuser->access_right('Import');
-$tools_misc{'Business card scan'} = [ $fsurl.'edit/prospect_main-upload.html' ]
- if $curuser->access_right('New prospect');
-$tools_misc{'Time Queue'} = [ $fsurl.'search/report_timeworked.html', 'View pending support time' ]
- if $curuser->access_right('Time queue');
-
-#tie my %tools_exporting, 'Tie::IxHash',
-# 'Download database dump' => [ $fsurl. 'misc/dump.cgi', '' ],
-#;
+tie my %tools_exporting, 'Tie::IxHash',
+ 'Download database dump' => [ $fsurl. 'misc/dump.cgi', '' ],
+;
tie my %tools_ticketing_articles, 'Tie::IxHash',
'Overview' => [ $fsurl.'rt/Articles/index.html', '' ],
$tools_ticketing{'Cron Tool'} = [ $fsurl.'rt/Developer/CronTool/', '' ]
if $conf->exists('rt-crontool');
-tie my %tools_system, 'Tie::IxHash', ();
-$tools_system{'Status'} = [ $fsurl.'view/Status.html', 'System status' ]
- if $curuser->access_right('Configuration'); # 'View system status');
-$tools_system{'Job Queue'} = [ $fsurl.'search/queue.html', 'View pending job queue' ]
- if $curuser->access_right('Job queue');
-
tie my %tools_menu, 'Tie::IxHash', ();
$tools_menu{'Customers'} = [ \%tools_customers, 'Customer tools' ]
if keys %tools_customers;
-$tools_menu{'Billing'} = [ \%tools_billing, 'Payment and invoice tools' ]
- if keys %tools_billing;
+$tools_menu{'Quick payment entry'} = [ $fsurl.'misc/batch-cust_pay.html', 'Enter multiple payments in a batch' ]
+ if $curuser->access_right('Post payment batch');
+$tools_menu{'Process payment batches'} = [ $fsurl.'search/pay_batch.cgi?magic=_date;open=1;intransit=1', 'Process credit card and electronic check batches' ]
+ if ( $conf->exists('batch-enable') || $conf->config('batch-enable_payby') )
+ && $curuser->access_right('Process batches');
+$tools_menu{'Download invoice batches'} = [ $fsurl.'search/bill_batch.cgi' ]
+ if $curuser->access_right('Process invoice batches')
+ || $curuser->access_right('Process global invoice batches')
+ || $curuser->access_right('Configuration'); #XXX remove in 2.5
+ #now there's a standalone event#if $conf->exists('invoice_print_pdf');
+$tools_menu{'Bulk DID Orders'} = [ $fsurl.'browse/did_order.html', 'View/manage bulk DID orders' ]
+ if $curuser->access_right('Import');
+$tools_menu{'Job Queue'} = [ $fsurl.'search/queue.html', 'View pending job queue' ]
+ if $curuser->access_right('Job queue');
$tools_menu{'Ticketing'} = [ \%tools_ticketing, 'Ticketing tools' ]
if $conf->config('ticket_system');
-$tools_menu{'Miscellaneous'} = [ \%tools_misc, '' ]
- if keys %tools_misc;
+$tools_menu{'Customer email settings'} = [ $fsurl.'misc/manage_cust_email.html' ]
+ if $curuser->access_right('Edit customer');
+$tools_menu{'Business card scan'} = [ $fsurl.'edit/prospect_main-upload.html' ]
+ if $curuser->access_right('New prospect');
+$tools_menu{'Time Queue'} = [ $fsurl.'search/report_timeworked.html', 'View pending support time' ]
+ if $curuser->access_right('Time queue');
+$tools_menu{'Attachments'} = [ $fsurl.'browse/cust_attachment.html', 'View customer attachments' ]
+ if !$conf->config('disable_cust_attachment') and $curuser->access_right('View attachments') and $curuser->access_right('Browse attachments');
$tools_menu{'Importing'} = [ \%tools_importing, 'Import tools' ]
if $curuser->access_right('Import');
-#$tools_menu{'Exporting'} = [ \%tools_exporting, 'Export tools' ]
-# if $curuser->access_right('Export');
-$tools_menu{'System'} = [ \%tools_system, 'System tools' ]
- if keys %tools_menu;
+$tools_menu{'Exporting'} = [ \%tools_exporting, 'Export tools' ]
+ if $curuser->access_right('Export');
+$tools_menu{'Status'} = [ $fsurl.'view/Status.html', 'System status' ]
+ if $curuser->access_right('Configuration'); # 'View system status');
+
tie my %config_employees, 'Tie::IxHash',
'Employees' => [ $fsurl.'browse/access_user.html', 'Setup internal users' ],
'Contact types' => [ $fsurl.'browse/contact_class.html', ''], #XXX useful description
;
-$config_cust{'Note classes'} = [ $fsurl.'browse/cust_note_class.html', 'Note classes define groups of customer notes for reporting.' ]
- if ($conf->exists('note-classes') && $conf->config('note-classes') > 0);
+$config_cust{'Note classes'} = [ $fsurl.'browse/cust_note_class.html', 'Note classes define groups of customer notes for reporting.' ];
tie my %config_agent, 'Tie::IxHash',
'Agent types' => [ $fsurl.'browse/agent_type.cgi', 'Agent types define groups of package definitions that you can then assign to particular agents' ],
if keys %config_billing;
$config_menu{'Ticketing'} = [ \%config_ticketing, '' ]
if $conf->config('ticket_system')
- && FS::TicketSystem->access_right(\%session, 'ShowConfigTab');
+ && eval { FS::TicketSystem->access_right(\%session, 'ShowConfigTab') };
$config_menu{'Network Monitoring'} = [ \%config_nms, '' ]
if $curuser->access_right('Configure network monitoring')
&& $conf->config('network_monitoring_system') eq 'Torrus_Internal';