Party wise Item sales, filter not working properly

Discussion in 'Tally Developer' started by Ria, Oct 31, 2021.

    
  1. Ria

    Ria Member


    With this code, upon using then item filter, only a single party with sales of that item is shown.

    Can someone point out where is the mistake in this code so that the filters work properly?

    Code:
     ;[#Field: SVtODate]
       
    ;    Add: On:  Accept    : Yes: Call: AESLogTime
    ;    Add: On:  Accept        : Yes: Field Accept
       
    
    [Function    : AeslogTime]
        100        :    Log: @@MachineTime
       
    
    [#Menu : Gateway of Tally]
       
        Add : Item : Before : @@locBalanceSheet    : TDL Reports    : Menu    : AES Reports
       
       
    [Button : ExplodeItmBtn]
       
        Key            : Ctrl + T
        Title        : "Explode Items"
        Action        : Set    : ExplodeItms    : NOT ##ExplodeItms
        ;Inactive    : NOt ##ExplodeGrps
       
    [System : Variable]
       
        ExplodeItms    : NO
       
    [Variable    : ExplodeItms]
       
        Type    : Logical
       
    
    [System    : Variable]
        v_mgc_Is_ItemFilterOn    : No
        v_Mgc_Is_PartyFilterOn    : No
        v_Mgc_StockItem            : ""
        v_Mgc_PartyName            : ""
        v_Mgc_Is_FiltersOff        : Yes
        v_Mgc_StockGrp            : ""
        v_mgc_Is_GrpFilterOn    : No
    
       
    [Variable    :v_Mgc_Is_FiltersOff]
        Type    : Logical
       
    [Variable    :v_Mgc_StockItem]
        Type    : String
       
    [Variable    :v_Mgc_PartyName]
        Type    : String
    
    [Variable    : v_Mgc_Is_ItemFilterOn]
        Type    : Logical
    
    [Variable    : v_Mgc_Is_PartyFilterOn]
        Type    : Logical
       
    [Variable    :v_Mgc_StockGrp]
        Type    : String
       
    [Variable    : v_mgc_Is_GrpFilterOn]
        Type    : Logical
    
    
    [Button: MGC_ChangeItem]
    
        Key         : F3
        Action         : Call: MGC_Is_ItemFilterOn
        Title       : $$LocaleString:"Filter Item"
        ;Inactive    : ##v_mgc_Is_ItemFiterOn
    
    [Button: MGC_ShowAll]
    
        Key         : F5
        Action         : Call: SetFiltersOff
        Title       : $$LocaleString:"Show All"
        Inactive    :  ##v_mgc_Is_FiltersOff ;Or (NOT ##v_mgc_Is_ItemFiterOn Or NOT ##v_mgc_Is_PartyFiterOn)
    
    [Function    :    SetFiltersOff]
       
        ;200        : If: NOT ##v_mgc_Is_FiltersOff
        300        :    Set: v_Mgc_Is_ItemFilterOn  : No
        400        :    Set: v_Mgc_Is_PartyFilterOn : No
        450        :     Set: v_mgc_Is_GrpFilterOn   : No
        ;500        : Else
    ;    600        :    Set: v_mgc_Is_ItemFiterOn  : Yes
    ;    700        :    Set: v_mgc_Is_PartyFiterOn : Yes
    ;    750        :     Set: v_mgc_Is_GrpFiterOn   : Yes
        ;800        : End If
        900        : Set: v_mgc_Is_FiltersOff : No;t ##v_mgc_Is_FiltersOff
       
    [Function    : MGC_Is_ItemFilterOn]
        100        : Set    : v_Mgc_Is_ItemFilterOn : Yes
        200        : If  : NOT ##v_Mgc_Is_ItemFilterOn
        350        :     Set: v_mgc_Is_FiltersOff : No
        400        : Else
        450        :    Set    : v_Mgc_StockItem : ""
        500        : End If
        550        :      Modify Variables : MGC_Change Item
        600        : Set    : v_Mgc_Is_ItemFilterOn : Yes
        900        : Set: v_mgc_Is_FiltersOff : No
    
    [Report: MGC_ChangeItem]  ;; Auto Report
    
                Use     : Modify Variables
                Delete    : Form
                Form    : MGC_ChangeItem
                Local   : Part : Modify Variables : Lines          : MGC_ChangeItem
                Local   : Field: MV Title         : Info           : $$LocaleString:"Filter Item"
                Title    : $$LocaleString:"Filter Item"
               
    [Form: MGC_ChangeItem]
                Use     : Modify Variables
                Set        : vTuaFilterRefresh : No
                Add     : On    : Form Accept: Yes:  Form Accept
    
                [Line: MGC_ChangeItem]
    
                    Field : Short Prompt, MGC_ChangeItem
                    Local : Field : Short Prompt : Info : "Stock Item"
    
                    [Field: MGC_ChangeItem]
    
                          Use            : Name field
                        Table        : MGC_FilterItm
                        Set as        : ##v_Mgc_StockItem
                        Modifies    : v_Mgc_StockItem
                        Set Always    : Yes
                        Show Table    : Always
                ;        Skip Forward: Yes
                        On            : Accept    : Yes:     Set    : v_Mgc_StockItem    : $$Value
                        On            : Accept    : Yes:     Field Accept
                        Style        : Tiny Bold
                        Validate    : NOT $$IsEmpty:$$Value
                        Dynamic        : ""
                   
    [Collection : MGC_FilterItm]
       
        Type        : StockItem
        Belongs To    : Yes
        Title       : $$LocaleString:"List of Stock Items"
        Format        : $Name, 20
    ;---------------------------------------------------------------------------------------------------------------------------------------------
    [Button: MGC_ChangeParty]
    
        Key         : Alt + b
        Action         : Call: MGC_Is_PartyFiterOn
        Title       : $$LocaleString:"Filter Party"
        ;Inactive    : ##v_mgc_Is_PartyFiterOn
    
       
    [Function    : MGC_Is_PartyFiterOn]
       
        100        : Set    : v_Mgc_Is_PartyFilterOn : Yes
        200        : If      : NOT ##v_Mgc_Is_PartyFilterOn
        350        :     Set: v_mgc_Is_FiltersOff : No
        400        : Else
        450        :    Set    : v_Mgc_PartyName : ""
        500        : End If
        550        :      Modify Variables : MGC_Change Party
        600        : Set    : v_Mgc_Is_PartyFilterOn : Yes
        900        : Set: v_mgc_Is_FiltersOff : No
       
    [Report: MGC_ChangeParty]  ;; Auto Report
    
                Use     : Modify Variables
                Delete    : Form
                Form    : MGC_ChangeParty
                Local   : Part : Modify Variables : Lines          : MGC_ChangeParty
                Local   : Field: MV Title         : Info           : $$LocaleString:"Filter Party"
                Title    : $$LocaleString:"Filter Party"
               
    [Form: MGC_ChangeParty]
                Use     : Modify Variables
                           
                Add     : On    : Form Accept: Yes:  Form Accept
    
                [Line: MGC_ChangeParty]
    
                    Field : Short Prompt,  MGC_ChangeParty
                    Local : Field : Short Prompt : Info : "Change Party"
    
               
                  [Field: MGC_ChangeParty]
                        Use            : Name Field
                        Table        : MGC_FilterPrty
                        Set Always    : Yes
                        Modifies    : v_Mgc_PartyName
                        On            : Accept: Yes:  Set    : v_Mgc_PartyName    : $$Value
                    ;    Invisible    : Yes
                        On            : Accept: Yes:  Field Accept
                       
    [Collection : MGC_FilterPrty]
       
        Type        : Ledger
        Include        : Group:$$GroupSundryDebtors
        Include        : Group:$$GroupCash
        Belongs To    : Yes
        Title       : $$LocaleString:"List of Ledgers"
        Format        : $Name, 20             
       
    
    
    [Button: MGC_ChangeGrp]
    
        Key         : F4
        Action         : Call: MGC_Is_GrpFiterOn
        Title       : $$LocaleString:"Filter Group"
    ;    Inactive    : ##v_mgc_Is_GrpFiterOn
    
    [Function    : MGC_Is_GrpFiterOn]
    
        100        : Set    : v_mgc_Is_GrpFilterOn : ON
        200        : If      : Not ##v_mgc_Is_GrpFilterOn
        350        :     Set: v_mgc_Is_FiltersOff : No
        400        : Else
        450        :    Set    : v_Mgc_StockGrp : ""
        500        :    Set    : v_Mgc_StockItem : ""
        550        :     Set    : v_mgc_Is_ItemFilterOn : No
    
        600        : End If
        650        :  Modify Variables : MGC_Change Grp
    
        700        : Set    : v_mgc_Is_GrpFilterOn : Yes
        900        : Set: v_mgc_Is_FiltersOff : No
       
    [Report: MGC_ChangeGrp]  ;; Auto Report
    
                Use     : Modify Variables
                Delete    : Form
                Form    : MGC_ChangeGrp
                Local   : Part : Modify Variables : Lines          : MGC_ChangeGrp
                Local   : Field: MV Title         : Info           : $$LocaleString:"Filter Grp"
                Title    : $$LocaleString:"Filter Grp"
               
    [Form: MGC_ChangeGrp]
                Use     : Modify Variables
                Set        : vTuaFilterRefresh : No
                Add     : On    : Form Accept: Yes:  Form Accept
    
                [Line: MGC_ChangeGrp]
    
                    Field : Short Prompt, MGC_ChangeGrp
                    Local : Field : Short Prompt : Info : "Stock Grp"
    
                    [Field: MGC_ChangeGrp]
    
                          Use            : Name field
                        Table        : MGC_FilterGrp
                        Set as        : ##v_Mgc_StockGrp
                        Modifies    : v_Mgc_StockGrp
                        Set Always    : Yes
                        Show Table    : Always
                ;        Skip Forward: Yes
                        On            : Accept    : Yes:     Set    : v_Mgc_StockGrp    : $$Value
                        On            : Accept    : Yes:     Field Accept
                        Style        : Tiny Bold
                        Validate    : NOT $$IsEmpty:$$Value
                        Dynamic        : ""
                   
    [Collection : MGC_FilterGrp]
       
        Type        : StockGroup
        Belongs To    : Yes
        Title       : $$LocaleString:"List of Stock Groups"
        Format        : $Name, 20
    
    
    ;;;;;;;;;;;;;;
    
    [Button : AES GSTInclButton]
       
        Title    : IF ##IncludeGST then "Exclude GST" else "IncludeGST"
        Key        : Alt + U
        Action    : Set    : IncludeGST : NOT ##IncludeGST
       
    [System : Variable]
       
        IncludeGST
       
    [Variable : IncludeGST]
       
        Type    : Logical
           
    
    
    
    [Menu : AES Reports]
       
        Title    : "TDL Reports"
       
        Item : Vertical Sales Report        : Display    : AES PrtyItem Sales
        Item : Vertical Purchase Report        : Display    : AES PrtyItem Prch
       
        ;Item : Party-Item wise Sales        : Display    : AES ItmPrty Sales
        ;Item : Party-Item wise Purchase        : Display    : AES ItmPrty Prch
       
       
    [Report : AES PrtyItem Sales]
       
        Title    : "Partywise Item Sales"
        Form     : AES PrtyItem Sales
       
        Set      : svFromDate  : $$Date:$$MonthStart:@@MachineDate
        Set      : svToDate       : $$Date:$$MonthEnd:@@MachineDate
       
        ;Use        : DSP Template
       
        ;Variable    : SLedgerName, StkGrpName
       
        Option        : Dummy    : Yes
       
        On    : Load    : Yes    : Call    : SetFiltersOff
       
    
    [Form : AES PrtyItem Sales]
       
        Part         : AES PrtyItem Sales
        Background     : White
       
        ;Use            : DSP Template   
        Delete        : Buttons
        Delete        : Bottom Button
       
        Add : Buttons        :  ChangePeriod, MGC_ChangeParty, MGC_ChangeGrp, MGC_ChangeItem, MGC_ShowAll, AES GSTInclButton, ExplodeItmBtn
       
        Delete    : Page Break
       
       
    ;    On        : Focus    : Yes    : Call    : AESLogtime
       
    [Part : AES PrtyItem Sales]
       
        Parts         : AES PrtyItem Sales Title, AES PrtyItem Sales Details
        ;Bottom Part    : AES PrtyItem Sales Totals
       
        Vertical     : Yes
    
    [Part : AES PrtyItem Sales Title]
       
        Line     : Form SubTitle, DB Title
       
        Local    : Field : Form SubTitle : Info         : "Partywise Item Sales"
        Local    : Line    : DB Title         : Delete    : Field : Name Field;Local    : Field    : Name Field : Set as : ""
        Local    : Field : Default         : Align     : Center
       
    [Part : AES PrtyItem Sales Details]
       
        Line             : AES PrtyItem Sales Title, AES PrtyItem Sales Details
        Bottom Line        : AES PrtyItem Sales Totals
        Repeat           : AES PrtyItem Sales Details : PrtyItem Sales Coll
        ;Local             : Field : Default : Align : Center
       
        Total            : AES PrtyItem Qty, AES PrtyItem Amount, AES PrtyItem GST
        ;Total            : AESImpRegInvValue
       
        Scroll           : Vertical
        Common Border     : Yes
        Space Top     : 0
           
    [Part : AES PrtyItem Sales Totals]
       
        Line    : AES PrtyItem Sales Totals
       
    [Line : AES PrtyItem Sales Title]
       
        Fields         : AES PrtyItem Party
        Right Field : AES PrtyItem Qty, AESPrtyItemRate, AES PrtyItem Amount ,  AES PrtyItem GST
    
        Local : Field : AES PrtyItem Date         : Set as : "Date"
        Local : Field : AES PrtyItem Ref        : Set as : "Reference"
        ;Local : Field : AES ImpRegTruckNo        : Set as : "Truck No."
        Local : Field : AES PrtyItem Group         : Set as : ""
        Local : Field : AES PrtyItem Party       : Set as : "Party Name"
        Local : Field : AES PrtyItem Qty        : Set as : "Quantity"
        Local : Field : AES PrtyItem Amount      : Set as : "Amount"
        Local : Field : AES PrtyItem GST        : Set as : "GST"
        Local : Field : AES PrtyItemRate        : Set as : "Rate"
       
        Local : Field : AES PrtyItem Qty        : Align  : RIght
        Local : Field : AES PrtyItem Party        : Align  : Left
        Local : Field : AES PrtyItem Amount      : Align  : Right  
        Local : Field : AES PrtyItem GST        : Align  : Right
        Local : Field : AES PrtyItemRate        : Align     : Right
       
        Local : Field : Default                 : Type      : String   
        Local : Field : Default                    : Skip     : Yes
        Local : Field : Default                    : Style  : Normal Bold
        Local : Field : Default                    : Delete : Border
    
        Border : Thin top bottom
       
    
    [Line : AES PrtyItem Sales Details]
    
        Fields         : AES PrtyItem Party;, AES PrtyItem Group
        Right Field : AES PrtyItem Qty,  AES PrtyItemRate, AES PrtyItem Amount, AES PrtyItem GST
    
        Height         : 2
        ;Option      : Alter on Enter
       
        Option      : ExplodeOnEnter
        Explode        : AES PrtyItem Sales Details Expl : $$KeyExplode or ##ExplodeFlag or ##ExplodeItms
    
        Invisible    : ($$NumItems:PrtyItemSalesExplColl =0)
       
        Local        : Field : AES PrtyItem Amount    : Set as    : ($$CollAmtTotal:PrtyItemSalesExplColl:$Amount) + (If ##IncludeGST Then #AESPrtyItemGST else 0)
        Local        : Field : AES PrtyItem Qty        : Set as    : $$CollQtyTotal:PrtyItemSalesExplColl:$Qty
        Local        : Field : AES PrtyItem GST        : Set as    : $$CollAmtTotal:PrtyItemSalesExplColl:$GST
        Local        : Field : AES PrtyItemRate        : Set as    : $$Number:(#AESPrtyItemAmount)/$$Number:(#AESPrtyItemQty)
       
       
        ;Local        : Field : AES PrtyItemRate        : Set as    : ""
    ;    On        : Focus    : Yes    : Call    : AESLogtime
       
    [Part : AES PrtyItem Sales Details Expl]
       
        Line    : AES PrtyItem Sales Details Expl, Empty
        Repeat    : AES PrtyItem Sales Details Expl    : PrtyItem Sales Expl Coll
    
    
       
    [Line : AES PrtyItemSales Details Expl]
       
        Fields         : AES PrtyItem Item Expl
        Right Field : AES PrtyItem Qty, AESPrtyItemRate, AES PrtyItem Amount, AES PrtyItem GST
    
        Local          : Field : Default                : Style  : Tiny Italic
        Indent        : 2
       
        Local        : Field    : Default    : Delete    : Border
       
        Local        : Field : AES PrtyItem Amount    : Set as    : $Amount + (If ##IncludeGST Then $GST else 0)
        Local        : Field : AES PrtyItem Qty        : Set as    : $Qty
        Local        : Field : AES PrtyItem GST        : Set as    : $GST
        Local        : Field : AES PrtyItemRate        : Set as    : #AESPrtyItemAmount/$Qty;($$Number:#AESPrtyItemAmount)/($$Number:#AESPrtyItemQty)
    
    
       
    
    [Line : AES PrtyItem Sales Totals]
       
        Use        : AES PrtyItem Sales Details
       
        ;Local     : Field : AES PrtyItem Date             : Set as : "Date"
        ;Local     : Field : AES PrtyItem Ref                : Set as : "Reference"
        ;Local     : Field : AES PrtyItem Group             : Set as : "Stock Group"
        Local     : Field : AES PrtyItem Party               : Set as : "Totals"
        Local     : Field : AES PrtyItem Qty                : Set as : $$Total:AESPrtyItemQty
        Local     : Field : AES PrtyItem Amount              : Set as : $$Total:AESPrtyItemAmount
        Local     : Field : AES PrtyItem GST                : Set as : $$Total:AESPrtyItemGST
        Local    : Field : AES PrtyItem Rate                : Set as : ""
       
        Border    : Thin Top
       
        Local    : Field    : Default    : Delete    : Border   
    ;    Local    : Field    : Default    : Style        : Bold 12
        Height    : 1.5
       
        Delete    : Invisible
       
    [Style : Bold Twelve]
       
        Bold    : Yes
        Height    : 12
       
    [Field : AES PrtyItem Group]
       
        Use      : Name Field
        Width       : 20
        Set as   : ""
        Alter    : Voucher
       
       
    [Field : AES PrtyItem Group Expl]
       
        Use      : Name Field
        Width       : 20
        Set as   : $ItemGrp
        Alter    : Voucher
        Full Width    : Yes
       
    [Field : AES PrtyItem Item Expl]
       
        Use      : Name Field
        Width       : 20
        Set as   : $ItemName
        Alter    : Voucher
        Full Width    : Yes
    
       
    [Field : AES PrtyItem Party]
       
        Use             : Name Field
        Full Width        : Yes
        Set as          : $PartyName
        Style            : Normal Bold
        Quick Search    : Yes
    
    [Field : AES PrtyItem Qty]
       
        Set as  : $Qty
        Width   : 16
        Border  : Thin Left
        Align    : Right
        Use        : Qty Primary Field
       
    [Field : AES PrtyItem Amount]
       
        Use        : Amount Field
        Width      : 20
        Border  : Thin Left
        Set as    : $Amount + (If ##IncludeGST Then $GST else 0)
       
    [Field : AES PrtyItemRate]
       
        Use        : Number Field
        Width    : 10
        Border    : Thin Left
        Format    : "No Zero, dECIMAL:2"
        Align    : rIGHT
        ;Set as    : #AESPrtyItemAmount;/#AESPrtyItemQty
       
    [Field : AES PrtyItem GST]
       
        Use            : Amount Field
        Width          : 20
        Border      : Thin Left
        Set as        : $GST;$GSTRate*$$Number:$Qty
        Format        : "No Zero"
        Invisible    : ##IncludeGST
       
    
    [Report : AES PrtyItem Prch]
       
        Title    : "Partywise Item Purchase"
        Form     : AES PrtyItem Prch
       
        Set      : svFromDate  : $$Date:$$MonthStart:@@MachineDate
        Set      : svToDate       : $$Date:$$MonthEnd:@@MachineDate
       
        ;Use        : DSP Template
       
        ;Variable    : SLedgerName, StkGrpName
       
        Option        : Dummy    : Yes
       
        On    : Load    : Yes    : Call    : SetFiltersOff
    
    
    [Form : AES PrtyItem Prch]
       
        Part         : AES PrtyItem Prch
        Background     : White
       
        ;Use            : DSP Template   
        Delete        : Buttons
        Delete        : Bottom Button
       
        Add : Buttons        :  ChangePeriod,  MGC_ChangeParty, MGC_ChangeGrp, MGC_ChangeItem, MGC_ShowAll, AES GSTInclButton, ExplodeItmBtn
        ;PrintReport,
        Delete    : Page Break
       
    
    
       
    [Part : AES PrtyItem Prch]
       
        Parts         : AES PrtyItem Prch Title, AES PrtyItem Prch Details
        ;Bottom Part    : AES PrtyItem Sales Totals
       
        Vertical     : Yes
    
    [Part : AES PrtyItem Prch Title]
       
        Line     : Form SubTitle, DB Title
       
        Local    : Field : Form SubTitle : Info         : "Partywise Item Purchase"
        Local    : Line    : DB Title         : Delete    : Field : Name Field;Local    : Field    : Name Field : Set as : ""
        Local    : Field : Default         : Align     : Center
       
    [Part : AES PrtyItem Prch Details]
       
        Line             : AES PrtyItem Prch Title, AES PrtyItem Prch Details
        Bottom Line        : AES PrtyItem Prch Totals
        Repeat           : AES PrtyItem Prch Details : PrtyItem Prch Coll
        ;Local             : Field : Default : Align : Center
       
        Total            : AES PrtyItem Qty, AES PrtyItem Amount, AES PrtyItem GST
        ;Total            : AESImpRegInvValue
       
        Scroll           : Vertical
        Common Border     : Yes
        Space Top     : 0
           
    [Part : AES PrtyItem Prch Totals]
       
        Line    : AES PrtyItem Prch Totals
       
    [Line : AES PrtyItem Prch Title]
       
        Fields         : AES PrtyItem Party
        Right Field : AES PrtyItem Qty, AESPrtyItemRate, AES PrtyItem Amount, AES PrtyItem GST
    
        Local : Field : AES PrtyItem Date         : Set as : "Date"
        Local : Field : AES PrtyItem Ref        : Set as : "Reference"
        ;Local : Field : AES ImpRegTruckNo        : Set as : "Truck No."
        Local : Field : AES PrtyItem Group         : Set as : ""
        Local : Field : AES PrtyItem Party       : Set as : "Party Name"
        Local : Field : AES PrtyItem Qty        : Set as : "Quantity"
        Local : Field : AES PrtyItem Amount      : Set as : "Amount"
        Local : Field : AES PrtyItem GST        : Set as : "GST"
        Local : Field : AES PrtyItemRate        : Set as : "Rate"
    
    
        Local : Field : Default                 : Type      : String   
        Local : Field : Default                    : Skip     : Yes
        Local : Field : Default                    : Style  : Normal Bold
        Local : Field : AES PrtyItem Qty        : Align  : RIght
        Local : Field : AES PrtyItem Party        : Align  : Left
        Local : Field : AES PrtyItem Amount      : Align  : Right  
        Local : Field : AES PrtyItem GST        : Align  : Right
        Local : Field : AES PrtyItemRate        : Align  : Right
    
        Local : Field : Default                    : Delete : Border
    
        Border : Thin top bottom
       
    
    [Line : AES PrtyItem Prch Details]
    
        Fields         : AES PrtyItem Party;, AES PrtyItem Group
        Right Field : AES PrtyItem Qty,  AES PrtyItemRate, AES PrtyItem Amount, AES PrtyItem GST
    
        Height         : 2
        ;Option      : Alter on Enter
       
        Option      : ExplodeOnEnter
        Explode        : AES PrtyItem Prch Details Expl : $$KeyExplode or ##ExplodeFlag or ##ExplodeItms
    
        Invisible    : ($$NumItems:PrtyItemPrchExplColl = 0)
       
        Local        : Field : AES PrtyItem Amount    : Set as    : ($$CollAmtTotal:PrtyItemPrchExplColl:$Amount) + (If ##IncludeGST Then #AESPrtyItemGST else 0)
        Local        : Field : AES PrtyItem Qty        : Set as    : $$CollQtyTotal:PrtyItemPrchExplColl:$Qty
        Local        : Field : AES PrtyItem GST        : Set as    : $$CollAmtTotal:PrtyItemPrchExplColl:$GST
        Local        : Field : AES PrtyItemRate        : Set as    : $$Number:(#AESPrtyItemAmount)/$$Number:(#AESPrtyItemQty)
    
    ;    On        : Focus    : Yes    : Call    : AESLogtime
    [Part : AES PrtyItem Prch Details Expl]
       
        Line    : AES PrtyItem Prch Details Expl, Empty
        Repeat    : AES PrtyItem Prch Details Expl    : PrtyItem Prch Expl Coll
    
    
    [Line : AES PrtyItemPrch Details Expl]
       
        Fields         : AES PrtyItem Item Expl
        Right Field : AES PrtyItem Qty,  AESPrtyItemRate, AES PrtyItem Amount, AES PrtyItem GST
    
    
        Local          : Field : Default                : Style  : Tiny Italic
        Indent        : 2
       
        Local        : Field    : Default    : Delete    : Border
       
        Local        : Field : AES PrtyItem Amount    : Set as    : $Amount + (If ##IncludeGST Then $GST else 0)
        Local        : Field : AES PrtyItem Qty        : Set as    : $Qty
        Local        : Field : AES PrtyItem GST        : Set as    : $GST
        Local        : Field : AES PrtyItemRate        : Set as    : #AESPrtyItemAmount/$Qty;($$Number:#AESPrtyItemAmount)/($$Number:#AESPrtyItemQty)
    
    
    
    [Line : AES PrtyItem Prch Totals]
       
        Use        : AES PrtyItem Prch Details
       
        ;Local     : Field : AES PrtyItem Date             : Set as : "Date"
        ;Local     : Field : AES PrtyItem Ref                : Set as : "Reference"
        ;Local     : Field : AES PrtyItem Group             : Set as : "Stock Group"
        Local     : Field : AES PrtyItem Party               : Set as : "Totals"
        Local     : Field : AES PrtyItem Qty                : Set as : $$Total:AESPrtyItemQty
        Local     : Field : AES PrtyItem Amount              : Set as : $$Total:AESPrtyItemAmount
        Local     : Field : AES PrtyItem GST                : Set as : $$Total:AESPrtyItemGST
       
        Delete    : Invisible
        Border    : Thin Top
       
        Local    : Field    : Default    : Delete    : Border   
    ;    Local    : Field    : Default    : Style        : Bold Twelve
        Height    : 1.5
    
    ;----------------------------------------------------------------------------------------------------------------------------------------------
    
    [Collection : PrtyItem Sales Coll Src]
    
        Type            : Vouchers : Voucher Type
        Child Of        : $$VchTypeSales
        Belongs To        : Yes
        Fetch            : MasterId
        Fetch            : VoucherTypeName, Reference, Date, PartyLedgerName, PartyName, +
                          Amount, BilledQty, InventoryEntries.*
    
        Filter Var        : SItemCount    : Number : $$FilterCount:InventoryEntries:CFBKStockItemFilter2
        Filter Var        : SIGrpCount     : Number : $$FilterCount:InventoryEntries:CFBKStockGrpFilter2
    
        Filter            : For Period,  notSysLedgers
        Filter            : FltItemCount, FltGrpCount   
       
        Is ODBC Table    : Yes
    
    [Collection : PrtyItem Sales Coll]
       
        Source Collection    : PrtyItem Sales Coll Src
       
       
        Walk            : InventoryEntries;, Batch Allocations
       
        By                : PartyName                : $.PartyLedgerName
    
        Compute            : ItemName                : $StockItemName
       
        Compute            : PartyGroup            : $(Ledger, $PartyLedgerName).Parent   
       
        Compute            : ItemGrp                : $(StockItem, $StockItemName).Parent   
       
       
        Filter            :  CFBKPartyFilter3        ;,  NOtSysGrp, CFBKGrpFilter2, CFBKItemFilter2
       
        Sort            : Default                : $PartyName
       
        Is ODBC Table    : Yes
    
    [Collection    : PrtyItem Sales Expl Coll Src]
        Parm Var        : pvAesItemParty : String    :#AESPrtyItemParty
       
        Type            : Vouchers : Ledger
        Child Of        : ##pvAesItemParty
        Belongs To        : Yes
        Fetch            : MasterId
        Fetch            : VoucherTypeName, Reference, Date, PartyLedgerName, PartyName, +
                          Amount, BilledQty, InventoryEntries.*
    
    
    [Collection : PrtyItem Sales Expl Coll]
       
        Source Collection    : PrtyItem Sales Expl Coll Src
       
        Walk            : Inventory Entries;, Batch Allocations
    
       
        By                : ItemGrp                 : $(StockItem, $StockItemName).Parent
        By                : ItemName                : $StockItemName
        By                : PartyName                : $PartyLedgerName
        Compute            : PartyGroup            : $(Ledger, $PartyLedgerName).Parent
       
        Aggr Compute    : Qty                    : Sum : $BilledQty
        Aggr Compute    : Amount                  : Sum : $Amount
        Aggr Compute    : GST                    : Sum : $$AsAmount:@@PrtyGrpSalesGSTAmt
       
        Filter            : NOtSysGrp, CFBKPartyFilter4, CFBKGrpFilter2, CFBKItemFilter2;,     ;, NOtSysGrp, CFBKGrpFilter2, CFBKItemFilter2
       
        Sort            : Default    : $ItemGrp
        Is ODBC Table    : Yes
       
    [System : Formula]
       
        PrtyGrpSalesGSTexAmt    : If ##IncludeGST Then 0 Else @@PrtyGrpSalesGSTAmt
        PrtyGrpSalesGSTAmt        : If $$IsEmpty:@@PrtyGrpSalesItemGST Then 0 Else (@@PrtyGrpSalesItemGST*$Amount/100);*$$Number:$BilledQty
        PrtyGrpSalesItemGST        : $$GetGSTRate:$Date:@@Inv_GSTEntryLedgerName:$StockItemName:@@IGSTDutyHead;($(StockItem, $StockItemName).GSTDetails[Last].StatewiseDetails[1, @@IsAnyState].RateDetails[1, @@IsCGST].GSTRate)*2
    
    
    [System : Formula]
       
        For Period            : $Date >= ##svFromDate And $Date <= ##svToDate       
        notSysLedgers        : NOt $$SysName:$PartyName ;ANd $$IsGroupSundryDebtors:$PartyGroup
        PrtySalesExpl        : $PartyName = #AESPrtyItemParty
        notSysGrp            : NOT $$SysName:$ItemGrp
        CFBKPartyFilter3    : If ##v_Mgc_Is_PartyFilterOn then  $PartyName = ##v_Mgc_PartyName Else Yes
        FltItemCount        : If ##v_Mgc_Is_ItemFilterOn then ##SItemCount != 0    Else Yes
        FltGrpCount            : If ##v_mgc_Is_GrpFilterOn  then ##SIGrpCount != 0    Else Yes
    
    [System : Formula]
       
        CFBKItemFilter2        : If ##v_Mgc_Is_ItemFilterOn then $ItemName= ##v_Mgc_StockItem Else Yes
        CFBKStockItemFilter2:  If ##v_Mgc_Is_ItemFilterOn then $StockItemName = ##v_Mgc_StockItem Else Yes
        CFBKStockGrpFilter2 :  If ##v_mgc_Is_GrpFilterOn then  $(StockItem, $StockItemName).Parent= ##v_Mgc_StockGrp Else Yes
           
    [System : Formula]
       
        CFBKGrpFilter2        : If ##v_mgc_Is_GrpFilterOn then   $ItemGrp= ##v_Mgc_StockGrp Else Yes
        CFBKPartyFilter4    : (If ##v_Mgc_Is_PartyFilterOn then  $PartyName= ##v_Mgc_PartyName Else Yes) ;($PartyName = #AESPrtyItemParty) AND
       
    [Collection : PrtyItem Prch Coll Src]
    
        Type            : Vouchers : Voucher Type
        Child Of        : $$VchTypePurchase
        Belongs To        : Yes
        Fetch            : MasterId
        Fetch            : VoucherTypeName, Reference, Date, PartyLedgerName, PartyName +
                          Amount, BilledQty, InventoryEntries.*    ;BatchAllocations.*
       
        Filter Var        : SItemCount    : Number : $$FilterCount:InventoryEntries:CFBKStockItemFilter2
        Filter Var        : SIGrpCount    : Number : $$FilterCount:InventoryEntries:CFBKStockGrpFilter2
       
        Filter            : FltItemCount, FltGrpCount   
        Filter            : For Period,  notSysLedgers
       
       
        ;Filter            : PrtyFilter
    
    [Collection : PrtyItem Prch Coll]
       
        Source Collection    : PrtyItem Prch Coll Src
    
        Walk            : InventoryEntries;, Batch Allocations
    
        By                : PartyName                : $.PartyLedgerName
        Compute            : PartyGroup            : $(Ledger, $PartyLedgerName).Parent   
        Compute            : ItemName                : $StockItemName
        Compute            : ItemGrp                : $(StockItem, $StockItemName).Parent   
               
        ;Aggr Compute    : Qty                    : Sum : $BilledQty
        ;Aggr Compute    : Amount                : Sum : $Amount
        ;Aggr Compute    : GST                    : Sum : $$AsAmount:@@PrtyGrpPrchGSTAmt
       
    ;    Filter            : notSysLedgers, CFBKPartyFilter3, NOtSysGrp, CFBKGrpFilter2, CFBKItemFilter2
        Filter            : CFBKPartyFilter3
        Sort            : Default    : $PartyName
       
    [Collection : PrtyItem Prch Expl Coll Src]
       
        Parm Var        : pvAesItemParty : String    :#AESPrtyItemParty
       
        Type            : Vouchers : Ledger
        Child Of        : ##pvAesItemParty
        Belongs To        : Yes
        Fetch            : MasterId
        Fetch            : VoucherTypeName, Reference, Date, PartyLedgerName, PartyName +
                          Amount, BilledQty, InventoryEntries.BatchAllocations.*
    
    
    [Collection : PrtyItem Prch Expl Coll]
       
        Source Collection    : PrtyItem Prch Expl Coll Src
       
        Walk            : Inventory Entries;, Batch Allocations
    
        By                : ItemGrp                 : $(StockItem, $StockItemName).Parent
        By                : ItemName                : $StockItemName
        By                : PartyName                : $PartyLedgerName
        Compute            : PartyGroup            : $(Ledger, $PartyLedgerName).Parent
        Aggr Compute    : Qty                    : Sum : $BilledQty
        Aggr Compute    : Amount                  : Sum : $Amount
        Aggr Compute    : GST                    : Sum :$$AsAmount:@@PrtyGrpPrchGSTAmt
       
        Filter            : NOtSysGrp, CFBKPartyFilter4, CFBKGrpFilter2, CFBKItemFilter2
       
        Sort            : Default    : $ItemName
    
    [System : Formula]
       
        ;PrtyGrpPrchGSTexAmt        : If ##IncludeGST Then 0 Else @@PrtyGrpPrchGSTAmt
        PrtyGrpPrchGSTAmt        : If $$IsEmpty:@@PrtyGrpPrchItemGST Then 0 Else (@@PrtyGrpPrchItemGST*$Amount/100);*$$Number:$BilledQty
        PrtyGrpPrchItemGST        : $$GetGSTRate:$Date:@@Inv_GSTEntryLedgerName:$StockItemName:@@IGSTDutyHead;($(StockItem, $StockItemName).GSTDetails[Last].StatewiseDetails[1, @@IsAnyState].RateDetails[1, @@IsCGST].GSTRate)*2
    
    
    
     


Share This Page