compressed sale into one transaction, if something fails all changes in sale and saledetail are rollbacked.
Added a way to communicate with database