Events Made Easy › Forums › How do I … › generate invoice.pdf with chronological numbering upon approval of booking
Tagged: Invoice
- This topic has 9 replies, 3 voices, and was last updated 2 years, 9 months ago by Anonymous.
-
AuthorPosts
-
Tue 15 Feb 2022 at 15:44 #63889AnonymousInactive
Hi Franky,
it would be great to have the possibility to send an invoice.pdf with chronological numbering when the booking gets approved.
i searched the forum and found that you already talked about this in a thread from 2020. have you made some progress on this already?
best
ThomasTue 15 Feb 2022 at 17:06 #63892FrankyKeymasterAdding such a number is not a task of EME. You can use the booking ID as number if you’d like, or the date/time of booking in a custom format.
For custom formatting, from the changelog (will be in 2.2.61):* Added placeholders #_CURDATE{xx}, #_CURTIME{xx}, #_BOOKINGPAYMENTDATE{xx}, #_BOOKINGPAYMENTTIME{xx}, #_BOOKINGCREATIONDATE{xx} and #_BOOKINGCREATIONTIME{xx} so you can format the layout to your liking (‘xx’ being the date/time format in php date notation)
Tue 15 Feb 2022 at 21:57 #63897AnonymousInactiveI can chime in, and offer an idea, if that’s OK?
Had the same requirement. And the way I’m handling it is with #_PAYMENTID, instead of booking id. Works pretty well and gives a sequence of invoice numbers upon payment (=approval time). Only if a bookings falls through, then I would have to manually create an empty invoice to document this for the financial authorities…
Other than that, I’m using #_BOOKINGCREATIONDATE to get the date when the booking is created as a prefix for the invoice. Like Franky suggested.This is my code
` INVOICE / RECHNUNG<br>
Invoice Date / Rechnungsdatum #_BOOKINGCREATIONDATE<br>
Invoice No. / Rechnungsnr. [eme_if tag="#ESC_BOOKINGCREATIONDATE" contains="/2021"]2021[/eme_if][eme_if tag="#ESC_BOOKINGCREATIONDATE" contains="/2022"]2022[/eme_if]-#_PAYMENTIDPerhaps you find this useful…
Tue 15 Feb 2022 at 22:51 #63898FrankyKeymasterWell, with the latest version you should be able to use
INVOICE / RECHNUNG<br> Invoice Date / Rechnungsdatum #_BOOKINGCREATIONDATE<br> Invoice No. / Rechnungsnr. #_BOOKINGCREATIONDATE{Y}-#_PAYMENTID
Tue 15 Feb 2022 at 22:55 #63899AnonymousInactiveAh, yes, awesome. Already saw it, but forgot to put in the cited code just yet.
Thanks!Tue 15 Feb 2022 at 23:04 #63902FrankyKeymasterAnd this should be ok too:
#_BOOKINGCREATIONDATE{Y}-#_BOOKINGIDThu 17 Feb 2022 at 15:34 #63929AnonymousInactivethanks to both of you for your input.
@kinghill payment_id is created upon approval, but is not reset when the booking gets canceld? so thats why you need to fill the gap of invoice numbers manually?
best
ThomasThu 17 Feb 2022 at 21:50 #63930AnonymousInactiveThat is actually an excellent question. And one I’m afraid I cannot answer confidently. I seem to remember that in case of cancellation the payment get not “freed up”/reset. But this is only from memory from an early test way back when, and I have to admit I don’t fully remember. Since then we never had a real cancellation.Sorry!
Perhaps Franky can shed a light on this? How payment IDs are being handled in case of cancellation. Sorry for the additional work!Thu 17 Feb 2022 at 22:11 #63932FrankyKeymasterPayment IDs are (database wise) a primary key and auto-incremented. So it can never get reused. Accounting-wise, an invoice can never get cancelled but needs to be credited back.
If you really want to get a sequence-number, then you should provide your own counting-up mechanism somewhere and use the booking action “eme_insert_rsvp_action” to change the value of a custom field using that value. But then again, even then you’d have the cancel-problem, so the current suggested method seems just fine to me.
Also: in the current EME version you can use user confirmation for bookings, so they actually confirm a booking before getting the payment info. However, the payment random id is used to confirm the booking too, so it’d still leave a gap there.
I’m open to suggestions on improving this, but currently it works fine as is 🙂Fri 18 Feb 2022 at 11:19 #63933AnonymousInactive@Franky – thanks for the detailed answer. Makes all total sense, and the hint regarding the hook might come in handy, too, at some point.
Right now, for me, though, I’m quite happy with using the paymentid as is. Since we don’t have to deal with ton of cancellations I’m OK with the occasional manual credit-back/cancel invoice.
So for me, no further action needed, all good. THANKS!
-
AuthorPosts
- The forum ‘How do I …’ is closed to new topics and replies.