...
 
Commits (20)
......@@ -676,10 +676,20 @@ sub linkInvoiceItem
$sellPrice->badd($inventoryItem->{'SellPrice'});
}
# If we have an item unit, add it aswell
# Work out what unit we're going to add
my $unit = undef;
# Default to the inventory item
if (defined($inventoryItem->{'Unit'}) && $inventoryItem->{'Unit'} ne "") {
$unit = $inventoryItem->{'Unit'};
}
# Allow overriding from the params passed
if (defined($detail->{'Unit'})) {
$unit = $detail->{'Unit'};
}
# If we have one defined, we can now add it
if (defined($unit)) {
push(@extraCols,'Unit');
push(@extraData,DBQuote($inventoryItem->{'Unit'}));
push(@extraData,DBQuote($unit));
}
# Total up final price
......