Re: build failure

2015-05-12 Thread Christoph Holtermann
Am 11.05.2015 um 21:35 schrieb John Ralls:
>> On May 11, 2015, at 11:55 AM, Christoph Holtermann  
>> wrote:
>>
>> Am 11.05.2015 um 16:26 schrieb John Ralls:
 On May 11, 2015, at 2:43 AM, Christoph Holtermann  
 wrote:

 Hello,

 can't make the current gnucash

 libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../../../src/libqof/qof 
 -I../../.. -I../../../../lib/libc -I../../../../src -pthread 
 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include 
 -DG_LOG_DOMAIN=\"qof\" -Wall -Wno-unused -Wno-deprecated-register -g 
 -std=gnu++11 -g -MT gnc-timezone.lo -MD -MP -MF .deps/gnc-timezone.Tpo -c 
 ../../../../src/libqof/qof/gnc-timezone.cpp  -fPIC -DPIC -o 
 .libs/gnc-timezone.o
 In file included from 
 /usr/include/boost/date_time/local_time/local_time_types.hpp:18:0,
from 
 /usr/include/boost/date_time/local_time/local_time.hpp:13,
from ../../../../src/libqof/qof/gnc-timezone.hpp:34,
from ../../../../src/libqof/qof/gnc-timezone.cpp:23:
 /usr/include/boost/date_time/local_time/custom_time_zone.hpp: In 
 instantiation of 'bool 
 boost::local_time::custom_time_zone_base::has_dst() const [with 
 CharT = char]':
 ../../../../src/libqof/qof/gnc-timezone.cpp:633:1:   required from here
 /usr/include/boost/date_time/local_time/custom_time_zone.hpp:67:30: error: 
 cannot convert 'const 
 boost::shared_ptr
  >' to 'bool' in return
  return (dst_calc_rules_); //if calc_rule is set the tz has dst
 ^
 cc1plus: warning: unrecognized command line option 
 "-Wno-deprecated-register" [enabled by default]

>>> Looks like your boost might be too old. 1.56.0 has 
>>>  return (bool) dst_calc_rules_; //if calc_rule is set the tz has dst
>>>
>>> for that line. What version do you have?
>>>
>>> Regards,
>>> John Ralls
>>>
>> Hello John,
>>
>> it's boost 1.53.0 on openSUSE 13.1.
>>
> Please remember to copy the list on all replies.
>
> OK, well the fix was r84636, or 
> https://github.com/boostorg/date_time/commit/47c81a90335c1da15be02575456b65296f96946e,
>  titled “Merge fix for C++11 compilation error." Looks like it just missed 
> 1.54, so 1.55 is going to have to be the minimum.
>
> I’ve pushed the requisite change to configure.ac.
>
> Regards,
> John Ralls
>
>
With 1.56 it's compiling again, thanks.

regards,

Christoph

-- 
--- Nachricht gesendet von C. Holtermann ---
-  -
-  Verschlüsselte Nachrichten können über  -
- den öffentlichen Schlüssel auf folgendem -
- Keyserver an mich gesendet werden:   -
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x4DD9CF0482B0620B

___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: GnuCash XML sched-xaction split amount formatting

2015-05-12 Thread Derek Atkins
Hi,

Ngewi Fet  writes:

> Hi there,
> I also just realized that there are credit-numeric and debit-numeric tags 
> which
> are formatted using the normal way GnuCash formats money amounts in XML, hence
> easier to parse (and more stable). 
>
> Given my experiences so far with the credit- and debit- formulas, I have
> decided to ignore those completely in favor of credit-numeric and
> debit-numeric.
> Now when parsing scheduled actions, if no credit/debit-numeric slots are 
> found,
> the template will just be ignored. 
>
> What do you think of this approach?
> What determines whether *-numeric variants or the *-formula variants are used
> when GnuCash desktop is saving to XML?

What determines what gets written out is how it was read in.  You're
assuming that the slots data is actually parsed and then rewritten,
which is only partially true.  Slots data is read in, stored in the same
tree structure it was read from, and then written back out into the same
tree structure on write.  Indeed, GnuCash does not even need to
understand or know about a particular slots entry for it to be re-saved
on write.

This is very different than the primary objects.  If Gnucash doesn't
know about a particular XML field in, say, a Transaction object then
when it tries to parse the XML it will choke on the unknown xml tag.

However there is no such thing as an "unknown slots" tag.  The slots are
literally loaded as-is and written back out as-is.

As for what determines whether -numeric or -formula variants are used --
that would be a question for how the SX was originally created.  In
particular, ./src/register/ledger-core/split-register-model-save.c has
the following code:

/* If the value can be parsed into a numeric result, store that
 * numeric value additionally. See above comment.*/
parse_result = gnc_exp_parser_parse_separate_vars(debit_formula,
  &debit_amount,
  &error_loc, NULL);
if (!parse_result)
debit_amount = gnc_numeric_zero();

qof_instance_set (QOF_INSTANCE (sd->split),
  "sx-credit-formula", credit_formula,
  "sx-credit-numeric", &credit_amount,
  "sx-debit-formula", debit_formula,
  "sx-debit-numeric", &debit_amount,
  NULL);

... So basically it's parsing the input and assigning the _formula or
_amount based on whether the parser can reduce the input into a single
amount or not.

So no, you cannot just use the _amount...  It will fail in most cases.

-derek

> Thanks for all the feedback so far!
>
> Regards,
> Ngewi
>
> On Mon, May 4, 2015 at 3:57 PM, Derek Atkins  wrote:
>
> Ngewi Fet  writes:
>
> >>> Too bad you can't just incorporate the GnuCash engine (and file
> >>> backend) C code directly into your App.  ;)
> >
> > That would be cool, although I don't know what the effort would be to
> > hook into it. In what format does GnuCash handle it's data internally?
> > SQL database? The SQL schema in the Android version is already similar
> > and could be made even more so. Having the same code generating XML
> > would definitely ease things. But I guess that's a rather looong term
> > goal as Geert says.
>
> No, it uses QOF internally.
>
> One of the medium-term goals is to change it to using SQLite internally.
>
> >> One of the long-term goals... However it will be c++ code by then. We'd
> >> love some more help getting the conversion done btw.
> >
> > Does this conversion require extensive knowledge of the Gtk framework
> > and the scheme language?
>
> No, just Glib.
>
> >> More on topic though:
> >> Ngewi, you write that you intend to generate the transactions when an 
> SX
> >> is due. Knowing that gnucash will also create these transactions,
> >> independently from GoA when they are due, won't this cause duplicate
> >> entries when importing back from GoA to gnucash on the desktop ?
> >
> > The scheduled transactions XML tracks things like the last run time,
> > number of executions pending etc etc. We update all of that
> > information as well.
> > I assume GnuCash looks at this before deciding if and how many
> > transactions to generate from the scheduled template. That way there
> > will be no duplicates.
> > But please correct me if I'm wrong.
>
> It does, provided you are sharing the datafile back and forth with
> desktop GnuCash.
>
> > Regards,
> > Ngewi
>
> -derek
>
> --
>        Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
>        Member, MIT Student Information Processing Board  (SIPB)
>        URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
>        warl...@mit.edu                        PGP key available
>

-- 
   Derek Atkins, SB '93 M