Triple Discount in invoice

Discussion in 'Tally Developer' started by Mahesh Sethi, Jul 19, 2023.

    
  1. Mahesh Sethi

    Mahesh Sethi Member


    Dear Admin & Experts,

    I am try to make triple discount provide in invoice i have a problem in recalculate the amount field pls help me. Guide me where i am go wrong.

    Screen shoot & code is as under:

    [#Field : VCH Value]
    ResetVal : If (@@NoBaseUnits OR $$IsEmpty:$BilledQty) then $$Value else ((($Rate * $BilledQty * (100 - $Discount) * (100 - $TlyTrngDiscount) * (100 - $TlyTrngDiscountM))) / 10000)


    [System : Formula]
    NrmlAmount : ((100 * 100 * $Amount) / (100 - $Discount)) / (100 - $$Number:$TlyTrngDiscount) / (100 - $$Number:$TlyTrngDiscountM)
    CalcedAmt : ((((if $$IsMultiGodownOn Then $BatchRate else $Rate) * $BilledQty * (100 - $Discount) * (100 - $TlyTrngDiscount) * (100 - $TlyTrngDiscountM))) / 10000)



    upload_2023-7-19_13-25-32.png
     


  2. Mahesh Sethi

    Mahesh Sethi Member


    Res. Amit ji & experts,

    Pls Pls help me on the above issue.

    Thanks in Advance.

    Mani
     


  3. drive

    drive Active Member


    If you Want Simple Discount Like Disc1 + Disc2 + Disc3 Then
    $Rate * $BilledQty * ( (100 - ($Discount+$TlyTrngDiscount+$TlyTrngDiscountM)) /100)

    Or you want compound Then
    (((($Rate * $BilledQty * (100-$Discount)/100)*(100-$TlyTrngDiscount)/100)*(100-$TlyTrngDiscountM)/100)
     


  4. Mahesh Sethi

    Mahesh Sethi Member


    Hello Mr. Drive,

    As per your guidance i will change the code but it is not successful. Code is as under:


    [System : UDF]
    TlyTrng Discount : Number : 3011
    TlyTrng DiscountM : Number : 3012
    [#Field : VCH Value]

    Resetval : (((($Rate * $BilledQty * (100-$Discount)/100) * (100-$TlyTrngDiscount) / 100) * (100-$TlyTrngDiscountM) / 100))
    ;; ResetVal : If (@@NoBaseUnits OR $$IsEmpty:$BilledQty) then $$Value else ((($Rate * $BilledQty * (100 - $Discount) * (100 - $TlyTrngDiscount) * (100 - $TlyTrngDiscountM))) / 10000)
    ;;

    [System : Formula]
    ;;

    NrmlAmount : (((($Rate * $BilledQty * (100-$Discount)/100)*(100-$TlyTrngDiscount)/100)*(100-$TlyTrngDiscountM)/100))
    ;;((((100 * 100 * $Rate * $BilledQty / (100-$Discount)/100) * (100-$TlyTrngDiscount)/100) * (100-$TlyTrngDiscountM)/100) / 100)
    ;;NrmlAmount : ((100 * 100 * $Amount) / (100 - $Discount)) / (100 - $$Number:$TlyTrngDiscount) / (100 - $$Number:$TlyTrngDiscountM)
    CalcedAmt : ((((if $$IsMultiGodownOn Then $BatchRate else $Rate) * $BilledQty * (100 - $Discount) * (100 - $TlyTrngDiscount) * (100 - $TlyTrngDiscountM))) / 100)
     


  5. Mahesh Sethi

    Mahesh Sethi Member


    Thanks to Admin, Experts & One of my known experts who help me to achieve It

    Now able to add 4 or 5 level of discount module should be generate & print also.

    :)
    upload_2023-7-21_15-59-42.png
     
    Last edited: Jul 21, 2023


Share This Page