How to fetch Particular Ledger Value in a separate Field

Discussion in 'Free Source Codes' started by Ch Suresh, Oct 5, 2023.

    
  1. Ch Suresh

    Ch Suresh Member


    Dear Experts, please guide me to fetch a particular ledger amount in a separate field

    My Trail code is attached here please guide me
    I need to fetch the Fright Advance Ledger Amount of 100 Rupees, in the below Fright Advance Field.


    upload_2023-10-5_12-49-59.png

    [#Part: DBLLINE Narration]

    Add : Lines : After : VCH ShowStatutoryDetails : PayVchPayments
    [Line : PayVchPayments]
    Field : Medium Prompt, Amount Field;PayVchPayments
    Local : Field : Medium Prompt : Set as : $$LocaleString:"Fright Advance"
    Local : Field : Amount Field : Set as : $Amount:Ledger:$LedgerName="Fright Advance"
    Local : Field : Amount Field : Storage : FrightAmount
    Local : Field : Amount Field : Set always:Yes
    Invisible : NOT @@IsSales
    [System:UDF]
    FrightAmount:Amount:1994
     

    Attached Files:



  2. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Use $$FilterValue to get the Closing Balance of the "FRIGHT Advance"

    Learn FilterValue and its usage from Developer.

    And WHY you need a STORAGE for that value ????
     


  3. Ch Suresh

    Ch Suresh Member


    Yes sir, actually I am writing a code for an auto-payment voucher for Cash to Fright Advance from the sales entry
    Here is the complete code

    please guide me sir


    ;;--------- Auto Payment for Purchase

    [#Form: Sales Color]

    Add : On : At End : Form Accept : Yes : CALL : PaymentVchCreate

    [#Object: Voucher]

    PayPayBillName1: $$CollectionField:$PayBillName:1:LedgerEntries
    PayPayBillAmt1 : $$CollectionField:$PayBillAmt:1:LedgerEntries

    [#Object: LedgerEntry]

    PayBillName : $$CollectionField:$Name:1:BillAllocations
    PayBillAmt : $$CollectionField:$Amount:1:BillAllocations
    PayVTypeName: $PayRcptVchType

    [Function: PaymentVchCreate]

    ;; Variable Block


    Variable : CashLedger : String
    Variable : CashAmount : Amount

    Variable : VchType : String
    Variable : VchCostCentre : String

    Variable : VchDate : Date
    Variable : VchNarration : String
    Variable : VCHAmount : Amount
    Variable : VCHNumber : String
    ;
    090 : Set : CashLedger : "Cash"
    100 : Set : CashAmount : $FrightAmount;$Amount:Ledger:($LedgerName = "Fright Advance")

    110 : Set : VchType : $$VchTypePayment

    115 : Set : VchCostCentre : $AutoCostLevel

    120 : SET : VchDate : $DATE
    130 : SET : VCHAmount : ##CashAmount;##PayCardAmount + ##ChequeAmount + ##CashAmount
    140 : SET : VchNarration : "Bill No.: " + $$String:$VoucherNumber + ", and Vehicle No: "+$$String:$BasicShipVesselNo;+ " Payment Received " ;+ $$String:##PayCardNumber
    141 : Set : VCHNumber : $VoucherNumber

    150 : QUERYBOX : "Create Payment Voucher ?":Yes:No

    160 : IF : $$LastResult

    170 : NEW OBJECT : VOUCHER

    180 : SET VALUE : Date : ##VchDate
    185 : Set Value : AUTOCOSTLEVEL : ##VchCostCentre
    190 : SET VALUE : VoucherTypeName : ##VchType
    200 : SET : SVViewName : $$SysName:AcctgVchView

    210 : INSERT COLLECTION OBJECT : AllLedgerEntries
    220 : SET VALUE : LedgerName : "Fright Advance";$PartyLedgerName
    230 : SET VALUE : Amount : -1 * ##VCHAmount
    240 : SET VALUE : Is Deemed Positive : "Yes"

    250 : INSERT COLLECTION OBJECT : BillAllocations
    260 : SET VALUE : Name : ##VCHNumber;;$PayPayBillName1
    270 : SET VALUE : BillType : "AgstRef"
    280 : SET VALUE : Amount : -1 * ##VCHAmount
    290 : SET TARGET : ...

    ;
    490 : If : NOT $$IsSysName:##CashLedger
    500 : INSERT COLLECTION OBJECT : AllLedgerEntries
    510 : SET VALUE : LedgerName : ##CashLedger
    520 : SET VALUE : Amount : -1 * ##CashAmount
    530 : SET VALUE : Is Deemed Positive : "No"
    540 : SET TARGET : ..
    550 : End If
    551 : Set Value : Narration : ##VchNarration

    560 : SET VALUE : PersistedView : ##SVViewName
    570 : CREATE TARGET

    580 : ENDIF

    [#Part: DBLLINE Narration]

    Add : Lines : After : VCH ShowStatutoryDetails : PayVchPayments
    [Line : PayVchPayments]
    Field : Medium Prompt, Amount Field;PayVchPayments
    Local : Field : Medium Prompt : Set as : $$LocaleString:"Fright Advance"
    Local : Field : Amount Field : Set as : $Amount:Ledger:$LedgerName="Fright Advance"
    Local : Field : Amount Field : Storage : FrightAmount
    Local : Field : Amount Field : Set always:Yes
    Invisible : NOT @@IsSales
    [System:UDF]
    FrightAmount:Amount:1994
    ;; End-of-File
     


  4. parthiban.M

    parthiban.M Member


    [System:Formula]
    cGST :$$FilterAmtTotal:LedgerEntries:cGST1:$Amount
    cGST1 :$Name:Ledger:$LedgerName Contains $$LocaleString:"CGST"


    change "cgst" to "freightxxxx" and in ur field set as:mad:@cgst
    and check once whether u need storage or not.....
     


  5. Ch Suresh

    Ch Suresh Member


    Yes, I got the solution
    Thank You
     


Share This Page