want TDL help

Discussion in 'Tally Developer' started by ONKAR, Jul 8, 2019.

    
  1. ONKAR

    ONKAR Active Member


    @Amit Kamdar sir please help me, in pos voucher customized default fields, but balance in change field not working properly, net sales, tender is working. see this image and tdl

    POS VOUCHER.JPG


    [#Form : POS INVOICE Color]
    Use : Voucher

    [#part: VCH POS Normal]
    Add:Line:After:VCH POS InvoiceTotal: VCH POS PTOTAL1, VCH POSPTOTAL2, VCHPOSPTOTAL3, VCHPOSPTOTAL4

    [Line:VCH POS PTOTAL1]
    Left Field:SHORT PROMPT,VCH POSCashLedger1, VCH POSCashAmount1
    Local : Field : Short Prompt : Set as : $$LocaleString:"Cash"


    [Field: VCH POSCashLedgerName1]

    Use : Name Field
    Set as : #VCHPOSCashLedger
    Storage : POSCashLedger
    Set Always : Yes
    Skip : Yes
    Invisible : Yes

    [Field:VCH POSCashLedger1]
    Use : Name Field

    Set as : If $$IsEmpty:$LedgerName OR $$IsEmpty:#VCHPOSCashAmount Then $$SysName:NotApplicable Else $LedgerName
    Storage : LedgerName:LedgerEntries:First:NOT $$IsSysName:$LedgerName AND $LedgerName = $POSCashLedger
    Table : POS Cash Ledgers Extract, NOT Applicable
    Keys : Create Ledger, Alter Ledger
    Variable : SV Ledger
    Width : @@VCHNameWidth
    Show Table : On Blank
    Skip : $$AmountAdd:#VCHPOSBankAmount:$$AmountAdd:#VCHPOSCardAmount:#VCHPOSCouponAmount = #VCHPOSInvoiceTotal OR #VCHPOSInvoiceTotal=0
    Option : VCH POSCashSinglePymt : ##POSSinglePayment
    Option : VCH POSForced : NOT $$InAlterMode

    [Field:VCH POSCashAmount1]
    Use : Amount Forex Field

    Storage : Amount:LedgerEntries:First:NOT $$IsSysName:$LedgerName AND $LedgerName = $POSCashLedger
    Set as : If NOT $$IsFieldEdited Then $$AmountAdd:#VCHPOSInvoiceTotal:$$AmountAdd:#VCHPOSCardAmount:$$AmountAdd:#VCHPOSCouponAmount:#VCHPOSBankAmount +
    Else $$Value

    Validate : If $$IsNegative:#VCHPOSInvoiceTotal Then $$AmountAdd:$$Value:$$AmountAdd:#VCHPOSBankAmount:$$AmountAdd:#VCHPOSCardAmount:#VCHPOSCouponAmount >= #VCHPOSInvoiceTotal Else +
    $$AmountAdd:$$Value:$$AmountAdd:#VCHPOSBankAmount:$$AmountAdd:#VCHPOSCardAmount:#VCHPOSCouponAmount <= #VCHPOSInvoiceTotal+
    AND NOT $$IsNegative:$$Value

    Set Always : Yes
    Option : VCH POS SinglePymt :##POSSinglePayment
    Format : "Symbol, No Zero," + ##ShowForex

    Inactive : $$IsNOTApplicable:#VCHPOSCashLedger OR $$IsEmpty:#VCHPOSCashLedger
    Skip : $$IsNotApplicable:#VCHPOSCashLedger OR $$AmountAdd:#VCHPOSBankAmount:$$AmountAdd:#VCHPOSCardAmount:#VCHPOSCouponAmount = #VCHPOSInvoiceTotal


    ;--------
    [Line:VCH POS PTOTAL2]
    Left Field:EI POS TOTAL2

    [Field:EI POS TOTAL2]
    Field:pOS INFO1, POS QTY1, POS AMOUNT1

    Border:THIN BOX
    Align:Left

    [Field:pOS INFO1]
    Info:"NET SALES :-"
    Width:18
    Local:Style:DEFAULT:Height:12
    Background:Blue
    Color : Lily White
    Local:Style:DEFAULT:Space Top : 0.5

    [Field:pOS QTY1]
    Info:""
    Width:6
    [Field:pOS AMOUNT1]
    Use : Amount Forex Field

    Storage : Amount:LedgerEntries:First:NOT $$IsSysName:$LedgerName AND $LedgerName = $POSCashLedger1
    Set as : If NOT $$IsFieldEdited Then $$AmountAdd:#VCHPOSInvoiceTotal:$$AmountAdd:#VCHPOSCardAmount:$$AmountAdd:#VCHPOSCouponAmount:#VCHPOSBankAmount +
    Else $$Value

    Validate : If $$IsNegative:#VCHPOSInvoiceTotal Then $$AmountAdd:$$Value:$$AmountAdd:#VCHPOSBankAmount:$$AmountAdd:#VCHPOSCardAmount:#VCHPOSCouponAmount >= #VCHPOSInvoiceTotal Else +
    $$AmountAdd:$$Value:$$AmountAdd:#VCHPOSBankAmount:$$AmountAdd:#VCHPOSCardAmount:#VCHPOSCouponAmount <= #VCHPOSInvoiceTotal+
    AND NOT $$IsNegative:$$Value

    Set Always : Yes
    Option : VCH POS SinglePymt :##POSSinglePayment
    Format : "Symbol, No Zero," + ##ShowForex

    Inactive : $$IsNOTApplicable:#VCHPOSCashLedger1 OR $$IsEmpty:#VCHPOSCashLedger1
    Skip : $$IsNotApplicable:#VCHPOSCashLedger1 OR $$AmountAdd:#VCHPOSBankAmount:$$AmountAdd:#VCHPOSCardAmount:#VCHPOSCouponAmount = #VCHPOSInvoiceTotal

    Align:Left
    Width:12
    Background:Blue
    Color : Lily White
    ;=====================
    [Line:VCH POS PTOTAL3]
    Left Field:EI POS TOTAL3

    [Field:EI POS TOTAL3]
    Field:pOS INFO2, POS QTY2, VCHPOSMoneyTendered1

    Border:THIN BOX
    Align:Left

    [Field:pOS INFO2]
    Info:"TENDER :-"
    Width:18
    Local:Style:DEFAULT:Height:12
    Background:Blue
    Color : Lily White
    Local:Style:DEFAULT:Space Top : 0.5

    [Field:pOS QTY2]
    Info:""
    Width:6
    [Field:VCHPOSMoneyTendered1]
    Use : Amount Forex Field

    Storage : POSCashReceived
    Validate : If (@@UseClassFmt AND $$InCreateMode) +
    Then $$Value >= $$AsPositive:#CIPOSCashAmount Else $$Value >= $$AsPositive:#VCHPOSCashAmount ;;AsPositive is used so that the cases of Positive and Negative Cash Amount both are considered.

    Format : "Symbol, No Zero," + ##ShowForex
    Set Always : Yes

    Align:Left
    Width:12
    Background:Blue
    Color : Lily White
    ;==========================
    [Line:VCH POS PTOTAL4]
    Left Field:EI POS TOTAL4

    [Field:EI POS TOTAL4]
    Field:pOS INFO3, POS QTY3, POS AMOUNT3

    Border:THIN BOX
    Align:Left

    [Field:pOS INFO3]
    Info:"BALANCE IN CHANGE :-"
    Width:22
    Local:Style:DEFAULT:Height:10
    Background:Blue
    Color : Lily White
    Local:Style:DEFAULT:Space Top : 0.5

    [Field:pOS QTY3]
    Info:""
    Width: 6

    [Field:pOS AMOUNT3]
    Use : Amount Forex Field
    Set as : If NOT $$IsEmpty:#VCHPOSCashAmount AND #VCHPOSMoneyTendered > $$AsPositive:#VCHPOSCashAmount Then $POSCashReceived - $$AsPositive:#VCHPOSCashAmount Else +
    If NOT $$IsEmpty:#CIPOSCashAmount AND #VCHPOSMoneyTendered > $$AsPositive:#CIPOSCashAmount Then $POSCashReceived - $$AsPositive:#CIPOSCashAmount Else ""
    Set Always : Yes
    Skip : Yes
    Format : "Symbol, No Zero," + ##ShowForex

    Align:Left
    Width:12
    Background:Blue
    Color : Lily White

    #Field: VCH POSCashLedgerName]
    Invisible:Yes

    [#Field: VCH POS CashDeemedPos]
    Invisible:Yes
    [#Field: VCH POSCashNoZero]
    Invisible:Yes
    [#Field: VCH POSCashLedger]
    Invisible:Yes
    [#Field: VCH POSCashAmount]
    ;Invisible:Yes
    [#Field: VCH POS MoneyTendered]
    Invisible:Yes
    [#Field: VCH POS Balance]
    Invisible:Yes
    [#Line: VCH POS Cash Receipt]
    Invisible:Yes
     
    Last edited: Jul 8, 2019
    sandeep76out likes this.


  2. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    #POSAMOUNT1 - #VCHPOSMoneyTendered1
     


  3. ONKAR

    ONKAR Active Member


    @Amit Kamdar sir , sorry for that , but i can't understand , where to add this
     


  4. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    in the field where you want the difference........i.e balance in change
     


  5. ONKAR

    ONKAR Active Member


    like this sir ,
    Set as : #POSAMOUNT1 - #VCHPOSMoneyTendered1
     


  6. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    You have made the above code and yet you ask this simple question.......?? :)

    Try it and see.....you know enough coding by now........
     


  7. ONKAR

    ONKAR Active Member



    ok got it, sir, I did it,

    you have given me a wrong solution sir, #POSAMOUNT1 - #VCHPOSMoneyTendered1

    this is correct solution sir Ji - #VCHPOSMoneyTendered1 - #POSAMOUNT1

    see this I got it solution


    [Field:pOS QTY3]
    Use : - Amount Forex Field
    Set as : #VCHPOSMoneyTendered1 - #POSAMOUNT1
    Width: 6
     


  8. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Well i have give the right CashFlow logical solution....

    when Bill is 23/- and Cash tendered is 30/-, then it should be -7...since you have to give back 7 back to the customer.
     


  9. ONKAR

    ONKAR Active Member


    SIR as per your solution balance in change amount showing in minus see this image

    SCREEN SHOT.JPG

    and as per my solution is showing like this sir. see this image

    Capture 2.JPG
     
    Last edited: Jul 8, 2019
    sandeep76out likes this.


  10. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    You can select whatever way you want to displayed....as negative or as positive.... if you want positive then follow the method that you have used.

    but going by accounting logic, the amount should be negative, as that is the amount going OUT from your cash.......
     
    ONKAR likes this.


  11. ONKAR

    ONKAR Active Member


    ok sir, thank you so much for your great help :):)
     


  12. ONKAR

    ONKAR Active Member


    @Amit Kamdar sir I have added your solution, now I am facing error like this , see this image

    Capture.JPG
     


  13. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    The solution i have given has nothing to do with your Voucher......

    try this....make it "blank" i.e. in Set As : "" ... temporarily and see........
     


  14. sandeep76out

    sandeep76out New Member


    @ONKAR Hi your POS is ready ?
     


Share This Page