We’ve just had an export order come in where the logistics service has requested the invoice contains at the end the total volume of litres in the shipment. I’m not sure why they need this, but would it be possible to implement this?
Thanks for the suggestion, Matthew. Please don’t forget to vote for it, as every vote counts
For more on how we handle feature requests, please see 💡 Posting ideas & feature requests for Breww 💙
While we’re waiting for this
It’s maybe worth pointing out that this can be done (fairly easily) in a custom invoice template. So if you’re happy hacking, or know someone who is…
Interesting! I’'ll have a look into this, thanks.
@matthew-denyer Wasn’t quite as easy as I thought, but I got it to work.
Happy to provide snippets if you like.
Yes please, if you don’t mind
OK, in the body template, after
{# Product lines #}
I’ve added:
{% set ns = namespace(found=false) %}
{% set ns.total_volume = 0.0 %}
Then after
{% for line in lines %}
I’ve added
{% set ns.total_volume = ns.total_volume + (line.product_volume_total | replace(" L", "") | float ) %}
Then after
{% if (is_invoice and is_export) or is_delivery_note %}
I’ve added
<div class="notes_and_extra_text">
<strong>Total product volume: </strong>{{ ns.total_volume if ns.total_volume else 'Unknown'}} L
</div>
Seems to work. Not sure all that mucking about is required… the namespace stuff seems to be because scope (maybe if I moved things to the right place it wouldn’t be necessary)
If breww added a “total_order_volume” variable, most of this wouldn’t be needed
There may be an easier way to do this.
Thanks Jon, I’ll have a play! If it works though maybe it’ll be easy for Breww to incorporate.
You’re welcome. It does work. But, like you say, easier (for us) if Breww do it,. However, if you’re in a hurry…
That said, I’d most likely whip the calculator out and add it as a note, manually.
Great to see you’ve been able to handle this using custom templates for now (and thanks Jon for your help). We’re happy to keep this request open for votes and implementation into Breww one day in the future to save the need for custom templates.
Cheers!