X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fpackages%2Fpackage.html;h=5d93ad46f17832aa5528ea5c70f1cbce82c0601f;hb=bdd45384ec9688d44f0225aff5a22be53a55ed68;hp=280a01682b7df5aa7462c3e133042f4cbcfeebc9;hpb=04a69f9d197efee6fa396bd35d04ae553e669978;p=freeside.git diff --git a/httemplate/view/cust_main/packages/package.html b/httemplate/view/cust_main/packages/package.html index 280a01682..5d93ad46f 100644 --- a/httemplate/view/cust_main/packages/package.html +++ b/httemplate/view/cust_main/packages/package.html @@ -1,4 +1,4 @@ - + @@ -36,6 +36,16 @@ ( <%pkg_dates_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)%> ) +% } +% % if ( $curuser->access_right('Customize customer package') ) { % $br=1; ( <%pkg_customize_link($cust_pkg,$part_pkg)%> ) @@ -64,27 +74,27 @@ % % if ( scalar(@invoice_detail) || scalar(@comments) || $editi || $editc ) { % -% my $editlink = $p. 'edit/cust_pkg_detail?pkgnum='. $cust_pkg->pkgnum. +% my $editlink = $p. 'edit/cust_pkg_detail.html?pkgnum='. $cust_pkg->pkgnum. % ';detailtype='; % if ( @invoice_detail ) { @@ -102,8 +112,8 @@ ( <% include('/elements/popup_link.html', { 'action' => $editlink. 'I', - 'label' => 'Add invoice details', - 'actionlabel' => 'Add invoice details', + 'label' => emt('Add invoice details'), + 'actionlabel' => emt('Add invoice details'), 'color' => '#333399', 'width' => 763, }) @@ -115,20 +125,20 @@ % if ( @comments ) { @@ -144,22 +154,30 @@ % } +% if ( $curuser->access_right('Change customer package') and +% !$cust_pkg->get('cancel') and +% !$opt{'show_location'}) { + + + +% } % } -
@@ -13,7 +13,7 @@ % if ( $cust_pkg->quantity > 1 ) {
-       Quantity: +       <% mt('Quantity:') |h %> <% $cust_pkg->quantity %>
- <% include('/elements/table-grid.html') %> + <& /elements/table-grid.html &>
- Invoice details + <% mt('Invoice details') |h %> % if ( $editi && ! $cust_pkg->get('cancel') ) { - (<% include('/elements/popup_link.html', { + (<& /elements/popup_link.html, { 'action' => $editlink. 'I', - 'label' => 'edit', - 'actionlabel' => 'Edit invoice details', + 'label' => emt('edit'), + 'actionlabel' => emt('Edit invoice details'), 'color' => '#333399', 'width' => 763, - }) - %>) + } + &>) % } - <% include('/elements/table-grid.html') %> + <& /elements/table-grid.html &>
- Comments + <% mt('Comments') |h %> % if ( $editc ) { - (<% include('/elements/popup_link.html', { + (<& /elements/popup_link.html, { 'action' => $editlink. 'C', - 'label' => 'edit', - 'actionlabel' => 'Edit comments', + 'label' => emt('edit'), + 'actionlabel' => emt('Edit comments'), 'color' => '#333399', 'width' => 763, - }) - %>) + } + &>) % } % if ( $editc ) { - ( <% include('/elements/popup_link.html', { + ( <& /elements/popup_link.html, { 'action' => $editlink. 'C', - 'label' => 'Add comments', - 'actionlabel' => 'Add comments', + 'label' => emt('Add comments'), + 'actionlabel' => emt('Add comments'), 'color' => '#333399', 'width' => 763, - }) - %> ) + } + &> ) % }
+ ( <% pkg_change_location_link($cust_pkg) %> ) +
@@ -174,6 +192,10 @@ my $part_pkg = $opt{'part_pkg'}; my $curuser = $FS::CurrentUser::CurrentUser; +my $countrydefault = $opt{'countrydefault'} || 'US'; +my $statedefault = $opt{'statedefault'} + || ($countrydefault eq 'US' ? 'CA' : ''); + #subroutines #false laziness w/status.html @@ -188,13 +210,37 @@ sub pkg_change_link { my $locationnum = $cust_pkg->locationnum; include( '/elements/popup_link-cust_pkg.html', 'action' => $p. "misc/change_pkg.cgi?locationnum=$locationnum", - 'label' => 'Change package', - 'actionlabel' => 'Change', + 'label' => emt('Change package'), + 'actionlabel' => emt('Change'), + 'cust_pkg' => $cust_pkg, + ); +} + +sub pkg_change_location_link { + my $cust_pkg = shift; + my $pkgpart = $cust_pkg->pkgpart; + include( '/elements/popup_link-cust_pkg.html', + 'action' => $p. "misc/change_pkg.cgi?locationnum=-1;pkgpart=$pkgpart;". + "address1=;address2=;city=;county=;state=$statedefault;". + "zip=;country=$countrydefault", + 'label' => emt('Change location'), + 'actionlabel' => emt('Change'), 'cust_pkg' => $cust_pkg, ); } -sub pkg_dates_link { pkg_link('edit/REAL_cust_pkg', 'Edit dates', @_ ); } +sub pkg_dates_link { pkg_link('edit/REAL_cust_pkg', emt('Edit dates'), @_ ); } + +sub pkg_discount_link { + my $cust_pkg = shift or return ''; + include( '/elements/popup_link-cust_pkg.html', + 'action' => $p.'edit/cust_pkg_discount.html', + 'label' => emt('Discount'), + 'actionlabel' => emt('Discount'), + 'cust_pkg' => $cust_pkg, + 'width' => 616, + ); +} sub pkg_customize_link { my $cust_pkg = shift or return ''; @@ -203,13 +249,13 @@ sub pkg_customize_link { qq!Customize!; + qq!">!.emt('Customize').''; } sub pkg_event_link { my($cust_pkg) = @_; qq!!. - 'View package events'. + emt('View package events'). ''; }