<commit_before>## -*- encoding: utf-8 -*-
<%
import calendar
import time, babel
from datetime import datetime
from giscedata_facturacio.report.utils import get_atr_price
from som_extend_facturacio_comer.utils import get_gkwh_atr_price
from giscedata_polissa.giscedata_polissa import TIPO_AUTOCONSUMO
from giscedata_polissa.report.utils import localize_period, datetime_to_date

def clean_text(text):
    return text or ''

def get_pas01(cas):
    for step_id in cas.step_ids:
        proces_name = step_id.proces_id.name
        step_name = step_id.step_id.name
        if proces_name == "M1" and step_name == "01":
            return step_id
    return None
%>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<head>
    <style>
        @font-face {
            font-family: "Roboto";
            src: url("${assets_path}/fonts/Roboto/Roboto-Regular.ttf") format('truetype');
            font-weight: normal;
        }
        @font-face {
            font-family: "Roboto";
            src: url("${assets_path}/fonts/Roboto/Roboto-Bold.ttf") format('truetype');
            font-weight: bold;
        }
        @font-face {
            font-family: "Roboto";
            src: url("${assets_path}/fonts/Roboto/Roboto-Thin.ttf") format('truetype');
            font-weight: 200;
        }
    </style>
    <style type="text/css">
        ${css}
    </style>
    <link rel="stylesheet" href="${addons_path}/som_polissa_condicions_generals/report/condicions_particulars.css"/>
</head>
<body>
    <%def name="clean(text)">
        ${text or ''}
    </%def>
    <%def name="enviament(diferent, text)">
        %if diferent:
            ${clean(text)}
        %endif
    </%def>
    %for cas in objects:
        <%
            pool = cas.pool
            polissa = cas.cups_polissa_id
            pas01 = get_pas01(cas)
            lang = polissa.titular.lang
            if lang not in ['ca_ES', 'es_ES']:
                lang = 'es_ES'
            setLang(lang)
        %>
        <div id="capcelera">
            <div id="logo_capcelera">
                <img id="logo" src="data:image/jpeg;base64,${company.logo}" style='height: 80px'/>
                <br/>
                <b>${_(u"Som Energia, SCCL")}<br/></b>
                ${_(u"CIF: F55091367")}<br/>
                ${_(u"Domicili: C/Pic de Peguera, 9 (1a planta) 17003, Girona")}<br/>
                ${_(u"Adreça electrònica: <EMAIL>")}
            </div>
            <div id="dades_capcelera">
                <div id="titol_dades">
                    <h3>${_(u"DADES DEL CONTRACTE")}</h3><commit_msg>report-condicionsParticularsM101: use browse to get the polissa<commit_after>## -*- encoding: utf-8 -*-
<%
import calendar
import time, babel
from datetime import datetime
from giscedata_facturacio.report.utils import get_atr_price
from som_extend_facturacio_comer.utils import get_gkwh_atr_price
from giscedata_polissa.giscedata_polissa import TIPO_AUTOCONSUMO
from giscedata_polissa.report.utils import localize_period, datetime_to_date

def clean_text(text):
    return text or ''

def get_pas01(cas):
    for step_id in cas.step_ids:
        proces_name = step_id.proces_id.name
        step_name = step_id.step_id.name
        if proces_name == "M1" and step_name == "01":
            return step_id
    return None
%>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<head>
    <style>
        @font-face {
            font-family: "Roboto";
            src: url("${assets_path}/fonts/Roboto/Roboto-Regular.ttf") format('truetype');
            font-weight: normal;
        }
        @font-face {
            font-family: "Roboto";
            src: url("${assets_path}/fonts/Roboto/Roboto-Bold.ttf") format('truetype');
            font-weight: bold;
        }
        @font-face {
            font-family: "Roboto";
            src: url("${assets_path}/fonts/Roboto/Roboto-Thin.ttf") format('truetype');
            font-weight: 200;
        }
    </style>
    <style type="text/css">
        ${css}
    </style>
    <link rel="stylesheet" href="${addons_path}/som_polissa_condicions_generals/report/condicions_particulars.css"/>
</head>
<body>
    <%def name="clean(text)">
        ${text or ''}
    </%def>
    <%def name="enviament(diferent, text)">
        %if diferent:
            ${clean(text)}
        %endif
    </%def>
    %for cas in objects:
        <%
            pool = cas.pool
            pol_obj = pool.get('giscedata.polissa')
            polissa = pol_obj.browse(cas._cr, cas._uid, cas.cups_polissa_id.id)
            pas01 = get_pas01(cas)
            lang = polissa.titular.lang
            if lang not in ['ca_ES', 'es_ES']:
                lang = 'es_ES'
            setLang(lang)
        %>
        <div id="capcelera">
            <div id="logo_capcelera">
                <img id="logo" src="data:image/jpeg;base64,${company.logo}" style='height: 80px'/>
                <br/>
                <b>${_(u"Som Energia, SCCL")}<br/></b>
                ${_(u"CIF: F55091367")}<br/>
                ${_(u"Domicili: C/Pic de Peguera, 9 (1a planta) 17003, Girona")}<br/>
                ${_(u"Adreça electrònica: <EMAIL>")}
            </div>
            <div id="dades_capcelera">
                <div id="titol_dades">
                    <h3>${_(u"DADES DEL CONTRACTE")}</h3>
{'fraction_non_alphanumeric': 0.1459786999632758, 'fraction_numerical': 0.014506059493206023, 'mean_word_length': 2.1760932944606415, 'pattern_counts': {'":': 2, '<': 67, '<?xml version=': 0, '>': 67, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6877706', 'n_tokens_mistral': 1949, 'n_tokens_neox': 1843, 'n_words': 351}