Duplicate Prevention in Auto Journal Voucher creation through Function with Value in Narration

Discussion in 'Free Source Codes' started by Murari Bajaj, Dec 13, 2020.

    
  1. Murari Bajaj

    Murari Bajaj Member


    Dear Experts
    Please suggest how to prevent an auto Journal entry ... checking the Narration of already entered
    Journal Voucher for the Specfied Dates using Function.
    Thanks
     


  2. Murari Bajaj

    Murari Bajaj Member


    My Fuction is as below:

    [Key:MB_EMP_AutoJrnl]
    Title:Auto Jrnl
    Key:Alt+J
    Action:Call:MB_Emp_AutoJrnlFunc:##SVToDate

    [Function:MB_Emp_AutoJrnlFunc]
    Parameter :pMBToDt:Date
    Variable :pMBToDate:Date
    Variable :vMBExpLedger : String
    Variable :vMBEmpAmount : Amount
    Variable :vMBEmpNameVar: String
    Variable :vMBMnthNm:String
    Variable :vMBYear:String
    Variable :vMBRate:String
    Variable :vMBOT:String
    Variable :vMBwrkdDays:String
    Variable :vMBSplAmt:String
    Variable :vMBHDAmt:String
    Variable :vMBExtraDays:String
    Variable : Counter : Number

    0001 : Set : Counter : 1
    0002 : Start Progress : ($$NumItems:MB_Emp_AutoJrnlColl):"Employee Salary Journal Vouchers":"Creating.."

    01 : Walk Collection:MB_Emp_AutoJrnlColl
    01a : Set:pMBToDate:$$MonthEnd:##pMBToDt
    02 : Set: vMBExpLedger:"Wages and Salary"
    04 : Set: vMBEmpAmount:$$Round:$MBmnthTotSalary:1
    05 : Set: vMBEmpNameVar:$Name
    05A : Set: vMBMnthNm:$$FullMonthName:##pMBToDate
    05B : Set: vMBYear:$$YearOfDate:##pMBToDate
    05C : Set: vMBRate:$$String:"Rate = " + $$String:$MBLEDEmpRate
    05D : Set: vMBOT:$$String:"OT = "+$$String:$MBEmpSSOvrTm
    05E : Set: vMBwrkdDays:$$String:"Days = "+$$String:$MBEmpSSWrkdDays
    05F : Set: vMBSplAmt:$$String:"SPLDayAmt = "+$$String:$MBMnthSplAmt
    05G : Set: vMBHDAmt:$$String:"HDAmt = "+$$String:$MBMnthHDAmt
    05H : Set: vMBExtraDays:$$String:"ExtraDays = "+$$String:$MBEmpSSOvrTmDays
    06 : New Object:Voucher
    07 : Set Value: VoucherTypeName:"Journal"
    08 : Set Value: Date:$$Date:##pMBToDate
    09 : Set Value:Narration:mad:@MBEmpJrnlNarr
    25a : Insert Collection Object : AllLedgerEntries
    26 : Set Value : LedgerName : ##vMBExpLedger
    27 : Set Value : Amount : ##vMBEmpAmount
    28 : Set Value : IsDeemedPositive : Yes
    29 : Set Target : ..
    11 : Insert Collection Object : Ledger Entries
    12 : Set Value : IsDeemedPositive : No
    13 : set value : Ledger Name : ##vMBEmpNameVar
    14 : Set value : Amount :##vMBEmpAmount
    15 : Set Target :..
    32 : Create Target
    33 : Increment : Counter
    34 : Show Progress : ##Counter
    35 : End Walk
    36 : End Progress

    [Collection: MB_Emp_AutoJrnlColl]
    Data Source: Report: selected
    Fetch: *.*
    [System:Formulae]
    MBEmpJrnlNarr:$$String:##vMBMnthNm +" - " +$$String:##vMBYear + " "+$$String:##vMBRate+ " "+$$String:##vMBOT+ " "+$$String:##vMBwrkdDays+ " "+$$String:##vMBSplAmt+ " "+$$String:##vMBHDAmt+ " "+$$String:##vMBExtraDays
     


  3. Murari Bajaj

    Murari Bajaj Member


    When we create the JV with this Function it writes the month of the Date field in selected in Narration of new Journal Voucher(JV). Like Novemver-2020 for any November-2020 date.
     


  4. Murari Bajaj

    Murari Bajaj Member


    Pla suggest if someone has the solution
     


  5. Murari Bajaj

    Murari Bajaj Member


    Amit sir
    Pls suggest something.
    Thanks
     


  6. Murari Bajaj

    Murari Bajaj Member


    The Problem is solved. Thanks
     


Share This Page