2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 03:00:54 +00:00

Fix rendering of supplier part pack quantity (#6226)

- Fixes https://github.com/inventree/InvenTree/issues/6224
This commit is contained in:
Oliver
2024-01-13 08:06:47 +11:00
committed by GitHub
parent 213a63318d
commit 9b1a310ffe
2 changed files with 15 additions and 7 deletions

View File

@ -1812,12 +1812,13 @@ function loadPartPurchaseOrderTable(table, part_id, options={}) {
formatter: function(value, row) {
let data = value;
if (row.supplier_part_detail.pack_quantity_native != 1.0) {
let total = value * row.supplier_part_detail.pack_quantity_native;
if (row.supplier_part_detail && row.supplier_part_detail.pack_quantity_native != 1.0) {
let pq = row.supplier_part_detail.pack_quantity_native;
let total = value * pq;
data += makeIconBadge(
'fa-info-circle icon-blue',
`{% trans "Pack Quantity" %}: ${row.pack_quantity} - {% trans "Total Quantity" %}: ${total}`
`{% trans "Pack Quantity" %}: ${pq} - {% trans "Total Quantity" %}: ${total}`
);
}
@ -1870,9 +1871,10 @@ function loadPartPurchaseOrderTable(table, part_id, options={}) {
formatter: function(value, row) {
var data = value;
if (value > 0 && row.supplier_part_detail.pack_quantity_native != 1.0) {
let total = value * row.supplier_part_detail.pack_quantity_native;
data += `<span class='fas fa-info-circle icon-blue float-right' title='{% trans "Pack Quantity" %}: ${row.pack_quantity} - {% trans "Total Quantity" %}: ${total}'></span>`;
if (value > 0 && row.supplier_part_detail && row.supplier_part_detail.pack_quantity_native != 1.0) {
let pq = row.supplier_part_detail.pack_quantity_native;
let total = value * pq;
data += `<span class='fas fa-info-circle icon-blue float-right' title='{% trans "Pack Quantity" %}: ${pq} - {% trans "Total Quantity" %}: ${total}'></span>`;
}
return data;