Skip to content

Commit

Permalink
Add database changes to support > 2 decimal places
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwire committed Oct 16, 2017
1 parent e0b780c commit cb398d5
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 14 deletions.
6 changes: 3 additions & 3 deletions CRM/Member/DAO/MembershipType.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*
* Generated from xml/schema/CRM/Member/MembershipType.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:22af2c3f87df3ad7cf2002c145f53cc6)
* (GenCodeChecksum:c86019d4817d79e1dd59d69eaa2a3eb6)
*/
require_once 'CRM/Core/DAO.php';
require_once 'CRM/Utils/Type.php';
Expand Down Expand Up @@ -299,8 +299,8 @@ static function &fields() {
'title' => ts('membership Type Minimum Fee') ,
'description' => 'Minimum fee for this membership (0 for free/complimentary memberships).',
'precision' => array(
20,
2
18,
9
) ,
'table_name' => 'civicrm_membership_type',
'entity' => 'MembershipType',
Expand Down
12 changes: 7 additions & 5 deletions CRM/Price/DAO/PriceFieldValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*
* Generated from xml/schema/CRM/Price/PriceFieldValue.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:d5b9853fb1321ad9872ce5b11a582d81)
* (GenCodeChecksum:fed218269d1baab495490130b4e2442a)
*/
require_once 'CRM/Core/DAO.php';
require_once 'CRM/Utils/Type.php';
Expand Down Expand Up @@ -95,7 +95,7 @@ class CRM_Price_DAO_PriceFieldValue extends CRM_Core_DAO {
/**
* Price field option amount
*
* @var string
* @var float
*/
public $amount;
/**
Expand Down Expand Up @@ -292,12 +292,14 @@ static function &fields() {
) ,
'amount' => array(
'name' => 'amount',
'type' => CRM_Utils_Type::T_STRING,
'type' => CRM_Utils_Type::T_MONEY,
'title' => ts('Amount') ,
'description' => 'Price field option amount',
'required' => true,
'maxlength' => 512,
'size' => 8,
'precision' => array(
18,
9
) ,
'table_name' => 'civicrm_price_field_value',
'entity' => 'PriceFieldValue',
'bao' => 'CRM_Price_BAO_PriceFieldValue',
Expand Down
6 changes: 2 additions & 4 deletions CRM/Upgrade/Incremental/sql/4.7.27.mysql.tpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{* file to handle db changes in 4.7.27 during upgrade *}

-- CRM-21268 Missing French overseas departments.
INSERT INTO civicrm_state_province (id, country_id, abbreviation, name) VALUES
(NULL, 1076, "WF", "Wallis-et-Futuna"),
(NULL, 1076, "NC", "Nouvelle-Calédonie");
-- CRM-20892 Change created_date default so that we can add a modified_date column
ALTER TABLE civicrm_mailing CHANGE created_date created_date timestamp NULL DEFAULT NULL COMMENT 'Date and time this mailing was created.';
5 changes: 5 additions & 0 deletions CRM/Upgrade/Incremental/sql/4.7.28.mysql.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{* file to handle db changes in 4.7.28 during upgrade *}

-- CRM-20772 Price set calculation precision when sales tax enabled
ALTER TABLE `civicrm_membership_type` CHANGE `minimum_fee` `minimum_fee` DECIMAL(18,9) NULL DEFAULT '0.00' COMMENT 'Minimum fee for this membership (0 for free/complimentary memberships).';
ALTER TABLE `civicrm_price_field_value` CHANGE `amount` `amount` DECIMAL(18,9) NOT NULL COMMENT 'Price field option amount';
1 change: 1 addition & 0 deletions xml/schema/Member/MembershipType.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
<name>minimum_fee</name>
<title>membership Type Minimum Fee</title>
<type>decimal</type>
<length>18,9</length>
<comment>Minimum fee for this membership (0 for free/complimentary memberships).</comment>
<default>0</default>
<add>1.5</add>
Expand Down
4 changes: 2 additions & 2 deletions xml/schema/Price/PriceFieldValue.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@
</field>
<field>
<name>amount</name>
<type>varchar</type>
<type>decimal</type>
<title>Amount</title>
<length>512</length>
<length>18,9</length>
<html>
<type>Text</type>
<size>8</size>
Expand Down

0 comments on commit cb398d5

Please sign in to comment.