• Resolved centuryperf

    (@centuryperf)


    What could cause this error when trying to print or save an invoice? It only appears on (so far one) random invoice. All other invoices work fine.

    Fatal error: Call to a member function get_reason() on int

    /public_html/wp-content/plugins/woocommerce/includes/class-wc-order.php (2377)

    #0 /public_html/wp-content/plugins/woocommerce/includes/class-wc-order.php(2412): WC_Order->add_order_item_totals_refund_rows()

    #1 /public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/Documents/OrderDocumentMethods.php(948): WC_Order->get_order_item_totals()

    #2 /public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/templates/Simple/invoice.php(162): WPO\IPS\Documents\OrderDocumentMethods->get_woocommerce_totals()

    #3 /public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/Documents/OrderDocument.php(1754): include('/home/1102925.c...')

    #4 /public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/Documents/OrderDocument.php(1610): WPO\IPS\Documents\OrderDocument->render_template()

    #5 /public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/Documents/OrderDocument.php(1567): WPO\IPS\Documents\OrderDocument->get_html()

    #6 /public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/Documents/OrderDocument.php(1634): WPO\IPS\Documents\OrderDocument->get_pdf()

    #7 /public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/Main.php(517): WPO\IPS\Documents\OrderDocument->output_pdf()

    #8 /public_html/wp-includes/class-wp-hook.php(324): WPO\IPS\Main->generate_document_ajax()

    #9 /public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()

    #10 /public_html/wp-includes/plugin.php(517): WP_Hook->do_action()

    #11 /public_html/wp-admin/admin-ajax.php(192): do_action()

    #12 {main}
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor alexmigf

    (@alexmigf)

    Hi @centuryperf

    This error might be caused by malformed refund data. Does the order include any refunds?

    Plugin Contributor alexmigf

    (@alexmigf)

    Are you using Object Cache Pro plugin?

    Hi, I’m getting the same error. We’re using Object Cache pro, disabling it, removes the error and the PDF now loads, but none of the refunds are showing on the invoice?

    Plugin Contributor alexmigf

    (@alexmigf)

    @omnisity

    Regarding the Object Cache Pro issue, there’s nothing we can do on our end. We already recommend that customers reach out to their support directly to resolve it, so you might consider doing the same.
    As for the refunds not displaying, this also doesn’t appear to be caused by our plugin, since we don’t modify the order data in any way. It could potentially be related to the other plugin as well.

    Thanks for the info, we’ll reach out to the host, it only effects orders that have refunds applied. I’ve attached some images, showing the refund amount and the invoice (which doesn’t show the new amount)?
    https://ibb.co/SDj9Pt71

    https://ibb.co/vvmt9k4Z

    Plugin Contributor alexmigf

    (@alexmigf)

    @omnisity

    Please note, we follow GAAP (Generally Accepted Accounting Principles) which means that administrative changes should be documented separately. This means that an original invoice should never be modified by a refund. In most countries (at least in the EU) this is even considered fraudulent (and illegal). We have chosen to follow this in both the free and the paid extension.

    I explain this to clarify that if you make a partial or full refund for an order, the invoice will not be affected, but you need to create a credit note for that.

    We support Credit Notes in our Professional extension.

    Thanks for clarifying, we’ll pass on this info to our client!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Random Fatal Error’ is closed to new replies.