Merge branch 'maint'

With a change to xaccTransIsSXTemplate to work with the private kvp
change in master.
This commit is contained in:
John Ralls
2014-12-23 18:37:45 -08:00
3 changed files with 15539 additions and 12634 deletions

28140
po/es.po

File diff suppressed because it is too large Load Diff

View File

@@ -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

View File

@@ -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);