
17 changed files with 495 additions and 38 deletions
@ -0,0 +1,16 @@
@@ -0,0 +1,16 @@
|
||||
Dear {{ user.first_name }}, |
||||
|
||||
The status of one or more of your orders have been changed by {{ request.user.first_name }}: |
||||
|
||||
{% for order in data %} |
||||
{{ order.cas_description }} |
||||
- new status: {{ order.status.name|title }} |
||||
{% endfor %} |
||||
|
||||
You can now log in at {{ request.resource_url(request.root) }} and order some more stuff. |
||||
|
||||
Regards, |
||||
The Ordr System |
||||
|
||||
-- |
||||
Please don't respont to this email! This is an automatically generated notification. |
@ -0,0 +1,80 @@
@@ -0,0 +1,80 @@
|
||||
{% extends "ordr3:templates/layout_full.jinja2" %} |
||||
|
||||
{% block subtitle %} Delete {{orders|length}} Orders {% endblock subtitle %} |
||||
|
||||
{% block content %} |
||||
|
||||
<div class="col-10"> |
||||
<div class="border border-danger rounded o3-delete-warning"> |
||||
<h4 class="mb-2 text-muted mb-4 text-truncate">Delete {{orders|length}} Orders <span class="text-danger">{{ context.model.cas_description }}</span></h4> |
||||
<p>You are about to delete the following orders:</p> |
||||
<form action="{{request.resource_url(context, 'batch-delete-confirm')}}" method="POST"> |
||||
<table class="table table-hover o3-data-table o3-data-hide-details"> |
||||
<thead> |
||||
<tr> |
||||
<th scope="col" class="o3-dont-wrap"> |
||||
Date |
||||
</th> |
||||
<th scope="col" class="o3-dont-wrap"> |
||||
CAS / Description |
||||
</th> |
||||
<th scope="col" class="o3-dont-wrap"> |
||||
Vendor |
||||
</th> |
||||
<th scope="col" class="o3-dont-wrap text-right"> |
||||
Total Price |
||||
</th> |
||||
<th scope="col" class="o3-dont-wrap"> |
||||
Ordered by |
||||
</th> |
||||
<th scope="col" class="o3-dont-wrap"> |
||||
Status |
||||
</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
{% for order in orders %} |
||||
<tr> |
||||
<td class="o3-dont-wrap"> |
||||
<input type="hidden" name="selection" value="{{ order.id }}"> |
||||
{{ order.created_on.strftime("%Y-%m-%d") }} |
||||
</td> |
||||
<td> |
||||
{{ order.cas_description }} |
||||
</td> |
||||
<td> |
||||
{{ order.vendor }} |
||||
</td> |
||||
<td class="text-right"> |
||||
<span class="o3-dont-wrap">{{ "%.2f"|format(order.total_price)|replace(".", ",") }}</a> {{ order.currency }}</span> |
||||
</td> |
||||
<td> |
||||
{{ order.created_by }} |
||||
</td> |
||||
<td> |
||||
{{ macros.status_label(order.status) }} |
||||
</td> |
||||
</tr> |
||||
{% endfor %} |
||||
</tbody> |
||||
</table> |
||||
<p class="font-weight-bold mt-4 mb-4">This action is permanent and cannot be undone!</p> |
||||
<p class="mt-4"> |
||||
<div class="custom-control custom-switch o3-confirmation"> |
||||
<input type="checkbox" class="custom-control-input" id="confirmation" value="confirmed" name="confirmation"> |
||||
<label class="custom-control-label" for="confirmation">I confirm that I want to delete this order.</label> |
||||
</div> |
||||
</p> |
||||
<p class="mt-4"> |
||||
<input type="hidden" name="csrf_token" value="{{csrf_token}}"> |
||||
|
||||
<button class="btn btn-outline-danger o3-confirm-button" type="submit" name="delete" disabled="disabled">Delete Orders</button> |
||||
<button class="btn btn-outline-secondary" type="submit" name="cancel">Cancel</button> |
||||
</p> |
||||
</form> |
||||
</div> |
||||
</div> |
||||
|
||||
{% endblock content %} |
||||
|
||||
|
@ -0,0 +1,85 @@
@@ -0,0 +1,85 @@
|
||||
{% extends "ordr3:templates/layout_full.jinja2" %} |
||||
|
||||
{% block subtitle %} Edit {{orders|length}} Orders {% endblock subtitle %} |
||||
|
||||
{% block content %} |
||||
|
||||
<div class="col-10"> |
||||
<h4 class="mb-2 text-muted mb-4 text-truncate">Edit {{orders|length}} Orders <span class="text-danger">{{ context.model.cas_description }}</span></h4> |
||||
<form action="{{request.resource_url(context, 'batch-edit-confirm')}}" method="POST"> |
||||
<table class="table table-hover o3-data-table o3-data-edit-multiple"> |
||||
<thead> |
||||
<tr> |
||||
<th scope="col" class="o3-dont-wrap"> |
||||
Date |
||||
</th> |
||||
<th scope="col" class="o3-dont-wrap"> |
||||
CAS / Description |
||||
</th> |
||||
<th scope="col" class="o3-dont-wrap"> |
||||
Vendor |
||||
</th> |
||||
<th scope="col" class="o3-dont-wrap text-right"> |
||||
Total Price |
||||
</th> |
||||
<th scope="col" class="o3-dont-wrap"> |
||||
Ordered by |
||||
</th> |
||||
<th scope="col" class="o3-dont-wrap"> |
||||
Status |
||||
</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
{% for order in orders %} |
||||
<tr> |
||||
<td class="o3-dont-wrap"> |
||||
{{ order.created_on.strftime("%Y-%m-%d") }} |
||||
</td> |
||||
<td> |
||||
{{ order.cas_description }} |
||||
</td> |
||||
<td> |
||||
{{ order.vendor }} |
||||
</td> |
||||
<td class="text-right"> |
||||
<span class="o3-dont-wrap">{{ "%.2f"|format(order.total_price)|replace(".", ",") }}</a> {{ order.currency }}</span> |
||||
</td> |
||||
<td> |
||||
{{ order.created_by }} |
||||
</td> |
||||
<td> |
||||
<input type="hidden" name="selection" value="{{ order.id }}"> |
||||
<select name="status-{{ order.id }}" class="custom-select custom-select-sm"> |
||||
{% for status in stati %} |
||||
<option value="{{status.name}}" {% if order.status == status %}selected="selected"{% endif %}>{{status.name|capitalize}}</option> |
||||
{% endfor %} |
||||
</select> |
||||
</td> |
||||
</tr> |
||||
{% endfor %} |
||||
</tbody> |
||||
</table> |
||||
<p class="mt-4"> |
||||
<input type="hidden" name="csrf_token" value="{{csrf_token}}"> |
||||
<div class="btn-group"> |
||||
<button type="button" class="btn btn-primary o3-set-multi-status" data-multi-value="APPROVAL">Set all to Approval</button> |
||||
<button type="button" class="btn btn-primary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" data-reference="parent"> |
||||
<span class="small">{{ macros.icon("caret-down-fill") }}</span> |
||||
</button> |
||||
<div class="dropdown-menu"> |
||||
<a class="dropdown-item o3-set-multi-status" data-multi-value="ORDERED">Set all to Ordered</a> |
||||
<a class="dropdown-item o3-set-multi-status" data-multi-value="COMPLETED">Set all to Completed</a> |
||||
<a class="dropdown-item o3-set-multi-status" data-multi-value="HOLD">Set all to Hold</a> |
||||
</div> |
||||
</div> |
||||
<button class="btn btn-danger" type="submit" name="change">Change Orders</button> |
||||
<button class="btn btn-outline-secondary" type="submit" name="cancel">Cancel</button> |
||||
</p> |
||||
|
||||
</form> |
||||
</div> |
||||
|
||||
{% endblock content %} |
||||
|
||||
|
@ -0,0 +1,51 @@
@@ -0,0 +1,51 @@
|
||||
{% extends "ordr3:templates/layout_full.jinja2" %} |
||||
|
||||
{% block subtitle %} Delete Order {{context.model.cas_description}} {% endblock subtitle %} |
||||
|
||||
{% block content %} |
||||
|
||||
<div class="col-5"> |
||||
<div class="border border-danger rounded o3-delete-warning"> |
||||
<h4 class="mb-2 text-muted mb-4 text-truncate">Delete Order <span class="text-danger">{{ context.model.cas_description }}</span></h4> |
||||
<p>You are about to delete the following order:</p> |
||||
<dl class="row"> |
||||
<dt class="col-sm-4">Cas / Description</dt> |
||||
<dd class="col-sm-8">{{ context.model.cas_description }}</dd> |
||||
<dt class="col-sm-4">Vendor</dt> |
||||
<dd class="col-sm-8">{{ context.model.vendor }}</dd> |
||||
<dt class="col-sm-4">Catalog Nr.</dt> |
||||
<dd class="col-sm-8">{{ context.model.catalog_nr }}</dd> |
||||
<dt class="col-sm-4">Package Size</dt> |
||||
<dd class="col-sm-8">{{ context.model.package_size }}</dd> |
||||
<dt class="col-sm-4">Amount, Price</dt> |
||||
<dd class="col-sm-8">{{ context.model.amount }} * {{ context.model.unit_price }} {{ context.model.currency }}</dd> |
||||
<dt class="col-sm-4">Ordered By</dt> |
||||
<dd class="col-sm-8">{{ context.model.created_by }}</dd> |
||||
<dt class="col-sm-4">Ordered On</dt> |
||||
<dd class="col-sm-8">{{ context.model.created_on.strftime("%Y-%m-%d %H:%I") }}</dd> |
||||
<dt class="col-sm-4">Status</dt> |
||||
<dd class="col-sm-8">{{ macros.status_label(context.model.status) }}</dd> |
||||
</dl> |
||||
|
||||
<p class="font-weight-bold mt-4 mb-4">This action is permanent and cannot be undone!</p> |
||||
<form action="{{request.resource_url(context, 'delete')}}" method="POST"> |
||||
<p class="mt-4"> |
||||
<div class="custom-control custom-switch o3-confirmation"> |
||||
<input type="checkbox" class="custom-control-input" id="confirmation" value="confirmed" name="confirmation"> |
||||
<label class="custom-control-label" for="confirmation">I confirm that I want to delete this order.</label> |
||||
</div> |
||||
</p> |
||||
<p class="mt-4"> |
||||
<input type="hidden" name="csrf_token" value="{{csrf_token}}"> |
||||
<button class="btn btn-outline-danger o3-confirm-button" type="submit" name="delete" disabled="disabled">Delete Order</button> |
||||
<button class="btn btn-outline-secondary" type="submit" name="cancel">Cancel</button> |
||||
</p> |
||||
</form> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="col-5"></div> |
||||
|
||||
{% endblock content %} |
||||
|
||||
|
Loading…
Reference in new issue