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 = grep /\w/, $conf->config('payby');
87 @payby = (qw( CARD DCRD CHEK DCHK ))
89 my %payby = map { $_ => 1 } @payby;
91 # cached for conditions, to avoid looking it up twice
92 my $invoicing_list_emailonly = $cust_main->invoicing_list_emailonly;
94 # nice declarative menu; a parameter to some kind of menu generator
101 label => 'Edit customer',
102 url => "edit/cust_main.cgi?$custnum",
103 acl => 'Edit customer'
106 label => 'Edit contacts',
107 url => "edit/cust_main-contacts.html?$custnum",
116 acl => 'Bill customer now',
117 content => sub { include( '/elements/bill.html',
118 label => emt('Bill now'),
119 url => $cgi->self_url,
120 custnum => shift->custnum,
126 popup => "misc/suspend_cust.html?custnum=$custnum",
127 acl => 'Suspend customer',
128 condition => sub { shift->unsuspended_pkgs > 0 },
129 actionlabel => 'Confirm Suspension',
133 label => 'Unsuspend',
134 popup => "misc/unsuspend_cust.html?custnum=$custnum",
135 acl => 'Unsuspend customer',
136 condition => sub { shift->suspended_pkgs > 0 },
137 actionlabel => 'Confirm Unsuspension',
141 popup => "misc/cancel_cust.html?custnum=$custnum",
142 acl => 'Cancel customer',
143 condition => sub { shift->ncancelled_pkgs > 0 },
144 actionlabel => 'Confirm Cancellation',
149 popup => "misc/merge_cust.html?custnum=$custnum",
150 acl => 'Merge customer',
151 actionlabel => 'Merge customer',
156 label => 'Refer a new customer',
157 url => "edit/cust_main.cgi?referral_custnum=$custnum",
158 confexists => '!disable_customer_referrals',
166 label => 'View this customer\'s referrals',
167 url => "search/cust_main.cgi?referral_custnum=$custnum",
168 confexists => '!disable_customer_referrals',
170 FS::cust_main->count('referral_custnum = ?', shift->custnum) > 0
174 label => 'View billing events',
175 url => "search/cust_event.html?custnum=$custnum",
176 acl => [ 'Billing event reports',
177 'View customer billing events' ],
180 label => 'Test billing events',
181 url => "misc/test-part_event.html?custnum=$custnum",
182 acl => 'Configuration',
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} },
463 label => 'Batch Electronic check refund',
464 popup => "edit/cust_refund.cgi?popup=1;payby=CHEK;custnum=$custnum",
465 actionlabel => 'Enter electronic check refund',
467 acl => ['Post refund' ],
479 label => 'Add tax adjustment',
480 popup => "edit/cust_tax_adjustment.html?custnum=$custnum",
481 actionlabel => 'Add tax adjustment',
483 confexists => 'enable_tax_adjustments',
484 acl => 'Add customer tax adjustment',
489 confexists => 'enable_tax_adjustments',
490 acl => 'Add customer tax adjustment',
494 label => 'Email statement to this customer',
496 my $cust_main = shift;
497 my $agentnum = $cust_main->agentnum;
498 'misc/email-customer-statement.html?table=cust_main;'.
499 'agent_virt_agentnum='.$agentnum.";custnum=$custnum;url=".
500 uri_escape($cgi->self_url);
502 condition => sub { $invoicing_list_emailonly },
503 acl => 'Resend invoices',
506 label => 'Download PDF statement',
507 url => "view/cust_main_statement-pdf.cgi?$custnum",
508 acl => 'View legacy typeset statements',
510 FS::cust_bill->count('custnum = ?', shift->custnum) > 0
514 label => 'Search invoices',
515 url => "search/report_cust_bill.html?custnum=$custnum",
516 acl => 'List invoices',
519 label => 'View tax exemptions',
520 url => "search/cust_tax_exempt_pkg.cgi?custnum=$custnum",
521 acl => 'View customer tax exemptions',
524 label => 'View tax adjustments',
525 url => "search/cust_tax_adjustment.html?custnum=$custnum",
526 confexists => 'enable_tax_adjustments',
527 acl => 'Add customer tax adjustment',
530 label => 'View pending payments',
531 url => "search/cust_pay_pending.html?magic=_date;statusNOT=done;custnum=$custnum",
532 acl => 'View pending payments',
534 FS::cust_pay_pending->count('custnum = ?', shift->custnum) > 0
541 label => 'Change History',
542 show => 'change_history',
543 acl => 'View customer history',