----------------------------------------
* CRM-13231: Incremental upgrade 4.3.4 fails if no COGS and EXP default account set
http://issues.civicrm.org/jira/browse/CRM-13231
if ($rev == '4.3.5') {
$postUpgradeMessage .= '<br />' . ts('Default versions of the following System Workflow Message Templates have been modified to handle new functionality: <ul><li>Events - Registration Confirmation and Receipt (on-line)</li><li>Events - Registration Confirmation and Receipt (off-line)</li></ul> 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 .= '<br />' . 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. <a href="%1" target="_blank">You can review steps to correct this situation on the wiki.</a>',
+ 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) {