mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add a VIew for receiving purchase order
This commit is contained in:
parent
11d9312c45
commit
bbd6b15089
@ -63,6 +63,8 @@ InvenTree | {{ order }}
|
|||||||
<button type='button' class='btn btn-primary' id='edit-order'>Edit Order</button>
|
<button type='button' class='btn btn-primary' id='edit-order'>Edit Order</button>
|
||||||
{% if order.status == OrderStatus.PENDING and order.lines.count > 0 %}
|
{% if order.status == OrderStatus.PENDING and order.lines.count > 0 %}
|
||||||
<button type='button' class='btn btn-primary' id='place-order'>Place Order</button>
|
<button type='button' class='btn btn-primary' id='place-order'>Place Order</button>
|
||||||
|
{% elif order.status == OrderStatus.PLACED %}
|
||||||
|
<button type='button' class='btn btn-primary' id='receive-order'>Receive Order</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<button type='button' class='btn btn-primary' id='export-order' title='Export order to file'>Export</button>
|
<button type='button' class='btn btn-primary' id='export-order' title='Export order to file'>Export</button>
|
||||||
</div>
|
</div>
|
||||||
@ -159,6 +161,12 @@ $("#edit-order").click(function() {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#receive-order").click(function() {
|
||||||
|
launchModalForm("{% url 'purchase-order-receive' order.id %}", {
|
||||||
|
reload: true,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
$("#export-order").click(function() {
|
$("#export-order").click(function() {
|
||||||
location.href = "{% url 'purchase-order-export' order.id %}";
|
location.href = "{% url 'purchase-order-export' order.id %}";
|
||||||
});
|
});
|
||||||
|
10
InvenTree/order/templates/order/receive_parts.html
Normal file
10
InvenTree/order/templates/order/receive_parts.html
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{% extends "modal_form.html" %}
|
||||||
|
|
||||||
|
{% block form %}
|
||||||
|
|
||||||
|
<form method='post' action='' class='js-modal-form' enctype='multipart/form-data'>
|
||||||
|
{% csrf_token %}
|
||||||
|
{% load crispy_forms_tags %}
|
||||||
|
</form>
|
||||||
|
|
||||||
|
{% endblock %}
|
@ -13,6 +13,7 @@ purchase_order_detail_urls = [
|
|||||||
|
|
||||||
url(r'^edit/?', views.PurchaseOrderEdit.as_view(), name='purchase-order-edit'),
|
url(r'^edit/?', views.PurchaseOrderEdit.as_view(), name='purchase-order-edit'),
|
||||||
url(r'^issue/?', views.PurchaseOrderIssue.as_view(), name='purchase-order-issue'),
|
url(r'^issue/?', views.PurchaseOrderIssue.as_view(), name='purchase-order-issue'),
|
||||||
|
url(r'^receive/?', views.PurchaseOrderReceive.as_view(), name='purchase-order-receive'),
|
||||||
|
|
||||||
url(r'^export/?', views.PurchaseOrderExport.as_view(), name='purchase-order-export'),
|
url(r'^export/?', views.PurchaseOrderExport.as_view(), name='purchase-order-export'),
|
||||||
|
|
||||||
|
@ -165,6 +165,34 @@ class PurchaseOrderExport(AjaxView):
|
|||||||
return DownloadFile(filedata, filename)
|
return DownloadFile(filedata, filename)
|
||||||
|
|
||||||
|
|
||||||
|
class PurchaseOrderReceive(AjaxView):
|
||||||
|
""" View for receiving parts which are outstanding against a PurchaseOrder.
|
||||||
|
|
||||||
|
Any parts which are outstanding are listed.
|
||||||
|
If all parts are marked as received, the order is closed out.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
ajax_form_title = "Receive Parts"
|
||||||
|
ajax_template_name = "order/receive_parts.html"
|
||||||
|
|
||||||
|
def get_context_data(self):
|
||||||
|
|
||||||
|
ctx = {
|
||||||
|
'order': self.order,
|
||||||
|
}
|
||||||
|
|
||||||
|
return ctx
|
||||||
|
|
||||||
|
def get(self, request, *args, **kwargs):
|
||||||
|
|
||||||
|
self.request = request
|
||||||
|
self.order = get_object_or_404(PurchaseOrder, pk=self.kwargs['pk'])
|
||||||
|
|
||||||
|
return self.renderJsonResponse(request)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class OrderParts(AjaxView):
|
class OrderParts(AjaxView):
|
||||||
""" View for adding various SupplierPart items to a Purchase Order.
|
""" View for adding various SupplierPart items to a Purchase Order.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user