            rows=[]
            for cart in data['carts']:
                discounted=(D(cart)*D(output['discount'])).quantize(D('.01'),rounding=ROUND_HALF_UP);reduce=D(output['reduction']) if discounted>=D(output['threshold']) else D('0');rows.append({'original':cart,'discounted':money(discounted),'reduction':money(reduce),'payable':money(discounted-reduce)})
            check('折后100.00命中满减',rows[0]['payable']=='90.00');check('124.99先舍入后的金额为99.99不满减',rows[1]['payable']=='99.99');check('错误先减后折得出不同结果',(D('125')-D('10'))*D('.8')!=D(rows[0]['payable']));cout('discount-boundaries.csv',rows);result={'rules':output,'calculations':rows,'rounding_note':'本地约定折后先按人民币分四舍五入，再检查门槛。'}
