Re: [GNC] Customizing invoices (Helmut Eller

2022-03-31 Thread john
Adrien,

Sort of. Yes, quantity is a multiplier of a commodity, but the way the 
commodity is measured affects what are the legitimate fractions the quantity 
can use. If you sell something by the kilo and have a scale that's accurate to 
the gram then the fraction for that commodity is 1/1000. If on the other hand 
you sell it by the pound and have a scale accurate to the 1/10 ounce then the 
fraction of the commodity is 1/160. If the commodity is labor sold by the hour 
with 15-minute increments then the fraction is 1/4. As it happens all of those 
are exactly representable with decimal fractions, but change that labor 
fraction to minutes (1/60) and it no longer is; same for years with month, 
week, or day fractions.

Now it turns out that the register used in creating invoices and bills ignores 
the commodity's fraction and always uses 10^9, so you're right that changing 
the fraction on the commodity won't help until we get that fixed. I *think* 
that the 2-decimals issue is a display problem and that the internal numbers 
aren't being rounded to two decimals, but I've been (and still am) busy with 
other work and haven't yet tested to find out what's really going on.

Regards,
John Ralls

> On Mar 31, 2022, at 5:57 AM, Adrien Monteleone 
>  wrote:
> 
> John,
> 
> Sorry I guess I misunderstood your suggestion wrong.
> 
> What's throwing me off is that setting up a non-currency commodity isn't 
> going to help as I see it. Quantity is not a commodity. It is the multiplier 
> of one.
> 
> A line-item on an invoice is always some multiplier of a currency.
> 
> The OPs use case is trying to set the multiplier more accurately than 2 
> decimal places allow. (the invoice lets you do so, but the invoice report 
> doesn't show this precision, though it retains the proper line-item total.)
> 
> Regards,
> Adrien
> 
> On 3/30/22 8:33 PM, john wrote:
>> Not a currency: Currency smallest fractions are set by law in the currency's 
>> issuing country, the ISO4217 committee maintains a list, and GnuCash follows 
>> that list. Non-currency commodities are more user-configurable via the 
>> Security editor, though you'll make yourself crazy if you set something 
>> different from what fraction actually trades for securities. For commodities 
>> that aren't securities or currencies it may make sense to set some other 
>> fraction, as in the example of the user selling subscriptions denominated in 
>> years who wants a fraction of 1/12.
> 
> ___
> 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] Customizing invoices (Helmut Eller

2022-03-31 Thread Adrien Monteleone

John,

Sorry I guess I misunderstood your suggestion wrong.

What's throwing me off is that setting up a non-currency commodity isn't 
going to help as I see it. Quantity is not a commodity. It is the 
multiplier of one.


A line-item on an invoice is always some multiplier of a currency.

The OPs use case is trying to set the multiplier more accurately than 2 
decimal places allow. (the invoice lets you do so, but the invoice 
report doesn't show this precision, though it retains the proper 
line-item total.)


Regards,
Adrien

On 3/30/22 8:33 PM, john wrote:

Not a currency: Currency smallest fractions are set by law in the currency's 
issuing country, the ISO4217 committee maintains a list, and GnuCash follows 
that list. Non-currency commodities are more user-configurable via the Security 
editor, though you'll make yourself crazy if you set something different from 
what fraction actually trades for securities. For commodities that aren't 
securities or currencies it may make sense to set some other fraction, as in 
the example of the user selling subscriptions denominated in years who wants a 
fraction of 1/12.


___
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] Customizing invoices (Helmut Eller

2022-03-30 Thread john
Not a currency: Currency smallest fractions are set by law in the currency's 
issuing country, the ISO4217 committee maintains a list, and GnuCash follows 
that list. Non-currency commodities are more user-configurable via the Security 
editor, though you'll make yourself crazy if you set something different from 
what fraction actually trades for securities. For commodities that aren't 
securities or currencies it may make sense to set some other fraction, as in 
the example of the user selling subscriptions denominated in years who wants a 
fraction of 1/12.

Regards,
John Ralls


> On Mar 30, 2022, at 9:35 AM, Adrien Monteleone 
>  wrote:
> 
> Helmut,
> 
> It isn't a matter of using securities on invoices.
> 
> The Security Editor is simply where you set the smallest fraction of a 
> currency. (and thus the number of digits displayed) John is proposing tying 
> that setting in to be used outside of securities, in this case for invoices 
> amounts. (so you only set it one place)
> 
> But that is a separate issue from Quantity. Chris is working on a solution 
> for both. (while researching your Quantity issue, I found the same problem 
> exists for Unit Prices, so they're getting tackled together)
> 
> Regards,
> Adrien
> 
> On 3/30/22 1:31 AM, Helmut Eller wrote:
>> On Tue, Mar 29 2022, John Ralls wrote:
>>> I'd think amounts on invoices should be in some integer multiple of
>>> the commodity's smallest fraction traded--that's a property of the
>>> commodity that you set in the New/Edit Security dialog--and should
>>> display as a decimal with the appropriate number of places if the
>>> fraction's denominator is a power of 10 or a rational number if not.
>>> 
>>> Does that seem reasonable?
>> I'm not sure how securities can be used for invoices. Anyway, in my
>> case we need to split up some amount of money among seven people
>> (members of a condominium). So I thought it would be nice to use the
>> original amount as unit price and 1/7 as quantity.
>> I think the legally correct way would be to used 143‰ (per mille)
>> instead of the exact fraction.
>> Though, I must say that it's a cool feature that GnuCash uses exact
>> fractions internally. And thanks to everybody who works on this.
> 
> ___
> 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] Customizing invoices (Helmut Eller

2022-03-30 Thread Adrien Monteleone

Helmut,

It isn't a matter of using securities on invoices.

The Security Editor is simply where you set the smallest fraction of a 
currency. (and thus the number of digits displayed) John is proposing 
tying that setting in to be used outside of securities, in this case for 
invoices amounts. (so you only set it one place)


But that is a separate issue from Quantity. Chris is working on a 
solution for both. (while researching your Quantity issue, I found the 
same problem exists for Unit Prices, so they're getting tackled together)


Regards,
Adrien

On 3/30/22 1:31 AM, Helmut Eller wrote:

On Tue, Mar 29 2022, John Ralls wrote:


I'd think amounts on invoices should be in some integer multiple of
the commodity's smallest fraction traded--that's a property of the
commodity that you set in the New/Edit Security dialog--and should
display as a decimal with the appropriate number of places if the
fraction's denominator is a power of 10 or a rational number if not.

Does that seem reasonable?


I'm not sure how securities can be used for invoices.  Anyway, in my
case we need to split up some amount of money among seven people
(members of a condominium).  So I thought it would be nice to use the
original amount as unit price and 1/7 as quantity.

I think the legally correct way would be to used 143‰ (per mille)
instead of the exact fraction.

Though, I must say that it's a cool feature that GnuCash uses exact
fractions internally.  And thanks to everybody who works on this.


___
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] Customizing invoices (Helmut Eller

2022-03-30 Thread Helmut Eller
On Tue, Mar 29 2022, John Ralls wrote:

> I'd think amounts on invoices should be in some integer multiple of
> the commodity's smallest fraction traded--that's a property of the
> commodity that you set in the New/Edit Security dialog--and should
> display as a decimal with the appropriate number of places if the
> fraction's denominator is a power of 10 or a rational number if not.
>
> Does that seem reasonable?

I'm not sure how securities can be used for invoices.  Anyway, in my
case we need to split up some amount of money among seven people
(members of a condominium).  So I thought it would be nice to use the
original amount as unit price and 1/7 as quantity.

I think the legally correct way would be to used 143‰ (per mille)
instead of the exact fraction.

Though, I must say that it's a cool feature that GnuCash uses exact
fractions internally.  And thanks to everybody who works on this.

Helmut
___
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] Customizing invoices (Helmut Eller

2022-03-29 Thread Adrien Monteleone
Thanks to you and Chris for investigating. Hopefully, this will resolve 
the discrepancy.


Regards,
Adrien

On 3/29/22 10:50 PM, john wrote:

Chris has created https://bugs.gnucash.org/show_bug.cgi?id=798496 
 to document working on that.


___
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] Customizing invoices (Helmut Eller

2022-03-29 Thread john



> On Mar 29, 2022, at 7:58 PM, Adrien Monteleone 
>  wrote:
> 
> It doesn't affect it now, but that would be reasonable at least for prices. 
> And if someone is really intent on 4 decimal precision for a quantity, 
> perhaps their answer is to rethink the base unit of the invoice item. (one 
> could argue that should be the answer here too I suppose)

Not at all. They simply need to make sure that the "Smallest Fraction Traded" 
value in the security editor for that commodity is 1/1.

Now apparently the report code doesn't honor that, and Chris has created 
https://bugs.gnucash.org/show_bug.cgi?id=798496 
 to document working on that.

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.


Re: [GNC] Customizing invoices (Helmut Eller

2022-03-29 Thread Adrien Monteleone

On 3/29/22 5:14 PM, John Ralls wrote:




On Mar 29, 2022, at 10:33 AM, Adrien Monteleone 
 wrote:

The report should simply print the data from the invoice unchanged.


Be careful what you ask for. The data from the invoice is a rational number, 
meaning a numerator and a denominator. The print routine will print that as an 
integer plus a fraction. Remember all of the complaining a few years ago when 
the price editor showed numbers like 123 + 45/6789? Do you *really* want your 
invoices to look like that?


Oops, yeah, I was making assumptions and shouldn't do that, certainly 
without investigating. (but then I'd already understand how the number 
is stored)


Or were you thinking "unchanged" means in decimal form but with no rounding? So 
if you have say 1/3 your printer keeps printing pages full of '3' until it runs out of 
paper? ;-)


As I mentioned in IRC, the 'view' of the invoice retains the precision 
'as entered' but the Invoice Report mangles it. To me, that's the bug. A 
user would reasonable expect a printed version of a 'view' to be the 
same data-wise as the view itself.


At the very least, the info should not be so altered as to render it 
incorrect, or at least certainly un-helpful (such as rounding/truncating 
to '0.00' when that is false)


Of course, there are understandable physical screen/paper limits to 
displaying or printing rational numbers. (if someone uses π, ϕ, √2, or 
e, they're own their own!)


There's a preference for force prices to decimal. If that's set then prices 
displayed in the Price Database window and the register are rounded to 1/100th 
of the smallest currency unit in which the price is denominated. For most 
currencies that's two decimal places so prices are displayed with four. The 
same could be applied to invoices and other reports.

I'd think amounts on invoices should be in some integer multiple of the 
commodity's smallest fraction traded--that's a property of the commodity that 
you set in the New/Edit Security dialog--and should display as a decimal with 
the appropriate number of places if the fraction's denominator is a power of 10 
or a rational number if not.

Does that seem reasonable?


It doesn't affect it now, but that would be reasonable at least for 
prices. And if someone is really intent on 4 decimal precision for a 
quantity, perhaps their answer is to rethink the base unit of the 
invoice item. (one could argue that should be the answer here too I suppose)


The bug I filed isn't about these questions though. It is that this 
already is not much of a problem in the Invoice 'view', but that this 
same info is mangled as it makes its way to a printable report.


Regards,
Adrien

___
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] Customizing invoices (Helmut Eller

2022-03-29 Thread John Ralls



> On Mar 29, 2022, at 10:33 AM, Adrien Monteleone 
>  wrote:
> 
> The report should simply print the data from the invoice unchanged.

Be careful what you ask for. The data from the invoice is a rational number, 
meaning a numerator and a denominator. The print routine will print that as an 
integer plus a fraction. Remember all of the complaining a few years ago when 
the price editor showed numbers like 123 + 45/6789? Do you *really* want your 
invoices to look like that?

Or were you thinking "unchanged" means in decimal form but with no rounding? So 
if you have say 1/3 your printer keeps printing pages full of '3' until it runs 
out of paper? ;-)


There's a preference for force prices to decimal. If that's set then prices 
displayed in the Price Database window and the register are rounded to 1/100th 
of the smallest currency unit in which the price is denominated. For most 
currencies that's two decimal places so prices are displayed with four. The 
same could be applied to invoices and other reports.

I'd think amounts on invoices should be in some integer multiple of the 
commodity's smallest fraction traded--that's a property of the commodity that 
you set in the New/Edit Security dialog--and should display as a decimal with 
the appropriate number of places if the fraction's denominator is a power of 10 
or a rational number if not. 

Does that seem reasonable?

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.


Re: [GNC] Customizing invoices (Helmut Eller

2022-03-29 Thread Adrien Monteleone
David, it seems the list-thread is broken, so for completeness, I'm 
posting there that I filed bug: 
https://bugs.gnucash.org/show_bug.cgi?id=798493 on this issue.


This also happens for the Unit Price column.

The report should simply print the data from the invoice unchanged.

Regards,
Adrien

On 3/28/22 7:31 PM, David Long wrote:

I have same problem as Helmut who wants to display more than 2 decimal
places in the quantity field of an invoice. My case is if I want to charge
say 7 months of an annual subscription then my quantity is 7 12ths so 3
decimal places would be better.
My only workaround was to add it in the description.


___
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.