Support » Plugin: One Stop Shop for WooCommerce » Refunds handling

  • Resolved danielvonmitschke

    (@danielvonmitschke)


    Hi,

    I am wondering how refunds are taken into account with your plugin.
    Let’s say I create a monthly report for January and all the orders that where paid in January are included in this report.
    Then in February an order is being returned and a refund is created for this order (obviously including VAT).
    In the upcoming February report this is not included because you do not include refunds in the wc_get_orders() function args.
    And the January report has already been submitted, so it’s no included there either.

    The same problem seems to exist for on-hold orders (e.g. BACS payment).
    As they are included in the report but mostly are not paid for yet (that’s why they are on hold) the report seems to be wrong as well for these order statuses?

    Thank you,

    d.

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

    (@vendidero)

    Hi there,

    the refunded tax amount is being removed from the report: https://github.com/vendidero/one-stop-shop-woocommerce/blob/main/src/AsyncReportGenerator.php#L157

    In case a refund is created within the next month a correction for the last month would be necessary (new report).

    On-hold orders are not included within the report (only order statuses that WooCommerce treats as paid statuses are included).

    Cheers

    Thread Starter danielvonmitschke

    (@danielvonmitschke)

    Hi, thank you for the answer.
    Regarding the refunds I think this is not quite the best way to handle it.
    Why not just handle the refunds separately the dates they are created at?

    Best,
    d.

    Plugin Author vendidero

    (@vendidero)

    Hi there,

    It’s not that easy. Refund orders do not include as much data (e.g. billing details such as country, address etc.) as normal orders do. They depend on their parent order. The plugin is open to contribution though in case you can come up with a better solution: https://github.com/vendidero/one-stop-shop-woocommerce

    Cheers

    Thread Starter danielvonmitschke

    (@danielvonmitschke)

    Again, thanks for the answer, but actually it is not very complicated to access the original order of a refund which will provide all the information necessary.

    I would love to contribute, but tried to use this for a very old WC version (2.9) and of course it won’t work with it.
    So I have to write my own plugin.

    Plugin Author vendidero

    (@vendidero)

    Hi,

    no, it’s not complicated but the parent order data may change (after creating a refund), e.g. the address data, total data etc. may be adjusted without the refund knowing. Furthermore the whole order query used to find orders by their taxable country (https://github.com/vendidero/one-stop-shop-woocommerce/blob/main/src/Package.php#L498) would break because a separate join would be necessary to retrieve the refund’s parent data.

    Cheers

    Thread Starter danielvonmitschke

    (@danielvonmitschke)

    The problem with changed order data is the same the way refunds are handled right now.

    I just think it is not easy (from a user point of view) to keep track of refunds and which reports might have to be submitted again.

    Plugin Author vendidero

    (@vendidero)

    No, it is not the same. Right now orders (and their related refunds) are booked at the same time. In case a refund is booked (e.g. one month) later, the actual order has been booked for the previous report and the refund may be booked to a different country (as the order has changed meanwhile) in comparison to the related order.

    But yes, we’ll investigate whether better solutions exist here. Technically it is not quite easy as our setup quite heavily relies on the order query functionality which does, by default, not support joining refunds with their corresponding parent to retrieve additional data (e.g. billing_country).

    Cheers

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.