Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
justinfreeman (Agileware)
Core
Commits
9c09f5b7
Commit
9c09f5b7
authored
12 years ago
by
Andie Hunt
Browse files
Options
Downloads
Patches
Plain Diff
check number of terms when updating member payment status
parent
bc028df3
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CRM/Contribute/BAO/Contribution.php
+16
-7
16 additions, 7 deletions
CRM/Contribute/BAO/Contribution.php
CRM/Price/BAO/LineItem.php
+2
-0
2 additions, 0 deletions
CRM/Price/BAO/LineItem.php
with
18 additions
and
7 deletions
CRM/Contribute/BAO/Contribution.php
+
16
−
7
View file @
9c09f5b7
...
@@ -1681,17 +1681,26 @@ LEFT JOIN civicrm_contribution contribution ON ( componentPayment.contribution_
...
@@ -1681,17 +1681,26 @@ LEFT JOIN civicrm_contribution contribution ON ( componentPayment.contribution_
// else fall back to using current membership type
// else fall back to using current membership type
$dao
->
free
();
$dao
->
free
();
// Figure out number of terms
$numterms
=
1
;
$lineitems
=
CRM_Price_BAO_LineItem
::
getLineItems
(
$contributionId
,
'contribution'
);
foreach
(
$lineitems
as
$lineitem
)
{
if
(
$membership
->
membership_type_id
==
CRM_Utils_Array
::
value
(
'membership_type_id'
,
$lineitem
))
{
$numterms
=
CRM_Utils_Array
::
value
(
'membership_num_terms'
,
$lineitem
);
// in case membership_num_terms comes through as null or zero
$numterms
=
$numterms
>=
1
?
$numterms
:
1
;
break
;
}
}
if
(
$currentMembership
)
{
if
(
$currentMembership
)
{
CRM_Member_BAO_Membership
::
fixMembershipStatusBeforeRenew
(
$currentMembership
,
CRM_Member_BAO_Membership
::
fixMembershipStatusBeforeRenew
(
$currentMembership
,
NULL
);
$changeToday
=
NULL
$dates
=
CRM_Member_BAO_MembershipType
::
getRenewalDatesForMembershipType
(
$membership
->
id
,
NULL
,
NULL
,
$numterms
);
);
$dates
=
CRM_Member_BAO_MembershipType
::
getRenewalDatesForMembershipType
(
$membership
->
id
,
$changeToday
=
NULL
);
$dates
[
'join_date'
]
=
CRM_Utils_Date
::
customFormat
(
$currentMembership
[
'join_date'
],
$format
);
$dates
[
'join_date'
]
=
CRM_Utils_Date
::
customFormat
(
$currentMembership
[
'join_date'
],
$format
);
}
}
else
{
else
{
$dates
=
CRM_Member_BAO_MembershipType
::
getDatesForMembershipType
(
$membership
->
membership_type_id
);
$dates
=
CRM_Member_BAO_MembershipType
::
getDatesForMembershipType
(
$membership
->
membership_type_id
,
null
,
null
,
null
,
$numterms
);
}
}
//get the status for membership.
//get the status for membership.
...
...
This diff is collapsed.
Click to expand it.
CRM/Price/BAO/LineItem.php
+
2
−
0
View file @
9c09f5b7
...
@@ -112,6 +112,7 @@ class CRM_Price_BAO_LineItem extends CRM_Price_DAO_LineItem {
...
@@ -112,6 +112,7 @@ class CRM_Price_BAO_LineItem extends CRM_Price_DAO_LineItem {
pf.label as field_title,
pf.label as field_title,
pf.html_type,
pf.html_type,
pfv.membership_type_id,
pfv.membership_type_id,
pfv.membership_num_terms,
li.price_field_id,
li.price_field_id,
li.participant_count,
li.participant_count,
li.price_field_value_id,
li.price_field_value_id,
...
@@ -158,6 +159,7 @@ class CRM_Price_BAO_LineItem extends CRM_Price_DAO_LineItem {
...
@@ -158,6 +159,7 @@ class CRM_Price_BAO_LineItem extends CRM_Price_DAO_LineItem {
'description'
=>
$dao
->
description
,
'description'
=>
$dao
->
description
,
'entity_id'
=>
$entityId
,
'entity_id'
=>
$entityId
,
'membership_type_id'
=>
$dao
->
membership_type_id
,
'membership_type_id'
=>
$dao
->
membership_type_id
,
'membership_num_terms'
=>
$dao
->
membership_num_terms
,
);
);
}
}
return
$lineItems
;
return
$lineItems
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment