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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

formula to calculate invoice total repeats in some instances

Status
Not open for further replies.

rbrownie

Technical User
Mar 14, 2010
10
US
Hello,

I have a formula to calculate invoice total based on invoice line plus misc charges only if invoice code is one of the following 3 codes (which is a string): (3,7 or 8). The formula below works perfectly except when there is an instance of the misc charges occuring in more than one of the chosen codes, in which case it repeats the invoice and calculation for each instance. I think this should be simple, but I am at a loss...

if {InvcDtl.TotalMiscChrg}>0 then

Select {MiscChrg.MiscCode}
Case "3":
{InvcDtl.ExtPrice}+{MiscChrg.TotalMiscChrg}
Case "7":
{InvcDtl.ExtPrice}+{MiscChrg.TotalMiscChrg}
Case "8":
{InvcDtl.ExtPrice}+{InvcDtl.TotalMiscChrg}
Default:
{InvcDtl.ExtPrice} else
{InvcDtl.ExtPrice}


Any ideas?

thanks!
 
Sorry,

I copied part of an incorrect formula, the one below is the one that I am using...

if {InvcDtl.TotalMiscChrg}>0 then

Select {MiscChrg.MiscCode}
Case "3":
{InvcDtl.ExtPrice}+{InvcDtl.TotalMiscChrg}
Case "7":
{InvcDtl.ExtPrice}+{InvcDtl.TotalMiscChrg}
Case "8":
{InvcDtl.ExtPrice}+{InvcDtl.TotalMiscChrg}
Default:
{InvcDtl.ExtPrice} else
{InvcDtl.ExtPrice}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top