Sales Colllection Not showing all Sales Vouchers

Discussion in 'Tally & TDL Learning HUB' started by A V C BAGA RAO, Oct 23, 2022.

    
  1. A V C BAGA RAO

    A V C BAGA RAO New Member


    [Collection : LearnwellSalesColl]
    Title : "Voucher"
    Type : Vouchers:VoucherType
    Fetch:VoucherNumber,VoucherDate,Reference,ReferenceDate,PartyName,BasicBuyerName,BasicBuyerAddress,PartyAddress,StateName,CountryofResidence,PartyGSTIn,PlaceofSupply
    Fetch:ConsigneeStateName,ConsigneeGSTIn,Narration
    Fetch:InventoryEntries.StockItemName
    Child Of:$$VchTypeSales

    I am using the above code to generate a GST report for pivot table provided by Learnswell. We have 3 Voucher types under sales 1. Sales, 2. Domestic Sales, 3. Export Sales. This collection is working for Voucher Type Sales only and not working for Other two types, even we change this "Child Of:$$VchTypeSales" to Sales Domestic.

    I dont know much about TDL.
     


  2. Himanshu-2002

    Himanshu-2002 Active Member


    Add two things
    Type:Voucher
    Filter:IsSalesVch
     
    A V C BAGA RAO likes this.


  3. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    When you use ..... $$VchTypeSales ... it covers all types defined under the parent VoucherGroup SALES ......

    If you want only Export then --- $VoucherTypeName CONTAINS "Export" (Whatever name your ExportSales is defined as).......... and use this as a filter in the collection.
     


  4. Sai Vineeth

    Sai Vineeth Active Member


    You need to use
    Code:
    Belongsto:True
    If belongsto is true, then it will fetch sales vouchers and vouchers defined under sales voucher types like domestic or export sales (Refer this https://help.tallysolutions.com/article/DeveloperReference/tdlreference/objects_and_collections.htm - Search for BelongsTo)
    Code:
    [Collection : LearnwellSalesColl]
    Title : "Voucher"
    Type : Vouchers:VoucherType
    Fetch:VoucherNumber,VoucherDate,Reference,ReferenceDate,PartyName,BasicBuyerName,BasicBuyerAddress,PartyAddress,StateName,CountryofResidence,PartyGSTIn,PlaceofSupply
    Fetch:ConsigneeStateName,ConsigneeGSTIn,Narration
    Fetch:InventoryEntries.StockItemName
    Child Of:$$VchTypeSales
    Belongsto:True
    
    or else
    use @@IsSalesVch($$IsSales:$VoucherTypeName ),
    $$IsSales function returns true if voucher type is sales or child of sales voucher type
    whereas $$VchTypeSales function only return sales
    Code:
    [Collection : LearnwellSalesColl]
    Title : "Voucher"
    Type : Vouchers
    Fetch:VoucherNumber,VoucherDate,Reference,ReferenceDate,PartyName,BasicBuyerName,BasicBuyerAddress,PartyAddress,StateName,CountryofResidence,PartyGSTIn,PlaceofSupply
    Fetch:ConsigneeStateName,ConsigneeGSTIn,Narration
    Fetch:InventoryEntries.StockItemName
    Filter:IsSalesVch
    
     
    Last edited: Oct 24, 2022


  5. A V C BAGA RAO

    A V C BAGA RAO New Member


    Thanks it worked.

     


Share This Page