Auto Receipt for sales Invoices

Discussion in 'Tally Developer' started by Arun Prasath, Aug 20, 2012.

         

  1. Dear sir This code is, only working in cash receipt, but bank receipt cheque not working please help me

    ;; 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 : Number
    VARIABLE : Cheqdate : Date
    VARIABLE : CheqBankName : String



    10 : SET : CurrentBillName : $BillName1
    20 : SET : CurrentBillAmt : $$Abs:$BillAmt1
    30 : SET : BankLedgerName : $MyBankLedger
    40 : SET : PartyLedgerName : $partyLedgerName
    50 : SET : Cheqno : $InstrumentNumber
    60 : SET : Cheqdate : $InstrumentDate
    70 : SET : CheqBankName : $BankName


    80 : NEW OBJECT : Voucher
    90 : SET VALUE : VoucherTypeName : $$VchTypeReceipt
    100 : SET VALUE : Date : If $PDdate then $RDate else $Date
    110 : SET VALUE : IsPostDated : $PDdate
    120 : SET : SVViewName : $$SysName:AcctgVchView

    130 : SET VALUE : Narration :$Narration
    140 : SET VALUE : Narration :"For Invoice No : " + $VoucherNumber + " Auto Receipt "

    150 : INSERT COLLECTION OBJECT : LedgerEntries
    160 : SET VALUE : Ledger Name : ##PartyLedgerName
    170 : SET VALUE : IsDeemedPositive : No
    180 : SET VALUE : Amount : ##CurrentBillAmt
    190 : LOG : $$String:##CurrentBillAmt+"Cr"
    200 : LOG : ##PartyLedgerName


    210 : INSERT COLLECTION OBJECT : BillAllocations
    220 : SET VALUE : Name : ##CurrentBillName
    230 : SET VALUE : BillType : $$SysName:AgstRef
    240 : SET VALUE : Amount : ##CurrentBillAmt

    250 : SET TARGET : ...
    260 : SET TARGET : ..

    270 : INSERT COLLECTION OBJECT : LedgerEntries
    280 : SET VALUE : Ledger Name : ##BankLedgerName
    290 : SET VALUE : IsDeemedPositive : Yes
    300 : SET VALUE : Amount : (##CurrentBillAmt*-1 )

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

    320 : INSERT COLLECTION OBJECT : BankAllocations
    330 : SET VALUE : Date : $Date
    340 : SET VALUE : TransactionType : "Cheque/DD"
    350 : SET VALUE : InstrumentNumber : $ChequeInfo.CheNumUDf
    360 : SET VALUE : InstrumentDate : $ChequeInfo.CheDateUDf
    370 : SET VALUE : Bank Name : $ChequeInfo.CheBankUDf
    380 : SET VALUE : PAYMENTFAVOURING : $PartyLedgerName
    390 : SET VALUE : Amount : ($ChequeInfo.CheAmountUDf)*-1
    400 : SET TARGET : ...
    410 : SET TARGET : ..
    420 : END IF
    430 : SET VALUE : PersistedView : ##SVViewName
    440 : Create Target
    450 : LOG : ">>>Voucher Created on "+$$String:$$Machinedate + " @ " + $$String:$$MachineTime + ">>>>>"

    ;460 : 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 : Student BankName : Indent : 5
    Local : Field : Student BankName : Info : "Bank Name"
    Local : Field : Amount Collected : Info : "Amount"
    Border : Thin Bottom


    [Line: Cheque Collection Details]

    Fields : Course Name, Student Name, Student BankName
    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
    Align : Center
    Inactive : $$IsEmpty:$CheNumUDf
    Width : 45 MMS

    [Field: Student BankName]

    Use : Name Field
    Storage : CheBankUDf
    ;Indent : 5
    Inactive : $$IsEmpty:$CheNumUDf


    [Field: Amount Collected]

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

    [System: UDF]

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


    [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]
    Type : Amount: Forced
    Set Always : Yes

    Use : Amount Field
    Set as : $$Total:AmountCollected
    ;Set as : $Amount
    Read Only : yes



    ;;EOF
     


  2. sayed

    sayed Member


    sir tell me i want not total amount
    i want ask how many amount plss help me
     


  3. sayed

    sayed Member


    sir tell me i want not total amount
    i want ask how many amount plss help me
     


  4. vipul

    vipul New Member


    sir i want same tdl in auto payment
    please tell me
    thanks in advance
     


  5. vipul

    vipul New Member


    some changes in this auto receipt code to convert in auto payment but there is one big problem when make purchase entry after go yes its complet after this code make receipt payment instead of payment
    meand dr payment ki jagah receipt payment karta hai
    please help me on this code
    i attached files
     

    Attached Files:



  6. laxman

    laxman Member


    Hi vipul

    Try This
     

    Attached Files:

    Jaydeep Shah likes this.


  7. vipul

    vipul New Member


    thanks laxmanbhai
    good work
     


  8. ganeshgk

    ganeshgk New Member


    sir suppose change the sales value how to alter the receipt values in automatic
     


  9. sumamehtra

    sumamehtra New Member


    Is it possible auto receipt from sales order?
     


  10. Jaydeep Shah

    Jaydeep Shah New Member


    Thank you
     


  11. V Shankar

    V Shankar New Member


    pls any one tell me how we can do the part payment in this auot receipt tdl. this tdl is generating the receipt for the total amount. even bank receipt also its not picking the break down of the chq. ex. if the customer pays the amount by multiple chqs.
    pls send me the corrected code.
     


Share This Page