Skip to content

Commit

Permalink
feat(emission): ignore fuels with non-carbontaxed emission category i…
Browse files Browse the repository at this point in the history
…n the carbon tax calculation
  • Loading branch information
dleard committed May 11, 2020
1 parent 145859b commit 5f07be7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions schema/deploy/views/ciip_carbon_tax_calculation.sql
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ begin;
date_part('day', ct_details_start.rate_end_date - reporting_year.reporting_period_start) as start_rate_days,
date_part('day', reporting_year.reporting_period_end - ct_details_end.rate_start_date) as end_rate_days
from ggircs_portal.ciip_fuel as cf
inner join ggircs_portal.emission_category
on cf.emission_category_id not in (select id from ggircs_portal.emission_category where swrs_emission_category is null)
join ggircs_portal.fuel as f
on cf.fuel_id = f.id
join ggircs_portal.application as a
Expand Down
3 changes: 2 additions & 1 deletion schema/deploy/views/ciip_fuel.sql
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ begin;
x.version_number,
(x.fuel_data ->> 'quantity')::numeric as quantity,
(x.fuel_data ->> 'fuelRowId')::integer as fuel_id,
(x.fuel_data ->> 'fuelUnits')::varchar(1000) as fuel_units
(x.fuel_data ->> 'fuelUnits')::varchar(1000) as fuel_units,
(x.fuel_data ->> 'emissionCategoryRowId')::numeric as emission_category_id
from x
);

Expand Down

0 comments on commit 5f07be7

Please sign in to comment.