how to set Variable: SVFromDate, SVToDate in sales voucher

Discussion in 'Requests' started by Naitesh, Apr 11, 2019.

    
  1. Naitesh

    Naitesh Member


    hello experts
    please help

    [Report : RptViewHistory]
    Variable: SVFromDate, SVToDate
    Form : FrmViewHistory
    Set : SVFromDate :'01-01-2018'
    Set : SVToDate :'31-03-2019'

    how to set variables in sales voucher
     


  2. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Set : SVFromDate : $$FinYearBeg:##SVCurrentDate:$StartingFrom:Company:##SVCurrentCompany
    Set : SVToDate : $$FinYearEnd:##SVCurrentDate:$StartingFrom:Company:##SVCurrentCompany
     


  3. Naitesh

    Naitesh Member


    THANK YOU FOR REPLY SIR

    HELLO AMIT SIR,

    PREVIOUS PERIOD IS 01-4-2018 TO 31-03-2019
    CURRENT PERIOD IS 01-4-2019 TO 31-03-2020

    I WANT TO GET DATA FROM PREVIOUS PERIOD IS 01-4-2018 TO 31-03-2019 IN COLLECTION

    I HAVE CREATE BasicUserDescription LIST NEXT TO STOCKITEM
    SAME COMPANY I HAVE CREATE NEW PERIOD
    I WANT TO LIST OF BasicUserDescription OF SAME STOCKITEM OF PREVIOUS PERIOD IN COLLECTION
    CODE BELOW

    WHERE TO USE
    Set : SVFromDate : $$FinYearBeg:##SVCurrentDate:$StartingFrom:Company:##SVCurrentCompany
    Set : SVToDate : $$FinYearEnd:##SVCurrentDate:$StartingFrom:Company:##SVCurrentCompany

    I HAVE TRIED THIS BUT IT NOT SHOWS PREVIOUS PERIOD DATA

    PLEASE HELP ME TO CORRECT CODE
    THANK YOU

    [#Line: EI InvInfo]
    add:Fields:After: VCH StockItem: NUDescription1

    [#Line: EI ColumnOne]
    add:Fields: After:VCH ItemTitle : NTDescription1

    [#Line: EI ColumnTwo]
    add:Fields:After:VCH ItemTitle :NTDescription1
    Local:Field: NTDescription1:Set as:""

    [#Field: VCH ItemTitle]
    Width : 30

    [Field:NTDescription1]

    Use: Name Field
    Set as: "Description"
    Width: 20
    Align: Right
    Skip: Yes

    [Field:NUDescription1]
    Use : Name Field
    Width : 20
    Align : Left
    Set Always:Yes
    Storage:BasicUserDescription
    Table : ColCatFinal,endoflist,New Number
    Show Table : Always
    Trigger:New Number: $$IsSysNameEqual:NewNumber:$$EditData
    CommonTable : No
    Dynamic : ""
    Skip on : $$IsEnd:$StockItemName

    [System: Formula]
    FilterVchAndDate : $$IsSales:$VoucherTypeName $Date > $$Date:'31-03-2018'
    FilterVchStkItemAndCat : $StockItemName = #VCHStockItem

    [Collection : ColCatMaster]
    Type : Voucher
    Belongs To:Yes
    Fetch : BasicUserDescription
    Filter:FilterVchAndDate

    [Collection : ColCatFinal]
    Source Collection :ColCatMaster
    Belongs To:Yes
    Walk : InventoryEntries
    Format : $BasicUserDescription,30
    Title:"Item Detail"
    Fetch : BasicUserDescription
    Filter : FilterVchStkItemAndCat
     


  4. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    First of all.... Stop using CAPS......... it feels rude in internet language and also feels like shouting.........

    in Tally....data is continuous, as long as the data is not SPLIT............ You do not need specify date to call data from previous period, if the data exists in the same company.

    As for your code, I do not understand your requirement. Share screenshot with remarks for us to understand the idea that is in your mind.
     


  5. Naitesh

    Naitesh Member


    sorry sir
    thank you sir

    i have one company with two period
    01) 01-04-2018 to 31-03-2019
    02) 01-04-2019 to 31-03-2020

    while entry in sales voucher in current period 01-04-2019 to 31-03-2020
    retrieve category from previous period 01-04-2018 to 31-03-2019

    shown as image
    i use code below

    [#Line: EI InvInfo]
    add:Fields:After: VCH StockItem: NUCat

    [#Line: EI ColumnOne]
    add:Fields: After:VCH ItemTitle : NTCat

    [#Line: EI ColumnTwo]
    add:Fields:After:VCH ItemTitle : NTCat
    Local:Field: NTCat :Set as:""

    [#Field: VCH ItemTitle]
    Width : 30

    [Field:NTCat]
    Use: Name Field
    Set as: "Category"
    Width: 10
    Align: Center
    Skip: Yes

    [Field:NUCat]
    Use : NSCat
    Storage : NSCat
    Width : 10
    Align : Left
    Set Always : Yes
    Table : ColCatFinal,endoflist,New Number
    Show Table : On Empty
    Trigger:New Number: $$IsSysNameEqual:NewNumber:$$EditData
    CommonTable : No
    Dynamic : ""
    Skip on : $$IsEnd:$StockItemName

    [System: Formula]
    FilterVchAndDate : $$IsSales:$VoucherTypeName or $$IsPurchase:$VoucherTypeName and $Date > $$Date:'01-04-2018'

    [System:UDF]
    NSCat: String: 3009

    [Collection : ColCatMaster]
    Type : Voucher
    Fetch : StockItemName,NSCat,Date
    Filter:FilterVchAndDate

    [Collection : ColCatFinal]
    Source Collection :ColCatMaster
    Walk : InventoryEntries
    Format : $NSCat,15
    Title:"Category"
    Fetch : StockItemName,NSCat,Date
     

    Attached Files:

    • 002.jpg
      002.jpg
      File size:
      171.2 KB
      Views:
      77
    • 003.png
      003.png
      File size:
      145.8 KB
      Views:
      81


  6. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Try.......

    [System: Formula]
    FilterVchAndDate : $$IsSales:$VoucherTypeName or $$IsPurchase:$VoucherTypeName
     


  7. Naitesh

    Naitesh Member


    hello sir
    i tried this
    [System: Formula]
    FilterVchAndDate : $$IsSales:$VoucherTypeName or $$IsPurchase:$VoucherTypeName

    but it only shows category from current period not from previous period

    i also tried this but not get result
    [System: Formula]
    FilterVchAndDate : $$IsSales:$VoucherTypeName or $$IsPurchase:$VoucherTypeName and $Date > $$Date:'01-04-2018'

    please help
    thank you
     


  8. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    In System formula....define previous year beginning date.............. MyPrevYrFromDate .....starting from 01-04-2018

    Remove filter .... FilterVchAndDate ....from the collection...........

    and put.....in Collection -- [Collection : ColCatFinal] the below line

    Compute : NSCat : $$FromValue:mad:@MyPrevYrFromDate:$$ToValue:##SVToDate:$NSCat:StockItem:$StockItemName
     


  9. Naitesh

    Naitesh Member


    hello sir

    i tried this but not get result

    [#Line: EI InvInfo]
    add:Fields:After: VCH StockItem: NUCat

    [#Line: EI ColumnOne]
    add:Fields: After:VCH ItemTitle : NTCat

    [#Line: EI ColumnTwo]
    add:Fields:After:VCH ItemTitle : NTCat
    Local:Field: NTCat :Set as:""

    [#Field: VCH ItemTitle]
    Width : 30

    [Field:NTCat]
    Use: Name Field
    Set as: "Category"
    Width: 10
    Align: Center
    Skip: Yes
    Key : mKeyF4

    [Field:NUCat]
    Use : NSCat
    Storage : NSCat
    Width : 10
    Align : Left
    Set Always : Yes
    Table : ColCatFinal,endoflist,New Number
    Show Table : On Empty
    Trigger:New Number: $$IsSysNameEqual:NewNumber:$$EditData
    CommonTable : No
    Dynamic : ""
    Skip on : $$IsEnd:$StockItemName

    [System: Formula]
    ;FilterVchAndDate : $$IsSales:$VoucherTypeName or $$IsPurchase:$VoucherTypeName and $Date > $$Date:'01-04-2018'
    ;FilterVchAndDate : $$IsSales:$VoucherTypeName or $$IsPurchase:$VoucherTypeName and $$FinYearEnd:'01-04-2018':'31-03-2019'
    FilterVchAndDate : $$IsSales:$VoucherTypeName or $$IsPurchase:$VoucherTypeName
    MyPrevYrFromDate : '01-04-2018'

    [System:UDF]
    NSCat: String: 3009

    [Collection : ColCatMaster]
    Type : Voucher
    Fetch : StockItemName,NSCat,Date

    [Collection : ColCatFinal]
    Source Collection :ColCatMaster
    Walk : InventoryEntries
    Compute : NSCat : $$FromValue:mad:MyPrevYrFromDate:$$ToValue:##SVToDate:$NSCat:StockItem:$StockItemName
    ;Format : $NSCat,15
    Title:"Category"
    Fetch : StockItemName,NSCat,Date

    ;;===============================================
    ;In System formula....define previous year beginning date.............. MyPrevYrFromDate .....starting from 01-04-2018
    ;
    ;Remove filter .... FilterVchAndDate ....from the collection...........
    ;
    ;and put.....in Collection -- [Collection : ColCatFinal] the below line
    ;
    ;Compute : NSCat : $$FromValue:mad:@MyPrevYrFromDate:$$ToValue:##SVToDate:$NSCat:StockItem:$StockItemName
    ;;===================================================

    please help to solve
    thank you
     

    Attached Files:



  10. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    You must be getting some error message...show it here...........

    try to alter a sales voucher and exit fully.
     


  11. Naitesh

    Naitesh Member


    above code after change period shows error
    do not know what is wrong

    thank you sir for giving your precious time

    if i use this code there is no error but not get previous period category

    [System: Formula]
    ;FilterVchAndDate1 : $$IsSales:$VoucherTypeName or $$IsPurchase:$VoucherTypeName and $Date > $$Date:'01-04-2018'
    ;FilterVchAndDate : $$IsSales:$VoucherTypeName or $$IsPurchase:$VoucherTypeName and $$FinYearEnd:'01-04-2018':'31-03-2019'
    ;MyPrevYrFromDate : '01-04-2018'
    ;MyPrevYrToDate : '31-03-2019'


    FilterVchAndDate : $$IsSales:$VoucherTypeName or $$IsPurchase:$VoucherTypeName


    [System:UDF]
    NSCat: String: 3009


    [Collection : ColCatMaster]
    Type : Voucher
    Filter:FilterVchAndDate

    [Collection : ColCatFinal]
    Source Collection :ColCatMaster
    Walk : all Inventory Entries
    Format : $NSCat,15
    Title:"Category"
    Fetch : StockItemName,NSCat,Date
     


  12. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Try This............

    Code:
    [#Line: EI InvInfo]
        add:Fields:After: VCH StockItem: NUCat
               
    [#Line: EI ColumnOne]
        add:Fields: After:VCH ItemTitle : NTCat
    
    [#Line: EI ColumnTwo]
        add:Fields:After:VCH ItemTitle : NTCat
        Local:Field: NTCat :Set as:""
    
    [#Field: VCH ItemTitle]
        Width       : 30
    
    [Field:NTCat]
        Use: Name Field
        Set as: "Category"
        Width: 10
        Align: Center
        Skip: Yes
    ;    Key : mKeyF4
       
    [Field:NUCat]
        Use            : Short Name Field ;NSCat
    ;    Set as        : $$Value
        Storage        : NSCat
        Width        : 10
        Align       : Left
        Set Always    : Yes
        Table         : ColCatFinal, endoflist, New Number
        Show Table     : Always ;On Empty
        Trigger        : New Number: $$IsSysNameEqual:NewNumber:$$EditData
        CommonTable : Yes
        Dynamic     : ""   
        Skip on     : $$IsEnd:$StockItemName   
    
    [Field : NUCatStore]
        Use            : Name Field ;NSCat
        Set as        : #NUCat
        Storage        : NSCat
        Width        : 10
        Align       : Left
        Invisible    : No
    
    [System: Formula]
        FilterVchAndDate : $$IsSales:$VoucherTypeName or $$IsPurchase:$VoucherTypeName
    
    [System:UDF]
         NSCat        : String    : 3009
       
    [Collection : ColCatMaster]
    Type : Voucher
    Fetch : StockItemName,NSCat,Date
    
    [Collection : ColCatFinal]
    Source Collection :ColCatMaster
    Walk : InventoryEntries
    Compute : NSCategory : $$FromValue:@@PrevYearStart:$$ToValue:##SVCurrentDate:$NSCat
    Format    : $NSCategory,15
    Title:"Category"
    Fetch : StockItemName,NSCat,Date, NSCategory
    Filter: FilterVchAndDate
    
    
     


  13. Naitesh

    Naitesh Member


    sir i try above code given by you but not getting result
    it shows only current period category not previous period category

    thank you
     


  14. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Try this way then...... you should put little more efforts in your R & D..............

    This will give you details from "Books Starting" from as defined in Company Master.

    Code:
    [Collection : ColCatMaster]
    Type : Voucher
    Filter: FilterVchAndDate
    ParmVar        : SVFromDate    : Date    : $BooksFrom:Company:##SVCurrentCompany
    ParmVar        : SVToDate        : Date    : $LastVoucherDate:Company:##SVCurrentCompany
    
    [Collection : ColCatFinal]
    Source Collection :ColCatMaster
    Walk : InventoryEntries
    Format    : $NSCategory,15
    Title:"Category"
    Fetch : StockItemName, NSCat
    Compute : NSCategory : $NSCat
     


  15. Naitesh

    Naitesh Member


    thank you Amit Sir
    you are great

    thank you for giving your precious time

    Problem Solved

    [Collection : ColCatMaster]
    Type : Voucher
    Filter: FilterVchAndDate
    ParmVar : SVFromDate : Date : $BooksFrom:Company:##SVCurrentCompany
    ParmVar : SVToDate : Date : $LastVoucherDate:Company:##SVCurrentCompany

    [Collection : ColCatFinal]
    Source Collection :ColCatMaster
    Walk : InventoryEntries
    Format : $NSCat,20
    Title:"Category"
    Fetch : StockItemName, NSCat
     



  16. sir I had tested this code but not show in next financial year the category, Good knowledgeable thing Naitesh work hard
    [#Line: EI InvInfo]
    add:Fields:After: VCH StockItem: NUCat

    [#Line: EI ColumnOne]
    add:Fields: After:VCH ItemTitle : NTCat

    [#Line: EI ColumnTwo]
    add:Fields:After:VCH ItemTitle : NTCat
    Local:Field: NTCat :Set as:""

    [#Field: VCH ItemTitle]
    Width : 30

    [Field:NTCat]
    Use: Name Field
    Set as: "Category"
    Width: 10
    Align: Center
    Skip: Yes
    Key : mKeyF4

    [Field:NUCat]
    Use : NSCat
    Storage : NSCat
    Width : 10
    Align : Left
    Set Always : Yes
    Table : ColCatFinal,endoflist,New Number
    Show Table : On Empty
    Trigger:New Number: $$IsSysNameEqual:NewNumber:$$EditData
    CommonTable : No
    Dynamic : ""
    Skip on : $$IsEnd:$StockItemName

    [System: Formula]
    ;FilterVchAndDate : $$IsSales:$VoucherTypeName or $$IsPurchase:$VoucherTypeName and $Date > $$Date:'01-04-2018'
    ;FilterVchAndDate : $$IsSales:$VoucherTypeName or $$IsPurchase:$VoucherTypeName and $$FinYearEnd:'01-04-2018':'31-03-2019'
    FilterVchAndDate : $$IsSales:$VoucherTypeName or $$IsPurchase:$VoucherTypeName
    MyPrevYrFromDate : '01-04-2018'

    [System:UDF]
    NSCat: String: 3009
    [Collection : ColCatMaster]
    Type : Voucher
    Filter: FilterVchAndDate
    ParmVar : SVFromDate : Date : $BooksFrom:Company:##SVCurrentCompany
    ParmVar : SVToDate : Date : $LastVoucherDate:Company:##SVCurrentCompany

    [Collection : ColCatFinal]
    Source Collection :ColCatMaster
    Compute : NSCat : $$FromValue:mad:@MyPrevYrFromDate:$$ToValue:##SVToDate:$NSCat:StockItem:$StockItemName
    Walk : InventoryEntries
    Format : $NSCat,20
    Title:"Category"
    Fetch : StockItemName, NSCat

    ;;===============================================
    ;In System formula....define previous year beginning date.............. MyPrevYrFromDate .....starting from 01-04-2018
    ;
    ;Remove filter .... FilterVchAndDate ....from the collection...........
    ;
    ;and put.....in Collection -- [Collection : ColCatFinal] the below line
    ;
    ;Compute : NSCat : $$FromValue:mad:@MyPrevYrFromDate:$$ToValue:##SVToDate:$NSCat:StockItem:$StockItemName
    ;;===================================================
     
    Last edited: May 27, 2019


  17. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Where is your compute in the collection ????
     



  18. see above code once again sir
     


  19. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    See my solution.... use it like that only..... since date variable is already defined in the source collection..........

    See my post above..........
     


Share This Page