X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fpackages%2Fpackage.html;h=ce175a27ec8104daa69006327eadee7af21d6239;hb=8c842e33466e953710168bb65c2bbb5765dc537f;hp=ab7bad2bfcb770f7936373a78c4a45e57cbe6bd2;hpb=e91ed1c4a81c25757f812b3ec8238645b836b235;p=freeside.git diff --git a/httemplate/view/cust_main/packages/package.html b/httemplate/view/cust_main/packages/package.html index ab7bad2bf..ce175a27e 100644 --- a/httemplate/view/cust_main/packages/package.html +++ b/httemplate/view/cust_main/packages/package.html @@ -1,96 +1,63 @@ -
<% $opt{before_pkg_callback} ? &{ $opt{before_pkg_callback} }( $cust_pkg ) : '' %> + +% ### +% # Package +% ### <% $opt{show_pkgnum} ? $cust_pkg->pkgnum.': ' : '' %><% $part_pkg->pkg |h %> -% my $custom_comment = $part_pkg->custom_comment('cust_pkg'=>$cust_pkg); - <% $custom_comment ? ' - ' : '' %> - <% $custom_comment |h %> - | -||||
-
-
-% if ( $part_pkg->freq eq '0' and !$opt{no_links} ) {
-% # One-time charge. Nothing you can do with this, unless:
-% if ( $curuser->access_right('Modify one-time charge') ) {
- ( <%onetime_change_link($cust_pkg)%> )
- -% } % -% } elsif ( !$cust_pkg->get('cancel') and !$opt{no_links} ) { +% my $custom_comment; +% if ( 0 && FS::part_pkg::flat->can('price_info') eq $part_pkg->can('price_info') ) { +% #perf hack / disabled in 4.x (feature pricing / cust_pkg_usageprice incompatible, well, harder) % -% if ( $change_from ) { -% # This is the target package for a future change. -% # Nothing you can do with it besides modify/cancel the -% # future change, and that's on the current package. -% } elsif ( $supplemental ) { -% # Supplemental packages can't be changed independently. -% # Show only "Add comments" and "Add invoice details". -% } else { -% # the usual case: links to change package definition, -% # discount, and customization -% my $br = 0; -% if ( $curuser->access_right('Change customer package') ) { -% $br=1; - ( <%pkg_change_link($cust_pkg)%> ) -% } -% -% if ( $curuser->access_right('Discount customer package') -% && $part_pkg->can_discount -% && ! scalar($cust_pkg->cust_pkg_discount_active) -% && ! scalar($cust_pkg->part_pkg->part_pkg_discount) -% ) -% { -% $br=1; - ( <%pkg_discount_link($cust_pkg)%> ) -% } +% $part_pkg->{"_$_"} = $part_pkg->option($_) || 0 +% foreach grep !defined($part_pkg->{"_$_"} ), qw(setup_fee recur_fee); +% +% my $str = ''; +% $str = $opt{money_char} . $part_pkg->{_setup_fee}. +% ($part_pkg->{_recur_fee} ? ' setup' : ' one-time') +% if $part_pkg->{_setup_fee}; +% $str .= ', ' if $part_pkg->{_setup_fee} && $part_pkg->{_recur_fee}; +% $str .= $opt{money_char}. $part_pkg->{_recur_fee}. +% '/'. $part_pkg->freq_pretty +% if $part_pkg->{_recur_fee}; +% $str; % -% if ( $curuser->access_right('Customize customer package') ) { -% $br=1; - ( <%pkg_customize_link($cust_pkg,$part_pkg)%> ) -% } +% $custom_comment = +% ( $part_pkg->custom ? '(CUSTOM) ' : '' ). +% $part_pkg->comment. +% ( ($part_pkg->custom || $part_pkg->comment) ? ' - ' : '' ). +% ($str || 'No charge'); % - <% $br ? ' ' : '' %> -% } - -% if ( ( $curuser->access_right('Billing event reports') -% || $curuser->access_right('View customer billing events') -% ) -% && $cust_pkg->num_cust_event -% ) { - ( <%pkg_event_link($cust_pkg)%> ) -% } -% } #!$supplemental - - +% } else { +% $custom_comment = $part_pkg->custom_comment('cust_pkg'=>$cust_pkg); +% } + <% $custom_comment ? ' - ' : '' %> + <% $custom_comment |h %> |
||||
- -% my $change_quan_label = 'Change quantity'; -% if ( $cust_pkg->quantity > 1 ) { -% $change_quan_label = 'change'; <% mt('Quantity:') |h %> <% $cust_pkg->quantity %> -% } % if ( $curuser->access_right('Change customer package') % && ! $cust_pkg->get('cancel') +% && ! $change_from % && ! $supplemental % && $part_pkg->freq ne '0' % && ! $opt{no_links} @@ -98,40 +65,41 @@ % ) % { - ( <% pkg_change_quantity_link($cust_pkg, $change_quan_label) %> ) + ( <% pkg_change_quantity_link($cust_pkg, 'change') %> ) % } - | ||||
- -% my $change_sales_label = 'Change sales person'; -% if ( $cust_pkg->salesnum ) { -% $change_sales_label = 'change'; <% mt('Sales Person:') |h %> <% $cust_pkg->salesperson |h %> -% } - % if ( $curuser->access_right('Change customer package') % && ! $cust_pkg->get('cancel') +% && ! $change_from % && ! $supplemental % #&& $part_pkg->freq ne '0' % && ! $opt{no_links} % ) % { - ( <% pkg_change_salesnum_link($cust_pkg, $change_sales_label) %> ) + ( <% pkg_change_salesnum_link($cust_pkg, 'change') %> ) % } - | -% if ( $editi && ! $cust_pkg->get('cancel') && ! $opt{no_links} ) { - - ( <% include('/elements/popup_link.html', { - 'action' => $editlink. 'I', - 'label' => emt('Add invoice details'), - 'actionlabel' => emt('Add invoice details'), - 'color' => '#333399', - 'width' => 763, - }) - %> ) - -% } | % } @@ -218,18 +174,6 @@ % } else {-% if ( $editc && ! $opt{no_links} ) { - - ( <& /elements/popup_link.html, { - 'action' => $editlink. 'C', - 'label' => emt('Add comments'), - 'actionlabel' => emt('Add comments'), - 'color' => '#333399', - 'width' => 763, - } - &> ) - -% } | % } @@ -241,7 +185,7 @@ % if ( @cust_pkg_usage ) {
<% mt('Included usage') %> | ||||
---|---|---|---|---|
<% emt('Included usage') %> | ||||
<% $part->description %>: | -ALIGN="right"><% $usage->minutes %> | +ALIGN="right"><% sprintf('%.1f', $usage->minutes) %> | > / | ><% $part->minutes %> | % if ( $part->shared ) { @@ -262,6 +206,144 @@
+ +% my $plink = "pkgnum=$pkgnum"; +% my $reg_recur_cond = sub { $part_pkg->freq ne '0' +% && ! $change_from +% && ! $supplemental +% && ! $cust_pkg->get('cancel') +% }; + + <& /elements/dropdown-menu.html, + id => 'cust_pkg'. $cust_pkg->pkgnum. '_menu', + bgcolor => $opt{row} % 2 ? '#ffffff' : '#eeeeee', + menu => [ + [ + + #TODO: order/group these better + + { label => 'Package actions', + content => 'Package actions ', + }, + + { label => 'Modify one-time charge', + acl => 'Modify one-time charge', + condition => sub { $part_pkg->freq eq '0' }, + url => "edit/quick-charge.html?change_$plink", + }, + + { label => 'Change package', + acl => 'Change customer package', + condition => $reg_recur_cond, + popup => "misc/change_pkg.cgi?$plink". + ';locationnum='. $cust_pkg->locationnum. + actionlabel => emt('Change package'), + #width => 768, + width => 960, + height => 538, + }, + + { label => 'Discount package', + condition => sub { $part_pkg->freq ne '0' + && ! $change_from + && ! $supplemental + && ! $cust_pkg->get('cancel') + && $can_discount_pkg + }, + popup => "edit/cust_pkg_discount.html?$plink". + actionlabel => emt('Discount package'), + width => 616, + }, + + { label => 'Customize package', + acl => 'Customize customer package', + condition => $reg_recur_cond, + url => "edit/part_pkg.cgi?$plink". + ';clone='. $part_pkg->pkgpart, + }, + + { label => 'View package events', + acl => [ 'Billing event reports', + 'View customer billing events', ], + condition => sub { $cust_pkg->exists_cust_event }, + url => "search/cust_event.html?$plink", + }, + + { label => 'Change quantity', + acl => 'Change customer package', + condition => sub { $part_pkg->freq ne '0' + && ! $change_from + && ! $supplemental + && ! $cust_pkg->get('cancel') + && $opt{'invoice-unitprice'} + }, + popup => "edit/cust_pkg_quantity.html?$plink", + + actionlabel => emt('Change quantity'), + width => 390, + height => 220, + }, + + { label => 'Change sales person', + acl => 'Change customer package', + condition => sub { ! $change_from + && ! $supplemental + && ! $cust_pkg->get('cancel') + }, + popup => "edit/cust_pkg_salesnum.html?$plink", + actionlabel => emt('Change sales persion'), + width => 390, + height => 220, + }, + + { label => (@invoice_detail ? 'Edit' : 'Add'). + ' invoice details', + acl => 'Edit customer package invoice details', + condition => sub { ! $cust_pkg->get('cancel') }, + popup => "edit/cust_pkg_detail.html?$plink". + ';detailtype=I', + actionlabel => emt( (@invoice_detail ? 'Edit' : 'Add'). + ' invoice details' + ), + width => 768, + }, + + { label => (@comments ? 'Edit' : 'Add'). ' comments', + acl => 'Edit customer package comments', + popup => "edit/cust_pkg_detail.html?$plink". + ';detailtype=C', + actionlabel => emt( (@comments ? 'Edit' : 'Add'). + ' comments' + ), + width => 768, + }, + + { label => '-', + content => '-', + }, + + + ], + ], + &> + + | +