I have the following forumla below. The goal is to have Cost_XX display in the report. I'm getting zero in the report. What am I doing wrong? What steps am I missing?
NumberVar Disc_Amt_V;
NumberVar Discount_V;
NumberVar Int_Cost_V;
NumberVar XCost_V;
NumberVar Cost_X;
NumberVar Cost_XX;
if {Command.Fst_Own_Rtl} = 0
then Disc_Amt_V = ({Command.ITM_QTY} * {Command.ITEM_LAST_COST})
and Discount_V = ((Disc_Amt_V * {Command.ITM_QTY}) * {Command.line_24})
and Cost_X = {Command.ITEM_LAST_COST}+({Command.ITEM_LAST_COST}*{Command.ROS_FRT_PCT})
else
if {Command.Fst_Own_Rtl} <> 0
then Int_Cost_V = ({Command.Cur_OWND_RTL}/{Command.Fst_Own_Rtl})
and XCost_V = (Int_Cost_V * {Command.ITEM_LAST_COST})
and Cost_X = XCost_V + (XCost_V * {Command.ROS_FRT_PCT})
and Cost_XX = Cost_X - Discount_V;
if ({Command.Cur_OWND_RTL} < {Command.Fst_Own_Rtl}) and {Command.MD_STAT} > 10
then ({Command.Fst_Own_Rtl} = {Command.Cur_OWND_RTL})
and Discount_V = ((({Command.Cur_OWND_RTL}/{Command.Fst_Own_Rtl}) * {Command.ITEM_LAST_COST}) * {Command.line_24}) * {Command.ITM_QTY}
else Discount_V = (({Command.ITEM_LAST_COST}*{Command.line_24}) * {Command.ITM_QTY})
and Cost_X = {Command.ITEM_LAST_COST} + ({Command.ITEM_LAST_COST} * {Command.ROS_FRT_PCT})
and Cost_XX = Cost_X - Discount_V;
if ({Command.Cur_OWND_RTL} >= {Command.Fst_Own_Rtl})
then Discount_V = (({Command.ITEM_LAST_COST} * {Command.line_24}) * {Command.ITM_QTY})
and Cost_X = ({Command.ITEM_LAST_COST} + ({Command.ITEM_LAST_COST} * {Command.ROS_FRT_PCT}))
and Cost_XX = Cost_X - Discount_V;
NumberVar Disc_Amt_V;
NumberVar Discount_V;
NumberVar Int_Cost_V;
NumberVar XCost_V;
NumberVar Cost_X;
NumberVar Cost_XX;
if {Command.Fst_Own_Rtl} = 0
then Disc_Amt_V = ({Command.ITM_QTY} * {Command.ITEM_LAST_COST})
and Discount_V = ((Disc_Amt_V * {Command.ITM_QTY}) * {Command.line_24})
and Cost_X = {Command.ITEM_LAST_COST}+({Command.ITEM_LAST_COST}*{Command.ROS_FRT_PCT})
else
if {Command.Fst_Own_Rtl} <> 0
then Int_Cost_V = ({Command.Cur_OWND_RTL}/{Command.Fst_Own_Rtl})
and XCost_V = (Int_Cost_V * {Command.ITEM_LAST_COST})
and Cost_X = XCost_V + (XCost_V * {Command.ROS_FRT_PCT})
and Cost_XX = Cost_X - Discount_V;
if ({Command.Cur_OWND_RTL} < {Command.Fst_Own_Rtl}) and {Command.MD_STAT} > 10
then ({Command.Fst_Own_Rtl} = {Command.Cur_OWND_RTL})
and Discount_V = ((({Command.Cur_OWND_RTL}/{Command.Fst_Own_Rtl}) * {Command.ITEM_LAST_COST}) * {Command.line_24}) * {Command.ITM_QTY}
else Discount_V = (({Command.ITEM_LAST_COST}*{Command.line_24}) * {Command.ITM_QTY})
and Cost_X = {Command.ITEM_LAST_COST} + ({Command.ITEM_LAST_COST} * {Command.ROS_FRT_PCT})
and Cost_XX = Cost_X - Discount_V;
if ({Command.Cur_OWND_RTL} >= {Command.Fst_Own_Rtl})
then Discount_V = (({Command.ITEM_LAST_COST} * {Command.line_24}) * {Command.ITM_QTY})
and Cost_X = ({Command.ITEM_LAST_COST} + ({Command.ITEM_LAST_COST} * {Command.ROS_FRT_PCT}))
and Cost_XX = Cost_X - Discount_V;