Re: [GNC-dev] Trading Accounts 797701

2020-04-23 Thread Geert Janssens
Op donderdag 23 april 2020 06:55:21 CEST schreef David Cousens:
> In a recnt discussion with
> (http://gnucash.1415818.n4.nabble.com/template/NamlServlet.jtp?macro=user_no
> des&user=378901) around capital gains and realized and unrealized gains, I
> had occasion to acquaint myself with trading accounts. The current version
> of Ch12 only deals with the manual calculation of multiple currencies and
> while it mentions trading accounts it is mainly by reference to peter
> Selinger's tutorials
> (https://www.mathstat.dal.ca/~selinger/accounting/tutorial.html and
> https://www.mscs.dal.ca/~selinger/accounting/gnucash.html). The user became
> confused and i also ended up confused largely because peter Selinger's
> articles do not discuss the trading account implementation in GnuCash as it
> is now.
> 
> I am proposing expanding Ch12 as per the outline in
> https://bugs.gnucash.org/show_bug.cgi?id=797701 to include trading accounts.
> 
> David Cousens
> 
More documentation is always welcome :)

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


Re: [GNC-dev] iOS app

2020-04-23 Thread Camille Rizko via gnucash-devel
 Thank you Geert,  I can develop on Linux as well as MacOS. My Linux station is 
a portable running Debian 9. My macOS is a workstation with a 26" screen, 
obviously a better choice for me.
I did download the source on Linux and went as far as running the cmake but 
encountered an error at line 59. Since I prefer the Mac station, I will 
download the Mac development and see if I have better luck doing a complete 
build.
Once I have a successful build, I will look into app-utils and see what I can 
do with it. The objective I assume is to port it to 100% C/C++, for all 
platforms, and eventually make it portable and usable by my iOS app.
MacOS and iOS are different OS builds, but they share a common compiler set, 
namely Objective C (superset of C/C++) and now SWIFT. The OBJECTs sometimes 
differ between MacOS and iOS, but are quite similar otherwise.
On Wednesday, April 22, 2020, 01:37:14 AM PDT, Geert Janssens 
 wrote:  
 
 #yiv1000945645 p, #yiv1000945645 li {white-space:pre-wrap;}
Hi Camille,

 

There is plenty of work on the gnucash project. However I'll focus on your 
eventual goal of basing your iOS app on the gnucash core.

 

I think your first step would be to familiarize yourself with the gnucash build 
system. We have wiki pages describing how to build gnucash on linux, MacOS and 
Windows [1]. I assume you are developing on MacOS, so I suggest you follow the 
instructions to setup a gnucash build environment on that platform and make 
sure you can build gnucash.

 

When you get to that point, you can start tweaking the build scripts to make 
them build only only what you need for the iOS app. I would think in the 
gnucash repo itself that would be the contents of libgnucash.

 

The biggest caveat here is that libgnucash/app-utils still depends quite a bit 
on guile, which is not what you'd want for iOS. So here's another opportunity 
to help out: rework app-utils to no longer depend on guile. I'll be honest; 
that's pretty involved so maybe not a good starting project.

 

The alternative approach would be to alter the build scripts such we can 
specify to build without the gui (already possible by setting WITH_GNUCASH=OFF 
to gnucash' cmake invocation) and without guile (which requires a new cmake 
parameter, for example WITH_GUILE). If both are set the build should only 
include libengine, but then without app-utils. That would probably give you 
most of what you need for a first version of the iOS app on top of the gnucash 
logic. As the guile separation goal progresses within the gnucash project, more 
of app-utils can be included in the minimal build for iOS, giving you even more 
features to work with.

 

Besides the gnucash repo there is the gnucash-on-osx repo which contains the 
build system for all of gnucash' dependencies on that platform. As it currently 
stands it will build more dependencies than you need for an iOS app. You're 
most likely not interested in gtk stuff, though you will still need glib (as 
libgnucash is still using it a lot).

 

gnucash-on-osx uses the jhbuild build system. To help you build only the parts 
you need for an iOS app, you can add a new module in gnucash.modules that would 
only trigger the build of dependencies for libgnucash instead of all of gnucash.

 

My experience with building on MacOS is limited and I have no experience at all 
with building for iOS so there are certainly things I am missing or glossing 
over. For example I have no idea how different the MacOS environment is from 
the iOS environment (runtime wise), so I can't tell if there will be a porting 
effort involved. I mean the source code of gnucash and its dependencies have 
been tweaked to build an run on MacOS. I have no idea whatsoever if extra 
tweaking will be required to build for and run on iOS. If so that would be 
another task, though I would first try to get the build system to output only 
the minimal set of dependencies and gnucash libraries.

 

I can probably help on the build system side within the gnucash project itself, 
like adding the extra switch to disable building with guile. I have a 
reasonable notion of how jhbuild works, but I don't have access to a MacOS 
system any more. So I can give advice or suggestions on the jhbuild tweaks, but 
can test any of those.

 

Skills you'll probably need or need to develop include: working with git [2], 
understanding cmake, working with jhbuild and obviously C and C++.

 

All changes you make in gnucash-on-osx or gnucash repositories can be submitted 
for inclusion via either pull requests on github (preferred) or patches in 
bugzilla. It goes without saying these changes should be such that they won't 
break the normal gnucash build.

 

If you have questions, consult our wiki, ask on irc or the gnucash-devel 
mailing list.

 

Other than that, enjoy the ride ! Happy hacking :)

 

Regards,

 

Geert

 

[1] https://wiki.gnucash.org/wiki/Building

[2] https://wiki.gnucash.org/wiki/Git

 

 

Op zondag 19 april 

Re: [GNC-dev] Fwd: Testing python

2020-04-23 Thread andygoblins
I'm building from git master. I just run "ninja build" without an install and 
do my testing straight from the build directory.

The last commit in my copy of master was on April 14. Does the master branch 
include the 3.10 build fix?

On April 21, 2020 8:23:40 PM UTC, Mark  wrote:
>Yea, I ran 'sudo ninja install'.
>Andy, from your initial email, can't tell for sure but possibly you
>built a
>venv right after your ninja build without doing an install?
>
>*Mark*
>
>
>*episte...@gmail.com *
>*(613) 447-5385*
>
>
>
>On Tue, Apr 21, 2020 at 10:18 AM Geert Janssens
>
>wrote:
>
>> Op dinsdag 21 april 2020 15:01:33 CEST schreef Mark:
>>
>> > My bindings are built from the git source code for the 3.10 release
>>
>> > (gnucash-3.10.tar.bz2):
>>
>> >
>>
>> > /opt/bin | Tue Apr 21 08:55:25 | marksa@Ares-A717-72G | bash 4.4.20
>>
>> > 2013 > ./gnucash --version
>>
>> > GnuCash 3.10
>>
>> > Build ID: 3.10+(2020-04-11)
>>
>> >
>>
>> > So maybe I have a slightly later version of 3.10 where this bug was
>> already
>>
>> > fixed?
>>
>>
>>
>> No, I don't think so. The fix was only included on 2020-04-12 and is
>not
>> part of the release tarball.
>>
>>
>>
>> But there are several factors at play. Do you run "make install" ? If
>so,
>> the python bindings would properly find the libraries in the
>installation
>> directory. If not, they should be found in the build directory, but I
>> expect that to fail without the aforementioned patch.
>>
>>
>>
>> Regards,
>>
>>
>>
>> Geert
>>

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: [GNC-dev] Testing python

2020-04-23 Thread Rob Gowin
On Sun, Apr 19, 2020 at 2:19 PM Andy Goblins  wrote:

>I also tried skipping the virtual environment and just running
>"GNC_UNINSTALLED=1;GNC_BUILDDIR=dir>;PYTHONPATH=$GNC_BUILDDIR/lib/python3.8/site-packages:$GNC_BUILDDIR
>/lib/gnucash python" just like the cmake tests use, but I get the same
>result; it's not finding the libgncmod-backend stuff in
>build/lib/gnucash.
>

You almost had it. :-) The semicolons in the above command line make it
such that, for example, "GNC_UNINSTALLED=1" is its own (no-op) command that
does not affect the python command.

Try this in your virtual environment:

(gnucash-build) robg@kubuntu01:~/gnucash-build$ GNC_UNINSTALLED=1
GNC_BUILDDIR=`pwd` python3

Python 3.6.9 (default, Apr 18 2020, 01:56:04)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import gnucash
* 23:52:18  WARN  no preferences backend loaded, or the
backend doesn't define register_cb, returning 0
* 23:52:18  WARN  no preferences backend loaded, or the
backend doesn't define register_cb, returning 0
* 23:52:18  WARN  no preferences backend loaded, or the
backend doesn't define register_cb, returning 0
* 23:52:18  WARN  no preferences backend loaded, or the
backend doesn't define register_cb, returning 0
* 23:52:18  WARN  no preferences backend loaded, or the
backend doesn't define register_cb, returning 0
>>> import gnucash.gnucash_core_c
>>> print(gnucash.gnucash_core_c.CREC)
c

I don't know what the deal with the preference backend stuff is, but maybe
it won't affect your testing.

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


[GNC-dev] Master problem when entering account in register

2020-04-23 Thread Chris Good
Hi,

 

I'm seeing what looks like a problem in GnuCash built from source pulled
from git master with latest commit:

5th Apr 2020 No gnucash/gettext scm module anymore, the translation defs are
in core-utils a392190adf877b552c25936c493c4d63a4a83e8f.

 

Say I have a transaction with 2 splits:

Assets:Current Assets:Bank1

Expenses:Groceries Joint

 

I click on the transaction Description, then click into the Account field
for the Expenses split.

It shows "Expenses: Groceries Joint" with nothing selected and insertion
cursor at the front.

I highlight the full field using Shift End.

Type ex and the field shows (nothing highlighted): 

rage CommSec CG:AMP CGex

and nothing in the now open selection list.

This is a combination of my Asset account Assets:Investments:Brokerage
CommSec CG:AMP CG

and the ex I typed.

 

This is running client Ubuntu 18.04 in VirtualBox on host Windows 10.

 

This seems like text selection
 Bug 797052 - Autofill
Selection is Corrupted After Clicking Description.

 

This is not happening with my maint built from source in the same VM.

 

Can anyone else duplicate this problem?

 

Regards,

Chris Good

 

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


[GNC-dev] Accounts tab keader Total (SUD)

2020-04-23 Thread David Cousens
I was setting up a demo _book with USD as the default currency to create some
updates to the documentation on multicurrency section in the guide and just
duplicating the original book structure used to create the screen shots in
the current documentation.

I started a new book, selected USD as the default currency and created my
required accounts with multiple currencies, while the locale for my computer
is Australia.

In the account tab I wanted to display the Total (USD), i.e. the total in
the book currency in the accounts tab,  however the drop down list of the
headers selected using the down arrow at the right of the header row has
(AUD) appended to the selectable column headers.  Surely when I selected USD
as the default currency in the new book dialog, this should override locale
settings?

In the preferences Accounts tab I deselcted the  Default Currency for new
accounts as Locale and selected the Choose radiobutton  with USD (US
Dollar), then saved the book and reopened it. No change in the above
resulted although new accounts were in USD.

Screenshot attached.  The Opening Balances (USD) displays the correct totals
if prices are set in the database

Searching through the XML file I was unable to find any references to AUD so
it is clearly picking up on the locale setting however changing
/etc/default/locale to

LANG=en_US.UTF-8
LANGUAGE=en_US.en

or the same settings in 

/etc/gnucash/environment 

produced no change in behaviour after restarting GnuCash. I still get a
column in AUD.

David Cousens



-
David Cousens
--
Sent from: http://gnucash.1415818.n4.nabble.com/GnuCash-Dev-f1435356.html
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: [GNC-dev] Accounts tabheader Total (USD)

2020-04-23 Thread David Cousens
GC v 3.9 on Linux Mint 19.3



-
David Cousens
--
Sent from: http://gnucash.1415818.n4.nabble.com/GnuCash-Dev-f1435356.html
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel