+ $discount_subtotal += $linetotal;
+ $form->{nodiscount_total} += $nodiscount_linetotal;
+ $nodiscount_subtotal += $nodiscount_linetotal;
+ $form->{discount_total} += $form->parse_amount($myconfig, $discount);
+
+ if ($form->{"subtotal_$i"} && $subtotal_header && ($subtotal_header != $i)) {
+ $discount_subtotal = $form->format_amount($myconfig, $discount_subtotal, 2);
+ push(@{ $form->{discount_sub} }, $discount_subtotal);
+ $nodiscount_subtotal = $form->format_amount($myconfig, $nodiscount_subtotal, 2);
+ push(@{ $form->{nodiscount_sub} }, $nodiscount_subtotal);
+ $discount_subtotal = 0;
+ $nodiscount_subtotal = 0;
+ $subtotal_header = 0;
+ } else {
+ push(@{ $form->{discount_sub} }, "");
+ push(@{ $form->{nodiscount_sub} }, "");
+ }