diff options
author | Ivan Kohler <ivan@freeside.biz> | 2015-10-23 16:17:51 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2015-10-23 16:17:51 -0700 |
commit | 80c2d997c5c983344c530ecbb46f94f1c299b35f (patch) | |
tree | 28bafc1d55836acb5455e6554941c06f0912ef98 /httemplate/view | |
parent | 3b1a5e8789d76f0581079d07190664f57bd773a3 (diff) | |
parent | 0806f9fdbf2086671c151b3bcb078dc008e96f6c (diff) |
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'httemplate/view')
-rwxr-xr-x | httemplate/view/cust_main/packages.html | 1 | ||||
-rw-r--r-- | httemplate/view/cust_main/packages/package.html | 31 | ||||
-rw-r--r-- | httemplate/view/cust_main/packages/status.html | 31 | ||||
-rwxr-xr-x | httemplate/view/quotation.html | 18 |
4 files changed, 56 insertions, 25 deletions
diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html index 4903e185b..0c67843d4 100755 --- a/httemplate/view/cust_main/packages.html +++ b/httemplate/view/cust_main/packages.html @@ -42,6 +42,7 @@ table.hiddenrows { z-index: 1; text-align: center; } + </STYLE> % # activate rolldown buttons for hidden package blocks <SCRIPT TYPE="text/javascript"> diff --git a/httemplate/view/cust_main/packages/package.html b/httemplate/view/cust_main/packages/package.html index 8aa64039c..e98b95e1c 100644 --- a/httemplate/view/cust_main/packages/package.html +++ b/httemplate/view/cust_main/packages/package.html @@ -53,10 +53,7 @@ ( <%onetime_change_link($cust_pkg)%> ) % } % # also, you can discount it -% if ( $curuser->access_right('Discount customer package') -% && ! scalar($cust_pkg->cust_pkg_discount_active) -% && ! scalar($cust_pkg->part_pkg->part_pkg_discount) -% ) { +% if ( $can_discount_pkg ) { ( <%pkg_discount_link($cust_pkg)%> ) % } <BR> @@ -79,14 +76,7 @@ ( <%pkg_change_link($cust_pkg)%> ) % } % -% if ( $curuser->access_right('Discount customer package') -% && $part_pkg->can_discount -% && ! scalar( @{ $cust_pkg->{_cust_pkg_discount_active} } ) -% && ( ! $opt{'term_discounts'} -% || ! scalar($cust_pkg->part_pkg->part_pkg_discount) -% ) -% ) -% { +% if ( $can_discount_pkg ) { % $br=1; ( <%pkg_discount_link($cust_pkg)%> ) % } @@ -437,4 +427,21 @@ sub pkg_event_link { '</a>'; } +# figure out if this user will be able to edit either the setup or recurring +# discounts for this package +my $can_discount_pkg = ( + $part_pkg->can_discount + and + ( ( $curuser->access_right(['Discount customer package', 'Waive setup fee']) + and $cust_pkg->base_setup > 0 + and !$cust_pkg->setup + ) + or + ( $curuser->access_right('Discount customer package') + and $cust_pkg->base_recur > 0 + and $cust_pkg->freq ne '0' + ) + ) +); + </%init> diff --git a/httemplate/view/cust_main/packages/status.html b/httemplate/view/cust_main/packages/status.html index 7e125f72e..13bd2024b 100644 --- a/httemplate/view/cust_main/packages/status.html +++ b/httemplate/view/cust_main/packages/status.html @@ -461,10 +461,11 @@ sub pkg_status_row_changed { my $part_pkg = $old->part_pkg; $html .= pkg_status_row_colspan( $cust_pkg, - emt("Changed from [_1]: [_2]", - $cust_pkg->change_pkgnum, - $part_pkg->pkg_comment(cust_pkg=>$old, nopartpkg=>1) - ), +# emt("Changed from [_1]: [_2]", +# $cust_pkg->change_pkgnum, +# $part_pkg->pkg_comment(cust_pkg=>$old, nopartpkg=>1) +# ), + '', '', 'size' => '-1', 'align' => 'right', @@ -529,17 +530,25 @@ sub pkg_status_row_discount { my $discount = $cust_pkg_discount->discount; - my $label = '<B>'.emt('Discount').'</B>: '. $discount->description; - if ( $discount->months ) { + my $label = '<SPAN STYLE="font-size: small"><B>'; + if ( $cust_pkg_discount->setuprecur eq 'setup' ) { + $label .= emt('Setup Discount'); + } else { + $label .= emt('Recurring Discount'); + } + $label .= '</B>: '. $discount->description; + warn Dumper $cust_pkg_discount; + if ( $discount->months > 0 and $cust_pkg_discount->months_used > 0 ) { my $remaining = $discount->months - $cust_pkg_discount->months_used; $remaining = sprintf('%.2f', $remaining) if $remaining =~ /\./; - $label .= emt("([_1] months remaining)",$remaining); + $label .= <br> . emt("([_1] months remaining)",$remaining); } + $label .= '</SPAN>'; - $label .= ' <FONT SIZE="-1">('. - '<A HREF="../misc/delete-cust_pkg_discount.html?'. - $cust_pkg_discount->pkgdiscountnum. - '">'.emt('remove discount').'</A>)</FONT>'; + #$label .= ' <FONT SIZE="-1">('. + # '<A HREF="../misc/delete-cust_pkg_discount.html?'. + # $cust_pkg_discount->pkgdiscountnum. + # '">'.emt('remove discount').'</A>)</FONT>'; $html .= pkg_status_row_colspan( $cust_pkg, $label, '', %opt ); diff --git a/httemplate/view/quotation.html b/httemplate/view/quotation.html index 67609a1c6..18625095e 100755 --- a/httemplate/view/quotation.html +++ b/httemplate/view/quotation.html @@ -91,6 +91,8 @@ my $curuser = $FS::CurrentUser::CurrentUser; #die "access denied" # unless $curuser->access_right('View quotations'); +my $can_generate_quotation = $curuser->access_right('Generate quotation'); + my $quotationnum; my($query) = $cgi->keywords; if ( $query =~ /^(\d+)$/ ) { @@ -119,11 +121,23 @@ my $link = "quotationnum=$quotationnum"; #$link .= ';notice_name='. $notice_name if $notice_name; my $preref_callback = sub { - areyousure_link("${p}misc/delete-quotation_pkg.html?". shift->quotationpkgnum, + my $quotation_pkg = shift; + $can_generate_quotation ? + areyousure_link("${p}misc/delete-quotation_pkg.html?". $quotation_pkg->quotationpkgnum, emt('Are you sure you want to remove this package from the quotation?'), emt('Remove this package'), #tooltip qq(<img src="${p}images/cross.png">), #link - ); + ) . + include('/elements/popup_link.html', + action => "${p}edit/quotation_pkg_detail.html?pkgnum=" . + $quotation_pkg->quotationpkgnum, + html_label => qq(<IMG SRC="${p}images/Actions-document-edit-icon.png">), + title => emt('Edit quotation details'), + actionlabel => emt('Edit quotation details'), + color => '#333399', + width => 763, + ) + : ''; }; sub areyousure_link { |