Prevent using same sequence on earlier customer invoice: which date to use?

How will you manage the SII declaration in this scenario?