Just had the weirdest thing: An invoice was saved, but in the table 'vtiger_crmentity' the 'setype' was set to Invoice. This led to very weird results. Happened only once so far, maybe it's just a once in a million fluke, or has anyone encoutered this before?
This install is more recent than that. Several invoices and quotes are made in this system every day, but this is the first time this ever happened. I checked Invoice.php, but there the code in the __construct is as in your link.. My guess is this was a weird fluke...
Keep an eye on it and let me know if it happens again. I will be vigilent also in case it happens somewhere else.