Banner Logo

Be a part of the family: Connect, Receive Support,
Contribute, and Reap Abundant Rewards!

RE: Refund are not shoing

WCMp Core

Resolved
Viewing 25 reply threads
  • Author
    Posts
    • #113065
      Anonymous
      Inactive

      The Refund amount is not showing in the Woocommerce report.
      I have narrowed down to a WCMP plugin problem.
      I tried deactivating WCMP and the refund amount is shown.
      Once activated, the refund amount is zeroed, but shown # of returned items.

    • #113117

      Hello,

      Thank you for reaching out to us.

      We found the issue at our end and our team is working on it. You can track it from here (https://github.com/wcmarketplace/dc-woocommerce-multi-vendor/issues/625).

    • #113203
      Anonymous
      Inactive

      Any update on this Major issue? Because this is causing a major problem with accounting.

    • #113310
      WCMp Admin
      Keymaster

      Hi @print88,

      This has already being assigned to development team and they are already looking into it.

    • #113471

      Hi @print88,
      Please use this code in your currently active theme functions.php file and let us know the issue is fixed or not

      
      add_filter( 'woocommerce_admin_report_data', function($report_data){
          
          $child_orders_for_partial = array();
          if (is_array($report_data->partial_refunds) && !empty($report_data->partial_refunds)) {
              foreach ($report_data->partial_refunds as $refund_key => $refund_value) {
                  $refund = new WC_Order_Refund( $refund_value->refund_id );
                  if ( is_object( $refund ) && !wp_get_post_parent_id($refund->get_parent_id())) {
                      $child_orders_for_partial[] = $refund_value;
                  }
              }
          }
          
          $child_orders_refund_lines = array();
          if (is_array($report_data->refund_lines) && !empty($report_data->refund_lines)) {
              foreach ($report_data->refund_lines as $refund_key => $refund_value) {
                  $refund = new WC_Order_Refund( $refund_value->refund_id );
                  if ( is_object( $refund ) && !wp_get_post_parent_id($refund->get_parent_id())) {
                      $child_orders_refund_lines[] = $refund_value;
                  }
              }
          }
      
          $report_data->partial_refunds = $report_data->refunded_orders = $child_orders_for_partial;
          $report_data->refund_lines  = $child_orders_refund_lines;   
      
          /**
           * Total up refunds. Note: when an order is fully refunded, a refund line will be added.
           */
          $report_data->total_tax_refunded          = 0;
          $report_data->total_shipping_refunded     = 0;
          $report_data->total_shipping_tax_refunded = 0;
          $report_data->total_refunds               = 0;
      
          foreach ( $report_data->refunded_orders as $key => $value ) {
             
              $report_data->total_tax_refunded          += floatval( $value->total_tax < 0 ? $value->total_tax * -1 : $value->total_tax );
              $report_data->total_refunds               += floatval( $value->total_refund );
              $report_data->total_shipping_tax_refunded += floatval( $value->total_shipping_tax < 0 ? $value->total_shipping_tax * -1 : $value->total_shipping_tax );
              $report_data->total_shipping_refunded     += floatval( $value->total_shipping < 0 ? $value->total_shipping * -1 : $value->total_shipping );
      
              // Only applies to parial.
              if ( isset( $value->order_item_count ) ) {
                  $report_data->refunded_order_items += floatval( $value->order_item_count < 0 ? $value->order_item_count * -1 : $value->order_item_count );
              }
          }
      
          // Totals from all orders - including those refunded. Subtract refunded amounts.
          $report_data->total_tax          = wc_format_decimal( array_sum( wp_list_pluck( $report_data->orders, 'total_tax' ) ) - $report_data->total_tax_refunded, 2 );
          $report_data->total_shipping     = wc_format_decimal( array_sum( wp_list_pluck( $report_data->orders, 'total_shipping' ) ) - $report_data->total_shipping_refunded, 2 );
          $report_data->total_shipping_tax = wc_format_decimal( array_sum( wp_list_pluck( $report_data->orders, 'total_shipping_tax' ) ) - $report_data->total_shipping_tax_refunded, 2 );
      
          // Total the refunds and sales amounts. Sales subract refunds. Note - total_sales also includes shipping costs.
          $report_data->total_sales = wc_format_decimal( array_sum( wp_list_pluck( $report_data->orders, 'total_sales' ) ) - $report_data->total_refunds, 2 );
          $report_data->net_sales   = wc_format_decimal( $report_data->total_sales - $report_data->total_shipping - max( 0, $report_data->total_tax ) - max( 0, $report_data->total_shipping_tax ), 2 );
      
          return $report_data;
      } );
      
      add_action( 'init', function() {
          global $WCMp;
          remove_filter( 'woocommerce_reports_get_order_report_data_args', array( $WCMp->report, 'woocommerce_reports_get_order_report_data_args' ), 99 );
      } );
      Copy
    • #113544
      Anonymous
      Inactive

      The codes did not work.
      Please see the attached BEFORE/AFTER screenshot.

    • #113591

      Hi,
      Can you please share your temporary admin and FTP access to your stagging site ( not live ) .So that we can debug on your site.

    • #113666
      This reply has been marked as private.
    • #113667
      Anonymous
      Inactive

      Please do not deactivate any plugins or touch the other network sites

    • #113678

      We have checked at our end and we found no issue. So to find the issue we have to debug your site for that we will need the FTP and admin access and during the course we might deactivate few plugin to detect the issue.
      Also, the admin access shared by you is not working. While sharing the access please mark the reply as private.

    • #114128
      Anonymous
      Inactive
      This reply has been marked as private.
    • #114204

      Our team need to debug your site to find and fix the issue. Kindly share the stage FTP , admin and vendor access (staging site). While sharing the access, please mark the reply as private.

    • #114225
      Anonymous
      Inactive

      I can probably make a backup for you.
      But I am unable to create a staging site due to the hosting limitations.

    • #114254

      Kindly share the URL of your site, FTP access and we will be debugging your site to fix the issue.
      Please share the access of the same site of which you have shared the admin access.
      Kindly take a backup of your site since we will be debugging your live site.

    • #114470
      Anonymous
      Inactive
      This reply has been marked as private.
    • #114471
      Anonymous
      Inactive
      This reply has been marked as private.
    • #114532

      The access shared by you is not working.

      Kindly share the URL of your site, FTP access, vendor, admin access and we will be debugging your site to fix the issue.
      Please share the access of the same site of which you have shared the admin, vendor access.

      Kindly take a backup of your site since we will be debugging your live site.

    • #114698
      Anonymous
      Inactive

      The new update has semi-fixed the problem.
      There is an “amount” showing in the refund section.
      The amount is not correct.

      Can you tell me how that number comes up?
      Please see attached screenshot for the Jan Refund.
      The actual refunded orders does not equal to total refund?

    • #114718
      Anonymous
      Inactive

      The gross sales is x2 as much as actual order as well.

    • #114758

      Hello, after hearing from you we did some tests and found the issue at our end. You can track the progress of this issue from here: https://github.com/wcmarketplace/dc-woocommerce-multi-vendor/issues/644

      Regarding the refund order, partial refund is working fine at our end as you can see here https://www.loom.com/share/4f252b8902b74843bf1cc01188d30a23

    • #115216
      Anonymous
      Inactive

      Is there any update as the the fix on the woocommerce report?

    • #115269

      @print88, Our team is working on this. The issue will be fixed in our next update, hopefully within next week.

    • #115589
      Anonymous
      Inactive

      I see that there is an update on the github.
      https://github.com/wcmarketplace/dc-woocommerce-multi-vendor/issues/644

      But does it resolve the problem? How do I implement the codes using code snippets?

    • #115599
    • #116853
      Anonymous
      Inactive

      After the recent update, the SALES are correct and the refund amount is showing.
      However, the REFUND AMOUNT is 2x what it is suppose to be.
      Can you check?

    • #116864

      Hello,

      We have already fix this issue in our updated plugin, kindly update the plugin to our latest version 3.5.18 and check the same.

Viewing 25 reply threads

The topic ‘RE: Refund are not shoing’ is closed to new replies.