mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-15 11:35:41 +00:00
Add shipment status to sales order page
This commit is contained in:
@ -700,6 +700,30 @@ class SalesOrder(Order):
|
|||||||
def pending_line_count(self):
|
def pending_line_count(self):
|
||||||
return self.pending_line_items().count()
|
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):
|
class PurchaseOrderAttachment(InvenTreeAttachment):
|
||||||
"""
|
"""
|
||||||
|
@ -135,6 +135,16 @@ src="{% static 'img/blank_image.png' %}"
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</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 %}
|
{% if order.link %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><span class='fas fa-link'></span></td>
|
<td><span class='fas fa-link'></span></td>
|
||||||
|
Reference in New Issue
Block a user