Bug fix for rendering in PurchaseOrderLineItem table (#4536)

This commit is contained in:
Oliver 2023-03-29 13:06:12 +11:00 committed by GitHub
parent 27aa16d55d
commit e8e2985454
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1905,15 +1905,15 @@ function loadPurchaseOrderLineItemTable(table, options={}) {
field: 'quantity',
title: '{% trans "Quantity" %}',
formatter: function(value, row) {
var units = '';
let units = '';
if (row.part_detail.units) {
if (row.part_detail && row.part_detail.units) {
units = ` ${row.part_detail.units}`;
}
var data = value;
let data = value;
if (row.supplier_part_detail.pack_size != 1.0) {
if (row.supplier_part_detail && row.supplier_part_detail.pack_size != 1.0) {
var pack_size = row.supplier_part_detail.pack_size;
var total = value * pack_size;
data += `<span class='fas fa-info-circle icon-blue float-right' title='{% trans "Pack Quantity" %}: ${pack_size}${units} - {% trans "Total Quantity" %}: ${total}${units}'></span>`;