Skip to content

Commit

Permalink
Merge pull request #14 from compucorp/comcl-793-fix-core-class-usages
Browse files Browse the repository at this point in the history
COMCL-793: Fix Core Class Usages
  • Loading branch information
shahrukh-compuco authored Sep 2, 2024
2 parents 407a6ec + 9158255 commit 7df7a61
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions CRM/Lineitemedit/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -1060,31 +1060,31 @@ private static function updateToFirstActiveFinancialType(int $priceSetId, array
return;
}
if (empty($priceFieldIds)) {
$priceFieldIds = array_values(Civi\api4\PriceField::get(FALSE)
$priceFieldIds = array_values(Civi\Api4\PriceField::get(FALSE)
->addSelect('id')
->addWhere('price_set_id', '=', $priceSetId)
->execute()
->column('id'));
}

$activeFinancialType = Civi\api4\FinancialType::get(FALSE)
$activeFinancialType = Civi\Api4\FinancialType::get(FALSE)
->addSelect('id')
->addWhere('is_active', '=', TRUE)
->execute()
->first();

Civi\api4\PriceSet::update(FALSE)
Civi\Api4\PriceSet::update(FALSE)
->addValue('financial_type_id', $activeFinancialType['id'])
->addWhere('id', '=', $priceSetId)
->execute();
Civi\api4\PriceFieldValue::update(FALSE)
Civi\Api4\PriceFieldValue::update(FALSE)
->addValue('financial_type_id', $activeFinancialType['id'])
->addWhere('price_field_id', 'IN', $priceFieldIds)
->execute();
}

private static function getDefaultPriceSet(): array {
return Civi\api4\PriceSet::get(FALSE)
return Civi\Api4\PriceSet::get(FALSE)
->addSelect('priceset.id', 'financialtype.is_active')
->addWhere('name', '=', 'default_contribution_amount')
->addJoin('FinancialType', 'LEFT', NULL, ['financial_type_id', '=', 'financialtype.id'])
Expand Down

0 comments on commit 7df7a61

Please sign in to comment.