Replace Amount field with UDF Field Value stored in ledger

Discussion in 'Tally Developer' started by Mahesh Sethi, Oct 8, 2020.

    
  1. Mahesh Sethi

    Mahesh Sethi Member


    Dear Sir,

    I want to replace the amount field when i post a receipt entry with that UDF value who stored in selected ledger for example when i select ledger OAE Diagnostic the value of UDF stored in OAE ledger will default show in amount field and it was changeable.

    Pls help me i am stuck ,This module i ready for practitioner doctors.
    the screen shoot will attached and here is the code :


    [#Part: MST GrandParent]
    Add:Line:After: MST GrandParent: Charges

    [Line : Charges]
    Fields : Medium Prompt,Chargess
    Local : Field : Medium Prompt : Set as: "Inspection Cherge's:"
    ;;Local : Field : Medium Prompt : Invisiable:$$IsBelongsTo:$$GroupDirectIncomes
    [Field : Chargess]
    Use : Number Field
    Set as : $$MyCChargges
    Storage : MyCChargges
    ;;Invisible : $$IsBelongsTo:$$GroupDirectIncomes


    Awaiting for your replay

    Thanks in advance.
    Receipt Entry.png
    Mani Ledger1.png Ledger1.png
     

    Attached Files:



  2. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Objectify your UDF in ---- Object : Ledger and then use the same in the relevant field as per your single entry mode..
     


  3. Mahesh Sethi

    Mahesh Sethi Member


    Respected sir,
    Can you pls give me any example code so that i study that because this is unknown part for me.

    Pls sir help me its humble request.

    Thanks & Regards,

    Mani
     


  4. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    for Example code..... study {Object : Ledger} in Developer ........
     


  5. Himanshu-2002

    Himanshu-2002 Active Member


    I think You can create a Column In which User will put values and When That Field is active then You can make that amount field inactive because I don't think that Changing Amount Data Type To Other Data type is a good Option....It will create problems in future
     


  6. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    He is not changing Data Type....merely putting a pre-fixed amount in the amount column.

    All he needs is to define it in OBJECT : LEDGER and use that in the amount field........... means add it to the IF...ELSE condition already existing in that field.
     


  7. Himanshu-2002

    Himanshu-2002 Active Member


    I think We can do it by many Ways

    Example:
    [Function: Example]
    00: Insert Collection Object: LedgerEntries
    10: Set Value : Amount : @@Formula
    20: Set Target:..

    And Define The Formula
    [System: Formulas]
    Formula: $$CollectionFieldByKey:$UDF:#LedgerName: Mycollection

    2nd Example

    [#Field: Amount Field]
    Set as : @@Formula
     


  8. Amit Kamdar

    Amit Kamdar Administrator Staff Member



  9. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    There is no collection of UDFs in Ledger Master, they are all defined in Object : Ledger.

    So CollectionFieldByKey will not work.
     


  10. Himanshu-2002

    Himanshu-2002 Active Member


    I think we can do this by CollectionFieldByKey because This is My Previous Project...and I have achieved This by Function....It was not exactly same But It was very similar to this
     


  11. Mahesh Sethi

    Mahesh Sethi Member


    Admin Sir,

    Yes i want exactly the same can you pls share with me so that i will complete the project .

    Pls Pls sir help.

    Mahesh
     


  12. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    I do not give codes, I teach people to learn and develop..........

    I have already given you the solution....you must adopt it.... and then use that value in the relevant field. It is not very complicated.

    And you are a coder yourself, so you must learn and learn well.
     
    panam likes this.


  13. Mahesh Sethi

    Mahesh Sethi Member



    Sir can you pls tell me what condition i have given that the value is replace .

    [#Field: ACLSAmt]

    Set By Condition : If ((@@IsReceipt AND NOT $IsDeemedPositive) OR (@@IsPayment AND $IsDeemedPositive) AND ($$IsEmpty:$TypeofTaxPayment AND $$IsEmpty:$..TaxPaymentType)) AND (@@IsIndianServiceTax AND @@IsSTTaxenabledDate_Vch) +
    AND ($LEDIsDutiesLedger:Ledger:$LedgerName AND +
    $$IsSysNameEqual:ServiceTax:($TaxType:Ledger:$LedgerName) AND +
    ($$Owner:$$FilterCount:LedgerEntries:IsSTTDebtorCreditorAccount > 0) AND +
    ($$Owner:$$FilterCount:LedgerEntries:IsSTSalesAccount = 0) AND +
    ($$IsSysNameEqual:Advance:($$Owner:$LedgerEntries[1, @@NonEmptyBill].BillAllocations[1].BillType) OR +
    $$IsSysNameEqual:NewRef:($$Owner:$LedgerEntries[1, @@NonEmptyBill].BillAllocations[1].BillType))) Then Yes Else No : If NOT $$IsEmpty:$Amount OR NOT $(Company, ##SVCurrentCompany).STUserDefinedClass Then $$Value Else +
    If @@STRoundUp Then $$RoundUp:($$Owner:$$STTAdvRcptTaxCalculation:#ACLSLed):(@@STRoundLimit) else if +
    @@STRoundDown Then $$RoundDown:($$Owner:$$STTAdvRcptTaxCalculation:#ACLSLed):(@@STRoundLimit) else if+
    @@STRoundNormal Then $$Round:($$Owner:$$STTAdvRcptTaxCalculation:#ACLSLed):(@@STRoundLimit) else($$Owner:$$STTAdvRcptTaxCalculation:#ACLSLed)
     


  14. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    First you define in Object : Ledger

    myvalue : $MyCChargges

    Then you add this in the SET AS of the above field.
     
    panam likes this.


  15. Mahesh Sethi

    Mahesh Sethi Member



    [#Field: ACLSAmt]
    Use : Amount Field
    Set as : $MyValue

    /*Set By Condition : If ((@@IsReceipt AND NOT $IsDeemedPositive) OR (@@IsPayment AND $IsDeemedPositive) AND ($$IsEmpty:$TypeofTaxPayment AND $$IsEmpty:$..TaxPaymentType)) AND (@@IsIndianServiceTax AND @@IsSTTaxenabledDate_Vch) +
    AND ($LEDIsDutiesLedger:Ledger:$LedgerName AND +
    $$IsSysNameEqual:ServiceTax:($TaxType:Ledger:$LedgerName) AND +
    ($$Owner:$$FilterCount:LedgerEntries:IsSTTDebtorCreditorAccount > 0) AND +
    ($$Owner:$$FilterCount:LedgerEntries:IsSTSalesAccount = 0) AND +
    ($$IsSysNameEqual:Advance:($$Owner:$LedgerEntries[1, @@NonEmptyBill].BillAllocations[1].BillType) OR +
    $$IsSysNameEqual:NewRef:($$Owner:$LedgerEntries[1, @@NonEmptyBill].BillAllocations[1].BillType))) Then Yes Else No : If NOT $$IsEmpty:$Amount OR NOT $(Company, ##SVCurrentCompany).STUserDefinedClass Then $$Value Else +
    If @@STRoundUp Then $$RoundUp:($$Owner:$$STTAdvRcptTaxCalculation:#ACLSLed):(@@STRoundLimit) else if +
    @@STRoundDown Then $$RoundDown:($$Owner:$$STTAdvRcptTaxCalculation:#ACLSLed):(@@STRoundLimit) else if+
    @@STRoundNormal Then $$Round:($$Owner:$$STTAdvRcptTaxCalculation:#ACLSLed):(@@STRoundLimit) else($$Owner:$$STTAdvRcptTaxCalculation:#ACLSLed)

    */

    ;[#Collection : Ledger]
    ;Compute : MyValue : $$CollectionField:$MyValueObj:1:Ledger:$LedgerName

    [#Object : Ledger]
    Collection : Ledger
    MyValue : $MyCChargges


    Sir where i go wrong.

    Pls help
     
    Himanshu-2002 likes this.


  16. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    [#Object : Ledger]
    MyValue : $MyCChargges

    [#Field: ACLSAmt]
    Set as : $MyValue:Ledger:$LedgerName

    Changes to default Field of Tally is NOT recommended. You do this at your own risk.
     
    panam likes this.


  17. Mahesh Sethi

    Mahesh Sethi Member


    Thanks a Lot sir, I am using this for only book receipt voucher Cr Cash and Dr Direct Income A/c Only, And at the time of entry receptionist will pass entry fast and without error.

    This module is developed for Practitioner Doctors who Diagnose the patent Charge the Fees and also Sell the Product like implants or machines under trading A/c.

    Again Thanks a Lot for your Inspiration.

    Mahesh
     


  18. narayane88

    narayane88 Active Member


    please following also use for





    [#Field: CI Value]
    Set By Condition:$LedgerName = "INSEPENCTION CHARGES" :$$AsAmount:$MyCChargges:Ledger:$LedgerName
    Set Always:Yes

    [#Field: EI Value]
    Set By Condition:$LedgerName = "INSEPENCTION CHARGES" :$$AsAmount:$MyCChargges:Ledger:$LedgerName
    Set Always:Yes
     


  19. Mahesh Sethi

    Mahesh Sethi Member


    Thanks for your support.

    Can i use this for Group = "Direct Income" in set by condition
    Pls Replay

    Mahesh
     


  20. narayane88

    narayane88 Active Member


    YES SIR AS YOU
     


Share This Page