mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add shipment status to sales order page
This commit is contained in:
parent
921ef5ae9e
commit
9ba6ac423d
@ -700,6 +700,30 @@ class SalesOrder(Order):
|
||||
def pending_line_count(self):
|
||||
return self.pending_line_items().count()
|
||||
|
||||
def completed_shipments(self):
|
||||
"""
|
||||
Return a queryset of the completed shipments for this order
|
||||
"""
|
||||
return self.shipments.exclude(shipment_date=None)
|
||||
|
||||
def pending_shipments(self):
|
||||
"""
|
||||
Return a queryset of the pending shipments for this order
|
||||
"""
|
||||
|
||||
return self.shipments.filter(shipment_date=None)
|
||||
|
||||
@property
|
||||
def shipment_count(self):
|
||||
return self.shipments.count()
|
||||
|
||||
@property
|
||||
def completed_shipment_count(self):
|
||||
return self.completed_shipments().count()
|
||||
|
||||
@property
|
||||
def pending_shipment_count(self):
|
||||
return self.pending_shipments().count()
|
||||
|
||||
class PurchaseOrderAttachment(InvenTreeAttachment):
|
||||
"""
|
||||
|
@ -135,6 +135,16 @@ src="{% static 'img/blank_image.png' %}"
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class='fas fa-truck'></span></td>
|
||||
<td>{% trans "Completed Shipments" %}</td>
|
||||
<td>
|
||||
{{ order.completed_shipment_count }} / {{ order.shipment_count }}
|
||||
{% if order.pending_shipment_count > 0 %}
|
||||
<span class='badge bg-danger badge-right rounded-pill'>{% trans "Incomplete" %}</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% if order.link %}
|
||||
<tr>
|
||||
<td><span class='fas fa-link'></span></td>
|
||||
|
Loading…
Reference in New Issue
Block a user