| @@ 865-892 (lines=28) @@ | ||
| 862 | result['reporting_period_cost']['total_increment_rate'] = Decimal(0.0) |
|
| 863 | result['reporting_period_cost']['total_unit'] = config.currency_unit |
|
| 864 | ||
| 865 | if energy_category_set is not None and len(energy_category_set) > 0: |
|
| 866 | for energy_category_id in energy_category_set: |
|
| 867 | result['reporting_period_cost']['names'].append(energy_category_dict[energy_category_id]['name']) |
|
| 868 | result['reporting_period_cost']['energy_category_ids'].append(energy_category_id) |
|
| 869 | result['reporting_period_cost']['units'].append(config.currency_unit) |
|
| 870 | result['reporting_period_cost']['timestamps'].append( |
|
| 871 | reporting_cost[energy_category_id]['timestamps']) |
|
| 872 | result['reporting_period_cost']['values'].append( |
|
| 873 | reporting_cost[energy_category_id]['values']) |
|
| 874 | result['reporting_period_cost']['subtotals'].append( |
|
| 875 | reporting_cost[energy_category_id]['subtotal']) |
|
| 876 | result['reporting_period_cost']['subtotals_per_unit_area'].append( |
|
| 877 | reporting_cost[energy_category_id]['subtotal'] / space['area'] |
|
| 878 | if space['area'] > 0.0 else None) |
|
| 879 | result['reporting_period_cost']['toppeaks'].append( |
|
| 880 | reporting_cost[energy_category_id]['toppeak']) |
|
| 881 | result['reporting_period_cost']['onpeaks'].append( |
|
| 882 | reporting_cost[energy_category_id]['onpeak']) |
|
| 883 | result['reporting_period_cost']['midpeaks'].append( |
|
| 884 | reporting_cost[energy_category_id]['midpeak']) |
|
| 885 | result['reporting_period_cost']['offpeaks'].append( |
|
| 886 | reporting_cost[energy_category_id]['offpeak']) |
|
| 887 | result['reporting_period_cost']['increment_rates'].append( |
|
| 888 | (reporting_cost[energy_category_id]['subtotal'] - |
|
| 889 | base_cost[energy_category_id]['subtotal']) / |
|
| 890 | base_cost[energy_category_id]['subtotal'] |
|
| 891 | if base_cost[energy_category_id]['subtotal'] > 0.0 else None) |
|
| 892 | result['reporting_period_cost']['total'] += reporting_cost[energy_category_id]['subtotal'] |
|
| 893 | result['reporting_period_cost']['total_per_unit_area'] = \ |
|
| 894 | result['reporting_period_cost']['total'] / space['area'] if space['area'] > 0.0 else None |
|
| 895 | ||
| @@ 541-559 (lines=19) @@ | ||
| 538 | result['reporting_period']['total_increment_rate'] = Decimal(0.0) |
|
| 539 | result['reporting_period']['total_unit'] = config.currency_unit |
|
| 540 | ||
| 541 | if energy_category_set is not None and len(energy_category_set) > 0: |
|
| 542 | for energy_category_id in energy_category_set: |
|
| 543 | result['reporting_period']['names'].append(energy_category_dict[energy_category_id]['name']) |
|
| 544 | result['reporting_period']['energy_category_ids'].append(energy_category_id) |
|
| 545 | result['reporting_period']['units'].append(config.currency_unit) |
|
| 546 | result['reporting_period']['timestamps'].append(reporting[energy_category_id]['timestamps']) |
|
| 547 | result['reporting_period']['values'].append(reporting[energy_category_id]['values']) |
|
| 548 | result['reporting_period']['subtotals'].append(reporting[energy_category_id]['subtotal']) |
|
| 549 | result['reporting_period']['subtotals_per_unit_area'].append( |
|
| 550 | reporting[energy_category_id]['subtotal'] / space['area'] if space['area'] > 0.0 else None) |
|
| 551 | result['reporting_period']['toppeaks'].append(reporting[energy_category_id]['toppeak']) |
|
| 552 | result['reporting_period']['onpeaks'].append(reporting[energy_category_id]['onpeak']) |
|
| 553 | result['reporting_period']['midpeaks'].append(reporting[energy_category_id]['midpeak']) |
|
| 554 | result['reporting_period']['offpeaks'].append(reporting[energy_category_id]['offpeak']) |
|
| 555 | result['reporting_period']['increment_rates'].append( |
|
| 556 | (reporting[energy_category_id]['subtotal'] - base[energy_category_id]['subtotal']) / |
|
| 557 | base[energy_category_id]['subtotal'] |
|
| 558 | if base[energy_category_id]['subtotal'] > 0.0 else None) |
|
| 559 | result['reporting_period']['total'] += reporting[energy_category_id]['subtotal'] |
|
| 560 | ||
| 561 | result['reporting_period']['total_per_unit_area'] = \ |
|
| 562 | result['reporting_period']['total'] / space['area'] if space['area'] > 0.0 else None |
|