diff options
author | Mark Wells <mark@freeside.biz> | 2013-08-09 13:36:43 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2013-08-09 13:36:43 -0700 |
commit | 98ea745e4b55a38ad8b5ba3749c56327d641d65d (patch) | |
tree | e7a1f0a2c4e3bc6c77f111c67f7994a6b61b1714 /httemplate | |
parent | 2a49a712c97e5b5a012a91ff4bc2c0518c2af6d6 (diff) |
preserve quantity when changing package type/location, #24259
Diffstat (limited to 'httemplate')
-rw-r--r-- | httemplate/edit/process/change-cust_pkg.html | 2 | ||||
-rw-r--r-- | httemplate/elements/tr-input-pkg-quantity.html | 15 | ||||
-rwxr-xr-x | httemplate/misc/change_pkg.cgi | 6 | ||||
-rw-r--r-- | httemplate/misc/order_pkg.html | 11 | ||||
-rw-r--r-- | httemplate/view/cust_main/packages/location.html | 4 | ||||
-rw-r--r-- | httemplate/view/cust_main/packages/package.html | 8 | ||||
-rw-r--r-- | httemplate/view/cust_main/packages/status.html | 4 |
7 files changed, 30 insertions, 20 deletions
diff --git a/httemplate/edit/process/change-cust_pkg.html b/httemplate/edit/process/change-cust_pkg.html index 9d06d8e1a..0d571defd 100644 --- a/httemplate/edit/process/change-cust_pkg.html +++ b/httemplate/edit/process/change-cust_pkg.html @@ -27,7 +27,7 @@ my $cust_pkg = qsearchs({ die 'unknown pkgnum' unless $cust_pkg; my %change = map { $_ => scalar($cgi->param($_)) } - qw( locationnum pkgpart ); + qw( locationnum pkgpart quantity ); $change{'keep_dates'} = 1; diff --git a/httemplate/elements/tr-input-pkg-quantity.html b/httemplate/elements/tr-input-pkg-quantity.html new file mode 100644 index 000000000..7ade57399 --- /dev/null +++ b/httemplate/elements/tr-input-pkg-quantity.html @@ -0,0 +1,15 @@ +% if ( FS::Conf->new->exists('invoice-unitprice') or $curr_value > 1 ) { + <TR> + <TH ALIGN="right"><% mt('Quantity') |h %> + </TH> + <TD> + <INPUT TYPE="text" NAME="quantity" SIZE=4 VALUE="<% $curr_value |h %>"> + </TD> + </TR> +% } else { + <INPUT TYPE="hidden" NAME="quantity" VALUE="1"> +% } +<%init> +my %opt = @_; +my $curr_value = $cgi->param('quantity') || $opt{'curr_value'} || 1; +</%init> diff --git a/httemplate/misc/change_pkg.cgi b/httemplate/misc/change_pkg.cgi index 7425fbfaf..923be71b1 100755 --- a/httemplate/misc/change_pkg.cgi +++ b/httemplate/misc/change_pkg.cgi @@ -22,6 +22,10 @@ 'cust_main' => $cust_main, &> + <& /elements/tr-input-pkg-quantity.html, + 'curr_value' => $cust_pkg->quantity + &> + <& /elements/tr-select-cust_location.html, 'cgi' => $cgi, 'cust_main' => $cust_main, @@ -94,7 +98,7 @@ my $title = "Change Package"; if ( $cust_pkg->change_to_pkgnum ) { my $change_to = FS::cust_pkg->by_key($cust_pkg->change_to_pkgnum); $cgi->param('delay', 1); - foreach(qw( start_date pkgpart locationnum )) { + foreach(qw( start_date pkgpart locationnum quantity )) { $cgi->param($_, $change_to->get($_)); } $title = "Edit Scheduled Package Change"; diff --git a/httemplate/misc/order_pkg.html b/httemplate/misc/order_pkg.html index a257e53e3..66c405ac1 100644 --- a/httemplate/misc/order_pkg.html +++ b/httemplate/misc/order_pkg.html @@ -37,16 +37,7 @@ &> % } -% if ( $conf->exists('invoice-unitprice') ) { - <TR> - <TH ALIGN="right"><% mt('Quantity') |h %> </TD> - <TD> - <INPUT TYPE="text" NAME="quantity" SIZE=4 VALUE="<% $quantity %>"> - </TD> - </TR> -% } else { - <INPUT TYPE="hidden" NAME="quantity" VALUE="1"> -% } +<& /elements/tr-input-pkg-quantity.html, curr_value => $quantity &> <TR> <TH ALIGN="right"><% mt('Start date') |h %> </TD> diff --git a/httemplate/view/cust_main/packages/location.html b/httemplate/view/cust_main/packages/location.html index 01cbc0ffb..5ff2b1e1f 100644 --- a/httemplate/view/cust_main/packages/location.html +++ b/httemplate/view/cust_main/packages/location.html @@ -70,8 +70,8 @@ sub pkg_change_location_link { 'label' => emt('Change location'), 'actionlabel' => emt('Change'), 'cust_pkg' => $cust_pkg, - 'width' => 763, - 'height' => 380, + 'width' => 960, + 'height' => 490, ); } diff --git a/httemplate/view/cust_main/packages/package.html b/httemplate/view/cust_main/packages/package.html index 596a47391..7df0869a3 100644 --- a/httemplate/view/cust_main/packages/package.html +++ b/httemplate/view/cust_main/packages/package.html @@ -280,8 +280,8 @@ sub pkg_change_link { 'label' => emt('Change package'), 'actionlabel' => emt('Change'), 'cust_pkg' => $cust_pkg, - 'width' => 763, - 'height' => 480, + 'width' => 960, + 'height' => 490, ); } @@ -295,8 +295,8 @@ sub pkg_change_location_link { 'label' => emt('Change location'), 'actionlabel' => emt('Change'), 'cust_pkg' => $cust_pkg, - 'width' => 763, - 'height' => 380, + 'width' => 960, + 'height' => 490, ); } diff --git a/httemplate/view/cust_main/packages/status.html b/httemplate/view/cust_main/packages/status.html index 6894a4e02..70b623c0f 100644 --- a/httemplate/view/cust_main/packages/status.html +++ b/httemplate/view/cust_main/packages/status.html @@ -645,8 +645,8 @@ sub pkg_change_later_link { 'label' => emt('Reschedule'), 'actionlabel' => emt('Edit scheduled change for'), 'cust_pkg' => $cust_pkg, - 'width' => 763, - 'height' => 480, + 'width' => 960, + 'height' => 490, ) } |