• Resolved roba0665

    (@roba0665)


    Hi,
    As an Australian seller it is a legal requirement that I call these documents a TAX INVOICE (and not INVOICE) can an option be included to allow for the regulatory requirement to be adhered to?

    An Indication of which products are GST taxed and which are not is also required (normally done with a * next to the line item) and then an indication on the invoice of how much GST has been paid.

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hi! There are several ways to rename the document, for both the free version and the Professional extension: Change the document title.

    For specifying the taxes/GST, we have the Premium Templates extension.

    If you are fine with changing the document title with a filter or custom translations then you don’t need the Professional extension, but if you want to do both from the settings I recommend getting the PDF Invoice Bundle instead, as it is cheaper than the separate plugins.

    If you have any follow up questions regarding that document title filter in the free plugin, feel free to reply to this thread. If you want to know more about the extensions, send an email to [email protected] and we’ll do our best to help!

    Thread Starter roba0665

    (@roba0665)

    Shame such a small thing can cause such an issue, I switched to another plugin that allowed me to edit the name of the document without muss or fuss..

    Plugin Contributor Ewout

    (@pomegranate)

    Thanks for the feedback, I’m glad to hear you found an alternative solution!

    Hello @roba0665,

    I have the same problem, can you tell me witch plugin you are using now?

    Plugin Contributor Ewout

    (@pomegranate)

    @losioteddy, did you see the documentation link from the post above? Example: Change “Invoice” to “Tax Invoice”

    Thread Starter roba0665

    (@roba0665)

    “WooCommerce PDF Invoices, Packing Slips, Delivery Notes & Shipping Labels”

    Allowed to simply rename the line Invoice to Tax Invoice, and with come creative thinking allowed the inclusion of the ABN number on the company address information.

    Hi – many thanks for the reply to the OP; I changed the document title from ‘Invoice’ to ‘Order acknowledgement’ very simply with a snippet, using your example from the documentation. However, there are a couple of other places I’d like to change it, though I’m not sure whether they fall within the scope of your plugin . . .
    One is the document title given to the downloaded pdf, which is still ‘invoice-xxxx.pdf, while the other is what’s shown on the user’s account order page, as in https://imgur.com/a/JTCDNyQ.

    Is it possible to change either of those?

    Thanks

    Plugin Contributor Ewout

    (@pomegranate)

    You could do this with a more catch-all approach replacing translations.

    
    add_filter('gettext', 'wpo_wcpdf_translate_invoice', 10, 3 );
    function wpo_wcpdf_translate_invoice( $translation, $text, $domain ) {
        if ( $domain == 'woocommerce-pdf-invoices-packing-slips' ) {
            $translation = str_ireplace('Invoice', 'Tax Invoice', $translation);
        }
        return $translation;
    }
    

    Hope that helps!

    Thank you, as always; that’s worked perfectly for the orders page (as shown in https://imgur.com/a/vMR0TZ3), but doesn’t seem to have affected the download name: https://imgur.com/a/hZkN1S4.

    If this can’t be changed, I won’t lose sleep over it.

    Plugin Contributor Ewout

    (@pomegranate)

    try adding this line to the code I posted in my previous post:

    
    add_filter('ngettext', 'wpo_wcpdf_translate_invoice', 10, 3 );
    

    I’m puzzled (it doesn’t take a lot); that looks like the first line of your initial code anyway, with the addition of ‘n’ in ‘ngettext’. Adding it at the start of your code doesn’t seem to have any effect . . .

    Plugin Contributor Ewout

    (@pomegranate)

    correct, that’s because the gettext filter doesn’t affect plural definitions (the filename can be ‘invoice’ or ‘invoices’ depending on how many invoices are inside. So you end up with both filters using the same function:

    
    add_filter('ngettext', 'wpo_wcpdf_translate_invoice', 10, 3 );
    add_filter('gettext', 'wpo_wcpdf_translate_invoice', 10, 3 );
    function wpo_wcpdf_translate_invoice( $translation, $text, $domain ) {
        if ( $domain == 'woocommerce-pdf-invoices-packing-slips' ) {
            $translation = str_ireplace('Invoice', 'Tax Invoice', $translation);
        }
        return $translation;
    }
    

    OK – that’s explained that, thank you – but does that mean there’s no way to change the download filename shown in https://imgur.com/a/hZkN1S4, as that’s still showing as ‘invoice-xxxx.pdf’?

    Plugin Contributor Ewout

    (@pomegranate)

    yes it should… except that I didn’t realize that the ngettext arguments are slightly different (which does make sense…)
    Apologies for the confusion, this will work:

    
    add_filter('ngettext', 'wpo_wcpdf_translate_invoice', 10, 5 );
    add_filter('gettext', 'wpo_wcpdf_translate_invoice', 10, 3 );
    function wpo_wcpdf_translate_invoice( $translation, $text, $domain_or_single, $plural = null, $domain = null ) {
        if ( $domain == 'woocommerce-pdf-invoices-packing-slips' || $domain_or_single = 'woocommerce-pdf-invoices-packing-slips' ) {
            $translation = str_ireplace('Invoice', 'Tax Invoice', $translation);
        }
        return $translation;
    }
    

    by the way, for finer control over the filenames, there’s also a separate filter: wpo_wcpdf_filename

    Yup – that’s sorted it completely, and thank you for the link to the other filters.

    Unfortunately, I gave you a 5 star rating some months ago for both the plugin and your support, so I can’t do it again – but I would if I could!

    Pete

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Change name of document’ is closed to new replies.