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;
69 <& /elements/dropdown-menu.html,
70 'id' => 'customer_menu',
71 #'class' => 'customer_submenu',
72 #XXX support installs outside /freeside in 4.x
73 'self_url' => "/freeside/view/cust_main.cgi?custnum=$custnum;show=",
75 'cust_main' => $cust_main,
76 'show' => $opt{'show'},
81 my $cust_main = $opt{'cust_main'};
82 my $custnum = $cust_main->custnum;
83 my $curuser = $FS::CurrentUser::CurrentUser;
84 my $conf = FS::Conf->new;
86 my %payby = map { $_ => 1 } $conf->config('payby');
88 # cached for conditions, to avoid looking it up twice
89 my $invoicing_list_emailonly = $cust_main->invoicing_list_emailonly;
91 # nice declarative menu; a parameter to some kind of menu generator
98 label => 'Edit customer',
99 url => "edit/cust_main.cgi?$custnum",
100 acl => 'Edit customer'
103 label => 'Edit contacts',
104 url => "edit/cust_main-contacts.html?$custnum",
113 acl => 'Bill customer now',
114 content => sub { include( '/elements/bill.html',
115 label => emt('Bill now'),
116 url => $cgi->self_url,
117 custnum => shift->custnum,
123 popup => "misc/suspend_cust.html?custnum=$custnum",
124 acl => 'Suspend customer',
125 condition => sub { shift->unsuspended_pkgs > 0 },
126 actionlabel => 'Confirm Suspension',
130 label => 'Unsuspend',
131 popup => "misc/unsuspend_cust.html?custnum=$custnum",
132 acl => 'Unsuspend customer',
133 condition => sub { shift->suspended_pkgs > 0 },
134 actionlabel => 'Confirm Unsuspension',
138 popup => "misc/cancel_cust.html?custnum=$custnum",
139 acl => 'Cancel customer',
140 condition => sub { shift->ncancelled_pkgs > 0 },
141 actionlabel => 'Confirm Cancellation',
146 popup => "misc/merge_cust.html?custnum=$custnum",
147 acl => 'Merge customer',
148 actionlabel => 'Merge customer',
153 label => 'Refer a new customer',
154 url => "edit/cust_main.cgi?referral_custnum=$custnum",
155 confexists => '!disable_customer_referrals',
163 label => 'View this customer\'s referrals',
164 url => "search/cust_main.cgi?referral_custnum=$custnum",
165 confexists => '!disable_customer_referrals',
167 FS::cust_main->count('referral_custnum = ?', shift->custnum) > 0
171 label => 'View billing events',
172 url => "search/cust_event.html?custnum=$custnum",
173 acl => [ 'Billing event reports',
174 'View customer billing events' ],
177 label => 'Email a notice to this customer',
179 my $cust_main = shift;
180 my $agentnum = $cust_main->agentnum;
181 'misc/email-customers.html?table=cust_main;'.
182 'agent_virt_agentnum='.$agentnum.";custnum=$custnum;url=".
183 uri_escape($cgi->self_url);
185 condition => sub { $invoicing_list_emailonly },
186 acl => 'Bulk send customer notices',
196 popup => "edit/cust_main_note.cgi?custnum=$custnum",
197 actionlabel => 'Add note',
198 confexists => '!cust_main-disable_notes',
199 acl => 'Add customer note',
204 label => 'Attach file',
205 popup => "edit/cust_main_attach.cgi?custnum=$custnum",
206 actionlabel => 'Upload file',
207 confexists => '!disable_cust_attachment',
208 acl => 'Add attachment',
217 confexists => 'ticket_system'
222 label => 'Appointments',
223 show => 'appointments',
224 confexists => 'ticket_system',
225 acl => 'View appointments',
228 label => 'Schedule new appointment',
229 confexists => 'ticket_system',
230 acl => 'Make appointment',
231 popup => "misc/make_appointment.html?custnum=$custnum",
232 actionlabel => 'Schedule appointment',
237 label => 'Quotations',
238 show => 'quotations',
241 label => 'Create new quotation',
242 url => "edit/quotation.html?custnum=$custnum",
243 acl => 'Generate quotation',
252 label => 'New qualification',
253 popup => "misc/qual.html?custnum=$custnum",
254 actionlabel => 'New qualification',
258 acl => 'Qualify service',
261 label => 'Order new package',
262 popup => "misc/order_pkg.html?custnum=$custnum",
263 actionlabel => 'Order new package',
267 acl => 'Order customer package',
270 # it's just a popup, but there's some freaky CCH tax stuff in it
271 label => 'One-time charge',
272 url => "edit/quick-charge.html?custnum=$custnum",
273 acl => 'One-time charge',
276 label => 'Move services between packages',
277 popup => "edit/bulk-cust_svc-pkgnum.html?custnum=$custnum",
278 actionlabel => 'Move services',
281 acl => 'Bulk move customer services',
284 label => 'Bulk order and cancel packages',
285 url => "edit/cust_pkg.cgi?$custnum",
286 acl => 'Bulk change customer packages',
294 label => 'Package reports',
295 url => "search/report_cust_pkg.html?custnum=$custnum",
298 label => 'View qualifications',
299 url => "search/qual.cgi?custnum=$custnum",
300 acl => 'Qualify service',
303 label => 'View accounts',
304 url => "search/report_svc_acct.html?custnum=$custnum",
307 label => 'View data usage',
308 popup => "search/report_sqlradius_usage-custnum.html?$custnum",
309 acl => 'Usage: RADIUS sessions',
310 actionlabel => 'Data usage report',
313 condition => sub { shift->num_usage_pkgs > 0 },
316 label => 'View CDRs',
317 url => "search/report_cdr.html?custnum=$custnum",
318 # XXX should have a condition that the customer has any CDR packages
323 label => 'Payment History',
324 show => 'payment_history',
327 # manual payment entry via edit/cust_pay
328 { label => 'Enter payment',
331 label => 'Enter check payment',
332 popup => "edit/cust_pay.cgi?popup=1;payby=BILL;custnum=$custnum",
333 actionlabel => 'Enter check payment',
336 acl => [ 'Post payment', 'Post check payment' ],
339 label => 'Enter cash payment',
340 popup => "edit/cust_pay.cgi?popup=1;payby=CASH;custnum=$custnum",
341 actionlabel => 'Enter cash payment',
344 acl => [ 'Post payment', 'Post cash payment' ],
347 # label => 'Enter Western Union payment',
348 # popup => "edit/cust_pay.cgi?popup=1;payby=WEST;custnum=$custnum",
349 # actionlabel => 'Enter Western Union payment',
352 # acl => [ 'Post payment', ],
353 ## condition => sub { $payby{WEST} },
356 # label => 'Record manual (offline/POS) credit card payment',
357 # popup => "edit/cust_pay.cgi?popup=1;payby=MCRD;custnum=$custnum",
358 # actionlabel => 'Enter credit card payment',
361 # acl => [ 'Post payment', ],
362 ## condition => sub { $payby{MCRD} },
365 # label => 'Record manual (offline/POS) electronic check',
366 # popup => "edit/cust_pay.cgi?popup=1;payby=MCHK;custnum=$custnum",
367 # actionlabel => 'Enter credit card payment',
370 # acl => [ 'Post payment', ],
371 ## condition => sub { $payby{MCHK} },
376 # realtime payments via payment.cgi
377 { label => 'Process payment',
380 label => 'Process credit card payment',
381 url => "misc/payment.cgi?payby=CARD;custnum=$custnum",
382 acl => [ 'Process payment', 'Process credit card payment', ],
383 condition => sub { $payby{CARD} or $payby{DCRD} },
386 label => 'Process electronic check payment',
387 url => "misc/payment.cgi?payby=CHEK;custnum=$custnum",
388 acl => [ 'Process payment', 'Process Echeck payment', ],
389 condition => sub { $payby{CHEK} or $payby{DCHK} },
399 label => 'Enter credit',
400 popup => "edit/cust_credit.cgi?custnum=$custnum",
401 actionlabel => 'Enter credit',
403 acl => 'Post credit',
406 label => 'Credit line items',
407 popup => "edit/credit-cust_bill_pkg.html?custnum=$custnum",
408 actionlabel => 'Credit line items',
411 acl => 'Credit line items',
413 FS::cust_bill->count('custnum = ?', shift->custnum) > 0
421 { label => 'Enter refund',
425 label => 'Enter check refund',
426 popup => "edit/cust_refund.cgi?popup=1;payby=BILL;custnum=$custnum",
427 actionlabel => 'Enter check refund',
429 acl => ['Post refund', 'Post check refund'],
432 label => 'Enter cash refund',
433 popup => "edit/cust_refund.cgi?popup=1;payby=CASH;custnum=$custnum",
434 actionlabel => 'Enter cash refund',
436 acl => ['Post refund', 'Post cash refund'],
439 # label => 'Record manual (offline/POS) credit card refund',
440 # popup => "edit/cust_refund.cgi?popup=1;payby=MCRD;custnum=$custnum",
441 # actionlabel => 'Enter credit card refund',
443 # acl => ['Post refund' ],
444 ## condition => sub { $payby{MCRD} },
447 # label => 'Record manual (offline/POS) electronic check refund',
448 # popup => "edit/cust_refund.cgi?popup=1;payby=MCHK;custnum=$custnum",
449 # actionlabel => 'Enter electronic check refund',
451 # acl => ['Post refund' ],
452 ## condition => sub { $payby{MCHK} },
464 label => 'Add tax adjustment',
465 popup => "edit/cust_tax_adjustment.html?custnum=$custnum",
466 actionlabel => 'Add tax adjustment',
468 confexists => 'enable_tax_adjustments',
469 acl => 'Add customer tax adjustment',
474 confexists => 'enable_tax_adjustments',
475 acl => 'Add customer tax adjustment',
479 label => 'Email statement to this customer',
481 my $cust_main = shift;
482 my $agentnum = $cust_main->agentnum;
483 'misc/email-customer-statement.html?table=cust_main;'.
484 'agent_virt_agentnum='.$agentnum.";custnum=$custnum;url=".
485 uri_escape($cgi->self_url);
487 condition => sub { $invoicing_list_emailonly },
488 acl => 'Resend invoices',
491 label => 'Download PDF statement',
492 url => "view/cust_main_statement-pdf.cgi?$custnum",
493 acl => 'View legacy typeset statements',
495 FS::cust_bill->count('custnum = ?', shift->custnum) > 0
499 label => 'Search invoices',
500 url => "search/report_cust_bill.html?custnum=$custnum",
501 acl => 'List invoices',
504 label => 'View tax exemptions',
505 url => "search/cust_tax_exempt_pkg.cgi?custnum=$custnum",
506 acl => 'View customer tax exemptions',
509 label => 'View tax adjustments',
510 url => "search/cust_tax_adjustment.html?custnum=$custnum",
511 confexists => 'enable_tax_adjustments',
512 acl => 'Add customer tax adjustment',
515 label => 'View pending payments',
516 url => "search/cust_pay_pending.html?magic=_date;statusNOT=done;custnum=$custnum",
517 acl => 'View pending payments',
519 FS::cust_pay_pending->count('custnum = ?', shift->custnum) > 0
526 label => 'Change History',
527 show => 'change_history',
528 acl => 'View customer history',