2
0
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:
Oliver Walters
2022-05-04 15:55:21 +10:00
parent bf48e3204b
commit a510ca89f7
9 changed files with 74 additions and 102 deletions

View File

@ -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={}) {