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

Issue 411: Pricing formulas #522

Open
wants to merge 17 commits into
base: development
Choose a base branch
from

Conversation

veggiematts
Copy link
Contributor

See Issue #411 for description.

Test plan:

  • Apply the database update (resources/install/protected/3.0.0/005-411.sql (will move prior merging))
  • Create a formula in resources admin -> pricing formulas
    pricing_1
  • Edit the cost history for a resource
  • Check that the formula you created is available in the dropdown list
    pricing_2
  • Once the formula is selected, fill values for the formula, and click save
  • Check that the payment amount is populated according to the formula values.
    pricing_3

Once the cost informations are saved, the formula is displayed with its values on cost history edition.

 - Add/edit/delete formulas in admin
 - Use formulas in costs
 - Use cost_to_integer and integer_to_cost
 - Fix line removal
 - Improve UI, add translations
 - Prevent formulas with non-mathematical expressions from being executed
 - Display formula with values once saved
 - use number_format to have consistent number format
 - Fix formula regex
 - Remove log message
 - Zeroing unprovided values
@veggiematts veggiematts added the enhancement This is an enhancement (not a bug) label Dec 18, 2018
 - Fix form for proper display on small resolutions
 - Fix use of simple and double quotes in pricing formula field names
  - use number_format to have consistent number format (follow-up)
@xsong9
Copy link
Contributor

xsong9 commented Feb 2, 2021

The Steering Committee reviewed the request and a couple of questions came up regarding the potential use. We'd love to discuss this with you at a future Steering Committee meeting.

@veggiematts
Copy link
Contributor Author

Hi,

Sure, we'll try to be there at the next Coral SC meeting to answer your questions.

@veggiematts
Copy link
Contributor Author

Any specific questions, by the way ?

@xsong9
Copy link
Contributor

xsong9 commented Mar 2, 2021

CORAL Steering Committee approved the PR.

 - Disable pricing formulas in acquisitions when no princing formulas are defined
 - Add a sample formula when adding or editing a formula
@veggiematts
Copy link
Contributor Author

Here are the requested modifications:

  • Disable pricing formulas in acquisitions when no princing formulas are defined
  • Add a sample formula when adding or editing a formula

Also, here is the paragraph to add in the documentation:
Pricing formulas are a good way to automatically calculate a price and to keep track of how said price has been calculated.

To add a pricing formula, go to the administration page in the resources module and click on the "Pricing Formula" tab.
Then, click on "add new formula". At the bottom of the screen, you will see an example of a simple pricing formula.

Here is another example:

Name: Multiple prices with two different discounts
Field 1: Price 1
Field 2: Price 2
Field 3: Price 3
Field 4: Price 4
Field 5: Discount 1
Field 6: Discount 2
Formula: (Price 1 + Price 2 + Price 3 + Price 4) * (1 - Discount 1 / 100) * (1 - Discount 2 / 100)

@veggiematts
Copy link
Contributor Author

Hi ! Is anything still preventing this PR from being merged ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This is an enhancement (not a bug) help wanted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants