Voucher security

Discussion in 'Requests' started by dudhebhate, Apr 6, 2016.

         
  1. dudhebhate

    dudhebhate New Member


    Dear All,

    I have a code for voucher security ,but the problem is that even cmpowner is not able to cancel /delete any voucher,the code is given below. Somebody kindly rectify this:

    [#Menu: Company]

    Add : Item : Before : @@LocQuit : Security - ~VoucherType : Display : GR Rep User list : yes
    Add : Item : After : Security - ~VoucherType : Blank
    ;;Control : @@locSecurityControl : no

    [#Form: Company Users]

    ;;Add : Part : After : Company Users : Company Users1

    [#Line: CUTitle]
    Add : Fields : At End : CUTitleMain


    ;[#Line: Company Users]
    ; Add : Fields : At End : ABN CU Valid Date

    [#Part: Company Users]

    Local : Line : Company Users : Add : Field : At End : GR Sec YesNo


    [Part: Company Users1]

    Line : CUTitleMain, CUTitleSub, Company Users1
    Repeat : Company Users1 : User List
    Scroll : Vertical

    [Line: CUTitleMain]

    Field : CUTitleMain
    Space Bottom : 1

    [Field: CUTitleMain]

    Set as : "Voucher Control"
    Style : Normal Bold
    Width : 10
    LIne : 0
    Align : Centre

    [Line: CUTitleSub]

    Use : Company Users1
    Local : Field : CMPLevel : Info : "Security Level"
    Local : Field : CMPUserName : Info : "Name of User"

    Local : Field : GR Sec YesNo : Info : "Voucher Wise Security"
    Local : Field : GR Sec YesNo : Type : String
    Local : Field : GR Sec YesNo : Width : 15
    Local : Field : Default : Align : Centre
    Local : Field : Default : Delete : Storage
    Local : Field : Default : Inactive : No
    Local : Field : Default : Style : Normal

    Border : Thin Top Bottom

    [Line: Company Users1]

    Field : CMPLevel, CMPUserName, GR Sec YesNo
    Local : Field : CMPUserName : Width : 30
    Local : Field : CMPLevel : Delete : Table

    ;;---------------------------------------------------------------------------

    [Field : GR Sec YesNo]

    Use : Logical Field
    Sub Form : GR Security : #GRSecYesNo ;;and @@IsDateExpired
    Inactive : ($$IsEmpty:$Name OR $$IsSysName:$Name)
    Storage : IsVchTypeSecurity
    Set as : No


    [Report : GR Security]

    Form : GR Security
    Object : Company
    Use : DSP Template

    [Form : GR Security]

    Height : 75% Screen
    Width : 75% Screen
    Parts : GR Security Info, GR Security
    BackGround : GR Light Grey

    Local : Field : Default : Style : Small Bold

    [Color : GR Light Grey]

    RGB : 200,200,200

    [Part : GR Security Info]

    Lines : GR Security Info, GR Security Info1

    [Line : GR Security Info]

    Border : Thin Top
    Fields : Name Field

    Local : Field : Name Field : Set as : "Security Details for "+$Name

    Local : Field : Name Field : Style : Normal Bold
    Local : Field : Name Field : Align : Centre
    Local : Field : Name Field : FullWidth : Yes
    Local : Field : Name Field : Skip : Yes
    Local : Field : Name Field : BackGround: Lily White

    [Line : GR Security Info1]

    Field : Info Field

    Local : Field : Info Field : Set as : "(Select the Voucher Types that You Want to Give Access to this User)"
    Local : Field : Info Field : Style : Too Small Italic
    Local : Field : Info Field : Full Width : Yes
    Local : Field : Info Field : Align : Centre

    Border : Double Bottom

    [Style : Too Small Italic]

    Font : "Arial"
    Height : 9
    Italic : Yes

    [Part : GR Security]

    CommonBorder: Yes
    Border : Thin Box
    Lines : GR Security Title, GR Security
    Repeat : GR Security : GR Sec Details
    Scroll : Vertical
    Vertical : Yes
    BreakOn : $$IsSysName:$GRVchName



    [Line : GR Security Title]

    Fields : GR Security Title1, GR Security Title2,GR Security Title5 ,GR Security Title6,GR Security Title7, GR Security Title3, GR Security Title4
    Border : Column Titles

    [Field : GR Security Title1]

    Use : Name Title Field
    Info : "Voucher Type"

    [Field : GR Security Title2]

    Use : Short Name Title Field
    Info : "Level"

    [Field : GR Security Title3]
    Use : Short Name Title Field
    Info : "Back Days"
    Width : @@NumberWidth

    [Field : GR Security Title4]

    Use : Uni Date Title Field
    Info : "Back Date"
    Width : @@ShortDateWidth


    [Field : GR Security Title5]

    Use : Uni Date Title Field
    Info : "Delete"
    Width : @@LogicalWidth

    [Field : GR Security Title6]

    Use : Uni Date Title Field
    Info : "Cancel"
    Width : @@LogicalWidth

    [Field : GR Security Title7]

    Use : Uni Date Title Field
    Info : "Print"
    Width : @@LogicalWidth

    [Line : GR Security]

    Fields : GR Security1, GR Security2, GR Security5,GR Security6 , GR Security7,GR Security3, GR Security4
    Border : Thin Bottom

    [Field : GR Security1]

    Use : Name Field
    Set as : $GRVchName
    Storage : GRVchName
    Table : VoucherType, EndOfList
    Show Table : Always
    Set Always : Yes
    Unique : Yes
    Style : Normal
    Border : Thin Left


    [Field : GR Security2]

    Use : Short Name Field
    Set as : $GRVchLevel
    Storage : GRVchLevel
    Table : GRVchLevel
    Inactive : $$IsSysName:$GRVchName
    Show Table : Always
    Style : Normal
    Border : Thin Left

    [Field : GR Security3]

    Use : Number Field
    Set as : $GRVchBackDays
    Storage : GRVchBackDays
    Inactive : $$IsSysName:$GRVchName
    Set Always : Yes
    Style : Normal
    Border : Thin Left
    Align : Right

    [Field : GR Security4]

    Use : Short Date Field
    Set as : $GRVchBackDate
    Storage : GRVchBackDate
    Inactive : $$IsSysName:$GRVchName
    Set Always : Yes
    Style : Normal
    Border : Thin Left
    Align : Centre


    [Field : GR Security5]

    Use : Logical Field
    Set as : $GRVchdel
    Storage : GRVchdel
    Inactive : $$IsSysName:$GRVchName
    Set Always : Yes
    Style : Normal
    Border : Thin Left
    Align : Centre


    [Field : GR Security6]

    Use : Logical Field
    Set as : $GRVchCanCel
    Storage : GRVchCanCel
    Inactive : $$IsSysName:$GRVchName
    Set Always : Yes
    Style : Normal
    Border : Thin Left
    Align : Centre

    [Field : GR Security7]

    Use : Logical Field
    Set as : $GRVchPrint
    Storage : GRVchPrint
    Inactive : $$IsSysName:$GRVchName
    Set Always : Yes
    Style : Normal
    Border : Thin Left
    Align : Centre


    [Collection : GRVchLevel]

    Title : "Levels"
    List Name : "Full", "Create/Alter", "Create","View"

    [System :UDF]

    GRSecDetails : Aggregate : 15 : yes
    GRVchName : String : 1
    GRVchLevel : String : 2
    GRVchOS : String : 3
    GRVchBackDays : Number : 4
    GRVchBackDate : Date : 5
    IsVchTypeSecurity : Logical : 9
    GRVchdel : Logical : 10
    GRVchCanCel : Logical : 11
    GRVchPrint : Logical : 12


    [#Object : User list]

    [Collection : GR User List]

    Type : User List : Company
    childof : ##SVCurrentCompany
    Filter : GRUserFilter
    Fetch : name,*.*
    ;Belongs To : yes


    ;[#Field: Plain VCH Date]
    ;
    ; Control : TestingControl1 : @@abcTEstingCreation
    ; Control : TestingControl2 : @@abcTEstingAlter
    ; Control : TestingControl3 : @@abcTEstingDays
    ; Control : TestingControl4 : @@abcTEstingDates
    ; Skip on : No


    [#Form: Attendance Color]
    Control : TestingControl1 : @@abcTEstingCreation
    Control : TestingControl2 : @@abcTEstingAlter
    Control : TestingControl3 : @@abcTEstingDays
    Control : TestingControl4 : @@abcTEstingDates

    [#Form: Payroll Color]
    Control : TestingControl1 : @@abcTEstingCreation
    Control : TestingControl2 : @@abcTEstingAlter
    Control : TestingControl3 : @@abcTEstingDays
    Control : TestingControl4 : @@abcTEstingDates

    [#Form : Sales Color]

    Control : TestingControl1 : @@abcTEstingCreation
    Control : TestingControl2 : @@abcTEstingAlter
    Control : TestingControl3 : @@abcTEstingDays
    Control : TestingControl4 : @@abcTEstingDates

    [#Form : Contra Color]

    Control : TestingControl1 : @@abcTEstingCreation
    Control : TestingControl2 : @@abcTEstingAlter
    Control : TestingControl3 : @@abcTEstingDays
    Control : TestingControl4 : @@abcTEstingDates

    [#Form : Credit Note Color]

    Control : TestingControl1 : @@abcTEstingCreation
    Control : TestingControl2 : @@abcTEstingAlter
    Control : TestingControl3 : @@abcTEstingDays
    Control : TestingControl4 : @@abcTEstingDates

    [#Form : Debit Note Color]

    Control : TestingControl1 : @@abcTEstingCreation
    Control : TestingControl2 : @@abcTEstingAlter
    Control : TestingControl3 : @@abcTEstingDays
    Control : TestingControl4 : @@abcTEstingDates

    [#Form : Delivery Note Color]

    Control : TestingControl1 : @@abcTEstingCreation
    Control : TestingControl2 : @@abcTEstingAlter
    Control : TestingControl3 : @@abcTEstingDays
    Control : TestingControl4 : @@abcTEstingDates

    [#Form : Journal Color]

    Control : TestingControl1 : @@abcTEstingCreation
    Control : TestingControl2 : @@abcTEstingAlter
    Control : TestingControl3 : @@abcTEstingDays
    Control : TestingControl4 : @@abcTEstingDates

    [#Form : Memorandum Color]

    Control : TestingControl1 : @@abcTEstingCreation
    Control : TestingControl2 : @@abcTEstingAlter
    Control : TestingControl3 : @@abcTEstingDays
    Control : TestingControl4 : @@abcTEstingDates

    [#Form : Payment Color]

    Control : TestingControl1 : @@abcTEstingCreation
    Control : TestingControl2 : @@abcTEstingAlter
    Control : TestingControl3 : @@abcTEstingDays
    Control : TestingControl4 : @@abcTEstingDates

    [#Form : Physical Stock Color]

    Control : TestingControl1 : @@abcTEstingCreation
    Control : TestingControl2 : @@abcTEstingAlter
    Control : TestingControl3 : @@abcTEstingDays
    Control : TestingControl4 : @@abcTEstingDates

    [#Form : Purchase Color]

    Control : TestingControl1 : @@abcTEstingCreation
    Control : TestingControl2 : @@abcTEstingAlter
    Control : TestingControl3 : @@abcTEstingDays
    Control : TestingControl4 : @@abcTEstingDates

    [#Form : Purc Order Color]

    Control : TestingControl1 : @@abcTEstingCreation
    Control : TestingControl2 : @@abcTEstingAlter
    Control : TestingControl3 : @@abcTEstingDays
    Control : TestingControl4 : @@abcTEstingDates

    [#Form : Receipt Color]

    Control : TestingControl1 : @@abcTEstingCreation
    Control : TestingControl2 : @@abcTEstingAlter
    Control : TestingControl3 : @@abcTEstingDays
    Control : TestingControl4 : @@abcTEstingDates

    [#Form : Receipt Note Color]

    Control : TestingControl1 : @@abcTEstingCreation
    Control : TestingControl2 : @@abcTEstingAlter
    Control : TestingControl3 : @@abcTEstingDays
    Control : TestingControl4 : @@abcTEstingDates

    [#Form : Rejection Inward Color]

    Control : TestingControl1 : @@abcTEstingCreation
    Control : TestingControl2 : @@abcTEstingAlter
    Control : TestingControl3 : @@abcTEstingDays
    Control : TestingControl4 : @@abcTEstingDates

    [#Form : Rejection Outward Color]

    Control : TestingControl1 : @@abcTEstingCreation
    Control : TestingControl2 : @@abcTEstingAlter
    Control : TestingControl3 : @@abcTEstingDays
    Control : TestingControl4 : @@abcTEstingDates

    [#Form : Reversing Journal Color]

    Control : TestingControl1 : @@abcTEstingCreation
    Control : TestingControl2 : @@abcTEstingAlter
    Control : TestingControl3 : @@abcTEstingDays
    Control : TestingControl4 : @@abcTEstingDates

    [#Form : Sales Order Color]

    Control : TestingControl1 : @@abcTEstingCreation
    Control : TestingControl2 : @@abcTEstingAlter
    Control : TestingControl3 : @@abcTEstingDays
    Control : TestingControl4 : @@abcTEstingDates

    [#Form : Stock Journal Color]

    Control : TestingControl1 : @@abcTEstingCreation
    Control : TestingControl2 : @@abcTEstingAlter
    Control : TestingControl3 : @@abcTEstingDays
    Control : TestingControl4 : @@abcTEstingDates


    [System : Formula]

    GRUserFilter : $Name=##SVUserName
    GRILVoucherName : $$CollectionField:mad:@GRILSecVchType:1:GRUserList
    GRILSecVchType : $$FilterValue:$GRVchName:GRSecDetails:First:GRILSecVchTypeFilter
    GRILSecVchTypeFilter: $GRVchName=##SVVoucherType

    GRILUserLevel : $$CollectionField:mad:@GRILVchLevel:1:GRUserList
    GRILVchLevel : $$FilterValue:$GRVchLevel:GRSecDetails:First:GRILSecVchTypeFilter

    GRILUserDays : $$CollectionField:mad:@GRILUserBackDays:1:GRUserList
    GRILUserBackDays : $$FilterValue:$GRVchBackDays:GRSecDetails:First:GRILSecVchTypeFilter
    ;;************************************************ *********************************************8
    GRILUserDates : $$CollectionField:mad:@GRILUserBackDates:1:GRUserList
    GRILUserBackDates : $$FilterValue:$GRVchBackDate:GRSecDetails:First:GRILSecVchTypeFilter

    abcTEstingCreation : @@IsVchTypeSecurityApplicable And NOT $$IsCmpOwner AND $$InCreateMode AND @@GRILEmptyList
    abcTEstingAlter : @@IsVchTypeSecurityApplicable And (NOT $$IsCmpOwner AND $$InAlterMode AND (@@GRILEmptyList OR @@GRILEmptyAlterList))
    abcTEstingDays : @@IsVchTypeSecurityApplicable And NOT $$IsCmpOwner AND @@GRILUserDays=>0 AND (@@GRVoucherPlusDays > @@GRILUserDays)
    abcTEstingDates : @@IsVchTypeSecurityApplicable And NOT $$IsCmpOwner AND NOT $$IsEmpty:mad:@GRILUserDates AND (@@GRVoucherDateofEntry < @@GRILUserDates)

    GRILEmptyList : $$IsEmpty:mad:@GRILVoucherName OR @@GRILUserLevel="View"
    GRILEmptyAlterList : (@@GRILUserLevel != "Create/Alter" AND @@GRILUserLevel !="Full")

    IsVchTypeSecurityApplicable : $$FilterValue:$IsVchTypeSecurity:CompanyUserList:First:ForThisVchTypeUser
    ForThisVchTypeUser : $Name = ##SVUserName

    TestingControl1 : "Hi "+##SVUserName+" !!! "+$$NewLine+"No Creation"+$$NewLine+"allowed for"+$$NewLine+" Voucher : "+##SVVoucherType
    TestingControl2 : "Hi "+##SVUserName+" !!! "+$$NewLine+"No Alteration"+$$NewLine+"allowed for"+$$NewLine+" Voucher : "+##SVVoucherType
    TestingControl3 : "Hi "+##SVUserName+" !!! "+$$NewLine+"Back Dated Days "+$$NewLine+"not allowed for"+$$NewLine+" Voucher : "+##SVVoucherType
    TestingControl4 : "Hi "+##SVUserName+" !!! "+$$NewLine+"Back Date "+$$NewLine+"not allowed for"+$$NewLine+" Voucher : "+##SVVoucherType

    GRLastDateofEntry : @@EndingDate ;;+ 1
    GRVoucherDateofEntry: $Date
    GRVoucherPlusDays : @@GRLastDateofEntry - @@GRVoucherDateofEntry

    ;;************************************************ ********************
    GRILUserOS : $$FilterValue:$GRVchOS:GRUserList:FirstummyCondition
    DummyCondition : 1=1

    GRRep Details Filter : ##GRSEcUserName=$Name

    GRILOSMenu : @@GRILUserOS="Both"

    GRCSVoucherName : $$CollectionField:mad:@GRCSSecVchType:1:GRUserList
    GRCSSecVchType : $$FilterValue:$GRVchName:GRSecDetails:First:GRCSSecVchTypeFilter
    GRCSSecVchTypeFilter : $GRVchName=$$ReqObject:$VoucherTypeName

    GRCSLevels : $$CollectionField:mad:@GRCSSecLevels:1:GRUserList
    GRCSSecLevels : $$FilterValue:$GRVchLevel:GRSecDetails:First:GRCSSecVchTypeFilter

    GRallowforthisUser : If $$IsCmpOwner then 1=1 else $Name=##SVUserName






    ;;;;;
    GRCSVoucherPrint : $$CollectionField:mad:@GRCSSecVchPrint:1:GRUserList
    GRCSSecVchPrint : $$FilterValue:$GRVchPrint:GRSecDetails:First:GRILSecVchTypeFilter ;;$$FilterValue:$GRVchdel:GRSecDetails:First:GRILSecVchTypeFilter

    GRCSVoucherDel : $$CollectionField:mad:@GRCSSecVchDel:1:GRUserList
    GRCSSecVchdel : $$FilterValue:$GRVchdel:GRSecDetails:First:GRILSecVchTypeFilter ;;$$FilterValue:$GRVchdel:GRSecDetails:First:GRILSecVchTypeFilter

    GRCSVoucherCan : $$CollectionField:mad:@GRCSSecVchCan:1:GRUserList
    GRCSSecVchCan : $$FilterValue:$GRVchCancel:GRSecDetails:First:GRILSecVchTypeFilter


    ;;************************************************ ************************************************** ************************************************** ***************





    [Collection : GRRep Userlist]

    Type : User List : Company
    Childof : ##SVCurrentCompany
    Filter : GRallowforthisUser

    [Collection : GRRep Userlist Details]

    Type : GR Sec Details : Company

    [Collection : GRRep Userlist Single Details]

    Type : UserList : Company
    Childof : ##SVCurrentCompany
    Filter : GRRep Details Filter

    [Variable : GR SEc User Name]

    Type : String
    Volatile : Yes

    [Report : GRRep Userlist]

    Form : GRRep Userlist
    Export : Yes
    Variable : GR SEc User Name
    Use : Dsp Template

    [Form : GRRep Userlist]

    Parts : GRRep Userlist
    Height : 100% Screen
    Width : 100% Screen
    Button : Print Button, Export Button
    BackGround : Lily White

    [Part : GRRep Userlist]

    Line : GRRep Userlist Title, GRRep Userlist
    Repeat : GRRep Userlist : GRRep Userlist
    Scroll : Vertical

    [Line : GRRep Userlist Title]

    Fields : Name Field
    Local : Field : Name Field : Set as : If $$IsCmpOwner Then "Security Details for All Users" else "Security Details for "+##SVUserName
    Local : Field : Name Field : Align : Centre
    Local : Field : Name Field : Skip : Yes
    Border : Column Titles

    [Line : GRRep Userlist]

    Fields : GRRep Userlist
    Explode : GRRep Userlist details : Yes
    Space Top : 0.50
    Border : Thin Top

    [Field : GRRep Userlist]

    Use : Name field
    Set As : $Name
    Variable : GRSEcUserName
    Modifies : GRSEcUserName
    Display : GRRep Userlist Single Details : Yes

    [Report : GRRep Userlist details]

    Object : Company
    Form : GRRep Userlist details
    Variable : GRSEcUserName

    [Form : GRRep Userlist details]

    Height : 80% Screen
    Width : 80% Screen
    Parts : GRRep Userlist details

    [Part : GRRep Userlist Details]

    Lines : GRRep Userlist Details
    Repeat : GRRep Userlist Details : GR Rep Userlist Details
    Scroll : Vertical
    Border : Thin Box
    Vertical : Yes
    Local : Field : Default : Style : Small Italic
    Local : Field : Default : Skip : Yes

    [Line : GRRep Userlist Details]

    Fields : GRRep Userlist Details 1, GRRep Userlist Details 2, GRRep Userlist Details 3, GRRep Userlist Details 4
    Indent : 3
    ;Fixed : Yes
    Local : Field : STATDirect : Style : If ##StatSortFlag AND $$IsEmpty:$$ExplodeOwner:#STATName then "Normal Bold" Else "Normal"
    Local : Field : STATDirect : Set as : If @@StatSortParent then $$ReportObject:$$FilterNumTotal:StatVchType:IsSubV chType:$StatVal Else $StatVal
    Local : Field : STATCancVal : Set as : If @@StatSortParent then $$ReportObject:$$FilterNumTotal:StatVchType:IsSubV chType:$CancVal Else $CancVal

    Option : StatDetail RemoveZeroValue : NOT @@StatSortParent AND ##StatZeroValueFlag

    [Field: STATValue1]

    Fields : STATDirect, STATCancVal, STATCancelled

    Display : Voucher Monthly Register

    Border : Thin Left : NOT $$InPixelMode OR (##StatVerticalFlag OR ($$NumSets > 1))


    [Field : GRRep Userlist Details 1]

    Use : Name Field
    Setas : $GRVchName
    Invisible: $$IsSysName:$GRVchName
    Variable : VoucherTypeName
    Alter : VoucherType
    Indent : 5
    Border : Thin Bottom : @@StatSortParent
    [Field : GRRep Userlist Details 2]

    Use : Name Field
    Setas : $GRVchLevel
    Width : @@DSPNameWidth

    Display : Voucher Monthly Register1 ;: $$IsVoucherType AND NOT @@StatSortParent


    [Report: Voucher Monthly Register1]

    Use : Voucher Monthly Summary
    ;Family : $$Translate:"Voucher Registers"
    Set : VchTotalTrans : Yes
    Set : DSPShowGraph : No
    Set : DSPNotScaleable : Yes
    Set : FamilyVoucherFlag : No
    Title : $$LocaleString:"Voucher Monthly Register"
    Local : Button : RelReports : Inactive : Yes

    [Field : GRRep Userlist Details 3]

    Use : Name Field
    Set as : $GRVchBackDays

    [Field : GRRep Userlist Details 4]

    Use : Name Field
    Set as : $GRVchBackDate

    [Report : GRRep Userlist Single Details]

    Object : Company
    Form : GRRep Userlist Single Details
    Variable: GR SEc User Name
    Use : Dsp Template

    [Form : GRRep Userlist Single Details]

    Parts : GRRep Userlist Single Details
    Button : Print Button, Export Button
    Width : 70% Screen
    Height : 100% Screen

    [Part : GRRep Userlist Single Details]

    Lines : GRRep UserList Single Title, GRRep Userlist Single Details
    Repeat : GRRep Userlist Single Details : GRRep Userlist Single Details
    Scroll : Vertical
    Vertical: Yes

    [Line : GRRep UserList Single Title]

    Use : GRRep Userlist Title
    Local : Field : Name Field : Set as : "Security Details for "+##GRSEcUserName

    [Line : GRRep Userlist Single Details]

    Use : GRRep Userlist
    Fixed : No
    Local : Line : GR Rep UserList : Fixed : No

    [System : Formula]

    GRAronFilter : If $$IsCmpOwner then @@GRSCrDrFilter else If @@GRILUserOS="Sundry Drs" then @@GRSDrFilter else +
    If @@GRILUserOS="Sundry Crs" then @@GRSCrFilter else +
    If @@GRILUserOS="Both" then @@GRSCrDrFilter else @@GRMainUser
    GRMainUser : If $$IsCmpOwner then @@GRSCrDrFilter else @@GRSDrCrFilter
    GRSDrFilter : $$IsBelongsTo:$$GroupSundryDebtors OR $$IsBelongsto:$$GroupCurrentAssets
    GRSCrFilter : $$IsBelongsTo:$$GroupSundryCreditors OR $$IsBelongsto:$$GroupCurrentLiab
    GRSCrDrFilter : 1=1
    GRSDrCrFilter : 1=1

    [Collection : Company UserList]
    Type : User List : Company
    ChildOf : ##SVCurrentCompany
    Fetch : *.*




    [#Line: VCHCURBAL ExplLine]
    Add: Field : After: VCH CurBalance:Vch Currbal1

    [#Field: VCH CurBalance]
    Width : @@VCHNameWidth+5
    Invisible : yes

    [#Line: ACLSFixedCurBal]

    Add: Field : After: VCH CurBalance:Vch Currbal1

    [Field : Vch Currbal1]
    Use : Name Field
    Width : @@VCHNameWidth
    Set as : $$String:mad:@LedgerTotal:Base,Symbol,DrCr
    Style : Small Bold Italic
    Skip : Yes
    Color : if $IsCashLedger:Ledger:#SVLedger AND NOT $$IsDr:mad:@LedgerTotal then @@SV_FIELD1 else @@SV_FIELD2

    ;[#Line: Vch Bank Allocations Cheque Exp]
    ; Add: Field : After : Short Prompt:Short Prompt11
    ; Local : Field : Short Prompt11 : Set as: $$LocaleString:"Instrument No." + ":"
    ; Local : Field : Short Prompt : Invisible : yes
    ;[Field: Short Prompt11]
    ;
    ; Align : Prompt
    ; Width : @@ShortWidth
    ; Skip : Yes
    ; Fixed : Yes


    [#Menu: Inventory Statements]
    Delete:Key Item : @@locStatistics : S : Display : Statistics : NOT $$IsEmpty:$$SelectedCmps
    Add: Key Item : @@locSaleBillsPending : S : Display : Statistics : NOT $$IsEmpty:$$SelectedCmps and $$Iscmpowner
    Add: Key Item : After : @@locStatistics :mad:@LocUserStatistics :S : Display : User Statistics1 : NOT $$IsEmpty:$$SelectedCmps and not $$Iscmpowner
    [#Menu: Account Statements]

    Title : $$LocaleString:"Statements of Accounts"
    Delete:Key Item : @@locStatistics : S : Display : Statistics : NOT $$IsEmpty:$$SelectedCmps

    Add: Key Item : Before :mad:@LOCQUIT:mad:@locStatistics : S : Display : Statistics : NOT $$IsEmpty:$$SelectedCmps and $$Iscmpowner
    Add: Key Item : After : @@locStatistics :mad:@LocUserStatistics :S : Display : User Statistics1 : NOT $$IsEmpty:$$SelectedCmps and not $$Iscmpowner


    [#Menu: Account Books]

    Title : $$LocaleString:"Account Books"

    Delete : Key Item : @@locGroupSummary : G : Display Collection : Group Summary : NOT $$IsEmpty:$$SelectedCmps
    Delete:Key Item : @@locGroupVouchers : V : Display Collection : Group Vouchers Extract : NOT $$IsEmpty:$$SelectedCmps
    Add : Key Item : After : @@Locledger : @@locGroupSummary : G : Display Collection : Group Summary : NOT $$IsEmpty:$$SelectedCmps and $

    $Iscmpowner or NOT ##SVusername Contains "ZUBAIR" AND NOT ##SVUSERNAME CONTAINS "DELTA1")
    Add : Key Item : After : @@locGroupSummary : @@locGroupVouchers : G : Display Collection : Group Summary : NOT $$IsEmpty:$$SelectedCmps and $

    $Iscmpowner or NOT ##SVusername Contains "ZUBAIR" AND NOT ##SVUSERNAME CONTAINS "DELTA1")
    Delete :Key Item : @@locJournalRegister : J : mENU : Journal Register : NOT $$IsEmpty:$$SelectedCmps
    Add : Key Item : After : @@locPurchaseRegister : @@locJournalRegister1 : J : Menu : Journal Register : NOT $$IsEmpty:$$SelectedCmps and $

    $Iscmpowner or NOT ##SVusername Contains "ZUBAIR" AND NOT ##SVUSERNAME CONTAINS "DELTA1")


    [System : Formula]
    LocUserStatistics:"User Statistics"
    LocJournalRegister1:"Journal Register"


    [Report: User Statistics1]


    Use : Filtered Company

    Repeat : SVCurrentCompany, SVFromDate, SVToDate, SVBudget, SVVariance, SVValuationMethod, SVCurrency, SVExchange
    Variable : SVPeriodicity
    Variable : DSPShowMonthly, FromTrialBalance, SVScaleFactor, StatZeroValueFlag
    Variable : DSPHasMultiLevel, DSPColumnTotal
    Variable : DSPNotScaleable, DSPHasColumnTotal
    Variable : StatVerticalFlag, StatSortFlag, IsPayHeadBkup, IsAttdBkup, IsCCReport

    Set : IsPayHeadBkup : Yes
    Set : IsAttdBkup : No
    Set : DSPShowMonthly : No
    Set : FromTrialBalance : No
    Set : DSPHasMultiLevel : No
    Set : DSPColumnTotal : No
    Set : DSPNotScaleable : No
    Set : DSPHasColumnTotal : No
    Set : SVValuationMethod : ""
    Set : SVCurrency : ""
    Set : SVExchange : 1
    Set : SVScaleFactor : @@Default

    ColumnReport : StatColumn

    PrintSet : ReportTitle : $$LocaleString:"Statistics"
    PrintSet : PrintWithPageNo : No
    Local : Button : RelReports : Inactive : Yes
    Title : $$LocaleString:"Statistics"

    FetchCollection : StatVchType

    [Form: User Statistics1]

    Button : F2ChangePeriod, ChangeCompany
    BottomButton : DSPAutoColumns, BlankButton, RelReports, InvReports, AcctReports, Report Operations, StatConfigure, FilterButton, ValueButton
    Bottom Toolbar Buttons : BottomToolBarBtn1, BottomToolBarBtn8, BottomToolBarBtn9, BottomToolBarBtn10, BottomToolBarBtn11

    Keys : ChangePeriod
    Buttons : PrintButton, ExportButton, UploadButton, MailButton

    Parts : DSP AccTitles, STATHorzDetailUser
    Background : @@SV_STATISTICS

    Space Top : if $$InPrintMode then ##SVSpaceTop else 0.05 inches
    Space Bottom: if $$InPrintMode then 0.5 else 0 inches
    Space Left : if $$InPrintMode AND $$InPixelMode then 0.5 else 0 inches
    Space Right : if $$InPrintMode AND $$InPixelMode then 0.25 else 0 inches

    Page Break : DSP ClPageBreak, DSP OpPageBreak
    Local : Field : DSP CmpTitle : Cells : 2
    Local : Field : DSP DateTitle : Cells : 2


    [Part: STATHorzDetailUser]

    Parts : STATVchTypeNew , STATAccts
    Vertical : No
    CommonBorder: Yes

    [Part: STATVchTypeNew]

    Lines : STATColTitle, GRRep Userlist1
    Repeat : GRRep Userlist1 : GRRep Userlist
    Scroll : Vertical
    Total : STATDirect, STATCancVal
    Local : Field : DSP NameTitle : Set as : $$LocaleString:"Types of Vouchers"
    Local : Field : DSP NameTitle : Full Width: Yes
    Local : Field : DSP CmpTitle : Cells : 2
    Option : Small Size Part : NOT $$InPrintMode
    Option : Scrolled Report : NOT $$InMigrationMode
    CommonBorder : Yes



    ;;************************************************ *******************
    ;[#Part: STATVchType]
    ;
    ; Delete:Lines : STATDetail
    ; Delete:Bottom Lines : STATVchTotal
    ; Delete: Repeat : STATDetail : STATVchType
    ; Add: Line :GRRep Userlist1
    ; Add:Repeat : GRRep Userlist1 : GRRep Userlist
    ; Add:Scroll : Vertical
    ; Total : STATDirect, STATCancVal
    ; Local : Field : DSP NameTitle : Set as : $$LocaleString:"Types of Vouchers"
    ; Local : Field : DSP NameTitle : Full Width: Yes
    ; Local : Field : DSP CmpTitle : Cells : 2
    ; Option : Small Size Part : NOT $$InPrintMode
    ; Option : Scrolled Report : NOT $$InMigrationMode
    ; CommonBorder : Yes

    [Line : GRRep Userlist1]

    Fields : GRRep Userlist
    Explode : GRRep Userlist detailsInfo : Yes
    Space Top : 0.50
    Border : Thin Top


    [Collection : GRRep Userlist DetailsInfo]

    Type : GR Sec Details : Company

    Fetch : Name, Parent, IsReserved, CancelledVouchers

    Compute : StatVal : $$DirectTotalVch:$GRVchName
    Compute : CancVal : $$DirectCancVch:$GRVchName
    Compute : MigVal : $$DirectAllVch:$GRVchName
    Compute : IsVTypeReserved : $IsReserved:VoucherType:$GRVchName
    Compute : NumOfVchTypeName : $$NumOfVchType:$GRVchName
    Compute : NumOfVchTypeParent : $$NumOfVchType:$Parent



    [Part : GRRep Userlist DetailsInfo]

    Lines : Statvou,GRRep Userlist Detailsinfo
    Repeat : GRRep Userlist Details info :GR Rep Userlist Detailsinfo
    Bottom Lines : GRRep STATVchTotal
    Total : STATDirect,STATCancVal
    Scroll : Vertical
    Border : Thin Box
    Vertical : Yes
    Local : Field : Default : Style : Small Italic
    Local : Field : Default : Skip : Yes

    [Line: GRRep StatVchTotal]

    Fields : STATTotal, GRRep STATVchTotal
    Repeat : GRRep STATVchTotal
    Option : Small Size Line : NOT $$InPrintMode
    SpaceTop : 0.5
    SpaceBottom : 0.5
    Fixed : Yes

    [Field: GRRep STATVchTotal]

    Fields : GRRepSTATDirectTotal, GRRepSTATCancelledTotal
    Border : Totals

    [Field: GRRepSTATDirectTotal]

    Use : Number Field
    Set as : $$Total:STATDirect
    Style : If ##StatSortFlag then "Normal Bold " else "Normal"
    Align : Right

    [Field: GRRepSTATCancelledTotal]

    Use : Number Field
    Type : String
    Set as : if NOT $$IsEmpty:mad:CancTot then @CancVal else ""
    CancVal : "(" + $$String:mad:CancTot + $$LocaleString:"cancelled" + " )"
    CancTot : $$Total:STATCancVal
    MigVal : "(" + $$String:mad:CancTot + $$LocaleString:"canc" + " )"
    Align : Right
    Style : If ##StatSortFlag then "Normal Bold" else "Normal"




    [Line : Statvou]
    Field : Statvou
    Invisible : yes
    [Field :Statvou]
    Use : name Field
    Set as : $$Fulllist:GRRepUserlistDetailsInfo:$GRVchName


    [Line : GRRep Userlist Detailsinfo]
    Field : GRRep Userlist Details 1 , STAT Value11
    Repeat : STATValue11

    [Field: STATValue11]

    Fields : STATDirect, STATCancVal, STATCancelled

    Display : Voucher Register

    Border : Thin Left : NOT $$InPixelMode OR (##StatVerticalFlag OR ($$NumSets > 1))


    [Field : GRRep Userlist Details 1a]

    Use : Name Field
    Setas : $GRVchName
    Invisible: $$IsSysName:$GRVchName
    Display : Voucher Register ;: $$Iscompany
    Variable : VoucherTypeName
    Alter : VoucherType

    Border : Thin Bottom : @@StatSortParent
    [Field : GRRep Userlist Details 2a]

    Use : Name Field
    Setas : $name
    Width : @@DSPNameWidth



    [Field : GRRep Userlist Details 3a]

    Use : Name Field
    Set as : $StatVal

    [Field : GRRep Userlist Details 4a]

    Use : Name Field
    Set as : $GRVchBackDate

    [#Line: DSP VchDetail]
    Local : Key : Delete Line Object : Inactive : NOT $$CanDelete OR NOT $$Iscmpowner
    Local : Key : Cancel Line Object : Inactive : NOT $$CanDelete OR NOT $$Iscmpowner

    Local : Key : Delete Line ObjectEx : Inactive : NOT $$CanDelete OR NOT $$Iscmpowner
    Local : Key : Cancel Line ObjectEx : Inactive : NOT $$CanCancel OR NOT $$Iscmpowner

    [#Form: Stock Vouchers]

    Local : Key : Form Delete : Inactive : not $$IsIscmpowner and (@@onlydel or not @@GRCSVoucherCan or @@abcTEstingDays)
    Local : Key : Delete Line Object : Inactive : NOT $$CanDelete OR NOT $$Iscmpowner
    Local : Key : Cancel Line Object : Inactive : NOT $$CanDelete OR NOT $$Iscmpowner

    Local : Key : Delete Line ObjectEx : Inactive : NOT $$CanDelete OR NOT $$Iscmpowner
    Local : Key : Cancel Line ObjectEx : Inactive : NOT $$CanCancel OR NOT $$Iscmpowner

    [#Line: STKVCH NormalDetail]

    Local : Key : Delete Line Object : Inactive : NOT $$CanDelete OR NOT $$Iscmpowner
    Local : Key : Cancel Line Object : Inactive : NOT $$CanDelete OR NOT $$Iscmpowner

    Local : Key : Delete Line ObjectEx : Inactive : NOT $$CanDelete OR NOT $$Iscmpowner
    Local : Key : Cancel Line ObjectEx : Inactive : NOT $$CanCancel OR NOT $$Iscmpowner

    [#Line: STKVCH InTRACKLead]

    Local : Key : Delete Line Object : Inactive : NOT $$CanDelete OR NOT $$Iscmpowner
    Local : Key : Cancel Line Object : Inactive : NOT $$CanDelete OR NOT $$Iscmpowner

    Local : Key : Delete Line ObjectEx : Inactive : NOT $$CanDelete OR NOT $$Iscmpowner
    Local : Key : Cancel Line ObjectEx : Inactive : NOT $$CanCancel OR NOT $$Iscmpowner


    [#Line: STKVCH OutTRACKLead]

    Local : Key : Delete Line Object : Inactive : NOT $$CanDelete OR NOT $$Iscmpowner
    Local : Key : Cancel Line Object : Inactive : NOT $$CanDelete OR NOT $$Iscmpowner

    Local : Key : Delete Line ObjectEx : Inactive : NOT $$CanDelete OR NOT $$Iscmpowner
    Local : Key : Cancel Line ObjectEx : Inactive : NOT $$CanCancel OR NOT $$Iscmpowner



    ;;;

    [#Form: Voucher]

    Local : Button : PrintButton : Inactive : not $$Iscmpowner and (@@onlydel or not @@GRCSVoucherPrint or @@abcTEstingDays)



    [#Key: BottomToolBarBtn3_Delete]

    Inactive: not $$Iscmpowner and (@@onlydel or not @@GRCSVoucherDel or @@abcTEstingDays)

    [system : Formula]
    onlydel : $$IsEmpty:mad:@GRILVoucherName


    [#Key: BottomToolBarBtn3]
    Inactive: Not $$Iscmpowner

    [#Key: BottomToolBarBtn3_Voucher]
    Inactive: not $$Iscmpowner and (@@onlydel or not @@GRCSVoucherDel or @@abcTEstingDays)

    [#Key : Form Delete]

    Inactive: not $$Iscmpowner and (@@onlydel or not @@GRCSVoucherDel or @@abcTEstingDays)

    [#Key: Delete Line Object]
    Inactive: Not $$Iscmpowner

    [#Key: Delete Line ObjectEx]

    Inactive: Not $$Iscmpowner


    ;;;;;;;;;;;;;;;;;;;;;;;;

    ;;Cancel button

    [#Key: BottomToolBarBtn4]
    Inactive : Not $$Iscmpowner


    [#Key: BottomToolBarBtn4_Cancel]
    Inactive : not $$Iscmpowner and (@@onlydel or not @@GRCSVoucherCan or @@abcTEstingDays)


    [#Key : Form Cancel]
    Inactive : not $$Iscmpowner and (@@onlydel or not @@GRCSVoucherCan or @@abcTEstingDays)

    [#Key: Cancel Line Object]
    Inactive : Not $$Iscmpowner



    [#Key: Cancel Line ObjectEx]
    Inactive : Not $$Iscmpowner





    [#Menu: Security Control]
    ;;Control : @@locSecurityControl : @@IsDateExpired



    ;;************************************************ ******************************

    [#Button : Print Button]
    inactive : $$IsVoucher And Not $$CmpUserName = "PRINT"
    ;; End-of-File
    [#Key: BottomToolBarBtn3_Delete]
    Inactive : No

    [#Key: BottomToolBarBtn3]
    Inactive : No

    [#Key: BottomToolBarBtn3_Voucher]
    Inactive : No

    [#Key: BottomToolBarBtn4]
    Inactive : No

    [#Key: BottomToolBarBtn4_Cancel]
    Inactive : No


    [#Field: VCH Ref]
    Validate : NOT $$CmpUserName = "print"
    Invisible : No
    Inactive : No


    [#Menu : Gateway of Tally]
    Add : Button : CmpUser Statistics,User Statistics

    [Button : CmpUser Statistics]
    key : alt+C
    Title : $$LocaleString:"Statistics"
    Action : Display : Statistics
    Inactive : $$CmpUserlevel = "sales"


    [Button : User Statistics]
    key : alt+U
    Title : $$LocaleString:"User Statistics"
    Action : Display : uSER Statistics1
    Inactive : not $$CmpUserlevel = "sales"
     



  2. Rajsrisrimal

    Rajsrisrimal Member


    Sir
    Kindly update the code , its not working in updated tally erp 9
     



Share This Page