Search code examples
mysqlhanasap-commerce-cloud

Hybris increase decimal digits


i'm facing a great issue with decimal places in base price in hybris with CPQ. in my local installation with mysql db, product base price is stored with 8 decimal digits the allows the correct final price.

in develop machine, with hana db, price is stored with 5 decimal digits that makes the final price wrong.

there's some setting to set up decimal digits?how can be possible this difference of behaviour?

thanks in advance Best regards

Marco


Solution

  • You didn't describe version of your hybris. May be there are patch for this issue. You can override existing attribute and force for db type like below.

    <attribute qualifier="totalPrice" redeclare="true">
        <persistence type="property">
            <columntype database="mysql">
                <value>DECIMAL(13, 8)</value>
            </columntype>
            <columntype database="sap">
                <value>DECIMAL(13, 8)</value>
            </columntype>
            <columntype>
                <value>DOUBLE</value>
            </columntype>           
        </persistence>
    </attribute>
    

    You need to initialize system for applying resize column. Otherwise you need to alter table manually.