From 5f8a14df32fad1ab38232c5643de84b4a7aaca3b Mon Sep 17 00:00:00 2001 From: Derek Atkins Date: Tue, 14 May 2002 02:44:54 +0000 Subject: [PATCH] In a posted invoice store company name in in TransDescription and the user memo in the SplitMemo. Change window-register and aging.scm to not reverse the meanings. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6863 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/business/business-core/gncInvoice.c | 13 +++--- src/gnome/window-register.c | 13 +----- .../ledger-core/split-register-model.c | 41 +++++++++---------- src/report/standard-reports/aging.scm | 2 +- 4 files changed, 29 insertions(+), 40 deletions(-) diff --git a/src/business/business-core/gncInvoice.c b/src/business/business-core/gncInvoice.c index bd159a2a0f..894b189399 100644 --- a/src/business/business-core/gncInvoice.c +++ b/src/business/business-core/gncInvoice.c @@ -390,7 +390,7 @@ gncInvoiceAttachInvoiceToTxn (GncInvoice *invoice, Transaction *txn) Transaction * gncInvoicePostToAccount (GncInvoice *invoice, Account *acc, Timespec *post_date, Timespec *due_date, - const char * desc, gboolean reverse) + const char * memo, gboolean reverse) { Transaction *txn; GList *iter; @@ -409,8 +409,8 @@ Transaction * gncInvoicePostToAccount (GncInvoice *invoice, Account *acc, name = gncOwnerGetName (gncOwnerGetEndOwner (gncInvoiceGetOwner (invoice))); - /* Set Transaction Description, Num (invoice ID), Currency */ - xaccTransSetDescription (txn, desc); + /* Set Transaction Description (Owner Name) , Num (invoice ID), Currency */ + xaccTransSetDescription (txn, name); xaccTransSetNum (txn, gncInvoiceGetID (invoice)); xaccTransSetCurrency (txn, invoice->common_commodity); @@ -472,8 +472,7 @@ Transaction * gncInvoicePostToAccount (GncInvoice *invoice, Account *acc, split = xaccMallocSplit (invoice->book); /* set action and memo? */ - /* The memo is the customer name */ - xaccSplitSetMemo (split, name); + xaccSplitSetMemo (split, memo); xaccSplitSetBaseValue (split, (reverse ? gnc_numeric_neg (acc_val->val) : acc_val->val), @@ -489,8 +488,8 @@ Transaction * gncInvoicePostToAccount (GncInvoice *invoice, Account *acc, Split *split = xaccMallocSplit (invoice->book); /* Set action/memo */ - /* The memo is the customer name */ - xaccSplitSetMemo (split, name); + xaccSplitSetMemo (split, memo); + xaccSplitSetAction (split, reverse ? _("Invoice") : _("Bill")); xaccSplitSetBaseValue (split, (reverse ? total : gnc_numeric_neg (total)), invoice->common_commodity); diff --git a/src/gnome/window-register.c b/src/gnome/window-register.c index d4ca334a82..66f5699a8b 100644 --- a/src/gnome/window-register.c +++ b/src/gnome/window-register.c @@ -1184,17 +1184,8 @@ print_check_cb(GtkWidget * widget, gpointer data) if(split && trans && gh_procedure_p(print_check)) { - if (xaccTransGetTxnType (trans) != TXN_TYPE_NONE) { - /* If this is an Invoice or Payment, reverse the meanings of - * these fields */ - memo = xaccTransGetDescription(trans); - payee = xaccSplitGetMemo(split); - - } else { - payee = xaccTransGetDescription(trans); - memo = xaccSplitGetMemo(split); - } - + payee = xaccTransGetDescription(trans); + memo = xaccSplitGetMemo(split); amount = xaccSplitGetAmount(split); amount = gnc_numeric_abs (amount); date = xaccTransGetDate(trans); diff --git a/src/register/ledger-core/split-register-model.c b/src/register/ledger-core/split-register-model.c index 41bfe23bbb..335812b32e 100644 --- a/src/register/ledger-core/split-register-model.c +++ b/src/register/ledger-core/split-register-model.c @@ -142,7 +142,16 @@ static const char * gnc_split_register_get_desc_label (VirtualLocation virt_loc, gpointer user_data) { - return _("Description"); + SplitRegister *reg = user_data; + + switch (reg->type) { + case RECEIVABLE_REGISTER: + return _("Customer"); + case PAYABLE_REGISTER: + return _("Vendor"); + default: + return _("Description"); + } } static const char * @@ -193,16 +202,7 @@ static const char * gnc_split_register_get_memo_label (VirtualLocation virt_loc, gpointer user_data) { - SplitRegister *reg = user_data; - - switch (reg->type) { - case RECEIVABLE_REGISTER: - return _("Customer"); - case PAYABLE_REGISTER: - return _("Vendor"); - default: return _("Memo"); - } } static const char * @@ -853,8 +853,16 @@ gnc_split_register_get_desc_help (VirtualLocation virt_loc, help = gnc_table_get_entry (reg->table, virt_loc); if (!help || *help == '\0') - help = _("Enter a description of the transaction"); - + switch (reg->type) { + case RECEIVABLE_REGISTER: + help = _("Enter the name of the Customer"); + break; + case PAYABLE_REGISTER: + help = _("Enter the name of the Vendor"); + break; + default: + help = _("Enter a description of the transaction"); + } return g_strdup (help); } @@ -965,16 +973,7 @@ gnc_split_register_get_memo_help (VirtualLocation virt_loc, help = gnc_table_get_entry (reg->table, virt_loc); if (!help || *help == '\0') - switch (reg->type) { - case RECEIVABLE_REGISTER: - help = _("Enter the name of the Customer"); - break; - case PAYABLE_REGISTER: - help = _("Enter the name of the Vendor"); - break; - default: help = _("Enter a description of the split"); - } return g_strdup (help); } diff --git a/src/report/standard-reports/aging.scm b/src/report/standard-reports/aging.scm index 6f8197b359..03f2043a09 100644 --- a/src/report/standard-reports/aging.scm +++ b/src/report/standard-reports/aging.scm @@ -324,7 +324,7 @@ more than one currency. This report is not designed to cope with this possibili "h" (N_ "Use the description to identify individual companies.\ If false, use split memo") - #f)) + #t)) (add-option