- # totals for assets, liabilities
- $form->{total_assets_this_period} =
- $form->round_amount($form->{total_assets_this_period},
- $form->{decimalplaces});
- $form->{total_liabilities_this_period} =
- $form->round_amount($form->{total_liabilities_this_period},
- $form->{decimalplaces});
- $form->{total_equity_this_period} =
- $form->round_amount($form->{total_equity_this_period},
- $form->{decimalplaces});
-
- # calculate earnings
- $form->{earnings_this_period} =
- $form->{total_assets_this_period} -
- $form->{total_liabilities_this_period} - $form->{total_equity_this_period};
-
- push(@{ $form->{equity_this_period} },
- $form->format_amount($myconfig,
- $form->{earnings_this_period},
- $form->{decimalplaces}, "- "
- ));
-
- $form->{total_equity_this_period} =
- $form->round_amount(
- $form->{total_equity_this_period} + $form->{earnings_this_period},
- $form->{decimalplaces});
-
- # add liability + equity
- $form->{total_this_period} =
- $form->format_amount(
- $myconfig,
- $form->{total_liabilities_this_period} + $form->{total_equity_this_period},
- $form->{decimalplaces},
- "- ");
-
- if ($last_period) {
-
- # totals for assets, liabilities
- $form->{total_assets_last_period} =
- $form->round_amount($form->{total_assets_last_period},
- $form->{decimalplaces});
- $form->{total_liabilities_last_period} =
- $form->round_amount($form->{total_liabilities_last_period},
- $form->{decimalplaces});
- $form->{total_equity_last_period} =
- $form->round_amount($form->{total_equity_last_period},
- $form->{decimalplaces});
-
- # calculate retained earnings
- $form->{earnings_last_period} =
- $form->{total_assets_last_period} -
- $form->{total_liabilities_last_period} -
- $form->{total_equity_last_period};
-
- push(@{ $form->{equity_last_period} },
- $form->format_amount($myconfig,
- $form->{earnings_last_period},
- $form->{decimalplaces}, "- "
- ));
-
- $form->{total_equity_last_period} =
- $form->round_amount(
- $form->{total_equity_last_period} + $form->{earnings_last_period},
- $form->{decimalplaces});
-
- # add liability + equity
- $form->{total_last_period} =
- $form->format_amount($myconfig,
- $form->{total_liabilities_last_period} +
- $form->{total_equity_last_period},
- $form->{decimalplaces},
- "- ");