From 03aba9649a5a4bc650a22c5f9cd65f154996a0ee Mon Sep 17 00:00:00 2001 From: AlexSserb Date: Thu, 12 Sep 2024 00:52:00 +0400 Subject: [PATCH] fix: inline styles to classes --- services/billing.py | 8 ++--- templates/documents/bill-of-payment.html | 39 +++++++++--------------- 2 files changed, 19 insertions(+), 28 deletions(-) diff --git a/services/billing.py b/services/billing.py index 53f51f8..e426e8c 100644 --- a/services/billing.py +++ b/services/billing.py @@ -149,16 +149,16 @@ class BillingService(BaseService): services.append( CreateBillingRequestValue( name=f'[{product.product.name}] - {service.service.name}', - price=to_locale_number(service.price), - amount=to_locale_number(product.quantity) + price=service.price, + amount=product.quantity ) ) for service in deal.services: services.append( CreateBillingRequestValue( name=f'{service.service.name}', - price=to_locale_number(service.price), - amount=to_locale_number(service.quantity) + price=service.price, + amount=service.quantity ) ) diff --git a/templates/documents/bill-of-payment.html b/templates/documents/bill-of-payment.html index d2c27a2..6c85e5d 100644 --- a/templates/documents/bill-of-payment.html +++ b/templates/documents/bill-of-payment.html @@ -35,8 +35,6 @@ margin-top: 8px; display: flex; justify-content: space-between; - /*flex-direction: column;*/ - /*text-align: right;*/ } .footer-block { @@ -80,8 +78,6 @@ td, th { padding: 16px 13px; - /*word-wrap: unset;*/ - } td:first-child, th:first-child { @@ -96,10 +92,21 @@ text-align: left; } + td:first-child { + white-space: normal; + word-wrap: break-word; + } + td:not(:first-child), th:not(:first-child) { text-align: right; } + td:not(:first-child) { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + img { width: 170px; margin-bottom: 15px; @@ -109,10 +116,6 @@ border-top: 2px solid black; } - .footer-right { - text-align: right; - } - .footer-line-right { font-size: medium; font-weight: bolder; @@ -166,23 +169,13 @@ {% for service in services %} - {{ service.name }} - - {{ service.amount }} шт. - {{ service.price }} ₽ - {{ '{:,}'.format(service.price * service.amount).replace(',', ' ') }}dshfghfghfghfg ₽ + {{ service.name }} + {{ '{:,}'.format(service.amount) }} шт. + {{ '{:,}'.format(service.price).replace(',', ' ') }} ₽ + {{ '{:,}'.format(service.price * service.amount).replace(',', ' ') }} ₽ {% endfor %} -