mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-18 04:55:44 +00:00
Refactor CancelSalesOrder form
This commit is contained in:
@ -21,6 +21,7 @@
|
||||
/* exported
|
||||
allocateStockToSalesOrder,
|
||||
cancelPurchaseOrder,
|
||||
cancelSalesOrder,
|
||||
completePurchaseOrder,
|
||||
completeShipment,
|
||||
createSalesOrder,
|
||||
@ -246,6 +247,32 @@ function issuePurchaseOrder(order_id, options={}) {
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Launches a modal form to mark a SalesOrder as "cancelled"
|
||||
*/
|
||||
function cancelSalesOrder(order_id, options={}) {
|
||||
|
||||
constructForm(
|
||||
`/api/order/so/${order_id}/cancel/`,
|
||||
{
|
||||
method: 'POST',
|
||||
title: '{% trans "Cancel Sales Order" %}',
|
||||
confirm: true,
|
||||
preFormContent: function(opts) {
|
||||
var html = `
|
||||
<div class='alert alert-block alert-warning'>
|
||||
{% trans "Cancelling this order means that the order will no longer be editable." %}
|
||||
</div>`;
|
||||
|
||||
return html;
|
||||
},
|
||||
onSuccess: function(response) {
|
||||
handleFormSuccess(response, options);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// Open a dialog to create a new sales order shipment
|
||||
function createSalesOrderShipment(options={}) {
|
||||
|
||||
|
Reference in New Issue
Block a user