templates/ClientInquiry/index.html.twig line 1

Open in your IDE?
  1. {% extends 'Layout/base.html.twig' %}
  2. {% block body %}
  3.     <div class="row mb-1 mt-0">
  4.         <div class="col-12">
  5.             <div class="email-container bg-transparent">
  6.                 <div class="inbox-rightbar">
  7.                     <div class="btn-group mb-2">
  8.                         {% if app.user.isRecipient %}
  9.                                 {% if not app.user.avoidUserForCreateNewInquiries %}
  10.                                     <button type="button" class="btn btn-success" onclick="window.location.href = '{{ path('client_inquiry_new') }}'"><i class="uil uil-plus"></i> {{ 'inquiry.add'|trans }}</button>
  11.                                 {% endif %}
  12.                                 {% if folder != 'chosen' and folder != 'archived' %}
  13.                                     <button type="button" class="btn btn-light move-to-archive" data-toggle="tooltip" data-html="true" data-placement="top" title="" data-original-title="ARCHIWIZUJ! Wskazówka:<br/>Zapytania, których wiesz że już na pewno NIE będziesz zamawiał przenieś do folderu Archiwum. Zaznacz je po lewej stronie w kwadracie a następnie kliknij poniższy przycisk „Archiwizuj” Dzięki temu będziesz mieć porządek :) ">
  14.                                         <i class="uil uil-archive-alt"></i>
  15.                                     </button>
  16.                                 {% endif %}
  17.                         {% endif %}
  18.                         {% if folder is not defined %}
  19.                             {% set folder='unknown' %}
  20.                         {% endif %}
  21.                     </div>
  22.                     <div class="mt-2">
  23. {#                        <h5 class="mt-3 mb-2 font-size-16">{{ 'menu.new'|trans }}</h5>#}
  24.                         <ul class="message-list">
  25.                             {% if entities|length == 0 %}
  26.                                 <h5 class="mt-3 mb-2 font-size-16">{{ 'common.no_results'|trans }}</h5>
  27.                             {% else %}
  28.                                 {% for inquiry in entities %}
  29.                                     {% set lowestPrice = 99999999 %}
  30.                                     {% set highestPrice = 0 %}
  31.                                     {% set chosenOfferId = null %}
  32.                                     {% set chosenOffer = null %}
  33.                                     {% set showOthersOffer = false %}
  34.                                     {% set countShowOthersOffers = 0 %}
  35.                                     {% for offer in inquiry.offers %}
  36.                                         {% if offer.totalPrice > highestPrice %}
  37.                                             {% set highestPrice = offer.totalPrice %}
  38.                                         {% endif %}
  39.                                         {% if offer.totalPrice < lowestPrice %}
  40.                                             {% set lowestPrice = offer.totalPrice %}
  41.                                         {% endif %}
  42.                                         {% if offer.chosen %}
  43.                                             {% set chosenOfferId = offer.id %}
  44.                                             {% set chosenOffer = offer %}
  45.                                         {% endif %}
  46.                                     {% endfor %}
  47.                                     <li entity-id="{{ inquiry.id }}" class="unread search-item-row" data-search-data="{{ inquiry.make }} {{ inquiry.model }} {{ inquiry.registrationNumber }} {{ inquiry.vin }} {{ inquiry.notices }}" style="{% if loop.index % 2 == 0 %} background-color: #dddddd {% endif %}">
  48.                                         <div class="row col-12">
  49.                                             <div class="col-mail col-mail-1 col-mail-car" style="width: 160px !important;">
  50.                                                 <div class="checkbox-wrapper-mail">
  51.                                                     <input type="checkbox" id="chk{{ inquiry.id }}" class="listCheckboxes" name="ids[]" value="{{ inquiry.id }}">
  52.                                                     <label for="chk{{ inquiry.id }}" class="toggle"></label>
  53.                                                 </div>
  54.                                                 <span data-toggle="tooltip" title="" data-original-title="
  55.                                                 Utworzono dnia <br>{{ inquiry.createdAt|date('Y-m-d H:i') }}
  56.                                                 {% if chosenOffer is not null %}
  57.                                                     {% if chosenOffer.chooseDate is not null %}<br>
  58.                                                         {{ 'offer.chooseDate'|trans }} <br>{{ chosenOffer.chooseDate|date('Y-m-d H:i') }}
  59.                                                     {% endif %}
  60.                                                     {% if chosenOffer.orderedDate is not null %}<br>
  61.                                                         {{ 'offer.orderConfirmationDate'|trans }} <br>{{ chosenOffer.orderedDate|date('Y-m-d H:i') }}
  62.                                                     {% endif %}
  63.                                                     {% if chosenOffer.sendDate is not null %}<br>
  64.                                                         {{ 'offer.sendConfirmationDate'|trans }}: <br>{{ chosenOffer.sendDate|date('Y-m-d H:i') }}
  65.                                                     {% endif %}
  66.                                                 {% endif %}
  67.                                                     " data-html="true"><i class="fa fa-calendar-alt"></i></span>
  68.                                                 {% if chosenOffer is not null and chosenOffer.partsOrdered and (app.user.id == inquiry.recipient.id or app.user.id == chosenOffer.supplier.id) %}
  69.                                                     <span data-toggle="tooltip" title="" data-original-title="Potwierdzono zamówienie części"><i class="fa fa-check text-success"></i></span>
  70.                                                 {% endif %}
  71.                                                 {% if chosenOffer is not null and not chosenOffer.partsOrdered and (app.user.id == inquiry.recipient.id or app.user.id == chosenOffer.supplier.id) %}
  72.                                                     &nbsp;
  73.                                                     <a href="{{ path('client_offer_details', {'id': chosenOffer.id}) }}" data-toggle="tooltip" title="" data-original-title="Oczekuje na potwierdzenie zamówienia częsci przez Dostawcę">
  74.                                                         <i class="fa fa-exclamation text-danger"></i>
  75.                                                     </a>
  76.                                                 {% endif %}
  77.                                                 {% if inquiry.isPartsReceived and (app.user.id == inquiry.recipient.id or app.user.id == chosenOffer.supplier.id) %}
  78.                                                     <span data-toggle="tooltip" title="" data-original-title="Potwierdzenie otrzymanie części"><i class="fa fa-check text-success"></i></span>
  79.                                                 {% endif %}
  80.                                                 {% if inquiry.isPartsIssued and (app.user.id == inquiry.recipient.id or app.user.id == chosenOffer.supplier.id) %}
  81.                                                     <span data-toggle="tooltip" title="" data-original-title="Potwierdzone wydanie części do naprawy"><i class="fa fa-check text-success"></i></span>
  82.                                                 {% endif %}
  83.                                                 {% if unreadPrivateMessages['privateMessages'][inquiry.id] is defined %}
  84.                                                     <a href="{{ path('client_offer_details', {'id': unreadPrivateMessages['privateMessages'][inquiry.id][0]['offer_id']}) }}#comments" style="animation: blinker 1s linear infinite; color: red;">
  85.                                                         <span data-toggle="tooltip" title="" data-original-title="
  86.                                                             {% if unreadPrivateMessages['privateMessages'][inquiry.id] is defined %}Oczekujące prywatne wiadomości: {{ unreadPrivateMessages['privateMessages'][inquiry.id]|length }}{% endif %}"
  87.                                                             >
  88.                                                             <i class="fa fa-envelope fa-2x"></i>
  89.                                                         </span>
  90.                                                     </a>
  91.                                                 {% endif %}
  92.                                             </div>
  93.                                             {% if app.request.attributes.get('_route') == 'supplier_inquiry_won' or app.request.attributes.get('_route') == 'client_inquiry_chosen' %}
  94.                                                 <div class="col-mail col-mail-1 col-mail-car" style="width: 95px !important; line-height: 16px !important; padding-top: 17px !important;">
  95.                                                     <span data-toggle="tooltip" title="" data-original-title="Data zamówienia">
  96.                                                         {{ inquiry.createdAt|date('d.m.Y') }}<br/>
  97.                                                         {{ inquiry.createdAt|date('H:i') }}<br/>
  98.                                                     </span>
  99.                                                 </div>
  100.                                             {% endif %}
  101.                                             <div class="col-mail col-mail-1 col-mail-car nowrap-mobile">
  102.                                                 <a href="{{ path('client_inquiry_details', {id : inquiry.id}) }}" class="title">{{ inquiry.make }} {{ inquiry.model }}</a>
  103.                                             </div>
  104.                                             <span class="col-span-center" onclick="window.location.href = '{{ path('client_inquiry_details', {id : inquiry.id}) }}'">
  105.                                             <div class="col-mail col-mail-1 mt-2 col-mail-registration-number">
  106. {#                                                {% if lastPrivateMessages[inquiry.id] is defined %}#}
  107. {#                                                    <span data-toggle="tooltip" data-html="true" title="" data-original-title="{{ lastPrivateMessages[inquiry.id]|raw }}">#}
  108. {#                                                {% endif %}#}
  109.                                                 <div class="board-box">
  110.                                                     <div class="license-plate plate-small">
  111.                                                         <div class="blue-stripe">
  112.                                                             <span class="stars">*</span><span class="PL">|</span>
  113.                                                         </div>
  114.                                                         <div class="license-plate-number">
  115.                                                             {{ inquiry.registrationNumber }}
  116.                                                         </div>
  117.                                                     </div>
  118.                                                 </div>
  119. {#                                                {% if lastPrivateMessages[inquiry.id] is defined %}#}
  120. {#                                                    </span>#}
  121. {#                                                {% endif %}#}
  122.                                             </div>
  123.                                             <div class="col-mail col-mail-1 mt-2 col-mail-recipient" data-toggle="tooltip" title="" data-original-title="
  124.                                                 {% if folder == 'chosen' and app.user.id == inquiry.recipient.id %}
  125.                                                     {{ chosenOffer.supplier }} (NIP: {% if chosenOffer.supplier.nip is defined and chosenOffer.supplier.nip is not null %}{{ chosenOffer.supplier.nip }}{% endif %})
  126.                                                 {% else %}
  127.                                                     {{ inquiry.recipient }} (NIP: {% if inquiry.recipient.nip is defined and inquiry.recipient.nip is not null %}{{ inquiry.recipient.nip }}{% endif %})
  128.                                                 {% endif %}
  129.                                                 ">
  130.                                                 {% if folder == 'chosen' and app.user.id == inquiry.recipient.id %}
  131.                                                     <p class="recipient">{{ chosenOffer.supplier }}</p>
  132.                                                 {% else %}
  133.                                                     <p class="recipient">{{ inquiry.recipient }}</p>
  134.                                                 {% endif %}
  135.                                             </div>
  136.                                             {% set supplierAddress = null %}
  137.                                             {% if chosenOffer is not null %}
  138.                                                 {% for address in chosenOffer.supplier.addresses %}
  139.                                                     {% if address.defaultAddress %}
  140.                                                         {% set supplierAddress = address %}
  141.                                                     {% endif %}
  142.                                                 {% endfor %}
  143.                                             {% endif %}
  144.                                             <div class="col-mail col-mail-1 mt-2 col-mail-address" data-toggle="tooltip" title="" data-original-title="
  145.                                             {% if folder == 'chosen' and app.user.id == inquiry.recipient.id %}
  146.                                                 {% if supplierAddress is not null %}
  147.                                                     {{ supplierAddress.street }} {{ supplierAddress.propertyNumber }},&nbsp;
  148.                                                     {{ supplierAddress.zipCode }} {{ supplierAddress.city }}
  149.                                                 {% endif %}
  150.                                             {% else %}
  151.                                                 {% if inquiry.customerAddress is null %}
  152.                                                     {% if inquiry.recipient.street is not null %}
  153.                                                         {{ inquiry.recipient.street }}
  154.                                                     {% endif %}
  155.                                                     {% if inquiry.recipient.propertyNumber is not null %}
  156.                                                         {{ inquiry.recipient.propertyNumber }}
  157.                                                     {% endif %}
  158.                                                 {% else %}
  159.                                                     {% if inquiry.customerAddress.street is not null %}
  160.                                                         {{ inquiry.customerAddress.street }}
  161.                                                     {% endif %}
  162.                                                     {% if inquiry.customerAddress.propertyNumber is not null %}
  163.                                                         {{ inquiry.customerAddress.propertyNumber }}
  164.                                                     {% endif %}
  165.                                                 {% endif %}
  166.                                             {% endif %}
  167.                                             ">
  168.                                                 <p class="address">
  169.                                                     {% if folder == 'chosen' and app.user.id == inquiry.recipient.id %}
  170.                                                         {% set recipientAddress = '' %}
  171.                                                         {% if inquiry.customerAddress is not null %}
  172.                                                             {% set recipientAddress = inquiry.customerAddress.city ~ '+' ~ inquiry.customerAddress.street ~ '+' ~ inquiry.customerAddress.propertyNumber %}
  173.                                                         {% endif %}
  174.                                                         {% if supplierAddress is not null %}
  175.                                                             {{ supplierAddress.street }} {{ supplierAddress.propertyNumber }}<br/>
  176.                                                             {{ supplierAddress.zipCode }} {{ supplierAddress.city }}
  177.                                                             {% if loggedAddressForGoogleMaps != supplierAddress.city~'+'~supplierAddress.street~'+'~supplierAddress.propertyNumber %}
  178.                                                                 <br/><a target="_blank" href="https://www.google.com/maps/dir/?api=1&origin={{ recipientAddress }}&destination={{ supplierAddress.city }}+{{ supplierAddress.street }}+{{ supplierAddress.propertyNumber }}">Zobacz trasę</a>
  179.                                                             {% endif %}
  180.                                                         {% endif %}
  181.                                                     {% else %}
  182.                                                         {% if inquiry.customerAddress is null %}
  183.                                                             {% if inquiry.recipient.street is not null %}
  184.                                                                 {{ inquiry.recipient.street }}
  185.                                                             {% endif %}
  186.                                                             {% if inquiry.recipient.propertyNumber is not null %}
  187.                                                                 {{ inquiry.recipient.propertyNumber }}
  188.                                                             {% endif %}
  189.                                                         {% else %}
  190.                                                             {% if inquiry.customerAddress.street is not null %}
  191.                                                                 {{ inquiry.customerAddress.street }}
  192.                                                             {% endif %}
  193.                                                             {% if inquiry.customerAddress.propertyNumber is not null %}
  194.                                                                 {{ inquiry.customerAddress.propertyNumber }}
  195.                                                             {% endif %}
  196.                                                         {% endif %}
  197.                                                     {% endif %}
  198.                                                 </p>
  199.                                             </div>
  200.                                             </span>
  201.                                             <div class="col-mail-center">
  202.                                                 {% set loggedSupplierInquiryCount = 0 %}
  203.                                                 {% if app.user.showOtherOffers %}
  204.                                                     {% for offer in inquiry.offers %}
  205.                                                         {% set loggedSupplierInquiryCount = loggedSupplierInquiryCount + 1 %}
  206.                                                     {% endfor %}
  207.                                                 {% else %}
  208.                                                     {% for offer in inquiry.offers %}
  209.                                                         {% if (app.user.isSupplier and offer.supplier.id == app.user.id) or (app.user.isRecipient) %}
  210.                                                             {% set loggedSupplierInquiryCount = loggedSupplierInquiryCount + 1 %}
  211.                                                         {% endif %}
  212.                                                     {% endfor %}
  213.                                                 {% endif %}
  214.                                                 <div class="col-mail col-mail-offer-discussion">
  215.                                                     {% if app.user.isRecipient or (app.user.isSupplier and app.user.showOtherOffers) %}
  216.                                                         {% if loggedSupplierInquiryCount > 0 %}
  217.                                                             <button class="btn text-success" type="button" aria-controls="offerBox{{ inquiry.id }}" onclick="$('#offerBox{{ inquiry.id }}').collapse('toggle')" data-toggle="tooltip" title="" data-original-title="{% trans %}offer.offers{% endtrans %} ({{ inquiry.offers|length }})">
  218.                                                                 <i class="fa fa-file-alt"></i>
  219.                                                                 <span>
  220.                                                                     {% trans %}offer.offers{% endtrans %} ({{ inquiry.offers|length }})
  221.                                                                 </span>
  222.                                                             </button>
  223.                                                         {% else %}
  224.                                                             <button class="btn text-secondary disabled" type="button" data-toggle="tooltip" title="" data-original-title="{% trans %}offer.no_offers{% endtrans %}">
  225.                                                                 <i class="fa fa-file-alt"></i>
  226.                                                             </button>
  227.                                                         {% endif %}
  228.                                                     {% endif %}
  229.                                                     {% if app.user.isSupplier %}
  230.                                                         {% set suppliersOffer = false %}
  231.                                                         {% for offer in inquiry.offers %}
  232.                                                             {% if offer.supplier.id == app.user.id %}
  233.                                                                 {% set suppliersOffer = offer %}
  234.                                                             {% endif %}
  235.                                                         {% endfor %}
  236.                                                         {% if suppliersOffer %}
  237.                                                             <button onclick="window.location.href = '{{ path('client_offer_details', {id : suppliersOffer.id}) }}'" class="btn text-success" data-toggle="tooltip" title="" data-original-title="{% trans %}offer.supplierShow{% endtrans %}">
  238.                                                                 <i class="fa fa-file-alt"></i>
  239.                                                                 <span>
  240.                                                                     {{ 'offer.offer'|trans }}
  241.                                                                 </span>
  242.                                                             </button>
  243.                                                         {% else %}
  244.                                                             {% if inquiry.expirationDate|date('U') > "now -30 days"|date('U') and not inquiry.archived and app.user.id != inquiry.recipient.id and lost is not defined %}
  245.                                                                 <button class="btn text-primary" type="button" onclick="window.location.href = '{{ path('supplier_make_offer', {id : inquiry.id}) }}#newOffer'" data-toggle="tooltip" title="" data-original-title="{% trans %}offer.makeOffer{% endtrans %}">
  246.                                                                     <i class="fa fa-file-alt"></i>
  247.                                                                     <span>
  248.                                                                         {{ 'offer.makeOffer'|trans }}
  249.                                                                     </span>
  250.                                                                 </button>
  251.                                                             {% endif %}
  252.                                                         {% endif %}
  253.                                                         {% if inquiry.recipient.id != app.user.id and app.request.attributes.get('_route') != 'supplier_inquiry_latest' and suppliersOffer and suppliersOffer is not null %}
  254.                                                             {% if app.request.attributes.get('_route') == 'supplier_inquiry_during' or app.request.attributes.get('_route') == 'supplier_inquiry_won' or app.request.attributes.get('_route') == 'supplier_inquiry_lost' %}
  255.                                                                 <button class="btn text-primary" type="button" onclick="window.location.href = '{{ path('client_offer_details', {'id': suppliersOffer.id }) }}#comments'" data-toggle="tooltip" title="" data-original-title="Napisz wiadomość prywatną do odbiorcy">
  256.                                                                     <i class="fa fa-envelope"></i>
  257.                                                                     <span>
  258.                                                                         Napisz wiadomość
  259.                                                                     </span>
  260.                                                                 </button>
  261.                                                             {% else %}
  262.                                                                 <button class="btn text-primary" type="button" onclick="window.location.href = '{{ path('client_private_message_customer_index', {inquiryId: inquiry.id, id: inquiry.recipient.id}) }}'" data-toggle="tooltip" title="" data-original-title="Napisz wiadomość prywatną do odbiorcy">
  263.                                                                     <i class="fa fa-envelope"></i>
  264.                                                                     <span>
  265.                                                                         Napisz wiadomość
  266.                                                                     </span>
  267.                                                                 </button>
  268.                                                             {% endif %}
  269.                                                         {% endif %}
  270.                                                         </a>
  271.                                                     {% endif %}
  272.                                                 </div>
  273.                                                 <div class="col-mail">
  274.                                                     <div class="date">
  275.                                                         {% if inquiry.expirationDate|date('U') > "now"|date('U') %}
  276.                                                             {% set difference = date(inquiry.expirationDate).diff(date("now")) %}
  277.                                                             {% set seconds = difference.d * 24 * 3600 + difference.h * 3600 + difference.i * 60 + difference.s %}
  278.                                                             <input type="hidden" class="[ inquiry-counter-data ]" data-counter-id="inquiry-counter-{{ inquiry.id }}" value="{{ seconds }}">
  279.                                                             <span id="inquiry-counter-{{ inquiry.id }}" data-toggle="tooltip" data-original-title="Czas do końca zapytania">{% if difference.d != 0 %}{{ difference.d }}d{% endif %} {% if difference.h != 0 %}{{ difference.h }}h{% endif%} {{ difference.i }}m</span>
  280.                                                             {% if app.request.attributes.get('_route') == 'supplier_inquiry_latest' %}
  281.                                                                 <a href="#" data-toggle="tooltip" data-placement="top" data-html="true" title="" data-original-title="Potrzebujesz więcej czasu na zrobienie wyceny? <br/>Kliknij i przedłuż o 3 godziny." data-inquiry-id="{{ inquiry.id }}" class="btn btn-success [ add-time-to-inquiry ]"><i class="uil uil-plus"></i> Potrzebuję czasu</a>
  282.                                                             {% endif %}
  283.                                                         {% else %}
  284.                                                             {% trans %}inquiry.finished{% endtrans %}
  285.                                                         {% endif %}
  286.                                                     </div>
  287.                                                 </div>
  288.                                                 {% if folder == 'won' %}
  289.                                                     <div class="col-mail" style="padding-left: 10px;">
  290.                                                         {% if inquiry.buyerStatus == '' %}
  291.                                                             <span style="color: grey" class="show-status-select" id="show-status-select-{{ inquiry.id }}" data-inquiry-id="{{ inquiry.id }}">
  292.                                                                 Zmień status...
  293.                                                             </span>
  294.                                                         {% else %}
  295.                                                             <span class="show-status-select" id="show-status-select-{{ inquiry.id }}" data-inquiry-id="{{ inquiry.id }}" style="
  296.                                                             {% if inquiry.buyerStatus == 'OK' %}
  297.                                                                 color: green;
  298.                                                             {% elseif inquiry.buyerStatus == 'W trakcie' %}
  299.                                                                 color: saddlebrown;
  300.                                                             {% elseif inquiry.buyerStatus == 'Anulowane' %}
  301.                                                                 color: red;
  302.                                                             {% endif %}
  303.                                                             ">
  304.                                                                 {{ inquiry.buyerStatus }}
  305.                                                             </span>
  306.                                                         {% endif %}
  307.                                                         <select class="select-change-inquiry-buyer-status d-none" id="select-change-inquiry-buyer-status-{{ inquiry.id }}" data-inquiry-id="{{ inquiry.id }}">
  308.                                                             <option value=""></option>
  309.                                                             <option value="OK" {% if inquiry.buyerStatus == 'OK' %}selected{% endif %}>OK</option>
  310.                                                             <option value="W trakcie" {% if inquiry.buyerStatus == 'W trakcie' %}selected{% endif %}>W trakcie</option>
  311.                                                             <option value="Anulowane" {% if inquiry.buyerStatus == 'Anulowane' %}selected{% endif %}>Anulowane</option>
  312.                                                         </select>
  313.                                                     </div>
  314.                                                 {% endif %}
  315.                                                 {% if folder == 'chosen' %}
  316.                                                     <div class="col-mail" style="padding-left: 10px;">
  317.                                                         {% if inquiry.sellerStatus == '' %}
  318.                                                             <span style="color: grey" class="show-status-select-chosen" id="show-status-select-chosen-{{ inquiry.id }}" data-inquiry-id="{{ inquiry.id }}">
  319.                                                                 Zmień status...
  320.                                                             </span>
  321.                                                         {% else %}
  322.                                                             <span class="show-status-select-chosen" id="show-status-select-chosen-{{ inquiry.id }}" data-inquiry-id="{{ inquiry.id }}" style="
  323.                                                             {% if inquiry.sellerStatus == 'OK' %}
  324.                                                                 color: green;
  325.                                                             {% elseif inquiry.sellerStatus == 'W trakcie' %}
  326.                                                                 color: saddlebrown;
  327.                                                             {% elseif inquiry.sellerStatus == 'Anulowane' %}
  328.                                                                 color: red;
  329.                                                             {% endif %}
  330.                                                                 ">
  331.                                                                 {{ inquiry.sellerStatus }}
  332.                                                             </span>
  333.                                                         {% endif %}
  334.                                                         <select class="select-change-inquiry-seller-status d-none" id="select-change-inquiry-seller-status-{{ inquiry.id }}" data-inquiry-id="{{ inquiry.id }}">
  335.                                                             <option value=""></option>
  336.                                                             <option value="OK" {% if inquiry.sellerStatus == 'OK' %}selected{% endif %}>OK</option>
  337.                                                             <option value="W trakcie" {% if inquiry.sellerStatus == 'W trakcie' %}selected{% endif %}>W trakcie</option>
  338.                                                             <option value="Anulowane" {% if inquiry.sellerStatus == 'Anulowane' %}selected{% endif %}>Anulowane</option>
  339.                                                         </select>
  340.                                                     </div>
  341.                                                 {% endif %}
  342.                                             </div>
  343.                                         </div>
  344.                                     </li>
  345.                                     <div class="collapse offerBoxCollapse" id="offerBox{{ inquiry.id }}" data-search-data="{{ inquiry.make }} {{ inquiry.model }} {{ inquiry.registrationNumber }} {{ inquiry.vin }} {{ inquiry.notices }}">
  346.                                         <div class="card card-body">
  347.                                             <div class="table-responsive">
  348.                                                 <table class="table table-bordered table-centered">
  349.                                                     <thead>
  350.                                                         <tr>
  351.                                                             <th scope="col" class="text-center">#</th>
  352.                                                             {% if app.user.showOtherOffersBeforePurchase %}
  353.                                                                 <th scope="col">{{ 'offer.offerent'|trans }}</th>
  354.                                                                 <th scope="col">Adres oddziału</th>
  355.                                                             {% endif %}
  356.                                                             <th scope="col" class="text-center">{% trans %}common.date{% endtrans %}</th>
  357.                                                             <th scope="col" class="text-center">{% trans %}offer.retail_net_price{% endtrans %}</th>
  358.                                                             <th scope="col" class="text-center">{% trans %}offer.discount{% endtrans %}</th>
  359.                                                             <th scope="col" class="text-center">{% trans %}offer.net_price{% endtrans %}</th>
  360.                                                             <th scope="col" class="text-center">{% trans %}offer.supply{% endtrans %}</th>
  361.                                                             <th scope="col" class="text-center">{% trans %}offer.plannedDeliveryTime{% endtrans %}</th>
  362.                                                             <th scope="col" class="text-center">{% trans %}offer.net_sum{% endtrans %}</th>
  363.                                                             <th scope="col" class="text-center"></th>
  364.                                                         </tr>
  365.                                                     </thead>
  366.                                                     <tbody>
  367.                                                     {% if app.user.showOtherOffers %}
  368.                                                         {% for offer in inquiry.offers %}
  369.                                                             {% if offer.supplier.id != app.user.id %}
  370.                                                                 {% set countShowOthersOffers = countShowOthersOffers + 1 %}
  371.                                                             {% endif %}
  372.                                                         {% endfor %}
  373.                                                         {% if countShowOthersOffers > 0 %}
  374.                                                             {% set showOthersOffer = true %}
  375.                                                         {% else %}
  376.                                                             {% set showOthersOffer = false %}
  377.                                                         {% endif %}
  378.                                                     {% else %}
  379.                                                         {% set showOthersOffer = false %}
  380.                                                     {% endif %}
  381.                                                     {% for offer in inquiry.offers %}
  382.                                                         {% if (app.user.isSupplier and offer.supplier.id == app.user.id) or (app.user.isRecipient and inquiry.recipient.id == app.user.id) or showOthersOffer %}
  383.                                                         <tr {% if chosenOfferId == offer.id %} class="table-success"{% elseif offer.isRejected %} class="table-danger"{% endif %} {% if showOthersOffer %}data-action="Pokazuj inne"{% endif %}>
  384.                                                             <td>
  385.                                                                 {{ loop.index }}
  386.                                                             </td>
  387.                                                             {% if app.user.showOtherOffersBeforePurchase %}
  388.                                                                 <td>
  389.                                                                     {% if (app.user.dontShowCompanyNameOtherOffers or app.user.showOnlyRetailPriceAndDeliveryDate) and app.user.id != offer.supplier.id and inquiry.recipient.id != app.user.id %}
  390.                                                                         ---
  391.                                                                     {% else %}
  392.                                                                         {{ offer.supplier }}
  393.                                                                     {% endif %}
  394.                                                                 </td>
  395.                                                                 <td>
  396.                                                                     {% if (app.user.dontShowCompanyNameOtherOffers or app.user.showOnlyRetailPriceAndDeliveryDate) and app.user.id != offer.supplier.id and inquiry.recipient.id != app.user.id %}
  397.                                                                         ---
  398.                                                                     {% else %}
  399.                                                                         {% set supplierAddress = null %}
  400.                                                                         {% for address in offer.supplier.addresses %}
  401.                                                                             {% if address.defaultAddress %}
  402.                                                                                 {% set supplierAddress = address %}
  403.                                                                             {% endif %}
  404.                                                                         {% endfor %}
  405.                                                                         {% set recipientAddress = '' %}
  406.                                                                         {% if inquiry.customerAddress is not null %}
  407.                                                                             {% set recipientAddress = inquiry.customerAddress.city ~ '+' ~ inquiry.customerAddress.street ~ '+' ~ inquiry.customerAddress.propertyNumber %}
  408.                                                                         {% endif %}
  409.                                                                         {% if supplierAddress is not null %}
  410.                                                                             {{ supplierAddress.street }} {{ supplierAddress.propertyNumber }},&nbsp;
  411.                                                                             {{ supplierAddress.zipCode }} {{ supplierAddress.city }}
  412.                                                                             {% if loggedAddressForGoogleMaps != supplierAddress.city~'+'~supplierAddress.street~'+'~supplierAddress.propertyNumber %}
  413.                                                                                 <br/><a target="_blank" href="https://www.google.com/maps/dir/?api=1&origin={{ recipientAddress }}&destination={{ supplierAddress.city }}+{{ supplierAddress.street }}+{{ supplierAddress.propertyNumber }}">Zobacz trasę</a>
  414.                                                                             {% endif %}
  415.                                                                         {% endif %}
  416.                                                                         {% if offer.contactPerson is defined and offer.contactPerson is not null %}
  417.                                                                             <br/><strong>Os. kontaktowa:</strong> {{ offer.contactPerson.name }}
  418.                                                                             <br/><strong>tel.:</strong> {{ offer.contactPerson.phoneNumber }}
  419.                                                                         {% endif %}
  420.                                                                         <br/><strong>e-mail:</strong> {{ offer.supplier.username }}
  421.                                                                     {% endif %}
  422.                                                                 </td>
  423.                                                             {% endif %}
  424.                                                             <td class="text-right">
  425.                                                                 {% if app.user.showOnlyRetailPriceAndDeliveryDate and app.user.id != offer.supplier.id and inquiry.recipient.id != app.user.id %}
  426.                                                                     ---
  427.                                                                 {% else %}
  428.                                                                     {{ offer.createdAt|date('Y-m-d H:i') }}
  429.                                                                 {% endif %}
  430.                                                             </td>
  431.                                                             <td class="text-right">
  432.                                                                 {{ offer.retailPrice|number_format(2, ',', ' ') }} zł
  433.                                                             </td>
  434.                                                             <td class="text-right">
  435.                                                                 {% if app.user.showOnlyRetailPriceAndDeliveryDate and app.user.id != offer.supplier.id and inquiry.recipient.id != app.user.id %}
  436.                                                                     ---
  437.                                                                 {% else %}
  438.                                                                     {{ offer.discount }} %
  439.                                                                 {% endif %}
  440.                                                             </td>
  441.                                                             <td class="text-right">
  442.                                                                 {% if app.user.showOnlyRetailPriceAndDeliveryDate and app.user.id != offer.supplier.id and inquiry.recipient.id != app.user.id %}
  443.                                                                     ---
  444.                                                                 {% else %}
  445.                                                                     {{ offer.priceAfterDiscount|number_format(2, ',', '') }} zł
  446.                                                                 {% endif %}
  447.                                                             </td>
  448.                                                             <td class="text-right">
  449.                                                                 {% if app.user.showOnlyRetailPriceAndDeliveryDate and app.user.id != offer.supplier.id and inquiry.recipient.id != app.user.id %}
  450.                                                                     ---
  451.                                                                 {% else %}
  452.                                                                     {{ offer.deliveryPrice|number_format(2, ',', ' ') }} zł
  453.                                                                 {% endif %}
  454.                                                             </td>
  455.                                                             <td class="text-center">
  456.                                                                 {{ offer.deliveryTime|date('Y-m-d') }}
  457.                                                             </td>
  458.                                                             {% if app.user.canGetNotificationsAboutBetterOffer %}
  459.                                                                 <td class="text-right {% if offer.totalPrice == lowestPrice %} text-success {% elseif  offer.totalPrice == highestPrice %} text-danger {% endif %}">
  460.                                                             {% else %}
  461.                                                                 <td class="text-right">
  462.                                                             {% endif %}
  463.                                                                 {% if app.user.showOnlyRetailPriceAndDeliveryDate and app.user.id != offer.supplier.id and inquiry.recipient.id != app.user.id %}
  464.                                                                     ---
  465.                                                                 {% else %}
  466.                                                                     <strong>{{ offer.totalPrice|number_format(2, ',', ' ') }} zł</strong>
  467.                                                                 {% endif %}
  468.                                                                 {% if offer.seenByRecipient %}
  469.                                                                     <span class="badge badge-success">Odczytano</span>
  470.                                                                 {% else %}
  471.                                                                     <span class="badge badge-warning">Nie odczytano</span>
  472.                                                                 {% endif %}
  473.                                                             </td>
  474.                                                             <td>
  475.                                                                 <div class="row mb-1">
  476.                                                                     <div class="col-md-7">
  477.                                                                         <a href="{{ path('client_offer_details', {id : offer.id}) }}" class="btn btn-light btn-sm" style="background-color: #ffd966;width: 95px;">
  478.                                                                             Szczegóły...
  479.                                                                         </a>
  480.                                                                     </div>
  481.                                                                     <div class="col-md-5">
  482.                                                                         {% if offer.state == 'complete' %}
  483.                                                                             <span class="badge badge-success">{% trans %}offer.state_short_complete{% endtrans %}</span>
  484.                                                                         {% else %}
  485.                                                                             <span class="badge badge-warning">{% trans %}offer.state_short_partial{% endtrans %}</span>
  486.                                                                         {% endif %}
  487.                                                                         {% if offer.partsOrdered %}
  488.                                                                             <span data-toggle="tooltip" title="" data-original-title="{{ 'offer.messages.partsOrderedBySupplier'|trans }}">
  489.                                                                                 <i class="fa fa-truck"></i>
  490.                                                                             </span>
  491.                                                                         {% endif %}
  492.                                                                     </div>
  493.                                                                 </div>
  494.                                                                 <div class="row mb-1">
  495.                                                                     <div class="col-md-7">
  496.                                                                         <span style="white-space: nowrap;">
  497.                                                                             <a href="#" class="btn btn-light btn-sm [ show-private-message-popup ] " data-offer-id="{{ offer.id }}" style="width: 95px;">
  498.                                                                                 Wiadomość
  499.                                                                             </a>
  500.                                                                             {% if unreadPrivateMessagesForOffers[offer.id] is defined or unreadMessagesForOffersForRecipient[offer.id] is defined %}
  501.                                                                                 <a href="{{ path('client_offer_details', {'id': offer.id}) }}#comments" style="animation: blinker 1s linear infinite; color: red;">
  502.                                                                                 <span data-toggle="tooltip" title="">
  503.                                                                                     <i class="fa fa-envelope fa-lg"></i>
  504.                                                                                 </span>
  505.                                                                                 </a>
  506.                                                                             {% endif %}
  507.                                                                         </span>
  508.                                                                     </div>
  509.                                                                     <div class="col-md-5">
  510.                                                                         {% if chosenOfferId == offer.id %}
  511.                                                                             <span class="badge badge-success">{% trans %}offer.choosed{% endtrans %}</span>
  512.                                                                         {% endif %}
  513.                                                                     </div>
  514.                                                                 </div>
  515.                                                                 {% if chosenOfferId == null and not offer.isRejected %}
  516.                                                                     {% if (app.user.isRecipient and inquiry.recipient.id == app.user.id) %}
  517.                                                                         {% if offer.totalPrice == 0 %}
  518.                                                                             <span style="animation: blinker 1s linear infinite;">
  519.                                                                                 <small style="color: red; font-weight: bold;">Wycena na 0,00 zł? Pamiętaj, sprawdz szczegóły!</small>
  520.                                                                             </span>
  521.                                                                         {% endif %}
  522.                                                                         <div class="row mb-1">
  523.                                                                             <div class="col-md-12">
  524.                                                                                 <button class="btn btn-light btn-sm [ offer-choose-button offer-choose-button-{{ inquiry.id }} ]"  data-offer-id="{{ offer.id }}" data-inquiry-id="{{ inquiry.id }}" data-offer-cost="{{ offer.totalPrice|number_format(2, ',', ' ') }}" data-all-parts="1" style="background-color: #92d050; font-weight: bold;">
  525.                                                                                     Kup-zamów KOMPLET części z tej oferty
  526.                                                                                 </button>
  527.                                                                             </div>
  528.                                                                         </div>
  529.                                                                         <div class="row mb-1">
  530.                                                                             <div class="col-md-12">
  531.                                                                                 <button class="btn btn-light btn-sm [ offer-choose-button offer-choose-button-{{ inquiry.id }} ]"  data-offer-id="{{ offer.id }}" data-inquiry-id="{{ inquiry.id }}" data-offer-cost="{{ offer.totalPrice|number_format(2, ',', ' ') }}" data-all-parts="0" style="background-color: #92d050; font-weight: bold;">
  532.                                                                                     Kup-zamów WYBRANE części z tej oferty
  533.                                                                                 </button>
  534.                                                                             </div>
  535.                                                                         </div>
  536.                                                                     {% endif %}
  537.                                                                 {% endif %}
  538.                                                             </td>
  539.                                                         </tr>
  540.                                                         {% endif %}
  541.                                                     {% endfor %}
  542.                                                     </tbody>
  543.                                                 </table>
  544.                                             </div>
  545.                                         </div>
  546.                                     </div>
  547.                                 {% endfor %}
  548.                             {% endif %}
  549.                         </ul>
  550.                     </div>
  551.                 </div>
  552.                 <div class="clearfix"></div>
  553.                 {% if count is defined and limit is defined and page is defined and routing is defined %}
  554.                     {% set maxPage = (count / limit)|round(0, 'ceil') %}
  555.                     {% if maxPage > 1 %}
  556.                         <nav aria-label="Stronicowanie">
  557.                             <ul class="pagination">
  558.                                 <li class="page-item {% if page == 1 %} disabled {% endif %}">
  559.                                     <a class="page-link" href="{{ path(routing, {page: page - 1}) }}">Poprzednia</a>
  560.                                 </li>
  561.                                 {% for pageNumber in 1..maxPage %}
  562.                                     <li class="page-item {% if pageNumber == page %} active {% endif %}">
  563.                                         <a class="page-link" href="{{ path(routing, {page: pageNumber}) }}">{{ pageNumber }}</a>
  564.                                     </li>
  565.                                 {% endfor %}
  566.                                 <li class="page-item" {% if page == maxPage %} disabled {% endif %}>
  567.                                     <a class="page-link" href="{{ path(routing, {page: page + 1}) }}">Następna</a>
  568.                                 </li>
  569.                             </ul>
  570.                         </nav>
  571.                     {% endif %}
  572.                 {% endif %}
  573.             </div>
  574.         </div>
  575.     </div>
  576. {% endblock %}