<!--{
    [% 
        pagewidth = 210;
        pageheight = 297;
        server_process_units = 'none';
#        money_signs = 3;
        PROCESS "invoice/default/invoice_template_aux.tt";

        money_format(amount=(billprof.interval_charge), comma='.'); fixfee = aux.val;
        money_format(amount=(zones.totalcost), comma='.'); zonefee = aux.val;
        money_format(amount=(invoice.amount_net), comma='.'); netfee = aux.val;
        money_format(amount=(invoice.amount_vat), comma='.'); vatfee = aux.val;
        money_format(amount=(invoice.amount_total), comma='.'); allfee = aux.val;
        cur = billprof.currency;
        p_start = date_format(thedate=invoice.period_start, format='%Y-%m-%d');
        p_end = date_format(thedate=invoice.period_end, format='%Y-%m-%d');
    -%]
}-->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="210mm" height="297mm" viewBox="0 0 595 842" server-process-units="none">

    <!--{ [% MACRO draw_background BLOCK %] }-->
    <g class="page" font-family="Verdana" font-size="8">
        <title>Background</title>


        <text x="56.7"  y="765.45">OPERATOR COMPANY</text>
        <text x="56.7"  y="779.625">OPERATOR STREET</text>
        <text x="56.7"  y="793.8">OPERATOR POSTCODE OPERATOR CITY</text>
        <text x="56.7"  y="807.975">OPERATOR COUNTRY</text>

        <text x="538.65" y="765.45" text-anchor="end">Company Reg.Nr.: OPERATOR COMPREGNUM</text>
        <text x="538.65" y="779.625" text-anchor="end">VAT.Nr.: OPERATOR VATNUM</text>
        <text x="538.65" y="793.8" text-anchor="end">IBAN: OPERATOR IBAN</text>
        <text x="538.65" y="807.975" text-anchor="end">BIC: OPERATOR BIC</text>
        <text x="297.675" y="816.48" text-anchor="middle">Page [% aux.page %]</text>


        <image x="400" y="40" height="39.07895" width="144.73686" xlink:href="data:image/png;base64,[encoded data, 27744 characters]"/>

    </g>
    <!--{ [% END %] }-->

    <g x="0" y="0" class="page">
        <title>Summary</title>
        <!--{ [% draw_background %] }-->

        <text x="79.38" y="170.1" font-family="Verdana" font-size="8">[% contact.company %]</text>
        <text x="79.38" y="181.44" font-family="Verdana" font-size="8">[% contact.street %]</text>
        <text x="79.38" y="192.78" font-family="Verdana" font-size="8">[% contact.postcode %] [% contact.city %]</text>
        <text x="79.38" y="204.12" font-family="Verdana" font-size="8">[% contact.country %]</text>

        <text x="538.65" y="141.75"  text-anchor="end" font-family="Verdana" font-size="8" font-weight="bold">Invoice Nr.</text>
        <text x="538.65" y="153.09"  text-anchor="end" font-family="Verdana" font-size="8">[% invoice.serial %]</text>
        <text x="538.65" y="164.43"  text-anchor="end" font-family="Verdana" font-size="8" font-weight="bold">Reseller Contract Nr.</text>
        <text x="538.65" y="175.77"  text-anchor="end" font-family="Verdana" font-size="8">[% contract.external_id %]</text>
        <text x="538.65" y="187.11"  text-anchor="end" font-family="Verdana" font-size="8" font-weight="bold">Invoice Period</text>
        <text x="538.65" y="198.45"  text-anchor="end" font-family="Verdana" font-size="8">[% p_start %] - [% p_end %]</text>
        <text x="538.65" y="209.79"  text-anchor="end" font-family="Verdana" font-size="8" font-weight="bold">Date</text>
        <text x="538.65" y="221.13"  text-anchor="end" font-family="Verdana" font-size="8">[% date_now(format='%Y-%m-%d') %]</text>

        <text x="56.7" y="283.5" font-family="Verdana" font-size="12" font-weight="bold">Your Monthly Statement</text>

        <text x="56.7" y="311.85" font-family="Verdana" font-size="8">Dear Reseller,</text>
        <text x="56.7" y="334.53" font-family="Verdana" font-size="8">For our services provided in the period of [% p_start %] to [% p_end %], we invoice the following items:</text>


        <text x="56.7" y="368.55" font-family="Verdana" font-size="8" font-weight="bold">Recurring Fees</text>
        <line x1="62.37" y1="374.22" x2="538.65" y2="374.22" style="stroke:#000000;stroke-width:1;" />
        <text x="62.37" y="385.56" font-family="Verdana" font-size="8" font-weight="bold">Name</text>
        <text text-anchor="end" x="283.5" y="385.56" font-family="Verdana" font-size="8" font-weight="bold">Quantity</text>
        <text text-anchor="end" x="377.055" y="385.56" font-family="Verdana" font-size="8" font-weight="bold">Unit Price</text>
        <text text-anchor="end" x="538.65" y="385.56" font-family="Verdana" font-size="8" font-weight="bold">Total Price in [% cur %]</text>
        <line x1="62.37" y1="391.23" x2="538.65" y2="391.23" style="stroke:#000000;stroke-width:1;" />
        <text x="62.37" y="408.24" font-family="Verdana" font-size="8">[% billprof.name %]</text>
        <text text-anchor="end" x="283.5" y="408.24" font-family="Verdana" font-size="8">1</text>
        <text text-anchor="end" x="377.055" y="408.24" font-family="Verdana" font-size="8">[% fixfee %]</text>
        <text text-anchor="end" x="538.65" y="408.24" font-family="Verdana" font-size="8">[% fixfee %]</text>
        <line x1="62.37" y1="419.58" x2="538.65" y2="419.58" style="stroke:#000000;stroke-width:1;" />
        <text x="62.37" y="430.92" font-family="Verdana" font-size="8" font-weight="bold">Total</text>
        <text text-anchor="end" x="538.65" y="430.92" font-family="Verdana" font-size="8" font-weight="bold">[% fixfee %]</text>
        <line x1="62.37" y1="436.59" x2="538.65" y2="436.59" style="stroke:#000000;stroke-width:1;" />



        <text x="56.7" y="467.775" font-family="Verdana" font-size="8" font-weight="bold">Calls [% invoice.call_direction %] other Platform Resellers and Peers</text>
        <line x1="62.37" y1="473.445" x2="538.65" y2="473.445" style="stroke:#000000;stroke-width:1;" />
        <text x="62.37" y="484.785" font-family="Verdana" font-size="8" font-weight="bold">Zone</text>
        <text text-anchor="end" x="283.5" y="484.785" font-family="Verdana" font-size="8" font-weight="bold">Quantity</text>
        <text text-anchor="end" x="377.055" y="484.785" font-family="Verdana" font-size="8" font-weight="bold">Usage</text>
        <text text-anchor="end" x="538.65" y="484.785" font-family="Verdana" font-size="8" font-weight="bold">Total Price in [% cur %]</text>
        <line x1="62.37" y1="490.455" x2="538.65" y2="490.455" style="stroke:#000000;stroke-width:1;" />

        <!--{ [% zonelist(fontfamily='Verdana', fontsize=8, startx=62, starty=507, offsety=14, miny=113.4, maxy=709, zones=zones.data, fields=[{name='zone',dx=0},{name='number',dx=221,anchor='end'},{name='duration',dx=99,timestamp2time=1,anchor='end'},{name='resellercost',dx=156,money_cents=1,comma='.',money_signs='3',anchor='end'}]) -%] }-->

        <!-- firsty-507 means the first y in the group is at 180mm (507px); mandatory to automatically place the footer after the list -->
        <!--{<g class="list-footer firsty-507 lasty-[% aux.lasty %]">}-->
            <line x1="62.37" y1="510.3" x2="538.65" y2="510.3" style="stroke:#000000;stroke-width:1;" />
            <text x="62.37" y="521.64" font-family="Verdana" font-size="8" font-weight="bold">Total</text>
            <text text-anchor="end" x="538.65" y="521.64" font-family="Verdana" font-size="8" font-weight="bold">[% zonefee %]</text>
            <line x1="62.37" y1="527.31" x2="538.65" y2="527.31" style="stroke:#000000;stroke-width:1;" />
        <!--{</g>}-->
        <!--{[% aux.lasty = aux.lasty + 56.7 %]}-->

        <!--{ [% check_pagebreak(following_height=141.75, miny=141.75, maxy=708.75) %] }-->

        <!-- firsty-558 means the first y in the group is at 197mm (558); mandatory to automatically place the footer after the list -->
        <!--{<g class="list-footer firsty-558 lasty-[% aux.lasty %]">}-->
            <text x="56.7" y="558" font-family="Verdana" font-size="8" font-weight="bold">Summary</text>
            <text text-anchor="end" x="538.65" y="558.495" font-family="Verdana" font-size="8" font-weight="bold">in [% cur %]</text>
            <line x1="62.37" y1="564.165" x2="538.65" y2="564.165" style="stroke:#000000;stroke-width:1;" />
            <text x="62.37" y="575.505" font-family="Verdana" font-size="8" font-weight="bold">Total Summary</text>
            <text text-anchor="end" x="538.65" y="575.505" font-family="Verdana" font-size="8" font-weight="bold">[% netfee %]</text>
            <text x="62.37" y="586.845" font-family="Verdana" font-size="8" font-weight="bold">VAT ([% contract.vat_rate %]%)</text>
            <text text-anchor="end" x="538.65" y="586.845" font-family="Verdana" font-size="8" font-weight="bold">[% vatfee %]</text>
            <line x1="62.37" y1="592.515" x2="538.65" y2="592.515" style="stroke:#000000;stroke-width:1;" />
            <text x="62.37" y="603.855" font-family="Verdana" font-size="8" font-weight="bold">Amount Due</text>
            <text text-anchor="end" x="538.65" y="603.855" font-family="Verdana" font-size="8" font-weight="bold">[% allfee %]</text>
            <line x1="62.37" y1="609.525" x2="538.65" y2="609.525" style="stroke:#000000;stroke-width:1;" />

            <text x="56.7" y="637.875" font-family="Verdana" font-size="8">The amount is automatically charged via SEPA within 30 days using Mandate ID MID12345 and Creditor ID CID12345</text>
            <text x="56.7" y="649.215" font-family="Verdana" font-size="8">from your account with IBAN [% rescontact.iban %] and BIC [% rescontact.bic %].</text>
            <text x="56.7" y="671.895" font-family="Verdana" font-size="8">With best regards,</text>
            <text x="56.7" y="683.235" font-family="Verdana" font-size="8">Your [% rescontact.company %] Service Team</text>
        <!--{</g>}-->

    </g>

</svg>
<!-- vim: set tabstop=4 syntax=html expandtab: -->
