+ gdouble trn_amount;
+
+ /* account initial amount */
+ lst_acc = g_hash_table_get_values(GLOBALS->h_acc);
+ lnk_acc = g_list_first(lst_acc);
+ while (lnk_acc != NULL)
+ {
+ Account *acc = lnk_acc->data;
+
+ //#1674045 ony rely on nosummary
+ //if( (acc->flags & (AF_CLOSED|AF_NOREPORT)) )
+ if( (acc->flags & (AF_NOREPORT)) )
+ goto next_acc;
+
+ trn_amount = 0.0;
+ if(selectall)
+ trn_amount = hb_amount_base(acc->initial, acc->kcur);
+ else
+ if( selkey == acc->key )
+ trn_amount = acc->initial;
+
+ if(trn_amount < 0)
+ data->tmp_expense[0] += trn_amount;
+ else
+ data->tmp_income[0] += trn_amount;
+
+ DB( g_print(" - stored initial %.2f for account %d:%s\n", trn_amount, acc->key, acc->name) );
+
+ next_acc:
+ lnk_acc = g_list_next(lnk_acc);
+ }
+ g_list_free(lst_acc);