fix ordering packages with no unit price, #13136
[freeside.git] / httemplate / misc / order_pkg.html
index 9854721..c5d3fa3 100644 (file)
                  'curr_value' => $pkgpart,
                  'classnum'   => -1,
                  'cust_main'  => $cust_main,
-                 'onchange'   => 'enable_order_pkg',
     &>
 % }
 
+% 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">
+% }
+
 <TR>
   <TH ALIGN="right"><% mt('Start date') |h %> </TD>
   <TD COLSPAN=6>
 %                 : 'standardize_new_location()';
 <INPUT NAME    = "submitButton"
        TYPE    = "button"
-       VALUE   = "Order Package"
+       VALUE   = "<% mt("Order Package") |h %>"
        onClick = "this.disabled=true; <% $onclick %>;"
        <% $pkgpart ? '' : 'DISABLED' %>
 >
@@ -164,6 +174,11 @@ if ( $cgi->param('lock_pkgpart') ) {
 
 my $pkgpart = $part_pkg ? $part_pkg->pkgpart : scalar($cgi->param('pkgpart'));
 
+my $quantity = 1;
+if ( $cgi->param('quantity') =~ /^\s*(\d+)\s*$/ ) {
+  $quantity = $1;
+}
+
 my $format = $date_format. ' %T %z (%Z)'; #false laziness w/REAL_cust_pkg.cgi?
 my $start_date = '';
 if( ! $conf->exists('order_pkg-no_start_date') ) {