Events Made Easy Forums How do I … generate invoice.pdf with chronological numbering upon approval of booking

Tagged: 

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #63889
    Anonymous
    Inactive

    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
    Thomas

    #63892
    Franky
    Keymaster

    Adding 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)

    #63897
    Anonymous
    Inactive

    I 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]-#_PAYMENTID

    Perhaps you find this useful…

    #63898
    Franky
    Keymaster

    Well, with the latest version you should be able to use

    INVOICE / RECHNUNG<br>
    Invoice Date / Rechnungsdatum #_BOOKINGCREATIONDATE<br>
    Invoice No. / Rechnungsnr. #_BOOKINGCREATIONDATE{Y}-#_PAYMENTID
    #63899
    Anonymous
    Inactive

    Ah, yes, awesome. Already saw it, but forgot to put in the cited code just yet.
    Thanks!

    #63902
    Franky
    Keymaster

    And this should be ok too:
    #_BOOKINGCREATIONDATE{Y}-#_BOOKINGID

    #63929
    Anonymous
    Inactive

    thanks 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
    Thomas

    #63930
    Anonymous
    Inactive

    That 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!

    #63932
    Franky
    Keymaster

    Payment 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 🙂

    #63933
    Anonymous
    Inactive

    @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!

Viewing 10 posts - 1 through 10 (of 10 total)
  • The forum ‘How do I …’ is closed to new topics and replies.
Scroll to Top