Looks like this is now fully sorted for invoices in 2.8.2 as subtotals are now good.
However please can we get delivery nots/packing slips updated?
Would need to add the following code to deliverynote.php and packinglist.php (currently I’ve manually edited the files to apply the fix):
within generate_template_html:
$find_replace=$this->set_other_data($find_replace,$template_type,$html,$order);
then at the end:
/**
* @since 2.8.1
* Added the filters to edit the data when refunds
*/
public function set_other_data($find_replace, $template_type, $html, $order)
{
add_filter('wf_pklist_alter_package_item_quantiy', array($this, 'alter_quantity_column'), 1, 5);
return $find_replace;
}
/**
* @since 2.8.1
* Alter quantity of order item if the item is refunded
*/
public function alter_quantity_column($qty, $template_type, $_product, $item, $order)
{
$item_id = $item['order_item_id'];
$new_qty=$order->get_qty_refunded_for_item($item_id);
if($new_qty<0)
{
$qty='<del>'.$qty.'</del> <ins>'.($qty+$new_qty).'</ins>';
}
return $qty;
}