I need to setup commission value field for my project, which should allow both currencies and percentage as unit type. AFAIK I can't use Money CCK for percentage values. Currently I use combination of CCK Number field for numeric value and Content Taxonomy for unit type (which is attached to taxonomy containing all currencies and units) but I know it's ugly cause there are problems with multiple values and I will have to duplicate lot of code that seems to be already written.
Could you advise me, what could be done to use both numeric and percentage values, without rewriting most of the MoneyCCK in my custom module ? I would like to reuse as most of Money CCK as I can (that means I can program but would prefer small customisations).

Comments

crea’s picture

Hmm, would inserting fake "%" currency work ? I don't need stuff like converting etc, and it should not break sorting cause MoneyCCK seem to sort only within the scope of single selected currency.

crea’s picture

Don't know if it's implemented or not, but it would be nice to turn Money CCK module field into more generic module, that would allow to implement unit types and possible operations as plug-ins. Currency then would become first supported plugin. And then implementing percentages would be soo easy...
I would call that module something like"Metrics", with the following slogan: "With the Metrics module, now you CAN compare apples to oranges!"
:-D

What do you think ?

crea’s picture

I explained my ideas in #530786: Merge Money CCK (+Currency API ???) and Units API into single bundle
Please take a look at that.

However, until this is implemented, original support request stands..

markus_petrux’s picture

Here's a couple of suggestions:

1) You could modify the currency_api to include percents.
2) You could look at the multigroup module included in CCK3, and here you could combine a formatted number with anything else.

crea’s picture

Thanks for answering.
I am going to evaluate 1. In case of 2 I would lose nice features of Money CCK such as formatters and display settings ;)

crea’s picture

Btw, did you like my idea of generic module ? Would you abandon (or say, feature freeze) Money CCK module in favor of more generic module and become it's maintainer ?

markus_petrux’s picture

Status: Active » Fixed

It seems to me this cannot be done within the scope of the Money module, so I would say this support request is close to fixed.

Your idea for a generic module is nice, and I would say that would be the way to go, but I don't have time for that either. At this moment I need more hands and hours in a day than I actually have.

crea’s picture

See MVF and Units ;)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.