X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Forder_pkg.html;h=17c56055e09f3d3f638a4853fb1c9e4e74920304;hb=e0a26680d75fc2000bde195eba7946805a3aaa28;hp=33b2bb39004d0324c040e9a26eb8a4c8e753ff64;hpb=e078ca418dcf3c7b92efcd371ce761df3314c369;p=freeside.git diff --git a/httemplate/misc/order_pkg.html b/httemplate/misc/order_pkg.html index 33b2bb390..17c56055e 100644 --- a/httemplate/misc/order_pkg.html +++ b/httemplate/misc/order_pkg.html @@ -9,14 +9,14 @@ function enable_order_pkg () { if ( document.OrderPkgForm.pkgpart.selectedIndex > 0 ) { - document.OrderPkgForm.submit.disabled = false; + document.OrderPkgForm.submitButton.disabled = false; if ( document.OrderPkgForm.pkgpart.options[document.OrderPkgForm.pkgpart.selectedIndex].getAttribute('data-can_discount') == 1 ) { document.OrderPkgForm.discountnum.disabled = false; } else { document.OrderPkgForm.discountnum.disabled = true; } } else { - document.OrderPkgForm.submit.disabled = true; + document.OrderPkgForm.submitButton.disabled = true; document.OrderPkgForm.discountnum.disabled = true; } } @@ -28,44 +28,41 @@
+ +% if ( $svcpart ) { + +% } <% ntable("#cccccc", 2) %> -<% include('/elements/tr-select-cust-part_pkg.html', - 'curr_value' => $pkgpart, - 'classnum' => -1, - 'cust_main' => $cust_main, - 'onchange' => 'enable_order_pkg', - ) -%> - -%# false laziness w/edit/quick-charge.html +% if ( $part_pkg ) { + + + Package + <% $part_pkg->pkg_comment |h %> + +% } else { + <% include('/elements/tr-select-cust-part_pkg.html', + 'curr_value' => $pkgpart, + 'classnum' => -1, + 'cust_main' => $cust_main, + 'onchange' => 'enable_order_pkg', + ) + %> +% } + Start date - - + <% include('/elements/input-date-field.html',{ + 'name' => 'start_date', + 'format' => $date_format, + 'value' => $start_date, + 'noinit' => 1, + }) %> (leave blank to start immediately) - - % if ( $cust_main->payby =~ /^(CARD|CHEK)$/ ) { % my $what = lc(FS::payby->shortname($cust_main->payby)); @@ -93,16 +90,59 @@ %> % } -<% include('/elements/tr-select-cust_location.html', - 'cgi' => $cgi, - 'cust_main' => $cust_main, - ) -%> +% if ( $cgi->param('lock_locationnum') ) { + + + +% } else { + + <% include('/elements/tr-select-cust_location.html', + 'cgi' => $cgi, + 'cust_main' => $cust_main, + ) + %> + +% } + + + Contract end date + + <% include('/elements/input-date-field.html',{ + 'name' => 'contract_end', + 'format' => $date_format, + 'value' => '', + 'noinit' => 1, + }) %> + + +% unless ( $cgi->param('lock_locationnum') ) { + + <% include( '/elements/standardize_locations.html', + 'form' => "OrderPkgForm", + 'onlyship' => 1, + 'no_company' => 1, + 'callback' => 'document.OrderPkgForm.submit();', + ) + %> + +% } +
-> +% my $onclick = $cgi->param('lock_locationnum') +% ? 'document.OrderPkgForm.submit()' +% : 'standardize_locations()'; + +>
@@ -125,10 +165,25 @@ my $cust_main = qsearchs({ 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql, }); -my $pkgpart = scalar($cgi->param('pkgpart')); +my $part_pkg = ''; +if ( $cgi->param('lock_pkgpart') ) { + $part_pkg = qsearchs({ + 'table' => 'part_pkg', + 'hashref' => { 'pkgpart' => scalar($cgi->param('lock_pkgpart')) }, + 'extra_sql' => ' AND '. FS::part_pkg->agent_pkgs_sql( $cust_main->agent ), + }) + or die "unknown pkgpart ". $cgi->param('lock_pkgpart'); +} + +my $pkgpart = $part_pkg ? $part_pkg->pkgpart : scalar($cgi->param('pkgpart')); my $format = $date_format. ' %T %z (%Z)'; #false laziness w/REAL_cust_pkg.cgi? -my $start_date = $cust_main->next_bill_date; -$start_date = $start_date ? time2str($format, $start_date) : ''; +my $start_date = ''; +if( ! $conf->exists('order_pkg-no_start_date') ) { + $start_date = $cust_main->next_bill_date; + $start_date = $start_date ? time2str($format, $start_date) : ''; +} + +my $svcpart = scalar($cgi->param('svcpart'));