Three important events need to be considered – Date of raising invoice, receipt of payment and completion of supply. If any of the two events occur before the change in rate of tax then the old rate will apply else the new rate will apply.
(ICAI FAQ PUBLICATION 06-09-2017 : Time and Value of Supply -FAQ NO. 30)