Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Kevin 35 posts 159 karma points
    Mar 20, 2017 @ 15:52
    Kevin
    0

    Retain Starting Invoice Number after deleting an invoice/order

    Is it possible to have Merchello retain the starting invoice number after the most recent invoice is deleted to prevent invoice numbers being re-used?

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Mar 20, 2017 @ 16:28
    Rusty Swayne
    0

    Hey Kevin,

    The invoice numbers should not ever be duplicated (even when an invoice is deleted).

    The invoice number uses a settings field in the merchStoreSetting table. Every time an invoice is created and then saved (if the invoice number is not set on the invoice ... e.g. a new invoice) the number from that table is retrieved used in the invoice and then incremented and saved back to the merchStoreSetting table. Deleting an invoice does not do anything to the number stored in the settings table.

    Example:

    merchStoreSetting invoice number value: 1000

    new invoice -> saved - invoice number will be 1000

    new invoice -> saved - invoice number will be 1001

    new invoice -> saved - invoice number will be 1002

    invoice 1001 deleted

    new invoice -> saved - invoice number will be 1003

  • Kevin 35 posts 159 karma points
    Mar 20, 2017 @ 17:03
    Kevin
    0

    Thanks Rusty,

    I think I have found our issue in our internal systems. We periodically sync the live database to our staging database. As it's a new site, at present staging has more invoice numbers than live, so after a restore, the new value of nextInvoiceNumber is lower than the old value.

    We can resolve this issue internally though.

    Thanks for the fast reply.

Please Sign in or register to post replies

Write your reply to:

Draft