Re: [GNC] ATM withdrawl

2023-02-26 Thread Fred Tydeman
I ended up adding a EURO bank charge expense account as a subaccount under
USD bank charges.
Then I added a split in the ATM transaction to move 150 EUR to cash and
10.50 EUR to that expense subaccount.
Thanks for the response.
___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.


Re: [GNC] Postgress connection string for nonstandard port

2023-02-26 Thread Geert Janssens
Op donderdag 23 februari 2023 22:00:12 CET schreef Bob Treumann:
> Thanks for all the feedback.   I will share my learnings;
> 
> The database must be created before you connect to it.The install
> process creates all the tables in the Public schema in that database once
> it connects successfully.

If your postgresql user has proper database creation rights, the database 
doesn't have to 
exist prior.

> 
> Geert Janssens referenced the code where he could tell that the appended
> port should work.
> Geert, can you tell me where to find that? I would like to see if I can
> modify it to connect to my chosen database and schema rather than using the
> public schema in a dedicated database.

I can give you a few pointers, but I'm afraid the whole path is not that 
straightforward.

I have started from the code that reads the database parameters:
https://github.com/Gnucash/gnucash/blob/maint/gnucash/gnome-utils/dialog-file-access.c#L71[1]
That code will eventually call 'gnc_uri_create_uri' in
_https://github.com/Gnucash/gnucash/blob/maint/gnucash/gnome-utils/dialog-file-access.c#L9_8
Note the port parameter is set to 0, which suggests to omit adding a port 
number to the uri 
by code. However if the host parameter contains a port part, that will be 
retained in the final 
uri, and that's how you can pass a non-standard port when entering database 
parameters.

> 
> I mentioned in another post that Postgress creates multiple schemas in a
> single database.That is my preferred way of operating because I can
> read and write to other schemas without connecting across databases.I'm
> not even sure if PG supports cross database connections.

There is no support for schemas other than the default, because schemas are a 
feature 
specific to postgresql and the same database code in gnucash also has to work 
with mysql 
and sqlite.

If you want to look into implementing some kind of generic table prefix (which 
could 
translate into a schema in posgresql and just a name prefix in the other 
databases), you will 
probably have to combine amandments in the gnc_uri code with changes in the dbi 
backend 
code found here
https://github.com/Gnucash/gnucash/tree/maint/libgnucash/backend/dbi[2]

Regards,

Geert


[1] 
https://github.com/Gnucash/gnucash/blob/maint/gnucash/gnome-utils/dialog-file-access.c#L71
[2] https://github.com/Gnucash/gnucash/tree/maint/libgnucash/backend/dbi
___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.


Re: [GNC] Postgress connection string for nonstandard port

2023-02-26 Thread Geert Janssens
The attached image only shows the connection parameters as entered by the OP. 
It doesn't 
indicate any errors in itself.

But to be sure I have just verified this myself. I created a postgresql server 
listening on a 
non-standard port, and used the method I described below to successfully save a 
gnucash 
session to a pre-existing, empty database.

Regards,

Geert

Op donderdag 23 februari 2023 09:36:04 CET schreef Peter West:
> The OP said that that was not working (see his attached image.)
> 
> 
> —
> Peter West
> p...@pbw.id.au
> “Blessed are the peacemakers, for they shall be called sons of God.”
> 
> > On 23 Feb 2023, at 6:30 pm, Geert Janssens 
> > wrote:
> > 
> > From what I read in the code you should be able to pass a custom port by
> > adding it in the hostname field, like so:
> > 
> > yourserver.xyz:6543
> > 
> > Regards,
> > 
> > Geert

___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.


Re: [GNC] ATM withdrawl

2023-02-26 Thread Jim DeLaHunt

On 2023-02-25 19:43, Fred Tydeman wrote:


When I try to record an ATM withdrawal, I do not see any way to  add a
split for the bank fee.

I am taking 150 euros from an ATM.  There is a 10.50 euro bank fee.  My
bank sees a withdrawal of 171.85 USD.  I have trading accounts turned on.

In my US bank account, I enter USD 171.85; I say that the money is going to
a euro account.  I get a popup where I enter 160.50 euros.  I see no way to
split out 150 cash and 10.50 bank fee.

This is in GnuCash 4.13 on Linux.


Ah, a person after my own heart: recording multi-currency transactions 
with a main payment and a split for a fee.


I suspect that what is going on here is that your transaction is not a 
simple ATM withdrawal, it is a multiple-currency ATM withdrawal.


For a single-currency ATM withdrawal, the GnuCash data entry is simpler. 
Imagine you are withdrawing 150.00 USD from an ATM, from your USD bank 
account. There is a 10.50 USD bank fee. Your USD bank sees a withdrawal 
of 160.50 USD.


In that case you would follow the instructions in the GnuCash Help 
documentation, 6.4. Multiple Split Transactions 
, to make the 
multiple splits of the transaction visible in the UI. There will be two 
splits, one withdrawing 150.00 USD from the USD bank account, and one 
adding 150.00 USD to your USD cash-in-pocket account. You simply add a 
third split, for 10.50 USD, for the fee, and increase the split 
withdrawing from the USD bank account to 160.50 USD.


But since this is a multi-currency transaction, you also has the 
Transfer Funds dialogue box, which also serves as the foreign exchange 
dialogue box. You will want to read up in the GnuCash Help 
documentation, 6.1. Transfer Funds Dialog Box 
, 
especially 6.1.3 Currency Transfer, and also 6.5. Multiple 
Currency/Commodity Transactions 
. 
This documentation only tells you part of the story, and does not 
include screenshots of the dialogue box. Some day I may contribute an 
improvement to this section, because it keeps confusing me.


One thing to know is that each transaction has a base currency. This is 
set to the currency of the register from which you enter the 
transaction. If you enter the transaction from your USD bank account, 
the base currency of the transaction will be USD, and all splits with 
EUR amounts will put up the Transfer Funds dialogue box to get a USD:EUR 
conversion rate.


Another thing to know is that each split which has an account 
denominated in a currency different from the transaction's base currency 
has its own exchange rate. The Transfer Funds dialogue box deals only 
with that individual split and its exchange rate. Thus, a Transfer Funds 
dialogue dealing with the split for your EUR cash-in-pocket account is 
not the place to add a second split for Bank Service Charge in Euros.


For your USD and EUR mixed-currency transaction, you should first enter 
a third split for the Bank Service Charge. It is up to you whether you 
make an account for EUR Bank Service Charges, or record the charge 
against a USD Bank Service Charges account.


If you enter the transaction from your USD bank account register, the 
base currency of the transaction will be USD. When you add a split with 
a EUR Bank Service Charge account, you will want to enter a EUR amount 
of 10.50 EUR, and an exchange rate of (150+10.50)/171.85 EUR/USD. (You 
may need to enter the inverse of this fraction; the Transfer Funds 
dialogue box always confuses me, and I usually enter the rate in the 
wrong direction at least 50% of the time.) But when you add a split with 
a USD Bank Service Charge account, you will want to enter the USD 
equivalent of 10.50 EUR directly in the split, which will be 
171.85/(150+10.50) USD (I am pretty confident about that fraction).


Note that you can enter simple expressions like this in a split's amount 
field, and GnuCash will do the arithmetic for you. See the GnuCash 
Tutorial and Concepts Guide, 2.9.2.4. Using Entry Shortcuts 
, 
and the bullet point beginning, "In any of the amount fields, you can 
use a built-in calculator."


Does this answer your question?

Best regards,
 —Jim DeLaHunt


___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.