Solution

Discussion in 'Requests' started by laxman, Dec 7, 2013.

    
  1. laxman

    laxman Member


    Dear Experts bellow code is not working with voucher class in sales please help...

    ;; Sri Ganeshji : Sri Balaji : Sri Pitreshwarji : Sri Durgaji : Sri Venkateshwara

    [System : Formula]

    AutoRec for Sales : $$InCreateMode and @@IsReceiptEntry

    [#Form : Sales Color]

    ;; Add : On : Form Accept : @@AutoRecforSales : CALL : Create Receipt Voucher
    Add : On : At End : Form Accept : Yes : CALL : Create Receipt Voucher

    [Function : Create Receipt Voucher]

    001 : Query Box : " Do you want to post \n Receipt voucher for Sales " : Yes : No
    002 : If : $$LastResult
    003 : CALL : My Voucher Create
    004 : END if

    [Function : My Voucher Create]

    VARIABLE : CurrentBillName : String
    VARIABLE : CurrentBillAmt : Amount
    VARIABLE : BankLedgerName : String
    VARIABLE : PartyLedgerName : String
    VARIABLE : Cheqno : String
    VARIABLE : Cheqdate : Date



    11 :SET : CurrentBillName : $BillName1
    12 :SET : CurrentBillAmt : $$Abs:$BillAmt1
    13 :SET : BankLedgerName : $MyBankLedger
    14 :SET : PartyLedgerName : $partyLedgerName


    15:NEW OBJECT:Voucher
    20:SET VALUE:VoucherTypeName: $$VchTypeReceipt
    25:SET VALUE:Date : If $PDdate then $RDate else $Date
    30:SET VALUE:IsPostDated: $PDdate
    35:SET:SVViewName: $$SysName:AcctgVchView

    40:SET VALUE:Narration:$Narration
    45:SET VALUE:Narration:"For Invoice No: " + $VoucherNumber + " Auto Receipt "

    50:INSERT COLLECTION OBJECT : LedgerEntries
    55:SET VALUE :Ledger Name: ##PartyLedgerName
    60:SET VALUE :IsDeemedPositive :No
    65:SET VALUE :Amount: ##CurrentBillAmt
    66 :LOG : $$String:##CurrentBillAmt+"Cr"
    67 :LOG : ##PartyLedgerName


    70:INSERT COLLECTION OBJECT: BillAllocations
    75:SET VALUE: Name: ##CurrentBillName
    80: SET VALUE: BillType: $$SysName:AgstRef
    85:SET VALUE: Amount: ##CurrentBillAmt

    90:SET TARGET: ...
    91:SET TARGET: ..

    95:INSERT COLLECTION OBJECT : LedgerEntries
    100:SET VALUE :Ledger Name : ##BankLedgerName
    105:SET VALUE :IsDeemedPositive :Yes
    110:SET VALUE :Amount : (##CurrentBillAmt*-1 )

    112:IF: ($$IsLedOfGrp:$MyBankLedger:$$GroupBank OR $$IsLedOfGrp:$MyBankLedger:$$GroupBankOD)

    115: INSERT COLLECTION OBJECT : BankAllocations
    120:SET VALUE: Date: $Date
    121:SET VALUE: TransactionType : "Cheque/DD"
    125:SET VALUE: InstrumentNumber: $ChequeInfo.CheNumUDf
    130: SET VALUE: InstrumentDate: $ChequeInfo.CheDateUDf
    135:SET VALUE: PAYMENTFAVOURING : $PartyLedgerName
    140:SET VALUE: Amount: ($ChequeInfo.CheAmountUDf)*-1
    145:SET TARGET: ...
    146:SET TARGET: ..
    147:END IF
    150: SET VALUE : PersistedView : ##SVViewName
    155:CREATE TARGET
    156:LOG : ">>>Voucher Created on "+$$String:$$Machinedate + " @ " + $$String:$$MachineTime + ">>>>>"

    160:RETURN

    ;; $$CollectionField:$BillCDt:$$Line:DSDLedgerBills


    [Collection : CurrentVchChqCollection]

    SourceCollection : .
    WAlk: Cheque Info

    Fetch: *.*

    [#Object: Voucher]

    BillName1:$$CollectionField:$BillName:1:LedgerEntries
    BillAmt1 :$$CollectionField:$BillAmt:1:LedgerEntries


    [#Object: LedgerEntry]

    BillName: $$CollectionField:$Name:1:BillAllocations
    BillAmt : $$CollectionField:$Amount:1:BillAllocations


    [System:FOrmula]

    DSDFrightAmt: $$FilterAmtTotal:LedgerEntries:DSDFrightAmt2:$Amount
    DSDFrightAmt2: $$isledofGrp:$LedgerName:$$Groupsundrydebtors
    IsReceiptEntry: $IsSalRecipt = "YES"
    VchPostdated : If $IsPostdated then "Yes" Else "No"



    [#Part: DBLLINE Narration]

    Add : Line : After : VCH Narration : Vch Recipt Detail


    [Line: Vch Recipt Detail]

    Fields : Medium Prompt, IsVchRecpt
    Local : Field : Medium Prompt : Set As : "Enter Receipt Details : "
    Invisible : Not @@IsSales

    [Field : IsVchRecpt]

    Use : Logical Field
    Set As : "No"
    Storage : IsSalRecipt
    Sub Form: Sales Receipt form : $$Value = "Yes"


    [System : UDF]

    IsSalRecipt : Logical : 1010
    MyBankLedger : String : 147
    PDdate : Logical : 1014
    IsRecChq : Logical : 1008
    RDate : Date : 150

    [System : Formula]

    IspostDatedRec : #IsPostdatRec = "No"


    [Report: Sales Receipt form]

    Form: Sales Receipt form


    [Form: Sales Receipt form]

    Part : FormSubTitle , Sales Receipt details
    VerticalAlign : Bottom
    HorizontalAlign : Left
    Background : @@SV_UNYELLOW
    Full Height : No
    Full Width : No
    Space Bottom : 0.25
    Option : Small Size Form
    Local : Field : Form SubTitle : Info : $$LocaleString:"Receipt Details"


    [Part : Sales Receipt details]

    Line : IsPostdatRec , PostdatedDate , SalesBank, RecChqDetails


    [Line: IsPostdatRec]

    Fields : Medium Prompt, IsPostdatRec
    Local : Field : Medium Prompt : Set as : "Is Post Dated ? "



    [Field : IsPostdatRec]

    Use : Logical Field
    Storage : PDdate
    Set Always : Yes


    [Line: PostdatedDate]

    Fields : Medium Prompt, PostdatedDate
    Local : Field : Medium Prompt : Set as : "Receipt Date : "


    [Field : PostdatedDate]

    Use : Uni Date Field
    Storage : RDate
    Skip : @@IspostDatedRec


    [Line: SalesBank]

    Fields : Medium Prompt, Receiptbank
    Local : Field : Medium Prompt : Set as : "Bank : "

    [Field : Receiptbank]

    Use : Name Field
    Keys : Create Ledger, Alter Ledger
    Storage : MyBankLedger
    Table: CashBank Ledgers Extract
    Show Table : Always


    [Line : RecChqDetails]

    Fields : Medium Prompt, RecChqDetails
    Local : Field : Medium Prompt : Set As :" Enter Cheque Details : "

    [Field : RecChqDetails]

    Use : Logical Field
    Storage : IsRecChq
    Sub Form: Cheque Collection Form : $$Value = "Yes"
    Skip : Not @@MyRecF

    [System : Formula]

    MyRecF : $$IsLedOfGrp:$MyBankLedger:$$GroupBank



    [Report: Cheque Collection Form]

    Form : Cheque Collection Form
    Title: "Cheque Details"


    [Form: Cheque Collection Form]

    Part: ALLOC Title, ALLOC AmtTitle, Cheque Collection Form
    Width: 60% Screen
    Height: 60% Screen
    Background: Very Light Orange

    Local : Field : ALLOC Prompt : Info: $$LocaleString:"Bank Allocations for :"
    Local : Field : ALLOC Name : Set as : $LedgerName
    Local : Field : ALLOC Name : Set Always : Yes
    Local: Line : ALLOC Title: Space Bottom: .5
    Local : Field : ALLOC Amount: Set as: $Amount
    Local : Field : ALLOC Amount: Format : "Forex"
    Local: Line: ALLOC Amount: Local: Field : Simple Prompt : Info : $$LocaleString:"For"


    [Part:Cheque Collection Form]

    Lines: Cheque Collection Title, Cheque Collection Details
    Bottom Line: ABS StuDetails

    Repeat: Cheque Collection Details: Cheque Info
    Scroll: Vertical
    Common Border: Yes
    Break After : $$IsEmpty:$CheNumUDf
    Total :AmountCollected

    [Line: Cheque Collection Title]

    Use: Cheque Collection Details
    Local: Field: Default: Delete: Storage
    Local: Field: Default: Inactive: No
    Local: Field: Default: Type: String
    Local: Field: Course Name: Info: "Cheque No."
    Local: Field: Student Name: Info: "Cheque Date"
    Local: Field: Amount Collected: Info: "Amount"
    Border: Thin Bottom


    [Line: Cheque Collection Details]

    Fields: Course Name, Student Name
    Right Field : AmountCollected


    [Field: Course Name]

    Use: Name Field
    Storage: CheNumUDf
    MAX : 6
    Width : 20 MMS


    [Field: Student Name]

    Use: Uni Date Field
    Storage: CheDateUdf
    Inactive: $$IsEmpty:$CheNumUDf
    Width : 45 MMS


    [Field: Amount Collected]

    Use: Amount Field
    Storage: CheAmountUDf
    Inactive: $$IsEmpty:$CheNumUDf


    [System: UDF]

    Cheque Info: Aggregate: 967
    CheNumUDf: String: 900
    CheDateUdf: Date: 125
    CheAmountUDf: Amount: 900


    [Line: ABS StuDetails]

    Field : Abs Subbank Title
    Right Field : Abs Sub Total

    Border : Totals

    [Field: Abs Subbank Title]

    Info : "Total"
    Width: 70 mms


    [Field: Abs Sub Total]

    Use : Amount Field
    Set as : $Amount
    Read Only : yes



    ;;EOF
     


  2. psjain_jal

    psjain_jal Member


    the above code was not work when we pass sales entry for Rs. 2000 & we recd chq only for 1500 ie rs 500 outstanding but in receipts vourchar its show bank recd chq of rs 2000
     


  3. mpal2311

    mpal2311 Active Member


    Good to see you again. Waiting for your Bundle of TDLs.
     


Share This Page