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#54 Fix mishandling of deferred revenue settings #14267

Merged
merged 2 commits into from
May 22, 2019

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented May 19, 2019

Overview

When invoicing was added to core the invoicing settings were added as an array rather than individual settings. This is against our standard but it was a long time ago & our review processes were poor then. However, it has had ongoing repercussions. This addresses one of them and also adds a process for converting them. We need this because switching to correctly referencing the deferred revenue settings might otherwise miss some where people have added the settings to follow the wrong format

Before

Saving the 2 settings
Always post to Accounts Receivable?
Enable Deferred Revenue?
Through the contribution settings form does not result in them being respected

After

The settings are respected

Technical Details

We should follow this up by changing the remaining settings in this array to being meta-data defined & then call the convert function

Comments

@mattwire @monishdeb @JoeMurray

https://lab.civicrm.org/dev/financial/issues/54#

@civibot
Copy link

civibot bot commented May 19, 2019

(Standard links)

@civibot civibot bot added the master label May 19, 2019
@eileenmcnaughton eileenmcnaughton force-pushed the setting_fin branch 2 times, most recently from fe5e055 to 6c5f362 Compare May 19, 2019 23:59
@seamuslee001
Copy link
Contributor

Jenkins re test this please

@seamuslee001
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton force-pushed the setting_fin branch 2 times, most recently from a1d782c to 4fa1e00 Compare May 20, 2019 05:35
@mattwire
Copy link
Contributor

This is a needed step that gets rid of some more problematic, legacy code. If this could be tested by a couple of "financial savvy" users @monishdeb @kcristiano then I'm happy to merge

* @param string $rev
*/
public function upgrade_5_15_alpha1($rev) {
$this->addTask('Fix errant deferred revenue settings', 'updateContributeSettings');
Copy link
Contributor

Choose a reason for hiding this comment

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

don't we need a $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => $rev)), 'runSql', $rev); here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes - good spotting. Added

* Test checkContributeSettings.
*/
public function testCheckContributeSettings() {
$settings = CRM_Contribute_BAO_Contribution::checkContributeSettings('deferred_revenue_enabled');
Copy link
Contributor

Choose a reason for hiding this comment

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

@eileenmcnaughton is there any handling here for storing the settings in the correct way if we get in the wrong format or saying its in the wrong format?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@seamuslee001 how do you mean? It just copies the setting from the wrong place (nested in a key) to the right place (it actually leaves a duplicate but I think that's OK since we can clean that up when the rest of the settings are migrated from that key)

Eileen McNaughton and others added 2 commits May 21, 2019 18:50
Currently we have a non-std store for invoicing settings that we are checking, yet the form saves it using our stds.

This updates checks for these settings to actually check the right place
@monishdeb
Copy link
Member

Jenkins test this please

@monishdeb
Copy link
Member

I am happy with the final patch and agree with the changes. Tested on my local. @seamuslee001 @pradpnayak any last thoughts before merging it?

@monishdeb
Copy link
Member

I think not. Merging it now

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

Successfully merging this pull request may close these issues.

4 participants