When a unit which is being trained is cancelled, the resourcesUsed counter is decreased by twice the cost of this unit.
Steps to reproduce:
1. Click on any building to train a new unit
2. Cancel the unit before it is completed.
3. Check in the summary the Resources Used field
I tested it with:
cmd 1 {"type":"train","template":"units/rome/support_female_citizen","count":1,"entities":[150],"pushFront":false}
cmd 1 {"type":"stop-production","entity":150,"id":1}
and got resourcesUsed = -50
I am not a professional programmer but, in case it helps, the problem seems to be in: binaries > data > mods > public > simulation > components > Trainer.js > Trainer > Item > Stop
There is a call to IncreaseResourceUsedCounter() in line 154 to decrease its value and a call to RefundResources() in line 161 which contains another call to IncreaseResourceUsedCounter(). Looks like this is why the value is decreased twice.
I have checked (in the newest version, rev 27288) that by commenting lines 153 and 154 in the mentioned file (Trainer.js) the issue sees to be solved.
PD: Thanks for this fabulous game. It is really awesome.