Commit 20bd3d40 authored by Nigel Kukard's avatar Nigel Kukard
Browse files

Merge branch 'units' into 'master'

Fixed Unit's on invoice line items

See merge request !47
parents f9a6008e 742f84b0
Pipeline #4196 passed with stages
in 2 minutes and 42 seconds
...@@ -676,10 +676,20 @@ sub linkInvoiceItem ...@@ -676,10 +676,20 @@ sub linkInvoiceItem
$sellPrice->badd($inventoryItem->{'SellPrice'}); $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 "") { 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(@extraCols,'Unit');
push(@extraData,DBQuote($inventoryItem->{'Unit'})); push(@extraData,DBQuote($unit));
} }
# Total up final price # Total up final price
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment