by COBS Tech Support » Thu Dec 22, 2005 3:20 pm
Try this script:
Declare nTotSales Type Number
Declare nTotCosts Type Number
Declare nTotTax Type Number
IF .Not. IsEmpty(Invoice->Taxno)
nTotTax := 0
Else
nTotTax := Invoice->Invtax
Endif
nTotSales := Invoice->Invtot - nTotTax
nTotCosts := Invoice->Tcost - nTotTax
IF nTotsales == 0
RETURN 0
ENDIF
RETURN (nTotsales - nTotcosts) / nTotsales * 100