X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=api%2Fv3%2FLineItem.php;h=b255dc1d06a188a45a5ead175d5b98af0001bf43;hb=f118a5ba2e82f3423e982c02df4979c6c0922cdb;hp=6e3690388fea25950caca5a77483c31ad8b11c29;hpb=67f82bf8bd97e3dc88351b45a472e5eb8a356874;p=civicrm-core.git diff --git a/api/v3/LineItem.php b/api/v3/LineItem.php index 6e3690388f..b255dc1d06 100644 --- a/api/v3/LineItem.php +++ b/api/v3/LineItem.php @@ -26,16 +26,11 @@ * * @return array * api result array + * + * @throws \API_Exception + * @throws \Civi\API\Exception\UnauthorizedException */ function civicrm_api3_line_item_create($params) { - // @todo the following line is not really appropriate for the api. The BAO should - // do the work. - $taxRates = CRM_Core_PseudoConstant::getTaxRates(); - if (isset($params['financial_type_id']) && array_key_exists($params['financial_type_id'], $taxRates)) { - $taxRate = $taxRates[$params['financial_type_id']]; - $taxAmount = CRM_Contribute_BAO_Contribution_Utils::calculateTaxAmount($params['line_total'], $taxRate); - $params['tax_amount'] = round($taxAmount['tax_amount'], 2); - } return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'LineItem'); }