Customer wise Stock Group Sales Report

Discussion in 'Tally Developer' started by K Vinod Kumar, Dec 12, 2012.

    
  1. K Vinod Kumar

    K Vinod Kumar New Member


    Dear Members,
    I have written a TDL for customer wise stock group sales report. The output shows the names of the customers but for some customers the values are not shown (inspite of having transactions for the particular stock group).
    Kindly advice me on this. As I'm unable to attach the code files. I'm here with listing the same
    in this file.


    ;; Om Hari Sri Ganapateya Namah: Om Namah Sivaya: Om Namo Narayanaya: Amme Narayana Devi Naryana


    [Collection : SL PSGS StockGroup Coll]
    Use : List of StockGroups Extract
    Variable : Stock Group Name
    Report : SL PSGS Report
    Trigger : Stock Group Name
    Fetch: Name


    [Report: SL PSGS Report]

    Use: DSP Template
    Form: SL PSGS Form
    Variable: DoSetAutoColumn, IName
    Repeat: IName ;;, PName
    Title: "Partywise Stock Group Report"
    Set: DoSetAutoColumn: Yes
    Set: DSPRepeatCollection: "SL StockItem Coll"
    Set : SVFromDate : $$MonthStart:##SVCurrentDate
    Set : SVToDate : $$MonthEnd:##SVCurrentDate

    [Form: SL PSGS Form]

    Use: DSP Template
    Parts: SL PSGS Part
    Background: White, Light Orange
    Option: Set Auto Vch Option: ##DoSetAutoColumn AND $$SetAutoColumns:IName

    [!Form: Set Auto Vch Option]

    [Part: SL PSGS Part]

    Lines: SL PSGS Title, SL PSGS SubTitle, SL PSGS Body
    BottomLines: SL PSGS Total
    Repeat: SL PSGS Body: SL Party Coll ;;Smp Stock Item
    Scroll: Vertical
    CommonBorder: Yes
    ;Total: CFBK Rep Party, CFBK Rep Col Total
    Total: SL ItemDetails Qty, SL ItemDetails Amt, SL Item ColTot Qty, SL Item ColTot Amt

    [Line: SL PSGS Title]
    Fields: SL Sno, SL Item Name, SL ItemGrpName, SL ItemGrp ColTot
    Repeat: SL ItemGrpName

    Local: Field: Default: Type: String
    Local: Field: Default: Align: Center
    Local: Field: Default: Style: SLB PSGS

    Local: Field: SL Sno: Set as: "Sl.No."
    Local: Field: SL Item Name: Set as: "Name of Customer"
    Border: Thick Top

    [Field : SL ItemGrp Name]
    Use: Name Field
    Set As: ##IName
    Style: SLB PSGS

    [Field : SL ItemGrp ColTot]
    Use: Name Field
    Set As: "Total"
    Style: SLB PSGS

    [Line: SL PSGS Sub Title]
    Use: SL PSGS Body

    Local: Field: Default: Type: String
    Local: Field: Default: Align: Center

    Local: Field: SL Sno: Set as: ""
    Local: Field: SL Item Name: Set as: ""
    Local: Field: SL Item Name: Widespaced: Yes
    Local: Field: SL Item Details Qty: Set as: "Quantity"
    Local: Field: SL Item Details Qty: Lines: 0
    Local: Field: SL Item Details Amt: Set as: "Amount"
    Local: Field: SL Item Details Amt: Lines: 0
    Local: Field: SL Item ColTot Qty: Set as: "Quantity"
    Local: Field: SL Item ColTot Qty: Lines: 0
    Local: Field: SL Item ColTot Amt: Set as: "Amount"
    Local: Field: SL Item ColTot Amt: Lines: 0
    Border: Thick Bottom ;Flush Totals

    [Line: SL PSGS Body]

    Fields: SL Sno, SL Item Name, SL ItemDetails, SL Item Col Total
    Repeat: SL ItemDetails
    Total: SL Item DetailsQty, SL ItemDetails Amt
    Space Top: 0.25

    [Field: SL Sno]
    Use: Number Field
    Set as: $$Line
    Width: 5
    Style: SL PSGS

    [Field: SL Item Name]
    Use: Name Field
    Set as: $$Upper:$PName
    Border: Thin Left
    Style: SL PSGS
    Lines: 0
    ;Display: Stock Vouchers
    ;Variable: Stock Item Name

    [Field: SL Item Details]
    Fields: SL Item Details Qty, SL Item Details Amt

    [Field : SL Item Details Qty]
    Use: Qty Primary Field
    Set as: $$ReportObject:$$CollectionFieldByKey:$TotBilledQty:mad:MyFormula:SLSummVoucherColl
    MyFormula: ##IName + #SLItemName
    Format: "NoZero"
    Border: Thin Left
    Style: SL PSGS
    Width: 5

    [Field : SL Item Details Amt]
    Use: Amount Field
    Set as: $$ReportObject:$$CollectionFieldByKey:$TotBilledAmt:mad:MyFormula:SLSummVoucherColl
    MyFormula: ##IName + #SLItemName
    Format: "NoZero"
    Border: Thin Right
    Style: SL PSGS
    Width: 10

    [Field: SL Item Col Total]
    Fields: SL Item ColTot Qty, SL Item ColTot Amt

    [Field : SL Item ColTot Qty]
    Use: Qty Primary Field
    Set as: $$Total:SLItemDetailsQty
    Border: Thin Left
    Style: SL PSGS
    Width: 7

    [Field : SL Item ColTot Amt]
    Use: Amount Field
    Set as: $$Total:SLItemDetailsAmt
    Border: Thin Right
    Style: SL PSGS
    Width: 12

    [Line: SL PSGS Total]
    Border: Flush Totals
    Fields: SL Sno, SL Item Name, SL ItemDetails, SL Item Col Total
    Repeat: SL ItemDetails
    Height: 1.5

    Local: Field: Default: Type: String
    ;Local: Field: Default: Align: Center
    Local: Field: Default: Style: SLB PSGS

    Local: Field: SL Sno: Set as: ""
    ;Local: Field: SL Sno: Type: String
    ;Local: Field: SL Sno: Align: Center
    Local: Field: SL Item Name: Set as: "Total"
    ;Local: Field: SL Item Name: Type: String
    ;Local: Field: SL Item Name: Align: Center
    Local: Field: SL Item Details Qty: Set as: $$Total:SLItemDetailsQty
    Local: Field: SL Item Details Amt: Set as: $$Total:SLItemDetailsAmt
    Local: Field: SL Item ColTot Qty: Set as: $$Total:SLItemColTotQty
    Local: Field: SL Item ColTot Amt: Set as: $$Total:SLItemColTotAmt
    ;Border: Thin Top

    ;; Collection Definition

    [Collection: SL Voucher Coll]
    Type: Voucher
    Filter: IsSalesVT

    [Collection: SL Summ Voucher Coll]

    Source Collection: SL Voucher Coll

    Walk: Inventory Entries
    Compute: StockGrpName: $Parent:StockItem:$StockItemName
    By: IName: $Parent:StockItem:$StockItemName ;;$StockItemName
    By: PName: $PartyLedgerName
    Aggr Compute: TotBilledQty: SUM: $BilledQty
    Aggr Compute: TotBilledAmt: SUM: $Amount
    Sort : @@Default: $..PartyLedgerName

    Search Key: $IName + $PName ;;$PName + $IName
    Filter: StkFilter
    Filter: NonEmptyQty
    ParmVar : SVFromDate: $$MonthStart:##SVCurrentDate
    ParmVar : SVToDate: $$MonthEnd:##SVCurrentDate


    [Collection: SL StockItem Coll]

    Source Collection: SL Voucher Coll

    Walk: Inventory Entries
    Compute: StockGrpName: $Parent:StockItem:$StockItemName
    By: IName: $StockGrpName ;;Parent:StockItem:$StockItemName ;;$StockItemName
    Aggr Compute: TotBilledQty: SUM: $BilledQty
    Aggr Compute: TotBilledAmt: SUM: $Amount
    ;Sort : @@Default: $..PartyLedgerName
    Filter: StkFilter
    Filter: NonEmptyQty

    [Collection: SL Party Coll]

    Source Collection: SL Voucher Coll

    Walk: Inventory Entries
    Compute: StockGrpName: $Parent:StockItem:$StockItemName
    By: PName: $PartyLedgerName
    Aggr Compute: TotBilledQty: SUM: $BilledQty
    Aggr Compute: TotBilledAmt: SUM: $Amount
    Filter: NonEmptyQty
    Filter: StkFilter
    ;Sort : @@Default: $..PartyLedgerName

    ;; Variable Definition

    [Variable: PName]
    Type: String
    ;Repeat: ##DSPRepeatCollection

    [Variable: IName]
    Type: String
    Repeat: ##DSPRepeatCollection

    ;; System Formula

    [System: Formula]
    IsSalesVT: $$IsSales:$VoucherTypeName
    ;StkFilter: ($Parent:StockItem:$StockItemName) contains ##StockGroupName
    StkFilter: ($StockGrpName contains ##StockGroupName)
    NonEmptyQty: $TotBilledQty <> 0

    [Style : SL PSGS]
    Font: Tahoma
    Height: 8

    [Style : SLB PSGS]
    Font: Tahoma
    Height: 8
    Bold: Yes

    ;; End-of-File




    Regards
    Vinod
     


  2. SINTO PARAVA

    SINTO PARAVA Member


    Dear Boss...
    "The exact same problem happened to me "!!"
     


  3. Yogender

    Yogender Member



Share This Page