In the first example, it would possibly depend on what it is for but you could potentially Debit Work in Progress or Amounts recoverable on contracts instead.
In the second example I would probably Credit Deferred income rather than Trade Debtors/ Sales ledger as the invoice still exists.
In the end, they all have the same effect!
__________________
Phil Hendy, The Accountancy Mentor
Are you thinking of setting up your own practice or have you set up and need some help?
If so a mentor may be the way forward - feel free to get in touch and see how I can assist you.