Replace margin style in A4 landscap to side_margin and extra_verical_margin parameters

#158881
This commit is contained in:
Raimon Esteve 2023-05-09 16:42:28 +02:00
parent d3020f360e
commit f442b2bf1f
9 changed files with 85 additions and 83 deletions

View File

@ -141,6 +141,7 @@ class GeneralLedgerReport(HTMLReport):
def __setup__(cls):
super(GeneralLedgerReport, cls).__setup__()
cls.__rpc__['execute'] = RPC(False)
cls.side_margin = 0.3
@classmethod
def prepare(cls, data):

View File

@ -1,7 +1,7 @@
<table style="width: 760px !important;margin-left: -70px !important;">
<table>
<tr>
<th>{{ _('Date') }}</th>
<th>{{ _('Número') }}</th>
<th>{{ _('Number') }}</th>
<th>{{ _('Reference') }} // {{ _('Description') }}</th>
<th style="text-align: right;">{{ _('Debit') }}</th>
<th style="text-align: right;">{{ _('Credit') }}</th>

View File

@ -1,25 +1,9 @@
{% extends 'account_reports/templates/base.html' %}
{% block style %}
<style type="text/css">
@page {
size: A4;
}
@media print {
#header-details {
display: none;
}
}
</style>
{% endblock %}
{% block title %}
{{ _('General Ledger') }} - {{ data['parameters']['company'] }} - {{ data['parameters']['now'] }}
{% endblock %}
{% block main %}
<div>
{{ show_detail(data['records']) }}
</div>
{{ show_detail(data['records']) }}
{% endblock %}

View File

@ -1,33 +1,55 @@
<link rel="stylesheet" href="{{ 'html_report/templates/base.css'|modulepath }}">
<style>
@page {
size: A4 landscape;
}
<header id="header" style="width: 760px !important;margin-left: -70px !important;">
<table>
<tr id="header-details">
<td>
<h1><em>{{ data['parameters']['company'] }} </em></h1> <br>
{{ _('VAT') }}: {{ data['parameters']['company_vat'] }}
</td>
<td>
<br>
<h1 style="margin-left: -105px !important;">{{ _('General Ledger') }}</h1>
</td>
<td class="right">
{{ data['parameters']['now'] }}
</td>
</tr>
<tr>
<td>
{{ _('Fiscal Year') }}: {{ data['parameters']['fiscal_year'] }}
{% if data['parameters']['start_period'] %} {{ _('Start Period') }}: {{ data['parameters']['start_period'].name|render }}{% endif %}
{% if data['parameters']['end_period'] %} {{ _('End Period') }}: {{ data['parameters']['end_period'].name|render }}{% endif %} <br>
{% if data['parameters']['parties'] %}{{ _('Parties') }}: {{ data['parameters']['parties'] }}{% else %}{{ _('All Parties' )}}{% endif %}<br/>
{% if data['parameters']['accounts'] %}{{ _('Accounts') }}: {{ data['parameters']['accounts'] }}{% else %}{{ _('All Accounts' )}}{% endif %}
</td>
</tr>
<tr>
<td colspan="3" >
{{ _("When the Move number is between '()' means it hasn't Post Number and the shown number is the provisional one.") }}
</td>
</tr>
</table>
header {
position: fixed;
top: 0;
left: 0;
padding-top: 1cm;
padding-left: 0.5cm;
text-align: left;
font-size: 9px;
width: 100%;
font-family: 'Arial';
}
</style>
<header id="header">
<table>
<thead>
<tr>
<td style="font-style: italic;font-size: 14px;font-weight: bold;">
{{ data['parameters']['company']}} <br>
{{ _('VAT') }}: {{ data['parameters']['company_vat'] }}
</td>
<td class="center" style="width:60%;text-align: center;font-size: 15px;">
<h1 style="font-size:20px">{{ _('General Ledger') }}</h1>
</td>
<td style="text-align: right;">
{{ data['parameters']['now']}}
</td>
</tr>
</thead>
</table>
<table>
<tbody>
<tr>
<td>
{{ _('Fiscal Year') }}: {{ data['parameters']['fiscal_year'] }}
{% if data['parameters']['start_period'] %} {{ _('Start Period') }}: {{ data['parameters']['start_period'].name|render }}{% endif %}
{% if data['parameters']['end_period'] %} {{ _('End Period') }}: {{ data['parameters']['end_period'].name|render }}{% endif %} <br>
{% if data['parameters']['parties'] %}{{ _('Parties') }}: {{ data['parameters']['parties'] }}{% else %}{{ _('All Parties' )}}{% endif %}<br/>
{% if data['parameters']['accounts'] %}{{ _('Accounts') }}: {{ data['parameters']['accounts'] }}{% else %}{{ _('All Accounts' )}}{% endif %}
</td>
</tr>
<tr>
<td>
{{ _("When the Move number is between '()' means it hasn't Post Number and the shown number is the provisional one.") }}
</td>
</tr>
</tbody>
</table>
</header>

View File

@ -180,11 +180,13 @@ class PrintTaxesByInvoiceAndPeriod(Wizard):
class TaxesByInvoiceReport(HTMLReport):
__name__ = 'account_reports.taxes_by_invoice'
side_margin = 0
@classmethod
def __setup__(cls):
super(TaxesByInvoiceReport, cls).__setup__()
cls.__rpc__['execute'] = RPC(False)
cls.side_margin = 0.3
@classmethod
def prepare(cls, data):

View File

@ -1,5 +1,5 @@
{% for k in data['records'] %}
<table style="text-align: right;width: 1110px !important;margin-left: -90px !important;">
<table>
{%if data['parameters']['jump_page'] %}
<thead>
<tr>

View File

@ -1,19 +1,29 @@
<link rel="stylesheet" href="{{ 'html_report/templates/base.css'|modulepath }}">
<style>
#header-table {
width: 17cm;
@page {
size: A4 landscape;
}
header {
position: fixed;
top: 0;
left: 0;
padding-top: 1cm;
padding-left: 0.5cm;
text-align: left;
font-size: 9px;
width: 100%;
font-family: 'Arial';
}
</style>
<header id="header">
<table style="width: 1110px !important; margin-left: -70px !important;">
<table>
<thead>
<tr>
<td style="font-style: italic;font-size: 14px;font-weight: bold;">
{{ data['parameters']['company_rec_name']}}
</td>
<td class="center" style="width:60%;text-align: right;font-size: 15px;">
<td class="center" style="width:60%;text-align: center;font-size: 15px;">
<h1 style="font-size:20px">{% if data['parameters']['jump_page'] %}{{ _('Taxes By Invoice and Period') }}{% else %}{{ _('Taxes By Invoice') }}{% endif %}</h1>
</td>
<td style="text-align: right;">
@ -23,8 +33,8 @@
</thead>
</table>
<table style="width: 1110px !important; margin-left: -70px !important;">
<thead>
<table>
<tbody>
{% if data['parameters']['start_date'] %}
<tr>
<td colspan="2" style="text-align: right;">{{ _('Initial posting date: ')}} {{ data['parameters']['start_date'] }}</td>
@ -35,13 +45,13 @@
</tr>
{% else %}
<tr>
<td>{{ _('Fiscal Year') }}: {{ data['parameters']['fiscal_year']}} {% if data['parameters']['periods'] %}{{ _('Periods:') }} {{data['parameters']['periods']}} {% else %}{{ _('All Periods') }}{% endif %}</td>
<td colspan="2">{{ _('Fiscal Year') }}: {{ data['parameters']['fiscal_year']}} {% if data['parameters']['periods'] %}{{ _('Periods:') }} {{data['parameters']['periods']}} {% else %}{{ _('All Periods') }}{% endif %}</td>
</tr>
{% endif %}
<tr>
<td>{% if data['parameters']['parties'] %}{{ _('Parties: ') }}{{ data['parameters']['parties']}}{% else %}{{ _('All Parties') }}{% endif %}</td>
<td style="text-align: right;">{% if data['parameters']['include_cancel'] %}{{ _('This document includes cancelled invoices marked with a *') }}{% else %}{{ _('This document not includes cancelled invoices') }}{% endif %}</td>
</tr>
</thead>
</tbody>
</table>
</header>

View File

@ -1,15 +1,5 @@
{% extends 'account_reports/templates/base.html' %}
{% block style %}
<style type="text/css">
@media print {
#header-details {
display: none;
}
}
</style>
{% endblock %}
{% block title %}
{% if data['parameters']['jump_page'] %}
{{ _('Taxes By Invoice and Period') }} - {{ data['parameters']['company_rec_name'] }} - {{ data['parameters']['now'] }}
@ -19,15 +9,9 @@
{% endblock %}
{% block main %}
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
{% if data['parameters']['records_found'] %}
{{ show_detail(data['records']) }}
{% else %}
<strong>{{ _('No records found') }}</strong>
{% endif %}
</div>
</div>
</div>
{% if data['parameters']['records_found'] %}
{{ show_detail(data['records']) }}
{% else %}
<strong>{{ _('No records found') }}</strong>
{% endif %}
{% endblock %}

View File

@ -23,7 +23,6 @@
-webkit-print-color-adjust: exact !important; /*Chrome, Safari */
color-adjust: exact !important; /*Firefox*/
}
size: A4;
}
header {