Attribute Level Pricing

From ADempiere
Revision as of 21:40, 22 June 2010 by Anhhn (Talk) (Created page with 'Attribute Level Pricing '''Case Study''' We have a product: Test, which has 3 attributes: TN1 (Number), TN2 (Number) and TL1 (List). Price for the product "Test" is as follows: …')

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
This Wiki is read-only for reference purposes to avoid broken links.

Attribute Level Pricing

Case Study We have a product: Test, which has 3 attributes: TN1 (Number), TN2 (Number) and TL1 (List). Price for the product "Test" is as follows: Base Price: 10$ For Attribute TL1: If TL1="Good", bonus of 0.5$, otherwise, deduction of 0.3 For Attribute TN1: 0<TN1<1: Deduction of 0.1 1<=TN1<2: No bonus/deduction 2<=TN1<3: Bonus of 0.1 3<=TN1: bonus of 0.2 For Attribute TN2: TN2 <=3: No bonus/deduction 3<TN2: Step bonus of 0.2 for every increase of 1.

We calculate the price at the end of month for all receipts within that month.

Customization Create Rule: TestPricing Application Dictionary >> Rule


double tn1=getAttributeNumber("TN1"); double tn2=getAttributeNumber("TN2"); String tl1=getAttributeString("TL1"); double result1=0; double result2=0; double result3=0; if (0<tn1 && tn1<1) result1=-0.1; if (2<=tn1 && tn1<3) result1=0.1; if (3<=tn1) result1=0.2; if (tn2<=3) result2=0; if (3<tn2) result2 = Math.ceil(tn2-3)*0.2; if (tl1.equals("Good")) result3=0.5; else result3=-0.3; result=result1+result2+result3;


Rule.png