To fix the gap in numbering if deleted some vouchers either you have correct manually all vouchers or can run renumbering process by using these steps:
Step 1: Go to Administration and click on configuration.
Step 2: Choose the Voucher Series Configuration option and select the voucher type such as sale, purchase, etc. Then, select the voucher series and click on Voucher Numbering.
Step 3: Choose the Numbering Type as either Automatic. Then, verify the prefix, suffix, and Starting No. as per your needs and click on OK.
Step 4: Then a window will appear of renumbering, press yes and then check.
Note: Take backup of your data before running this process.