Re: [GNC] Net Income & Retained Earnings do not match

2023-02-14 Thread Derek Robinson via gnucash-user
 You might check to see that the accounts being pulled into those reports are 
complete. I have found that those numbers don't match when the list of accounts 
on the Balance Sheet report doesn't match the list of accounts on the P&L 
(possibly because some are hidden accounts with balances).
On Tuesday, February 14, 2023 at 12:36:04 PM EST, 
gnucash-user-requ...@gnucash.org  wrote:  
 
 Send gnucash-user mailing list submissions to
    gnucash-user@gnucash.org

To subscribe or unsubscribe via the World Wide Web, visit
    https://lists.gnucash.org/mailman/listinfo/gnucash-user
or, via email, send a message with subject or body 'help' to
    gnucash-user-requ...@gnucash.org

You can reach the person managing the list at
    gnucash-user-ow...@gnucash.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of gnucash-user digest..."
Today's Topics:

  1.  Net Income & Retained Earnings do not match (John Wilson)
  2. Re:  Is GnuCash.org down (Monday, 2/13/2023, 7:20PM PST)
      (Ken Pyzik)
  3. Re:  Is GnuCash.org down (Monday, 2/13/2023, 7:20PM PST)
      (Adrien Monteleone)
  4. Re:  Net Income & Retained Earnings do not match (David Carlson)
I have set up a new set of books by exporting a tree of accounts from 
2022, the old books, to 2023 the new books.

In the old books the Net Income in my P&L report matched the Retained 
Earnings in my Balance Sheet report but it doesn't in my new set of books.

Is this 'a bug' or have I done something to my tree of accounts?

Help!

-- 
John Wilson,
3770 San Mateo Drive,
Port Alberni, BC, V9Y 5H4
Tel: 250-723-3752
Tuesday 2/14/2023 at 9:15PST- GnuCash.org is still down.  Been down for ove=
r 14 hours.  I got only one response - so maybe this was a planned outage t=
hat I missed?  If so, sorry for posting.  If not - info for everyone to kno=
w.

Ken

From: Ken Pyzik
Sent: Monday, February 13, 2023 7:24 PM
To: gnucash-user@gnucash.org
Subject: Is GnuCash.org down (Monday, 2/13/2023, 7:20PM PST)

Is GnuCash.org down (Monday, 2/13/2023, 7:20PM PST)?  Can't seem to get to =
it.  - Ken

There are some issues with the website the devs are aware of but can't 
yet fix. (has to do with limited access rights)

The list server, wiki, bugzilla & github should all be working however.

Regards,
Adrien

On 2/14/23 11:18 AM, Ken Pyzik wrote:
> Tuesday 2/14/2023 at 9:15PST- GnuCash.org is still down.  Been down for over 
> 14 hours.  I got only one response - so maybe this was a planned outage that 
> I missed?  If so, sorry for posting.  If not - info for everyone to know.


What document type is that attachment?  If it isn't something my computer
can scan for viruses, I won't open it.

Now, if you started a new file with the same account tree, it won't have
any transactions, so those reports will be different, in fact, IIRC, net
income should be zero and retained earnings whatever you set  the opening
balance to when you set up the new books.

On Tue, Feb 14, 2023 at 11:14 AM John Wilson 
wrote:

> I have set up a new set of books by exporting a tree of accounts from
> 2022, the old books, to 2023 the new books.
>
> In the old books the Net Income in my P&L report matched the Retained
> Earnings in my Balance Sheet report but it doesn't in my new set of books.
>
> Is this 'a bug' or have I done something to my tree of accounts?
>
> Help!
>
> --
> John Wilson,
> 3770 San Mateo Drive,
> Port Alberni, BC, V9Y 5H4
> Tel: 250-723-3752
> ___
> 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.
>


-- 
David Carlson

___

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.
  
___
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] IRA/401K income detection (David G. Pickett)

2022-03-16 Thread Derek Robinson via gnucash-user
I handle qualified plans with 3 generic transactions.
1. Contributions to plan: credit cash (if making a contribution from a bank 
account) or wage income (if making the contribution directly from your 
paycheck), debit to your plan
2. Gains to your plan. Unrealized gains should adjust the plan balance 
automatically as you update prices of the underlying holdings. If you have 
realized gains, create an equity account called "Gains and Losses," credit 
that, debit your plan.
3. Distributions from your plan: if you want to track these tightly, it is 
easiest as two transactions (or really one four-line transaction). Create an 
equity account called "Qualified Plan Drawdowns" and a revenue account called 
"Qualified Plan Income." For each distribution: credit your plan, debit 
Qualified Plan Drawdowns, credit Qualified Plan Income, debit cash. Your 
"Qualified Plan Drawdowns" are essentially dividends - money you pay yourself.


___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.


Re: [GNC] v3.8 AQBanking in the US

2020-01-04 Thread Derek Robinson via gnucash-user
 All - the development you're talking about is beyond me, but I'm happy to help 
with testing or anything else that needs an extra set of hands. A couple of 
things.
- I assume you're in touch with Martin Preuss already, but if not, the README 
for aqbanking 6 points out a list of changes that consuming applications must 
consider. It's at https://github.com/aqbanking/aqbanking/blob/master/README. 
See section 11.
- The non-editable user problem that John Ralls noted seems to be because the 
backend type gets set to HBCI even when you set it to ofxconnect. This can be 
fixed by modifying aqbanking\settings6\users\.conf (change backendName to 
aqofxconnect).
- At least for my bank (USAA) account retrieval only works if there is at least 
one "dummy" account in the list of online accounts.
- I have user setup, account retrieval, and balance retrieval working. 
Transactions are retrieved and visible in the OFX log but don't show up in the 
GC transaction matcher. If there is a piece of GC code that returns a single 
transaction with date=0, amount=0 and description="Unspecified" when a crawl 
through the retrieved transactions returns nothing, that's a good place to 
start.
All best and let me know how I can help!
DerekOn Saturday, January 4, 2020, 05:37:38 AM EST, 
gnucash-user-requ...@gnucash.org  wrote:  
 
 Send gnucash-user mailing list submissions to
    gnucash-user@gnucash.org

To subscribe or unsubscribe via the World Wide Web, visit
    https://lists.gnucash.org/mailman/listinfo/gnucash-user
or, via email, send a message with subject or body 'help' to
    gnucash-user-requ...@gnucash.org

You can reach the person managing the list at
    gnucash-user-ow...@gnucash.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of gnucash-user digest..."
Today's Topics:

  1. Re:  v3.8 AQBanking in the US (John Ralls)
  2. Re:  v3.8 AQBanking in the US (Kenneth Schneider)
  3. Re:  GnuCash/AqBanking headaches (chris graves)
  4. Re:  v3.8: Budget "total" field (chris graves)
  5. Re:  GnuCash/AqBanking headaches (John Ralls)
  6. Re:  Default Invoice Config (Axel Essbaum)
  7.  Import failing - cannot get debug file (Bennie Gibson)
  8. Re:  Chaning left sidebar spacing (William Marshall)
  9. Re:  Chaning left sidebar spacing (William Marshall)
  10. Re:  Chaning left sidebar spacing (William Marshall)
No. OFX Direct Connect is a way of connecting GnuCash directly to the bank and 
retrieving the account, balance, and transaction data directly into GnuCash. 

In addition to a working AQBanking it requires that your bank provide the 
service and that it reveals enough information that you can configure AQBanking 
to connect to it.

Regards,
John Ralls


> On Jan 3, 2020, at 8:56 AM, David Carlson  wrote:
> 
> Is OFX Direct Connect linked to simple OFX or QFX downloads that are provided 
> by many US banks as one of the three ways that data can be funneled through 
> Intuit Software, hopefully to GnuCash instead of Quicken?
> 
> In other words, has Intuit found a way to kill OFX as an open source tool?
> 
> David Carlson
> 
> On Fri, Jan 3, 2020 at 10:43 AM John Ralls  wrote:
> 
> 
> > On Jan 3, 2020, at 7:09 AM, Derek Atkins  wrote:
> > 
> > John Ralls  writes:
> > 
> >> I don't know how much of that's fixable from GnuCash. Martin said last
> >> week that he's suspended development of OFX so anything that isn't is
> >> presumably broken forever.
> > 
> > Did he give a reason for suspending OFX development?
> 
> Yes: 
> https://lists.gnucash.org/pipermail/gnucash-user/2019-December/088350.html
> 
> Regards,
> John Ralls
> 
> ___
> gnucash-user mailing list
> gnucash-user@gnucash.org
> To update your subscription preferences or to unsubscribe:
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> If you are using Nabble or Gmane, please see 
> https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
> -
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.
> 
> 
> -- 
> David Carlson


I have volunteered to help Martin as best I can.

I’m retired, getting old and not in the best of health but hopefully can be of 
some assistance. I’ve been working with Linux in one flavor or another for over 
25 years and would like to give back to the community in some way. If anyone 
else can also help I’m sure it would be appreciated.

Ken Schneider 

> On Jan 3, 2020, at 11:36 AM, John Ralls  wrote:
> 
> 
> 
>> On Jan 3, 2020, at 7:09 AM, Derek Atkins  wrote:
>> 
>> John Ralls  writes:
>> 
>>> I don't know how much of that's fixable from GnuCash. Martin said last
>>> week that he's suspended development of OFX so anything that isn't is
>>> presumably broken forever.
>> 
>> Did he give a reason for suspending OFX development?
> 
> Yes: 
> https://lists.gnucash.org/pipermail/gnucash-user/2019-December/088350.html
> 
> Regards,
> John Ralls
> 
> 

Re: [GNC] v3.8 AQBanking in the US

2020-01-02 Thread Derek Robinson via gnucash-user
I’ll check that piece of configuration over the weekend (and I never knew the 
xml could be uncompressed ... thanks Frank Ellenberger!)

Sent from my iPhone

> On Jan 2, 2020, at 11:40 AM, chris graves  wrote:
> 
> Derek,
> 
> Yes, the symptoms I'm experiencing seem to be the same.
> 
> Chris
> 
>> On Jan 1, 2020, at 8:21 PM, Derek Robinson via gnucash-user 
>>  wrote:
>> 
>> We may be talking about the same issue - is the behavior what I described in 
>> my post earlier today?
>> 
>> John Ralls ( or anyone else who might know ) - any idea where the link 
>> between an AqBanking account and the corresponding GC account is stored?
>> 
>> Derek
>> 
>> Sent from my iPhone
>> ___
>> gnucash-user mailing list
>> gnucash-user@gnucash.org
>> To update your subscription preferences or to unsubscribe:
>> https://lists.gnucash.org/mailman/listinfo/gnucash-user
>> If you are using Nabble or Gmane, please see 
>> https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
>> -
>> Please remember to CC this list on all your replies.
>> You can do this by using Reply-To-List or Reply-All.
> 

___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.


Re: [GNC] v3.8 AQBanking in the US

2020-01-01 Thread Derek Robinson via gnucash-user
We may be talking about the same issue - is the behavior what I described in my 
post earlier today?

John Ralls ( or anyone else who might know ) - any idea where the link between 
an AqBanking account and the corresponding GC account is stored?

Derek

Sent from my iPhone
___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.


[GNC] 3.8 Link between aqbanking account and Gnucash account broken?

2020-01-01 Thread Derek Robinson via gnucash-user
I recently installed Gnucash 3.8. I'm having a problem with online banking 
transaction retrieval and can't troubleshoot further than I have.

Symptom: Actions -> Online Actions -> Get Balance works correctly. Actions -> 
Online Actions -> Get Transactions returns a single transaction with Amount = 
0, Date = 12/31/1969, Description = Unspecified.
The OFX log for Actions -> Online Actions -> Get Transactions DOES have the 
correct transactions in it - they just don't show up in the transaction 
matcher. That log is identical to the log I get under Gnucash 3.7, except that 
the OFXHEADER value under GC 3.7 is 100 and under GC 3.8 is 102.

Observation: In Tools -> Online Banking Setup -> Match Online Accounts to 
Gnucash accounts there are two differences between GC 3.7 and 3.8.
1. In GC 3.7 the "Online Banking Account Name" is of the form Bank Code 
bankcode (), Account accountcode (). In GC 3.8 it is of the form Bank 
Code bankcode (), Account accountcode (). In other words, the Bank Name element 
is missing. Examples:
GC 3.7: Bank Code 123456789 (123456789), Account 06 ()
GC 3.8: Bank Code 123456789 (), Account 06 ()
I've verified that the bankName element is present in both the 
aqbanking/settings/account/account.conf and 
aqbanking/settings6/account/account.conf files.
2. In GC 3.7 the GnuCash Account Name gets populated when going through the 
Online Banking Setup screens and stays populated when I finish that process and 
then go back into Online Banking Setup (including after a restart of GnuCash). 
In GC 3.8 the GnuCash Account Name is populated when going through the Online 
Banking Setup screens, but it is blank if I finish that process and then go 
back into Online Banking Setup. In other words, I can't get that association to 
"stick".

Hypothesis: the "link" between the account definition in Online Banking Setup 
and the GC account is partially corrupted in GC 3.8. I say "partially" because 
the Get Balance action continues to work even though I can't see the associated 
GC account in Online Banking Setup. Only the Get Transactions action is broken. 
I can't tell where that "link" is stored but I assume it's in the .gnucash file 
itself; I can't see any evidence of it in the old (GC 3.7) aqbanking account 
definition files in aqbanking/settings/account/account.conf files, nor in any 
other files in that folder.
I appreciate any help / insight from the group.
Derek


___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.


Re: [GNC] Vanguard investments module for Gnucash / Finance ::Quote

2019-11-20 Thread Derek Robinson via gnucash-user
 Frank - thanks for your message and the suggestion. I made two updates to the 
module and posted it to the Finance::Quote developers list. Those updates are:

- Changed the logic that retrieves the last price to directly extract the last 
(most current) row of the price table, instead of iterating from the top. 
Probably doesn't make much difference but this is a little cleaner.
- Provided two links in the SEE ALSO documentation section, one for 529 
portfolios and one for all other Vanguard products.

Best,Derek
On Tuesday, November 19, 2019, 04:28:15 PM EST, Frank H. Ellenberger 
 wrote:  
 
 Hi Derek,

Am Di., 19. Nov. 2019 um 17:28 Uhr schrieb Derek Robinson via
gnucash-user :
>
> Vanguard investors using GnuCash may be frustrated that many Vanguard 
> products (like their 529 portfolios, any 401(k) / 403(b) products with the 
> word "Trust" in the title) do not have prices that are easily obtainable from 
> one of the regular price sources. The attached module extracts prices from 
> the Vanguard price history page and adds them to the GnuCash price database.
>
> VanguardSite.pm will retrieve the most recent daily closing price (NAV) for 
> Vanguard investments (funds, collective investment trusts, 529 portfolios 
> ...) using Finance::Quote and add it to the GnuCash price history.
:
> Feel free to message me with questions.
> -Derek

you should consider to offer it to the finance-quote project.

One nitpick:the help section "See also" links to
http://www.vanguard.com, which is a redirect to
https://investor.vanguard.com/corporate-portal/# which then offers
several sites. Can you be more specific there, ideally the page
explaining which symbols a used, ...

Background: That is my starting point, when I update
https://code.gnucash.org/docs/C/gnucash-help/fq-sources.html#gnc-tbl-fq-individual-source
etc. for official modules.

Regards
Frank  
___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.


[GNC] Vanguard investments module for Gnucash / Finance ::Quote

2019-11-19 Thread Derek Robinson via gnucash-user
Vanguard investors using GnuCash may be frustrated that many Vanguard products 
(like their 529 portfolios, any 401(k) / 403(b) products with the word "Trust" 
in the title) do not have prices that are easily obtainable from one of the 
regular price sources. The attached module extracts prices from the Vanguard 
price history page and adds them to the GnuCash price database.

VanguardSite.pm will retrieve the most recent daily closing price (NAV) for 
Vanguard investments (funds, collective investment trusts, 529 portfolios ...) 
using Finance::Quote and add it to the GnuCash price history.

Instructions
Drop VanguardSite.pm into path\to\Strawberry\perl\site\lib\Finance\Quote
Make path\to\Strawberry\perl\site\lib\Finance\Quote.pm writable
Add VanguardSite to the @modules array in the new sub of Quote.pm. Save.
Make Quote.pm read-only.

Open gnucash.

Add a Vanguard security.
Attributes:
- Full name, Display symbol, ISIN don't matter.
- Type is FUND
- Fraction traded is 1/1000 for most Vanguard investments - check your 
statement if in doubt.
- Symbol/abbreviation must be the INTERNAL VANGUARD FUND ID (like 0052), NOT 
the ticker (like VGHCX).
- Check Get Online Quotes, select the "Unknown" radio button, and select 
"vanguardsite" from the dropdown.
- Timezone doesn't matter.


Get online prices. You should see a price entry from the last full business day 
with type = nav.

Feel free to message me with questions.
-Derek


VanguardSite.pm
Description: Binary data
___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.


Re: [GNC] (Reformatted) Crash with no information when using custom F::Q module

2019-11-18 Thread Derek Robinson via gnucash-user
 Thanks very much, Frank. I didn't quite understand the difference between 
gnc-fq-dump and gnc-fq-helper. My data retrieval method name contained digits 
and gnc-fq-helper did not allow them. I changed the method name to contain 
letters only and it works fine now.
Best,Derek 
On Monday, November 18, 2019, 03:31:18 PM EST, Frank H. Ellenberger 
 wrote:  
 
 Hello Derek,

Am Mo., 18. Nov. 2019 um 17:28 Uhr schrieb Derek Robinson via
gnucash-user :
>
> Apologies - I don't know why the linebreaks didn't work in my last message. 
> Please disregard that (unreadable) version.

Tip: To avoid reformatting of source file send them as attachments
instead of inline.

Wthout looking closer in your module ...
:
> gnc-fq-dump output
>
> C:\Program Files (x86)\gnucash\bin>perl gnc-fq-dump vanguardportfolios529 4517
> Finance::Quote fields Gnucash uses:
> symbol: 4517                <=== required
> date: 11/15/2019            <=== recommended
> currency: USD                <=== required
> last:                        <=\
> nav: 51.22                  <=== one of these
> price:                      <=/
> timezone:                    <=== optional

So, for a user it is readable, but is it also readable for the
program? For that purpose we have gnc-fq-helper. See
https://wiki.gnucash.org/wiki/Online_Quotes#Helper_Scripts

Regards
Frank
  
___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.


Re: [GNC] (Reformatted) Crash with no information when using custom F::Q module

2019-11-18 Thread Derek Robinson via gnucash-user
 Solved.
gnc-fq-dump  worked fine, but gnc-fq-helper (method "symbol") 
didn't. Noticed the following comment in the parse_input_line method of 
gnc-fq-helper:

  # Make sure we have an opening ( preceded only by whitespace.
  # and followed by a one word method name composed of [a-z_]+.
  # Also allow the '.' and '^' characters for stock indices.
  # Kill off the whitespace if we do and grab the command.

I renamed my method from "vanguardportfolios529" to "vanguardeducation" and it 
works now.
-Derek    On Monday, November 18, 2019, 11:17:20 AM EST, Derek Robinson via 
gnucash-user  wrote:  
 
 Apologies - I don't know why the linebreaks didn't work in my last message. 
Please disregard that (unreadable) version.
New to the list - please direct me to previous posts if I've missed something 
that will explain what's happening.
I wrote a custom F::Q module to extract daily "prices" from Vanguard 529 plan 
portfolios that are not traded on exchanges. I believe I've done that 
correctly. When I run gnc-fq-dump, I get return values that make sense and 
appear to be the same returns I would get from using an existing module (say 
yahoo_json) to query for a traded security (say CSCO). However, when I 
configure one of my securities in Gnucash (build 3.7+, F::Q version 1.49) the 
program crashes. There is no log output in gnucash.trace.xx.log (the file 
exists, but it's blank) and no useful information from gdb. I may have 
installed gdb incorrectly, or maybe I'm using it incorrectly. All I get is 
"Inferior 1 (process ) exited with code 01" and "No stack" after using bt.
I'd appreciate any guidance an experienced user can provide. Thanks!
Derek

package Finance::Quote::VanguardPortfolios529;
require 5.005;
our $VERSION = '1.49'; # VERSION
use strict;
use HTTP::Request::Common;
use HTML::TableExtract;
use HTML::TreeBuilder;
use Text::Template;
use Encode qw(decode);
use Time::Piece;

sub methods { 
  return ( vanguardportfolios529   => \&vanguardportfolios529 );
}

my @labels = qw/date isodate nav/;

sub labels {
  return ( iexcloud => \@labels, );
}

sub vanguardportfolios529 {

    my $quoter = shift;
    my @portfolios = @_;
        my (%info, $symbol, $url, $reply, $code, $desc, $body);
    my $ua = $quoter->user_agent();    
    my $quantity = @portfolios;
    foreach my $symbol (@portfolios) {
  my $t = localtime;
 my $t2 = $t - 7*86400;
 my $URL = Text::Template->new(TYPE => 'STRING', SOURCE => 
'https://personal.vanguard.com/us/funds/tools/pricehistorysearch?radio=1&results=get&FundType=529Plans&FundIntExt=INT&FundId={$symbol}&fundName={$symbol}&radiobutton2=1&beginDate='.$t2->mon.'%2F'.$t2->mday.'%2F'.$t2->year.'&endDate='.$t->mon.'%2F'.$t->mday.'%2F'.$t->year.'&year=#res');
 # Vanguard price history doesn't like invalid dates, so we pass a date range 
from a week ago through today - this range will always return SOME valid data, 
unless markets close for several days.

         # Get the web page
        $url   = $URL->fill_in(HASH => {symbol => $symbol});
        $reply = $ua->request( GET $url);
        $code  = $reply->code;
        $desc  = HTTP::Status::status_message($code);
        $body  = decode('UTF-8', $reply->content);

         if ($code != 200) {
            $info{ $symbol, 'success' } = 0;
            $info{ $symbol, 'errormsg' } = $desc;
            next;
        } 

 # Extract first table.  my $te = HTML::TableExtract->new( headers => [qw(Date 
Price)] );
        $te->parse($body);


 my $ts = $te->first_table_found();
  # It's a simple table - just dates and prices.
 my $currprice;
 my $currdate;

  # Iterate over table. We will end up passing the last row (most current 
price) to the constructor below.
 foreach my $row ($ts->rows) {
 $currprice = @$row[1];
 $currdate = @$row[0];
 }

         eval {
 $info{$symbol, 'symbol'}             = $symbol;
 $info{$symbol, 'method'}             = 'vanguardportfolios529';
 $info{$symbol, 'nav'}                = $currprice =~ s/[\$,]//g ? $currprice : 
die('failed to parse last price');
 $info{$symbol, 'currency'}           = 'USD';
 $info{$symbol, 'success'}            = 1;
 $quoter->store_date( \%info, $symbol, { usdate => $currdate } );
 }

 or do {
 $info{$symbol, 'errormsg'} = $@;
 $info{$symbol, 'success'}  = 0;
        }

  }

    return wantarray() ? %info : \%info;
}


1;


gnc-fq-dump output

C:\Program Files (x86)\gnucash\bin>perl gnc-fq-dump vanguardportfolios529 4517
Finance::Quote fields Gnucash uses:
symbol: 4517                 <=== required
date: 11/15

Re: [GNC] (Reformatted) Crash with no information when using custom F::Q module

2019-11-18 Thread Derek Robinson via gnucash-user
 One small correction - there should be a line break in the following statement:
# Extract first table.  my $te = HTML::TableExtract->new( headers => [qw(Date 
Price)] );

... so it's actually
# Extract first table.
my $te = HTML::TableExtract->new( headers => [qw(Date Price)] );

On Monday, November 18, 2019, 11:17:20 AM EST, Derek Robinson via 
gnucash-user  wrote:  
 
 Apologies - I don't know why the linebreaks didn't work in my last message. 
Please disregard that (unreadable) version.
New to the list - please direct me to previous posts if I've missed something 
that will explain what's happening.
I wrote a custom F::Q module to extract daily "prices" from Vanguard 529 plan 
portfolios that are not traded on exchanges. I believe I've done that 
correctly. When I run gnc-fq-dump, I get return values that make sense and 
appear to be the same returns I would get from using an existing module (say 
yahoo_json) to query for a traded security (say CSCO). However, when I 
configure one of my securities in Gnucash (build 3.7+, F::Q version 1.49) the 
program crashes. There is no log output in gnucash.trace.xx.log (the file 
exists, but it's blank) and no useful information from gdb. I may have 
installed gdb incorrectly, or maybe I'm using it incorrectly. All I get is 
"Inferior 1 (process ) exited with code 01" and "No stack" after using bt.
I'd appreciate any guidance an experienced user can provide. Thanks!
Derek

package Finance::Quote::VanguardPortfolios529;
require 5.005;
our $VERSION = '1.49'; # VERSION
use strict;
use HTTP::Request::Common;
use HTML::TableExtract;
use HTML::TreeBuilder;
use Text::Template;
use Encode qw(decode);
use Time::Piece;

sub methods { 
  return ( vanguardportfolios529   => \&vanguardportfolios529 );
}

my @labels = qw/date isodate nav/;

sub labels {
  return ( iexcloud => \@labels, );
}

sub vanguardportfolios529 {

    my $quoter = shift;
    my @portfolios = @_;
        my (%info, $symbol, $url, $reply, $code, $desc, $body);
    my $ua = $quoter->user_agent();    
    my $quantity = @portfolios;
    foreach my $symbol (@portfolios) {
  my $t = localtime;
 my $t2 = $t - 7*86400;
 my $URL = Text::Template->new(TYPE => 'STRING', SOURCE => 
'https://personal.vanguard.com/us/funds/tools/pricehistorysearch?radio=1&results=get&FundType=529Plans&FundIntExt=INT&FundId={$symbol}&fundName={$symbol}&radiobutton2=1&beginDate='.$t2->mon.'%2F'.$t2->mday.'%2F'.$t2->year.'&endDate='.$t->mon.'%2F'.$t->mday.'%2F'.$t->year.'&year=#res');
 # Vanguard price history doesn't like invalid dates, so we pass a date range 
from a week ago through today - this range will always return SOME valid data, 
unless markets close for several days.

         # Get the web page
        $url   = $URL->fill_in(HASH => {symbol => $symbol});
        $reply = $ua->request( GET $url);
        $code  = $reply->code;
        $desc  = HTTP::Status::status_message($code);
        $body  = decode('UTF-8', $reply->content);

         if ($code != 200) {
            $info{ $symbol, 'success' } = 0;
            $info{ $symbol, 'errormsg' } = $desc;
            next;
        } 

 # Extract first table.  my $te = HTML::TableExtract->new( headers => [qw(Date 
Price)] );
        $te->parse($body);


 my $ts = $te->first_table_found();
  # It's a simple table - just dates and prices.
 my $currprice;
 my $currdate;

  # Iterate over table. We will end up passing the last row (most current 
price) to the constructor below.
 foreach my $row ($ts->rows) {
 $currprice = @$row[1];
 $currdate = @$row[0];
 }

         eval {
 $info{$symbol, 'symbol'}             = $symbol;
 $info{$symbol, 'method'}             = 'vanguardportfolios529';
 $info{$symbol, 'nav'}                = $currprice =~ s/[\$,]//g ? $currprice : 
die('failed to parse last price');
 $info{$symbol, 'currency'}           = 'USD';
 $info{$symbol, 'success'}            = 1;
 $quoter->store_date( \%info, $symbol, { usdate => $currdate } );
 }

 or do {
 $info{$symbol, 'errormsg'} = $@;
 $info{$symbol, 'success'}  = 0;
        }

  }

    return wantarray() ? %info : \%info;
}


1;


gnc-fq-dump output

C:\Program Files (x86)\gnucash\bin>perl gnc-fq-dump vanguardportfolios529 4517
Finance::Quote fields Gnucash uses:
symbol: 4517                 <=== required
date: 11/15/2019             <=== recommended
currency: USD                <=== required
last:                        <=\
nav: 51.22                   <=== one of these
price:                       <=/
timezone:                   

[GNC] (Reformatted) Crash with no information when using custom F::Q module

2019-11-18 Thread Derek Robinson via gnucash-user
Apologies - I don't know why the linebreaks didn't work in my last message. 
Please disregard that (unreadable) version.
New to the list - please direct me to previous posts if I've missed something 
that will explain what's happening.
I wrote a custom F::Q module to extract daily "prices" from Vanguard 529 plan 
portfolios that are not traded on exchanges. I believe I've done that 
correctly. When I run gnc-fq-dump, I get return values that make sense and 
appear to be the same returns I would get from using an existing module (say 
yahoo_json) to query for a traded security (say CSCO). However, when I 
configure one of my securities in Gnucash (build 3.7+, F::Q version 1.49) the 
program crashes. There is no log output in gnucash.trace.xx.log (the file 
exists, but it's blank) and no useful information from gdb. I may have 
installed gdb incorrectly, or maybe I'm using it incorrectly. All I get is 
"Inferior 1 (process ) exited with code 01" and "No stack" after using bt.
I'd appreciate any guidance an experienced user can provide. Thanks!
Derek

package Finance::Quote::VanguardPortfolios529;
require 5.005;
our $VERSION = '1.49'; # VERSION
use strict;
use HTTP::Request::Common;
use HTML::TableExtract;
use HTML::TreeBuilder;
use Text::Template;
use Encode qw(decode);
use Time::Piece;

sub methods { 
  return ( vanguardportfolios529   => \&vanguardportfolios529 );
}

my @labels = qw/date isodate nav/;

sub labels {
  return ( iexcloud => \@labels, );
}

sub vanguardportfolios529 {

    my $quoter = shift;
    my @portfolios = @_;
        my (%info, $symbol, $url, $reply, $code, $desc, $body);
    my $ua = $quoter->user_agent();    
    my $quantity = @portfolios;
    foreach my $symbol (@portfolios) {
  my $t = localtime;
 my $t2 = $t - 7*86400;
 my $URL = Text::Template->new(TYPE => 'STRING', SOURCE => 
'https://personal.vanguard.com/us/funds/tools/pricehistorysearch?radio=1&results=get&FundType=529Plans&FundIntExt=INT&FundId={$symbol}&fundName={$symbol}&radiobutton2=1&beginDate='.$t2->mon.'%2F'.$t2->mday.'%2F'.$t2->year.'&endDate='.$t->mon.'%2F'.$t->mday.'%2F'.$t->year.'&year=#res');
 # Vanguard price history doesn't like invalid dates, so we pass a date range 
from a week ago through today - this range will always return SOME valid data, 
unless markets close for several days.

         # Get the web page
        $url   = $URL->fill_in(HASH => {symbol => $symbol});
        $reply = $ua->request( GET $url);
        $code  = $reply->code;
        $desc  = HTTP::Status::status_message($code);
        $body  = decode('UTF-8', $reply->content);

         if ($code != 200) {
            $info{ $symbol, 'success' } = 0;
            $info{ $symbol, 'errormsg' } = $desc;
            next;
        } 

 # Extract first table.   my $te = HTML::TableExtract->new( headers => [qw(Date 
Price)] );
        $te->parse($body);


 my $ts = $te->first_table_found();
  # It's a simple table - just dates and prices.
 my $currprice;
 my $currdate;

  # Iterate over table. We will end up passing the last row (most current 
price) to the constructor below.
 foreach my $row ($ts->rows) {
 $currprice = @$row[1];
 $currdate = @$row[0];
 }

         eval {
 $info{$symbol, 'symbol'}             = $symbol;
 $info{$symbol, 'method'}             = 'vanguardportfolios529';
 $info{$symbol, 'nav'}                = $currprice =~ s/[\$,]//g ? $currprice : 
die('failed to parse last price');
 $info{$symbol, 'currency'}           = 'USD';
 $info{$symbol, 'success'}            = 1;
 $quoter->store_date( \%info, $symbol, { usdate => $currdate } );
 }

 or do {
 $info{$symbol, 'errormsg'} = $@;
 $info{$symbol, 'success'}  = 0;
        }

  }

    return wantarray() ? %info : \%info;
}


1;


gnc-fq-dump output

C:\Program Files (x86)\gnucash\bin>perl gnc-fq-dump vanguardportfolios529 4517
Finance::Quote fields Gnucash uses:
symbol: 4517                 <=== required
date: 11/15/2019             <=== recommended
currency: USD                <=== required
last:                        <=\
nav: 51.22                   <=== one of these
price:                       <=/
timezone:                    <=== optional


___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.


[GNC] Crash with no information when using custom F::Q module

2019-11-18 Thread Derek Robinson via gnucash-user
New to the list - please direct me to previous posts if I've missed something 
that will explain what's happening.
I wrote a custom F::Q module to extract daily "prices" from Vanguard 529 plan 
portfolios that are not traded on exchanges. I believe I've done that 
correctly. When I run gnc-fq-dump, I get return values that make sense and 
appear to be the same returns I would get from using an existing module (say 
yahoo_json) to query for a traded security (say CSCO). However, when I 
configure one of my securities in Gnucash (build 3.7+, F::Q version 1.49) the 
program crashes. There is no log output in gnucash.trace.xx.log (the file 
exists, but it's blank) and no useful information from gdb. I may have 
installed gdb incorrectly, or maybe I'm using it incorrectly. All I get is 
"Inferior 1 (process ) exited with code 01" and "No stack" after using bt.
I'd appreciate any guidance an experienced user can provide. Thanks!
Derek

F::Q module code

package Finance::Quote::VanguardPortfolios529;
require 5.005;
our $VERSION = '1.49'; # VERSION
use strict;use HTTP::Request::Common;use HTML::TableExtract;use 
HTML::TreeBuilder;use Text::Template;use Encode qw(decode);use Time::Piece;
sub methods {   return ( vanguardportfolios529   => \&vanguardportfolios529 );}
my @labels = qw/date isodate nav/;sub labels {  return ( iexcloud => \@labels, 
);}
sub vanguardportfolios529 {    my $quoter = shift;    my @portfolios = @_;      
  my (%info, $symbol, $url, $reply, $code, $desc, $body);    my $ua = 
$quoter->user_agent();        my $quantity = @portfolios;
    foreach my $symbol (@portfolios) {  my $t = localtime; my $t2 = $t - 
7*86400; my $URL = Text::Template->new(TYPE => 'STRING', SOURCE => 
'https://personal.vanguard.com/us/funds/tools/pricehistorysearch?radio=1&results=get&FundType=529Plans&FundIntExt=INT&FundId={$symbol}&fundName={$symbol}&radiobutton2=1&beginDate='.$t2->mon.'%2F'.$t2->mday.'%2F'.$t2->year.'&endDate='.$t->mon.'%2F'.$t->mday.'%2F'.$t->year.'&year=#res');
 # Vanguard price history doesn't like invalid dates, so we pass a date range 
from a week ago through today - this range will always return SOME valid data, 
unless markets close for several days.         # Get the web page        $url   
= $URL->fill_in(HASH => {symbol => $symbol});        $reply = $ua->request( GET 
$url);        $code  = $reply->code;        $desc  = 
HTTP::Status::status_message($code);        $body  = decode('UTF-8', 
$reply->content);         if ($code != 200) {            $info{ $symbol, 
'success' } = 0;            $info{ $symbol, 'errormsg' } = $desc;            
next;        }  # Extract first table.  my $te = HTML::TableExtract->new( 
headers => [qw(Date Price)] );        $te->parse($body);
 my $ts = $te->first_table_found();  # It's a simple table - just dates and 
prices. my $currprice; my $currdate;  # Iterate over table. We will end up 
passing the last row (most current price) to the constructor below. foreach my 
$row ($ts->rows) { $currprice = @$row[1]; $currdate = @$row[0]; }         eval 
{ $info{$symbol, 'symbol'}             = $symbol; $info{$symbol, 'method'}      
       = 'vanguardportfolios529'; $info{$symbol, 'nav'}                = 
$currprice =~ s/[\$,]//g ? $currprice : die('failed to parse last price'); 
$info{$symbol, 'currency'}           = 'USD'; $info{$symbol, 'success'}         
   = 1; $quoter->store_date( \%info, $symbol, { usdate => $currdate } ); } or 
do { $info{$symbol, 'errormsg'} = $@; $info{$symbol, 'success'}  = 0;        }  
}
    return wantarray() ? %info : \%info;}
1;

gnc-fq-dump output
C:\Program Files (x86)\gnucash\bin>perl gnc-fq-dump vanguardportfolios529 
4517Finance::Quote fields Gnucash uses:    symbol: 4517                 <=== 
required      date: 11/15/2019           <=== recommended  currency: USD        
          <=== required      last:                      <=\       nav: 51.22    
            <=== one of these     price:                      <=/  timezone:    
                  <=== optional
C:\Program Files (x86)\gnucash\bin>




___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.