How to extract Right 3 characters of a Ledger Name?

Discussion in 'Tally Developer' started by ABDUL AZIZ, Jul 17, 2019.

    
  1. ABDUL AZIZ

    ABDUL AZIZ Member


    But sir, I don't know how to add line in Local Field?
     


  2. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    You can add it in the Part or Line level.... of your code...........
     


  3. ABDUL AZIZ

    ABDUL AZIZ Member


    Thanks sir got it , means a line cannot be added at Field level.
     


  4. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    It can be added....

    Local : Part : ThisPart : Local : Line : ThisLine : Local : Field : Addthisfield

    even at Report / Form level also.....

    Local : Form : ThisForm : Local : Part : ThisPart : Local : Line : ThisLine : Local : Field : Addthisfield
     


  5. ABDUL AZIZ

    ABDUL AZIZ Member


    Sir,

    Due to my limited knowledge, I tried but not succeeded.



    [LINE : AllFranchiseeInvoicesLine1]

    Use : AllFranchiseeInvoicesLine2
    FIELD : NAME FIELD
    LOCAL : FIELD : AllFranchiseeInvoicesVchrDate : INFO : "Voucher Date"
    LOCAL : FIELD : AllFranchiseeInvoicesVchrPartyName : INFO : "Ledger Name"
    LOCAL : FIELD : AllFranchiseeInvoicesVchrType : INFO : "Voucher Type"
    LOCAL : FIELD : AllFranchiseeInvoicesVchrNo : INFO : "Voucher No."
    LOCAL : FIELD : AllFranchiseeInvoicesVchrBasic : INFO : "Basic Amount"
    LOCAL : FIELD : AllFranchiseeInvoicesVchrIGST : INFO : "IGST Amount"
    LOCAL : FIELD : AllFranchiseeInvoicesVchrCGST : INFO : "CGST Amount"
    LOCAL : FIELD : AllFranchiseeInvoicesVchrSGST : INFO : "SGST Amount"
    LOCAL : FIELD : AllFranchiseeInvoicesVchrRound : INFO : "R/O Amount"
    LOCAL : FIELD : AllFranchiseeInvoicesVchrAmount : INFO : "Total Amount"
    Local : Field : Default : Style : Normal Bold
    Local : Field : Default : Align : Center
    Local : Field : Default : Color : Black
    Local : Field : Default : Line : 0
    Border : Thin Top Bottom

    I want to display "Total Amount" field like this as shown in image below:
    Error message by Tally.JPG

    Thanks & Regards,
     


  6. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    From your code... it looks like a report of either sales or purchase......... then why do you want the separate column for Dr/Cr figures ??? Is this a combined Sales/Purchase report??
     


  7. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    And from you code, cannot make out what you have tried? as it is not shown/apparent.

    Display your efforts in doing the same and so I can point out where you have gone wrong.
     


  8. ABDUL AZIZ

    ABDUL AZIZ Member


    Right sir!
     


  9. ABDUL AZIZ

    ABDUL AZIZ Member


    I have added three lines: (but I wated to add these lines in Amount Field only, which I am not able to do that so I added full three Lines)

    Trying to do Total :

    In 1st Line I want Net Total i.e. net of Dr and Cr.
    In 2nd Line Total of Dr. entries only.
    In 3rd Line Total of Cr. entries only.

    but not able to do that
    codes are given below.



    [LINE :AllFranchiseeInvoicesLine3]


    use : AllFranchiseeInvoicesLine2
    Border : Totals
    Local : Field : Default : Style : Normal Bold
    Local : Field : Default : Type : String
    Local : Field : AllFranchiseeInvoicesVchrDate : Set as : "Net Total"
    Local : Field : AllFranchiseeInvoicesVchrPartyName : Set as : ""
    Local : Field : AllFranchiseeInvoicesVchrType : Set As : ""
    Local : Field : AllFranchiseeInvoicesVchrNo : Set As : ""
    Local : Field : AllFranchiseeInvoicesVchrBasic : Set As : $$Total:AllFranchiseeInvoicesVchrBasic
    Local : Field : AllFranchiseeInvoicesVchrIGST : Set As : $$Total:AllFranchiseeInvoicesVchrIGST
    Local : Field : AllFranchiseeInvoicesVchrCGST : Set As : $$Total:AllFranchiseeInvoicesVchrCGST
    Local : Field : AllFranchiseeInvoicesVchrSGST : Set As : $$Total:AllFranchiseeInvoicesVchrSGST
    Local : Field : AllFranchiseeInvoicesVchrRound : Set As : $$Total:AllFranchiseeInvoicesVchrRound
    Local : Field : AllFranchiseeInvoicesVchrAmount : Set As : $$Total:AllFranchiseeInvoicesVchrAmount
    Local : Field : AllFranchiseeInvoicesVchrAmount : Type : Amount
    Local : Field : AllFranchiseeInvoicesVchrAmount : Use : Amount Field
    Local : Field : AllFranchiseeInvoicesVchrAmount : Format : "DrCr"



    [LINE :AllFranchiseeInvoicesLine4]

    use : AllFranchiseeInvoicesLine2
    Border : Totals
    Local : Field : Default : Style : Normal Bold
    Local : Field : Default : Type : String
    Local : Field : AllFranchiseeInvoicesVchrDate : Set as : "Dr Total"
    Local : Field : AllFranchiseeInvoicesVchrPartyName : Set as : ""
    Local : Field : AllFranchiseeInvoicesVchrType : Set As : ""
    Local : Field : AllFranchiseeInvoicesVchrNo : Set As : ""
    Local : Field : AllFranchiseeInvoicesVchrBasic : Set As : ""
    Local : Field : AllFranchiseeInvoicesVchrIGST : Set As : ""
    Local : Field : AllFranchiseeInvoicesVchrCGST : Set As : ""
    Local : Field : AllFranchiseeInvoicesVchrSGST : Set As : ""
    Local : Field : AllFranchiseeInvoicesVchrRound : Set As : ""
    Local : Field : AllFranchiseeInvoicesVchrAmount : Set As : $$Total:AllFranchiseeInvoicesVchrAmount
    Local : Field : AllFranchiseeInvoicesVchrAmount : Type : Amount
    Local : Field : AllFranchiseeInvoicesVchrAmount : Use : Amount Field
    Local : Field : AllFranchiseeInvoicesVchrAmount : Format : "DrCr"

    [LINE :AllFranchiseeInvoicesLine5]

    use : AllFranchiseeInvoicesLine2
    Border : Totals
    Local : Field : Default : Style : Normal Bold
    Local : Field : Default : Type : String
    Local : Field : AllFranchiseeInvoicesVchrDate : Set as : "Cr Total"
    Local : Field : AllFranchiseeInvoicesVchrPartyName : Set as : ""
    Local : Field : AllFranchiseeInvoicesVchrType : Set As : ""
    Local : Field : AllFranchiseeInvoicesVchrNo : Set As : ""
    Local : Field : AllFranchiseeInvoicesVchrBasic : Set As : ""
    Local : Field : AllFranchiseeInvoicesVchrIGST : Set As : ""
    Local : Field : AllFranchiseeInvoicesVchrCGST : Set As : ""
    Local : Field : AllFranchiseeInvoicesVchrSGST : Set As : ""
    Local : Field : AllFranchiseeInvoicesVchrRound : Set As : ""
    Local : Field : AllFranchiseeInvoicesVchrAmount : Set As : Not $$Total:AllFranchiseeInvoicesVchrAmount
    Local : Field : AllFranchiseeInvoicesVchrAmount : Type : Amount
    Local : Field : AllFranchiseeInvoicesVchrAmount : Use : Amount Field
    Local : Field : AllFranchiseeInvoicesVchrAmount : Format : "DrCr"

    Error message by Tally.JPG
     


  10. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    In your collection you need to compute........

    Aggr Compute : AllFranchiseeDR : SUM : If $$IfDr:<udf name> then $Amount Else 0
    Aggr Compute : AllFranchiseeCR : SUM : If NOT $$IfDr:<udf name> then $Amount Else 0

    Then use $AllFranchiseeDr or $AllFranchiseeCr in your Field in respective Line/field.
     


  11. ABDUL AZIZ

    ABDUL AZIZ Member


    Sir, Please look at the below collection, desired result in not coming.

    [Collection: AllFranchiseeInvoicesVouchersColl]

    Type : Voucher
    ;Child Of : $$VchTypeSales
    ;Belongs To : Yes
    Walk : Ledger Entries
    By : PartyLedgerName : $LedgerName
    Filter : AllFranchiseeInvoicesVouchersList
    Fetch : *.*, Amount, Parent, PartyLedgerName, Ledger, Date, LedgerName , VoucherTypeName
    Aggr Compute : AllFranchiseeDR : SUM : If $$IfDr:$AllFranchiseeInvoicesVchrAmount then $Amount Else 0
    Aggr Compute : AllFranchiseeCR : SUM : If NOT $$IfDr:$AllFranchiseeInvoicesVchrAmount then $Amount Else 0


    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    Local : Field : AllFranchiseeInvoicesVchrAmount : Set As : $AllFranchiseeCR
     


  12. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Is AllFranchiseeInvoicesVchrAmount your Field Name or UDF Name ???
     


  13. ABDUL AZIZ

    ABDUL AZIZ Member


    Field name.

    I dont have any <udf name>
     


  14. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    then instead of $.... use #
     


  15. ABDUL AZIZ

    ABDUL AZIZ Member


    Sir, Still not giving any result

    [LINE :AllFranchiseeInvoicesLine4]

    use : AllFranchiseeInvoicesLine2
    Border : Totals
    Local : Field : Default : Style : Normal Bold
    Local : Field : Default : Type : String
    Local : Field : AllFranchiseeInvoicesVchrDate : Set as : "Dr Total"
    Local : Field : AllFranchiseeInvoicesVchrPartyName : Set as : ""
    Local : Field : AllFranchiseeInvoicesVchrType : Set As : ""
    Local : Field : AllFranchiseeInvoicesVchrNo : Set As : ""
    Local : Field : AllFranchiseeInvoicesVchrBasic : Set As : ""
    Local : Field : AllFranchiseeInvoicesVchrIGST : Set As : ""
    Local : Field : AllFranchiseeInvoicesVchrCGST : Set As : ""
    Local : Field : AllFranchiseeInvoicesVchrSGST : Set As : ""
    Local : Field : AllFranchiseeInvoicesVchrRound : Set As : ""
    Local : Field : AllFranchiseeInvoicesVchrAmount : Set As : $AllFranchiseeDR
    Local : Field : AllFranchiseeInvoicesVchrAmount : Type : Amount
    Local : Field : AllFranchiseeInvoicesVchrAmount : Use : Amount Field
    Local : Field : AllFranchiseeInvoicesVchrAmount : Format : "DrCr"



    [LINE :AllFranchiseeInvoicesLine5]

    use : AllFranchiseeInvoicesLine2
    Border : Totals
    Local : Field : Default : Style : Normal Bold
    Local : Field : Default : Type : String
    Local : Field : AllFranchiseeInvoicesVchrDate : Set as : "Cr Total"
    Local : Field : AllFranchiseeInvoicesVchrPartyName : Set as : ""
    Local : Field : AllFranchiseeInvoicesVchrType : Set As : ""
    Local : Field : AllFranchiseeInvoicesVchrNo : Set As : ""
    Local : Field : AllFranchiseeInvoicesVchrBasic : Set As : ""
    Local : Field : AllFranchiseeInvoicesVchrIGST : Set As : ""
    Local : Field : AllFranchiseeInvoicesVchrCGST : Set As : ""
    Local : Field : AllFranchiseeInvoicesVchrSGST : Set As : ""
    Local : Field : AllFranchiseeInvoicesVchrRound : Set As : ""
    Local : Field : AllFranchiseeInvoicesVchrAmount : Set As : $AllFranchiseeCR
    Local : Field : AllFranchiseeInvoicesVchrAmount : Type : Amount
    Local : Field : AllFranchiseeInvoicesVchrAmount : Use : Amount Field
    Local : Field : AllFranchiseeInvoicesVchrAmount : Format : "DrCr"


    [Collection: AllFranchiseeInvoicesVouchersColl]

    Type : Voucher
    ;Child Of : $$VchTypeSales
    ;Belongs To : Yes
    Walk : Ledger Entries
    By : LedgerName : $LedgerName
    Filter : AllFranchiseeInvoicesVouchersList
    Fetch : *.*, Amount, Parent, PartyLedgerName, Ledger, Date, LedgerName , VoucherTypeName
    Aggr Compute : AllFranchiseeDR : SUM : If $$IfDr:#AllFranchiseeInvoicesVchrAmount then $Amount Else 0
    Aggr Compute : AllFranchiseeCR : SUM : If NOT $$IfDr:#AllFranchiseeInvoicesVchrAmount then $Amount Else 0
     


  16. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Instead of $Amount....try #AllFranchiseeInvoicesVchrAmount
     


  17. ABDUL AZIZ

    ABDUL AZIZ Member


    No changes in result...

    [Collection: AllFranchiseeInvoicesVouchersColl]

    Type : Voucher
    ;Child Of : $$VchTypeSales
    ;Belongs To : Yes
    Walk : Ledger Entries
    By : LedgerName : $LedgerName
    Filter : AllFranchiseeInvoicesVouchersList
    Fetch : *.*, Amount, Parent, PartyLedgerName, Ledger, Date, LedgerName , VoucherTypeName
    Aggr Compute : AllFranchiseeDR : SUM : If $$IfDr:#AllFranchiseeInvoicesVchrAmount then #AllFranchiseeInvoicesVchrAmount Else 0
    Aggr Compute : AllFranchiseeCR : SUM : If NOT $$IfDr:#AllFranchiseeInvoicesVchrAmount then #AllFranchiseeInvoicesVchrAmount Else 0

    Error message by Tally.JPG
     


  18. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    As a final test...try this.....
    Aggr Compute : AllFranchiseeDR : SUM : If $$IfDr:#AllFranchiseeInvoicesVchrAmount then $$AsAmount:1111 Else 0
    Aggr Compute : AllFranchiseeCR : SUM : If NOT $$IfDr:#AllFranchiseeInvoicesVchrAmount then $$AsAmount:2222 Else 0

    If this value displays, then it means the problem is coming from elsewhere.

    From your code shared, this is the MAX I can do.......... you can try other things. If the value is not being computed, it means the Collection is wrong and you need another collection to SUM up the value.
     


  19. ABDUL AZIZ

    ABDUL AZIZ Member


    Not showing anything...
     


  20. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    So the problem is elsewhere......since no values are being picked up from this collection...................either the Collection is wrong or a new collection is required. Now that cannot be commented until the whole code is studied.
     


  21. ABDUL AZIZ

    ABDUL AZIZ Member


    Sir,

    I have attached the code and backup please help me to trace the error.

    I have added a button F7 to display report.

    I am not getting the Total of Dr and Cr. at bottom line.
     

    Attached Files:

    Last edited: Jul 19, 2019


  22. ABDUL AZIZ

    ABDUL AZIZ Member


    Please check someone and tell me the error......
     


Share This Page