Print selected bill

Discussion in 'Tally Developer' started by tarasolution, Sep 3, 2012.

    
  1. tarasolution

    tarasolution New Member


    dear all,

    want to print selected bill from sale register i use a collection and added a button, in that collection i use "Data Source: Report: Selected" but don't know how to fetch the value

    pl help , Thanks in advance
     


  2. admin

    admin Administrator Staff Member


    This is very simple. When ever u write "Data Source: Report: Selected" in the collection, your collection contains those Vouchers.

    Now, add Fetch Attribute in the collection, which one you want to print

    [Collection : My Selected Bills]
    Data Source: Report: Selected
    Fetch : Inventory Entries.*, Voucher Number, Date,Ledger Entries.*

    Like this :)
     
    Maulik Patel likes this.


  3. tarasolution

    tarasolution New Member


    Here my full code but as per you told it is not working that's why i m asking



    [#Form : Day Book]
    Add : Button : PrintSelectedCheques

    [Button: PrintSelectedCheques]
    Key : Ctrl + F9
    Title : "Print Bill"
    Action: Print Report : My Invoice;My Invoice;;_Tanvi
    Scope : Selected Lines

    [Report : My Invoice]
    ;Use: Multi Voucher Print
    Add : Collection : PrintSelectedBill
    ;Collection : MSpecific Vouchers of Company
    ;Local : Collection : MSpecific Vouchers of Company : Delete: Filter
    ;Local : Collection : MSpecific Vouchers of Company : Add: Filter : IsOfSVVoucherType, OptionalVch
    Object : Voucher
    ;set : VoucherTypeName : "Sales"

    [#Report : Printed invoice]
    Add : Collection : PrintSelectedBill

    [Collection: PrintSelectedBill]
    Data Source: Parent Report: Selected
    Fetch : Inventory Entries.*, Voucher Number, Date,Ledger Entries.*
    ;Type : Voucher
    ;Switch: VType: Others Voucher of Company: NOT ($$IsStockJrnl:##SVVoucherType OR $$IsJobMaterialIssue:##SVVoucherType OR $$IsJobMaterialReceive:##SVVoucherType)


    [Form : My Invoice]
    Delete:parts
    Delete:Bottom Parts
    Delete:pageBreak
    Height : @@InvHeight inch
    Width : @@InvWidth inch
    ;; Space Top : @@InvSpace inch
    ;; Space Right : 0.5 inch
    ;Space Left : @@InvSpaceLeft inch
    ;Space Bottom: 0.25 inch
    ;Space Top : @@InvSpace Inch
    ;Space Bottom : 0 mms
    ;;Space Left : 0 mms
    ;Space Right : 0 mms
    ;Height : 5 inch
    ;Width : 3 inch
    Add:Top Parts:NM Top Part,NM Mid Part
    Add:Bottom Parts:NM Bottom Part
    Add:page Break:NM ClPgBrk,NM OpPgBrk
    FetchObject: Stock Item: @@InvEntryList: IsBatchWiseOn, AdditionalUnits,PartNo, Description, OnlyAlias, HasMfgDate,IsPerishableOn
    FetchObject: Ledger: @@LedEntryList: StateName, Pincode, RegistrationNumber, TaxType, ReserveName, ServiceCategory, STCategory

    [Part:NM ClPgBrk]
    Line:NM CF

    [Line:NM CF]
    Right Fields:NM CF

    [Field:NM CF]
    Set as:"Carried Forward....."

    [Part:NM OpPgBrk]
    Use:NM Top Part
    ;;Lines:NM OPOne,NM OpTwo
    ;;
    ;;[Line:NM OpOne]
    ;;Right Fields:NM OpOne
    ;;Height:40 mms
    ;;
    ;;[Field:NM OpOne]
    ;;Set as:"Brought Forward....."
    ;;
    ;;[Line:NM OpTwo]
    ;;Use:Column Title Line

    [Part:NM Top Part]
    Parts:NM TopFirst,NM TopSecond,NM TopThird
    Vertical:Yes

    [Part:NM TopFirst]
    Lines:NM PgTitle,NM InvTitle,R1,R2
    Repeat: R2:BuyerAddress

    [Line:NM PgTitle]
    Right Fields:NM PgTitle

    [Field:NM PgTitle]
    Set as:"Page No."+$$String:$$PageNo
    Inactive:$$PageNo=1

    [Line:NM InvTitle]
    Field:NM InvTitle

    [Field:NM InvTitle]
    SetAs:##ReportTitle
    Full Width:Yes
    Alignment:Centre
    Style:Large Bold

    [Line:R1]
    Fields: RFld1
    SpaceTop: 2 mms

    [Field:RFld1]
    SetAs: $PartyLedgerName
    FullWidth: Yes
    Style: LARGE bOLD
    Alignment: Centre

    [Line:R2]
    Field:RFld2

    [Field:RFld2]
    SetAs: $BuyerAddress
    FullWidth: Yes
    Style: LARGE
    Alignment: Centre

    [Part:NM TopSecond]
    Left Parts : NM TopLeftPart
    RightParts : NM TopRightPart
    ;Height:27 mms
    ;Width:200 mms

    [Part:NM TopLeftPart]
    Line: M1,M3
    Vertical: Yes
    [Line:M1]
    Field: MFld1
    SpaceTop: 2 mms

    [Field:MFld1]
    SetAs: "NO. : "+ $VoucherNumber
    FullWidth: Yes
    Align: Left

    [Line:M3]
    Field:MFld3

    [Field:MFld3]
    SetAs: "BROKER : " + $EntryBrokarage
    FullWidth: Yes
    Align: Left

    [Part:NM TopRightPart]
    ;Width: 85 mms
    Lines: M2

    [Line:M2]
    Field:MFld2

    [Field:MFld2]
    Type: String
    SetAs: "Date : "+$$String:$Date
    FullWidth: Yes
    Align: Right



    [Part:NM TopThird]
    Line:Column Title Line
    Border:Dark Border

    [Border:Dark Border]
    Top:Thick
    Bottom:Thick
    ;Right:Thick
    ;Left:Thick

    [Line:Column Title Line]
    Use:NM INVLine
    Local:Field:pclsFld:SetAs:"ITEM"
    Local:Field:pclsFld:Align:Left
    Local:Field:pclsFld:Full Width : YEs
    Local:Field:pclsFld:Style : Tiny Bold

    Local:Field:ALTUnitFld:SetAs:"BAG/PKT"
    Local:Field:ALTUnitFld:Type:String
    Local:Field:ALTUnitFld:Width: 14 mms
    Local:Field:ALTUnitFld:Style : Tiny Bold
    Local:Field:ALTUnitFld:Align:Right
    Local:Field:ALTUnitFld:Line : 0

    Local:Field:QtyFld:SetAs:"KGS."
    Local:Field:QtyFld:Type:String
    Local:Field:QtyFld:Align:Right
    Local:Field:QtyFld:Width: 14 mms
    Local:Field:QtyFld:Style : Tiny Bold

    Local:Field:RateFld:SetAs:"RATE"
    Local:Field:RateFld:Type:String
    Local:Field:RateFld:Align:Right
    Local:Field:RateFld:Width: 14 mms
    Local:Field:RateFld:Style : Tiny Bold

    Local:Field:AmtFld:SetAs:"AMOUNT"
    Local:Field:AmtFld:Align:Right
    Local:Field:AmtFld:Width: 20 mms
    Local:Field:AmtFld:Style : Tiny Bold

    [Part:NM Mid Part]
    Line:NM INVLine
    Repeat:NM INVLine:InventoryEntries
    Scrolled:Vertical
    ;Border:Thick Base
    ;Common Borders:Yes
    Float : YEs

    [Line:NM INVLine]
    Fields: PclsFld,ALTUnitFld,QtyFld,RateFld,AmtFld
    Explode : NM BatchPart :(@@HasBatchWise OR @@IsOrderVch) AND @@InvWithBatches AND (NOT @@IsOrderVch OR @@OrdExplBatch)


    [Field:pclsFld]
    SetAs: $StockItemName
    Full Width: Yes
    ;Border: Thick Left
    Alignment: Left
    Style: Tiny
    Line: 0

    [Field:ALTUnitFld]
    Use: Qty Secondary Field
    SetAs: $BilledQTy
    Width: 14 mms
    Style: Tiny
    Alignment : Right
    ;Max : @@MaxNumberWidth
    ;Border: Thick Left Right
    Format: "NoSymbol,NoZero,NoComma"

    [Field:QtyFld]
    Use: Qty Primary Field
    Set as: $BilledQTy
    Width: 14 mms
    Alignment: Right
    Style: Tiny
    Format: "NoSymbol,NoZero,NoComma"
    ;Border: Thick Right

    [Field:RateFld]
    Use: Rate Price Field
    Set as: $Rate
    Width: 14 mms
    Style: Tiny
    Alignment: Right
    ;Border: Thick Left Right

    [Field:AmtFld]
    SetAs: $Amount
    Width: 20 mms
    Style: Tiny
    Alignment: Right
    ;Border: Thick Left

    [Part : NM BatchPart]
    Line : NM BatchLine
    Repeat : NM BatchLine : Batch Allocations

    [Line : NM BatchLine]
    Field : PclsFld1,ALTUnitFld1,QtyFld1,RateFld1,AmtFld1
    Empty if : $$Isempty:$batchname or NOT @@HasBatchWise

    [Field:pclsFld1]
    SetAs: "Lot No : " + $batchname
    Full Width: Yes
    Alignment: Left
    Style: Tiny
    Line: 0


    [Field:ALTUnitFld1]
    set as: ""
    Width: 14 mms
    Style: Tiny
    Alignment: Right
    Format: "NoSymbol,NoZero,NoComma"

    [Field:QtyFld1]
    Set as: ""
    Width: 14 mms
    Alignment: Right
    Style: Tiny
    Format: "NoSymbol,NoZero,NoComma"

    [Field:RateFld1]
    Set as: ""
    Width: 14 mms
    Style: Tiny
    Alignment: Right

    [Field:AmtFld1]
    SetAs: ""
    Width: 20 mms
    Style: Tiny
    Alignment: Right

    [Part:NM Bottom Part]
    Parts:NM LEDPart
    Vertical:Yes

    [Part:NM LEDPart]
    Left PaRT : NM LEDPart lEFT
    rIGHT pART : NM LEDPart Right
    Border: Thin Top

    [PaRT : NM LEDPart lEFT]
    Line : NM LEDPart lEFT Line

    [Line : NM LEDPart lEFT Line]
    Field: NM AIW

    [Field:NM AIW]
    SetAs: $$InWords:$Amount+" only."
    Full Width: Yes
    Align: Left
    Line: 0
    Style: Tiny

    [pART : NM LEDPart Right]
    Lines: IT Line,LELine,NetAmtLine
    Repeat: LELine:LedgerEntries
    Common Borders: Yes

    [Border:Thick Base]
    Right:Flush,Thin,Full Length
    Left:Thin,Full Length
    Bottom:Flush,Thin,Full Length

    [Line:ITLine]
    Field: SubTotFld,SubTotAmtFld
    Invisible: $$NumItems:InventoryEntries <=1

    [Field:SubTotFld]
    SetAs:"GROSS TOTAL : "
    Align:Right
    Width: 40 mms
    Style: Tiny

    [Field:SubTotAmtFld]
    Use:AmountField
    Full Width:Yes
    SetAs:$$CollAmtTotal:InventoryEntries:$Amount;;$$Total:AmtFld
    Align:Right
    Style: Tiny Bold
    ;Border:Thick Left

    [Line:LELine]
    Fields:LETitleFld,LEAmtFld
    Empty:$LedgerName = $PartyLedgerNAme

    [Field:LETitleFld]
    SetAs:$LedgerName + " : "
    Width:40 mms
    Align:Left
    Delete: Space Left
    Style: Tiny

    [Field:LEAmtFld]
    SetAs:$Amount
    Align:Right
    Full Width:Yes
    Style: Tiny

    [Line:NetAmtLine]
    Fields:NetAmtTitleFld
    RightField:NetAmtFld

    [Field:NetAmtTitleFld]
    SetAs:"TOTAL AMOUNT : "
    Style:Normal Bold
    Width: 40 mms
    Align:Right

    [Field:NetAmtFld]
    Use: Amount Field
    SetAs:$amount
    Align:Right
    Full Width:yes
    Border: My Top
    Style:Normal Bold

    [Border: My Top]
    Top:Thick,Full Length
    Bottom:Thick,Double,Full Length

    ;; Adding Agent Field
    ;[#Part: DBLLINE Narration]
    ; add : option : opbrokarage : $$Issales:##SVVoucherType ;or $$IsPurchase:##SVVoucherType
    ;
    ; [!Part : opbrokarage ]
    ; Add : line : before :VCH NarrPrompt :Linebrkgs
    ;
    ; [Line : Linebrkgs]
    ; field : Short prompt,entbrokarage
    ; local : field : short prompt : set as : "Agent Name :"
    ; local : field : short prompt : width : .85 inch
    ;
    ;[Field : entbrokarage]
    ; Use : name field
    ; style : normal
    ; width : 1.5 inch
    ; storage : EntryBrokarage
    ; set always : yes
    ;;Invisible: @@Mykey

    ;*******************************Date Control Formula From Here*************************
    [System : Formula]
    chkdate : $$date:"30-10-2010"
    Mykey : If $$Machinedate > @@chkdate Then "Yes" Else "No"


    [System : Udf]
    EntryBrokarage : String : 21000
    ; ---------------------------------------------------------------End of File------------------------------------------------------------------------------------------------
     



  4. can u tell me my attached custome invoice how to do page break with tag " Original" & "Duplicate"
     

    Attached Files:



  5. tarasolution

    tarasolution New Member


    use this


    [Part : InvHeading Part1]
    Line : noofcopyln

    [Line : noofcopyln]
    Field : MynoofCopy Field

    [Field: MynoofCopy Field]
    Set As: If @@IsSales and ##SVPrintCopies > 1 Then @NonTaxInvSet else $CrfmSaleType
    NonTaxInvSet: If $$SetNo = 1 Then $$LocaleString:"Client Copy" Else +
    If $$SetNo = 2 Then $$LocaleString:"EDP Copy" Else +
    If $$SetNo = 3 Then $$LocaleString:"Serial Control Copy" Else +
    If $$SetNo = 4 Then $$LocaleString:"UnPaid Bills File Copy" Else $$LocaleString:"EXTRA Copy"
    Align : Right
    Style: S10 Bold
    fULL wIDTH: yeS
     



  6. Sir, Where i have to use this code and also i have used page break in attached invoice but it is not working also.

    If possible attached my .txt file pls modify and send me the same because i am not expert in tdl programming but i have learn my self and i have customize my own invoice format.

    If possible pls. share you mobile number then i can call you and explain you about my problems.

    Thanks in Advance
    Thanks & regards,
     


  7. tarasolution

    tarasolution New Member


    can you provide me some demo data for test this code ?
     


  8. tarasolution

    tarasolution New Member


    pl help .... in selected bill print tdl , pl , pl
     


  9. tarasolution

    tarasolution New Member


    My Full Code
     

    Attached Files:




  10. This is the code for modification. and your attached sales bill print is giving error fetch object in form.
    1. I need Terms & condition in full page
    2. I need Company log on top left.
    3. Vat analysis on bottom part.
    4. Page break
    5. Address field on top one line address and other line for Phone: Email.
    6. own Company's IFCI Code.
    7. Buyer's tax number on below buyer's address.

    Thanks for your help in Advance.
     

    Attached Files:



  11. Aniket

    Aniket New Member


    Sir this code is not working for the printing of selected bills in remote location from the daybook. Please help me with the modifications to be done.
     
    ANKUR BAJAJ likes this.



  12. Dear Sir, Pls. help me to do the mentioned changes in above mentioned file
     


  13. Jitendra Velani

    Jitendra Velani New Member


    This Printed Bills TDL Not Printing a Customer Name & address and Inventory Details in Body of Invoice Printing
     


  14. laxman

    laxman Member




    Dear Expert

    Need Discount Column ......
     


  15. KHADER

    KHADER New Member


    it is not show print preview
     


Share This Page