Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CiviCRM Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
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
Development
CiviCRM Core
Commits
18409515
Unverified
Commit
18409515
authored
2 years ago
by
Eileen McNaughton
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #23788 from ufundo/5.51
only check batch currency match when adding a financial_trxn
parents
b32b43d5
f36ab38f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CRM/Batch/BAO/EntityBatch.php
+2
-1
2 additions, 1 deletion
CRM/Batch/BAO/EntityBatch.php
with
2 additions
and
1 deletion
CRM/Batch/BAO/EntityBatch.php
+
2
−
1
View file @
18409515
...
...
@@ -26,6 +26,7 @@ class CRM_Batch_BAO_EntityBatch extends CRM_Batch_DAO_EntityBatch {
// Only write the EntityBatch record if the financial trxn and batch match on currency and payment instrument.
$batchId
=
$params
[
'batch_id'
]
??
NULL
;
$entityId
=
$params
[
'entity_id'
]
??
NULL
;
$entityTable
=
$params
[
'entity_table'
]
??
'civicrm_financial_trxn'
;
// Not having a batch ID and entity ID is only acceptable on an update.
if
(
!
$batchId
)
{
$existingEntityBatch
=
\Civi\Api4\EntityBatch
::
get
(
FALSE
)
...
...
@@ -36,7 +37,7 @@ class CRM_Batch_BAO_EntityBatch extends CRM_Batch_DAO_EntityBatch {
$entityId
=
$existingEntityBatch
[
'entity_id'
]
??
NULL
;
}
// There should never be a legitimate case where a record has an ID but no batch ID but SyntaxConformanceTest says otherwise.
if
(
$batchId
)
{
if
(
$batchId
&&
$entityTable
===
'civicrm_financial_trxn'
)
{
$batchCurrency
=
self
::
getBatchCurrency
(
$batchId
);
$batchPID
=
(
int
)
CRM_Core_DAO
::
getFieldValue
(
'CRM_Batch_DAO_Batch'
,
$batchId
,
'payment_instrument_id'
);
$trxn
=
\Civi\Api4\FinancialTrxn
::
get
(
FALSE
)
...
...
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