From 2d5b5dde002c301715ac466e83f9bd478b71125c Mon Sep 17 00:00:00 2001 From: Roman Widmann Date: Thu, 1 Feb 2018 16:47:12 +0100 Subject: [PATCH] Fall 4574, 4576: Dokumentenvorlagen --- ext/custom-addons/dp_custom/models/account.py | 9 + ext/custom-addons/dp_custom/models/sale.py | 9 + .../dp_reports/data/paperformat.xml | 4 +- .../dp_reports/reports/report_templates.xml | 17 +- .../static/src/less/report_backend.less | 29 +- .../dp_reports_account/reports/invoice.xml | 309 ++++++++---------- .../dp_reports_sale/reports/sale.xml | 82 +++-- 7 files changed, 231 insertions(+), 228 deletions(-) diff --git a/ext/custom-addons/dp_custom/models/account.py b/ext/custom-addons/dp_custom/models/account.py index fdf5cf87..7b5eaa6e 100644 --- a/ext/custom-addons/dp_custom/models/account.py +++ b/ext/custom-addons/dp_custom/models/account.py @@ -44,6 +44,15 @@ class AccountInvoice(models.Model): positions = fields.Integer(string='Positionen', compute='_compute_positions') num_items = fields.Integer(string='Anzahl der Artikel', compute='_compute_num_items') + weight_total = fields.Float(string='Gesamtgewicht', compute='_compute_weight_total') + + @api.multi + def _compute_weight_total(self): + for record in self: + sum = 0 + for line in record.invoice_line_ids: + sum += line.product_id.weight * line.quantity + record.weight_total = sum @api.multi def _compute_positions(self): diff --git a/ext/custom-addons/dp_custom/models/sale.py b/ext/custom-addons/dp_custom/models/sale.py index dcdf64cf..2a642757 100644 --- a/ext/custom-addons/dp_custom/models/sale.py +++ b/ext/custom-addons/dp_custom/models/sale.py @@ -49,6 +49,15 @@ class SaleOrder(models.Model): earliest_scheduled_date = fields.Datetime(compute='_compute_earliest_scheduled_date') positions = fields.Integer(string='Positionen', compute='_compute_positions') num_items = fields.Integer(string='Anzahl der Artikel', compute='_compute_num_items') + weight_total = fields.Float(string='Gesamtgewicht', compute='_compute_weight_total') + + @api.multi + def _compute_weight_total(self): + for record in self: + sum = 0 + for line in record.order_line: + sum += line.product_id.weight * line.product_uom_qty + record.weight_total = sum @api.multi def _compute_positions(self): diff --git a/ext/custom-addons/dp_reports/data/paperformat.xml b/ext/custom-addons/dp_reports/data/paperformat.xml index f23cb430..d1c9504b 100644 --- a/ext/custom-addons/dp_reports/data/paperformat.xml +++ b/ext/custom-addons/dp_reports/data/paperformat.xml @@ -7,12 +7,12 @@ 0 0 Portrait - 55 + 40 20 10 10 - 40 + 25 90 diff --git a/ext/custom-addons/dp_reports/reports/report_templates.xml b/ext/custom-addons/dp_reports/reports/report_templates.xml index 3acd0316..85df0cb9 100644 --- a/ext/custom-addons/dp_reports/reports/report_templates.xml +++ b/ext/custom-addons/dp_reports/reports/report_templates.xml @@ -61,15 +61,18 @@ style="max-height: 85px;"/> -
-
+
+
diff --git a/ext/custom-addons/dp_reports/static/src/less/report_backend.less b/ext/custom-addons/dp_reports/static/src/less/report_backend.less index c604d7f9..a414aef3 100644 --- a/ext/custom-addons/dp_reports/static/src/less/report_backend.less +++ b/ext/custom-addons/dp_reports/static/src/less/report_backend.less @@ -32,8 +32,9 @@ hr.red-line-1 { height: 1px; border: 0; border-top: 1px solid #A72523; - margin: 1em 0; padding: 0; + margin-top: 0; + margin-bottom: 0; } hr.red-line-2 { @@ -41,8 +42,9 @@ hr.red-line-2 { height: 2px; border: 0; border-top: 2px solid #A72523; - margin: 1em 0; padding: 0; + margin-top: 0; + margin-bottom: 0; } div.height-20 { @@ -52,13 +54,30 @@ div.height-20 { thead.table-header { background-color: #9D9D9D; + border-top: 2px solid #A72523; color: white; } tbody.sale-tbody { background-color: #E6E7E9; -} - -tr.amount-total { + margin-top: 0; + margin-bottom: 0; border-bottom: 2px solid #A72523; } + +tbody.totals-tbody { + background-color: #E6E7E9; + margin-top: 0; + margin-bottom: 0; +} + +tbody.invoice-tbody { + background-color: #E6E7E9; + margin-top: 0; + margin-bottom: 0; + border-bottom: 2px solid #A72523; +} + +.table-condensed > tbody > tr.amount-total { + border-top: 2px solid #A72523 !important; +} diff --git a/ext/custom-addons/dp_reports_account/reports/invoice.xml b/ext/custom-addons/dp_reports_account/reports/invoice.xml index c30b2e1c..7464e366 100644 --- a/ext/custom-addons/dp_reports_account/reports/invoice.xml +++ b/ext/custom-addons/dp_reports_account/reports/invoice.xml @@ -6,163 +6,129 @@
-
-
- Kundendaten -
- - - -
- -
- - -
- -
- Email: - -
- Telefon: - -
-
- Lieferadresse -
- - - -
- -
- - -
+
+
+ +
+
+ Lieferadresse +
+ +
+
-
- Rechnungsadresse -
- - - -
- -
- - -
- -
- Email: - -
- Telefon: +
+
+ Rechnungsadresse +
+
+
+
+
+
-
-
-
-
- Kundennr.: - - Ansprechpartner: - - Positionen: - -
-
- Angebotsdatum: - ????????? - Email: - - Artikel: - -
-
- Lieferdatum: - ????????? - Telefon: - - Bezeichnung: - ????????? +
+
+
+
+
+ Kundennr.: + + Ansprechpartner: + + Positionen: + +
+
+ Angebotsdatum: + ????????? + Email: + + Artikel: + +
+
+ Lieferdatum: + ????????? + Telefon: + + Bezeichnung: + ????????? +
+
+ + + + + + + + + + + + + -
Pos.AnzahlGewichtEPArtikelRabattGesamtpreis
- - + + + - - - - - - - - - - - - - - - - - - - - - - + + + + - - - + + + Zolltarif Nr.: + + +
+ + +
+ + + + + + + +
Pos.AnzahlGewichtEPArtikelRabattGesamtpreis
- - - - - kg - - - - - - - -
-
- - Zolltarif Nr.: - - + +
+ + + + + kg + + + + + + +
- -
- - - -
+ + + +
+ +
+
+
+ + - - - - -
- -
- -
- -
- - - + -
- Zwischensumme + Zwischensumme
Rechnungsbetrag - + + +
-
-
-
-

- -

-

- Gesamtgewicht: - kg -
-

-

- Lieferkonditionen: - -
-

-

- Zahlungskonditionen: - -
-

+ +
+
+

+ +

+

+ Gesamtgewicht: + kg +
+

+

+ Lieferkonditionen: + +
+

+

+ Zahlungskonditionen: + +
+

+
+
diff --git a/ext/custom-addons/dp_reports_sale/reports/sale.xml b/ext/custom-addons/dp_reports_sale/reports/sale.xml index 49bb0145..50f67b71 100644 --- a/ext/custom-addons/dp_reports_sale/reports/sale.xml +++ b/ext/custom-addons/dp_reports_sale/reports/sale.xml @@ -25,45 +25,40 @@


- - Email:
-
- - Telefon: - +
+
-
- Kundennr.: - - Ansprechpartner: - - Positionen: - -
-
- Angebotsdatum: - - Email: - - Artikel: - -
-
- Lieferdatum: - - Telefon: - - Bezeichnung: - ????????? -
-
-
+
+
+ Kundennr.: + + Ansprechpartner: + + Positionen: +
+
+ Angebotsdatum: + + Email: + + Artikel: + +
+
+ Lieferdatum: + + Telefon: + + Bezeichnung: + ????????? +
+
@@ -131,24 +126,20 @@
-
-
-
-
- + - + @@ -157,13 +148,15 @@ t-options='{"widget": "monetary", "display_currency": o.currency_id}'/> - + @@ -175,6 +168,11 @@

+

+ Gesamtgewicht: + kg +
+

Lieferkonditionen:

- Zwischensumme + Zwischensumme
MwSt.
Gesamtsumme - + + +