Redgarding to block entries for a scheduled time

Discussion in 'Free Source Codes' started by parthiban.M, Oct 17, 2023.

    
  1. parthiban.M

    parthiban.M Member


    Heloo Experts,

    How to block the sales voucher entry for a certain period of time??
    For eg., I need to control the entries from eve 8 to morng 8 .....I have tried on basic code given below..whick is working gud for a from time input but how to add that sceduled time of From time and To time....
    any experts give me any ideas/suggestions pls.....

    [#Form:salescolor]
    Control:$$String:$$MachineTime="18:00"
     


  2. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    From Logic Point of view -- I think you need to concatenate the DATE and TIME as a STRING ......

    BTW 8:00 pm is 20 Hrs and not 18 Hrs ----

    12/oct/2023 + 20:00 -- as a variable1 or UDf1
    13/Oct/2023 + 08:00 -- as a variable2 or UDf2

    Then use #FldName between UDF1 and UDF2
     


  3. parthiban.M

    parthiban.M Member


    Gud morning sir,
    And am really sry as I couldn't get ur suggestion properly sir....I really got stuck on the code I have used above...and dont have any idea what to do nxt....
    Can u plz jst explain me once again how does the scheduled time work....else automatically without using udf's how to control the sales entry between the two times of (evng 8 pm To morning 8 Am ) everyday sir...
    If the udf's is must if I create two fields one for FROM time another for TO time..thn how to combine the field in [#form:salescolor] sir
     


  4. narayane88

    narayane88 Active Member


    use following code for your reference set time as 24 hours clock

    Code:
    [#Report:Voucher]
        Set:vchLockStrTime:"16:00"
        Set:vchLockEndTime:"20:00"
      
      
    [#Form:Voucher]
        On:Form Accept:Yes:Form Accept
        Add:Control:IsintimeCtr:@@IsTimePass
      
      
    [System:Formula]
        IsTimePass: $$Time:$$MachineTime >  ##vchLockStrTime and  $$Time:$$MachineTime <  ##vchLockEndTime
        IsintimeCtr:"Not allowed any entries within time from "  + $$String:##vchLockStrTime + " to  " + $$String:##vchLockEndTime
      
    
    [Variable:vchLockStrTime]
        Type:Time
        Persistent : Yes
      
    [Variable:vchLockEndTime]
        Type:Time
        Persistent : Yes
      
    
    [System:Variable]
        vchLockStrTime:"21:00"
        vchLockEndTime:"06:00"
     
    Last edited: Oct 18, 2023
    Rohit Khedar and gangstar like this.


  5. parthiban.M

    parthiban.M Member


    thank you sir...its working fine...
     


  6. ebek

    ebek Member


    Thank you sir
     


  7. Rohit Khedar

    Rohit Khedar Member


    @narayane88 sir proper not work in tally erp
     


Share This Page