Button to Show All Items Including Zero

Discussion in 'Tally.ERP 9' started by Hasan@123, Sep 2, 2020.

Tags:
  1. Hasan@123

    Hasan@123 Member


    Dear developers,
    I have added a button in my report to show all stock items including zero values but it is not working. Please check my code.

    [#Menu: Gateway of Tally]
    Add: Item: before : @@locBalanceSheet :price List : Display: HAS_Price List


    [Report: HAS_Price List]

    Form : HAS_Price List
    Use : Dsp Template
    Title : "Price List 2.0"
    Variable: ExplodeFlag, Stock Group Name
    Local:Collection:Smpl StkGrp Items:Sort:Default:$ClosingBalance ;;;16062020
    Local:Collection:Smpl StkGrp Items:Add:Filter:Zerovaluehasan ;;;16062020


    [Form: HAS_Price List]

    Part : HAS_Price List, HAS_Price List Details, HasLine1
    Background : White, Light Orange
    Button : Change Period, Explode Flag,
    Buttons : PrintButton, ExportButton, UploadButton, MailButton, ShowAllItems
    BottomButton : BlankButton, RelReports, InvReports, AcctReports, Report Operations, /*StatRegConfigure,*/ FilterButton, ValueButton
    Keys : Form Remove Line, Form Show Last Removed Line

    Height : 100 % Screen
    Width : 100 % Screen


    [Part: HAS_Price List]

    Lines : HASPrtHdr

    [Line: HASPrtHdr]

    Field : Name Field
    Right Field : DSP MainDateTitle
    Field : HASFldHrd
    Local : Field : Name Field : Style : Normal Bold
    Space Bottom : 1.5

    [Field: HASFldHrd]

    Set As : "PRICE LIST"
    Style : Normal Bold
    FullWidth : Yes
    Border : Thin Bottom
    Align : Centre
    Skip : Yes
    Fixed : Yes
    Width : 50% Screen



    [Part: HAS_Price List Details]

    Lines : HAS_Price List Title, HAS_Price List Details
    Repeat : HAS_Price List Details : Smpl Stk Grp and Item Coll

    Total : HAS_Price List Item Price, HAS_Price List Item Qty, HAS_Price List Item Value,
    Scroll : Vertical
    Common Border : Yes

    [Part : HasLine1]

    Line: HasLine


    [Line : HasLine]

    Field : simplefield

    Local : Field : simplefield : info : "Hasan"

    Local : Field : simplefield : style : hasfont
    Local : Field : simplefield : Background : Black
    Local : Field : simplefield : fullwidth : Yes
    Local : Field : simplefield : align : center
    Local : Field : simplefield : width : 15
    Local : Field : simplefield : color : white
    Local : Field : simplefield : skip : yes


    [Style : hasfont]

    Font : "Times New Roman"
    Height : 10
    Bold : Yes



    [Line: HAS_Price List Details]

    Fields : HAS_Price List Item Name
    Right Field :HAS_Price List Item Desc, HAS_Price List Item Price, HAS_Price List Item Qty, HAS_Price List Item Value
    Explode : Smpl Stk Grp Item Details : $$IsStockGroup AND (##ExplodeFlag OR $$KeyExplode)

    Option : Smpl IsStock Item : $$IsStockItem
    Space Bottom: 2 mms


    [Part: Smpl Stk Grp Item Details]

    Line : Smpl Stk Grp Item Details
    Repeat : Smpl Stk Grp Item Details : Smpl Stk Grp and Item Coll

    [Line: Smpl Stk Grp Item Details]

    Use : HAS_Price List Details


    [Line: HAS_Price List Total]

    Use : HAS_Price List Details

    Local : Field : Default : Type : String
    Local : Field : HAS_Price List Item Name : Align : Center




    [Line: HAS_Price List Title]

    Use : HAS_Price List Details

    Local : Field : Default : Type : String
    Local : Field : HAS_Price List Item Name : Set As : "Particulars"

    Local : Field : HAS_Price List Item Price : Set as : "Price"
    Local : Field : HAS_Price List Item Qty : Set As : "Closing Stock"

    Local :Field : Default : Style : Normal Bold
    Local :Field : Default : Align : Centre

    Border : Column Titles


    [Field: HAS_Price List Item Name]

    Use : Name Field
    Set As : $Name

    Option : Smpl Stk Grp Item Name : $$IsStockItem
    Option : Smpl Stk Grp Name : $$IsStockGroup
    Color: Black
    Quick Search: Yes





    [!Field: Smpl Stk Grp Name]

    Variable: Stock Group Name
    Display : HAS_Price List

    Alter : Stock Group
    Variable: StockGroupName
    Color : Black


    [!Field: Smpl Stk Grp Item Name ]

    Variable: Stock Item Name
    Display : Item Monthly Summary
    Style : small Bold

    Alter : Stock Item

    [FIELD: HAS_Price List Item Price]
    Use : SIMPLE FIELD
    Set As : $$GetPriceFromLevel:$StockItemName:"Pricelist":##SvCurrentDate:$ClosingBalance
    Storage : PriceListRte
    Width : 25
    Style : Normal
    Border : Thin Left
    Align: Center


    [Field: HAS_Price List Item Qty]

    ;Use : Qty Primary Field
    ;Type: Number: Forced
    ;Set Always: Yes
    Width : @@NameWidth
    Set As : $ClosingBalance
    Color : Black
    Style : Normal
    Border : Thin Left
    Align: Center










    [Collection: Smpl Stk Grp and Item Coll]

    Collection : Smpl Stk Grp Coll, Smpl StkGrp Items


    [Collection: Smpl Stk Grp Coll]

    Type : Stock Group
    Child Of: #StockGroupName
    Fetch : Name, Closing Balance, Closing Value

    [Collection: Smpl StkGrp Items]

    Type : Stock Item
    Childof : #StockGroupName
    Fetch : Name, Closing Balance, Closing Value
    Compute : IntQtyOpBal :$$AsSignedQty:$$GodownItemValue:mad:@IntFGPET:$StockItemName:$OpeningBalance

    [System: Formula]
    IntFGPET : "Finished Good PET";"Finished Goods - Int"
    Zerovaluehasan:$ClosingBalance > 0 ;;;16062020




    [Button: ShowAllItems]
    Key:F6
    Title: "Show All Items"
    Action: Alter: HasShowAllItems

    [Report: HasShowAllItems]
    Object: company
    Form: HasShowAllItems

    [Form:HasShowAllItems]
    Top Part:HasShowAllItemsTop
    Full Width:No
    No Confirmation:Yes
    Space Bottom: 3 MM
    Space Left: 4 MM
    Space Right: 4 MM
    Space Top: 3 MM

    [Part:HasShowAllItemsTop]
    Line:HasShowAllItemsTop

    [Line:HasShowAllItemsTop]
    Field:MEDIUM PROMPT,HasShowAllItemsTop
    Local:Field:MEDIUM PROMPT:Set as:"Show All Items"
    Space Bottom: 1 MM


    [Field:HasShowAllItemsTop]
    Use:LOGICAL FIELD
    Set as:$$Value
    Storage:HasShowAllItems


    [System:UDF]
    HasShowAllItems:Logical:1660
     

    Attached Files:

    Last edited: Sep 2, 2020


  2. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    You need to use Variable in your Field --- HasShowAllItemsTop

    And Alter your formula -- Zerovaluehasan --- accordingly.
     


  3. Hasan@123

    Hasan@123 Member


    dont know how it can be done.
     


  4. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    [Button: ShowAllItems]
    Key:F6
    Title: "Show All Items"
    Title : If ##AllItemsShow = "All Items" Then "Show All Items" Else "Only Non-Zero"
    Action : Set : AllItemsShow : If ##AllItemsShow = "All Items" Then "Only Non-Zero" Else "All Items"

    Define variable "AllItemsShow" in Report and also set the same........
    Also define the variable........
    And then change your Formula for "Zerovaluehasan"

    You have to do it.........you can do it.
     
    Jaydeep Shah likes this.


Share This Page