mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Disable inclusion of transaction text for OFX transactions in the description.
OFX puts rather useless information in the transaction text that makes the description overly long with the important part at the end.
This commit is contained in:
parent
25e3b22a4a
commit
b6d3c0e581
@ -688,8 +688,8 @@ gnc_ab_trans_dialog_verify_values(GncABTransDialog *td)
|
|||||||
gnc_ab_trans_dialog_entry_set (amount_entry, "", NULL);
|
gnc_ab_trans_dialog_entry_set (amount_entry, "", NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check transaction purpose */
|
/* Check transaction purpose. OFX doesn't do transfers. */
|
||||||
purpose = gnc_ab_get_purpose(td->ab_trans);
|
purpose = gnc_ab_get_purpose(td->ab_trans, FALSE);
|
||||||
if (!purpose || !strlen(purpose))
|
if (!purpose || !strlen(purpose))
|
||||||
{
|
{
|
||||||
gnc_ab_trans_dialog_entry_set (td->purpose_entry,
|
gnc_ab_trans_dialog_entry_set (td->purpose_entry,
|
||||||
|
@ -238,7 +238,8 @@ gnc_ab_maketrans(GtkWidget *parent, Account *gnc_acc,
|
|||||||
gnc_xfer_dialog_set_amount_sensitive(xfer_dialog, FALSE);
|
gnc_xfer_dialog_set_amount_sensitive(xfer_dialog, FALSE);
|
||||||
gnc_xfer_dialog_set_date_sensitive(xfer_dialog, FALSE);
|
gnc_xfer_dialog_set_date_sensitive(xfer_dialog, FALSE);
|
||||||
|
|
||||||
description = gnc_ab_description_to_gnc(ab_trans);
|
/* OFX doesn't do transfers. */
|
||||||
|
description = gnc_ab_description_to_gnc(ab_trans, FALSE);
|
||||||
gnc_xfer_dialog_set_description(xfer_dialog, description);
|
gnc_xfer_dialog_set_description(xfer_dialog, description);
|
||||||
g_free(description);
|
g_free(description);
|
||||||
|
|
||||||
|
@ -363,7 +363,7 @@ gnc_ab_get_remote_name(const AB_TRANSACTION *ab_trans)
|
|||||||
}
|
}
|
||||||
|
|
||||||
gchar *
|
gchar *
|
||||||
gnc_ab_get_purpose(const AB_TRANSACTION *ab_trans)
|
gnc_ab_get_purpose(const AB_TRANSACTION *ab_trans, gboolean is_ofx)
|
||||||
{
|
{
|
||||||
const GWEN_STRINGLIST *ab_purpose;
|
const GWEN_STRINGLIST *ab_purpose;
|
||||||
const char *ab_transactionText = NULL;
|
const char *ab_transactionText = NULL;
|
||||||
@ -371,7 +371,7 @@ gnc_ab_get_purpose(const AB_TRANSACTION *ab_trans)
|
|||||||
|
|
||||||
g_return_val_if_fail(ab_trans, g_strdup(""));
|
g_return_val_if_fail(ab_trans, g_strdup(""));
|
||||||
|
|
||||||
if (gnc_prefs_get_bool(GNC_PREFS_GROUP_AQBANKING, GNC_PREF_USE_TRANSACTION_TXT))
|
if (!is_ofx && gnc_prefs_get_bool(GNC_PREFS_GROUP_AQBANKING, GNC_PREF_USE_TRANSACTION_TXT))
|
||||||
{
|
{
|
||||||
/* According to AqBanking, some of the non-swift lines have a special
|
/* According to AqBanking, some of the non-swift lines have a special
|
||||||
* meaning. Some banks place valuable text into the transaction text,
|
* meaning. Some banks place valuable text into the transaction text,
|
||||||
@ -393,10 +393,10 @@ gnc_ab_get_purpose(const AB_TRANSACTION *ab_trans)
|
|||||||
}
|
}
|
||||||
|
|
||||||
gchar *
|
gchar *
|
||||||
gnc_ab_description_to_gnc(const AB_TRANSACTION *ab_trans)
|
gnc_ab_description_to_gnc(const AB_TRANSACTION *ab_trans, gboolean is_ofx)
|
||||||
{
|
{
|
||||||
/* Description */
|
/* Description */
|
||||||
gchar *description = gnc_ab_get_purpose(ab_trans);
|
gchar *description = gnc_ab_get_purpose(ab_trans, is_ofx);
|
||||||
gchar *other_name = gnc_ab_get_remote_name(ab_trans);
|
gchar *other_name = gnc_ab_get_remote_name(ab_trans);
|
||||||
gchar *retval;
|
gchar *retval;
|
||||||
|
|
||||||
@ -527,8 +527,10 @@ gnc_ab_trans_to_gnc(const AB_TRANSACTION *ab_trans, Account *gnc_acc)
|
|||||||
/* Trans-Num or Split-Action set with gnc_set_num_action below per book
|
/* Trans-Num or Split-Action set with gnc_set_num_action below per book
|
||||||
* option */
|
* option */
|
||||||
|
|
||||||
|
fitid = AB_Transaction_GetFiId(ab_trans);
|
||||||
|
|
||||||
/* Description */
|
/* Description */
|
||||||
description = gnc_ab_description_to_gnc(ab_trans);
|
description = gnc_ab_description_to_gnc(ab_trans, (fitid && *fitid));
|
||||||
xaccTransSetDescription(gnc_trans, description);
|
xaccTransSetDescription(gnc_trans, description);
|
||||||
g_free(description);
|
g_free(description);
|
||||||
|
|
||||||
@ -549,10 +551,10 @@ gnc_ab_trans_to_gnc(const AB_TRANSACTION *ab_trans, Account *gnc_acc)
|
|||||||
gnc_set_num_action (gnc_trans, split, custref, NULL);
|
gnc_set_num_action (gnc_trans, split, custref, NULL);
|
||||||
|
|
||||||
/* Set OFX unique transaction ID */
|
/* Set OFX unique transaction ID */
|
||||||
fitid = AB_Transaction_GetFiId(ab_trans);
|
|
||||||
if (fitid && *fitid)
|
if (fitid && *fitid)
|
||||||
gnc_import_set_split_online_id(split, fitid);
|
gnc_import_set_split_online_id(split, fitid);
|
||||||
|
|
||||||
|
/* FIXME: Extract function */
|
||||||
{
|
{
|
||||||
/* Amount into the split */
|
/* Amount into the split */
|
||||||
const AB_VALUE *ab_value = AB_Transaction_GetValue(ab_trans);
|
const AB_VALUE *ab_value = AB_Transaction_GetValue(ab_trans);
|
||||||
|
@ -179,7 +179,7 @@ gchar *gnc_ab_get_remote_name(const AB_TRANSACTION *ab_trans);
|
|||||||
* @param ab_trans AqBanking transaction
|
* @param ab_trans AqBanking transaction
|
||||||
* @return A newly allocated string, may be ""
|
* @return A newly allocated string, may be ""
|
||||||
*/
|
*/
|
||||||
gchar *gnc_ab_get_purpose(const AB_TRANSACTION *ab_trans);
|
gchar *gnc_ab_get_purpose(const AB_TRANSACTION *ab_trans, gboolean is_ofx);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create the appropriate description field for a GnuCash Transaction by the
|
* Create the appropriate description field for a GnuCash Transaction by the
|
||||||
@ -189,7 +189,7 @@ gchar *gnc_ab_get_purpose(const AB_TRANSACTION *ab_trans);
|
|||||||
* @param ab_trans AqBanking transaction
|
* @param ab_trans AqBanking transaction
|
||||||
* @return A newly allocated string, may be ""
|
* @return A newly allocated string, may be ""
|
||||||
*/
|
*/
|
||||||
gchar *gnc_ab_description_to_gnc(const AB_TRANSACTION *ab_trans);
|
gchar *gnc_ab_description_to_gnc(const AB_TRANSACTION *ab_trans, gboolean is_ofx);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create the appropriate memo field for a GnuCash Split by the information
|
* Create the appropriate memo field for a GnuCash Split by the information
|
||||||
|
Loading…
Reference in New Issue
Block a user