+if ( $cgi->param('start') eq 'on_hold' ) {
+ $hash{'susp'} = 'now';
+} elsif ( $cgi->param('start') eq 'on_date' ) {
+ $hash{'start_date'} = scalar($cgi->param('start_date'))
+ ? parse_datetime($cgi->param('start_date'))
+ : '';
+}
+
+my @cust_pkg_usageprice = ();
+foreach my $quantity_param ( grep { $cgi->param($_) && $cgi->param($_) > 0 }
+ grep /^usagepricenum(\d+)_quantity$/,
+ $cgi->param
+ )
+{
+ $quantity_param =~ /^usagepricenum(\d+)_quantity$/ or die 'unpossible';
+ my $num = $1;
+ push @cust_pkg_usageprice, new FS::cust_pkg_usageprice {
+ usagepricepart => scalar($cgi->param("usagepricenum${num}_usagepricepart")),
+ quantity => scalar($cgi->param($quantity_param)),
+ };
+}
+$hash{cust_pkg_usageprice} = \@cust_pkg_usageprice;
+
+# extract details (false laziness with /misc/order_pkg.html)
+my $details = {
+ 'invoice_detail' => [],
+ 'package_comment' => [],
+ 'quotation_detail' => [],
+};
+foreach my $field ( $cgi->param ) {
+ foreach my $detailtype ( keys %$details ) {
+ if ($field =~ /^$detailtype(\d+)$/) {
+ $details->{$detailtype}->[$1] = $cgi->param($field);
+ }
+ }
+}
+foreach my $detailtype ( keys %$details ) {
+ @{ $details->{$detailtype} } = grep { length($_) } @{ $details->{$detailtype} };
+}
+