From 1cede8ddbf04b0361893f79fc6a04ee80d3b03a0 Mon Sep 17 00:00:00 2001 From: Derek Atkins Date: Fri, 2 Jan 2004 22:38:29 +0000 Subject: [PATCH] * src/business/business-core/gncInvoice.c: set the lot title to " " (e.g., "Invoice 000001" or "Bill I2-34") when posting an invoice. We already assume one invoice to a lot. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@9747 57a11ea4-9604-0410-9ed3-97b8803252fd --- ChangeLog | 5 +++++ src/business/business-core/gncInvoice.c | 10 ++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index bcfd20cc2c..e28cabffc9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2003-01-02 Derek Atkins + * src/business/business-core/gncInvoice.c: set the lot title to + " " (e.g., "Invoice 000001" or + "Bill I2-34") when posting an invoice. We already assume + one invoice to a lot. + * src/business/business-reports/aging.scm: When computing the aging report, ignore splits that belong to closed lots. This way we wont get the wrong values when the invoice falls outside the 360-day diff --git a/src/business/business-core/gncInvoice.c b/src/business/business-core/gncInvoice.c index a92094e47b..5735a2e56f 100644 --- a/src/business/business-core/gncInvoice.c +++ b/src/business/business-core/gncInvoice.c @@ -750,7 +750,7 @@ Transaction * gncInvoicePostToAccount (GncInvoice *invoice, Account *acc, GList *splitinfo = NULL; gnc_numeric total; gboolean reverse; - const char *name, *type; + const char *name, *type, *lot_title; Account *ccard_acct = NULL; GncOwner *owner; @@ -791,12 +791,18 @@ Transaction * gncInvoicePostToAccount (GncInvoice *invoice, Account *acc, if (!lot) lot = gnc_lot_new (invoice->inst.book); + type = gncInvoiceGetType (invoice); + + /* Set the lot title */ + lot_title = g_strdup_printf ("%s %s", type, gncInvoiceGetID (invoice)); + gnc_lot_set_title (lot, lot_title); + g_free (lot_title); + /* Create a new transaction */ txn = xaccMallocTransaction (invoice->inst.book); xaccTransBeginEdit (txn); name = gncOwnerGetName (gncOwnerGetEndOwner (gncInvoiceGetOwner (invoice))); - type = gncInvoiceGetType (invoice); /* Set Transaction Description (Owner Name) , Num (invoice ID), Currency */ xaccTransSetDescription (txn, name ? name : "");