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} },
384 label => 'Record manual (non-Freeside) Paypal payment',
385 popup => "edit/cust_pay.cgi?popup=1;payby=PPAL;custnum=$custnum",
386 actionlabel => 'Enter Paypal payment',
389 acl => [ 'Post Payment', 'Post Paypal payment', ],
390 condition => sub { $payby{PPAL} },
395 # realtime payments via payment.cgi
396 { label => 'Process payment',
399 label => 'Process credit card payment',
400 url => "misc/payment.cgi?payby=CARD;custnum=$custnum",
401 acl => [ 'Process payment', 'Process credit card payment', ],
402 condition => sub { $payby{CARD} or $payby{DCRD} },
405 label => 'Process electronic check payment',
406 url => "misc/payment.cgi?payby=CHEK;custnum=$custnum",
407 acl => [ 'Process payment', 'Process Echeck payment', ],
408 condition => sub { $payby{CHEK} or $payby{DCHK} },
418 label => 'Enter credit',
419 popup => "edit/cust_credit.cgi?custnum=$custnum",
420 actionlabel => 'Enter credit',
422 acl => 'Post credit',
425 label => 'Credit line items',
426 popup => "edit/credit-cust_bill_pkg.html?custnum=$custnum",
427 actionlabel => 'Credit line items',
430 acl => 'Credit line items',
432 FS::cust_bill->count('custnum = ?', shift->custnum) > 0
440 { label => 'Enter refund',
444 label => 'Enter check refund',
445 popup => "edit/cust_refund.cgi?popup=1;payby=BILL;custnum=$custnum",
446 actionlabel => 'Enter check refund',
448 acl => ['Post refund', 'Post check refund'],
451 label => 'Enter cash refund',
452 popup => "edit/cust_refund.cgi?popup=1;payby=CASH;custnum=$custnum",
453 actionlabel => 'Enter cash refund',
455 acl => ['Post refund', 'Post cash refund'],
458 # label => 'Record manual (offline/POS) credit card refund',
459 # popup => "edit/cust_refund.cgi?popup=1;payby=MCRD;custnum=$custnum",
460 # actionlabel => 'Enter credit card refund',
462 # acl => ['Post refund' ],
463 ## condition => sub { $payby{MCRD} },
466 # label => 'Record manual (offline/POS) electronic check refund',
467 # popup => "edit/cust_refund.cgi?popup=1;payby=MCHK;custnum=$custnum",
468 # actionlabel => 'Enter electronic check refund',
470 # acl => ['Post refund' ],
471 ## condition => sub { $payby{MCHK} },
474 label => 'Enter electronic check refund',
475 popup => "edit/cust_refund.cgi?popup=1;payby=CHEK;custnum=$custnum",
476 actionlabel => 'Enter electronic check refund',
478 acl => ['Post refund' ],
480 FS::pay_batch->can_handle_electronic_refunds
493 label => 'Add tax adjustment',
494 popup => "edit/cust_tax_adjustment.html?custnum=$custnum",
495 actionlabel => 'Add tax adjustment',
497 confexists => 'enable_tax_adjustments',
498 acl => 'Add customer tax adjustment',
503 confexists => 'enable_tax_adjustments',
504 acl => 'Add customer tax adjustment',
508 label => 'Email statement to this customer',
510 my $cust_main = shift;
511 my $agentnum = $cust_main->agentnum;
512 'misc/email-customer-statement.html?table=cust_main;'.
513 'agent_virt_agentnum='.$agentnum.";custnum=$custnum;url=".
514 uri_escape($cgi->self_url);
516 condition => sub { $invoicing_list_emailonly },
517 acl => 'Resend invoices',
520 label => 'Download PDF statement',
521 url => "view/cust_main_statement-pdf.cgi?$custnum",
522 acl => 'View legacy typeset statements',
524 FS::cust_bill->count('custnum = ?', shift->custnum) > 0
528 label => 'Search invoices',
529 url => "search/report_cust_bill.html?custnum=$custnum",
530 acl => 'List invoices',
533 label => 'View tax exemptions',
534 url => "search/cust_tax_exempt_pkg.cgi?custnum=$custnum",
535 acl => 'View customer tax exemptions',
538 label => 'View tax adjustments',
539 url => "search/cust_tax_adjustment.html?custnum=$custnum",
540 confexists => 'enable_tax_adjustments',
541 acl => 'Add customer tax adjustment',
544 label => 'View pending payments',
545 url => "search/cust_pay_pending.html?magic=_date;statusNOT=done;custnum=$custnum",
546 acl => 'View pending payments',
548 FS::cust_pay_pending->count('custnum = ?', shift->custnum) > 0
555 label => 'Change History',
556 show => 'change_history',
557 acl => 'View customer history',