Please help me with Function....

Discussion in 'Free Source Codes' started by Jenny, May 31, 2021.

    
  1. sattam

    sattam Active Member


    is your code working?
    Your code is full of error. I have no time to correct each and every line.Have you learned basic tdl?
    if not then try to learn first and then copy.Sorry bro.
     



  2. Code is working except for bank allocations part in Functions and thanks for your concern.

    Well, i know basic things and have learn that.
    no one can be good at code without guidance of anyone. After self learning of coding we encounter with few problems which we cannot identify at our own for which we publish code here to find solution.
     
    Last edited: Jun 2, 2021



  3. "BalajiMG" sir thank you for your help, now bank allocation part is working as required.
    Error was in Bank Allocations part only.
     
    bharat shah likes this.


  4. Anuj Mittal

    Anuj Mittal New Member


    Hello Mr. Gangster

    Those Solution You Provided Its Working Fine on Hard Coded But if I Get The Values From Form Then its Giving Error Action Execution Failed.
    Please Solve My Error
     


  5. bharat shah

    bharat shah Member


    what was the error
     


  6. love

    love Member


    a little addition to the already GOOD tdl JENNY ADDTION.jpg
     


  7. love

    love Member


    1.activated journal entry
    2.added 3rd ledger as most of the time in receipts and payment a short or excess is to be adjusted later on
    3.the 3rd ledger AND amount field SKIP if debit ledger and credit ledger amount are same
    4. 3rd ledger amount is auto fill difference
     

    Attached Files:

    silpa dravid likes this.


  8. silpa dravid

    silpa dravid Member


    can u share the final code please
     


  9. bharat shah

    bharat shah Member


    BULK ENTRY is working fine but in sales voucher if any entry is done ,its giving this error
     

    Attached Files:



  10. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    As per the TITLE of the Thread... this is only for -- Bulk Entry of Payment / Receipt / Contra only.
     
    bharat shah likes this.



  11. Great addition, can you share?
     


  12. bharat shah

    bharat shah Member


    i know but its conflicting in sales voucher. if u remove the tdl sales is working fine but when loaded its getting error. i checked the code but not able to rectify it
     


  13. Devendra_Rawat

    Devendra_Rawat Well-Known Member



    This was my reply to him on mail:

    No, there are multiple issues with your code,

    You are walking over a collection, which is not there in your code.

    Second, if that part is corrected, then it is able to save only last entry.

    Then comes the allocation part, which to be seen only when first two problems are corrected.

    One more thing is, you are referring to field values in your function, how will the function know the row no of field, during execution, because same field is there in all the rows in your quick entry report.

    So issues are multiple, and due to bad health, I am not able to concentrate properly.

    Kindly have a deep look into your code.
    .


    Now, he insists that Only Bank Allocation part had some error and rest of the code is working fine.

    Happy to know that this problem is solved, "but it made me to wonder as to how the code is working ??"

    @Amit Kamdar sir, we try to help, wherever possible, but we can troubleshoot some specific issues if the rest of the code is fine... but if there are structural issues in the code, we expect the member to take a deep dive :(
    :(
    into the sample project available with Tally Developer.. and that is in the interest of the member only.
     
    sattam and Amit Kamdar like this.


  14. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Right said....2 days back a member sent me a code but forgot to mention that the problem was resolved and now there is another problem/issue and I wasted 1 hours on the same.

    We can help surely, but not spoon feed anyone...... and also not possible in terms of time, as all are busy in own work/projects.

    I reject the codes which has lots of errors / remarked lines or non-sensical NAMES .... it is hard to concentrate on codes with PARTS/LINE/FIELDS having long names and irrelevant characters. :confused::confused:
     
    balajimg likes this.


  15. balajimg

    balajimg Active Member



    and as a learner, if you are not able to identify the error, no problem, but we expect atleast indenting the code and proper naming of definitions and method/udf names
     
    Amit Kamdar likes this.


  16. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Right..... names like .... "amitkamdarReport Part0 Line1 Title1" .... one goes mad in perusing the code line by line. :p:cool:
     



  17. Well sir i greatful with your concern amd your reply. Well, i have replied to the Sattam sir over there response to my code.

    To be honest you can ask Balajimg sir who have help me for Bank Allocations part and code which i have sent to sattam sir was taken from this thread only.

    He have help me with issue and resolved.

    Now coming to your reply regarding collection which is not there, so sir the thing i came to know is that if we some error i Bank Allocation part then this error will come as due to wrong position or wrong writinf method of the code this error came.

    So it feel me that you and sattam sir have gone through the code properly.
    Sattam sir gone through the code only after i have given thanks comment to Balajimg Sir. As it was necessary for me to write here as Balajimg sir helped me for it and i want to mention here that problem is solved.

    The code which i have sent you was also working properly if you have tested it. I believe that being CA it is possible to go through this all thing, as for our community (though i am not CA but CA Final Student but i am considering part of this professional organization) there are many compliances part and workload is there that it becomes difficult to cope up with other things but still you have shown willingness to help is good.

    Regarding i have mentioned Field value in the Function for which i have already told you it's some sort of jugad. But still it is working fine and i am using it for my day to day data entry purpose...

    So, you are correlating 2 different thing and making wrong impression of someone. If you are not believing on my words, i am willing to share code to you. You can cross check it.

    I have to write big letter type answer just because i was portrayed as wrong and lier.
    I have lots of respect for you and all experts but please don't portrayed someone as wrong and lier. If you don't trust on someone words that's ok but don't other make think that he is lier, Don't believe on him.

    Your write up make me think only this.

    And i am really sorry that i have demanded help from you, the reason was simple you were CA.
    You taught me lesson.
     



  18. Sattam sir have pointed one thing after error getting solved that don't put UDF name similar to those already exisiting in default tally. For customized TDL put different names.

    I am thanks to him for his this reply and giving knowledge.

     



  19. Sir, BankAllocations part is done just now in code which i have sent to you.
    My Query is solved for Bank Allocations part.

    What i have learned is, Bank Allocation part function sequence should same as it is available in tally, otherwise there can be some error.
    In bank allocation function you should walk BankAllocation otherwise it will leads error

    Special Thanks to Balajimg sir for explaining, garimaji , Sattamsir for making me understand that we should not use UDF value name as it is available in default tally.

    Amitsir it would not be possible without your suggestions at beginning when i have started learning TDL.
    Keep guiding us.


     
    Last edited: Jun 4, 2021


  20. balajimg

    balajimg Active Member


    Can understand that you have got the support from various sources (Mr. Amit Kamdar, Mr. Garima, Mr. Sattam, etc..) and you have atleast acknowledged their names and contributions
    Its all communication gap...

    Have found people who dont even care to inform that the issue is resolved, so that some experts who are genuinely involved in the debugging can save their precious time
    :)
     


  21. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    @RAJESH BHANUSHALI ----- Buddy.. there is no need to take it personally and to heart.
    As a learner your teacher may be young or old....what is important is that you gain knowledge. Age is not important, knowledge imparted is.
     
    Last edited: Jun 4, 2021


  22. balajimg

    balajimg Active Member


    hahaha
     


  23. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    True...... Regarding such people ........ I just ignore them in future..... :);)
    Why waste time for people who cannot appreciate a good help, time and efforts of experts.
     


  24. Devendra_Rawat

    Devendra_Rawat Well-Known Member


    This is the non working code, from your Post and also mailed to me, Amit Sir can judge,

    I again request members to focus on one issue at a time.. I have seen members working on multiple codes at the same time as can be verified from the number of queries on the forum on different topics..

    I don't understand why people take good advice in wrong sense.. I am always ready to help as long as member is sincere and willing to learn.. efforts must go in.. putting a query on the forum must be last resort.




    Code:
    
    ;; Shri Ganeshay Namah ;;
    
    [#Menu: Gateway of Tally]   
       
        Add    : Item   : "Bulk Payment Entry" : Alter : CphSales EntryRpt
       
        [Report : CphSales EntryRpt]
           
            Form    : CphSales EntryFrm
            Title   : $$LocaleString:"Bulk Payment Entry"
            Object    : Company
           
            ;Fetch Collection: Sales Support Ledgers Extract, Party Ledgers Extract
           
                   
            [Form : CphSales EntryFrm]
               
                Part         : Form SubTitle, CphSales CrLedPrt, CphSales DrLedPrt
                Width        : 100% Page
                Height        : 100% Page
                Space Left    : 0.25
                Space Right    : 0.25   
                Horizontal Align: Left
               
                Local        : Field    : Form SubTitle    : Info        : "Bulk Payment Entry"
               
                On        : Form Accept : yes        : Form Accept
                On         : Form Accept : yes     : Call     : CphSale BulkAutoEntry
    
    
    ;; Sales Credit Part ;;                           
    ;;------------------------------------------------------------------------------------------           
               
                    [Part : CphSales CrLedPrt]
    
                     Line : CphSales CrLedLne
                   
                   
                        [Line : CphSales CrLedLne]
       
                            Field    : Medium Prompt, CphSales CrLedFld                       
                            Local    : Field    : Medium Prompt    : Info    : $$LocaleString:"Credit Ledger"
                            Space Bottom    : 0.50
                           
    
                            [Field    : CphSales CrLedFld]
                               
                                Type        : String
                                Use            : Name Field
                                Table        : CashBank LedgersExtract
                                Storage        : RBCBLedgerName
                                Show Table    : Always
                                Case        : Title Case
                                Width        : 50
                                Align        : Left
                                Border        : Thin Box
                               
                               
       
    
    ;; Sales Debit Part ;;                           
    ;;------------------------------------------------------------------------------------------                       
    
                [Part : CphSales DrLedPrt]
                   
                    Line     : CphSales DrLedTtleLne, CphSales DrLedDetlsLne
                    Repeat    : CphSales DrLedDetlsLne : CphSalesCollection
                    Scroll            : Vertical
                    Common Border    : Yes
                    Break On        : $$IsEndOfList:$PartyLedgerName
                   
                   
                        [Line : CphSales DrLedTtleLne]
                           
                            Use        : CphSales DrLedDetlsLne       
                           
                            Local    : Field    : Default                    : Inactive    : No
                            Local    : Field    : Default                    : Delete    : Storage
                            Local    : Field    : Default                    : Type        : String                       
                            Local    : Field    : Default                    : Style        : Normal
                           
                            Local    : Field    : CphSales SerialNoFld        : Info        : $$LocaleString:"Sno."
                           
                            Local    : Field    : CphSales DateFld            : Info        : $$LocaleString:"Date"
                           
                            Local    : Field    : CphSales DebitLedgerFld    : Info        : $$LocaleString:"Debit Ledger"
                           
                            Local    : Field    : CphSales DrAmountFld        : Info        : $$LocaleString:"Amount"
       
                            Local    : Field    : CphVchNarration            : Info        : $$LocaleString:"Narration"
                           
                            Local    : Field    : CphChequeNo                : Info        : $$LocaleString:"Cheque No"
                           
                            Border    : Thin TopBottom
                            Delete    : Space Top
                                                   
    
                    [Line    : CphSales DrLedDetlsLne]
                       
                        Field        : CphSales SerialNoFld, CphSales DateFld, CphSales DebitLedgerFld, CphSales DrAmountFld, CphChequeNo, CphVchNarration
                       
                        Border:Thin Left
                        Space Top    : 0.25
                       
    
                        [Field    : CphSales SerialNoFld]
                           
                            Use          : Short Name Field
                            Width        : @@SymWidth
                            Set as       : $$Line
                            Skip         : Yes
                                               
                           
    
                        [Field    : CphSales DateFld]
                           
                            Type        :     Date
                            Use            :    Short Date Field
                            Storage        :    Date
                            Set as        :    $$PrevObj:$Date                       ; Line added
                            Set Always    :    Yes                       ; Line added
                            Width        :     @@ShortWidth
                           
    
                        [Field    : CphSales DebitLedgerFld]
                           
                            Type        :     String
                            Use            :     Name Field
                            Table        :     All Ledger, EndOfList       
                            Keys        : Create Ledger, Alter Ledger
                            Storage        :     PartyLedgerName
                            ;;Set as        :     $Name
                            Show Table    :     Always
                            Case        :     Title Case
                            Width    :     @@NameWidth
                            Align        :     Left
                            Inactive    :     $$IsEndOfList:$PartyLedgerName        ;;$$IsEndOfList:$Name    ;;$$IsEmpty:$Name
                           
    
                           
    
                        [Field    : CphSales DrAmountFld]
                           
                            Type        :     Amount
                            Use            :    Amount Field
                            Storage        :    Amount
                            ;;Set as        :   $Amount
                            Width        :     @@AmountWidth
                            Inactive    :     $$IsEndOfList:$PartyLedgerName        ;$$IsEndOfList:$Name;;$$IsEmpty:$Name
                               
                           
                        [Field:CphVchNarration]
                            Use:Voucher Narration Field
                            Storage:Narration
                            Key                 : PrevVchNarration, PrevLedNarration
                            Full WidthWidth:Yes
                            Inactive    :     $$IsEndOfList:$PartyLedgerName        ;$$IsEndOfList:$Name;;$$IsEmpty:$Name
                           
                        [Field:CphChequeNo]
                            Use            : Name Field
                            Width        : @@shortwidth
                            Storage        : CheNumUDf
                            Inactive    :     $$IsEndOfList:$PartyLedgerName        ;$$IsEndOfList:$Name;;$$IsEmpty:$Name
                                                   
    
    [Collection: CphSalesCollection]
           
        Title         : "Bulk Payment Entry"
        Type        : CphSales BulkEntry : Company
        Child Of    : ##SVCurrentCompany
                       
                           
                           
    
    [System: UDF]
    
        CphSales BulkEntry         : Aggregate : 41071
        Date                    : Date        : 41072
        PartyLedgerName            : String    : 41073
        Amount                    : Amount    : 41074
        RBCBLedgerName            : String    : 41075
        CheNumUDf                : String    : 41076
        Narration                : String    : 41077
    
    
    
    ;; Bulk Auto Entry ;;
    ;;-----------------------------------------------------------------------------------------------------------------------
    
    [Function: CphSale BulkAutoEntry]
    
    ;; Procedural Block
       
        Variable : CphDate             : Date   
        Variable : CphDrLedgerName     : String
        Variable : CphCrLedgerName     : String
        Variable : CphAmount        : Amount
        VARIABLE : ChqNo            : String
        VARIABLE : Narration        : String
        ;Variable:    ChqDate            :Date
    
        ;;Variable : CphNoofEntry        : Number:1   
        Variable     : Counter         : Number: 1
       
        001 :     Start Batch Post        : 10
        ;;003 :     SET : Counter           : 0 
        005 :     START PROGRESS          : ($$NumItems:CphSalesCollection)   : "Creating Vouchers" : @@CmpMailName : "Creating Payment Vouchers ..."
        007 :     WALK COLLECTION         : CphSalesCollection    ;;Sales Info
        ;;000 :   SET : CphNoofEntry         : $$Line:##CphNoofEntry ;; Counter
        010 :     SET : CphDate            : $$Date:$Date
        020 :     SET : CphDrLedgerName   : $PartyLedgerName
        030 :     SET : CphCrLedgerName   : #CphSalesCrLedFld
        040 :     SET : CphAmount            : $$AsAmount:$Amount   
        041    :    Set    : ChqNo                : #CphChequeNo
        042    :    Set    :    Narration        : $Narration
        ;043 :   Set:    ChqDate            : $$Date:$Date
       
       
        ;040a:   WHILE : ##CphNoofEntry >= 1
        050    :     SET             :     SVViewName            : $$SysName:AcctgVchView
       
       
        060    :     NEW OBJECT        :     Voucher   
        070    :     SET VALUE         :    Date                   : ##CphDate   
        080    :     SET VALUE        :     VoucherTypeName        : $$VchTypePayment
    
       
        090    :    SET VALUE         :    Narration             : $Narration
        100    :    SET VALUE         :    Narration             : "Cheque No :" + $CheNumUDf +" ,  Against Bill No :"+$Narration
    
    ;;----------------------------------------------------------------------------
    ;;Debit Entry
        110    :    INSERT COLLECTION OBJECT : AllLedgerEntries
        110a:    SET TARGET        : LedgerEntries
        120    :    SET VALUE         : Ledger Name            : ##CphDrLedgerName
        ;130
        140    :    SET VALUE         : IsDeemedPositive         : "Yes"   
        141    :    SET VALUE         : Amount                : ##CphAmount * (-) 1     ;##CphAmount
        150    :     SET TARGET        : ..
    
        150a  :    LOG : $$String:##CphDrLedgerName ;+ $$String:#CphAmount + "Dr"
        ;150b  :    LOG : ##CphCrLedgerName + $$String:#CphAmount + "Cr"
       
    ;----------------------------------------------------------------------------
    ;;Credit Entry
        160    :    INSERT COLLECTION OBJECT :  AllLedgerEntries
        160a:     SET TARGET        : LedgerEntries
        170    :    SET VALUE         : Ledger Name              :   ##CphCrLedgerName
        180    :    SET VALUE         : Amount                :     ##CphAmount * (-) 1 ;##CphAmount
        190    :    SET VALUE         : IsDeemedPositive         :   "No"
        ;200    :     SET TARGET        : ..
       
        ;200a:    LOG : $$String:##CphCrLedgerName ;+ $$String:#CphAmount + "Cr"
    ;-----------------------------------------------------------------------------------
        ;Bank Allocations
        201    :     IF                            : ($$IsLedOfGrp:$RBCBLedgerName:$$GroupBank OR $$IsLedOfGrp:$RBCBLedgerName:$$GroupBankOD)
        202    :    SET TARGET        : LedgerEntries[$$LoopIndex]
        203    :    SET                : BankLedgerAmount                    : $Amount
        209 :          INSERT COLLECTION OBJECT                : BankAllocations
        210    :            WALK            : BankAllocations
        211 :                SET TARGET    : BankAllocations[$$LoopIndex]
        220 :                SET VALUE        : Date                            : $$Owner:$$Owner:$Date
        230    :                SET VALUE        : TransactionType               :$$LocaleString:"Cheque"
        ;235:                SET VALUE        : BankName            : $RBCBLedgerName
        240    :                SET VALUE        : InstrumentNumber                :$$Owner:$$Owner:$ChqNumUDF
        250    :               SET VALUE         : InstrumentDate                :$$String:##CphDate
        260    :                SET VALUE        : PAYMENTFAVOURING      :$$String:##CphDrLedgerName
        270    :                 SET VALUE        : Amount                :(##CphAmount) *-1
        280    :                 SET TARGET        : ...
        281    :            End Walk   
        290    :                 SET TARGET        : ..
        300    :     END IF
       
    ;-----------------------------------------------------------------------------------
        310    :   SET VALUE         : PersistedView : ##SVViewName
        ;310a:     CALL             : CphSave Target Sales
        320    :   CREATE TARGET
       
        ;;330    :     SET             : CphDate            : ##CphDate
        340 :     INCREMENT         : Counter
        350a:     SHOW PROGRESS     : ##Counter
        360    :     END WALK   
        370    :     MSGBOX             : " Message Box " : "Successful created All the Payment Voucher"
        380 :     END PROGRESS
        390 :   DISPLAY            : CphPayment Daybook
        ;390    :     LOG : ">>>Voucher Created on "+$$String:$$Machinedate + " @ " + $$String:$$MachineTime + ">>>>>"
        400    :   RETURN
        410 :    End Batch Post
    
    /*
    [Function: CphSave Target Sales]
       
        10 : Save Target
    */
    
    
    ;; End-of-File
    
    
    [Report: CphPayment  Daybook]
    
        Use        : Daybook
        Set        : VoucherTypeName    : "Payment"
        Set        : SVFromDate        : $$FinYearBeg:##StartDate:$StartingFrom:Company:##SVCurrentCompany
        Set        : SVToDate            : $$FinYearEnd:##StartDate:$StartingFrom:Company:##SVCurrentCompany
               
        Local    : Collection        : Default    : Add    : Filter    : Prov Filter
    
    [System: Formula]
    
        Prov Filter    : $Amount = ##InputAmt
     
    Amit Kamdar likes this.


  25. Devendra_Rawat

    Devendra_Rawat Well-Known Member



    I tested it, yes it worked.. I worked on it next morning 6 to 7, but noticed a lot of issues, made bank allocation part working .. but I was getting the Dr Cr Total mismatch error.. and then abandoned it.:D:D
     


Share This Page