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

    (@pomegranate)

    Hi! There is no simple way to autodetect the ‘first’ and ‘second +’ time that the invoice is opened, but you can indeed do this with a custom field.
    Open the order details, then scroll down, create a new custom field called ‘Stamp’. Enter ‘ORIGINAL’

    Whenever you want it to say “COPY”, simply change the ‘Stamp’ field.

    To display this in the invoice, add this to your theme functions / functions.php (read this if you don’t know how)

    add_action( 'wpo_wcpdf_after_document_label', 'wpo_wcpdf_original_copy', 10, 2 );
    function wpo_wcpdf_original_copy ($template_type, $order) {
        global $wpo_wcpdf;
        if ($template_type == 'invoice') {
            ?>
            <h2><?php $wpo_wcpdf->custom_field('Stamp'); ?></h2>
            <?php
        }
    }

    That’s quite a manual approach though, I’m sorry I don’t have any better solution ??

    Regarding the taxes – that’s a feature of the Premium Templates extension!

    Hope that helps!
    Ewout

    Thread Starter Anonymous User 14957226

    (@anonymized-14957226)

    Hi!
    Thanks for the replay, there is a way to fixed the custom Stamp field? and if I want to change to Copy I will.

    Thanks.

    Plugin Contributor Ewout

    (@pomegranate)

    Hi!
    If you want to display ‘ORIGINAL’ by default and only ‘COPY’ when you’ve entered the Stamp field, you can use this code:

    add_action( 'wpo_wcpdf_after_document_label', 'wpo_wcpdf_original_copy', 10, 2 );
    function wpo_wcpdf_original_copy ($template_type, $order) {
        global $wpo_wcpdf;
        if ($template_type == 'invoice') {
        	$stamp = get_post_meta( $order->id, 'Stamp', true );
        	$stamp = empty($stamp) ? "ORIGINAL" : $stamp;
            echo "<h1>{$stamp}</h1>";
        }
    }

    Good luck & happy selling!
    Ewout

    Thread Starter Anonymous User 14957226

    (@anonymized-14957226)

    Thanks! it’s work great!
    This is possible to just add the line that says “Tax 17%” without the calculate?

    Also (I don’t know if this is available in the premium) print all the invoice for last month at once?

    Thanks.

    Plugin Contributor Ewout

    (@pomegranate)

    Hi! With the Premium templates extension you can add the tax line (rate & amount) to the totals. What do you mean ‘without the calculate’?

    There is currently no option to bulk print invoices for a predefined date range, only the bulk export by selecting the orders and then choose ‘PDF invoices’ in the dropdown (top left).

    Ewout

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Custome fields or *original* stamp’ is closed to new replies.