Unrealized Revenue from Services

If I sell services and a client doesn't pay me, can I write that invoice off as a loss since I haven't actually claimed it as income?  How do I account for the loss of my services time?  Also what if I give a way services for free to a NFP?  How do I classify that?