mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Merge branch 'maint'
With a change to xaccTransIsSXTemplate to work with the private kvp change in master.
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
@-NOTE If you make any changes here, you should probably -@
|
||||
@-NOTE also change the equivalent sections in: -@
|
||||
@-NOTE - src/bin/overrides/gnucash-env.in -@
|
||||
@-NOTE Check as well that modifications performed in -@
|
||||
@-NOTE - gnucash-on-windows.git:gnucash.iss don't conflict. -@
|
||||
# environment
|
||||
#
|
||||
# This configuration file can be used to change/add environment variables
|
||||
|
||||
@@ -58,7 +58,7 @@ struct timeval
|
||||
#include "gnc-lot.h"
|
||||
#include "gnc-event.h"
|
||||
#include <gnc-gdate-utils.h>
|
||||
|
||||
#include "SchedXAction.h"
|
||||
#include "qofbackend-p.h"
|
||||
|
||||
/* Notes about xaccTransBeginEdit(), xaccTransCommitEdit(), and
|
||||
@@ -2319,6 +2319,29 @@ xaccTransGetReadOnly (const Transaction *trans)
|
||||
trans->inst.kvp_data, TRANS_READ_ONLY_REASON) : NULL;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
xaccTransIsSXTemplate (const Transaction * trans)
|
||||
{
|
||||
Split *split0 = xaccTransGetSplit (trans, 0);
|
||||
if (split0 != NULL)
|
||||
{
|
||||
char* formula = NULL;
|
||||
g_object_get (split0, "sx-debit-formula", &formula, NULL);
|
||||
if (formula != NULL)
|
||||
{
|
||||
g_free (formula);
|
||||
return TRUE;
|
||||
}
|
||||
g_object_get (split0, "sx-credit-formula", &formula, NULL);
|
||||
if (formula != NULL)
|
||||
{
|
||||
g_free (formula);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean xaccTransIsReadonlyByPostedDate(const Transaction *trans)
|
||||
{
|
||||
GDate *threshold_date;
|
||||
@@ -2332,6 +2355,9 @@ gboolean xaccTransIsReadonlyByPostedDate(const Transaction *trans)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (xaccTransIsSXTemplate (trans))
|
||||
return FALSE;
|
||||
|
||||
threshold_date = qof_book_get_autoreadonly_gdate(book);
|
||||
g_assert(threshold_date); // ok because we checked uses_autoreadonly before
|
||||
trans_date = xaccTransGetDatePostedGDate(trans);
|
||||
|
||||
Reference in New Issue
Block a user