The situation is that I inherited a large peice of code in the form an SQL Procedure which had complicated business logic and rules. Mind you this code is very dense and with exactly 0 comments. My job is to resuse this code and apply it to a different use case. I made efforts to understand and make sense of this the best I could given that the developer who wrote this is very non-comittal to giving any time to explain stuff and just assumes you know what he knows.
Regardless of that fact, I managed to make sense of solution 80% and I am currently in the process of extending. However the dead line is now approaching and now the developer suddenly came out of no where and said that this hasn't progressed far enough and now will just take it away from and start from scratch (or take what I made). Obviously my boss just wants to see the deadline completed. But this has made me angry. What should I do ?
EDIT: Will have a talk with the boss and explain the pros and cons.