Collection Name Needed - Stock Vouchers

Discussion in 'Tally Developer' started by Adeshwar Mehta, Oct 14, 2022.

    

  1. Hi,
    Can someone guide me to the collection for stock item details so that I can compute and fetch the UDF from there for my report.
    As you can see I have been able to fetch the mobile number correctly from the ledger. Problem is i need to fetch the UDF and for that i either need to amend the collection or add fetch there. my code is as under

    If there is something wrong that i am doing please do guide me in the right direction.. I scrolled through the entire Developer of Inventory Collections and Stock Voucher coll did not make any progress..

    Code:
    [#Line: DSP VchInv1Titles]
    Add :Field : After: DSP VchAcctTitle : Area
    
       
    [Field: Area]
    Use: Short Name Field
    Set as: "Area"
    Skip: Yes
    Align: Right
    Style: Normal Bold
    Width:20
    
    
    [#Line: DSP VchInvDetail]
        Add: Left Fields: After: DSP VchItemAccount : AreaName
       
       
    [Field: AreaName]
    Use: Short Name Field
    Set as: $owneritemarea
    Skip: Yes
    Align: Right
    Style: Normal Bold
    Width:20
    
       
    [#Collection: Stock Voucher Template]
        Fetch    : ledgerName, Ledgermobile,LedgerEntries.*,ledgerentries.Arealedger
        Compute: OwneritemArea : $Arealedger:Ledger:$PartyLedgername
     

    Attached Files:



  2. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    $owneritemarea:Ledger:#dspVchItemAccount
     



  3. Thanks.. It worked.. I had actually tried it but again made a stupid mistake of changing the company which did not have the udf stored in those ledgers.. Facepalm..
    If you can help me in one more small thing I want to use filters using the UDF fetched Value.. Should i change the default Report DSP Template or which is the report for Stock Vouchers that I need to add button and filter to
     


  4. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    You can use your filters anywhere ... if in your report the desired values are coming, then you can use it in the collection of that report, it will work.
     



  5. Thats the thing.. I still havent been to exactly pin point the collection that is used by stock vouchers.. or is it stock voucher template itself??
     


  6. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Collection : Vouchers of Stock Item
     


  7. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Stock Voucher Template ......... or for that matter any other Report/Form/Part/Line/Field having the name "template" means exactly that........just a template..... it contains only the core and common values to be used and not the main things...like type, compute, style etc etc.........
     


  8. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Also Note --- Any templates --- are being used by other Reports also..... so any changes in Templates will affect the other reports too........

    So I do not suggest / recommend any changes to any templates.
     



  9. This is my code and now what has happened is everything is blank
    If i remove the line Filter: AreaFilter1 .. all vouchers get displayed normally

    What am I doing wrong.

    Code:
    
    [#Line: DSP VchInv1Titles]
    Add :Field : After: DSP VchAcctTitle : Area
    
       
    [Field: Area]
    Use: Short Name Field
    Set as: "Area"
    Skip: Yes
    Align: Right
    Style: Normal Bold
    Width:20
    
    
    [#Line: DSP VchInvDetail]
       Add: Left Fields: After: DSP VchItemAccount : AreaName
       
       
    [Field: AreaName]
    Use: Short Name Field
    Set as: $owneritemarea
    Skip: Yes
    Align: Right
    Style: Normal Bold
    Width:20
    
       
    [#Collection: Vouchers of Stock Item]
       Fetch   : ledgerName, Ledgermobile,LedgerEntries.*,ledgerentries.Arealedger
       Compute: OwneritemArea : $Arealedger:Ledger:$ledgername
       Filter: Areafilter1
       
    [#Form: Stock Vouchers]
         Add       : Button     : AreaFilter1
         
    
      [Button:AreaFilter1]
      Key : Alt+[
      Title : Area
       Action : Execute : AreaFilter1
                                                   
      [Variable:AreaChqVar1]
      Type : String
    
      [System:Variable]
      Areaname : ""
      AreaChqVar1 : ""
       
      [Report:AreaFilter1]
      Form : AreaFilter1
      Set : AreaChqVar1 : "Filter"
    
      [Form:AreaFilter1]
      Part : Areafilter1
      No Confirmation : Yes
    
      [Part:Areafilter1]
      Line : Areafilter1
    
      [Line:Areafilter1]
      Field : Medium Prompt,Areafilter1
      Local : Field : Medium Prompt : Set as : "Select Area Name: "
    
      [Field:Areafilter1]
      Table : AreaNameCollection,EndOfList
      ShowTable : Always
      Use : Name Field
      Width : 20
      Border : Thin Box
      Variable : Areaname
      Modifies : AreaName
       
    [System: Formulae]
       Area1Wise : $OwneritemArea=@@Area1EOL
      Area1Full : $OwneritemArea=$OwneritemArea
      Area1EOL : if $$IsEndOfList:##AreaName then $OwneritemArea Else ##AreaName
      AreaFilter1 : if ##AreaChqVar1="Filter" Then @@Area1Wise Else @@Area1Full
     



  10. Since there are two tdls Involved have mailed you both the TDLs to be able to Guide Further what the issue is.. Whenever you are free and if you get time do guide ..
     


  11. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Where is the Variable --- AreaName ?? Define it and the other variables.
     



  12. That is defined in another TDL .. You mean to say I need to change the variable now ??? What would be the new variable for it to be mapped correctly.
     


  13. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    could not find in above code, so asked........... Rest code is fine.......... but i think there is problem in your filter formula.
     



  14. Well this formula was working in the other TDL ... I Noticied one difference though.. There the collection was Type : voucher.. her the collection is Type : vouchers : stock item .. will that make any difference???

    If not I am lost.. Have sent you both when you get time pls have a look and revert.. This is the last bit required to complete most of what I wanted from Tally on a daily basis..
     


  15. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Yes there is a difference in time taken to collect the data .......... the more definite instructions one can give, will take less time....
    Type : Voucher .... will collect all the vouchers and the filter it as per given conditions
    Type : voucher : stockitem ... will collect all vouchers having a stockitem .... hence will take less time

    will check your code in a few days....
     



  16. @Amit Kamdar I did a very simple thing to solve it. i used the button filter already defined in another TDL ( Smarea) which i have mailed to you and the filter is working fine. But the new hiccup is that it remembers the previous filter. So if i have filtered for x , it by default remembers x every time i open a stock item report. What do i need to change to ensure that it always starts from fresh and resets to normal once the report is exited..

     


Share This Page