Production
This commit is contained in:
@@ -0,0 +1,108 @@
|
||||
{# Base for every company form. Standalone on purpose: the forms copy the printed
|
||||
originals and must not inherit the DCR report's look (base.html). #}
|
||||
{% from "forms/_macros.html" import letterhead, meta_block, grid, sign_right, sign_approval %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>{{ label }}{% if title_suffix %} — {{ title_suffix }}{% endif %}</title>
|
||||
<style>
|
||||
@page {
|
||||
size: A4;
|
||||
margin: 12mm 16mm;
|
||||
{% block page_box %}{% endblock %}
|
||||
}
|
||||
|
||||
* { box-sizing: border-box; }
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: Carlito, Calibri, "Liberation Sans", "DejaVu Sans", sans-serif;
|
||||
font-size: 11.5pt;
|
||||
line-height: 1.2;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.company { text-align: center; }
|
||||
.company .name {
|
||||
font-family: "Liberation Sans", Arial, Helvetica, "DejaVu Sans", sans-serif;
|
||||
font-size: 21pt;
|
||||
font-weight: bold;
|
||||
line-height: 1.15;
|
||||
color: #000;
|
||||
}
|
||||
.company .line { font-size: 11pt; line-height: 1.35; }
|
||||
|
||||
h1.title {
|
||||
margin: 7mm 0 4mm;
|
||||
text-align: center;
|
||||
font-size: 18pt;
|
||||
line-height: 1.1;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
table.meta { width: 100%; border-collapse: collapse; margin: 0 0 2.5mm; }
|
||||
table.meta td { padding: .6mm 0; font-size: 12pt; vertical-align: top; }
|
||||
table.meta td.ml { width: 62%; padding-left: 1.5mm; }
|
||||
|
||||
table.grid { border-collapse: collapse; table-layout: fixed; margin: 0 auto; }
|
||||
table.grid.left { margin: 0; }
|
||||
table.grid th, table.grid td { border: .7pt solid #000; padding: 0 1.6mm; }
|
||||
table.grid th {
|
||||
background: #fff;
|
||||
height: 9mm;
|
||||
font-size: 11.5pt;
|
||||
line-height: 1.15;
|
||||
text-align: center;
|
||||
}
|
||||
table.grid td {
|
||||
height: 6.4mm;
|
||||
font-size: 11.5pt;
|
||||
line-height: 1.15;
|
||||
vertical-align: middle;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
table.grid tr { page-break-inside: avoid; }
|
||||
th.l, td.l { text-align: left; }
|
||||
th.c, td.c { text-align: center; }
|
||||
th.r, td.r { text-align: right; }
|
||||
|
||||
/* A fill-in line: the printed underscore rule, holding the value when there is one. */
|
||||
.ln {
|
||||
display: inline-block;
|
||||
min-width: 42mm;
|
||||
height: 4.4mm;
|
||||
border-bottom: .7pt solid #000;
|
||||
text-align: center;
|
||||
font-weight: normal;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
.sign-right {
|
||||
margin: 16mm 0 0 68%;
|
||||
font-size: 10.5pt;
|
||||
font-weight: bold;
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
table.sign-approval { width: 100%; margin-top: 14mm; border-collapse: collapse; page-break-inside: avoid; }
|
||||
table.sign-approval td { padding: 0; font-size: 8.5pt; font-weight: bold; }
|
||||
table.sign-approval td:first-child { width: 56%; }
|
||||
table.sign-approval .sign-when { margin: 1.5mm 0 0 0; font-size: 8pt; font-weight: normal; text-align: right; }
|
||||
table.sign-approval .ln { font-size: 9pt; }
|
||||
|
||||
{% block form_styles %}{% endblock %}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
{% block body %}
|
||||
{{ letterhead(full_letterhead) }}
|
||||
<h1 class="title">{{ title }}</h1>
|
||||
{{ meta_block(meta_rows) }}
|
||||
{% block form %}{% endblock %}
|
||||
{% block signature %}{{ sign_right() }}{% endblock %}
|
||||
{% endblock %}
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,56 @@
|
||||
{# Building blocks shared by the company-form PDFs. Each mirrors a part of the printed form. #}
|
||||
|
||||
{% macro letterhead(full) %}
|
||||
<div class="company">
|
||||
<div class="name">{{ company_name }}</div>
|
||||
{% if full %}
|
||||
<div class="line">{{ company_address }}</div>
|
||||
<div class="line">Website: {{ company_website }} E-Mail:{{ company_email }}</div>
|
||||
<div class="line">PHONE: {{ company_phone }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{# NAME / HEADQUARTER on the left, DATE / MONTH on the right — empty slots stay empty. #}
|
||||
{% macro meta_block(rows) %}
|
||||
{% if rows %}
|
||||
<table class="meta">
|
||||
{% for pair in rows %}
|
||||
<tr>
|
||||
{% for slot in pair %}
|
||||
<td class="{{ 'ml' if loop.first else 'mr' }}">{% if slot %}<b>{{ slot[0] }}</b> {{ slot[1] }}{% endif %}</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro grid(g, left=False) %}
|
||||
<table class="grid{% if left %} left{% endif %}" style="width:{{ g.width }}">
|
||||
<colgroup>{% for w in g.widths %}<col style="width:{{ w }}">{% endfor %}</colgroup>
|
||||
<thead>
|
||||
<tr>{% for h in g.headers %}<th>{{ h }}</th>{% endfor %}</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for r in g.rows %}
|
||||
<tr>{% for c in r.cells %}<td class="{{ g.aligns[loop.index0] }}">{{ c }}</td>{% endfor %}</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endmacro %}
|
||||
|
||||
{# "SIGNATURE" alone, low on the right — the sales / activity / call-report forms. #}
|
||||
{% macro sign_right(text="SIGNATURE") %}
|
||||
<div class="sign-right">{{ text }}</div>
|
||||
{% endmacro %}
|
||||
|
||||
{# Tour plan, standard tour plan and fare chart: MR signature plus the AM approval. #}
|
||||
{% macro sign_approval(approval) %}
|
||||
<table class="sign-approval">
|
||||
<tr>
|
||||
<td>SIGNATURE: <span class="ln">{{ approval.mr_name }}</span></td>
|
||||
<td>{{ approval.label }} <span class="ln">{{ approval.value }}</span>{% if approval.when %}<div class="sign-when">{{ approval.when }}</div>{% endif %}</td>
|
||||
</tr>
|
||||
</table>
|
||||
{% endmacro %}
|
||||
@@ -0,0 +1,11 @@
|
||||
{% extends "forms/_form_base.html" %}
|
||||
{% from "forms/_macros.html" import grid %}
|
||||
|
||||
{% block form_styles %}
|
||||
h1.title { margin: 0 0 5mm; font-size: 10pt; }
|
||||
table.grid th { font-family: "Liberation Sans", Arial, "DejaVu Sans", sans-serif; font-size: 10pt; }
|
||||
{% endblock %}
|
||||
|
||||
{% block form %}
|
||||
{{ grid(grids.main) }}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,11 @@
|
||||
{% extends "forms/_form_base.html" %}
|
||||
{% from "forms/_macros.html" import grid %}
|
||||
|
||||
{% block form_styles %}
|
||||
h1.title { margin: 0 0 5mm; font-size: 10pt; }
|
||||
table.grid th { font-family: "Liberation Sans", Arial, "DejaVu Sans", sans-serif; font-size: 10pt; }
|
||||
{% endblock %}
|
||||
|
||||
{% block form %}
|
||||
{{ grid(grids.main) }}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,24 @@
|
||||
{% extends "forms/_form_base.html" %}
|
||||
{% from "forms/_macros.html" import grid %}
|
||||
|
||||
{% block form_styles %}
|
||||
h1.title { margin: 6mm 0 3mm; font-size: 13pt; text-decoration: none; letter-spacing: .3px; }
|
||||
table.grid th { height: 7.5mm; font-size: 9pt; }
|
||||
table.grid td { font-size: 10pt; }
|
||||
h2.section { margin: 6mm 0 1.5mm; text-align: center; font-size: 11pt; }
|
||||
.visit { margin: 6mm 0 0 14mm; font-size: 10.5pt; line-height: 1.7; }
|
||||
.visit b { display: inline-block; min-width: 30mm; }
|
||||
.sign-left { margin: 12mm 0 0 14mm; font-size: 10.5pt; font-weight: bold; }
|
||||
{% endblock %}
|
||||
|
||||
{% block form %}
|
||||
{{ grid(grids.doctors, left=True) }}
|
||||
<h2 class="section">CHEMIST VISIT</h2>
|
||||
{{ grid(grids.chemists, left=True) }}
|
||||
<div class="visit">
|
||||
<div><b>STOCKIST VISIT :</b> {{ stockist_visit }}</div>
|
||||
<div><b>ORDER :</b> {{ order_value }}</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block signature %}<div class="sign-left">MR Signature</div>{% endblock %}
|
||||
@@ -0,0 +1,8 @@
|
||||
{% extends "forms/_form_base.html" %}
|
||||
{% from "forms/_macros.html" import grid, sign_approval %}
|
||||
|
||||
{% block form %}
|
||||
{{ grid(grids.main) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block signature %}{{ sign_approval(approval) }}{% endblock %}
|
||||
@@ -0,0 +1,20 @@
|
||||
{% extends "forms/_form_base.html" %}
|
||||
{% from "forms/_macros.html" import grid, sign_right %}
|
||||
|
||||
{% block form_styles %}
|
||||
h1.title { margin: 0 0 5mm; font-size: 13pt; }
|
||||
table.grid th { font-family: "Liberation Sans", Arial, "DejaVu Sans", sans-serif; font-size: 10pt; }
|
||||
table.avg { width: 100%; margin-top: 7mm; border-collapse: collapse; }
|
||||
table.avg td { padding: 0; font-family: "Liberation Sans", Arial, "DejaVu Sans", sans-serif; font-size: 9.5pt; font-weight: bold; white-space: nowrap; }
|
||||
table.avg .ln { min-width: 44mm; }
|
||||
{% endblock %}
|
||||
|
||||
{% block form %}
|
||||
{{ grid(grids.main) }}
|
||||
<table class="avg">
|
||||
<tr>
|
||||
<td>DOCTOR CALL AVG <span class="ln">{{ doctor_call_avg }}</span></td>
|
||||
<td>CHEMIST CALL AVG. <span class="ln">{{ chemist_call_avg }}</span></td>
|
||||
</tr>
|
||||
</table>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,6 @@
|
||||
{% extends "forms/_form_base.html" %}
|
||||
{% from "forms/_macros.html" import grid %}
|
||||
|
||||
{% block form %}
|
||||
{{ grid(grids.main) }}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,11 @@
|
||||
{% extends "forms/_form_base.html" %}
|
||||
{% from "forms/_macros.html" import grid %}
|
||||
|
||||
{% block form_styles %}
|
||||
h1.title { font-size: 14pt; margin: 6mm 0 3mm; }
|
||||
table.grid th { font-size: 11pt; }
|
||||
{% endblock %}
|
||||
|
||||
{% block form %}
|
||||
{{ grid(grids.main) }}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,20 @@
|
||||
{% extends "forms/_form_base.html" %}
|
||||
{% from "forms/_macros.html" import grid %}
|
||||
|
||||
{# Arial throughout, title tucked directly under the company name — as printed. #}
|
||||
{% block form_styles %}
|
||||
.company .name { font-size: 20pt; }
|
||||
h1.title {
|
||||
margin: 0 0 4mm;
|
||||
font-family: "Liberation Sans", Arial, "DejaVu Sans", sans-serif;
|
||||
font-size: 14pt;
|
||||
}
|
||||
table.grid th, table.grid td { font-family: "Liberation Sans", Arial, "DejaVu Sans", sans-serif; }
|
||||
table.grid th { height: 10mm; font-size: 9.5pt; }
|
||||
table.grid td { font-size: 9.5pt; }
|
||||
table.grid td:nth-child(2) { font-weight: bold; }
|
||||
{% endblock %}
|
||||
|
||||
{% block form %}
|
||||
{{ grid(grids.main) }}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,8 @@
|
||||
{% extends "forms/_form_base.html" %}
|
||||
{% from "forms/_macros.html" import grid, sign_approval %}
|
||||
|
||||
{% block form %}
|
||||
{{ grid(grids.main, left=True) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block signature %}{{ sign_approval(approval) }}{% endblock %}
|
||||
@@ -0,0 +1,8 @@
|
||||
{% extends "forms/_form_base.html" %}
|
||||
{% from "forms/_macros.html" import grid, sign_approval %}
|
||||
|
||||
{% block form %}
|
||||
{{ grid(grids.main) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block signature %}{{ sign_approval(approval) }}{% endblock %}
|
||||
@@ -0,0 +1,64 @@
|
||||
{% extends "forms/_form_base.html" %}
|
||||
{% from "forms/_macros.html" import letterhead, sign_right %}
|
||||
|
||||
{# The weekly report is boxed: the whole page carries a border, as printed. #}
|
||||
{% block page_box %}margin: 8mm; padding: 9mm 8mm 6mm; border: .8pt solid #000;{% endblock %}
|
||||
|
||||
{% macro items(rows, label_width) %}
|
||||
<table class="items">
|
||||
{% for label, value in rows %}
|
||||
<tr>
|
||||
<td class="bul">o</td>
|
||||
<td class="lbl" style="width:{{ label_width }}">{{ label }}</td>
|
||||
<td>: <span class="ln">{{ value }}</span></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endmacro %}
|
||||
|
||||
{% block form_styles %}
|
||||
.weekly + .weekly { page-break-before: always; }
|
||||
.weekly h1.title { margin: 2mm 0 0; font-family: "Liberation Sans", Arial, "DejaVu Sans", sans-serif; font-size: 11pt; }
|
||||
table.wmeta { width: 100%; margin: 9mm 0 7mm; border: .75pt solid #000; border-collapse: collapse; }
|
||||
table.wmeta td { padding: 1.4mm 3mm; font-size: 10.5pt; }
|
||||
table.wmeta td:first-child { width: 68%; }
|
||||
.weekly h2 {
|
||||
margin: 0 0 .6mm;
|
||||
font-family: "Liberation Serif", "Times New Roman", "DejaVu Serif", serif;
|
||||
font-size: 11.5pt;
|
||||
}
|
||||
.weekly h2.gap { margin-top: 2mm; }
|
||||
table.items { width: 100%; margin: 0 0 4mm; border: .75pt solid #000; border-collapse: collapse; }
|
||||
table.items td {
|
||||
padding: .5mm 0;
|
||||
font-family: "Liberation Serif", "Times New Roman", "DejaVu Serif", serif;
|
||||
font-size: 11pt;
|
||||
line-height: 1.25;
|
||||
white-space: nowrap;
|
||||
}
|
||||
table.items tr:last-child td { padding-bottom: 2mm; }
|
||||
table.items td.bul { width: 9mm; padding-left: 3mm; font-family: "Liberation Mono", "Courier New", monospace; }
|
||||
table.items .ln { min-width: 60mm; text-align: left; height: 4.6mm; }
|
||||
.weekly .sign-right { margin-top: 26mm; font-size: 10.5pt; }
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
{% for report in reports %}
|
||||
<div class="weekly">
|
||||
{{ letterhead(false) }}
|
||||
<h1 class="title" style="text-decoration: underline">{{ title }}</h1>
|
||||
<table class="wmeta">
|
||||
{% for pair in report.meta_rows %}
|
||||
<tr>
|
||||
{% for slot in pair %}<td><b>{{ slot[0] }}</b> {{ slot[1] }}</td>{% endfor %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
<h2>1. Work Summary & Sales Performance</h2>
|
||||
{{ items(report.summary, "40mm") }}
|
||||
<h2 class="gap">2. Additional Schemes & Projects</h2>
|
||||
{{ items(report.schemes, "64mm") }}
|
||||
{{ sign_right("Signature") }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user