PRINT USER DEFINED FIELD AT PURCHASE VOUCHER

Discussion in 'Free Source Codes' started by Muraleedharan Krishnan, Mar 12, 2022.

    

  1. PLEASE ANYBODY SUGGEST THE CODE TO PRINT USER DEFINED FIELD AT PURCHASE VOUCHER. THANKS
    Amitji any hints please!
     

    Attached Files:

    Last edited: Mar 12, 2022



  2. Please see my code for printing. Pl tell me where I have made the mistake in the code.

    ;;========================================================================================================
    ;; VOUCHER LEVEL CUSTOMISATION
    ;;=========================================================================================================

    [#Part: VCHTitle2Left]
    Add:Line:After:VCH Ref:qrcode

    [#Part:VCHTitle2right]
    Add: Line: At End: etrrcttime
    Add:Line:After:etrrcttime:tansadno
    Add:Line:After:tansadno : bnkref
    Add:Line:After:bnkref : controlnumber

    [Line : qrcode]
    Fields : Short Prompt, My Field1
    Local : Field : Short Prompt : Set as: "FIELD 1:"
    Invisible: Not @@IsPurchase


    [Line : controlnumber]
    Fields : Short Prompt, My Field2
    Local : Field : short prompt :Set as: "FIELD 4:"
    Invisible: Not @@IsPurchase

    [Line : bnkref]
    Fields : Short Prompt, My Field3
    Local : Field : short prompt :Set as: "FIELD 5:"
    Invisible: Not @@IsPayment

    [Line : tansadno]
    Fields : Short Prompt, My Field4
    Local : Field : short prompt :Set as: "FIELD 3:"
    Invisible: Not @@IsPayment
    Invisible: Not @@IsPurchase

    [Line : etrrcttime]
    Fields : Short Prompt, My Field5
    Local : Field : Short Prompt : Set as: "FIELD 2:"
    Invisible: Not @@IsPurchase

    [Field : My Field1]
    Use: short Name Field
    Storage: Myname1
    Case : Upper Case

    [Field : My Field2]
    Use: Short Name Field
    Storage: Myname2

    [Field : My Field3]
    Use: Short Name Field
    Storage: Myname3

    [Field : My Field4]
    Use: Short Name Field
    Storage: Myname4
    Case : Upper Case

    [Field : My Field5]
    Use: Short Name Field
    Storage: Myname5

    [System : UDF]
    MyName1 : String: 21450
    MyName2 : String: 21451
    MyName3 : String: 21452
    MyName4 : String: 21453
    MyName5 : String: 21454
    ;=========================================================================================================
    ;To Print Field 1
    ;=========================================================================================================
    [#Part: PUPCFG Left]
    Add : Line : PUQRCodePrnt

    [Line : PUQRCodePrnt]

    Field: Medium Prompt, PUQRCodePrnt
    Local: Field: Medium Prompt : Info : $$LocaleString:"Print QRCode ?"
    ;Local: Field: Logical Field : Modifies : PUQRCodePrnt
    ;Local : Field : Logical Field : Skip : NOT @@IsPurchase
    ;Local : Field : Medium Prompt : Color : Red
    ;Local : Field : Logical Field : Skip : @@IsBangladeshVATOn AND NOT @@IsPurchase AND NOT #VATCOMPShowExemptFlag

    [Field: PUQRCodePrnt]
    Use : Logical Field
    Modifies: PUQRCodePrnt
    ;Color : Red
    ;Storage : PUQRCodePrint

    [System: Variables]

    PUQRCodePrnt : No

    [Variable: PUQRCodePrnt]

    Type : Logical
    Persistent : Yes


    [System:Formula]

    QRCode : if @@IsPurchase then ##$Myname1 else + No

    DSPQRCode : if ##SVVoucherOfType ="Purchase" Then $$LocaleString:"QR Code" Else + ""

    ;=========================================================================================================

    IN THE ABOVE CODE FOR PRINTING WERE I AM MAKING MISTAKE? ANYBODY CAN SUGGEST!

    THANKS
     


  3. sattam

    sattam Active Member


    You have to add part in purchase Voucher print and define field accordingly
     



  4. Thank you. Let me try to add the part in Voucher Print and see.
     



  5. Sir failed to find the part name to print. please help. thanks
     



  6. [​IMG]
    i HAVE SAME ISSUE
     



  7. [Part: CMP AccFeat Left]
    Add: Line: CMP EnableAreaTable
    [Line: CMP EnableAreaTable]
    Field: Medium Prompt, CMP EnableAreaTable
    Local: Field: Medium Prompt: Info: "Enable Area ? "
    Local: Field: Long Prompt: Info: "Enable Broker wise Report.?:"
    ;;Does not work in Tally ERP 9
    ;;Invisible: NOT $$MODAdvInventory or NOT $IsInvoicingOn
    Space Top: 1
    [Field: CMP EnableAreaTable]
    Use: Logical Field
    Storage: EnableArea
    Set as: If $$IsEmpty:$$Value then "No" else $$Value
    Sub Form: SmReport: $$Value = "Yes"
    [#Menu: Gateway Of Tally]
    Add : Item : Area : Menu : AreaMenu
    [Menu: AreaMenu]
    Add : Item : Area Master : Alter : Area Name
    Add : Item : Blank
    Add : Item : Area Sales Report : Display : SmReport
    Add : Item : Blank
    [Report: Area Name]
    Form : Area Name
    Object : Company
    [Form: Area Name]
    Part : FormSubTitle, Saleman
    ;Button : Delete All, Remove Line, Restore Line, Restore All,Report Operations
    FullWidth : No
    Height : 90% Screen
    Background : @@SV_CHEQUE
    SpaceRight : 0.5
    SpaceLeft : 1.5
    Local : Field : Form SubTitle : Info : $$LocaleString:"Area Name"
    Option : Small Size Form
    [Part: Saleman]
    Lines : CMP Area
    Repeat : CMP Area:mydbArea
    Break on: $$IsEmpty:$AreaName
    Scroll : Vertical
    Height : 90% Screen
    [Line: CMP Area]
    Fields : Multi SNo, CMPSalemanName
    Local : Field : Default : Delete : Border
    [Field: CMPSalemanName]
    Use : Short Name Field
    Storage : AreaName
    Unique : Yes
    [System: UDF]
    mydbArea : Aggregate: 999
    AreaName : String : 1000 ;: Yes
    [Collection : AreaNameCollection]
    Type : mydbArea : Company
    Childof : ##SVCurrentCompany
    Format : $AreaName, 10
    Title : Area Name
    ;=============== During Sales Voucher Entry=============
    [#Part: VCHTitle2Left]
    Option: HPAreaName: $$IsSales:##SVVoucherType OR $$IsDelNote:##SVVoucherType
    [!Part: HPAreaName]
    Add: Line: HPAreaName
    [Line: HPAreaName]
    Add: Field: HPAreaNameTitle
    Add: Field: VCHAreaName
    [Field: HPAreaNameTitle]
    Info : "Area: "
    Width: 10
    ;;This is where the User will input the "Area"
    [Field: VCHAreaName]
    Use : Name Field
    Storage : VCHAreaName
    Set as : $VCHAreaName
    Width : 25
    Table : AreaNameCollection, not applicable
    Show Table: Always
    Key : Create AreaName
    [Key: Create AreaName]
    Key :Alt + C
    Action: CREATE: AreaName
    [System: UDF]
    VCHAreaName:String:375
    ;;================= Report Code start from here=====================
    ;====================================================Area sales Report==================================================
    TDLLic : $$CmpUserName:CompanyUsersCollection <> ÒadminÓ
    ;; Limiting based on Company Users
    [Report: SmReport]
    Use : DSP Template
    Form : PQRReport
    Title : "Area Report"
    Set : SVFromDate : $$MonthStart:##SVCurrentDate
    Set : SVToDate : $$MonthEnd:##SVCurrentDate
    Set : AreaChqVar : "Full"
    Set : AreaName : ""
    [Form: PQRReport]
    Use : DSP Template
    Parts : PQRReport
    Height : 100% screen
    Width : 100% screen
    Delete : Buttons: ExplodeFlag
    Background: @@SV_RELEASEDLEAFGREEN_PL; Very Light Green
    ;Delete : Bottom Buttons: DSPAutoColumns, RelReports,BudgetAnalysis, ReportConfig
    Bottom Toolbar Buttons : BottomToolBarBtn1, BottomToolBarBtn6, BottomToolBarBtn7, BottomToolBarBtn8, BottomToolBarBtn9, BottomToolBarBtn10, BottomToolBarBtn11, BottomToolBarBtn12,
    Add: Button: Areafilter
    [Part: PQRReport]
    Lines:pQRTitile,PQRBody
    BottomLines : PQRBody Total
    Repeat : PQRBody:pQRAreaVouchersColl
    CommonBorder: Yes
    Scroll : Vertical
    Total:pQRPartyAmount,PQRVCHGP
    [Line: PQRTitile]
    Use:pQRBody
    Local : Field : Default : Type : String
    Local : Field : Default : Style : Tiny Bold
    Local : Field : Default : Align : Centre
    Local : Field : Default : set as : $$LocaleString:"S. No"
    Local : Field : PQRPartyDate : Set as: $$LocaleString:"Date"
    Local : Field : PQRPartyVchNo : Set as: $$LocaleString:"Vch No."
    Local : Field : PQRPartyName : Set as: $$LocaleString:"Party Name"
    Local : Field : PQRPartyArea: Set as: $$LocaleString:"Area"
    Local : Field : PQRVCHGP: Set as: $$LocaleString:"GrossProfit"
    Local : Field : PQRVCHGPPER: Set as: $$LocaleString:"Profit%"
    Local : Field : PQRPartyVchType : Set as: $$LocaleString:"Vch Type"
    Local : Field : PQRPartyAmount : Set as: $$LocaleString:"Amount"
    Border : Flush Totals
    [Line: PQRBody]
    Field:pQRSno, PQRPartyDate,PQRPartyVchNo,PQRPartyName,PQRPartyArea,PQRVCHGP,PQRVCHGPPER,PQRPartyVchType
    RightField:pQRPartyAmount
    Border :Thin Bottom
    [Field:pQRSno]
    Set as : $$Line
    Width : 1.5 cm
    Align : Center
    Border : Thin Left Right
    [Field: PQRPartyDate]
    Set as : $Date
    Width : 9% Screen
    Align : Right
    ;Style : Tiny
    Border : Thin Left
    [Field: PQRPartyVchNo]
    Set as : $VoucherNumber
    Width : 9% Screen
    Align : Center
    ;Style : Tiny
    Border : Thin Left
    [Field: PQRPartyName]
    Use : Name Field
    Set as : $PartyLedgerName
    Border : Thin Left
    Width : 38% Screen
    Align : Left
    ;Style : Tiny
    Variable: LedgerName
    Display : Ledger Vouchers
    [Field: PQRPartyArea]
    Use :Name Field
    Set as :$VCHAreaName
    Border : Thin Left
    Width : 12% Screen
    Align : Left
    ;Style : Tiny
    Key : Create AreaName
    [Field: PQRVCHGP]
    Use :Amount Forex Field
    Set as :$GrossProfit
    Border : Thin Left
    Width : 10% Screen
    Align : Left
    ;Style : Tiny
    Key : Create AreaName
    [Field:pQRVCHGPPER]
    use : amount field
    width: 10% Screen
    Border:thin left
    align: right
    set as: $GROSSPROFIT/$GROSSREVENUE*100
    [Field: PQRPartyVchType]
    Set as : $VoucherTypeName
    Border : Thin Left
    ;Width : 15% Screen
    Align : Left
    ;Style : Tiny
    [Field: PQRPartyAmount]
    Use : Amount Forex Field
    Set as : $GROSSREVENUE
    Border : Thin Left
    ;Width : 15% Screen
    Align : Right
    ;Style : Tiny
    Format : "No Zero,DrCr,Symbol," + ##ShowForex
    [Line: PQRBody Total]
    Use:pQRBody
    Local : Field : Default : Type : String
    Local : Field : Default : Style : Tiny Bold
    Local : Field : Default : Align : Centre
    Local : Field : PQRSno : Set as: ""
    Local : Field : PQRPartyDate : Set as: ""
    Local : Field : PQRPartyVchNo : Set as: ""
    Local : Field : PQRPartyName : Set as: "TOTAL"
    Local : Field : PQRPartyName : Align : Centre
    Local : Field : PQRPartyArea: Set as: ""
    local : field : PQRVCHGP :set as: $$Total:pqrvchgp
    local : field : PQRVCHGPPER :set as: $$Total:pqrvchgp/$$Total:pQRPartyAmount*100
    Local : Field : PQRPartyVchType : Set as: ""
    Local : Field : PQRPartyAmount : Set as: $$Total:pQRPartyAmount
    Border : Flush Totals
    ;============================== Filter ===================================
    [Button:AreaFilter]
    Key : Alt+S
    Action : Execute : AreaFilter
    Title : Area Name
    [Report:AreaFilter]
    Form : AreaFilter
    ;Set : AreaName : ""
    Set : AreaChqVar : "Filter"
    [Form:AreaFilter]
    Part : AreaFilter
    No Confirmation : Yes
    [Part:AreaFilter]
    Line : AreaFilter
    [Line:AreaFilter]
    Field : Medium Prompt,AreaFilter
    Local : Field : Medium Prompt : Set as : "Select Area Name: "
    [Field:AreaFilter]
    Table : AreaNameCollection,EndOfList
    ShowTable : Always
    Use : Name Field
    Width : 20
    Border : Thin Box
    Variable : AreaName
    Modifies : AreaName
    ;================================================================================================
    ;===================================== Collections =================================================
    [Collection: PQRAreaVouchersColl]
    Type : Voucher
    Fetch : Date, VoucherNumber, VoucherTypeName,LedgerName,PartyLedgerName,VCHAreaName,GrossProfit,GROSSREVENUE, LedgerEntries.*
    Filter : PQRSaleManVouchers
    Filter : AreaFilter
    [System:UDF]
    EnableArea : Logical : 1000
    Commission : Number : 1001
    [Variable:AreaName]
    Type : String
    [Variable:AreaChqVar]
    Type : String
    [System:Variable]
    AreaName : ""
    AreaChqVar : ""
    [System: Formula]
    ;PQRSaleManVouchers: $$IsSales:$VoucherTypeName OR $$IsDelNote:$VoucherTypeName
    PQRSaleManVouchers: $$IsSales:$VoucherTypeName
    AreaWise : $VCHAreaName=@@AreaEOL
    AreaFull : $VCHAreaName=$VCHAreaName
    AreaEOL : if $$IsEndOfList:##AreaName then $VCHAreaName Else ##AreaName
    AreaFilter : if ##AreaChqVar="Filter" Then @@AreaWise Else @@AreaFull
     



  8. I want to print area name on invoice (simple invoice)
     


Share This Page