• Resolved Andrea

    (@licoreo)


    hi,
    i need to disable automatic creation of bill when the order is payed, is possible?

    thank you
    Andrea

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Contributor alexmigf

    (@alexmigf)

    Hello @licoreo

    Please try this:

    add_filter('wpo_wcpdf_document_is_allowed', 'wcpdf_disallow_invoice_order_is_paid', 10, 2);
    function wcpdf_disallow_invoice_order_is_paid( $allowed, $document )
    {
    	$order = $document->order;
    	if ( !empty($order) && $document->get_type() == 'invoice' ) {
    		if( $order->is_paid() ) {
    			$allowed = false;
    		}
    	}
    	return $allowed;
    }

    If you never used actions/filters please read this documentation.

    Thread Starter Andrea

    (@licoreo)

    thank you for the answert
    i think that there is a problem, all previuos invoice are hidden, and this is bad

    i don’t want an automatic invoice generation on payment status, but i need to create invoice manually

    • This reply was modified 4 years, 10 months ago by Andrea.
    Plugin Contributor alexmigf

    (@alexmigf)

    Hello @licoreo

    I’m not quite understanding what you are trying to saying. The code above just disable invoice creation if the order is paid.

    Anyway, if you detach the invoice document from “Completed” order status under PDF Invoices > Documents > Invoice, shouldn’t create invoice automatically.

    Thread Starter Andrea

    (@licoreo)

    Actualy when an order is paid, the WooCommerce PDF Invoices & Packing Slips plugin automatically creates an invoice.

    What I would like to do is to disable this function and manually create the invoice by going to the order details and clicking on ‘generate invoice’.

    Is this possible?

    Plugin Contributor alexmigf

    (@alexmigf)

    Hi @licoreo

    Like i said before, you must disable here: PDF Invoices > Documents > Invoice

    Captura-de-ecra-2020-04-29-a-s-17-13-38

    Thread Starter Andrea

    (@licoreo)

    if i disabled invoice i can’t create invoice manually

    Plugin Contributor alexmigf

    (@alexmigf)

    Hi @licoreo

    I’m not telling you to disable the invoice, just the “Attach to” option.

    Thread Starter Andrea

    (@licoreo)

    every checkbox in “attach to” are unchecked

    • This reply was modified 4 years, 10 months ago by Andrea.
    Plugin Contributor alexmigf

    (@alexmigf)

    Hi @licoreo

    Good, now if you receive a new order the plugin shouldn’t create the document automatically. Please confirm.

    Thread Starter Andrea

    (@licoreo)

    the plugin stille create document automatically

    can you suggest me a soluzion?

    thank you

    Plugin Contributor alexmigf

    (@alexmigf)

    Hello @licoreo

    Please send us an email, i will try to help you with that.

    Plugin Contributor Ewout

    (@pomegranate)

    This turned out to be caused by WooCommerce P.IVA e Codice Fiscale per Italia PRO, which was automatically generating the invoice when the order was completed.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘disable automatic creation of bill’ is closed to new replies.