mirror of
https://github.com/inventree/InvenTree.git
synced 2026-10-09 03:36:26 +00:00
Sorter fixes
This commit is contained in:
1 parent
4167e1fdb3
commit
b5e1d3f87a
1 file changed
+11
-3
@@ -535,10 +535,18 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) {
|
||||
sorter: function(valA, valB, rowA, rowB) {
|
||||
var aA = sumAllocations(rowA);
|
||||
var aB = sumAllocations(rowB);
|
||||
|
||||
var qA = rowA.quantity * output.quantity;
|
||||
var qB = rowB.quantity * output.quantity;
|
||||
|
||||
var qA = rowA.quantity;
|
||||
var qB = rowB.quantity;
|
||||
|
||||
if (output) {
|
||||
qA *= output.quantity;
|
||||
qB *= output.quantity;
|
||||
} else {
|
||||
qA *= buildInfo.quantity;
|
||||
qB *= buildInfo.quantity;
|
||||
}
|
||||
|
||||
if (aA == 0 && aB == 0) {
|
||||
return (qA > qB) ? 1 : -1;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user