how to apply discount.
Hello Bhairavi,
Please use below customized code in UDJC
Double Quantity = get(Fields.In, “Quantity”).getNumber(r);
Double Price = get(Fields.In, “Price”).getNumber(r);
Double Total_Price=TotalPriceOfproduct(Quantity,Price);
get(Fields.Out, “TotalPrice”).setValue(r, Total_Price);
if(Total_Price>100){
Double dis=Discount(Total_Price);
get(Fields.Out, “DiscountPrice”).setValue(r, dis);
}
else
{
Double dis=Total_Price;
get(Fields.Out, “DiscountPrice”).setValue(r, dis);
}
putRow(data.outputRowMeta, r);
return true;
}
public double TotalPriceOfproduct(double a,double b)
{
return a*b;
}
public double Discount(double a)
{
return ((a*5)/100);
}