2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 13:05:42 +00:00

add total price woth js reload

This commit is contained in:
Matthias
2022-03-06 23:21:33 +01:00
parent 56142b9303
commit f0b19e69b8
5 changed files with 54 additions and 0 deletions

View File

@ -2290,6 +2290,24 @@ function showFulfilledSubTable(index, row, element, options) {
});
}
var soTotalPriceRef = '' // safes reference to total price
var soTotalPriceOptions = {} // options to reload the price
function loadOrderTotal(reference, options={}) {
soTotalPriceRef = reference;
soTotalPriceOptions = options;
}
function reloadTotal(){
inventreeGet(
soTotalPriceOptions.url,
{},
{success: function(data){
$(soTotalPriceRef).html(data.total_price_string);
}}
);
};
/**
* Load a table displaying line items for a particular SalesOrder
@ -2587,6 +2605,7 @@ function loadSalesOrderLineItemTable(table, options={}) {
function reloadTable() {
$(table).bootstrapTable('refresh');
reloadTotal();
}
// Configure callback functions once the table is loaded
@ -2954,6 +2973,7 @@ function loadSalesOrderAdditionalLineItemTable(table, options={}) {
function reloadTable() {
$(table).bootstrapTable('refresh');
reloadTotal();
}
// Configure callback functions once the table is loaded