Invoice sent with issue date in the future

An invoice was sent today, after making a couple of amendments (initally sent internally to a colleagues email address in error), but when doing those amendments I changed the issue date to 29/11/2019 (tomorrow) this has not been a position that was allowed in the past.

Could you reintroduce the lock so that invoices cannot be issued for a date in the future, so such a mistake would not occur. Thanks

Hi @alan_mcbrien

This is more of a feature rather than a bug, as some users do invoice using future dates (e.g. for bookings).

However, what you could do here is add a visual warning if the date is in the future - would that help?

If you have a Power User Subscription, go to Account Settings >> Design Customisation >> Advanced CSS/HTML Customisation, and select Global Scripts. The below will highlight the field if the date is in the future:

$(document).ready(function() {
   
   $('.page-sales-create #txtissueDate').change(function() {
        var enteredDate = $(this).val();
        
        if(isFutureDate(enteredDate)) {
            $('#txtissueDate').addClass('standardTextboxError');
        } else {
            $('#txtissueDate').removeClass('standardTextboxError');
        }
   });
   
   /** Taken from Stack Overflow: https://stackoverflow.com/questions/21499843/javascript-validate-date-input-so-its-only-either-current-or-the-future */
   function isFutureDate(idate){
        var today = new Date().getTime(),
            idate = idate.split("/");
    
        idate = new Date(idate[2], idate[1] - 1, idate[0]).getTime();
        return (today - idate) < 0;
    }

});

This produces this:
image

1 Like

Thank you for the coding to add a warning message but not going to add extra script as the scenario which I desribed was an exceptional occurence, the way the system works with issue date of invoice generated from today’s date works well enough for the accounts I work on. I think that I have mixed up the two ledgers as in Purchases there is not a facility to date a receipt in the future.

This topic was automatically closed after 7 days. New replies are no longer allowed.