How to make WCMP GST Ready?

WCMp Core

How to make WCMP GST Ready? Open

Viewing 26 reply threads
  • Author
    Posts
    • #66418
      Priyank Pandey
      Participant

      As Indian Tax Regulation, we need to collect and submit GST on every sale and margin collected to the Government.
      Just want to confirm, how to achieve this GST flow:

      For example:

      Step 1: If a vendor submits a product of price ₹500 to the WC marketplace then GST will be applied of 5%. After the GST the product will be available at ₹500+5% of 500 = ₹525 to the customers. (Everything is fine for this step.)

      Step 2: If a customer orders the same product then e-commerce operator collects the ₹525 from the customer and deduct the margin of 10% from that amount that is ₹50. (This step is also fine.)

      Step 3: Then again 18% GST will be applied on the margin deducted that means 18% of ₹50 = ₹9. It means eCommerce operator will deduct ₹50 (10% margin on the product price) + ₹9 (GST on the 10% margin collected). (I can not achieve this step.)

      Step 4: The eCommerce operator also needs to deduct 2% of the product price as a Tax Collection at Source (TCS). It means the eCommerce operator will deduct 2% of ₹500 = ₹10 from the amount he collected from the customer. (I can not achieve this step also.)

      In short: The eCommerce operator needs to deduct 18% on the margin amount and 2% on the product price from the vendor. It means the total amount vendor will get after GST and TCS deduction is as follows: ₹525-₹50(10% margin)-₹9(18% GST on ₹50 margin)-₹10(2% TCS on product price)= ₹456.

      But WCMP only deducts the percentage margin from the sale. Please help as the current tax flow is necessary if we want to run the E-commerce marketplace in India.

      Thanks.

    • #66428

      @Priyank Pandey, Currently, the tax flow gets carried out by WooCommerce. Hence, the tax will only be calculated on the product price.
      This document will be able to help you out further – https://docs.woocommerce.com/document/setting-up-taxes-in-woocommerce/

      Now, depending on the “Tax” option set via WCMp >> Settings >> Payment, either vendor will receive the full ta amount calculated on the product, or admin will get the amount.

      Now the flow you need requires a good amount of custom code.

      If you need a reference of the procedure you need to follow for this, let us know.

    • #66430
      Priyank Pandey
      Participant

      Yes Moumita, please let me know the procedure to achieve the flow I discussed above.

    • #66541
      Priyank Pandey
      Participant

      Hi, please help.

    • #66674
      Priyank Pandey
      Participant

      Hi, any reference or solution? It’s urgent.

    • #66675

      @Priyank Pandey, let me get in touch with my team regarding this, so I can help you out accordingly.

    • #66678
      Priyank Pandey
      Participant

      Ok sure take your time Moumita. Thank you so much!

    • #66723

      @Priyank Pandey, As I can understand you need to add addition tab in the add product page, that will be added as tax.

      Kindly follow this link for further help – https://wc-marketplace.com/tech-blog/vendor-per-product-tax/

      Now, as in the above code, we have removed, admin’s tax settings from those products, so you have to do further modification and add admin’s tax also.

      Now using this filter you have to modifiy the commission total that vendor and admin will earn –

      apply_filters('vendor_commission_amount', $amount, $product_id, $variation_id, $item, $order_id, $item_id)
      Copy

      Let us know if you need any further help.

    • #66730
      Priyank Pandey
      Participant

      Hi Moumita,

      I have already defined the different tax classes for different products. (Attaching the screenshot).

      I need help after customer purchases a product and the sale amount is added to the vendor’s account after the commission deduction by the admin.

      For example, if admin is deducting 10% commission on Rs. 500 product then admin will earn Rs. 50 commission on that sale. So as per the rules, the admin must have to deduct 18% tax on the Rs. 50 commission amount also i.e Rs.9. And also admin needs to deduct 2% tax on the product value that is 2% of Rs. 500 i.e. Rs. 10.

      After this tax deduction vendor will get Rs.500- Rs.50 (Admin Commission)- Rs.9 (18% tax on admin commission)- Rs.10 (2% tax on product value) = Rs. 431

      On the other hand, if the admin will not deduct the 18% tax on admin commission and 2% tax on the product value, the vendor will get Rs.500- Rs.50 (10% admin commission)= Rs. 450

      I hope you are getting my point.

      In short, I need to collect tax on the amount added on the vendor’s dashboard.

    • #66732
      Priyank Pandey
      Participant

      For your reference, to know how GST flow will work you can follow this video: https://www.youtube.com/watch?v=Rr5GJBmenB0

    • #66743

      Hi @Priyank Pandey, as you need this flow i.e.

      After this tax deduction vendor will get Rs.500- Rs.50 (Admin Commission)- Rs.9 (18% tax on admin commission)- Rs.10 (2% tax on product value) = Rs. 431
      Copy

      , hence you have to use this filter –

      apply_filters('vendor_commission_amount', $amount, $product_id, $variation_id, $item, $order_id, $item_id)
      Copy

      Hence, you need to fetch the

      product_id
      Copy

      from

      order_id
      Copy

      and modify the commission amount as per your need.

      Let us know if you have any further query.

    • #66744
      Priyank Pandey
      Participant

      Hi Moumita,

      I don’t have any experience in PHP coding. I mean how to and where to put that code? In Functions.php or where?

      Am I meant to use the code as is? Or does it need some edits before it will fulfill its desired function? If I need to change it a bit could I perhaps get some help with that?

    • #66861

      Priyank, we have just shared you the filter’s name and now you have to use them to add your own custom code.

      However, I am afraid we don’t have any readymade code for this. Hence you have to develop this module on your end or you may hire any developers.

      If they need any help from us regarding the coding procedure, let us know.

    • #67162
      Priyank Pandey
      Participant

      Hi,
      I’ve tried to add the code to functions.php but the site got crashed. I hope you will add this function to the next plugin update. Thanks for your help! Keep up the good work!

    • #67165

      @Priyank Pandey, can you please let us know what code you have added, so we can help you accordingly.

    • #67260
      Priyank Pandey
      Participant

      Hi Moumita,

      Actually, I tried following this https://code.tutsplus.com/tutorials/adding-custom-hooks-in-wordpress-custom-filters–cms-26508 and this https://code.tutsplus.com/tutorials/adding-custom-hooks-in-wordpress-custom-actions–cms-26454

      Created some code but deleted because of some internal error in the server. I didn’t save the code so I can not provide the same. Actually, I have no experience in coding so it is fine.

      You guys are doing great work keep it up.

    • #67261
      Priyank Pandey
      Participant

      Without this feature, I can not run a marketplace. I hope you will add this feature in future updates.

    • #67313

      @Priyank Pandey, our team will check on how you can achive this flow.

      I will keep you posted.

    • #67316
      Priyank Pandey
      Participant

      Thanks, Moumita. You are Love!

    • #67585

      Priyank, can you please confirm whether this is you are looking for :
      Vendor’s commission value = Product price – Admin commission – GST (will be calculated on the admin’s commission/vendor’s commission amount?) – TCS (will be calculated on the product price)

    • #67607
      Priyank Pandey
      Participant

      Yes, Moumita, I’m looking for :
      Vendor’s commission value = (Product price+GST Tax Collected On Purchase of the Product) – Admin commission – GST (will be calculated on the admin’s commission amount) – TCS (will be calculated on the product price)

      Also, let me know how to display the same on the vendor and admin dashboards and email templates.

    • #67609

      Hi @Priyank Pandey, our dev team will look into this.

      If needed we will share a coding documentaion on this.

      Kindly provide us some time.

    • #67610
      Priyank Pandey
      Participant

      Thanks for your help Moumita, much appreciated.

    • #67856

      Please add this code to the function.php of the current active theme to achive this tax flow :

      <?php
      function apply_item_gst_on_vendor_commission_amount( $amount, $product_id, $variation_id, $item, $order_id ) {
          if ( $amount ) {
              $tax_class = $item->get_tax_class(); // item tax class for ex. 18 ( 18% GST )
              $item_total = $item->get_subtotal();
              $admin_commission = $item_total - $amount; // where $amount is vendor commission
              $gst_on_admin_commission = $tcs = 0;
              if ( $tax_class == '18' ) {
                  // if item tax (GST) is 18% and admin want to deduct 18% tax on admin commission
                  $gst_on_admin_commission = ( 18 * $admin_commission ) / 100; // lets assume $admin_commission = 50, So, value will be 9
                  //if admin want to deduct 2% tax on product value
                  $tcs = ( 2 * $item_total ) / 100; // lets assume $item_total = 500, So, value will be 10
              }
              // do your calculations for rest of GST taxes
              return ( $amount - $gst_on_admin_commission - $tcs );
          }
          return $amount;
      }
      add_filter( 'vendor_commission_amount', 'apply_item_gst_on_vendor_commission_amount', 99, 5 );
      ?>
      Copy
    • #67871
      Priyank Pandey
      Participant

      Hi Moumita, thanks for the code. Here is the code I entered in child Functions.php file:

      /**
       GST Flow
       */
      
      function apply_item_gst_on_vendor_commission_amount( $amount, $product_id, $variation_id, $item, $order_id ) {
          if ( $amount ) {
              $tax_class = $item->get_tax_class(); // item tax class for ex. 18 ( 18% GST )
              $item_total = $item->get_subtotal();
              $admin_commission = $item_total - $amount; // where $amount is vendor commission
              $gst_on_admin_commission = $tcs = 0;
              if ( $tax_class == '18' ) {
                  // if item tax (GST) is 18% and admin want to deduct 18% tax on admin commission
                  $gst_on_admin_commission = ( 18 * $admin_commission ) / 100; // lets assume $admin_commission = 50, So, value will be 9
                  //if admin want to deduct 2% tax on product value
                  $tcs = ( 1 * $item_total ) / 100; // lets assume $item_total = 500, So, value will be 5
              }
              // do your calculations for rest of GST taxes
              return ( $amount - $gst_on_admin_commission - $tcs );
          }
          return $amount;
      }
      add_filter( 'vendor_commission_amount', 'apply_item_gst_on_vendor_commission_amount', 99, 5 );
      Copy

      But there is no change in the commission calculation.

      If this GST flow works vendor should get (Rs.500 + Rs.25) {$item_total}- Rs.50 {$amount} – Rs.9 {$gst_on_admin_commission} – Rs.5 {$tcs}= Rs. 461

      But even after entering this code, the amount in the withdrawal amount in the vendor dashboard is showing Rs. 462.50.

      Please help!

    • #67873
      Priyank Pandey
      Participant

      Sorry, I forgot to add all tax classes in the code. That is why I was getting the error in calculation. Here’s the perfect code:

      /**
       GST Flow
       */
      
      function apply_item_gst_on_vendor_commission_amount( $amount, $product_id, $variation_id, $item, $order_id ) {
          if ( $amount ) {
              $tax_class = $item->get_tax_class(); // item tax class for ex. 18 ( 18% GST )
              $item_total = $item->get_subtotal();
              $admin_commission = $item_total - $amount; // where $amount is vendor commission
              $gst_on_admin_commission = $tcs = 0;
              if ( $tax_class == '3' ) {
                  // if item tax (GST) is 3% and admin want to deduct 18% tax on admin commission
                  $gst_on_admin_commission = ( 18 * $admin_commission ) / 100; // lets assume $admin_commission = 50, So, value will be 9
                  //if admin want to deduct 2% tax on product value
                  $tcs = ( 1 * $item_total ) / 100; // lets assume $item_total = 500, So, value will be 5
              }
              if ( $tax_class == '5' ) {
                  // if item tax (GST) is 5% and admin want to deduct 18% tax on admin commission
                  $gst_on_admin_commission = ( 18 * $admin_commission ) / 100; // lets assume $admin_commission = 50, So, value will be 9
                  //if admin want to deduct 2% tax on product value
                  $tcs = ( 1 * $item_total ) / 100; // lets assume $item_total = 500, So, value will be 5
              }
              if ( $tax_class == '12' ) {
                  // if item tax (GST) is 12% and admin want to deduct 18% tax on admin commission
                  $gst_on_admin_commission = ( 18 * $admin_commission ) / 100; // lets assume $admin_commission = 50, So, value will be 9
                  //if admin want to deduct 2% tax on product value
                  $tcs = ( 1 * $item_total ) / 100; // lets assume $item_total = 500, So, value will be 5
              }
              if ( $tax_class == '18' ) {
                  // if item tax (GST) is 18% and admin want to deduct 18% tax on admin commission
                  $gst_on_admin_commission = ( 18 * $admin_commission ) / 100; // lets assume $admin_commission = 50, So, value will be 9
                  //if admin want to deduct 2% tax on product value
                  $tcs = ( 1 * $item_total ) / 100; // lets assume $item_total = 500, So, value will be 5
              }
              if ( $tax_class == '28' ) {
                  // if item tax (GST) is 28% and admin want to deduct 18% tax on admin commission
                  $gst_on_admin_commission = ( 18 * $admin_commission ) / 100; // lets assume $admin_commission = 50, So, value will be 9
                  //if admin want to deduct 2% tax on product value
                  $tcs = ( 1 * $item_total ) / 100; // lets assume $item_total = 500, So, value will be 5
              }
              // do your calculations for rest of GST taxes
              return ( $amount - $gst_on_admin_commission - $tcs );
          }
          return $amount;
      }
      add_filter( 'vendor_commission_amount', 'apply_item_gst_on_vendor_commission_amount', 99, 5 );
      Copy
    • #67874
      Priyank Pandey
      Participant

      The only error is in the calculation I’m getting is this: https://wc-marketplace.com/support-forum/topic/error-in-tax-calculation-after-order-is-placed/

      WCMp is only displaying half of the tax. As I described in the above link.

      Also, let me know how to display the same in the vendor and admin dashboard and email templates.

Viewing 26 reply threads

Please LOGIN to reply to this topic

COVID-19 Outbreak: WCMp team is supporting business affected by coronavirus

Read the Message Buy at Slashed Price