If one of the statements fails your procedure leave the transaction open.
Completing of procedure code does not complete transaction.
it should be like this:
if @ierror=0
begin
commit transaction
end
ELSE
begin
rollback transaction
end
_____________
Code for TallyGenerator