Calculate Simple Interest

Discussion in 'Free Source Codes' started by Ozair Ahmad, Nov 12, 2019.

    
  1. Ozair Ahmad

    Ozair Ahmad New Member


    ; A bit changed (Amount will display in word)
    [# Menu : Gateway of Tally]

    Add :Item :Simple Interest Calculator :Alter :Simple Interest Calculator

    [Report: Simple Interest Calculator]

    Form :Simple Interest
    Auto :Yes

    [Form : Simple Interest]
    Part: Form SubTitle, Simple Interest
    Local:Field :Form SubTitle :Info :"Simple Interest Calculator"
    Width: 30% Page

    [Part: Simple Interest]
    Line: Principal Amt, Interest Rate, NoOfYrs, Result, uPickWord

    [Line: Principal Amt]
    Fields: Medium Prompt, Principal Amt
    Local: Field:Medium Prompt : Info : "Principal Amount"
    [Field: Principal Amt]
    Use:Amount Field

    [Line:Interest Rate]
    Fields:Medium Prompt, Interest Rate
    Local:Field:Medium Prompt :Info: "Rate"
    [Field: Interest Rate]
    Use:Number Field
    Format:"NoZero, Percentage"
    Align:Right
    Width:mad:@AmountWidth

    [Line:NoOfYrs]
    Fields:Medium Prompt, NoOfYrs
    Local:Field:Medium Prompt : Info: "Year"
    [Field:NoOfYrs]
    Use:Number Field
    Format:"NoZero"
    Align:Right
    Width:mad:@AmountWidth

    [Line:Result]
    Fields:Medium Prompt, Result
    Local:Field:Medium Prompt : Info:"Interest Amount"
    Local:Field: Default : Inactive: $$IsEmpty:#PrincipalAmt OR $$IsEmpty:#InterestRate OR $$IsEmpty:#NoOfYrs
    Space Top:1
    [Field:Result]
    Use :Amount Field
    Set Always :Yes
    Set as :$$CalcSI:#PrincipalAmt:#InterestRate:#NoOfYrs
    Align :Right

    [Line:uPickWord]
    Fields:Medium Prompt, uPickWord
    Local:Field:Medium Prompt : Info:"Amount in Words"
    Local:Field: Default : Inactive: $$IsEmpty:#PrincipalAmt OR $$IsEmpty:#InterestRate OR $$IsEmpty:#NoOfYrs OR $$IsEmpty:#Result
    [Field:uPickWord]
    Type :String
    Use :Number Field
    Set Always :Yes ;;It used for when Result Field Changes uPickWord value also will change
    Set as :$$InWords:#Result + " Only."
    Width :mad:@StringWidth
    Color :Red
    Style :No

    [Function : CalcSI]
    Parameter: aP :Amount
    Parameter: nR :Number
    Parameter: nY :Number

    Returns :Amount

    Variable :RS :Amount

    01: SET: RS: (##aP * ##nR * ##nY) / 100
    02: RETURN: ##RS

    ;end
     
    Last edited: Nov 12, 2019


Share This Page