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 #customer_menu ul form {
65 background: transparent;
71 <& /elements/dropdown-menu.html,
72 'id' => 'customer_menu',
73 #'class' => 'customer_submenu',
74 #XXX support installs outside /freeside in 4.x
75 'self_url' => "/freeside/view/cust_main.cgi?custnum=$custnum;show=",
77 'cust_main' => $cust_main,
78 'show' => $opt{'show'},
83 my $cust_main = $opt{'cust_main'};
84 my $custnum = $cust_main->custnum;
85 my $curuser = $FS::CurrentUser::CurrentUser;
86 my $conf = FS::Conf->new;
88 my @payby = grep /\w/, $conf->config('payby');
89 @payby = (qw( CARD DCRD CHEK DCHK ))
91 my %payby = map { $_ => 1 } @payby;
93 # cached for conditions, to avoid looking it up twice
94 my $invoicing_list_emailonly = $cust_main->invoicing_list_emailonly;
96 # nice declarative menu; a parameter to some kind of menu generator
103 label => 'Edit customer',
104 url => "edit/cust_main.cgi?$custnum",
105 acl => 'Edit customer'
108 label => 'Edit contacts',
109 url => "edit/cust_main-contacts.html?$custnum",
118 acl => 'Bill customer now',
119 content => sub { include( '/elements/bill.html',
120 label => emt('Bill now'),
121 url => $cgi->self_url,
122 custnum => shift->custnum,
128 popup => "misc/suspend_cust.html?custnum=$custnum",
129 acl => 'Suspend customer',
130 condition => sub { shift->unsuspended_pkgs > 0 },
131 actionlabel => 'Confirm Suspension',
135 label => 'Unsuspend',
136 popup => "misc/unsuspend_cust.html?custnum=$custnum",
137 acl => 'Unsuspend customer',
138 condition => sub { shift->suspended_pkgs > 0 },
139 actionlabel => 'Confirm Unsuspension',
143 popup => "misc/cancel_cust.html?custnum=$custnum",
144 acl => 'Cancel customer',
145 condition => sub { shift->ncancelled_pkgs > 0 },
146 actionlabel => 'Confirm Cancellation',
151 popup => "misc/merge_cust.html?custnum=$custnum",
152 acl => 'Merge customer',
153 actionlabel => 'Merge customer',
158 label => 'Refer a new customer',
159 url => "edit/cust_main.cgi?referral_custnum=$custnum",
160 confexists => '!disable_customer_referrals',
168 label => 'View this customer\'s referrals',
169 url => "search/cust_main.cgi?referral_custnum=$custnum",
170 confexists => '!disable_customer_referrals',
172 FS::cust_main->count('referral_custnum = ?', shift->custnum) > 0
176 label => 'View billing events',
177 url => "search/cust_event.html?custnum=$custnum",
178 acl => [ 'Billing event reports',
179 'View customer billing events' ],
182 label => 'Test billing events',
183 url => "misc/test-part_event.html?custnum=$custnum",
184 acl => 'Configuration',
187 label => 'Email a notice to this customer',
189 my $cust_main = shift;
190 my $agentnum = $cust_main->agentnum;
191 'misc/email-customers.html?table=cust_main;'.
192 'agent_virt_agentnum='.$agentnum.";custnum=$custnum;url=".
193 uri_escape($cgi->self_url);
195 condition => sub { $invoicing_list_emailonly },
196 acl => 'Bulk send customer notices',
206 popup => "edit/cust_main_note.cgi?custnum=$custnum",
207 actionlabel => 'Add note',
208 confexists => '!cust_main-disable_notes',
209 acl => 'Add customer note',
214 label => 'Attach file',
215 popup => "edit/cust_main_attach.cgi?custnum=$custnum",
216 actionlabel => 'Upload file',
217 confexists => '!disable_cust_attachment',
218 acl => 'Add attachment',
227 confexists => 'ticket_system'
232 label => 'Appointments',
233 show => 'appointments',
234 confexists => 'ticket_system',
235 acl => 'View appointments',
238 label => 'Schedule new appointment',
239 confexists => 'ticket_system',
240 acl => 'Make appointment',
241 popup => "misc/make_appointment.html?custnum=$custnum",
242 actionlabel => 'Schedule appointment',
247 label => 'Quotations',
248 show => 'quotations',
251 label => 'Create new quotation',
252 url => "edit/quotation.html?custnum=$custnum",
253 acl => 'Generate quotation',
262 label => 'New qualification',
263 popup => "misc/qual.html?custnum=$custnum",
264 actionlabel => 'New qualification',
268 acl => 'Qualify service',
271 label => 'Order new package',
272 popup => "misc/order_pkg.html?custnum=$custnum",
273 actionlabel => 'Order new package',
277 acl => 'Order customer package',
280 # it's just a popup, but there's some freaky CCH tax stuff in it
281 label => 'One-time charge',
282 url => "edit/quick-charge.html?custnum=$custnum",
283 acl => 'One-time charge',
286 label => 'Move services between packages',
287 popup => "edit/bulk-cust_svc-pkgnum.html?custnum=$custnum",
288 actionlabel => 'Move services',
291 acl => 'Bulk move customer services',
294 label => 'Bulk order and cancel packages',
295 url => "edit/cust_pkg.cgi?$custnum",
296 acl => 'Bulk change customer packages',
304 label => 'Package reports',
305 url => "search/report_cust_pkg.html?custnum=$custnum",
308 label => 'View qualifications',
309 url => "search/qual.cgi?custnum=$custnum",
310 acl => 'Qualify service',
313 label => 'View accounts',
314 url => "search/report_svc_acct.html?custnum=$custnum",
317 label => 'View data usage',
318 popup => "search/report_sqlradius_usage-custnum.html?$custnum",
319 acl => 'Usage: RADIUS sessions',
320 actionlabel => 'Data usage report',
323 condition => sub { shift->num_usage_pkgs > 0 },
326 label => 'View CDRs',
327 url => "search/report_cdr.html?custnum=$custnum",
328 # XXX should have a condition that the customer has any CDR packages
333 label => 'Payment History',
334 show => 'payment_history',
337 # manual payment entry via edit/cust_pay
338 { label => 'Enter payment',
341 label => 'Enter check payment',
342 popup => "edit/cust_pay.cgi?popup=1;payby=BILL;custnum=$custnum",
343 actionlabel => 'Enter check payment',
346 acl => [ 'Post payment', 'Post check payment' ],
349 label => 'Enter cash payment',
350 popup => "edit/cust_pay.cgi?popup=1;payby=CASH;custnum=$custnum",
351 actionlabel => 'Enter cash payment',
354 acl => [ 'Post payment', 'Post cash payment' ],
357 # label => 'Enter Western Union payment',
358 # popup => "edit/cust_pay.cgi?popup=1;payby=WEST;custnum=$custnum",
359 # actionlabel => 'Enter Western Union payment',
362 # acl => [ 'Post payment', ],
363 ## condition => sub { $payby{WEST} },
366 # label => 'Record manual (offline/POS) credit card payment',
367 # popup => "edit/cust_pay.cgi?popup=1;payby=MCRD;custnum=$custnum",
368 # actionlabel => 'Enter credit card payment',
371 # acl => [ 'Post payment', ],
372 ## condition => sub { $payby{MCRD} },
375 # label => 'Record manual (offline/POS) electronic check',
376 # popup => "edit/cust_pay.cgi?popup=1;payby=MCHK;custnum=$custnum",
377 # actionlabel => 'Enter credit card payment',
380 # acl => [ 'Post payment', ],
381 ## condition => sub { $payby{MCHK} },
386 # realtime payments via payment.cgi
387 { label => 'Process payment',
390 label => 'Process credit card payment',
391 url => "misc/payment.cgi?payby=CARD;custnum=$custnum",
392 acl => [ 'Process payment', 'Process credit card payment', ],
393 condition => sub { $payby{CARD} or $payby{DCRD} },
396 label => 'Process electronic check payment',
397 url => "misc/payment.cgi?payby=CHEK;custnum=$custnum",
398 acl => [ 'Process payment', 'Process Echeck payment', ],
399 condition => sub { $payby{CHEK} or $payby{DCHK} },
409 label => 'Enter credit',
410 popup => "edit/cust_credit.cgi?custnum=$custnum",
411 actionlabel => 'Enter credit',
413 acl => 'Post credit',
416 label => 'Credit line items',
417 popup => "edit/credit-cust_bill_pkg.html?custnum=$custnum",
418 actionlabel => 'Credit line items',
421 acl => 'Credit line items',
423 FS::cust_bill->count('custnum = ?', shift->custnum) > 0
431 { label => 'Enter refund',
435 label => 'Enter check refund',
436 popup => "edit/cust_refund.cgi?popup=1;payby=BILL;custnum=$custnum",
437 actionlabel => 'Enter check refund',
439 acl => ['Post refund', 'Post check refund'],
442 label => 'Enter cash refund',
443 popup => "edit/cust_refund.cgi?popup=1;payby=CASH;custnum=$custnum",
444 actionlabel => 'Enter cash refund',
446 acl => ['Post refund', 'Post cash refund'],
449 # label => 'Record manual (offline/POS) credit card refund',
450 # popup => "edit/cust_refund.cgi?popup=1;payby=MCRD;custnum=$custnum",
451 # actionlabel => 'Enter credit card refund',
453 # acl => ['Post refund' ],
454 ## condition => sub { $payby{MCRD} },
457 # label => 'Record manual (offline/POS) electronic check refund',
458 # popup => "edit/cust_refund.cgi?popup=1;payby=MCHK;custnum=$custnum",
459 # actionlabel => 'Enter electronic check refund',
461 # acl => ['Post refund' ],
462 ## condition => sub { $payby{MCHK} },
465 label => 'Enter electronic check refund',
466 popup => "edit/cust_refund.cgi?popup=1;payby=CHEK;custnum=$custnum",
467 actionlabel => 'Enter electronic check refund',
469 acl => ['Post refund' ],
481 label => 'Add tax adjustment',
482 popup => "edit/cust_tax_adjustment.html?custnum=$custnum",
483 actionlabel => 'Add tax adjustment',
485 confexists => 'enable_tax_adjustments',
486 acl => 'Add customer tax adjustment',
491 confexists => 'enable_tax_adjustments',
492 acl => 'Add customer tax adjustment',
496 label => 'Email statement to this customer',
498 my $cust_main = shift;
499 my $agentnum = $cust_main->agentnum;
500 'misc/email-customer-statement.html?table=cust_main;'.
501 'agent_virt_agentnum='.$agentnum.";custnum=$custnum;url=".
502 uri_escape($cgi->self_url);
504 condition => sub { $invoicing_list_emailonly },
505 acl => 'Resend invoices',
508 label => 'Download PDF statement',
509 url => "view/cust_main_statement-pdf.cgi?$custnum",
510 acl => 'View legacy typeset statements',
512 FS::cust_bill->count('custnum = ?', shift->custnum) > 0
516 label => 'Search invoices',
517 url => "search/report_cust_bill.html?custnum=$custnum",
518 acl => 'List invoices',
521 label => 'View tax exemptions',
522 url => "search/cust_tax_exempt_pkg.cgi?custnum=$custnum",
523 acl => 'View customer tax exemptions',
526 label => 'View tax adjustments',
527 url => "search/cust_tax_adjustment.html?custnum=$custnum",
528 confexists => 'enable_tax_adjustments',
529 acl => 'Add customer tax adjustment',
532 label => 'View pending payments',
533 url => "search/cust_pay_pending.html?magic=_date;statusNOT=done;custnum=$custnum",
534 acl => 'View pending payments',
536 FS::cust_pay_pending->count('custnum = ?', shift->custnum) > 0
543 label => 'Change History',
544 show => 'change_history',
545 acl => 'View customer history',