mageprince / magento2-paymentfee

Magento 2 Payment Fee by MagePrince helps admin to set payment fees to charge customers for selecting a specific payment method to complete their order from all available payment methods.
25 stars 19 forks source link

payment fee is always showing excluding tax #5

Closed ioweb-gr closed 4 years ago

ioweb-gr commented 4 years ago

I have set up the module and it seems to calculate the fee correctly however I have an issue with how it's displayed.

In my country when dealing with retail customers we have to show prices including tax however the fee is always showing up without tax. The tax amount is always added as an extra.

For example in checkout I have

Cart Subtotal 32,00 € Shipping Flat Rate - Fixed 5,00 € Payment Fee 3,00 € Tax 7,88 € Order Total Incl. Tax 40,72 € Order Total Excl. Tax 32,84 €

You will notice that the amounts are correct because it's adding 0.72€ to the payment fee however because it's showing without tax the customer is confused. He expects the total to be 32 + 5 + 3 = 40 but he sees 40.72.

Is it possible to add a setting for the display of the fee to show including or excluding tax? Or how can I change the display for it?

mageprince commented 4 years ago

Hi @ioweb-gr The current logic of payment fee will add the extra fee tax into the main tax amount. You can add tax into the payment fee in model Fee.php https://github.com/mageprince/magento2-paymentfee/blob/master/Model/Total/Fee.php

ioweb-gr commented 4 years ago

Hi and thanks for the quick reply @mageprince . I mean that the fee is not taking into account the system settings for prices. I think there should be a condition based on the catalog price settings. If the store is set to input prices including tax, it should work in the reverse way but if it's set to input prices excluding tax it should work like it does right now. It would make the extension much more usable in different use cases.

What do you think?

mageprince commented 4 years ago

@ioweb-gr Thanks for your suggestion. We will add this functionality in the todo list and inform you once available with the future version of the extension.

peter-k77 commented 3 years ago

Except of display issue, there is another issue with missing tax calculation on the invoice. See the example below:

-- ORDER -- Subtotal: $600 (incl. tax) Payment fee: $10 (this is excluding tax - the incorrect behaviour) Tax: $102 (20% tax => $600/1.2.2+$10.2) Grand Total: $612 (incl. tax => $600+$10*1.2)

When you invoice the order, tax on the payment fee is calculated differently: -- INVOICE -- Subtotal: $600 (incl. tax) Payment fee: $10 (tax is now completely forgotten) Tax: $100 (20% tax => $600/1.2*.2; no tax on the payment fee) Grand Total: $610 (mixed tax)

When you look back at the invoiced order: Total Paid: $610 Total Due: $2 (this will stay here forever)

I understand this is free extension, but the tax issue is serious, so I would appreciate if the error is fixed soon. Thanks

mageprince commented 3 years ago

Hi, @peter-k77 Thanks for your feedback. This issue has been resolved in the latest version of the module. Related Commit: https://github.com/mageprince/magento2-paymentfee/commit/bcbe7ff9cadd146d64ea968773f5255b6a222dc7

mageprince commented 3 years ago

Hi @ioweb-gr @peter-k77, thank you for your patience. This is now implemented with the latest version of the module(2.1.0). You can now select text display type (Incl. Tax, Excl Tax, or Both) from the configuration.

ioweb-gr commented 3 years ago

Sorry for the huge delay in responding to this. I was caught up in many things. For me in the latest version it's working great. I was confused at first because the fee value is always added excluding price in the backend, but that's fairly easy to understand.

I would suggest a tooltip maybe could be added?

Index: vendor/mageprince/magento2-paymentfee/etc/adminhtml/system.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/vendor/mageprince/magento2-paymentfee/etc/adminhtml/system.xml b/vendor/mageprince/magento2-paymentfee/etc/adminhtml/system.xml
--- a/vendor/mageprince/magento2-paymentfee/etc/adminhtml/system.xml    (date 1619003871971)
+++ b/vendor/mageprince/magento2-paymentfee/etc/adminhtml/system.xml    (date 1619003871971)
@@ -81,10 +81,11 @@
                     <label>Refund fee</label>
                     <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                 </field>
-                <field id="paymentfee" translate="label" type="text" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
+                <field id="paymentfee" translate="label,tooltip" type="text" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
                     <label>Payment Method Fee</label>
                     <frontend_model>Mageprince\Paymentfee\Block\Adminhtml\System\Form\Field\PaymentFee</frontend_model>
                     <backend_model>Magento\Config\Model\Config\Backend\Serialized\ArraySerialized</backend_model>
+                    <tooltip>Add fee value excluding tax</tooltip>
                 </field>
                 <field id="customers" translate="label" type="multiselect" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="1">
                     <label>Apply Payment Fee For Specific Customers</label>
mageprince commented 3 years ago

Hi @ioweb-gr, Thanks for your suggestion. We will pass to this our developer for review.