leslie-alldridge/xero-bulk-void-invoice-tool

Invoices for last day of month don't come through

mposborne opened this issue · 1 comments

Hi, I found your tool when hunting around for something to bulk void so that I could fix up a rather large but botched invoice import. Great tool and I found it super useful so thank you!

I just noticed that there's an error when pulling in invoices for the month selected in that any invoice dated for the last day of the month will not come through.

See your code line here:

where: `Date >= DateTime(${year}, ${month}, 01) && Date < DateTime(${year}, ${month}, ${finalDay})`,

Which should probably be:

where: `Date >= DateTime(${year}, ${month}, 01) && Date <= DateTime(${year}, ${month}, ${finalDay})`,

(i.e. less than or equal to the final day of month)

Perfect, thanks for explaining the issue in great detail @mposborne !