• Resolved hempion1

    (@hempion1)


    Hallo!

    Ich nutze euer Plugin und wollte habe Schwierigkeiten mit der Kompatibilität mit dem Plugin “PDF Invoices and Packing Slips” von WP Overnight.
    (https://de.wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/)

    Im konkreten geht es um die Steuerberechnung der Versandkosten bei Warenkörben mit gemischten Steuersätzen, die über euer Plugin anteilsmäßig berechnet werden können (https://vendidero.de/dokument/steuerberechnung-fuer-versandkosten-und-gebuehren).

    PDF Invoices hat eine Funktion, bei der die “Steuerbasis”, also die zu Grunde liegende Netto Summe, die für die Steuerberechnung verwendet wird, auf der PDF Rechnung anzeigen lässt. Dies ist für die Buchhaltung in einem Unternehmen eine große Erleichtungerung – daher nutze auch ich diese Funktion.
    Das Problem ist nur, dass PDF Invoices die besondere Funktion der Steuerberechung bei gemischten Warenkörben nicht kennt und deshalb die Netto Steuer-Basis auf der Rechnung in diesen Fällen falsch angezeigt wird.
    Unter diesem Link könnt ihr ein Beispiel der inkorrekten Berechnung sehen:
    https://drive.google.com/file/d/17Swj0f8mGGBpzvBiWLWDvOzBqhlULqBS/view?usp=sharing
    Ich habe mit dem Plugin Autor von PDF Invoices gesprochen und gefragt, ob er das Problem selbst lösen kann. Er hat mir folgende Antwort gegeben:

    “There isn’t really a way to show the tax base reliably for the Germanized calculations. In my opinion, Germanized should create separate shipping lines (one for each tax rate), or at the very least store the tax base. Just like they show it in their documentation (https://vendidero.de/dokument/steuerberechnung-fuer-versandkosten-und-gebuehren).
    Perhaps they do store the calculation base somewhere, or perhaps they internally store custom items that make up the single shipping item and we could retrieve the data that way.”

    Daher meine Frage:
    Speichert euer Plugin die Berechnungs-Werte für die anteilmäßigen Steuern von Versandkosten irgendwo ab, damit das Plugin PDF Invoices diese Daten abrufen kann und es somit kompartibel ist?

    Vielen Dank für eure Hilfe.

Viewing 15 replies - 1 through 15 (of 17 total)
  • Plugin Author vendidero

    (@vendidero)

    Hi,

    also Germanized arbeitet hier standardkompatibel, d.h. die Steuern für die Versandkosten werden berechnet und in der Bestellung gespeichert (samt der verschiedenen Steuersätze). WooCommerce sieht durchaus vor, dass auch mehrere verschiedene Steuersätze für einer Zeile (in diesem Fall für die Versandkosten) hinterlegt werden können. Die Steueranteile können z.B. via https://github.com/vendidero/woocommerce-germanized/blob/master/includes/admin/class-wc-gzd-admin-order.php#L138
    abgerufen werden. In Germanized Pro ist das in der Rechnungslegung bereits vorgesehen.

    Grüße

    Thread Starter hempion1

    (@hempion1)

    Hallo,

    danke für die Erklärung und die Hilfestellung.
    Ich werde das zusammen mit dem Plugin Autor analysieren und ggf. nochmals auch euch zukommen.

    Grüße

    Ewout

    (@pomegranate)

    @vendidero thanks for responding. I am the plugin author of WooCommerce PDF Invoices & Packing Slips.

    You are referring to the tax amounts and tax rates, but the issue (and non-compliance) is not with that data, but the fact that you are using compound tax rates based on a partial excluding-tax amount that is not stored anywhere in the order data (the code you are linking to is the function responsible for calculating the tax amounts, but do you also have a function for retrieving the ex-tax amounts for each rate?)

    Taking the example from your documentation:
    https://vendidero.de/dokument/steuerberechnung-fuer-versandkosten-und-gebuehren

    The resulting line item in the order data only contains the ex-tax amount (€4,40) and the two tax amounts plus rates (€0,14 / 7% and €0,45 / 19%). But the ex-tax amounts that below to those taxes (€1,99 / €2,41) are not stored in the order data anywhere. This is the “Tax base” that @hempion1 is referring to in their question.
    The WooCommerce “standard” that I am referring to (e.g. how WooCommerce applies multiple compounding rates normally) is that the tax is normally always calculated from the entire ex-tax amount of the line item.So in the example of a 7% and 19% rate applied to a €4,40 price, it would result in 4.40 * 7% = €0.308 plus 4.40 * 19% = €0.836 and an including tax total of €5.544.
    I fully understand that’s not how the split taxes works fiscally, but in your current implementation, the order ends up with data missing to verify the calculation. To comply with the WooCommerce ‘standard’, you should store the tax rates and amounts as separate line items (since they are not true compounding taxes) so that all data is present and all regular tax calculations can be applied. Taking the same example: instead of one line 4.40 + 0.14 + 0.45, you would end up with two lines 1.99 + 0.14 / 2.41 + 0.45. Then all the data is there and if you still want to present this as one single line to the customer you can simply add the data.

    Calculating backwards from the percentage and tax amount is not an option, taking rounding settings into account and also defeats the point of storing the taxes amounts in the first place (after all, you could calculate everything, theoretically).

    Plugin Author vendidero

    (@vendidero)

    Hi @pomegranate,

    these split taxes are not compound taxes as compound taxes are applied one after another and split taxes are applied at once by splitting up the total amount into separate pieces. We will see if there is a way to include the tax base amounts in order item meta for further compatibility in a future release. Adding separate shipping line items is not a very good solution in my opinion as this would introduce many new issues (e.g. compatibility issues with fee and shipping plugins).

    Cheers

    Ewout

    (@pomegranate)

    these split taxes are not compound taxes as compound taxes are applied one after another and split taxes are applied at once by splitting up the total amount into separate pieces.

    Exactly, this is what I was referring to and where your implementation is diverging from the WooCommerce “standards”.

    compatibility issues with fee and shipping plugins

    Could you elaborate on this? WooCommerce already offers adding multiple shipping lines per order out of the box. In my opinion this is the solution that offers the most all-round compatibility because it doesn’t require any third party to read plugin specific item meta.

    • This reply was modified 2 years, 9 months ago by Ewout.
    Plugin Author vendidero

    (@vendidero)

    Hi there,

    Exactly, this is what I was referring to and where your implementation is diverging from the WooCommerce “standards”.

    Woo does support multiple tax rates/amounts per item that’s why I guess it is not against the standard. Woo does not offer to store a tax base amount in a standard-compliant way though.

    Could you elaborate on this? WooCommerce offers multiple shipping methods out of the box.

    Of course they do. But none of the typical (table rate) shipping plugins expects a shipping rate to be split into two order items which will lead to display problems and confusion for the end-customer (order emails for example) and may lead to (re-) calculation bugs on the admin side.

    Cheers

    Ewout

    (@pomegranate)

    Woo does support multiple tax rates/amounts per item that’s why I guess it is not against the standard.

    If you add 2 tax rates to a line item and let WooCommerce calculate the taxes, it will use the entire ex-tax amount to calculate the amount:

    • If the tax rate is set to compound, it will calculate the second tax amount on top of the first (so 5.00 => 20% = 1.00 (subtotal 6.00) => 10% = 0.60 => total = 6.60)
    • If the tax rate is NOT set to compound, it will calculate them separately ( 5.00 => 20% = 1.00 and 10% = 0.50 => total = 6.50).

    In both cases all the data to verify the calculations is present in the line items.
    Your plugin does custom calculations to override this behavior and the data it uses to make these calculations is not stored.

    Plugin Author vendidero

    (@vendidero)

    Yep, of course we do but there is no way around it as taxation rules are a little special in Germany. I’ve added a commit which adds _split_tax as custom meta data to the shipping item including all the data necessary to reproduce the calculation. See: https://github.com/vendidero/woocommerce-germanized/commit/83009f0e269e5bb42ba16313f3d15ce4c95dc3e0

    Unfortunately Woo does not use separate tax items for different item types (e.g. shipping, fee, line items) (yet) which would give us much more freedom and compatibility options here.

    Cheers

    Ewout

    (@pomegranate)

    Excellent, that certainly helps! Just to confirm: this is under the assumption that a single tax class would never have more than one rate, correct? (Because that’s actually how you normally setup multiple rates for a product in the first place: a single tax class with multiple rates, with distinctive priorities).
    I’m asking because you’re storing the share and taxable amount per tax-class rather than per rate (ID).

    Plugin Author vendidero

    (@vendidero)

    Hi,

    yep, that’s right. Split taxes are calculated on a per-tax-class base. I’ve added the tax rate ids to the meta data for convenience: https://github.com/vendidero/woocommerce-germanized/commit/906c440322445a35fffe09a0c221d3c44128da77

    Cheers

    Ewout

    (@pomegranate)

    @vendidero excellent, I can definitely work with that. Thank you so much for the swift action and providing this data!

    Plugin Author vendidero

    (@vendidero)

    @pomegranate sounds good! Thanks for reporting!

    Thread Starter hempion1

    (@hempion1)

    Hello!

    Thank you so much for your effort and trying to find a solution so quickly!

    @pomegranate already provided a new version which I will to test together with the updated version of Germanized.

    Unfortunaltely installingthe new version 3.5.0 for Germanized resulted in a fatal error due to the OSS Section tab added in the new version and the get_settings_for_section funtion (Error: Call to undefined method WC_GZD_Settings_Germanized::get_settings_for_section() ).

    @vendidero could you please fix this error so that I can go on with testing?
    Thank you!

    Plugin Author vendidero

    (@vendidero)

    Hi @hempion1,

    yep, that’s due to our WC beta testing. Will fix that within the next commit. Please be careful when using the master/main branch which is not safe for production.

    Cheers

    Thread Starter hempion1

    (@hempion1)

    Thanks for the advice.
    Would be nice to comment here when the next commit is done.
    Or is there another way to test your latest update?

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Kompatibilität mit PDF Invoice Plugin von WP Overnight’ is closed to new replies.