• Resolved madideas

    (@madideas)


    If I refund one item in a multi-item order, then the totals on the invoice are updated accordingly, but the line item still shows exactly as before it was refunded, so it’s not clear on the invoice what’s actually happened. Am I missing something, or is this a bug?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author webtoffee

    (@webtoffee)

    Hi @madideas

    Thanks for reaching out.

    We will look into it and get back to you soon.

    Thread Starter madideas

    (@madideas)

    Hi, looks like you sorted the invoice line item in the latest release, however…
    1. The ‘subtotal’ section of the invoice still shows the full order amount and VAT as opposed to the reduced numbers due to the refund and
    2. Delivery notes/packing slips still show refunded items with no discerning features

    Thread Starter madideas

    (@madideas)

    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> &nbsp; <ins>'.($qty+$new_qty).'</ins>';
    		}
    		return $qty;
    	}
    Plugin Author webtoffee

    (@webtoffee)

    Hi @madideas,

    Thanks for sharing the information.

    We are glad to know that the issue is fixed. Currently, this functionality is applicable only for the invoice document. However, we will keep your suggestion in our pipeline and consider it in our future updates.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.