From
李宝嘉's 《
官场现形记》 (late Qing satirical novel): '
好便宜!
你倒会打如意算盘!' ('How convenient — you sure know how to cook up a wishful calculation!'). The word
算盘 ('abacus') is the literal tool;
如意 ('as one wishes') makes it a calculation rigged in your own favor.