- g_date_set_julian (date, txn->date);
- //#1270876
- switch(PREFS->dtex_datefmt)
- {
- case 0: //"m-d-y"
- g_string_append_printf (elt, "D%02d/%02d/%04d\n",
- g_date_get_month(date),
- g_date_get_day(date),
- g_date_get_year(date)
- );
- break;
- case 1: //"d-m-y"
- g_string_append_printf (elt, "D%02d/%02d/%04d\n",
- g_date_get_day(date),
- g_date_get_month(date),
- g_date_get_year(date)
- );
- break;
- case 2: //"y-m-d"
- g_string_append_printf (elt, "D%04d/%02d/%02d\n",
- g_date_get_year(date),
- g_date_get_month(date),
- g_date_get_day(date)
- );
- break;
- }
-
- //g_ascii_dtostr (amountbuf, sizeof (amountbuf), txn->amount);
- g_ascii_formatd (amountbuf, sizeof (amountbuf), "%.2f", txn->amount);
- g_string_append_printf (elt, "T%s\n", amountbuf);
-
- g_string_append_printf (elt, "C%s\n", txn->flags & OF_VALID ? "R" : "");
-
- if( txn->paymode == PAYMODE_CHECK)
- g_string_append_printf (elt, "N%s\n", txn->info);
-
- //Ppayee
- payee = da_pay_get(txn->kpay);
- if(payee)
- g_string_append_printf (elt, "P%s\n", payee->name);
-
- // Mmemo
- g_string_append_printf (elt, "M%s\n", txn->wording);
-
- // LCategory of transaction
- // L[Transfer account name]
- // LCategory of transaction/Class of transaction
- // L[Transfer account]/Class of transaction
- if( txn->paymode == PAYMODE_INTXFER && txn->kacc == acc->key)
- {
- //#579260
- Account *dstacc = da_acc_get(txn->kxferacc);
- if(dstacc)
- g_string_append_printf (elt, "L[%s]\n", dstacc->name);
- }
- else
+ case 0: //"m-d-y"
+ g_string_append_printf (elt, "D%02d/%02d/%04d\n",
+ g_date_get_month(date),
+ g_date_get_day(date),
+ g_date_get_year(date)
+ );
+ break;
+ case 1: //"d-m-y"
+ g_string_append_printf (elt, "D%02d/%02d/%04d\n",
+ g_date_get_day(date),
+ g_date_get_month(date),
+ g_date_get_year(date)
+ );
+ break;
+ case 2: //"y-m-d"
+ g_string_append_printf (elt, "D%04d/%02d/%02d\n",
+ g_date_get_year(date),
+ g_date_get_month(date),
+ g_date_get_day(date)
+ );
+ break;
+ }
+
+ //g_ascii_dtostr (amountbuf, sizeof (amountbuf), txn->amount);
+ g_ascii_formatd (amountbuf, sizeof (amountbuf), "%.2f", txn->amount);
+ g_string_append_printf (elt, "T%s\n", amountbuf);
+
+ sbuf = "";
+ if(txn->status == TXN_STATUS_CLEARED)
+ sbuf = "c";
+ else
+ if(txn->status == TXN_STATUS_RECONCILED)
+ sbuf = "R";
+
+ g_string_append_printf (elt, "C%s\n", sbuf);
+
+ if( txn->paymode == PAYMODE_CHECK)
+ g_string_append_printf (elt, "N%s\n", txn->info);
+
+ //Ppayee
+ payee = da_pay_get(txn->kpay);
+ if(payee)
+ g_string_append_printf (elt, "P%s\n", payee->name);
+
+ // Mmemo
+ g_string_append_printf (elt, "M%s\n", txn->wording);
+
+ // LCategory of transaction
+ // L[Transfer account name]
+ // LCategory of transaction/Class of transaction
+ // L[Transfer account]/Class of transaction
+ if( txn->paymode == PAYMODE_INTXFER && txn->kacc == acc->key)
+ {
+ //#579260
+ Account *dstacc = da_acc_get(txn->kxferacc);
+ if(dstacc)
+ g_string_append_printf (elt, "L[%s]\n", dstacc->name);
+ }
+ else
+ {
+ cat = da_cat_get(txn->kcat);
+ if(cat)