From: Dave Greenberg Date: Thu, 19 Sep 2013 01:48:29 +0000 (-0700) Subject: CRM-13231 - Fix warning in postUpgradeMessage for missing cost of sales linkage.... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=b9810330abccde810cc8380d4d76bc40933905bd;p=civicrm-core.git CRM-13231 - Fix warning in postUpgradeMessage for missing cost of sales linkage. Add link to wiki page for instructions on fixing. ---------------------------------------- * CRM-13231: Incremental upgrade 4.3.4 fails if no COGS and EXP default account set http://issues.civicrm.org/jira/browse/CRM-13231 --- diff --git a/CRM/Upgrade/Incremental/php/FourThree.php b/CRM/Upgrade/Incremental/php/FourThree.php index 278f010e52..a925a615b3 100644 --- a/CRM/Upgrade/Incremental/php/FourThree.php +++ b/CRM/Upgrade/Incremental/php/FourThree.php @@ -193,7 +193,15 @@ WHERE ceft.entity_id IS NULL; if ($rev == '4.3.5') { $postUpgradeMessage .= '
' . ts('Default versions of the following System Workflow Message Templates have been modified to handle new functionality: If you have modified these templates, please review the new default versions and implement updates as needed to your copies (Administer > Communications > Message Templates > System Workflow Messages).'); } - + if ($rev == '4.3.6') { + $flag = CRM_Core_DAO::singleValueQuery('SELECT count(ccp.id) FROM civicrm_contribution_product ccp +INNER JOIN civicrm_product cp ON ccp.product_id = cp.id +WHERE ccp.financial_type_id IS NULL and cp.cost > 0'); + if ($flag) { + $postUpgradeMessage .= '
' . ts('Your database contains one or more premiums which have a cost but are not linked to a financial type. If you are exporting transations to an accounting package, this will result in unbalanced transactions. You can review steps to correct this situation on the wiki.', + array( 1 => 'http://wiki.civicrm.org/confluence/display/CRMDOC/Fixing+Issues+Caused+by+Missing+Cost+of+Goods+Account+-+4.3+Upgrades')); + } + } } function upgrade_4_3_alpha1($rev) {