Margins on Visual Builder Report
  • Susan Jones
    Margins on Visual Builder Report

    by Susan Jones » Thu Dec 22, 2005 3:18 pm

    How can I calculate a margin on a visual builder report like the ones standard CAPITAL reports have?
  • COBS Tech Support
    Posts:683
    Joined:Fri Sep 09, 2005 8:23 am

    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

Who is online

Users browsing this forum: No registered users and 17 guests