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
f8325309
Commit
f8325309
authored
11 years ago
by
pratik.joshi
Browse files
Options
Downloads
Patches
Plain Diff
CRM-13964 : post process working
parent
59e44db1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CRM/Contribute/BAO/Contribution.php
+20
-1
20 additions, 1 deletion
CRM/Contribute/BAO/Contribution.php
CRM/Event/Form/Participant.php
+13
-4
13 additions, 4 deletions
CRM/Event/Form/Participant.php
CRM/Financial/BAO/FinancialItem.php
+3
-0
3 additions, 0 deletions
CRM/Financial/BAO/FinancialItem.php
with
36 additions
and
5 deletions
CRM/Contribute/BAO/Contribution.php
+
20
−
1
View file @
f8325309
...
...
@@ -144,6 +144,14 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution {
$params
[
'contribution_status_id'
]
=
CRM_Core_OptionGroup
::
getValue
(
'contribution_status'
,
'Completed'
,
'name'
);
}
// CRM-13964 partial payment
if
(
empty
(
$contributionID
))
{
if
(
$partialAmtTotal
=
CRM_Utils_Array
(
'partial_amount_total'
,
$params
)
&&
$partialAmtPay
=
CRM_Utils_Array
(
'partial_amount_pay'
,
$params
))
{
$params
[
'total_amount'
]
=
$partialAmtTotal
;
$params
[
'status_id'
]
=
CRM_Core_OptionGroup
::
getValue
(
'contribution_status'
,
'Partially paid'
,
'name'
);
}
}
if
(
$contributionID
)
{
CRM_Utils_Hook
::
pre
(
'edit'
,
'Contribution'
,
$contributionID
,
$params
);
}
...
...
@@ -2524,6 +2532,16 @@ WHERE contribution_id = %1 ";
$update
=
TRUE
;
}
$statusId
=
$params
[
'contribution'
]
->
contribution_status_id
;
// CRM-13964 partial payment
if
(
CRM_Utils_Array
::
value
(
'contribution_status_id'
,
$params
)
!=
array_search
(
'Partially Paid'
,
$contributionStatuses
)
&&
$partialAmtTotal
=
CRM_Utils_Array
(
'partial_amount_total'
,
$params
)
&&
$partialAmtPay
=
CRM_Utils_Array
(
'partial_amount_pay'
,
$params
))
{
$params
[
'total_amount'
]
=
$partialAmtPay
;
$statusId
=
CRM_Core_OptionGroup
::
getValue
(
'contribution_status'
,
'Completed'
,
'name'
);
// new creation of financial trasaction for the balance amount
}
// build line item array if its not set in $params
if
(
!
CRM_Utils_Array
::
value
(
'line_item'
,
$params
)
||
$additionalParticipantId
)
{
CRM_Price_BAO_LineItem
::
getLineItemArray
(
$params
,
$entityID
,
str_replace
(
'civicrm_'
,
''
,
$entityTable
));
...
...
@@ -2552,6 +2570,7 @@ WHERE contribution_id = %1 ";
if
(
!
isset
(
$totalAmount
)
&&
CRM_Utils_Array
::
value
(
'prevContribution'
,
$params
))
{
$totalAmount
=
$params
[
'total_amount'
]
=
$params
[
'prevContribution'
]
->
total_amount
;
}
//build financial transaction params
$trxnParams
=
array
(
'contribution_id'
=>
$params
[
'contribution'
]
->
id
,
...
...
@@ -2562,7 +2581,7 @@ WHERE contribution_id = %1 ";
'net_amount'
=>
CRM_Utils_Array
::
value
(
'net_amount'
,
$params
),
'currency'
=>
$params
[
'contribution'
]
->
currency
,
'trxn_id'
=>
$params
[
'contribution'
]
->
trxn_id
,
'status_id'
=>
$
params
[
'contribution'
]
->
contribution_
status
_i
d
,
'status_id'
=>
$status
I
d
,
'payment_instrument_id'
=>
$params
[
'contribution'
]
->
payment_instrument_id
,
'check_number'
=>
CRM_Utils_Array
::
value
(
'check_number'
,
$params
),
);
...
...
This diff is collapsed.
Click to expand it.
CRM/Event/Form/Participant.php
+
13
−
4
View file @
f8325309
...
...
@@ -1465,6 +1465,15 @@ loadCampaign( {$this->_eID}, {$eventCampaigns} );
if
(
$contributionParams
[
'contribution_status_id'
]
==
CRM_Core_OptionGroup
::
getValue
(
'contribution_status'
,
'Pending'
,
'name'
))
{
$contributionParams
[
'is_pay_later'
]
=
1
;
}
// CRM-13964 partial_payment_total
if
(
$params
[
'fee_amount'
]
>
$params
[
'total_amount'
])
{
// the owed amount
$contributionParams
[
'partial_payment_total'
]
=
$params
[
'fee_amount'
];
// the actual amount paid
$contributionParams
[
'partial_amount_pay'
]
=
$params
[
'total_amount'
];
}
if
(
$this
->
_single
)
{
if
(
empty
(
$ids
))
{
$ids
=
array
();
...
...
@@ -1513,10 +1522,10 @@ loadCampaign( {$this->_eID}, {$eventCampaigns} );
foreach
(
$this
->
_lineItem
as
$key
=>
$value
)
{
if
(
is_array
(
$value
)
&&
$value
!=
'skip'
)
{
foreach
(
$value
as
$lineKey
=>
$line
)
{
//10117 update the line items for participants if contribution amount is recorded
if
(
$this
->
_quickConfig
&&
CRM_Utils_Array
::
value
(
'total_amount'
,
$params
))
{
$line
[
'unit_price'
]
=
$line
[
'line_total'
]
=
$params
[
'total_amount'
];
}
/*
//10117 update the line items for participants if contribution amount is recorded
*/
/*
if ($this->_quickConfig && CRM_Utils_Array::value('total_amount', $params )) {
*/
/*
$line['unit_price'] = $line['line_total'] = $params['total_amount'];
*/
/* } */
$lineItem
[
$this
->
_priceSetId
][
$lineKey
]
=
$line
;
}
CRM_Price_BAO_LineItem
::
processPriceSet
(
$participants
[
$num
]
->
id
,
$lineItem
,
CRM_Utils_Array
::
value
(
$num
,
$contributions
,
NULL
),
'civicrm_participant'
);
...
...
This diff is collapsed.
Click to expand it.
CRM/Financial/BAO/FinancialItem.php
+
3
−
0
View file @
f8325309
...
...
@@ -85,6 +85,9 @@ class CRM_Financial_BAO_FinancialItem extends CRM_Financial_DAO_FinancialItem {
elseif
(
$contribution
->
contribution_status_id
==
array_search
(
'Pending'
,
$contributionStatuses
))
{
$itemStatus
=
array_search
(
'Unpaid'
,
$financialItemStatus
);
}
elseif
(
$contribution
->
contribution_status_id
==
array_search
(
'Partially paid'
,
$contributionStatuses
))
{
$itemStatus
=
array_search
(
'Partially paid'
,
$financialItemStatus
);
}
$params
=
array
(
'transaction_date'
=>
CRM_Utils_Date
::
isoToMysql
(
$contribution
->
receive_date
),
'contact_id'
=>
$contribution
->
contact_id
,
...
...
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