This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
devicehub-teal/ereuse_devicehub/templates/inventory/device_list.html

839 lines
39 KiB
HTML
Raw Normal View History

2021-12-28 11:36:02 +00:00
{% extends "ereuse_devicehub/base_site.html" %}
{% block main %}
<div class="pagetitle">
<h1>Inventory</h1>
<nav>
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="{{ url_for('inventory.devicelist')}}">Inventory</a></li>
2021-12-30 21:39:56 +00:00
{% if not lot %}
2022-11-25 17:56:56 +00:00
{% if all_devices %}
<li class="breadcrumb-item active">All devices</li>
{% else %}
<li class="breadcrumb-item active">Unassigned</li>
{% endif %}
2021-12-30 21:39:56 +00:00
{% elif lot.is_temporary %}
<li class="breadcrumb-item active">Temporary</li>
2021-12-30 21:39:56 +00:00
<li class="breadcrumb-item active">{{ lot.name }}</li>
{% elif lot.is_incoming %}
<li class="breadcrumb-item active">Incoming</li>
2021-12-30 21:39:56 +00:00
<li class="breadcrumb-item active">{{ lot.name }}</li>
{% elif lot.is_outgoing %}
<li class="breadcrumb-item active">Outgoing</li>
2021-12-30 21:39:56 +00:00
<li class="breadcrumb-item active">{{ lot.name }}</li>
{% elif lot.is_shared %}
<li class="breadcrumb-item active">Shared with me</li>
<li class="breadcrumb-item active">{{ lot.name }}</li>
2021-12-30 21:39:56 +00:00
{% endif %}
2021-12-28 11:36:02 +00:00
</ol>
</nav>
</div><!-- End Page Title -->
<section class="section profile">
<div class="row">
<div class="col-xl-12">
<div class="card">
{% if lot %}
<div class="card-body pt-3">
<!-- Bordered Tabs -->
2022-04-12 10:57:46 +00:00
<div class="d-flex align-items-center justify-content-between row">
2022-06-01 09:09:28 +00:00
<div class="col-sm-12 col-md-5">
<h3>
<a href="{{ url_for('inventory.lot_edit', id=lot.id) }}">
{{ lot.name }} {% if lot.is_shared %}<i class="bi bi-arrow-right"></i> {{ lot.owner.email }}{% endif %}
</a>
2022-06-01 09:09:28 +00:00
</h3>
</div>
2022-03-07 17:28:45 +00:00
2022-04-12 10:57:46 +00:00
<div class="col-sm-12 col-md-7 d-md-flex justify-content-md-end"><!-- lot actions -->
2022-05-30 14:32:25 +00:00
{% if lot.is_temporary or not lot.transfer.closed %}
2022-04-28 09:38:31 +00:00
{% if lot and lot.is_temporary %}
2022-10-06 14:56:12 +00:00
<a type="button" href="{{ url_for('inventory.lot_new_transfer', lot_id=lot.id, type_id='outgoing') }}" class="btn btn-primary doTransfer" >
Create Outgoing Lot
</a>
2022-10-06 14:56:12 +00:00
<a type="button" href="{{ url_for('inventory.lot_new_transfer', lot_id=lot.id, type_id='incoming') }}" class="btn btn-primary doTransfer">
Create Incoming Lot
</a>
{% endif %}
{% if not lot.is_shared %}
2022-04-05 09:46:31 +00:00
<a class="text-danger" href="javascript:removeLot()">
<i class="bi bi-trash"></i> Delete Lot
</a>
<span class="d-none" id="activeRemoveLotModal" data-bs-toggle="modal" data-bs-target="#btnRemoveLots"></span>
{% endif %}
2022-03-07 17:28:45 +00:00
{% endif %}
</div>
2022-03-07 17:28:45 +00:00
</div>
</div>
{% endif %}
2022-02-03 09:28:15 +00:00
<div class="card-body pt-3" style="min-height: 650px;">
2021-12-28 11:36:02 +00:00
<!-- Bordered Tabs -->
{% if lot %}
<ul class="nav nav-tabs nav-tabs-bordered">
2021-12-28 11:36:02 +00:00
<li class="nav-item">
<button class="nav-link active" data-bs-toggle="tab" data-bs-target="#devices-list">Devices</button>
</li>
2021-12-28 11:36:02 +00:00
{% if lot and not lot.is_temporary and not lot.is_shared %}
<li class="nav-item">
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#trade-documents-list">Documents</button>
</li>
2021-12-28 11:36:02 +00:00
2022-05-31 14:28:38 +00:00
{% if lot.transfer %}
2022-05-30 14:32:25 +00:00
<li class="nav-item">
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#edit-transfer">
2022-06-01 11:26:17 +00:00
Transfer ({% if lot.transfer.closed %}<span class="text-danger">Closed</span>{% else %}<span class="text-success">Open</span>{% endif %})
2022-05-30 14:32:25 +00:00
</button>
</li>
<li class="nav-item">
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#edit-delivery-note">
Delivery Note
</button>
</li>
<li class="nav-item">
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#edit-receiver-note">
Receiver Note
</button>
</li>
2023-02-14 19:03:33 +00:00
<li class="nav-item">
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#edit-customer-details">
Customer Details
</button>
</li>
2022-05-31 14:28:38 +00:00
{% endif %}
{% endif %}
2022-05-30 14:32:25 +00:00
</ul>
{% endif %}
2022-04-12 11:19:56 +00:00
<div class="tab-content pt-1">
<div id="devices-list" class="tab-pane fade devices-list active show">
2022-04-08 10:40:50 +00:00
<label class="btn btn-primary " for="SelectAllBTN"><input type="checkbox" id="SelectAllBTN" autocomplete="off"></label>
{% if not lot or not lot.is_shared %}
<div class="btn-group dropdown ml-1">
2022-04-07 11:28:07 +00:00
<button id="btnLots" type="button" onclick="processSelectedDevices()" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
<i class="bi bi-folder2"></i>
Lots
<span class="caret"></span>
</button>
<span class="d-none" id="activeTradeModal" data-bs-toggle="modal" data-bs-target="#tradeLotModal"></span>
2022-05-13 19:27:50 +00:00
2022-04-21 17:53:09 +00:00
<ul class="dropdown-menu" aria-labelledby="btnLots" id="dropDownLotsSelector">
2022-05-13 19:27:50 +00:00
<div class="row w-100">
<div class="input-group mb-3 mx-2">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1"><i class="bi bi-search"></i></span>
</div>
<input type="text" class="form-control" id="lots-search" placeholder="search" aria-label="search" aria-describedby="basic-addon1">
</div>
</div>
2022-05-09 11:57:17 +00:00
<h6 class="dropdown-header">Select lots where to store the selected devices</h6>
2022-04-21 17:53:09 +00:00
<ul class="mx-3" id="LotsSelector"></ul>
2022-04-07 11:28:07 +00:00
<li><hr /></li>
<li>
2022-04-07 11:28:07 +00:00
<a href="#" class="dropdown-item" id="ApplyDeviceLots">
<i class="bi bi-check"></i>
Apply
</a>
</li>
</ul>
</div>
2022-04-12 10:44:24 +00:00
<div class="btn-group dropdown m-1" uib-dropdown="">
<button id="btnActions" type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
<i class="bi bi-plus"></i>
2022-09-21 10:29:16 +00:00
Actions
</button>
<span class="d-none" id="activeActionModal" data-bs-toggle="modal" data-bs-target="#actionModal"></span>
<span class="d-none" id="activeAllocateModal" data-bs-toggle="modal" data-bs-target="#allocateModal"></span>
<span class="d-none" id="activeDatawipeModal" data-bs-toggle="modal" data-bs-target="#datawipeModal"></span>
<ul class="dropdown-menu" aria-labelledby="btnActions">
<li>
Status actions
</li>
<li>
<a href="javascript:newAction('Recycling')" class="dropdown-item">
<i class="bi bi-recycle"></i>
Recycling
</a>
</li>
<li>
<a href="javascript:newAction('Use')" class="dropdown-item">
<i class="bi bi-play-circle-fill"></i>
Use
</a>
</li>
<li>
<a href="javascript:newAction('Refurbish')" class="dropdown-item">
<i class="bi bi-tools"></i>
Refurbish
</a>
</li>
<li>
<a href="javascript:newAction('Management')" class="dropdown-item">
<i class="bi bi-mastodon"></i>
Management
</a>
</li>
<li>
Allocation
</li>
<li>
<a href="javascript:newAllocate('Allocate')" class="dropdown-item">
<i class="bi bi-house-fill"></i>
Allocate
</a>
</li>
<li>
<a href="javascript:newAllocate('Deallocate')" class="dropdown-item">
<i class="bi bi-house"></i>
Deallocate
</a>
</li>
<li>
Physical actions
</li>
<li>
<a href="javascript:newAction('ToPrepare')" class="dropdown-item">
<i class="bi bi-tools"></i>
ToPrepare
</a>
</li>
<li>
<a href="javascript:newAction('Prepare')" class="dropdown-item">
<i class="bi bi-egg"></i>
Prepare
</a>
</li>
<li>
2023-05-23 11:45:32 +00:00
<a href="javascript:newDataWipe('EraseDataWipe')" class="dropdown-item">
<i class="bi bi-eraser-fill"></i>
DataWipe
</a>
</li>
<li>
<a href="javascript:newAction('ToRepair')" class="dropdown-item">
<i class="bi bi-screwdriver"></i>
ToRepair
</a>
</li>
<li>
<a href="javascript:newAction('Ready')" class="dropdown-item">
<i class="bi bi-check2-all"></i>
Ready
</a>
</li>
2023-08-22 08:41:48 +00:00
<li>
<a href="javascript:newAction('EWaste')" class="dropdown-item">
<i class="bi bi-trash-fill"></i>
E-Waste
</a>
</li>
2024-02-09 19:45:17 +00:00
<li>
<a href="javascript:newAction('Recycled')" class="dropdown-item">
<i class="bi bi-recycle"></i>
Recycled
</a>
</li>
</ul>
</div>
2021-12-28 11:36:02 +00:00
2022-04-12 10:44:24 +00:00
<div class="btn-group dropdown m-1" uib-dropdown="">
<button id="btnExport" type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
<i class="bi bi-reply"></i>
Exports
</button>
<span class="d-none" id="exportAlertModal" data-bs-toggle="modal" data-bs-target="#exportErrorModal"></span>
<ul class="dropdown-menu" aria-labelledby="btnExport">
<li>
2022-02-24 13:15:58 +00:00
<a href="javascript:export_file('devices')" class="dropdown-item">
<i class="bi bi-file-spreadsheet"></i>
Devices Spreadsheet
</a>
</li>
2022-06-20 08:36:24 +00:00
<li>
2022-11-25 17:56:56 +00:00
{% if not all_devices %}
<span class="dropdown-item" style="color: #999ea4;">
<i class="bi bi-file-spreadsheet"></i>
Devices Lots Spreadsheet
</span>
2022-11-25 17:56:56 +00:00
{% else %}
<a href="javascript:export_file('devices_lots')" class="dropdown-item">
<i class="bi bi-file-spreadsheet"></i>
Devices Lots Spreadsheet
</a>
{% endif %}
2022-06-20 08:36:24 +00:00
</li>
2022-11-04 09:37:56 +00:00
<li>
<a href="javascript:export_file('obada_standard')" class="dropdown-item">
<i class="bi bi-file-spreadsheet"></i>
Obada Standard Spreadsheet
</a>
</li>
2022-02-24 13:15:58 +00:00
<li>
<a href="javascript:export_file('certificates')" class="dropdown-item">
<i class="bi bi-eraser-fill"></i>
2023-03-20 16:32:58 +00:00
Device Sanitization
</a>
</li>
</ul>
</div>
2022-04-28 09:47:52 +00:00
<div class="btn-group dropdown m-1" uib-dropdown="">
<button id="btnTags" type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
<i class="bi bi-tag"></i>
Labels
</button>
<ul class="dropdown-menu" aria-labelledby="btnTags">
<li>
2022-03-31 14:12:35 +00:00
<form id="print_labels" method="post" action="{{ url_for('labels.print_labels') }}">
{% for f in form_print_labels %}
{{ f }}
{% endfor %}
<a href="javascript:$('#print_labels').submit()" class="dropdown-item">
2022-04-05 09:40:23 +00:00
<i class="bi bi-printer"></i>
Print labels
</a>
</form>
</li>
</ul>
</div>
2022-04-12 10:44:24 +00:00
<div class="btn-group dropdown m-1" uib-dropdown="">
<button id="btnSnapshot" type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
2022-02-28 12:27:12 +00:00
<i class="bi bi-laptop"></i>
2022-09-15 15:11:06 +00:00
Placeholders
</button>
<ul class="dropdown-menu" aria-labelledby="btnSnapshot">
2022-06-29 15:31:54 +00:00
<li>
{% if lot %}
2022-07-04 09:26:24 +00:00
<a href="{{ url_for('inventory.lot_upload_placeholder', lot_id=lot.id) }}" class="dropdown-item">
2022-06-29 15:31:54 +00:00
{% else %}
2022-07-04 09:26:24 +00:00
<a href="{{ url_for('inventory.upload_placeholder') }}" class="dropdown-item">
2022-06-29 15:31:54 +00:00
{% endif %}
<i class="bi bi-upload"></i>
Upload Spreadsheet
</a>
</li>
<li>
{% if lot %}
<a href="{{ url_for('inventory.lot_device_add', lot_id=lot.id) }}" class="dropdown-item">
{% else %}
<a href="{{ url_for('inventory.device_add') }}" class="dropdown-item">
{% endif %}
<i class="bi bi-plus"></i>
Create a new
</a>
</li>
</ul>
</div>
2021-12-28 11:36:02 +00:00
<div class="btn-group dropdown m-1" uib-dropdown="">
<button id="btnSnapshot" type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
<i class="bi bi-laptop"></i>
2022-09-15 15:11:06 +00:00
Snapshots
</button>
<ul class="dropdown-menu" aria-labelledby="btnSnapshot">
<li>
{% if lot %}
<a href="{{ url_for('inventory.lot_upload_snapshot', lot_id=lot.id) }}" class="dropdown-item">
{% else %}
<a href="{{ url_for('inventory.upload_snapshot') }}" class="dropdown-item">
{% endif %}
<i class="bi bi-upload"></i>
Upload files
</a>
</li>
</ul>
</div>
{% endif %}
{% if lot and lot.is_shared %}
<div class="btn-group dropdown m-1" uib-dropdown="">
<button id="btnExport" type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
<i class="bi bi-reply"></i>
Exports
</button>
<span class="d-none" id="exportAlertModal" data-bs-toggle="modal" data-bs-target="#exportErrorModal"></span>
<ul class="dropdown-menu" aria-labelledby="btnExport">
<li>
<a href="javascript:export_file('devices')" class="dropdown-item">
<i class="bi bi-file-spreadsheet"></i>
Devices Spreadsheet
</a>
</li>
</ul>
</div>
{% endif %}
2022-05-03 10:13:15 +00:00
<div id="select-devices-info" class="alert alert-info mb-0 mt-3 d-none" role="alert">
If this text is showing is because there are an error
</div>
<div class="tab-content pt-2">
<form method="get">
<div class="d-flex mt-4 mb-4">
{% for f in form_filter %}
{{ f }}
{% endfor %}
2022-11-25 17:56:56 +00:00
<input type="hidden" class="d-none" value="1" name="page" />
<input type="hidden" class="d-none" value="{{ devices.per_page }}" name="per_page" />
<input type="submit" id="submit_filter" class="d-none ms-2 btn btn-primary" value="Filter" />
2022-03-07 12:07:26 +00:00
</div>
</form>
<p class="mt-3">
Displaying devices of type
<em>{{ form_filter.filter.data or "Computer" }}</em>
</p>
2022-11-25 17:56:56 +00:00
<div class="dataTable-top" style="float: left;">
<div class="dataTable-dropdown">
<label>
<select class="dataTable-selector">
<option value="5"{% if devices.per_page == 5 %} selected="selected"{% endif %}>
5
</option>
<option value="10"{% if devices.per_page == 10 %} selected="selected"{% endif %}>
10
</option>
<option value="15"{% if devices.per_page == 15 %} selected="selected"{% endif %}>
15
</option>
<option value="20"{% if devices.per_page == 20 %} selected="selected"{% endif %}>
20
</option>
<option value="25"{% if devices.per_page == 25 %} selected="selected"{% endif %}>
25
</option>
<option value="50"{% if devices.per_page == 50 %} selected="selected"{% endif %}>
50
</option>
<option value="100"{% if devices.per_page == 100 %} selected="selected"{% endif %}>
100
</option>
</select> entries per page
</label>
</div>
<div class="dataTable-search">
</div>
</div>
<div class="dataTable-container">
2021-12-29 09:57:39 +00:00
<table class="table">
2021-12-28 13:14:02 +00:00
<thead>
<tr>
<th scope="col">Select</th>
2021-12-28 13:14:02 +00:00
<th scope="col">Title</th>
<th scope="col">DHID</th>
2022-07-28 15:48:14 +00:00
<th scope="col">PHID</th>
2022-08-08 16:09:25 +00:00
<th scope="col">Type</th>
2022-04-28 09:47:52 +00:00
<th scope="col">Unique Identifiers</th>
<th scope="col">Lifecycle Status</th>
<th scope="col">Allocated Status</th>
<th scope="col">Physical Status</th>
2022-05-25 15:37:24 +00:00
<th scope="col" data-type="date" data-format="YYYY-MM-DD">Updated in</th>
<th scope="col" data-type="date" data-format="YYYY-MM-DD hh:mm:ss">Registered in</th>
2022-05-16 09:54:02 +00:00
<th scope="col"></th>
2021-12-28 13:14:02 +00:00
</tr>
</thead>
<tbody>
2022-11-25 17:56:56 +00:00
{% for dev in devices.items %}
2022-10-14 14:39:38 +00:00
{% if dev.placeholder and (not dev.parent_id or dev.parent.placeholder.kangaroo) %}
2021-12-28 13:14:02 +00:00
<tr>
2022-02-04 10:30:29 +00:00
<td>
<input type="checkbox" class="deviceSelect" data="{{ dev.id }}"
data-device-type="{{ dev.type }}" data-device-manufacturer="{{ dev.manufacturer }}"
2022-04-28 14:58:44 +00:00
data-device-dhid="{{ dev.devicehub_id }}" data-device-vname="{{ dev.verbose_name }}"
{% if form_new_allocate.type.data and dev.id in list_devices %}
checked="checked"
{% endif %}
/>
2022-02-04 10:30:29 +00:00
</td>
<td>
2022-05-16 09:54:02 +00:00
<a href="{{ url_for('inventory.device_details', id=dev.devicehub_id)}}">
{% if dev.get_type_logo() %}
<i class="{{ dev.get_type_logo() }}" title="{{ dev.type }}"></i>
{% endif %}
{{ dev.verbose_name }}
</a>
{% if dev.lots | length > 0 %}
<h6 class="d-inline">
{% for lot in dev.get_lots_for_template() %}
<span class="badge rounded-pill bg-light text-dark">{{ lot }}</span>
{% endfor %}
</h6>
{% endif %}
</td>
<td>
<a href="{{ url_for('inventory.device_details', id=dev.devicehub_id)}}">
{{ dev.devicehub_id }}
</a>
</td>
2022-07-28 15:48:14 +00:00
<td>
{{ dev.binding and dev.binding.phid or dev.placeholder and dev.placeholder.phid or '' }}
</td>
<td>
{{ dev.is_abstract() }}
2022-07-28 15:48:14 +00:00
</td>
2021-12-28 13:14:02 +00:00
<td>
{% for t in dev.tags | sort(attribute="id") %}
2022-03-31 14:12:35 +00:00
<a href="{{ url_for('labels.label_details', id=t.id)}}">{{ t.id }}</a>
{% if not loop.last %},{% endif %}
2021-12-28 13:14:02 +00:00
{% endfor %}
</td>
2022-05-09 08:18:22 +00:00
<td>{% if dev.status %}{{ dev.status.type }}{% endif %}</td>
<td>{% if dev.allocated_status %}{{ dev.allocated_status.type }}{% endif %}</td>
<td>{% if dev.physical_status %}{{ dev.physical_status.type }}{% endif %}</td>
2022-09-20 15:25:09 +00:00
<td>{{ dev.get_updated.strftime('%Y-%m-%d %H:%M:%S')}}</td>
2022-05-25 15:33:54 +00:00
<td>{{ dev.created.strftime('%Y-%m-%d %H:%M:%S')}}</td>
2022-05-16 09:54:02 +00:00
<td>
<a href="{{ dev.public_link }}" target="_blank">
<i class="bi bi-box-arrow-up-right"></i>
</a>
</td>
2021-12-28 13:14:02 +00:00
</tr>
2022-10-14 13:33:43 +00:00
{% endif %}
2021-12-28 12:55:56 +00:00
{% endfor %}
2021-12-28 13:14:02 +00:00
</tbody>
2021-12-29 09:57:39 +00:00
</table>
2022-11-25 17:56:56 +00:00
<div class="dataTable-bottom">
<div class="dataTable-info">
Showing {{ devices.first }} to {{ devices.last }} of {{ devices.total }} entries
</div>
<nav class="dataTable-pagination">
<ul class="dataTable-pagination-list">
{% if devices.has_prev %}
<li class="pager">
{% if all_devices %}
<a href="{{ url_for('inventory.alldevicelist', page=devices.prev_num, per_page=devices.per_page, filter=filter) }}"></a>
{% elif lot %}
<a href="{{ url_for('inventory.lotdevicelist', lot_id=lot.id, page=devices.prev_num, per_page=devices.per_page, filter=filter) }}"></a>
{% else %}
<a href="{{ url_for('inventory.devicelist', page=devices.prev_num, per_page=devices.per_page, filter=filter) }}"></a>
{% endif %}
</li>
{% endif %}
{% for page in devices.iter_pages() %}
{% if page %}
{% if page == devices.page %}
<li class="active"><a href="javascript:void()">{{ page }}</a></li>
{% else %}
<li class="">
{% if all_devices %}
<a href="{{ url_for('inventory.alldevicelist', page=page, per_page=devices.per_page, filter=filter) }}">
{% elif lot %}
<a href="{{ url_for('inventory.lotdevicelist', lot_id=lot.id, page=page, per_page=devices.per_page, filter=filter) }}">
{% else %}
<a href="{{ url_for('inventory.devicelist', page=page, per_page=devices.per_page, filter=filter) }}">
{% endif %}
{{ page }}
</a>
</li>
{% endif %}
{% endif %}
{% endfor %}
{% if devices.has_next %}
<li class="pager">
{% if all_devices %}
<a href="{{ url_for('inventory.alldevicelist', page=devices.next_num, per_page=devices.per_page, filter=filter) }}"></a>
{% elif lot %}
<a href="{{ url_for('inventory.lotdevicelist', lot_id=lot.id, page=devices.next_num, per_page=devices.per_page, filter=filter) }}"></a>
{% else %}
<a href="{{ url_for('inventory.devicelist', page=devices.next_num, per_page=devices.per_page, filter=filter) }}"></a>
{% endif %}
</li>
{% endif %}
</ul>
</nav>
</div>
</div>
2021-12-28 11:36:02 +00:00
</div>
</div>
{% if lot and not lot.is_temporary and not lot.is_shared %}
<div id="trade-documents-list" class="tab-pane fade trade-documents-list">
2023-03-13 16:52:00 +00:00
<div class="btn-group dropdown ml-1 mt-1" uib-dropdown="">
2023-03-29 11:40:27 +00:00
<a href="{{ url_for('inventory.transfer_document_add', lot_id=lot.id)}}" class="btn btn-primary">
2023-03-13 16:52:00 +00:00
<i class="bi bi-plus"></i>
Add new document
<span class="caret"></span>
</a>
</div>
2022-10-06 12:41:40 +00:00
<h5 class="card-title">Documents</h5>
<table class="table">
<thead>
<tr>
<th scope="col">File</th>
2023-04-18 16:15:44 +00:00
<th scope="col">Description</th>
2022-10-10 11:24:31 +00:00
<th scope="col" data-type="date" data-format="YYYY-MM-DD hh:mm">Uploaded on</th>
2023-03-28 15:09:47 +00:00
<th></th>
</tr>
</thead>
<tbody>
2022-09-23 09:54:19 +00:00
{% for doc in lot.documents %}
<tr>
<td>
2022-09-26 06:14:04 +00:00
{% if doc.get_url() %}
<a href="{{ doc.get_url() }}" target="_blank">{{ doc.file_name}}</a>
2022-09-23 09:54:19 +00:00
{% else %}
{{ doc.file_name}}
{% endif %}
</td>
2023-04-18 16:15:44 +00:00
<td>
{% if doc.description %}
{{ doc.description|truncate(30, True) }}
{% endif %}
</td>
2022-09-23 09:54:19 +00:00
<td>
2022-10-10 11:24:31 +00:00
{{ doc.created.strftime('%Y-%m-%d %H:%M')}}
2022-09-23 09:54:19 +00:00
</td>
2023-03-28 15:09:47 +00:00
<td>
2023-03-29 11:40:27 +00:00
<a href="{{ url_for('inventory.transfer_document_edit', lot_id=lot.id, doc_id=doc.id)}}" title="Edit document">
2023-03-29 08:43:30 +00:00
<i class="bi bi-pencil-square"></i>
</a>
</td>
<td>
<a href="javascript:javascript:void(0)" data-bs-toggle="modal" data-bs-target="#btnRemoveDocument{{ loop.index }}" title="Remove document">
2023-03-28 15:09:47 +00:00
<i class="bi bi-trash-fill"></i>
</a>
<div class="modal fade" id="btnRemoveDocument{{ loop.index }}" tabindex="-1" style="display: none;" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Delete Document</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
Are you sure that you want to delete this Document?<br />
<strong>{{ doc.file_name }}</strong>
<p class="text-danger">
This action cannot be undone.
</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary-outline" data-bs-dismiss="modal">Cancel</button>
<a href="{{ url_for('inventory.document_del', lot_id=lot.id, doc_id=doc.id) }}" type="button" class="btn btn-danger">
Delete it!
</a>
</div>
</div>
</div>
</div>
</td>
2022-09-23 09:54:19 +00:00
</tr>
{% endfor %}
{% for doc in lot.trade.documents %}
<tr>
<td>
2022-09-26 06:14:04 +00:00
{% if doc.get_url() %}
<a href="{{ doc.get_url() }}" target="_blank">{{ doc.file_name}}</a>
{% else %}
{{ doc.file_name}}
{% endif %}
</td>
<td>
2022-10-10 11:24:31 +00:00
{{ doc.created.strftime('%Y-%m-%d %H:%M')}}
</td>
2023-03-28 15:09:47 +00:00
<td>
<a href="javascript:void(0)"><i class="bi bi-trash-fill"></i></a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
2022-05-30 14:32:25 +00:00
<div id="edit-transfer" class="tab-pane fade edit-transfer">
2023-03-13 16:52:00 +00:00
{% if form_transfer.date.data %}
<div class="btn-group dropdown ml-1 mt-1" uib-dropdown="">
<a href="{{ url_for('inventory.open_transfer', lot_id=lot.id)}}" class="btn btn-primary">
<i class="bi bi-plus"></i>
Reopen a transfer
<span class="caret"></span>
</a>
</div>
{% endif %}
2022-05-30 14:32:25 +00:00
<h5 class="card-title">Transfer</h5>
<form method="post" action="{{ url_for('inventory.edit_transfer', lot_id=lot.id) }}" class="row g-3 needs-validation" novalidate>
{{ form_transfer.csrf_token }}
{% for field in form_transfer %}
{% if field != form_transfer.csrf_token %}
<div class="col-12">
{% if field != form_transfer.type %}
{{ field.label(class_="form-label") }}
{% if field == form_transfer.code %}
<span class="text-danger">*</span>
{% endif %}
{{ field }}
<small class="text-muted">{{ field.description }}</small>
2022-05-30 14:32:25 +00:00
{% if field.errors %}
<p class="text-danger">
{% for error in field.errors %}
{{ error }}<br/>
{% endfor %}
</p>
{% endif %}
{% endif %}
</div>
{% endif %}
{% endfor %}
<div>
<a href="{{ url_for('inventory.lotdevicelist', lot_id=lot.id) }}" class="btn btn-danger">Cancel</a>
<button class="btn btn-primary" type="submit">Save</button>
</div>
</form>
</div>
<div id="edit-delivery-note" class="tab-pane fade edit-delivery-note">
<h5 class="card-title">Delivery Note</h5>
<form method="post" action="{{ url_for('inventory.delivery_note', lot_id=lot.id) }}" class="row g-3 needs-validation" novalidate>
{{ form_delivery.csrf_token }}
{% for field in form_delivery %}
{% if field != form_delivery.csrf_token %}
<div class="col-12">
{% if field != form_delivery.type %}
{{ field.label(class_="form-label") }}
{{ field }}
<small class="text-muted">{{ field.description }}</small>
{% if field.errors %}
<p class="text-danger">
{% for error in field.errors %}
{{ error }}<br/>
{% endfor %}
</p>
{% endif %}
{% endif %}
</div>
{% endif %}
{% endfor %}
{% if lot.transfer and form_receiver.is_editable() %}
<div>
<a href="{{ url_for('inventory.lotdevicelist', lot_id=lot.id) }}" class="btn btn-danger">Cancel</a>
<button class="btn btn-primary" type="submit">Save</button>
</div>
{% endif %}
</form>
</div>
<div id="edit-receiver-note" class="tab-pane fade edit-receiver-note">
<h5 class="card-title">Receiver Note</h5>
<form method="post" action="{{ url_for('inventory.receiver_note', lot_id=lot.id) }}" class="row g-3 needs-validation" novalidate>
{{ form_receiver.csrf_token }}
{% for field in form_receiver %}
{% if field != form_receiver.csrf_token %}
<div class="col-12">
{% if field != form_receiver.type %}
{{ field.label(class_="form-label") }}
{{ field }}
<small class="text-muted">{{ field.description }}</small>
{% if field.errors %}
<p class="text-danger">
{% for error in field.errors %}
{{ error }}<br/>
{% endfor %}
</p>
{% endif %}
{% endif %}
</div>
{% endif %}
{% endfor %}
{% if lot.transfer and form_receiver.is_editable() %}
2022-05-30 14:32:25 +00:00
<div>
<a href="{{ url_for('inventory.lotdevicelist', lot_id=lot.id) }}" class="btn btn-danger">Cancel</a>
<button class="btn btn-primary" type="submit">Save</button>
</div>
{% endif %}
2022-05-30 14:32:25 +00:00
</form>
</div>
2023-02-14 19:03:33 +00:00
<div id="edit-customer-details" class="tab-pane fade edit-customer-details">
<h5 class="card-title">Customer Details</h5>
<form method="post" action="{{ url_for('inventory.customer_details', lot_id=lot.id) }}" class="row g-3 needs-validation" novalidate>
{{ form_customer_details.csrf_token }}
{% for field in form_customer_details %}
{% if field != form_customer_details.csrf_token %}
<div class="col-12">
{% if field != form_customer_details.type %}
{{ field.label(class_="form-label") }}
{{ field }}
<small class="text-muted">{{ field.description }}</small>
{% if field.errors %}
<p class="text-danger">
{% for error in field.errors %}
{{ error }}<br/>
{% endfor %}
</p>
{% endif %}
{% endif %}
</div>
{% endif %}
{% endfor %}
<div>
<a href="{{ url_for('inventory.lotdevicelist', lot_id=lot.id) }}" class="btn btn-danger">Cancel</a>
<button class="btn btn-primary" type="submit">Save</button>
</div>
</form>
</div>
{% endif %}
2021-12-28 11:36:02 +00:00
</div><!-- End Bordered Tabs -->
</div>
2021-12-28 11:36:02 +00:00
</div>
</div>
2022-04-07 11:28:07 +00:00
<div id="NotificationsContainer" style="position: absolute; bottom: 0; right: 0; margin: 10px; margin-top: 70px; width: calc(100% - 310px);"></div>
2021-12-28 11:36:02 +00:00
</div>
</div>
</section>
{% include "inventory/lot_delete_modal.html" %}
2022-01-04 11:56:28 +00:00
{% include "inventory/actions.html" %}
2022-01-10 14:53:11 +00:00
{% include "inventory/allocate.html" %}
2022-02-07 13:01:38 +00:00
{% include "inventory/data_wipe.html" %}
2022-02-24 13:15:58 +00:00
{% include "inventory/trade.html" %}
{% include "inventory/alert_export_error.html" %}
2022-04-28 14:58:44 +00:00
{% include "inventory/alert_lots_changes.html" %}
2021-12-29 12:02:39 +00:00
2021-12-29 09:57:39 +00:00
<!-- Custom Code -->
2022-11-25 17:56:56 +00:00
<script>
$(document).ready(() => {
$(".dataTable-selector").on("change", function() {
const per_page = $('.dataTable-selector').val();
{% if all_devices %}
window.location.href = "{{ url_for('inventory.alldevicelist', page=1) }}&filter={{ filter }}&per_page="+per_page;
{% elif lot %}
window.location.href = "{{ url_for('inventory.lotdevicelist', lot_id=lot.id, page=1) }}&filter={{ filter }}&per_page="+per_page;
{% else %}
window.location.href = "{{ url_for('inventory.devicelist', page=1) }}&filter={{ filter }}&per_page="+per_page;
{% endif %}
});
});
</script>
2021-12-29 09:57:39 +00:00
<script>
let table = new simpleDatatables.DataTable("table", {
2022-11-25 17:56:56 +00:00
footer: false,
paging: false,
2022-04-25 09:19:55 +00:00
})
2021-12-29 09:57:39 +00:00
</script>
2022-05-18 09:16:22 +00:00
{% if config['DEBUG'] %}
<script src="{{ url_for('static', filename='js/main_inventory.js') }}"></script>
{% else %}
<script src="{{ url_for('static', filename='js/main_inventory.build.js') }}"></script>
{% endif %}
2021-12-28 11:36:02 +00:00
{% endblock main %}