Название сделки: {{ deal.name }}
                
             
            
            
                Дата создания: {{ now().strftime("%d.%m.%Y, %H:%M") }}
            
            
                Текущий статус: {{ current_status_str }}
            
            
                {% if deal.comment %}
                    Комментарий к сделке: {{ deal.comment }}
                {% endif %}
            
            
            
            
            
                Клиент: {{ deal.client.name }}
            
            
                Дата отгрузки: {{ last_status.next_status_deadline.strftime("%d.%m.%Y") }}
            
            {% if deal.base_marketplace.name %}
                
Маркетплейс: {{ deal.base_marketplace.name }}
            {% endif %}
            {% if deal.shipping_warehouse.name %}
                
Склад отгрузки: {{ deal.shipping_warehouse.name }}
            {% endif %}
            {% if deal.services|length > 0 %}
                
                    
                    
                        | Общие услуги | 
                        Количество | 
                        Сумма | 
                    
                    
                    
                    
                    
                    {% for service in deal.services %}
                        
                            | {{ service.service.name }} | 
                            {{ '{:,}'.format(service.quantity) }} шт. | 
                            {{ '{:,}'.format(service.price * service.quantity).replace(',', ' ') }} Р | 
                        
                    {% endfor %}
                    
                
                
                    Итого: {{ general_services_total }} Р
                
            {% else %}
                
                
            {% endif %}
            
            
            {% for product in deal.products %}
                
                    
                    
                        
                            {% if product.product.images|length > 0 %}
                                

                            {% else %}
                                

                            {% endif %}
                        
 
                        
                            
                                {{ loop.index }}. {{ product.product.name }}
                            
                            
                                Артикул: {{ product.product.article }}
                                {% if product.product.brand %}
                                    
Бренд: {{ product.product.brand }}
                                {% endif %}
                                {% if product.product.color %}
                                    
Цвет: {{ product.product.color }}
                                {% endif %}
                                {% if product.product.size %}
                                    
Размер: {{ product.product.size }}
                                {% endif %}
                                {% if product.quantity %}
                                    
Количество: {{ product.quantity }}
                                {% endif %}
                                {% if product.product.additional_info %}
                                    
                                        Доп. информация: {{ product.product.additional_info }}
                                    
                                {% endif %}
                            
 
                         
                     
                    
                    
                        
                            {% if product.product.barcodes|length > 0 %}
                                
                                    {{ encode128(product.product.barcodes[0].barcode, "A") }}
                                
                                
                                    {{ product.product.barcodes[0].barcode }}
                                
                            {% else %}
                                
                            {% endif %}
                        
 
                     
                 
                {% if product.services|length > 0 %}
                    
                        
                        
                            | Наименование услуги | 
                            Цена | 
                            Сумма | 
                        
                        
                        
                        
                        
                        {% for service in product.services %}
                            
                                | {{ service.service.name }} | 
                                {{ '{:,}'.format(product.quantity) }} Р | 
                                {{ '{:,}'.format(service.price * product.quantity).replace(',', ' ') }} Р | 
                            
                        {% endfor %}
                        
                    
                    
                        Итого: {{ product_services_totals[loop.index0].total }} Р, за
                        единицу: {{ product_services_totals[loop.index0].total_one_product }} Р
                    
                {% else %}
                    
                {% endif %}
            {% endfor %}