From b47790dbe5e5d8232ba7a896888f8040f8936943 Mon Sep 17 00:00:00 2001 From: Christian Stimming Date: Sun, 10 Apr 2011 20:18:38 +0000 Subject: [PATCH] Bug #647360: Invoice entries in expense voucher are created in old voucher, not in new one. It worked fine for customer invoices, and vendor bills, but not expense vouchers, where the feature was broken all along. BP git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20554 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/engine/gncInvoice.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/engine/gncInvoice.c b/src/engine/gncInvoice.c index ae0fbfc688..9280cb5a73 100644 --- a/src/engine/gncInvoice.c +++ b/src/engine/gncInvoice.c @@ -354,13 +354,15 @@ GncInvoice *gncInvoiceCopy (const GncInvoice *from) GncEntry *to_entry = gncEntryCreate(book); gncEntryCopy(from_entry, to_entry); - if (gncInvoiceGetOwnerType (invoice) == GNC_OWNER_VENDOR) + switch (gncInvoiceGetOwnerType (invoice)) { - // this is a vendor bill + case GNC_OWNER_VENDOR: + case GNC_OWNER_EMPLOYEE: + // this is a vendor bill, or an expense voucher gncBillAddEntry(invoice, to_entry); - } - else - { + break; + case GNC_OWNER_CUSTOMER: + default: // this is an invoice gncInvoiceAddEntry(invoice, to_entry); }