How to allow filter in collection on particular date onward

Discussion in 'Free Source Codes' started by kapil22, Apr 25, 2021.

    
  1. kapil22

    kapil22 Member


    Dear Experts,

    Please help how to allow filter in collection on particular date onward.

    [#Collection : VLedTable]
    Option : EnhancedNewVLedTable : @@IsMyLocalTDLModuleOn
    [!Collection : EnhancedNewVLedTable]
    Title : $$LocaleString:"List of Ledgers"
    Delete : Format
    Add : Format : $$Name,48
    Add : Format : $Parent,22
    Add : Format : $Description,15
    Add : SubTitle : "LEDGER NAME","GROUP NAME","DESCRIPTION"
    Column Align: Left
    Filter : MyFilter01,MyFilter02,MyFilter03,MyFilter04,MyFilter05,MyFilter06,MyFilter07,MyFilter08,MyFilter09,MyFilter10,+
    MyFilter11,MyFilter12,MyFilter13,MyFilter14,MyFilter15,MyFilter16,MyFilter17,MyFilter18,MyFilter19,MyFilter20,+
    MyFilter21,MyFilter22,MyFilter23,MyFilter24,MyFilter25,MyFilter26,MyFilter27,MyFilter28,MyFilter29,MyFilter30,+
    MyFilter31,MyFilter32,MyFilter33,MyFilter34,MyFilter35,MyFilter36,MyFilter37,MyFilter38,MyFilter39,MyFilter40,+
    MyFilter41,MyFilter42,MyFilter43,MyFilter44,MyFilter45,MyFilter46,MyFilter47,MyFilter48,MyFilter49,MyFilter50,+
    MyFilter51,MyFilter52,MyFilter53,MyFilter54,MyFilter55,MyFilter56,MyFilter57,MyFilter58,MyFilter59,MyFilter60,+
    MyFilter61,MyFilter62,MyFilter63,MyFilter64,MyFilter65,MyFilter66,MyFilter67,MyFilter68,MyFilter69,MyFilter70,+
    MyFilter71,MyFilter72,MyFilter73,MyFilter74,MyFilter75
    [System : Formula]
    MyFilter01 : $Parent not contains ("410101- Grant To Partners")
    MyFilter02 : $Parent not contains ("410102- Project Activity Expenses")
    MyFilter03 : $Parent not contains ("410103- Certification Charges")
    MyFilter04 : $Parent not contains ("410104- Conference Expenses")
    MyFilter05 : $Parent not contains ("410105- Promotional Expenses")
    MyFilter06 : $Parent not contains ("410106- Bidding fee for Proposal")
    MyFilter07 : $Parent not contains ("410107- Fixed Assets Charges to Grant")
    MyFilter08 : $Parent not contains ("410108- Capital Assets for Beneficiaries")
    MyFilter09 : $Parent not contains ("410201- Staff Salary")
    MyFilter10 : $Parent not contains ("410202- Staff Medical Allowance")
    MyFilter11 : $Parent not contains ("410203- Staff Festival Allowance")
    MyFilter12 : $Parent not contains ("410204- Staff Other Allowance")
    MyFilter13 : $Parent not contains ("410205- Staff Insurance")
    MyFilter14 : $Parent not contains ("410206- Staff Gratuity")
    MyFilter15 : $Parent not contains ("410207- Staff Earn Leave")
    MyFilter16 : $Parent not contains ("410208- Staff Sick Leave")
    MyFilter17 : $Parent not contains ("410209- Staff Relocation Expenses")
    MyFilter18 : $Parent not contains ("410210- Staff Training Expenses")
    MyFilter19 : $Parent not contains ("410211- Staff Welfare")
    MyFilter20 : $Parent not contains ("410212- Staff Orientation")
    MyFilter21 : $Parent not contains ("410213- PF Employee Contribution")
    MyFilter22 : $Parent not contains ("410214- PF Employer Contribution")
    MyFilter23 : $Parent not contains ("410215- ESI Employer Contribution")
    MyFilter24 : $Parent not contains ("410216- Performance/Loyalty Pay")
    MyFilter25 : $Parent not contains ("410217- Staff Development Retreat")
    MyFilter26 : $Parent not contains ("410301- International Travel")
    MyFilter27 : $Parent not contains ("410302- Domestic Travel")
    MyFilter28 : $Parent not contains ("410303- Local Conveyance")
    MyFilter29 : $Parent not contains ("410304- Vehicle Hiring Charges")
    MyFilter30 : $Parent not contains ("410305- Vehicle Running Cost")
    MyFilter31 : $Parent not contains ("410306- Vehicle Maintenance")
    MyFilter32 : $Parent not contains ("410307- Vehicle Insurance")
    MyFilter33 : $Parent not contains ("410401- Professional Charges")
    MyFilter34 : $Parent not contains ("410402- Professional Charges- ECC Staff")
    MyFilter35 : $Parent not contains ("410403- Honorariums & Stipend")
    MyFilter36 : $Parent not contains ("410501- Office Rent")
    MyFilter37 : $Parent not contains ("410502- Office Maintenance")
    MyFilter38 : $Parent not contains ("410503- Equipment Maintenance")
    MyFilter39 : $Parent not contains ("410504- License Maintenance")
    MyFilter40 : $Parent not contains ("410505- Software Maintenance")
    MyFilter41 : $Parent not contains ("410506- Office Pantry, Toiletry Material")
    MyFilter42 : $Parent not contains ("410601- Printing, Photocopy, Xerox Charges")
    MyFilter43 : $Parent not contains ("410602- Books, Periodicals & Newspaper")
    MyFilter44 : $Parent not contains ("410603- Stationery- Office")
    MyFilter45 : $Parent not contains ("410604- Stationery- Computer")
    MyFilter46 : $Parent not contains ("410701- Telephone & Internet - Office")
    MyFilter47 : $Parent not contains ("410702- Mobile & Internet - Staff")
    MyFilter48 : $Parent not contains ("410703- Postage & Courier Charges")
    MyFilter49 : $Parent not contains ("410704- Website Maintenance")
    MyFilter50 : $Parent not contains ("410705- Email Maintenance")
    MyFilter51 : $Parent not contains ("410801- Auditor- Remuneration")
    MyFilter52 : $Parent not contains ("410802- Auditor- Out of Pocket Expenses")
    MyFilter53 : $Parent not contains ("410803- Audit Expenses")
    MyFilter54 : $Parent not contains ("410901- Assets Insurance")
    MyFilter55 : $Parent not contains ("410902- Bank Charges")
    MyFilter56 : $Parent not contains ("410903- Depreciation")
    MyFilter57 : $Parent not contains ("410904- Director Sitting Fee")
    MyFilter58 : $Parent not contains ("410905- EPF Charges")
    MyFilter59 : $Parent not contains ("410906- Electricity & Water Charges")
    MyFilter60 : $Parent not contains ("410907- Interest on Overdraft Account")
    MyFilter61 : $Parent not contains ("410908- Interest on Hire Purchase")
    MyFilter62 : $Parent not contains ("410909- Interest on Vehicle Loan")
    MyFilter63 : $Parent not contains ("410910- Legal Expenses")
    MyFilter64 : $Parent not contains ("410911- Legal Fee")
    MyFilter65 : $Parent not contains ("410912- Loss on Sale of Assets")
    MyFilter66 : $Parent not contains ("410913- Meeting Expenses- Board")
    MyFilter67 : $Parent not contains ("410914- Meeting Expenses- Office")
    MyFilter68 : $Parent not contains ("410915- Misc. Expenses")
    MyFilter69 : $Parent not contains ("410916- Participation Fees")
    MyFilter70 : $Parent not contains ("410917- Prior Period Expenditure")
    MyFilter71 : $Parent not contains ("410918- Recruitment Expenses")
    MyFilter72 : $Parent not contains ("410919- Shared Institutional Overhead")
    MyFilter73 : $Parent not contains ("410920- Written off Assets")
    MyFilter74 : $Parent not contains ("410921- Written off Bad Debts")
    MyFilter75 : $Parent not contains ("410922- Written off Stock")
     
    Johar likes this.


  2. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Wow....that is a long list of FILTERS.....75 nos..........!!!

    What will happen If someone changes........"410101- Grant To Partners" to "410101- Grants To Partner"
     


  3. kapil22

    kapil22 Member


    this "410101- Grants To Partner" does not exist so can't available to select in voucher ledger field. 75 nos filter write due to can't formalized the shorter way. if you can help, most welcome. but is there any way to apply condition to this filter applicable on particular date onward.
    thanks Amit ji,
    Regards,
    Kapil
     


  4. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    You have totally missed the point.
    What will happen If someone changes........"410101- Grant To Partners" to "410101- Grants To Partner"
    Alters the Name from A to B .... means you will have to update the code everytime the NAME has been changed.

    You query in POST 1 is not clear........ you want Debtors/Creditors Ledgers to be displayed ONLY ????
    What are the numbers in your Group Name?
    Explain what you mean by Filter from particular date onwards??
     


  5. kapil22

    kapil22 Member


    these are groups "410101- Grant To Partners" which contains some ledger, i unlisted in VLedTable Collection by filter by Ledger Parents.
    yes these "410101- Grant To Partners" are under the parent (group) of "4100- Expenditure" but can't filter by this group as another sub group "4141- Pro Expense" related ledger need to show in this VLedTable collection.
    following structure will clear explain:
    4100- Expenditure
    410101- Grant To Partners
    Ledger a
    Ledger b
    410102- Project Activity Expenses
    410103- Certification Charges
    (these sub group ledger to filter and to show upto particular date)

    4141- Pro Expense
    Ledger aa
    Ledger bb
    (these sub group ledger to show on particular date onward)

    thanks
    kapil
     


  6. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    You can add a FIELD in the Ledger Master........e.g. Ledger Creation Date.........and define the same in the Object:ledger

    Then use that value to filter the Collection of Ledgers on or after a particular date.
     


  7. kapil22

    kapil22 Member


    thanks Amit ji
     


  8. kapil22

    kapil22 Member


    Dear Amit Ji,
    i got another way to do this which as follow:

    [System : Formula]
    MyFilter : if $$Date:##VARVchDate >= $$Date:"20210401" then @@Filter20 else @@Filter21
    ;; where @@Filter20 eliminate those ledger which i do not want on date 01-04-2021 onwards
    ;;and @@Filter21 eliminate those ledger which i do not want on date before 01-04-2021

    I am learning.
    Thanks
    Kapil
     


  9. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Very Good Kapil..... but for a good code, it is best NEVER to have any type of hard coded values except TITLES and INFOs.......

    Instead of -- $$Date:"20210401" ...... am sure you can work out to use........YearBeginDate of current company and current FY.

    Keep going.
     


  10. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    And how will the Formula know if the Ledger is before "Date" or after "Date" .... have you made a created Field ??
     


Share This Page