facturation: The summary pey year added on the first page of the bill

Closes #3130
This commit is contained in:
Serghei Mihai 2013-08-07 12:23:32 +02:00
parent 7d589b3e04
commit 7fc1515128
2 changed files with 75 additions and 1 deletions

View File

@ -46,6 +46,16 @@ def render_to_pdf_file(templates, ctx, prefix='tmp', delete=False):
pass
raise
def details_per_year(service, invoicing,
header_service_template = 'facturation/bordereau-%s.html',
header_template = 'facturation/bordereau-details-par-annee.html',
delete = False):
context = {'invoicings': invoicing.get_stats_per_price_per_year()}
return render_to_pdf_file((header_service_template % service.slug,
header_template),
context,
delete = delete)
def header_file(service, invoicing, health_center, batches,
header_service_template='facturation/bordereau-%s.html',
@ -65,6 +75,7 @@ def header_file(service, invoicing, health_center, batches,
'synthesis': synthesis,
'counter': counter,
}
prefix = '%s-invoicing-%s-healthcenter-%s-' % (
service.slug, invoicing.id, health_center.id)
return render_to_pdf_file(
@ -262,7 +273,7 @@ def render_invoicing(invoicing, delete=False, headers=True, invoices=True):
service = invoicing.service
now = datetime.datetime.now()
output_file = None
all_files = []
all_files = [details_per_year(service, invoicing)]
try:
if service.name == 'CMPP':
batches_by_health_center = build_batches(invoicing)

View File

@ -0,0 +1,63 @@
<!doctype html>
<html>
<head>
<style>
@page {
@frame title {
-pdf-frame-content: title;
margin: 0.5cm;
margin-right: 6cm;
}
@frame {
top: 6cm;
margin: 1cm;
}
}
@page then {
@frame {
margin: 2cm 1cm;
}
}
div {
display: block;
}
table tr.batch-columns-header td {
text-align: center;
}
#title {
font-size: 3em;
line-height: 0cm;
}
#content td {
text-align: center;
}
#content {
text-align: center;
}
</style>
</head>
<body>
<div id="title">Détail par année et par tarif des actes</div>
<div id="content">
<div style="border: 0.5px solid black; padding-top: 2px; padding-bottom: 3px; line-height: 50%;">
<pdf:nexttemplate name="then"/>
<table>
<thead style="border: none;">
<tr class="batch-columns-header" style="background-color: #EEEEEE;">
<td>Tarif</td>
<td>Année</td>
<td>Actes</td>
<td>Montant</td>
</tr>
</thead>
<tbody class="batch-content" style="border: none;">
{% for year, x in invoicings.detail.items %}
{% for ppa, stats in x.items %}
<tr><td>{{ ppa }}</td><td>{{ year }}</td><td>{{ stats.0 }}</td><td>{{ stats.1 }}</td></tr>
{% endfor %}
{% endfor %}
</tbody>
</table>
</div>
</body>
</html>