Repeated Line storage issue

Discussion in 'Free Source Codes' started by SilverlineInfotech, Jul 6, 2020.

    
  1. SilverlineInfotech

    SilverlineInfotech New Member


    Dear Members,

    Kindly guide me for my code. I have repeated a line @ bottom of Sales invoice for Amount collected by cash or through Cheque or On-line etc.
    Problem
    When I reopen sales Voucher Amounts are not shown.

    Plz see attached TDL
     

    Attached Files:

    Last edited: Jul 7, 2020


  2. Damodaran

    Damodaran New Member


    Try the below code:
    Code:
        [#Form: Sales Color]
            Add :  Part : At End  :   Inv_BottomPartPayDetPPP
           
        [Part :Inv_BottomPartPayDetPPP]
            Line         : InvLn_PayDetTitPPP, InvLn_PayDetDetailsPPP
            Bottom Line : InvLn_PayDetTotPPP
            Total        : InvFld_PayDetDetailsRsPPP
            Height        : 25% Page
            Repeat         : InvLn_PayDetDetailsPPP : VCHPayModa
            BreakOn     : $$IsEndofList:$VCHPayMod
            Vertical    : Yes
            Scroll      : Vertical
            Invisible    : Not @@IsSales
           
            [Line : InvLn_PayDetTitPPP]
                Fields : InvFld_PayDetTitPPP, InvFld_PayDetTitRsPPP
                Border : Thin Box
                           
                [Field : InvFld_PayDettitPPP]
                    Use            : Name Field
                    Set As        : "Pay Mode "
                    Skip        : Yes
                    Width         : 10% Page
                    Space Left    : 1% Page
                    Border        : Thin Right
               
                [Field : InvFld_PayDettitRsPPP]
                    Use            : Name Field
                    Set As        : "Amt. Rs."
                    Skip        : Yes
                    Width         : 7% Page
                    ;Align        : Centre
                    Border        : Thin Right
    
            [Line : InvLn_PayDetDetailsPPP]
                Fields : InvFld_PayDetDetailsPPP, InvFld_PayDetDetailsRsPPP
                Border : Thin Box
    
                [Field : InvFld_PayDetDetailsPPP]
                    Use            : Name Field
                    Storage     : VCHPayMod
                    Set As        : $VCHPayMod
                    Table        : PayMod
                    ShowTable    : Always
                    Key            : PayMod
                    Width         : 10% Page
               
                [Field : InvFld_PayDetDetailsRsPPP]
                    Use            : Amount Field
                    Storage        : VCHPayModAmt
                    Set As        : $VCHPayModAmt
                    Set Always    : Yes
                    Width         : 7% Page
                    ;Align        : Centre
                    Inactive    : $$IsEndofList:$VCHPayMod
                    Skip        : If $$IsEndofList:$VCHPayMod Then Yes Else No
                    Border        : Thin Right
                    Validate    : Not $$IsEmpty:$VCHPayModAmt ;If Not $$IsEndofList:$VCHPayMod Then Yes Else No
    
            [Line : InvLn_PayDetTotPPP]
                Fields       : InvFld_PayDetTotPPP, InvFld_PayDetTotAmtPPP
                Border       : Thin Box
               
                [Field : InvFld_PayDetTotPPP]
                    Use            : Medium Prompt
                    Set As        : "TOTAL : "
                    Width         : 10% Page
                    Space Left    : 1% Page
                    Style        : Large Bold
                   
                [Field : InvFld_PayDetTotAmtPPP]
                    Use            : Amount Field
                    Width         : 7% Page
                    Set As        : $$Total:InvFld_PayDetDetailsRsPPP ;$VCHPayModAmt
                    Style        : Large Bold
                    Set Always    : Yes
                    ReadOnly     : Yes
                    Control        : PayDetTotAmtPPP : If $Amount = #InvFld_PayDetTotAmtPPP then No Else Yes
                    Border        : Thin Right
    
    ;================================= Types of payment Master
    
    [#Menu: Accounts Info.]
            Add : Item : Payment Mode     : Alter : PayMod
    
    [Report    : PayMod]
        Form    : PayMod
        Object    : Company
        Title    : "Payment Mode"
    
    [Form    : PayMod]
        FullHeight    : Yes
        Part        : PayMod
    
        [Part    : PayMod]
            Line    : PayModMTLn, PayModMLn
            Repeat    : PayModMLn : PayMod
            BreakOn : $$IsEmpty:$PayMod
            Scroll    : Vertical
    
            [Line    : PayModMTLn]
                Border    : Column Titles
                Field    : PayModMTFld
    
                [Field    : PayModMTFld]
                    Use        : Name Field
                    Set As    : "Payment Mode"
                    Align    : Center
    
            [Line    : PayModMLn]
                Field    : PayModMFld
    
                [Field    : PayModMFld]
                    Use        : Name Field
                    Storage    : PayMod
                    Scroll  : Vertical
    
    [Key : PayMod]
        Key     : Alt+C
        Action     : Alter : PayMod
    ;====================================================================================
    
        [Collection    : PayMod]
                Type    : PayMod : Company
                ChildOf    : ##SVCurrentCompany
                Format    : $PayMod, 15,
                 Collection : EndofList
                Title    : "Payment Mode"
    
        [Collection    : VCHPayMod]
                Compute    : VCHPayMod     : $VCHPayMod
                Compute    : VCHPayModAmt  : $VCHPayModAmt
                Format    : $VCHPayMod
                Format    : $VCHPayModAmt
    
        [System : UDF]
            PayMod                  : String : 3824
            VCHPayMod            : String : 3825
            VCHPayModAmt        : Amount : 3826
        VCHPayModa    : Aggregate : 3827
    
     
    SilverlineInfotech likes this.


  3. SilverlineInfotech

    SilverlineInfotech New Member


    Dear Ma'am,

    I am a new Learner of TDL not very expert still I will try to develop a report if some help me to resolve this problem as I cannot go further unless this problem is resolved.

    Can you plz solve this or can you pls ask for some one's help in your group or contact
     


  4. SilverlineInfotech

    SilverlineInfotech New Member


    Damodaran sir,
    Thank you for your prompt response
    Error message collection not found and even if we create a collection it's gives various errors incorrect storage.
    Is your code working at your end?
    Pls check awaits for response
     


  5. SilverlineInfotech

    SilverlineInfotech New Member


    Damodaran sir,
    Thank you for your prompt response
    Error message collection not found and even if we create a collection it's gives various errors incorrect storage.
    Is your code working at your end?
    Pls check awaits for response
     


  6. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Remove this line .......... Repeat : InvLn_PayDetDetailsPPP : VCHPayMod in [Part :Inv_BottomPartPayDetPPP]
     


  7. SilverlineInfotech

    SilverlineInfotech New Member


    Sir,

    If we remove the repeated Line then only single Payment type will be selected

    E.g if received 10,000 amount by
    Cash 3000
    Gpay 4000
    NEFT 2000
    Cheque 1000
    Then how can be store these values in that single entry
    Further I want to develop a report baised on this data
     


  8. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Solution by @Damodaran should be working fine........ adopt it.
     


  9. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    It is working fine...as per his solutions.....if not, then you must have made some mistake......check it once again.

    11.PNG
     
    SilverlineInfotech likes this.


  10. SilverlineInfotech

    SilverlineInfotech New Member


    My apologies to Damadoran sir your solution is working I made a mistake in my code

    Thank you so much
     


  11. SilverlineInfotech

    SilverlineInfotech New Member


    Thank you Sir for taking time to verify the coding
    You were right I made a mistake in my code Damadoran sir code is working
    Thank you Amit sir for correcting me
     


  12. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    As part of learning and easy coding.... naming convention is also very important.

    You should use name which gives meaningful indication of what it is........
    Like.....
    PaytypeT -- indicates pay type title
    Paytype --- indicates Value field
    paycodecoll -- coll indicates collection
    udfmystorage -- here udf denotes it is storage.... and so on

    in this manner, even if u open the TDL file after one year.... the name indicates clearly what is what and how your code is structured.

    In many cases, we EXPERTS get bored by the name and do not like to see the whole code.... because making sense of all names for parts, lines, fields etc also takes up valuable time. And we have our own work / projects also.

    Hope you take a good lesson and in right spirit of the above suggestions.
     
    SilverlineInfotech likes this.


  13. SilverlineInfotech

    SilverlineInfotech New Member


    Sure sir

    I will definitely follow your suggestion
    Thank you
     


Share This Page