122 DEBUG(
"File name is : %s", info->file_name);
125 root = gnc_book_get_root_account (gnc_get_current_book());
127 info->failed = FALSE;
130 fh = g_fopen (info->file_name,
"w");
136 const gchar *currentSel;
143 if (info->use_quotes)
146 mid_sep = g_strconcat (
"\"", info->separator_str,
"\"", NULL);
151 mid_sep = g_strconcat (info->separator_str, NULL);
155 header = g_strconcat (end_sep, _(
"type"), mid_sep, _(
"full_name"), mid_sep, _(
"name"), mid_sep,
156 _(
"code"), mid_sep, _(
"description"), mid_sep, _(
"color"), mid_sep,
157 _(
"notes"), mid_sep, _(
"commoditym"), mid_sep, _(
"commodityn"), mid_sep,
158 _(
"hidden"), mid_sep, _(
"tax"), mid_sep, _(
"place_holder"), end_sep, EOLSTR, NULL);
159 DEBUG(
"Header String: %s", header);
162 if (!write_line_to_file (fh, header))
172 for (ptr = accts, i = 0; ptr; ptr = g_list_next (ptr), i++)
174 gchar *fullname = NULL;
175 gchar *str_temp = NULL;
180 part1 = g_strconcat (end_sep, currentSel, mid_sep, NULL);
183 str_temp = csv_test_field_string (info, fullname);
184 part2 = g_strconcat (part1, str_temp, mid_sep, NULL);
190 str_temp = csv_test_field_string (info, currentSel);
191 part1 = g_strconcat (part2, str_temp, mid_sep, NULL);
196 str_temp = csv_test_field_string (info, currentSel);
197 part2 = g_strconcat (part1, str_temp, mid_sep, NULL);
202 str_temp = csv_test_field_string (info, currentSel);
203 part1 = g_strconcat (part2, str_temp, mid_sep, NULL);
208 part2 = g_strconcat (part1, currentSel, mid_sep, NULL);
212 str_temp = csv_test_field_string (info, currentSel);
213 part1 = g_strconcat (part2, str_temp, mid_sep, NULL);
218 str_temp = csv_test_field_string (info, currentSel);
219 part2 = g_strconcat (part1, str_temp, mid_sep, NULL);
224 str_temp = csv_test_field_string (info, currentSel);
225 part1 = g_strconcat (part2, str_temp, mid_sep, NULL);
230 part2 = g_strconcat (part1, currentSel, mid_sep, NULL);
234 part1 = g_strconcat (part2, currentSel, mid_sep, NULL);
238 part2 = g_strconcat (part1, currentSel, end_sep, EOLSTR, NULL);
241 DEBUG(
"Account String: %s", part2);
244 if (!write_line_to_file (fh, part2))
GList * gnc_account_get_descendants_sorted(const Account *account)
const char * gnc_commodity_get_mnemonic(const gnc_commodity *cm)
GNCAccountType xaccAccountGetType(const Account *acc)
const char * xaccAccountGetCode(const Account *acc)
#define DEBUG(format, args...)
const char * xaccAccountTypeEnumAsString(GNCAccountType type)
const char * gnc_commodity_get_namespace(const gnc_commodity *cm)
#define ENTER(format, args...)
const char * xaccAccountGetColor(const Account *acc)
gchar * gnc_account_get_full_name(const Account *account)
const char * xaccAccountGetDescription(const Account *acc)
gboolean xaccAccountGetTaxRelated(const Account *acc)
gboolean xaccAccountGetHidden(const Account *acc)
gnc_commodity * xaccAccountGetCommodity(const Account *acc)
gboolean xaccAccountGetPlaceholder(const Account *acc)
#define LEAVE(format, args...)
const char * xaccAccountGetName(const Account *acc)
const char * xaccAccountGetNotes(const Account *acc)