Re: [GNC-dev] Auto reconcile from register window

2020-10-28 Thread Cristian Klein
Hi all,

The missing auto-clear menu in gnc-plugin-page-register-ui.xml and
gnc-plugin-page-register2-ui.xml were an omission. I used to right-click
the account from the tree view, so I never noticed the missing menu items.
I fixed this in the previously mentioned PR [1].

I checked how this feature behaves with "non-accounts" (i.e, search
results), and the menu item is disabled as one would expect.

[1] https://github.com/Gnucash/gnucash/pull/805

În mie., 28 oct. 2020 la 07:15, Christopher Lam 
a scris:

> I see no objections myself.
>
> Auto-clear will have increased test coverage[1] and visibility, and I have
> a plan to modify so that the hash-table is generated once as soon as the
> dialog is created, saved within the dialog, and updated when the end_value
> is changed. Thus the user could have live feedback whenever a valid
> autoclear target is entered. The algorithm can also be improved to clear
> even when splits have duplicate amounts, see PR[1].
>
> [1] https://github.com/Gnucash/gnucash/pull/805
>
> On Wed, 28 Oct 2020, 2:03 pm Mike Alexander,  wrote:
>
> > Yes, but, Autoclear doesn't need an account any more than reconcile
> > needs one.  Both gnc_plugin_page_register_cmd_reconcile and
> > gnc_plugin_page_register_cmd_autoclear call
> > gnc_plugin_page_register_get_account to get the account to work on.
> > This may return a null pointer if the register doesn't have a clearly
> > defined account (e.g. search results), but it works as well for one
> > caller as for the other.  Reconcile calls recnWindow to do the real work
> > and it checks for a null account and returns immediately if given one.
> > The corresponding autoclear method is autoClearWindow and it doesn't
> > check for a null account pointer.
> >
> > It seems to me that if we fix autoClearWindow to check for a null
> > account and hook up the menu item in the register window things should
> > work fine.  I can do that unless someone knows why it's a bad idea.
> >
> > Mike
> >
> > On 26 Oct 2020, at 2:49, Christopher Lam wrote:
> >
> > > Having said that, when we type into the blank entry it knows which
> > > account to tie the split to... So, the account could be found
> > > somewhere...
> > >
> > > On Mon, 26 Oct 2020, 2:38 pm Christopher Lam,
> > >  wrote:
> > > From my understanding, this code is not hooked up to the register
> > > because: a register is always a search list, and not necessarily tied
> > > to an account. Proof: the blank transaction register entry has no
> > > account.
> > >
> > > I gather the original coder noticed the same, therefore didn't hook
> > > it.
> >
> ___
> gnucash-devel mailing list
> gnucash-devel@gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-devel
>


-- 
Cristian Klein, PhD
CTO
www.kleinlabs.com
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: [GNC-dev] Auto reconcile from register window

2020-10-28 Thread Christopher Lam
I see no objections myself.

Auto-clear will have increased test coverage[1] and visibility, and I have
a plan to modify so that the hash-table is generated once as soon as the
dialog is created, saved within the dialog, and updated when the end_value
is changed. Thus the user could have live feedback whenever a valid
autoclear target is entered. The algorithm can also be improved to clear
even when splits have duplicate amounts, see PR[1].

[1] https://github.com/Gnucash/gnucash/pull/805

On Wed, 28 Oct 2020, 2:03 pm Mike Alexander,  wrote:

> Yes, but, Autoclear doesn't need an account any more than reconcile
> needs one.  Both gnc_plugin_page_register_cmd_reconcile and
> gnc_plugin_page_register_cmd_autoclear call
> gnc_plugin_page_register_get_account to get the account to work on.
> This may return a null pointer if the register doesn't have a clearly
> defined account (e.g. search results), but it works as well for one
> caller as for the other.  Reconcile calls recnWindow to do the real work
> and it checks for a null account and returns immediately if given one.
> The corresponding autoclear method is autoClearWindow and it doesn't
> check for a null account pointer.
>
> It seems to me that if we fix autoClearWindow to check for a null
> account and hook up the menu item in the register window things should
> work fine.  I can do that unless someone knows why it's a bad idea.
>
> Mike
>
> On 26 Oct 2020, at 2:49, Christopher Lam wrote:
>
> > Having said that, when we type into the blank entry it knows which
> > account to tie the split to... So, the account could be found
> > somewhere...
> >
> > On Mon, 26 Oct 2020, 2:38 pm Christopher Lam,
> >  wrote:
> > From my understanding, this code is not hooked up to the register
> > because: a register is always a search list, and not necessarily tied
> > to an account. Proof: the blank transaction register entry has no
> > account.
> >
> > I gather the original coder noticed the same, therefore didn't hook
> > it.
>
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: [GNC-dev] Auto reconcile from register window

2020-10-28 Thread Mike Alexander
Yes, but, Autoclear doesn't need an account any more than reconcile 
needs one.  Both gnc_plugin_page_register_cmd_reconcile and 
gnc_plugin_page_register_cmd_autoclear call 
gnc_plugin_page_register_get_account to get the account to work on.  
This may return a null pointer if the register doesn't have a clearly 
defined account (e.g. search results), but it works as well for one 
caller as for the other.  Reconcile calls recnWindow to do the real work 
and it checks for a null account and returns immediately if given one.  
The corresponding autoclear method is autoClearWindow and it doesn't 
check for a null account pointer.


It seems to me that if we fix autoClearWindow to check for a null 
account and hook up the menu item in the register window things should 
work fine.  I can do that unless someone knows why it's a bad idea.


Mike

On 26 Oct 2020, at 2:49, Christopher Lam wrote:

Having said that, when we type into the blank entry it knows which 
account to tie the split to... So, the account could be found 
somewhere...


On Mon, 26 Oct 2020, 2:38 pm Christopher Lam, 
 wrote:
From my understanding, this code is not hooked up to the register 
because: a register is always a search list, and not necessarily tied 
to an account. Proof: the blank transaction register entry has no 
account.


I gather the original coder noticed the same, therefore didn't hook 
it.

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


Re: [GNC-dev] Auto reconcile from register window

2020-10-26 Thread Christopher Lam
Having said that, when we type into the blank entry it knows which account
to tie the split to... So, the account could be found somewhere...

On Mon, 26 Oct 2020, 2:38 pm Christopher Lam, 
wrote:

> From my understanding, this code is not hooked up to the register because:
> a register is always a search list, and not necessarily tied to an account.
> Proof: the blank transaction register entry has no account.
>
> I gather the original coder noticed the same, therefore didn't hook it.
>
> On Mon, 26 Oct 2020, 2:10 pm Mike Alexander,  wrote:
>
>> I noticed the recent checkins related to the auto reconcile feature.
>> This intrigued me since I didn't know such a feature existed.  After
>> looking around for a while it appears that this is because it is only
>> available for the account tree and I always start a reconcile from the
>> register window.  Code exists in gnc-plugin-page-register.c to implement
>> it, but there isn't anything in gnc-plugin-page-register-ui.xml to
>> create the menu entry to invoke it.  I presume this is an oversight, or
>> is there some reason this shouldn't be hooked up?  Or am I missing
>> something obvious?  The same thing applies to
>> gnc-plugin-page-register2-ui.xml.
>>
>> Mike
>> ___
>> gnucash-devel mailing list
>> gnucash-devel@gnucash.org
>> https://lists.gnucash.org/mailman/listinfo/gnucash-devel
>>
>
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: [GNC-dev] Auto reconcile from register window

2020-10-26 Thread Christopher Lam
>From my understanding, this code is not hooked up to the register because:
a register is always a search list, and not necessarily tied to an account.
Proof: the blank transaction register entry has no account.

I gather the original coder noticed the same, therefore didn't hook it.

On Mon, 26 Oct 2020, 2:10 pm Mike Alexander,  wrote:

> I noticed the recent checkins related to the auto reconcile feature.
> This intrigued me since I didn't know such a feature existed.  After
> looking around for a while it appears that this is because it is only
> available for the account tree and I always start a reconcile from the
> register window.  Code exists in gnc-plugin-page-register.c to implement
> it, but there isn't anything in gnc-plugin-page-register-ui.xml to
> create the menu entry to invoke it.  I presume this is an oversight, or
> is there some reason this shouldn't be hooked up?  Or am I missing
> something obvious?  The same thing applies to
> gnc-plugin-page-register2-ui.xml.
>
> Mike
> ___
> gnucash-devel mailing list
> gnucash-devel@gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-devel
>
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel