• Tatuya Kamada's avatar
    Change the usage of price, quantity and efficiency in Trade Model Line. · 6b0fb0d2
    Tatuya Kamada authored
    Until now, when using, for example, VAT, you put like this:
    
    price=0.196, efficiency=1.0
    
    so the result by getAggregatedAmountList is, if the base is 100:
    
    price=0.196, efficiency=1.0, quantity=100
    
    Thus, the total price is 19.6.
    
    This works but not compatible with rounding, as, for instance, if we want to 
    round it up to 20, the result is not saved at anywhere.
    
    So, from now on, we do like this instead:
    
    price=1.0, efficiency=0.196
    
    so the result is:
    
    price=1.0, efficiency=0.196, quantity=100, total price=19.6
    
    The total price does not change. When we apply a rounding method, it would 
    result in:
    
    price=1.0, efficiency=0.196, quantity=100, total price=20
    
    --
    
    This modification is approved by YO and Yusei.
    
    TODO: write some test-cases
    
    
    
    git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30019 20353a03-c40f-0410-a6d1-a30d3c3de9de
    6b0fb0d2
TradeModelLine.py 2.03 KB