PARTYWISE SALES WITH QUANTITY AND AMOUNT

Discussion in 'Free Source Codes' started by DEEPAK B, Jan 27, 2023.

    
  1. DEEPAK B

    DEEPAK B Member


    Hello

    I got the ready-made code from Tally Developer (Sample File Object & Collection) and for a long time I have been using it but now, along with quantity filed I also wanted the amount field to come so I have modified the code, and its working fine

    but I am not satisfied with the format (see image 1) I want this format to look like this (see Image 2)
    As a starter, I have done my efforts but was not able to succeed in it.

    Can you help me with this code

    Sharing the code please help me
    Code:
    [#Menu: Gateway of Tally]
    Item: Partywise Itemwise: Display: CFBK Rep
    
    
    [Report: CFBK Rep]
        Use            : DSP Template
        Form        : CFBK Rep
        Variable    : DoSetAutoColumn, IName
        Repeat        : IName
        Set         : DoSetAutoColumn         : Yes
        Set            : DSPRepeatCollection    : "CFBK Party"
        Set         : SVFromDate              : $$MonthStart:##SVCurrentDate
        Set         : SVToDate                : $$MonthEnd:##SVCurrentDate
    
    [Form: CFBK Rep]
        Use                        : DSP Template
        Parts                    : PrtHdr,CFBK Rep
        Background                 : White, Light Orange
        Button                  : ExplodeFlag, ChangeDybkDate, ChangePeriod
        BottomButton            : BlankButton, RelReports, InvReports, AcctReports, Report Operations, FilterButton, ValueButton
        Bottom Toolbar Buttons     : BottomToolBarBtn1, BottomToolBarBtn2_EditVch, BottomToolBarBtn3, BottomToolBarBtn4, BottomToolBarBtn5, BottomToolBarBtn6, BottomToolBarBtn7, BottomToolBarBtn8, BottomToolBarBtn9, BottomToolBarBtn10, BottomToolBarBtn11, BottomToolBarBtn12
        Buttons                : PrintButton, ExportButton, UploadButton, MailButton
        Option                    : Set Auto Vch Option     : ##DoSetAutoColumn AND $$SetAutoColumns:IName
    
    [Part: PrtHdr]
            Lines    : PrtHdr
    
            [Line: PrtHdr]
                Field        : Name Field
                Right Field  : DSP MainDateTitle
                Field        : FldHrd       
                Local        : Field : Name Field : Style : Normal Bold
                Space Bottom : 1.5
               
                [Field: FldHrd]
                    Set As    : "Party-Wise Product-Wise  Sales QTY Report"
                    Style     : Normal Bold
                    FullWidth : Yes
                    Border    : Thin Bottom
                    Align     : Centre
                    Skip      : Yes
                    Fixed     : Yes
                    Width     : 50% Screen
    
    [Part: CFBK Rep]
        Lines        : CFBK Rep Title, CFBK Rep Details
        BottomLines    : CFBK Rep Total
        Repeat        : CFBK Rep Details        : Smp Stock Item
        Scroll        : Vertical
        CommonBorder: Yes
        Total        : CFBK Rep Party, CFBK Rep Col Total
    
        [Line: CFBK Rep Title]
            Use        : CFBK Rep Details
            Local    : Field    : Default            : Type        : String
            Local    : Field    : Default            : Align        : Center
            Local    : Field    : CFBK Rep Name        : Set as    : "Particulars"
            Local    : Field    : CFBK Rep Name        : Widespaced: Yes
            Local    : Field    : CFBK Rep Party1    : Set as    : ##IName
            Local    : Field    : CFBK Rep Party1    : Lines        : 0
            Local    : Field    : CFBK Rep Party2    : Set as    : "Amount"
            Local    : Field    : CFBK Rep ColTotal    : Set as    : "Total"
            Border    : Flush Totals
    
        [Line: CFBK Rep Details]
            Fields    : CFBK Rep Name, CFBK Rep Party, CFBK Rep Col Total
            Repeat    : CFBK Rep Party
            Total    : CFBK Rep Party
    
            [Field: CFBK Rep Name]
                Use            : Name Field
                Set as        : $PName
                Variable    : LedgerName
                Display     : Ledger Monthly Summary
    
            [Field: CFBK Rep Party]
                Fields     : CFBK Rep Party1, CFBK Rep Party2
    
                [Field:CFBK Rep Party1]
                    Use            : Qty Primary Field
                    Set as        : $$ReportObject:$$CollectionFieldByKey:$BilledQty:@MyFormula:CFBKSummVoucher
                    MyFormula    : ##IName + #CFBKRepName
                    Format        : "NoZero"
                    Border        : Thin Left
    
                [Field:CFBK Rep Party2]
                    Use            : Amount Field
                    Set as        : $$ReportObject:$$CollectionFieldByKey:$Amount:@MyFormula:CFBKSummVoucher
                    MyFormula    : ##IName + #CFBKRepName
                    Format        : "NoZero"
                    Border        : Thin Left
    
            [Field: CFBK Rep Col Total]
                Use        : Qty Primary Field
                Set as    : $$Total:CFBKRepParty
                Border    : Thin Left
    
            [Field: CFBK Rep Col Total Amt]
                Use        : Amount Field
                Set as    : $$Total:CFBKRepParty
                Border    : Thin Left
    
        [Line: CFBK Rep Total]
            Fields    : CFBK Rep Name, CFBK Rep Party, CFBK Rep Col Total
            Repeat    : CFBK Rep Party
            Local    : Field    : Default            : Type        : String
            Local    : Field    : Default            : Align        : Center
            Local    : Field    : CFBK Rep Name        : Set as    : "Total"
            Local    : Field    : CFBK Rep Name        : Widespaced: Yes
            Local    : Field    : CFBK Rep Party    : Set as    : $$Total:CFBKRepParty
            Local    : Field    : CFBK Rep ColTotal    : Set as    : $$Total:CFBKRepColTotal
            Border    : Thin Top
           
    
    ;; Collection Definition
    
    [Collection: CFBK Voucher]
        Type        : Voucher
        Filter        : IsSalesVT
        Childof     : $$GroupSundryDebtors
        Belongs To     : yes
    
    [Collection: CFBK Summ Voucher]
        Source Collection    : CFBK Voucher
        Walk                : Inventory Entries
        By                    : PName            : $PartyLedgerName
        By                    : IName            : $StockItemName
        Aggr Compute        : BilledQty        : SUM    : $BilledQty
        Aggr Compute        : Amount        : Sum    : $Amount
        Search Key            : $IName + $PName
    
    [Collection: Smp Stock Item]
        Source Collection    : CFBK Voucher
        Walk                : Inventory Entries
        By                    : PName            : $PartyLedgerName
        Aggr Compute        : BilledQty        : SUM    : $BilledQty
        Aggr Compute        : Amount        : Sum    : $Amount
    
    [Collection: CFBK Party]
        Source Collection    : CFBK Voucher
        Walk                : Inventory Entries
        By                    : IName            : $StockItemName
        Aggr Compute        : BilledQty        : SUM    : $BilledQty
        Aggr Compute        : Amount        : Sum    : $Amount
    
    [Collection: Smp Stock Item Amt]
        Source Collection    : CFBK Voucher
        Walk                : Inventory Entries
        By                    : IName            : $StockItemName
        Aggr Compute        : BilledQty        : SUM    : $BilledQty
        Aggr Compute        : Amount        : SUM    : $Amount
    
    [Variable: IName]
        Type        : String
        Repeat        : ##DSPRepeatCollection
    
    [System: Formula]
        IsSalesVT    : $$IsSales:$VoucherTypeName
        NonEmptyQty    : NOT $$IsEmpty:$BilledQty
        NonEmptyAmt    : NOT $$IsEmpty:$Amount
    
     

    Attached Files:



  2. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Simply add the LINE for the second Column titles.
     


  3. DEEPAK B

    DEEPAK B Member


    How Silly of me Sir have done this so many a time and forgot about this
    Thanks for the help

    sir item name is not coming in between quantity and Amount (see the Image) once this done I am through

    Please help me with this also
     

    Attached Files:



  4. Rohit Khedar

    Rohit Khedar Member


     

    Attached Files:



  5. DEEPAK B

    DEEPAK B Member


    Yes Rohit Sir, If you see My Capture Image its not coming as per your image to please guide me with this
     


  6. DEEPAK B

    DEEPAK B Member


    I donot know actually where I have gone wrong

    after long try also I am not able to get my mistake. Please Help me with this code "Item Name" in First Line should come in the center of the" Quantity and Amount"
    Sharing the code after changing done as suggested by Amit Sir. I have shared the image of that above
     
    Last edited: Jan 30, 2023


  7. sattam

    sattam Active Member


    [Line: CFBK Rep Title]
    Use : CFBK Rep Details
    Local : Field : Default : Type : String
    Local : Field : Default : Align : Center
    Local : Field : Default : Style :Normal Bold
    Local : Field : CFBK Rep Name : Set as : "Particulars"
    Local : Field : CFBK Rep Name : Widespaced: Yes
    ;Local : Field : CFBK Rep Party1 : Set as : ##IName
    ;Local : Field : CFBK Rep Party1 : Lines : 0
    Local : Field : CFBK Rep Party : Delete:Fields
    Local : Field : CFBK Rep Party : Set as : ##IName
    Local : Field : CFBK Rep Party : Lines : 0
    Local : Field : CFBK Rep Party : Border:Thin Left
    Local : Field : CFBK Rep Party : Delete:Background
    Local : Field : CFBK Rep ColTotal : Set as : "Total"
    Border : Flush Totals
     


  8. DEEPAK B

    DEEPAK B Member


    Its working while viewing on screen in tally but if I export it to Excel then it shows as attached an image
     

    Attached Files:



  9. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    add .... Cells : 2 in all the fields.
     


  10. DEEPAK B

    DEEPAK B Member


    Great Sir It's Done Thank you Amit Sir, Sattam Sir

    Sir Just for my Information what function is there while exporting any report in excel format then the Head should Automatically come in Row with Merge and Center of that report
     
    Last edited: Jan 30, 2023


  11. DEEPAK B

    DEEPAK B Member


    Sir made some more changes previously final total was not coming in the bottom and Extreme Right which is been done for Quantity and Amount
     

    Attached Files:



  12. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    find the total number of columns and use CELL
     


  13. DEEPAK B

    DEEPAK B Member


    Thanks, Sir Will try this as its something new function to me
     


  14. DEEPAK B

    DEEPAK B Member


    Sir

    I just want to take this tdl to some advanced level (for me its advanced level) that is
    I have created a new voucher type in Sales i.e 1st one which is default Sales where its inventory voucher and 2nd one is Sales Service (voucher type sales) where only accounting is done
    Now the thing is it's talking Details from the Sales i.e Quantity and Amount but now I want is it should also take the Amount from Sales Service also with its Accounting Name.

    If it's possible then how can I do it and where to find it also what function should I should use in this above TDL Can you guide Please
     


  15. Vineet Jindal

    Vineet Jindal Member


    Sir Please let me know how to make the coloumn under 3 columns as images given above...as I have add cell but it is not working...
     

    Attached Files:



  16. sivam

    sivam Active Member


    Same like Second column Steps
     


  17. Vineet Jindal

    Vineet Jindal Member


    Okay Sir.....Thank You..
    Sir, please tell me how to make automatic batch number instead of manual while making purchase voucher
     


  18. sivam

    sivam Active Member


    Code:
    [#Field: VCHBATCH NrmlName]
       
        Add            : Option    : VCHBATCH NrmlName KNS    : @@IsPurchase
       
    [!Field: VCHBATCH NrmlName KNS]
       
        Set By Condition    : ($$IsEmpty:$$Value)    : 123454
     


  19. Vineet Jindal

    Vineet Jindal Member


    Hello Sir,
    Thanks for your Reply.....

    Sir, I want the auto batch no while selecting any item .....Batch Number will be purchase Voucher Date as we create
     

    Attached Files:



  20. sivam

    sivam Active Member


    [#Field: VCHBATCH GRNName]

    Add : Option : VCHBATCH NrmlName KNS : @@IsPurchase

    [!Field: VCHBATCH NrmlName KNS]

    Set By Condition : $$InCreateMode : 123456

    You can add Anything as your logic
     


Share This Page