Please Help Me to Modify This Code

Discussion in 'Tally.ERP 9' started by HAROON2015, Sep 19, 2019.

    
  1. HAROON2015

    HAROON2015 Member


    hi,
    i added a stock item named "4 OL BC" to the gate way of tally for easy accessible and set the current month for report with day wise report
    code is here
    Code:
    [#Menu : Gateway of Tally]
    
    Add : Item : 4 OL BC : Display :  All Stock ItemsS : NOT $$IsEmpty:$$SelectedCmps
    
    [Report: All Stock ItemsS]
    
    Use : Item Monthly Summary
    Set : Stock Item Name : "4 OL BC"
    Set      : SVFromDate          : $$MonthStart:##SVCurrentDate
    Set      : SVToDate            : $$MonthEnd:##SVCurrentDate
    now i want to add a button to the Report of Item monthly Summary's toolbar
    to view the previous whole months report
    for example this the current month report of stock item "4 OL BC"
    [​IMG]
    now when i press the button then show the previous month report like below
    [​IMG]

    I want to create a button to see the report of the previous month
    Code:
    [#Report : item monthly Summary]
    Local    : Form : Default : Add : Button : ShowOnlyAbovesid
    [Button         : ShowOnlyAbovesid
        Key         : F8
    Title     : ShowOnlyAbovesid
    Action     : Set      : SVFromDate          : $$MonthStart:##SVCurrentDate -31
    Action     : Set      : SVFromDate          : $$MonthStart:##SVCurrentDate -31
    
    so please help to create a button on report of item monthly summary of previous month

    hope some one will help
     

    Attached Files:

    Last edited: Sep 19, 2019


  2. hprahul

    hprahul Member


    the function $$MonthStart gives the date as 01-Month-year.
    it is not at all necessary that -31 will always give the previous month's date. as it may contain 28/29/30 days even depending on month. therefore, if you give following a try, it may help...
    Code:
    $$MonthStart:($$MonthStart:##SVCurrentDate -1)
    
    Hope this helps...
     


  3. balajimg

    balajimg Active Member


    Hope this works for you...

    [#Report : item monthly Summary]
    Local : Form : Default : Add : Button : ShowOnlyAbovesid
    [Button : ShowOnlyAbovesid
    Key : F8
    Title : ShowOnlyAbovesid
    Action : Call : ChgPrevMonth
    [Function : ChgPrevMonth]
    01 : Action : Set : SVFromDate : $$MonthStart:$$PrevMonth:##SVFromDate
    02 : Action : Set : SVToDate : $$MonthEnd:$$PrevMonth:##SVFromDate
     
    HAROON2015 likes this.


  4. HAROON2015

    HAROON2015 Member


    thanks sir
     


Share This Page