From 4e5365b946f45cda3d252d6aa2dad59c3686828f Mon Sep 17 00:00:00 2001 From: AlexSserb Date: Thu, 3 Oct 2024 16:08:17 +0400 Subject: [PATCH] feat: return barcodes to a document --- static/css/deal.css | 15 ++++++++++++++- .../documents/deal/deal-product-services.html | 14 ++++++++++---- templates/documents/deal/deal.html | 8 ++++++++ 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/static/css/deal.css b/static/css/deal.css index c5d2937..78c114d 100644 --- a/static/css/deal.css +++ b/static/css/deal.css @@ -159,12 +159,25 @@ table tfoot { .barcode-container-table { display: flex; white-space: nowrap; + flex-direction: column; + margin-top: 5px; + margin-bottom: -10px; } .barcode-container { display: flex; white-space: nowrap; - justify-content: right; + flex-direction: column; + margin-top: 15px; + margin-bottom: 0; + text-align: center; +} + +.barcode { + font-family: "Libre Barcode 128", cursive; + font-size: 25pt; + transform: scale(1, 1.5); + margin-bottom: -10px; } .barcode-text-bigger-part { diff --git a/templates/documents/deal/deal-product-services.html b/templates/documents/deal/deal-product-services.html index 9e15cb2..4c47020 100644 --- a/templates/documents/deal/deal-product-services.html +++ b/templates/documents/deal/deal-product-services.html @@ -59,14 +59,17 @@ {% if product_data.deal_products|length > 1 %}
{% else %} -
+
{% if product_data.deal_products[0].product.barcodes|length > 0 %} {% with barcode=product_data.deal_products[0].product.barcodes[0].barcode %} -

- ШК: {{ barcode[:-5] }} +

+ {{ encode128(barcode, "A") }} +
+ + {{ barcode[:-5] }} {{ barcode[-5:] }} -

+
{% endwith %} {% else %}
@@ -126,6 +129,9 @@
{% if deal_product.product.barcodes|length > 0 %} {% with barcode=deal_product.product.barcodes[0].barcode %} +
+ {{ encode128(barcode, "A") }} +
{{ barcode[:-5] }} {{ barcode[-5:] }} diff --git a/templates/documents/deal/deal.html b/templates/documents/deal/deal.html index 5caae29..795221e 100644 --- a/templates/documents/deal/deal.html +++ b/templates/documents/deal/deal.html @@ -8,6 +8,14 @@ Сделка