Recycle Bin For tally prime

Discussion in 'Free Source Codes' started by Lalit Lohar, Jun 19, 2022.

    
  1. Lalit Lohar

    Lalit Lohar New Member


    What is the error in below code it's not working properly in Tally Prime.

    ;;=========== Recycle Bin


    [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 :mad:@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


    ======================
    ALT+D provisions
    ======================
    Account Info >> Ledger >> Alter >> Alt+D
    Display >> Daybook >> SelectAnyVoucher >> Enter >> Alt+D
    Display >> Account Books >> Ledger >> SelectLedger >> SelectAnyVoucher >> Enter >> Alt+D
    ----------------------------------------------------------------------------------------

    [#Key: BottomToolBarBtn3_Delete]
    Title : $$LocaleString:"Delete"
    Option: RbinFormDelete: if ($$IsVoucher AND @@IsRBinOn AND NOT ##IsRestoreMode) then Yes else No

    Change the functionality of Alt+D in Daybook. Instead of deleting, alter / open the voucher
    [#Key: BottomToolBarBtn3]
    Title : $$LocaleString:"Delete"
    Option: RbinDeleteLineObject: @@IsRBinOn ;;Yes

    Unknown
    [#Form: Voucher]
    [#Key: BottomToolBarBtn3_Delete]
    Title : $$LocaleString:"Delete_Voucher"
    Option: RbinFormDelete: Yes
    Required for Display >> Account Books >> Ledger
    Required for Display >> Account Books >> Group Vouchers
    [#Key: Delete Line Object]
    Key : Alt+D
    Option: RbinDeleteLineObject: @@IsRBinOn ;;Yes

    Required for Display >> Account Books >> Ledger
    Required for Display >> Account Books >> Group Vouchers
    [#Key: Delete Line ObjectEx]
    Key : Alt+D
    Option: RbinDeleteLineObject: @@IsRBinOn ; Yes
    Optional definition
    [!Key: RbinFormDelete]
    Key: Alt+D
    Action: Alter: Rpt Confirmation

    Optional definition
    [!Key: RbinDeleteLineObject]
    Key: Alt+D
    Action: Alter Object : @@IsRBinOn

    ========================
    CTRL+R - Restore Voucher
    ========================
    [Key: Restore from Bin]
    Key: CTRL+R
    Action: Alter Object : @@IsRBinOn


    Display dialog box and prompt user to Delete Voucher
    [Report: Rpt Confirmation]
    Add: Form: frm Confirmation
    Variable: lConfirmation
    Set: lConfirmation: Yes
    Title: "Confirm"

    [Form: frm Confirmation]
    Add: Part: Prt Heading,Prt Title, Prt YesNo
    Add: Bottom Part: Prt Caption
    Full Width : No
    No Confirm : Yes
    Space Left : 5
    Space Right : 5
    Space Top : 2
    Space Bottom: 1
    Width: 50% screen
    Height: 50% screen

    [Part: Prt Heading]
    Horizontal Align: Centre
    Lines : ln Heading

    [Part: Prt Title]
    Horizontal Align: Centre
    Lines : Form SubTitle
    Local : Field : Form SubTitle : Info : $$LocaleString:"Delete Voucher [Yes/No]"

    [Part: Prt YesNo]
    Horizontal Align: Centre
    Lines : ln Confirmation

    [Part: Prt Caption]
    Horizontal Align: Centre
    Lines : ln Caption1

    [Line: ln Heading]
    Add: Field : fldHeading

    [Line: ln Confirmation]
    Add: Field: fldConfirmation,fldRecyclebinFlag,fldOptionalFlag

    [Line: ln Caption1]
    Add: Field: fldCaption1

    [Field: fldConfirmation]
    Use: Logical Field
    Set as: ##lConfirmation
    Modifies: lConfirmation

    [Field: fldRecycleBinFlag]
    Use: Logical Field
    Set as: #fldConfirmation
    Set Always: Yes
    Modifies: RecycleBinFlag
    Skip: Yes
    Invisible: Yes

    [Field: fldOptionalFlag]
    Use: Logical Field
    Set as: #fldConfirmation
    Set Always: Yes
    Modifies: OptionalFlag
    Skip: Yes
    Invisible: Yes

    [Field: fldHeading]
    Info: "Recycle-bin for Tally"

    [Field: fldCaption1]
    Info: "Email to xxxxxxxx@gmail.com"

    ==========================================================
    Report Daybook must display vouchers which are not deleted
    ==========================================================
    [#Report: Daybook]
    Local: Line: DSP VchDetail: Empty : $fldDeleted
    Set: IsRestoreMode: No

    [#Report: Ledger Vouchers]
    Local: Line: DSP VchDetail: Empty : $fldDeleted
    Set: IsRestoreMode: No

    [#Line: DSP VchDetail]
    Add: Option: DSP VchDetail Restore: $fldDeleted

    [!Line: DSP VchDetail Restore]
    Add: Keys: Restore from Bin


    ====================================================================================
    Field VCH Optional
    ------------------
    1) Mark Voucher as Deleted
    2) Restore Deleted Voucher
    =====================================================================================
    Show message "Voucher is Marked for Deletion. Press any key." - Voucher entry screen
    =====================================================================================
    [#Field: VCH Optional]
    Option: Rbin VCH Delete: ##OptionalFlag and NOT ##IsRestoreMode
    Option: Rbin VCH Restore: ##OptionalFlag and ##IsRestoreMode

    [!Field: Rbin VCH Delete]
    Mark voucher as deleted
    =======================
    Style: My Style
    Set as: if #Recyclebin then "Press ENTER-KEY to send this voucher to the RECYCLE-BIN." else @UseOptStr
    Skip: if #Recyclebin then No else Yes
    Color : Red

    [Style: My Style]
    Font: Verdana
    Height: 18
    Bold: Yes

    [!Field: Rbin VCH Restore]
    Restore the Voucher
    ===================

    Add: Fields: Long Prompt,fldConfirmation,SetRecyclebinFlag,SetRecyclebinField,SetOptionalFlag,SetOptionalField
    Local: Field: Long Prompt: Info: "About to RESTORE Voucher. Press ENTER-key to confirm."
    Local: Field: Long Prompt: Full Width: Yes
    Local: Field: Long Prompt: Align: Right
    Local: Field: Long Prompt: Style: My Style
    Color : Blue

    [Field: SetRecyclebinFlag]
    Use: Logical field
    Type: Logical : Forced
    Modifies: RecyclebinFlag
    Set as: NOT #fldConfirmation
    Set Always: Yes ;; If this is removed it does not work
    Invisible: Yes
    Skip: Yes

    [Field: SetRecyclebinField]
    Use: Logical field
    Type: Logical
    Storage: fldDeleted
    Set as: #SetRecyclebinFlag
    Set Always: Yes ;; If this is removed it does not work
    Invisible: Yes
    Skip: Yes

    [Field: SetOptionalFlag]
    Use: Logical field
    Type: Logical
    Modifies: OptionalFlag
    Set as: #SetRecyclebinFlag
    Set Always: Yes ;; If this is removed it does not work
    Invisible: Yes
    Skip: Yes

    [Field: SetOptionalField]
    Use : Logical Field
    Storage : Is Optional
    Set as : #SetOptionalFlag
    Set always : Yes
    Invisible : Yes
    Skip : Yes

    ================================================
    Modify Voucher entry screen
    ================================================
    [#Form: Voucher]
    Option: RbinVoucher: ##OptionalFlag

    [!Form: RbinVoucher]
    Key: SaveVoucher

    [Key: SaveVoucher]
    Key: Enter
    Action: Form Accept

    [#Field: Plain VCH Date]
    Option: Rbin Plain VCH Date: ##OptionalFlag

    [!Field: RBin Plain VCH Date]
    Skip: if #RecycleBin then Yes else No
     


  2. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    explain "not working properly"..........what is the error code or what is not working?
     


  3. Lalit Lohar

    Lalit Lohar New Member


    Deleted voucher not showing in Recycle bin also when deleted voucher there was not any confirmation it's moving in Recycle bin.
     


  4. Deepak K Swain

    Deepak K Swain New Member



    [#Key: Form Delete]

    Title : $$LocaleString:"Delete"
    Key : Alt+D
    Action : Delete
    Mode : Edit
    Inactive: If $$BaseOwner:$$IsVoucher Then NOT ($$InAlterMode AND $$CanDelete) Else NOT $$CanDelete
    Option: RbinFormDelete: if ($$IsVoucher AND NOT ##IsRestoreMode) then Yes else No

    ;;
    use this in this existing code
    Plz try to learn not copy paste .
     


  5. rajiv jaiswal

    rajiv jaiswal Member


     


Share This Page