Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dialog-price-edit-db.cpp] Copy the latest price when creating a new entry from a commodity selection #1932

Conversation

boomer41
Copy link
Contributor

When a price entry is selected, it's contents get copied 1:1 to the newly created price to facilitate faster entry based on existing values (e.g. the type).
When selecting a commodity instead, the user is presented with an empty price entry where only the commodity is set.

IMO the user ends up with the same values (except the price of course) as the latest entry.
So we check whether we have a (latest) entry and use that as the template,
so that e.g. the type gets copied, too.
This spares the user some clicks.

@jralls
Copy link
Member

jralls commented Apr 30, 2024

IMO the user ends up with the same values (except the price of course) as the latest entry.

There's nothing here that empties the price. Was it your intention to? Might it make sense to change the date to today instead of defaulting to the last price's date?

@boomer41
Copy link
Contributor Author

IMO the user ends up with the same values (except the price of course) as the latest entry.

There's nothing here that empties the price. Was it your intention to? Might it make sense to change the date to today instead of defaulting to the last price's date?

See my reply in the discussion thread. It will be zeroed.

…entry from a commodity selection

When a price entry is selected, it's contents get copied 1:1 to the newly created price to facilitate faster entry based on existing values (e.g. the type).
When selecting a commodity instead, the user is presented with an empty price entry where only the commodity is set.
IMO the user ends up with the same values (except the price of course) as the latest entry.
So we check whether we have a (latest) entry and use that as the template, so that e.g. the type gets copied, too.
This spares the user some clicks.
@boomer41 boomer41 force-pushed the feature/pricedb-add-clone-from-latest branch from 11a5082 to c10af4e Compare April 30, 2024 19:42
@code-gnucash-org code-gnucash-org merged commit a53ed8f into Gnucash:stable May 5, 2024
3 of 4 checks passed
@jralls
Copy link
Member

jralls commented May 5, 2024

Thanks!

@boomer41 boomer41 deleted the feature/pricedb-add-clone-from-latest branch May 5, 2024 06:03
@boomer41
Copy link
Contributor Author

boomer41 commented May 5, 2024

Thanks!

You may have misspelled my name in the merge commit message, but all good :D
Thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants