;;PRODUCT: RecycleBin
;; AUTHOR: Shweta Computers

[System: Variable]
  RecycleBinFlag: "No"
  IsRestoreMode: "No"
  lConfirmation: "No"

[System: Formula]
  locRecyclebin : $$LocaleString:"Recycle Bin"

[System: UDF]
  fldDeleted: Logical : 1

[Variable: RecycleBinFlag]
  Type: Logical
  Volatile: Yes
  Persistent: No

[Variable: IsRestoreMode]
  Type: Logical
  Volatile: No
  Persistent: no

[Variable: lConfirmation]
  Type: Logical
  Persistent: No
  Volatile : Yes
  Default: No

[#Menu: GatewayofTally]
  Add: Item: Before:Reports: @@locRecyclebin :Display :Rpt Deleted Vouchers :NOT $$IsEmpty:$$SelectedCmps
  Add: Item: After: @@locRecyclebin: Blank
  Control :@@locRecyclebin: $$Allow:Create:Vouchers

[Report: Rpt Deleted Vouchers]
  Use: Voucher Register
  Title   : "Recycle Bin"
  Local: Line: DSP Vchdetail: Empty: NOT $fldDeleted
  Set: FamilyVoucherFlag: Yes
  Set: IsRestoreMode: Yes
  Set: SV To Date : $$YearEnd:##SVCurrentDate 
  Set: lConfirmation: Yes

[#Form: Voucher]
  Local: Line : VCH NarrPrompt: Add: Fields: Recycle Bin
  Set Always: RecycleBinFlag: If ##IsRestoreMode then ##RecyclebinFlag else No
 
[Field: Recycle Bin]
  Use: Logical field
  Storage: fldDeleted
  Set as: If ##IsRestoreMode then No else ##RecyclebinFlag
  ;; If this is removed it does not work
  Set Always: Yes                                         
  Type: Logical 
  Invisible: Yes

[#Collection: DayBook Vouchers of Company]
  Fetch	: fldDeleted 
  
[INCLUDE: rbin1.txt]
[INCLUDE: rbin2.txt]		
[INCLUDE: rbin3.txt]
[INCLUDE: rbin4.txt]
