Skip to content

Commit

Permalink
only check batch currency match when adding a financial_trxn
Browse files Browse the repository at this point in the history
  • Loading branch information
ufundo committed Jun 9, 2022
1 parent 2e881e7 commit 258f22e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CRM/Batch/BAO/EntityBatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static function create($params) {
$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 && $params['entity_table'] == '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)
Expand Down

0 comments on commit 258f22e

Please sign in to comment.