Files
PyRIGS/assets/templates/partials/purchasedetails_form.html
Arona Jones 54b44404ba Fix various minor issues (#545)
* Add absolute URL to power tests

* Update to target Python 3.10

* Return user to current page when clicking 'mark reviewed'

* Add units to power test record detail and form

I'm a bad scientist (coz I'm an engineer)

* Allow a higher value in PSSC fields

* Default venue to event venue in EC/PT

* Fix population of initial venue values for EC/PT

* Add link to create power test from EC detail

* Do not set power plan field to required on RA

"This might be a problem if the risk assessment is being done by one person and the power plan by another."

* Default power MIC to MIC

* Implement some suggestions from the Doctor

* Prevent checking in to cancelled events and dry hires

Will close #539

* Exclude dry hires from H&S overview list

* Add "ex VAT" tooltips to asset purchase price and replacement cost

* Automagically clear and focus ID field when audit modal closes

Closes #533

* Delete unused things

* Allow two decimal places in cable length, show training item IDs in selectpicker

Will close #540

* Fix #524 500 Error when viewing qualification list for items nobody is qualified in

* Update README.md

* Add a guard against nulls in recent changes

Maybe fixes #537 I'm unable to replicate locally

* Turn down verbosity of CI tests, fix tests, potential speedup

* Squash migration

* Add encoding to open

* Update to v3 upload-artifact

Resolves a deprecation warning
2023-05-29 11:50:04 +01:00

85 lines
3.9 KiB
HTML

{% load widget_tweaks %}
{% load linkornone from filters %}
<div class="card mb-2">
<div class="card-header">
Purchase Details
</div>
<div class="card-body">
{% if create or edit or duplicate %}
<div class="form-group" id="purchased-from-group">
<label for="{{ form.purchased_from.id_for_label }}">Supplier</label>
<div class="row">
<div class="col">
<select id="{{ form.purchased_from.id_for_label }}" name="{{ form.purchased_from.name }}" class="selectpicker" data-live-search="true" data-sourceurl="{% url 'api_secure' model='supplier' %}">
{% if object.purchased_from %}
<option value="{{form.purchased_from.value}}" selected="selected" data-update_url="{% url 'supplier_update' form.purchased_from.value %}">{{ object.purchased_from }}</option>
{% endif %}
</select>
</div>
<div class="col align-right">
<div class="btn-group">
<a href="{% url 'supplier_create' %}" class="btn btn-success modal-href"
data-target="#{{ form.purchased_from.id_for_label }}">
<span class="fas fa-plus"></span>
</a>
<a {% if form.supplier.value %}href="{% url 'supplier_update' form.purchased_from.value %}"{% endif %} class="btn btn-warning modal-href" id="{{ form.purchased_from.id_for_label }}-update" data-target="#{{ form.purchased_from.id_for_label }}">
<span class="fas fa-edit"></span>
</a>
</div>
</div>
</div>
</div>
<div class="form-group">
<label for="{{ form.purchase_price.id_for_label }}">Purchase Price</label>
<div class="input-group">
<div class="input-group-prepend"><span class="input-group-text">£</span></div>
{% render_field form.purchase_price|add_class:'form-control'|set_data:"toggle:tooltip" value=object.purchase_price title="Ex. VAT" %}
</div>
</div>
<div class="form-group">
<label for="{{ form.salvage_value.id_for_label }}">Replacement Cost</label>
<div class="input-group">
<div class="input-group-prepend"><span class="input-group-text">£</span></div>
{% render_field form.replacement_cost|add_class:'form-control'|set_data:"toggle:tooltip" value=object.replacement_cost title="Ex. VAT" %}
</div>
</div>
<div class="form-group">
<label for="{{ form.date_acquired.id_for_label }}" >Date Acquired</label>
{% if object.date_acquired%}
{% with date_acq=object.date_acquired|date:"Y-m-d" %}
{% render_field form.date_acquired|add_class:'form-control'|attr:'type="date"' value=date_acq %}
{% endwith %}
{% else %}
<input type="date" name="date_acquired" value="{% now 'Y-m-d' %}"
class="form-control" id="id_date_acquired">
{% endif %}
</div>
<div class="form-group">
<label for="{{ form.date_sold.id_for_label }}">Date Sold</label>
{% with date_sol=object.form.date_sold|date:"Y-m-d" %}
{% render_field form.date_sold|add_class:'form-control'|attr:'type="date"' value=date_sol %}
{% endwith %}
</div>
{% else %}
<dl>
<dt>Purchased From</dt>
<dd>{% if object.purchased_from %}<a href="{{object.purchased_from.get_absolute_url}}">{{ object.purchased_from }}</a>{%else%}-{%endif%}</dd>
<dt>Purchase Price</dt>
<dd>£{{ object.purchase_price|default_if_none:'-' }}</dd>
<dt>Replacement Cost</dt>
<dd>£{{ object.replacement_cost|default_if_none:'-' }}</dd>
<dt>Date Acquired</dt>
<dd>{{ object.date_acquired|default_if_none:'-' }}</dd>
{% if object.date_sold %}
<dt>Date Sold</dt>
<dd>{{ object.date_sold|default_if_none:'-' }}</dd>
{% endif %}
</dl>
{% endif %}
</div>
</div>