Payment Voucher Print Format

Discussion in 'Tally Developer' started by Mahesh Sethi, Jul 15, 2023.

    
  1. Mahesh Sethi

    Mahesh Sethi Member


    Dear Admin & experts,

    I have done the payment voucher in A 4 size paper . here i want before ledger if Amount Amount is Dr then before ledger print Dr or if ledger amount is Cr then before ledger print Cr and also Dr Cr Amount should come in single column.
    Screen shot is att.

    Code is as under:

    [Part : VoucherDetailsTop]
    Space Top: 1
    Line : VchHeadTop, PartyDetailsAllTop, PartyLedNarrTop,TotalWordsLineTop, VchCheckbyMadebyTop
    Repeat : PartyDetailsAllTop : AllLedgerEntries
    Border: Thick Box ;;Left Right

    [Line : VchHeadTop]
    Fields : VchParTop,
    Right Field : MMyVchDrAmountTop,MVchCrAmountTop
    Border : Thin Bottom

    [Field : VchParTop]
    Use : Name Field
    Set as : "PARTICULARS"
    Style : ManiStyle1 ;;Large Bold
    Width : 75% Page
    Align : Center

    [Field : MMyVchDrAmountTop]
    Use : Name Field
    Set as : "DEBIT AMOUNT"
    Style : ManiStyle1 ;;Medium Bold
    Width : 12.5% Page
    Align : Left
    Line : 2
    ;; Border : Thin left
    [Field : MVchCrAmountTop]
    Use : Name Field
    Set as : "CREDIT AMOUNT"
    Style : ManiStyle1 ;;Medium Bold
    Width : 12.5% Page
    Align : Left
    Line : 2
    ;; Border : Thin left
    [Line : PartyDetailsAllTop]
    Lines : PartyNameTop, ;;BlankLineI

    [Line : PartyNameTop]
    Field : PartyLedNameTop, PartyDrAmountTop, PartyCrAmountTop ;;CostCenterName
    ;Field : PartyLedName, CostCenterName, PartyDrAmount, PartyCrAmount
    ;Field : PartyLedName, PartyClosingBalance, PartyDrAmount, PartyCrAmount
    Explode : PartyLedNarrPartTop : yes
    Border : Thick Box
    Space Top : 1 mms
    Space Bottom: 1 mms

    [Part : PartyLedNarrPartTop]
    Line : PartyLedNarrTop
    ;Repeat : PartyLedNarr : LedgerEntries
    [Line : PartyLedNarrTop]
    Fields : Short Prompt, PartyLedNarrationTop
    Local : Field : Short Prompt : Info : $$LocaleString:"Detail's"
    Local : Field : Short Prompt : PrePrinted : Yes
    ;; SpaceBottom : 1
    ;; Space Top : 1

    [Field : PartyLedNameTop]
    Set as : $LedgerName
    Width : 75% Page
    Space Left : 5
    Style : Large
    ;;Border : Thin Bottom

    [Field : PartyDrAmountTop]
    Set as : if $$IsDr:$Amount then $$AsDrAmt:$Amount else ""
    Width : 12.5% Page
    Align : Right
    Style : Large ;;StyleAllText
    Border : Thin LeftRight

    [Field : PartyCrAmountTop]
    Set as : if $$IsDr:$Amount then "" else $$AsCrAmt:$Amount
    ;; Space Right : 1
    Width : 12.5% Page
    Align : Right
    Style : Large ;;StyleAllText
    [Field : PartyLedNarrationTop]
    Set as : $Narration
    Width : 60% Page
    Line : if $$StringLength:$Narration > 70 then 2 else 1
    Style : Large ;;StyleAllTextNarration

    Awaiting for your replay.

    Thanks
     

    Attached Files:



  2. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    If $$IsDr:$Amount:ledger:#yourfield then "Dr" else "Cr"

    As for amount in same column ... put the value there and use FORAMT : "DrCr" in your field
     


  3. Mahesh Sethi

    Mahesh Sethi Member


    Dear Admin Sir,

    Thanks for your replay, I Add a field before ledger name & its work but its show only cr in all ledgers.


    [Field : DRCRTop]
    Use : Name Field
    Set as : If $$IsDr:$Amount:ledger:#PartyLedNameTop then "Dr" else "Cr"
    Width : 4% Page
    Style : Large


    upload_2023-7-15_16-22-52.png
     


  4. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    If $$IsDr:$Amount then "Dr" else "Cr"
     
    Mahesh Sethi likes this.


Share This Page