Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subtotal Does Not Include all Amounts

Status
Not open for further replies.

blueboyz

Technical User
Sep 13, 2005
210
US
I'm using Peachtree 2011 which uses Pervasive SQL as the database engine and Crystal Reports 2008.

I created a report to show the commission for each sales person.
I created a formula to calculate the commission:
{@Commission} =
IF {Employee.Type} = "STR" THEN {@COMMISSIONSTR}
ELSE IF {Employee.Type} = "SAE" THEN {@COMMISSIONSAE}
ELSE IF {Employee.Type} = "SAP" THEN {@COMMISSIONSAP}

({@COMMISSIONSTR}, {@COMMISSIONSTR}, {@COMMISSIONSAP} is another formula that applies the commission rate depending on what the sales person sold the product for (called the Price Level))

{@Commission} is placed in the Details section and then a summary is inserted for each group (Group 1 = Sales Person, Group 2 = Sales Order)

There are two exceptions to the commission:
If the sales person sells the item "XXX" then the Price Level is 9 and the amount on the sales order is subtracted from the commission on the sales order.
If the sales person sells the item "ZZZ" then the Price Level is 10 and the commission for the sales order is reduced by 50%.

I created another formula to handle the exceptions:
{@CommissionSO-2} =
EvaluateAfter ({@COMMISSION});
NumberVar CommissionSO2:= (((Sum ({@COMMISSION}, {JrnlHdr.Reference}) * {@P10}) + {#P9 SO}));
CommissionSO2;

{@P10} =
WhilePrintingRecords;
NumberVar P10 := (If {@Price Levels} = "Price Level 10" then -.50 else 1.00);
P10;

The report display:
REP SO P1 P2 P3 P4 P5 P6 P7 P8 P9 P10 Comm
JOE AMT
1034 22.00 12 10 0.00
1055 28.62 2.64 25.00 -.5 -24.87

The commission for sales order 1034 should show 2.12.

I placed {@CommissionSO-2} in the Group 2 Footer-Sales Order.
The problem is if the sales order doesn't have a unit price that falls into Price Level 9, then the commission is 0.00.

Does anyone know how to fix my variable so that commission is calculated for every price level?


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top