"Pending Payment" orders adding to withdrawable balance

WCMp Core

"Pending Payment" orders adding to withdrawable balance Open

Viewing 19 reply threads
  • Author
    Posts
    • #78672
      admin24
      Participant

      My vendor was confused when the dashboard showed a higher withdrawable balance than expected. Turns out the pending payment orders are adding to this amount even though it is not withdrawable.

      Also, I’ve added some of your code to hide pending payment orders from the vendor. How can the earnings/commission that is greyed out also be hidden? Thank you.

    • #81290
      admin24
      Participant

      Hello, just checking if the team has seen this one. Thank you.

    • #85924
      sumit singh
      Moderator

      Hi, use the following filter to hide the earnings/commission that is greyed out :-

      apply_filters('wcmp_vendor_withdrawal_list_row_data', $row, $commission_id);
      copy
    • #85962
      admin24
      Participant

      Hi, sorry but this is a bug. “Withdrawable” means you can withdraw it. Pending payment is never withdrawable. Thanks

    • #86098
      sumit singh
      Moderator

      Yes, we will soon modify the code as per this. For now, use this code to only show processing and completed payment for withdrawal.

      add_filter('wcmp_widget_vendor_transaction_details_data', 'modify_wcmp_widget_vendor_transaction_details_data');
      function modify_wcmp_widget_vendor_transaction_details_data($final) {
      global $WCMp;
      $vendor = get_wcmp_vendor(get_current_vendor_id());
      $check_caps = true;
      $args = array(
              'meta_query' => array(
                  array(
                      'key' => '_commission_vendor',
                      'value' => absint($vendor->term_id),
                      'compare' => '='
                  ),
              ),
          );
          $default_args = array(
              'post_type' => 'dc_commission',
              'post_status' => array('publish', 'private'),
              'posts_per_page' => -1,
              'fields' => 'ids',
      );
         
          $args = wp_parse_args( $args, $default_args );
         
          if( isset( $args['meta_query'] ) ) {
              $args['meta_query'][] = array(
                  'key' => '_paid_status',
                  'value' => array('unpaid', 'partial_refunded'),
                  'compare' => 'IN'
              );
          } else {
              $args['meta_query'] = array(
                  array(
                      'key' => '_paid_status',
                      'value' => array('unpaid', 'partial_refunded'),
                      'compare' => 'IN'
                  ),
              );
          }
      
          $commissions = new WP_Query( $args );
          if( $commissions->get_posts() ) :
              $commission_amount = $shipping_amount = $tax_amount = $total = 0;
              foreach ( $commissions->get_posts() as $commission_id ) {
              $order_id = get_post_meta( $commission_id, '_commission_order_id', true );
              $order = wc_get_order( $order_id );
              if($order->get_status() == 'processing' || $order->get_status() == 'completed') {
                 $commission_amount += WCMp_Commission::commission_amount_totals( $commission_id, 'edit' );
                 $shipping_amount += WCMp_Commission::commission_shipping_totals( $commission_id, 'edit' );
                 $tax_amount += WCMp_Commission::commission_tax_totals( $commission_id, 'edit' );
             }
              }
              if( $check_caps && $vendor->id ){
                  $amount = array(
                      'commission_amount' => $commission_amount,
                  );
                  if ($WCMp->vendor_caps->vendor_payment_settings('give_shipping') && !get_user_meta($vendor->id, '_vendor_give_shipping', true)) {
                      $amount['shipping_amount'] = $shipping_amount;
                  } else {
                      $amount['shipping_amount'] = 0;
                  }
                  if ($WCMp->vendor_caps->vendor_payment_settings('give_tax') && !get_user_meta($vendor->id, '_vendor_give_tax', true)) {
                      $amount['tax_amount'] = $tax_amount;
                  } else {
                      $amount['tax_amount'] = 0;
                  }
                  $amount['total'] = $amount['commission_amount'] + $amount['shipping_amount'] + $amount['tax_amount'];
                  $final['total_amount'] = $amount['total'];
                  return $final;
              }else{
                  $final['total_amount'] = $commission_amount + $shipping_amount + $tax_amount;
                  return $final;
              }
          endif;
      }
      copy
    • #86621
      admin24
      Participant

      This code breaks the dashboard.

    • #86628

      @admin24, can you share a temporary admin, vendor and FTP access so we can check.

      While sharing the access don’t forget to mark the response as private.

    • #86711
      admin24
      Participant

      As long as this is added to the fix list, I can personally wait for a release. I appreciate the effort but I’m sure there are other things the team can work on. Thank you.

    • #86808
    • #88238
      skempik
      Participant

      Hi, I was wondering if you guys are any further forward with this issue?

      I noticed the github thread has been closed but I am no good with code and cant make much sense of it.

      All i need is for all pending orders to be deducted from the vendors withdraw-able balance or to be cancelled/deleted complately to avoid confusion.

      Thank you in advance I appreciate any help.

    • #88586
      admin24
      Participant

      I don’t understand how this is closed? It is still an issue even in the latest update:

      – Amount still shows in the withdrawable balance for pending payment orders.
      – Pending payment orders are still showing in the payouts list (greyed out).
      – Dashboard widget shows pending payment orders in revenue and unique purchases**
      – Stats/Reports include pending payment orders**

      **These are serious issues. Vendors are doing their taxes now and using reports to justify their earnings, but they’ve not actually earned it all. Please help fix this ASAP.

    • #88637
      tasos
      Participant

      the same here 🙁

      Also for cancelled orders too

    • #88644

      @admin24, @tasos, Our flow will add the pending order under the withdrawal widget. In order to modify this, we have added a filter. Once this filter will be supported, we will share a code to show the order amount for completed and processing orders only.

      You can track the issue here – https://github.com/wcmarketplace/dc-woocommerce-multi-vendor/issues/212

    • #88646
      tasos
      Participant

      At least can we NOT send email to vendors when an order is not processing?

      So if order is:
      cancelled
      pending payment
      failed
      on-hold
      NOT to send email to vendor?

    • #88665
      tasos
      Participant

      Im starting to feel that nothing works as normal.

      Brand new vendor.
      Received 3 cancelled orders
      in his Product Sales Report (/dashboard/) can see Revenue from cancelled orders and Unique Purchases 3 (from cancelled orders too)

      instead of this his /dashboard/banking-overview/ shows the 3 CANCELLED orders as Commission and his Ending Balance instead of zero shows the ammount of comission of the cancelled orders.

      Amazing.

    • #88701
      admin24
      Participant

      Hi,

      What possible situation could there be for pending payment, on hold, and cancelled orders to display as withdrawable and counting in sales/revenue numbers when they are not actually withdrawable/sales/revenue? I still say this is something that is broken. If someone wants non-withdrawable orders to show as withdrawable everywhere, I’d first call them nuts since it defies logic, then I’d say that should be a customization they can make on their own using custom code, not the other way around. Again, this is hugely important since it is tax time and the sales/revenue reports are totally inflated.

      Thank you.

    • #88702
      dekaepta
      Participant

      Just made a clean install locally with only WCMP and woocommerce.

      Indeed it have problems.
      When an order is cancelled you can see in dashboard “Product Sales Report” the product with Revenue Unique Purchases from a cancelled order. THIS IR WRONG.

      In Banking Overview the Initial Balance – Total Credit/Debit – Ending Balance Are Wrong too.

      Stats / Reports Overview is wrong
      Total Sales shows ammount from Cacnelled orders.

      Key Performance Indicators in dashboard are showing WRONG numbers

      one more IMPORTANT thing
      vendor gets EMAIL for Cancelled order

      The only normal thing is in dashboard the main pages “Withdrawable Balance” which is 0.00 now as no order is completed.

      Can you please fix theese asap they are CRITICAL stuff for a multivendor marketplace

    • #89535

      @dekaepta, we have added the fix in our last update.

      Please update and confirm the same.

      • #89669
        admin24
        Participant
        This reply has been marked as private.
    • #89668
      admin24
      Participant

      I updated and only the original post issue is fixed. But the whole thing is not fixed.

      Item added to cart, checkout, then click proceed to payment. In PayPal window, click “Cancel and Return”.

      Returns to Cart but an order and suborder are created, the status of both show as cancelled, but vendor receives email of a new order. Not good.

      No longer does the withdrawable amount increase. Good. But…

      1) The “Product Sales Report” widget increases the revenue and unique purchases. Not good.

      2) The Key Performance Indicators doesn’t increase though, good.

      3) The “Stats/Reports” page increases everything as though there was a sale. Not good. Especially since it’s tax time in the US.

      4) The banking overview shows a strange addition and subtraction. Not sure why that has to happen for an order that never takes place.

    • #89831

      @admin24, thanks for the update.

      We will look into this in our next update.

Viewing 19 reply threads

Please LOGIN to reply to this topic

WCMp bundle is available at a slashed price

Grab It Now