From dcfc1280bdf13623b79c639ff8735c6c3fa7f85d Mon Sep 17 00:00:00 2001 From: Geert Janssens Date: Sat, 14 Apr 2018 18:46:26 +0200 Subject: [PATCH] Base invoice posted status on the presence of a posted transaction rather than a posted account Bills and invoices that are posted and subsequently unposted again still store their posted account internally as a convenience to the user (upon reposting the old account will be offered by default) so it's not a reliable test for the posted state. The posted transaction on the other hand is guaranteed to only exist when the invoice is posted. This should fix a slew of small and perhaps larger side effects, such as a posted bill still appearing as editable, critical warnings when creating new bills/invoices and so on. --- libgnucash/engine/gncInvoice.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libgnucash/engine/gncInvoice.c b/libgnucash/engine/gncInvoice.c index 35b7f9f91c..592363f89a 100644 --- a/libgnucash/engine/gncInvoice.c +++ b/libgnucash/engine/gncInvoice.c @@ -1859,7 +1859,7 @@ gncInvoiceApplyPayment (const GncInvoice *invoice, Transaction *txn, gboolean gncInvoiceIsPosted (const GncInvoice *invoice) { if (!invoice) return FALSE; - return GNC_IS_ACCOUNT(gncInvoiceGetPostedAcc(invoice)); + return GNC_IS_TRANSACTION(gncInvoiceGetPostedTxn(invoice)); } gboolean gncInvoiceIsPaid (const GncInvoice *invoice)