gnucash maint: Charge back net value of bill entries in invoices
Geert Janssens
gjanssens at code.gnucash.org
Sat Mar 11 07:30:45 EST 2017
Updated via https://github.com/Gnucash/gnucash/commit/4949499b (commit)
from https://github.com/Gnucash/gnucash/commit/80e64a12 (commit)
commit 4949499bd44581419298a4b220fdbbe2c639a257
Author: Christoph Rohland <christoph at rohland.net>
Date: Thu Mar 9 15:01:11 2017 +0100
Charge back net value of bill entries in invoices
When charging entries from bills we need to exclude taxes since the tax
rate of the invoice might be different than that of the bill.
This fixes Bug 776380 - Gross value of bills charged back instead of
net value (https://bugzilla.gnome.org/show_bug.cgi?id=776380)
diff --git a/src/engine/gncInvoice.c b/src/engine/gncInvoice.c
index 222553f..a624b7b 100644
--- a/src/engine/gncInvoice.c
+++ b/src/engine/gncInvoice.c
@@ -1465,7 +1465,11 @@ Transaction * gncInvoicePostToAccount (GncInvoice *invoice, Account *acc,
/* If this is a bill, and the entry came from an invoice originally, copy the price */
if (gncEntryGetBillable (entry))
- gncEntrySetInvPrice (entry, gncEntryGetBillPrice (entry));
+ {
+ /* We need to set the net price since it may be another tax rate for invoices than bills */
+ gncEntrySetInvPrice (entry, gncEntryGetPrice (entry, FALSE, TRUE));
+ gncEntrySetInvTaxIncluded (entry, FALSE);
+ }
}
gncEntryCommitEdit (entry);
Summary of changes:
src/engine/gncInvoice.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
More information about the gnucash-changes
mailing list