diff options
author | Mark Wells <mark@freeside.biz> | 2015-04-25 15:02:15 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2015-04-25 15:02:23 -0700 |
commit | c110da0da864245e47cae019b8a347367cc6430c (patch) | |
tree | e406be890446095b8cd59a5b5c827c62dd063fff /FS/FS/ClientAPI/MasonComponent.pm | |
parent | 4fda726fa9f8e709c68ec823edc5ae702723281c (diff) |
selfservice quotations, #33852
Diffstat (limited to 'FS/FS/ClientAPI/MasonComponent.pm')
-rw-r--r-- | FS/FS/ClientAPI/MasonComponent.pm | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/FS/FS/ClientAPI/MasonComponent.pm b/FS/FS/ClientAPI/MasonComponent.pm index 695b4ca..b6f8aa4 100644 --- a/FS/FS/ClientAPI/MasonComponent.pm +++ b/FS/FS/ClientAPI/MasonComponent.pm @@ -27,6 +27,7 @@ my %allowed_comps = map { $_=>1 } qw( my %session_comps = map { $_=>1 } qw( /elements/location.html /elements/tr-amount_fee.html + /elements/select-part_pkg.html /edit/cust_main/first_pkg/select-part_pkg.html ); @@ -106,6 +107,26 @@ my %session_callbacks = ( }, + '/elements/select-part_pkg.html' => sub { + my( $custnum, $argsref ) = @_; + my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } ) + or return "unknown custnum $custnum"; + + my $pkgpart = $cust_main->agent->pkgpart_hashref; + + #false laziness w/ edit/cust_main/first_pkg.html + my @first_svc = ( 'svc_acct', 'svc_phone' ); + + my @part_pkg = + grep { $pkgpart->{ $_->pkgpart } + || ( $_->agentnum && $_->agentnum == $cust_main->agentnum ) + } + qsearch( 'part_pkg', { 'disabled' => '' }, '', 'ORDER BY pkg' ); # case? + + push @$argsref, 'part_pkg' => \@part_pkg; + ''; + }, + ); my $outbuf; |