frappe / press

Full service cloud hosting for the Frappe stack - powers Frappe Cloud
https://frappe.cloud
GNU Affero General Public License v3.0
260 stars 186 forks source link

Refactor conversion logic #523

Open rutwikhdev opened 2 years ago

rutwikhdev commented 2 years ago
shikhar13012001 commented 2 years ago

I want to work on this issue @rutwikhdev can you please assign this to me?

NagariaHussain commented 2 years ago

right now we just have price_inr and price_usd fields all over the place

Because we want separate pricing for India and International countries.

Maybe the conversion using some exchange rate will make sense at some places, but not in our plan doctypes etc.

Even if we use single currency fields with domain, we will have hardcoded conversion rates 😅 (otherwise we will have changing plan rates every time).

rutwikhdev commented 2 years ago

right now we just have price_inr and price_usd fields all over the place

I think there are few use cases where we have different pricing. Most places we use $1 ~ 75 INR. We could just configure our own conversion rate. 50-100 INR here and there won't make a difference in edge cases ig😅

It just seems very repetitive and dumb fetching different prices based on currencies and countries.

Wherever we need different pricing we could just have some sort of multiplier field.

casesolved-co-uk commented 1 month ago

Can I also suggest as part of this that you think about introducing a new money type and Currency fieldtype in frappe?

ERPNext suffers from using separate decimal and currency fields which makes the code messy. (ERPNext also solves the currency exchange issue btw, maybe this should be moved to frappe?)

frappe could really do with a new money type in python and possibly JS, and possibly a better way of storing this in the db. Here's an actively maintained type:

https://github.com/py-moneyed/py-moneyed