Skip to content

Commit

Permalink
Merge pull request #685 from Som-Energia/NEW_add_multicau_list_support
Browse files Browse the repository at this point in the history
Mostrar els mútiples CAU's en la factura en pdf
  • Loading branch information
FranciscoCubero authored Jul 29, 2024
2 parents 6bfe85c + fa4731c commit b8fff12
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions giscedata_facturacio_comer_som/giscedata_facturacio_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -1307,6 +1307,14 @@ def get_component_contract_data_td_data(self, fact, pol):
u"6.3TD": 5,
u"6.4TD": 6,
}

if len(pol.autoconsum_cups_ids) == 0:
data["autoconsum_caus"] = [data["autoconsum_cau"]]
else:
data["autoconsum_caus"] = []
for mcau in pol.autoconsum_cups_ids:
data["autoconsum_caus"].append(mcau.autoconsum_id.cau)

data["segment_tariff"] = segment_tarif.get(pol.tarifa.name, "")
return data

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ autoconsum_text = TABLA_113_dict[cd.autoconsum] if cd.autoconsum in TABLA_113_di
${_(u'Data final del contracte: <span style="font-weight: bold;">%s</span> %s') % (cd.renovation_date, _(u'sense condicions de permanència') if not cd.has_permanence else _(u"pròrroga automàtica per períodes d'un any"))} <br/>
%if cd.is_autoconsum:
${_(u"Autoproducció tipus:")} <span style="font-weight: bold;">${autoconsum_text}</span> <br />
${_(u"CAU (Codi d'autoconsum unificat):")} <span style="font-weight: bold;">${cd.autoconsum_cau}</span>
% for autoconsum_cau in cd.autoconsum_caus:
${_(u"CAU (Codi d'autoconsum unificat):")} <span style="font-weight: bold;">${autoconsum_cau}</span> <br />
% endfor
%endif
</p>
</div>
Expand Down

0 comments on commit b8fff12

Please sign in to comment.