1 <style type="text/css">
8 /* #customer_menu .ui-menu-item */
10 background-color: #f8f8f8;
13 /* #customer_menu .ui-menu-item */
14 #customer_menu > li.ui-state-focus {
15 background-color: #f8f8f8;
18 #customer_menu > li.ui-state-active {
19 background-color: #f8f8f8;
22 #customer_menu > li > a {
23 border-top: 1px solid transparent;
24 border-left: 1px solid transparent;
25 border-right: 1px solid transparent;
30 #customer_menu > li.ui-state-active > a {
32 /* if i could find something light enough that didn't look pink?
33 or is this too visually distracting and not the useful hint i think it is?
38 #customer_menu a.current_show {
41 border-top: 1px solid #7e0079;
42 border-left: 1px solid #7e0079;
43 border-right: 1px solid #7e0079;
44 border-bottom: 2px solid #ffffff;
46 border-bottom-left-radius: 2px;
47 border-bottom-right-radius: 2px;
54 border-top-left-radius: .5em;
55 border-top-right-radius: .5em;
60 text-decoration: none;
64 background: transparent;
67 %# #customer_menu ul li.ui-state-active {
68 %# background: #f8f0fc;
69 %# border: 1px solid #7e0079;
70 %# border-radius: 2px;
77 <& /elements/dropdown-menu.html,
78 'id' => 'customer_menu',
79 #'class' => 'customer_submenu',
80 #XXX support installs outside /freeside in 4.x
81 'self_url' => "/freeside/view/cust_main.cgi?custnum=$custnum;show=",
83 'cust_main' => $cust_main,
84 'show' => $opt{'show'},
89 my $cust_main = $opt{'cust_main'};
90 my $custnum = $cust_main->custnum;
91 my $curuser = $FS::CurrentUser::CurrentUser;
92 my $conf = FS::Conf->new;
94 my %payby = map { $_ => 1 } $conf->config('payby');
96 # cached for conditions, to avoid looking it up twice
97 my $invoicing_list_emailonly = $cust_main->invoicing_list_emailonly;
99 # nice declarative menu; a parameter to some kind of menu generator
106 label => 'Edit customer',
107 url => "edit/cust_main.cgi?$custnum",
108 acl => 'Edit customer'
111 label => 'Edit contacts',
112 url => "edit/cust_main-contacts.html?$custnum",
121 acl => 'Bill customer now',
122 content => sub { include( '/elements/bill.html',
123 label => emt('Bill now'),
124 url => $cgi->self_url,
125 custnum => shift->custnum,
131 popup => "misc/suspend_cust.html?custnum=$custnum",
132 acl => 'Suspend customer',
133 condition => sub { shift->unsuspended_pkgs > 0 },
134 actionlabel => 'Confirm Suspension',
138 label => 'Unsuspend',
139 popup => "misc/unsuspend_cust.html?custnum=$custnum",
140 acl => 'Unsuspend customer',
141 condition => sub { shift->suspended_pkgs > 0 },
142 actionlabel => 'Confirm Unsuspension',
146 popup => "misc/cancel_cust.html?custnum=$custnum",
147 acl => 'Cancel customer',
148 condition => sub { shift->ncancelled_pkgs > 0 },
149 actionlabel => 'Confirm Cancellation',
154 popup => "misc/merge_cust.html?custnum=$custnum",
155 acl => 'Merge customer',
156 actionlabel => 'Merge customer',
161 label => 'Refer a new customer',
162 url => "edit/cust_main.cgi?referral_custnum=$custnum",
163 confexists => '!disable_customer_referrals',
171 label => 'View this customer\'s referrals',
172 url => "search/cust_main.cgi?referral_custnum=$custnum",
173 confexists => '!disable_customer_referrals',
175 FS::cust_main->count('referral_custnum = ?', shift->custnum) > 0
179 label => 'View billing events',
180 url => "search/cust_event.html?custnum=$custnum",
181 acl => [ 'Billing event reports',
182 'View customer billing events' ],
185 label => 'Email a notice to this customer',
187 my $cust_main = shift;
188 my $agentnum = $cust_main->agentnum;
189 'misc/email-customers.html?table=cust_main;'.
190 'agent_virt_agentnum='.$agentnum.";custnum=$custnum;url=".
191 uri_escape($cgi->self_url);
193 condition => sub { $invoicing_list_emailonly },
194 acl => 'Bulk send customer notices',
204 popup => "edit/cust_main_note.cgi?custnum=$custnum",
205 actionlabel => 'Add note',
206 confexists => '!cust_main-disable_notes',
207 acl => 'Add customer note',
212 label => 'Attach file',
213 popup => "edit/cust_main_attach.cgi?custnum=$custnum",
214 actionlabel => 'Upload file',
215 confexists => '!disable_cust_attachment',
216 acl => 'Add attachment',
225 confexists => 'ticket_system'
230 label => 'Appointments',
231 show => 'appointments',
232 confexists => 'ticket_system',
233 acl => 'View appointments',
236 label => 'Schedule new appointment',
237 confexists => 'ticket_system',
238 acl => 'Make appointment',
239 popup => "misc/make_appointment.html?custnum=$custnum",
240 actionlabel => 'Schedule appointment',
245 label => 'Quotations',
246 show => 'quotations',
249 label => 'Create new quotation',
250 url => "edit/quotation.html?custnum=$custnum",
251 acl => 'Generate quotation',
260 label => 'New qualification',
261 popup => "misc/qual.html?custnum=$custnum",
262 actionlabel => 'New qualification',
266 acl => 'Qualify service',
269 label => 'Order new package',
270 popup => "misc/order_pkg.html?custnum=$custnum",
271 actionlabel => 'Order new package',
275 acl => 'Order customer package',
278 # it's just a popup, but there's some freaky CCH tax stuff in it
279 label => 'One-time charge',
280 url => "edit/quick-charge.html?custnum=$custnum",
281 acl => 'One-time charge',
284 label => 'Move services between packages',
285 popup => "edit/bulk-cust_svc-pkgnum.html?custnum=$custnum",
286 actionlabel => 'Move services',
289 acl => 'Bulk move customer services',
292 label => 'Bulk order and cancel packages',
293 url => "edit/cust_pkg.cgi?$custnum",
294 acl => 'Bulk change customer packages',
302 label => 'Package reports',
303 url => "search/report_cust_pkg.html?custnum=$custnum",
306 label => 'View qualifications',
307 url => "search/qual.cgi?custnum=$custnum",
308 acl => 'Qualify service',
311 label => 'View accounts',
312 url => "search/report_svc_acct.html?custnum=$custnum",
315 label => 'View data usage',
316 popup => "search/report_sqlradius_usage-custnum.html?$custnum",
317 acl => 'Usage: RADIUS sessions',
318 actionlabel => 'Data usage report',
321 condition => sub { shift->num_usage_pkgs > 0 },
324 label => 'View CDRs',
325 url => "search/report_cdr.html?custnum=$custnum",
326 # XXX should have a condition that the customer has any CDR packages
331 label => 'Payment History',
332 show => 'payment_history',
335 # manual payment entry via edit/cust_pay
336 { label => 'Enter payment',
339 label => 'Enter check payment',
340 popup => "edit/cust_pay.cgi?popup=1;payby=BILL;custnum=$custnum",
341 actionlabel => 'Enter check payment',
344 acl => [ 'Post payment', 'Post check payment' ],
347 label => 'Enter cash payment',
348 popup => "edit/cust_pay.cgi?popup=1;payby=CASH;custnum=$custnum",
349 actionlabel => 'Enter cash payment',
352 acl => [ 'Post payment', 'Post cash payment' ],
355 # label => 'Enter Western Union payment',
356 # popup => "edit/cust_pay.cgi?popup=1;payby=WEST;custnum=$custnum",
357 # actionlabel => 'Enter Western Union payment',
360 # acl => [ 'Post payment', ],
361 ## condition => sub { $payby{WEST} },
364 # label => 'Record manual (offline/POS) credit card payment',
365 # popup => "edit/cust_pay.cgi?popup=1;payby=MCRD;custnum=$custnum",
366 # actionlabel => 'Enter credit card payment',
369 # acl => [ 'Post payment', ],
370 ## condition => sub { $payby{MCRD} },
373 # label => 'Record manual (offline/POS) electronic check',
374 # popup => "edit/cust_pay.cgi?popup=1;payby=MCHK;custnum=$custnum",
375 # actionlabel => 'Enter credit card payment',
378 # acl => [ 'Post payment', ],
379 ## condition => sub { $payby{MCHK} },
384 # realtime payments via payment.cgi
385 { label => 'Process payment',
388 label => 'Process credit card payment',
389 url => "misc/payment.cgi?payby=CARD;custnum=$custnum",
390 acl => [ 'Process payment', 'Process credit card payment', ],
391 condition => sub { $payby{CARD} or $payby{DCRD} },
394 label => 'Process electronic check payment',
395 url => "misc/payment.cgi?payby=CHEK;custnum=$custnum",
396 acl => [ 'Process payment', 'Process Echeck payment', ],
397 condition => sub { $payby{CHEK} or $payby{DCHK} },
407 label => 'Enter credit',
408 popup => "edit/cust_credit.cgi?custnum=$custnum",
409 actionlabel => 'Enter credit',
411 acl => 'Post credit',
414 label => 'Credit line items',
415 popup => "edit/credit-cust_bill_pkg.html?custnum=$custnum",
416 actionlabel => 'Credit line items',
419 acl => 'Credit line items',
421 FS::cust_bill->count('custnum = ?', shift->custnum) > 0
429 { label => 'Enter refund',
433 label => 'Enter check refund',
434 popup => "edit/cust_refund.cgi?popup=1;payby=BILL;custnum=$custnum",
435 actionlabel => 'Enter check refund',
437 acl => ['Post refund', 'Post check refund'],
440 label => 'Enter cash refund',
441 popup => "edit/cust_refund.cgi?popup=1;payby=CASH;custnum=$custnum",
442 actionlabel => 'Enter cash refund',
444 acl => ['Post refund', 'Post cash refund'],
447 # label => 'Record manual (offline/POS) credit card refund',
448 # popup => "edit/cust_refund.cgi?popup=1;payby=MCRD;custnum=$custnum",
449 # actionlabel => 'Enter credit card refund',
451 # acl => ['Post refund' ],
452 ## condition => sub { $payby{MCRD} },
455 # label => 'Record manual (offline/POS) electronic check refund',
456 # popup => "edit/cust_refund.cgi?popup=1;payby=MCHK;custnum=$custnum",
457 # actionlabel => 'Enter electronic check refund',
459 # acl => ['Post refund' ],
460 ## condition => sub { $payby{MCHK} },
472 label => 'Add tax adjustment',
473 popup => "edit/cust_tax_adjustment.html?custnum=$custnum",
474 actionlabel => 'Add tax adjustment',
476 confexists => 'enable_tax_adjustments',
477 acl => 'Add customer tax adjustment',
482 confexists => 'enable_tax_adjustments',
483 acl => 'Add customer tax adjustment',
487 label => 'Email statement to this customer',
489 my $cust_main = shift;
490 my $agentnum = $cust_main->agentnum;
491 'misc/email-customer-statement.html?table=cust_main;'.
492 'agent_virt_agentnum='.$agentnum.";custnum=$custnum;url=".
493 uri_escape($cgi->self_url);
495 condition => sub { $invoicing_list_emailonly },
496 acl => 'Resend invoices',
499 label => 'Download PDF statement',
500 url => "view/cust_main_statement-pdf.cgi?$custnum",
501 acl => 'View legacy typeset statements',
503 FS::cust_bill->count('custnum = ?', shift->custnum) > 0
507 label => 'Search invoices',
508 url => "search/report_cust_bill.html?custnum=$custnum",
509 acl => 'List invoices',
512 label => 'View tax exemptions',
513 url => "search/cust_tax_exempt_pkg.cgi?custnum=$custnum",
514 acl => 'View customer tax exemptions',
517 label => 'View tax adjustments',
518 url => "search/cust_tax_adjustment.html?custnum=$custnum",
519 confexists => 'enable_tax_adjustments',
520 acl => 'Add customer tax adjustment',
523 label => 'View pending payments',
524 url => "search/cust_pay_pending.html?magic=_date;statusNOT=done;custnum=$custnum",
525 acl => 'View pending payments',
527 FS::cust_pay_pending->count('custnum = ?', shift->custnum) > 0
534 label => 'Change History',
535 show => 'change_history',
536 acl => 'View customer history',