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

dev/financial#73 Update Order.create so that total_amount is not required. #15501

Merged
merged 1 commit into from
Oct 14, 2019

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

Per https://lab.civicrm.org/dev/financial/issues/73 total_amount should not be a required field for Order.create

Before

total_amount required

After

total_amount OR line_items required

Technical Details

As test shows it is otherwise created from the line items

Comments

@mecachisenros @artfulrobot @JoeMurray

@civibot civibot bot added the master label Oct 14, 2019
@civibot
Copy link

civibot bot commented Oct 14, 2019

(Standard links)

…ired.

As test shows it is otherwise created from the line items
@mattwire
Copy link
Contributor

Thanks @eileenmcnaughton

@mattwire mattwire merged commit 03d52f0 into civicrm:master Oct 14, 2019
@artfulrobot
Copy link
Contributor

I've updated the OrderAPI documentations PR (which is still a work in progress but referenced this bug)

@eileenmcnaughton eileenmcnaughton deleted the order branch October 14, 2019 09:58
*/
function civicrm_api3_order_create($params) {

civicrm_api3_verify_one_mandatory($params, NULL, ['line_items', 'total_amount']);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the 'total_amount' should not be required but be optional. If it is present, check that the line items total to it. If it is absent, set the total_amount to the sum of the line item amounts.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right so EITHER line_items OR total_amount are mandatory with this line

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

Successfully merging this pull request may close these issues.

4 participants