2 Collection Filter Help

Discussion in 'Tally Developer' started by Rupal Agarwal, Aug 20, 2022.

    
  1. Rupal Agarwal

    Rupal Agarwal Member


    Hello everyone,

    I have made a report which shows the sales and receipt entries side by side in 2 separate parts.
    Now I want the receipt part to show only those entries of parties to whom I have made any sale entry, and it will not show the entry of the parties to whom I have not made any sales.

    For example, according to the given pic.
    it is showing an entry of Ajay but I have not sold any product to him, I don't want this entry.

    Screenshot 2022-08-20 182025.png

    Please Help.
    My code is given below :

    Code:
    [#Menu:gateway of tally]
        Add:Item: Debtors report: Display: SaleRec
    
    [Report:SaleRec]
        Form:SaleRec
      
    [Form:SaleRec]
        Part: Entries
        Height:100% page
        Width: 100% page
        Button: change date, change period
    
    [Part:entries]
        Part:SEntries, REntries
          
    [Line:titles]
        Field: Date, Party
        Right Field:VCHName, VCH no, Amount
        Local:Field:date:Info:"Date"
        Local:Field:Party:Info:"Party"
        Local:Field:VCHName:Info:"Voucher name"
        Local:Field:VCH no:Info:"Voucher no"
        Local:Field:Amount:Info:"Amount"
        Space Bottom:0.1
        Space Top:0.1
        Border:thinbox
    
    ;;================================================================  
    
    [Part:SEntries]
        Line:head, titles, entries
        Bottom Line:total
        Repeat:Entries:SalesColl
        Scroll:Vertical
        Width: 50% Page
        Border:thinbox
    ;    Background:@@SV_SALESVOUCHER
        Total:amount
    
        ;;======================================
    
    [Part:REntries]
        Use:SEntries
        Repeat:Entries:RecColl
        Local:Field:head:Info:"List of all Receipt entries"
    
    ;;================================================================  
    
    [Line:head]
        Field:head
        Space Bottom:0.2
        Space Top:0.2
        Border:thin box
      
    [Field:head]
        Use:name field
        Set as:"List Of all Sales entries"
        Align:Center
        Width:50% screen
    
    ;;================================================================  
    
    [Line:total]
        right Field:total title,total
        Border:thin box
      
    [Field:total title]
        Use:Short prompt
        Info:"Total Sales : "
      
    [Field:total]
        Use : number field
        Set as:$$Total:amount
        Width:20
        Align:Right
        Format      : "Symbol, No Zero,"
    
    ;;================================================================  
    
    [Line:entries]
        Field: Date, Party
        Right Field:VCHName, VCH no, Amount
    
    [Field:date]
        Use:Short Date Field
        Set as:$date
        Style:normal
    
    [Field:party]
        Use:name field  
        Set as:if not $partyledgername = "" then $partyledgername else "       "+$$LocaleString:"((cancelled))"
      
    [Field:Vchname]
        Use:short name field
        Set as:$vouchertypename
        Style:normal
      
    [Field : Vch no]
        Use:short name field
        Set as : $vouchernumber
        Style:normal
      
    [Field:amount]
        use:amount field
        Set as:$amount
        format      : "Symbol, No Zero"
        Style:normal
    
    ;;================================================================
    
    [Collection:SalesColl]
        Type:vouchers:vouchertype
        Child Of:$$VchTypeSales
        Belongs To:Yes
        Fetch:date, partyledgername, vouchertype, vouchernumber, amount
      
    [Collection:RecColl]
        Type:vouchers:vouchertype
        Child Of:$$VchTypeReceipt
        Belongs To:Yes
        Fetch:date, partyledgername, vouchertype, vouchernumber, amount
        Filter: RecFilter
    ;;================================================================
    
    [System:Formula]
        RecFilter: not $Partyledgername = $$CollectionField:$partyledgername:1:SalesColl
     


  2. Bipin Damania

    Bipin Damania Active Member


    In RecColl Filter only Ledger under Sundry Debtors
     


  3. Rupal Agarwal

    Rupal Agarwal Member


    Sir, in my case both the ledgers are under Sundry Debtors only. :oops:

    In the pic above Ajay is also under Sundry Debtors, but he paid his previous balance amount, and I want the list of current sales and receipts only.
     


  4. Bipin Damania

    Bipin Damania Active Member


    Then you have to try
    Filter only those Ledger have Sales Transactions
    Or
    Bill wise Receipt
     


  5. Rupal Agarwal

    Rupal Agarwal Member


    Sir, can you please guide me on how to do this?
     


  6. Anshul Garg

    Anshul Garg Member


    RecFilter: $$FIletr:$Partyledgername; =$$CollectionField:$partyledgername:1:SalesColl

    [Function:FIletr]
    Parameter:abc:String
    Variable:inc:Number:0
    Variable:xyz:Number:0
    Return:Logical
    fetch object:partyledgername
    01:Log :##inc
    02:Walk Collection:SalesColl
    03:Increment:inc

    04:Log :$partyledgername

    10:if : $partyledgername=##abc ;$$CollectionField:$partyledgername:##inc:SalesColl =abc then yes
    15:Increment :xyz

    20:End If
    25:End Walk
    ;26:log
    30:If:##xyz=0
    35:Return:False
    40:Else
    45:Return:True
    50:End If



    try this
     


  7. Rupal Agarwal

    Rupal Agarwal Member


    Not working :(
     


  8. Anshul Garg

    Anshul Garg Member


    give screen shot of error it is generating bcoz its working for me
     


Share This Page