{% extends "page_base.html" %} {% load static %} {% load i18n %} {% load inventree_extras %} {% block page_title %} {% inventree_title %} | {% trans "Company" %} - {{ company.name }} {% endblock page_title %} {% block heading %} {% trans "Company" %}: {{ company.name }} {% if not company.active %}  
{% trans 'Inactive' %}
{% endif %} {% endblock heading %} {% block actions %} {% admin_url user "company.company" company.pk as url %} {% include "admin_button.html" with url=url %} {% if company.is_supplier and roles.purchase_order.add %} {% endif %} {% define perms.company.change_company or perms.company.delete_company as has_permission %} {% if has_permission %} {% endif %} {% endblock actions %} {% block thumbnail %}
{% trans 'Part image' %}
{% settings_value "INVENTREE_DOWNLOAD_FROM_URL" as allow_download %} {% if allow_download %} {% endif %}
{% endblock thumbnail %} {% block details %}
{% trans "Description" %} {{ company.description }}
{% trans "Manufacturer" %} {% include "yesnolabel.html" with value=company.is_manufacturer %}
{% trans "Supplier" %} {% include 'yesnolabel.html' with value=company.is_supplier %}
{% trans "Customer" %} {% include 'yesnolabel.html' with value=company.is_customer %}
{% endblock details %} {% block details_right %} {% if company.website %} {% endif %} {% if company.address %} {% endif %} {% if company.phone %} {% endif %} {% if company.email %} {% endif %} {% if company.contact %} {% endif %}
{% trans "Website" %} {{ company.website }}{% include "clip.html" %}
{% trans "Currency" %} {% if company.currency %} {{ company.currency }} {% else %} {% trans "Uses default currency" %} {% endif %}
{% trans "Address" %} {{ company.address }}{% include "clip.html" %}
{% trans "Phone" %} {% include "tel.html" with tel=company.phone %}
{% trans "Email" %} {% include "mail.html" with mail=company.email %}
{% trans "Contact" %} {{ company.contact }}{% include "clip.html" %}
{% endblock details_right %} {% block js_ready %} {{ block.super }} $('#company-edit').click(function() { editCompany({{ company.id }}); }); $("#company-order-2").click(function() { createPurchaseOrder({ supplier: {{ company.pk }}, }); }); $('#company-delete').click(function() { constructForm('{% url "api-company-detail" company.pk %}', { method: 'DELETE', title: '{% trans "Delete Company" escape %}', redirect: '{% url "company-index" %}', }); }); function reloadImage(data) { if (data.image) { $('#company-image').attr('src', data.image); // Reset the "modal image" view $('#company-image').click(function() { showModalImage(data.image); }); $('#company-image-delete').show(); } else { location.reload(); } } enableDragAndDrop( "#company-thumb", "{% url 'api-company-detail' company.id %}", { label: 'image', method: 'PATCH', success: function(data, status, xhr) { reloadImage(data); } } ); {% if company.image %} $('#company-image').click(function() { showModalImage('{{ company.image.url }}'); }); {% else %} $('#company-image-delete').hide(); {% endif %} $('#company-image-delete').click(function(event) { event.stopPropagation(); showQuestionDialog( '{% trans "Remove Image" escape %}', '{% trans "Remove associated image from this company" escape %}', { accept_text: '{% trans "Remove" escape %}', submitClass: 'danger', accept: function() { inventreePut( '{% url "api-company-detail" company.pk %}', { 'image': null, }, { method: 'PATCH', success: function() { location.reload(); } } ); } } ); }); $("#company-image-upload").click(function(event) { event.stopPropagation(); constructForm( '{% url "api-company-detail" company.pk %}', { method: 'PATCH', fields: { image: {}, }, title: '{% trans "Upload Image" escape %}', onSuccess: function(data) { reloadImage(data); } } ); }); if (global_settings.INVENTREE_DOWNLOAD_FROM_URL) { $('#company-image-url').click(function() { event.stopPropagation(); constructForm( '{% url "api-company-detail" company.pk %}', { method: 'PATCH', title: '{% trans "Download Image" escape %}', fields: { remote_image: {}, }, onSuccess: function(data) { reloadImage(data); } } ); }); } {% endblock js_ready %}