Update invoice after editing order
-
Hello,
How to get the latest updated invoice output after editing the order such as changing the item quantity or price or refund?
How can ad some words and auto created current date (like DELIVERY DATE: AUG 7, 2019) at bottom page of Packing Slips?
Please advise. Thanks in advance!
-
Hi! If you change an item quantity or price (before the order is paid), the invoice will be updated automatically. Refunds are separate, as these are post-payment changes, and following GAAP (Generally Accepted Accounting Principles), this should not affect the original invoice, you would need to create a new negative invoice to account for this. That is a feature of our Professional extension, see: Creating a refund/credit note
Adding extra text to the bottom of the packing slip can be done with a code snippet or a custom template in the free version, or with a custom block in the Premium Templates extension.
If you are interested both the Premium Templates and Professional extension, you could also consider the PDF Invoice Bundle which is cheaper than the separate plugins.
Hi,
Thank you for responding.
1) I currently can create a refund on the paid order. I want to provide a modified invoice that has refunded or credit note record with final balance to customer.
How can I do that?2) Can you please provide a code snippet for adding extra text (DELIVERY DATE: AUG 7, 2019) to the bottom of the packing slip ? Also provide Custom Block info in case I can use.
Thanks in advance!
Hi!
With the free version you cannot create the credit note within WooCommerce directly, you need to create this separately (in excel for example) and send it to your customer. For the professional extension you will see the Credit note button for refunded orders.There’s an example code snippet in the documentation that reads the delivery date from a custom field in the order (
delivery_dateor_delivery_datein the example): https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/displaying-a-custom-field/#with-a-template-action-hook
In the Custom block you can use several of the date placeholders like{{order_date}},{{current_date}},{{date_completed}},{{date_paid}}, like so:DELIVERY DATE: {{current_date}}
but also from a custom field if you store that in the order (
delivery_date).DELIVERY DATE: {{delivery_date}}
Please explain again for the following question:
How to get the latest updated invoice output after editing the order such as changing the item quantity or price or refund…for the paid order ?? I guess your plugin uses the same Invoice number but add “a” or “-1” following the original invoice number.
Thanks in advance!
I’m not sure I understand. As I wrote: changing price or quantity will be automatically update in the invoice, refunds are never included in the invoice.
For credit notes in the Professional extension you get an option to either use a separate invoice number sequence or to use the original number sequence (you can add a credit note specific prefix/suffix though).
Hello, Thank you for prompt responding.
I added following code snippet, but the current date does’t printed:
—————————————————–
add_action( ‘wpo_wcpdf_after_order_data’, ‘wpo_wcpdf_delivery_date’, 10, 2 );
function wpo_wcpdf_delivery_date ($template_type, $order) {
if ($template_type == ‘packing-slip’) {
$document = wcpdf_get_document( $template_type, $order );
?>
<tr class=”delivery-date”>
<th>Delivery Date:</th>
<td><?php $document->custom_field(‘delivery_date’); ?></td>
</tr>
<?php
}
}
————————————————————
How can I get the current date printed follow the Delivery date: ?Or, Can I create “delivery_date” on Add New Custom Field, and input date manually in Value to get the date printed?
Thanks in advance!
Hi @cfm168,
The code snippet you’ve sent prints the value of a custom field with the meta key
delivery_dateonly on the packing slip.So make sure you are looking at the packing slip and also make sure the delivery date is stored with the
delivery_datemeta key. If you are having trouble finding it please read this: Finding WooCommerce Custom Fields.You can also manually add a custom field with the
delivery_datemeta key to your order. That should also print the date on your packing slip.-
This reply was modified 6 years, 10 months ago by
kluver.
-
This reply was modified 6 years, 10 months ago by
The topic ‘Update invoice after editing order’ is closed to new replies.