- 'category' => 'Total category', #required but what's it used for?
- 'subtotal' => sprintf('%.2f',$total)
- };
+ 'category' => 'Total category', #required but what's it used for?
+ );
+
+ if ( $prorate_total ) {
+
+ push @sections, {
+ %total,
+ 'description' => 'First payment (depending on day of month)',
+ 'subtotal' => [ $subtotals{0}, $total ],
+ };
+
+ } else {
+
+ push @sections, {
+ %total,
+ 'description' => 'First payment',
+ 'subtotal' => $total,
+ };
+ }
+