We use components and frameworks for the development of our projects. We have third-party components/frameworks (both - closed and open source) and inherited elements on top of them. Sometimes our client requires to develop software that includes adding new features to those components and frameworks - in such cases it is crystal clear - we ask 100% payment for the development/adaptation/improvement costs of those components and frameworks.
But then there are cases when we discover that some component has bug in it and it prohibits to complete the commissioned development task. Sometimes it is more heavy - we can discover the design failure in our framework that involves even redesign/rework some parts of it. Of course, we do and complete such fixings, but they are quite costly, the development costs are not negligible. My question is - how to report to the management such works and how to bill such development works to the client? From the one side - such works were required by the commissioned development works. From the other side - these works can be considered also as: 1) company investments (so, client can not be billed directly); 2) losses due to the technical debt (and client also can not be billed).
Actually - it would be nice to put this into the wider picture how development works are billed and reported. E.g. - what about the accounting of the developer work which is spent for the communication with the client regarding the content of some features. What about the time for meetings with the client. What to do about the time which is required by the developer to assimilate the design and codebase from the previous developers? There are guidelines about cost estimation but little about how to account those costs (investment vs operational costs) and how to report them to the management and client?