Use ATNDBTest
Go


--
-- Delete All User Tables
If Exists(SELECT * FROM INFORMATION_SCHEMA.TABLES Where TABLE_SCHEMA = 'PAY' And TABLE_TYPE = 'BASE TABLE' And TABLE_NAME = 'MonthlyFactorPerEmployee') Drop Table PAY.MonthlyFactorPerEmployee 
If Exists(SELECT * FROM INFORMATION_SCHEMA.TABLES Where TABLE_SCHEMA = 'PAY' And TABLE_TYPE = 'BASE TABLE' And TABLE_NAME = 'ContractFactor') Drop Table PAY.ContractFactor 
If Exists(SELECT * FROM INFORMATION_SCHEMA.TABLES Where TABLE_SCHEMA = 'PAY' And TABLE_TYPE = 'BASE TABLE' And TABLE_NAME = 'Contract') Drop Table PAY.Contract 
If Exists(SELECT * FROM INFORMATION_SCHEMA.TABLES Where TABLE_SCHEMA = 'PAY' And TABLE_TYPE = 'BASE TABLE' And TABLE_NAME = 'EmployeeBank') Drop Table PAY.EmployeeBank 
If Exists(SELECT * FROM INFORMATION_SCHEMA.TABLES Where TABLE_SCHEMA = 'PAY' And TABLE_TYPE = 'BASE TABLE' And TABLE_NAME = 'EmployeeCommunicationMethod') Drop Table PAY.EmployeeCommunicationMethod 
If Exists(SELECT * FROM INFORMATION_SCHEMA.TABLES Where TABLE_SCHEMA = 'PAY' And TABLE_TYPE = 'BASE TABLE' And TABLE_NAME = 'EmployeeCourse') Drop Table PAY.EmployeeCourse 
If Exists(SELECT * FROM INFORMATION_SCHEMA.TABLES Where TABLE_SCHEMA = 'PAY' And TABLE_TYPE = 'BASE TABLE' And TABLE_NAME = 'EmployeeRelatedPeople') Drop Table PAY.EmployeeRelatedPeople 
If Exists(SELECT * FROM INFORMATION_SCHEMA.TABLES Where TABLE_SCHEMA = 'PAY' And TABLE_TYPE = 'BASE TABLE' And TABLE_NAME = 'EmployeeWorkExperience') Drop Table PAY.EmployeeWorkExperience 
If Exists(SELECT * FROM INFORMATION_SCHEMA.TABLES Where TABLE_SCHEMA = 'PAY' And TABLE_TYPE = 'BASE TABLE' And TABLE_NAME = 'Employee') Drop Table PAY.Employee 
If Exists(SELECT * FROM INFORMATION_SCHEMA.TABLES Where TABLE_SCHEMA = 'PAY' And TABLE_TYPE = 'BASE TABLE' And TABLE_NAME = 'Factor') Drop Table PAY.Factor 
If Exists(SELECT * FROM INFORMATION_SCHEMA.TABLES Where TABLE_SCHEMA = 'PAY' And TABLE_TYPE = 'BASE TABLE' And TABLE_NAME = 'LoanType') Drop Table PAY.LoanType 
If Exists(SELECT * FROM INFORMATION_SCHEMA.TABLES Where TABLE_SCHEMA = 'PAY' And TABLE_TYPE = 'BASE TABLE' And TABLE_NAME = 'TaxTableDetail') Drop Table PAY.TaxTableDetail 
If Exists(SELECT * FROM INFORMATION_SCHEMA.TABLES Where TABLE_SCHEMA = 'PAY' And TABLE_TYPE = 'BASE TABLE' And TABLE_NAME = 'TaxTableHeader') Drop Table PAY.TaxTableHeader 
If Exists(SELECT * FROM INFORMATION_SCHEMA.TABLES Where TABLE_SCHEMA = 'PAY' And TABLE_TYPE = 'BASE TABLE' And TABLE_NAME = 'TaxGroup') Drop Table PAY.TaxGroup 
If Exists(SELECT * FROM INFORMATION_SCHEMA.TABLES Where TABLE_SCHEMA = 'PAY' And TABLE_TYPE = 'BASE TABLE' And TABLE_NAME = 'JobLocation') Drop Table PAY.JobLocation 
If Exists(SELECT * FROM INFORMATION_SCHEMA.TABLES Where TABLE_SCHEMA = 'PAY' And TABLE_TYPE = 'BASE TABLE' And TABLE_NAME = 'Job') Drop Table PAY.Job 
If Exists(SELECT * FROM INFORMATION_SCHEMA.TABLES Where TABLE_SCHEMA = 'PAY' And TABLE_TYPE = 'BASE TABLE' And TABLE_NAME = 'JobCategory') Drop Table PAY.JobCategory 
If Exists(SELECT * FROM INFORMATION_SCHEMA.TABLES Where TABLE_SCHEMA = 'PAY' And TABLE_TYPE = 'BASE TABLE' And TABLE_NAME = 'EmployeeTaxOrg') Drop Table PAY.EmployeeTaxOrg 
If Exists(SELECT * FROM INFORMATION_SCHEMA.TABLES Where TABLE_SCHEMA = 'PAY' And TABLE_TYPE = 'BASE TABLE' And TABLE_NAME = 'SPIOrg') Drop Table PAY.SPIOrg 
If Exists(SELECT * FROM INFORMATION_SCHEMA.TABLES Where TABLE_SCHEMA = 'PAY' And TABLE_TYPE = 'BASE TABLE' And TABLE_NAME = 'SSIOrg') Drop Table PAY.SSIOrg 
--
-- Delete All System Tables
If Exists(SELECT * FROM INFORMATION_SCHEMA.TABLES Where TABLE_SCHEMA = 'PAY' And TABLE_TYPE = 'BASE TABLE' And TABLE_NAME = 'ContactTitle') Drop Table PAY.ContactTitle 
If Exists(SELECT * FROM INFORMATION_SCHEMA.TABLES Where TABLE_SCHEMA = 'PAY' And TABLE_TYPE = 'BASE TABLE' And TABLE_NAME = 'ContractType') Drop Table PAY.ContractType 
If Exists(SELECT * FROM INFORMATION_SCHEMA.TABLES Where TABLE_SCHEMA = 'PAY' And TABLE_TYPE = 'BASE TABLE' And TABLE_NAME = 'EmployeeCourseCertification') Drop Table PAY.EmployeeCourseCertification 
If Exists(SELECT * FROM INFORMATION_SCHEMA.TABLES Where TABLE_SCHEMA = 'PAY' And TABLE_TYPE = 'BASE TABLE' And TABLE_NAME = 'EmployeeStatus') Drop Table PAY.EmployeeStatus 
If Exists(SELECT * FROM INFORMATION_SCHEMA.TABLES Where TABLE_SCHEMA = 'PAY' And TABLE_TYPE = 'BASE TABLE' And TABLE_NAME = 'EmployeeTaxAdjustment') Drop Table PAY.EmployeeTaxAdjustment 
If Exists(SELECT * FROM INFORMATION_SCHEMA.TABLES Where TABLE_SCHEMA = 'PAY' And TABLE_TYPE = 'BASE TABLE' And TABLE_NAME = 'EmploymentType') Drop Table PAY.EmploymentType 
If Exists(SELECT * FROM INFORMATION_SCHEMA.TABLES Where TABLE_SCHEMA = 'PAY' And TABLE_TYPE = 'BASE TABLE' And TABLE_NAME = 'FactorCategory') Drop Table PAY.FactorCategory 
If Exists(SELECT * FROM INFORMATION_SCHEMA.TABLES Where TABLE_SCHEMA = 'PAY' And TABLE_TYPE = 'BASE TABLE' And TABLE_NAME = 'FactorClass') Drop Table PAY.FactorClass 
If Exists(SELECT * FROM INFORMATION_SCHEMA.TABLES Where TABLE_SCHEMA = 'PAY' And TABLE_TYPE = 'BASE TABLE' And TABLE_NAME = 'FactorGroup') Drop Table PAY.FactorGroup 
If Exists(SELECT * FROM INFORMATION_SCHEMA.TABLES Where TABLE_SCHEMA = 'PAY' And TABLE_TYPE = 'BASE TABLE' And TABLE_NAME = 'Marriage') Drop Table PAY.Marriage 
If Exists(SELECT * FROM INFORMATION_SCHEMA.TABLES Where TABLE_SCHEMA = 'PAY' And TABLE_TYPE = 'BASE TABLE' And TABLE_NAME = 'Military') Drop Table PAY.Military 
If Exists(SELECT * FROM INFORMATION_SCHEMA.TABLES Where TABLE_SCHEMA = 'PAY' And TABLE_TYPE = 'BASE TABLE' And TABLE_NAME = 'Sex') Drop Table PAY.Sex 

/*=============================================================================================================*/
/*=============================================================================================================*/
/*=============================================================================================================*/
/*=============================================================================================================*/
/*=============================================================================================================*/
/*=============================================================================================================*/
Go
If Not Exists(SELECT * FROM sys.schemas Where Name = 'PAY') Exec('Create Schema PAY')
GO
/*=============================================================================================================*/
Create Table PAY.SSIOrg(
	Serial Bigint Identity(1,1) Not Null,
	Code Int Null,
	FADes Varchar(300) Null,
	ENDes Varchar(300) Null,
	FileNumber Varchar(50) Null, -- 
	ContractNumber Varchar(50) Null, -- 
	TaxFreePersonsCount int Null, -- 
	AccEntityL1CodeBookRef Bigint Null,
	AccEntityL2CodeBookRef Bigint Null,
	RecorderRef Int Null,
	RecordDate char(10) Null,
	EditorRef Int Null,
	EditDate char(10) Null,
	Comment Varchar(300) Null,
	OfficeDetailRef Int Null)
GO
/*=============================================================================================================*/
Create Table PAY.SPIOrg(
	Serial Bigint Identity(1,1) Not Null,
	Code Int Null,
	FADes Varchar(300) Null,
	ENDes Varchar(300) Null,
	FileNumber Varchar(50) Null, 
	AccEntityL1CodeBookRef Bigint Null,
	AccEntityL2CodeBookRef Bigint Null,
	RecorderRef Int Null,
	RecordDate char(10) Null,
	EditorRef Int Null,
	EditDate char(10) Null,
	Comment Varchar(300) Null,
	OfficeDetailRef Int Null)
Go
/*=============================================================================================================*/
Create Table PAY.EmployeeTaxAdjustment(
	Serial int Identity(1,1) Not Null,
	FADes Varchar(300) Null,
	ENDes Varchar(300) Null)
Go
/*=============================================================================================================*/
Create Table PAY.EmployeeTaxOrg(
	Serial Bigint Identity(1,1) Not Null,
	Code Int Null,
	FADes Varchar(300) Null,
	ENDes Varchar(300) Null,
	FileNumber Varchar(50) Null,
	EmployeeTaxAdjustmentRef int Null, 
	AccEntityL1CodeBookRef Bigint Null,
	AccEntityL2CodeBookRef Bigint Null,
	RecorderRef Int Null,
	RecordDate char(10) Null,
	EditorRef Int Null,
	EditDate char(10) Null,
	Comment Varchar(300) Null,
	OfficeDetailRef Int Null)
GO
/*=============================================================================================================*/
Create Table PAY.JobCategory(
	Serial Bigint Identity(1,1) Not Null,
	Code int Null,
	FADes Varchar(300) Null,
	ENDes Varchar(300) Null,
	RecorderRef Int Null,
	RecordDate char(10) Null,
	EditorRef Int Null,
	EditDate char(10) Null,
	OfficeDetailRef Int Null)
Go
/*=============================================================================================================*/
Create Table PAY.Job(
	Serial Bigint Identity(1,1) Not Null,
	Code Int Null,
	FADes Varchar(300) Null,
	ENDes Varchar(300) Null, 
	JobCategoryRef Bigint ,  
	SSI_JobCode Varchar(50) Null,  
	RecorderRef Int Null,
	RecordDate char(10) Null,
	EditorRef Int Null,
	EditDate char(10) Null,
	Comment Varchar(300) Null,
	OfficeDetailRef Int Null)
Go
/*=============================================================================================================*/
Create Table PAY.JobLocation(
	Serial Bigint Identity(1,1) Not Null,
	Code int Null,
	FADes Varchar(300) Null,
	ENDes Varchar(300) Null, 
	RecorderRef Int Null,
	RecordDate char(10) Null,
	EditorRef Int Null,
	EditDate char(10) Null,
	OfficeDetailRef Int Null)
Go
Alter Table PAY.JobLocation Add Constraint PK_PAY_JobLocation Primary Key Clustered (Serial)
Go
/*=============================================================================================================*/
Create Table PAY.TaxGroup(
	Serial Bigint Identity(1,1) Not Null,
	Code int Null,
	FADes Varchar(300) Null,
	ENDes Varchar(300) Null,
	RecorderRef Int Null,
	RecordDate char(10) Null,
	EditorRef Int Null,
	EditDate char(10) Null,
	OfficeDetailRef Int Null)
Go
/*=============================================================================================================*/
Create Table PAY.TaxTableHeader(
	Serial Bigint Identity(1,1) Not Null,
	Code int Null,
	FADes Varchar(300) Null,
	ENDes Varchar(300) Null, 
	TaxGroupRef Int Null,
	--EffectiveDate Char(10) Null, 
	RecorderRef Int Null,
	RecordDate char(10) Null,
	EditorRef Int Null,
	EditDate char(10) Null,
	Comment Varchar(300) Null,
	OfficePeriodRef Int Null,
	OfficeDetailRef Int Null)
Go
/*=============================================================================================================*/
Create Table PAY.TaxTableDetail(
	Serial Bigint Identity(1,1) Not Null,
	TaxTableHeaderRef Bigint,
	FromAmount Money,
	ToAmount Money,
	Rate Decimal(4,2),
	PartialAmount Money,
	CurrentRowTotalAmount Money)
Go
/*=============================================================================================================*/
Create Table PAY.LoanType(
	Serial Bigint Identity(1,1) Not Null,
	Code int Null,
	FADes Varchar(300) Null,
	ENDes Varchar(300) Null, 
	Active bit Null,
	RecorderRef Int Null,
	RecordDate char(10) Null,
	EditorRef Int Null,
	EditDate char(10) Null,
	Comment Varchar(300) Null,
	OfficeDetailRef Int Null)
Go
/*=============================================================================================================*/
Create Table PAY.FactorGroup(
	Serial Smallint Not Null, --
	Type Smallint Not Null, ----
	FADes Varchar(50) Null, ----
	ENDes Varchar(50) Null) ----
Go
/*=============================================================================================================*/
Create Table PAY.FactorCategory(
	Serial Smallint Not Null, --
	Type Smallint Not Null, ----
	FADes Varchar(50) Null, ----
	ENDes Varchar(50) Null) ----
Go
/*=============================================================================================================*/
Create Table PAY.FactorClass(
	Serial Smallint Not Null, --
	FADes Varchar(50) Null, ----
	ENDes Varchar(50) Null) ----
Go
/*=================================================*/
Create Table PAY.Factor(
	Serial Bigint Identity(1,1) Not Null, --
	Code int Null, -------------------------
	Symbol Varchar(5) Null, ----------------
	FADes Varchar(300) Null, ---------------
	ENDes Varchar(300) Null, ---------------
	FactorGroupRef Smallint Null, ----------
	FactorCategoryRef Smallint Null, -------
	FactorClassRef Smallint Null, ----------
	Periority int Null, --------------------
	Formula Varchar(Max) Null, -------------
	IncludedSSI Bit Null, ------------------
	IncludedTax	Bit Null, ------------------
	DebitAccAdjutantL1CodeBookRef Bigint Null,
	DebitAccEntityL1CodeBookRef Bigint Null,
	DebitAccEntityL2CodeBookRef Bigint Null,
	CreditAccAdjutantL1CodeBookRef Bigint Null,
	CreditAccEntityL1CodeBookRef Bigint Null,
	CreditAccEntityL2CodeBookRef Bigint Null,
	Active bit Null,
	RecorderRef Int Null,
	RecordDate char(10) Null,
	EditorRef Int Null,
	EditDate char(10) Null,
	Comment Varchar(300) Null,
	OfficeDetailRef Int Null)
Go
/*===================================================================================*/
Create Table PAY.Sex(
	Serial Smallint Identity(1,1) Not Null, --
	FADes Varchar(50) Null, ------------------
	ENDes Varchar(50) Null) ------------------
Go
/*===================================================================================*/
Create Table PAY.Military(
	Serial Smallint Identity(1,1) Not Null, --
	FADes Varchar(50) Null, ------------------
	ENDes Varchar(50) Null) ------------------
Go
/*===================================================================================*/
Create Table PAY.EmployeeStatus(
	Serial Smallint Identity(1,1) Not Null, --
	FADes Varchar(50) Null, ------------------
	ENDes Varchar(50) Null) ------------------
Go
/*===================================================================================*/
Create Table PAY.Marriage(
	Serial Smallint Identity(1,1) Not Null, --
	FADes Varchar(50) Null, ------------------
	ENDes Varchar(50) Null) ------------------
Go
/*===================================================================================*/
Create Table PAY.Employee(
	Serial Bigint Identity(1,1) Not Null, --------
	FAFirstName Varchar(50) Null, ----------------
	ENFirstName Varchar(50) Null, ----------------
	FALastName Varchar(100) Null, ----------------
	ENLastName Varchar(100) Null, ----------------
	FAFatherName Varchar(50) NULL, ---------------
	ENFatherName Varchar(50) NULL, ---------------
	SSN Char(10) NULL, ---------------------------
	BirthCertificateNo Varchar(15) NULL, ---------
	BirthCertificateSerial Varchar(15) NULL, -----
	BirthCertificateRegPlace Varchar(50) NULL, ---
	BirthDate Char(10) NULL, ---------------------
	BirthPlace Varchar(50) NULL, -----------------
	SexRef Smallint NULL, ------------------------
	Nationality Varchar(50) Null, ----------------
	Religion Varchar(50) Null, -------------------
	ReligionSect Varchar(50) Null, ---------------
	MilitaryRef Smallint Null, -------------------
	EmployeeStatusRef Smallint Null, -------------
	MarriageRef Smallint Null, -------------------
	MarriageDate Char(10) NULL, ------------------
	ChildNumber Smallint Null, -------------------
	Sponsorship Smallint Null, -------------------
	Disability Varchar(300) Null, ----------------
	SpecificDisease Varchar(300) Null, -----------
	Code varchar(15) Null, -----------------------
	SSINumber Varchar(15) Null, ------------------
	SPINumber Varchar(15) Null, ------------------
	SSIRecordInDays int Null, --------------------
	Picture Varbinary(MAX) Null, -----------------
	AccEntityL1CodeBookRef Bigint Null, ----------
	AccEntityL2CodeBookRef Bigint Null, ----------
	Active bit Null, -----------------------------
	Comment Varchar(300) Null, -------------------
	RecorderRef Int Null,
	RecordDate char(10) Null,
	EditorRef Int Null,
	EditDate char(10) Null,
	OfficeDetailRef Int Null)
Go
/*=============================================================================================================*/
Create Table PAY.EmployeeBank(
	Serial Bigint Identity(1,1) Not Null, --
	EmployeeRef Bigint Not Null, -----------
	BankName Varchar(50) Null, -------------
	OffshootCode Varchar(15) Null, ---------
	OffshootName  Varchar(50) Null, --------
	BankAccountNo  Varchar(20) Null, -------
	BankCardNo Varchar(25) Null, -----------
	IBAN  Varchar(30) Null) ----------------
Go
/*=============================================================================================================*/
Create Table PAY.ContactTitle(
	Serial smallint Identity(1,1) Not Null, --
	FADes Varchar(50) Null, ------------------
	ENDes Varchar(50) Null) ------------------
Go
/*=============================================================================================================*/
Create Table PAY.EmployeeCommunicationMethod(
	Serial Bigint Identity(1,1) Not Null, --
	EmployeeRef Bigint Not Null, -----------
	ContactTitleRef smallint NULL, ---------
	Data Varchar(300) NULL) ----------------
Go
/*=============================================================================================================*/
Create Table PAY.EmployeeRelatedPeople(
	Serial Bigint Identity(1,1) Not Null, --
	EmployeeRef Bigint Not Null, -----------
	Name Varchar(50) NULL, -----------------
	Relation Varchar(100) NULL, ------------
	ContactTitleRef smallint NULL, ---------
	Data Varchar(300) NULL, ----------------
	Comment Varchar(300) NULL) -------------
Go
/*=============================================================================================================*/
Create Table PAY.EmployeeCourseCertification(
	Serial smallint Identity(1,1) Not Null, --
	FADes Varchar(50) Null, -----------------
	ENDes Varchar(50) Null) -----------------			
Go
/*=============================================================================================================*/
Create Table PAY.EmployeeCourse(
	Serial Bigint Identity(1,1) Not Null, -----
	EmployeeRef Bigint Not Null, --------------
	UniversityName Varchar(100) Null, ---------
	CourseDescription Varchar(300) Null, ------
	CourseStartDate Char(10) NULL, ------------
	CourseEndDate Char(10) NULL, --------------
	CourseDuration Varchar(20) NULL, ----------
	CourseCertificationRef smallint Null, -----
	CourseScore Varchar(20) Null, -------------
	Comment Varchar(300) NULL) ----------------
Go
/*=========================================================================*/
Create Table PAY.EmployeeWorkExperience(
	Serial Bigint Identity(1,1) Not Null, ----
	EmployeeRef Bigint Not Null, -------------
	Department  Varchar(100) Null, -----------
	Post Varchar(50) NULL, -------------------
	StartDate Char(10) NULL, -----------------
	EndDate Char(10) NULL, -------------------
	Duration Varchar(20) NULL, ---------------
	LatestSalary Varchar(15) Null, -----------
	ReasonForLeavingWork Varchar(200) Null, --
	Comment Varchar(300) NULL) ---------------
GO
/*================================================*/
Create Table PAY.ContractType(
	Serial smallint Not Null, -- سریال
	FADes Varchar(50) Null, ------------------
	ENDes Varchar(50) Null) ------------------
Go
/*================================================*/
Create Table PAY.EmploymentType(
	Serial smallint Not Null, -- سریال
	FADes Varchar(50) Null, ------------------
	ENDes Varchar(50) Null) ------------------
Go
/*=============================================================================================================*/
Create Table PAY.Contract(
	Serial Bigint Identity(1,1) Not Null, ---------
	ContractTypeRef Smallint NULL, ----------------
	ContractStartDate Char(10) NULL, --------------
	ContractEndDate Char(10) NULL, ----------------
	EmployeeRef Bigint Not Null, ------------------
	ContractNumber Varchar(15) Null, --------------
	Comment Varchar(300) NULL, --------------------
	EmploymentTypeRef Smallint NULL, --------------
	EmploymentStartDate char(10) Null, ------------
	EmploymentEndDate char(10) Null, --------------
	JobRef Bigint Null, ---------------------------
	JobLocationRef Bigint Null, -------------------
	CostCenterRef Bigint Null, --------------------
	TaxGroupRef Bigint Null, ----------------------
	EmployeeTaxOrgRef Bigint Null, ----------------
	TaxFreeHomeLoan Bigint Null, ------------------
	IncludedSSI Bit Null, -------------------------
	SSIOrgRef Bigint Null, ------------------------
	HardAndHarmfulJob Bit Null, -------------------
	UnemploymentInsuranceExemption Bit Null, ------
	EmployerInsuranceContribution Smallint Null, --
	IncludedSPI Bit Null, -------------------------
	SPIOrgRef Bigint Null, ------------------------
	ContractLetter Varchar(Max) Null, -------------
	AppointmentLetter Varchar(Max) Null, ----------
	RecorderRef Int Null,
	RecordDate char(10) Null,
	EditorRef Int Null,
	EditDate char(10) Null,
	OfficeDetailRef Int Null)
Go
/*=========================================================================*/
Create Table PAY.ContractFactor(
	Serial Bigint Identity(1,1) Not Null, --
	ContractRef Bigint Not Null, -----------
	FactorRef Bigint Not NULL, -------------
	Amount Bigint NULL) --------------------
GO
/*=============================================================================================================*/
Create Table PAY.MonthlyFactorPerEmployee(
	[Serial] Bigint Identity(1,1) Not Null, --
	[EmployeeRef] Bigint Not Null, -----------
	[FactorRef] Bigint Not Null, -------------
	[Value] Varchar(15) Null, ----------------
	[Month]	Int Null, ------------------------
	[OfficePeriodRef] Int Null, --------------
	[OfficeDetailRef] Int Null) --------------
Go




/*=============================================================================================================*/
	 Declare @RecorderRef Int
	 Declare @OfficeDetailRef Int
	 Delete From PAY.Factor

	Declare Tmp_Cursor2 Cursor Local For Select Serial From OfficeDetail 
	Open Tmp_Cursor2
	Fetch Next From Tmp_Cursor2 Into @OfficeDetailRef
	While @@FETCH_STATUS = 0
	Begin
		Select @RecorderRef = RecorderRef From OfficePeriod Where OfficeDetailRef = @OfficeDetailRef
		--
		-- عوامل حقوقی
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (01, N'Pay01', N'حقوق پايه', N'حقوق پايه', 10, 10, 1, 10, N'(Pay01*Wrk01)/30.0000', 1, 1, NULL, NULL, NULL, NULL, NULL, NULL, 1, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (02, N'Pay02', N'مزد ساعتي', N'مزد ساعتي', 10, 10, 1, 11, N'Pay02*Wrk02', 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (03, N'Pay03', N'بن کارگري', N'بن کارگري', 10, 10, 1, 12, N'', 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (04, N'Pay04', N'حق سرپرستي', N'حق سرپرستي', 10, 10, 1, 13, N'(Pay04*Wrk01)/DaysOfMonth', 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (05, N'Pay05', N'حق مسئوليت', N'حق مسئوليت', 10, 10, 1, 14, N'(Pay05*Wrk01)/DaysOfMonth', 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (06, N'Pay06', N'حق شيفت', N'حق شيفت', 10, 10, 1, 15, N'', 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (07, N'Pay07', N'حق سنوات', N'حق سنوات', 10, 10, 1, 16, N'', 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (08, N'Pay08', N'حق اولاد', N'حق اولاد', 10, 10, 1, 17, N'(Pay08*Wrk01)/DaysOfMonth', 0, 1, NULL, NULL, NULL, NULL, NULL, NULL, 1, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (09, N'Pay09', N'حق مسکن', N'حق مسکن', 10, 10, 1, 18, N'(Pay09*Wrk01)/DaysOfMonth', 1, 1, NULL, NULL, NULL, NULL, NULL, NULL, 1, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (10, N'Pay10', N'حق الزحمه', N'حق الزحمه', 10, 10, 1, 19, N'', 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (11, N'Pay11', N'حق خواروبار', N'حق خواروبار', 10, 10, 1, 20, N'(Pay11*Wrk01)/DaysOfMonth', 1, 1, NULL, NULL, NULL, NULL, NULL, NULL, 1, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (12, N'Pay12', N'اضافه کاري', N'اضافه کاري', 10, 12, 1, 21, N'(Pay01*Wrk05/220.0000)*1.4000', 1, 1, NULL, NULL, NULL, NULL, NULL, NULL, 1, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (13, N'Pay13', N'اضافه کاري تعطيلي', N'اضافه کاري تعطيلي', 10, 12, 1, 22, N'', 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (14, N'Pay14', N'حق ماموريت روزانه', N'حق ماموريت روزانه', 10, 12, 1, 23, N'(Pay01*Wrk07)/30.0000', 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 1, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (15, N'Pay15', N'حق ماموريت ساعتي', N'حق ماموريت ساعتي', 10, 12, 1, 24, N'', 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (16, N'Pay16', N'نوبتکاري', N'نوبتکاري', 10, 12, 1, 25, N'(Pay01*((Wrk09*0.1000)+(Wrk10*0.1500)+(Wrk11*0.2500)+(Wrk12*0.3000)))/30.0000', 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (17, N'Pay17', N'پاداش نقدي', N'پاداش نقدي', 10, 11, 1, 26, N'Pay17', 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 1, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (18, N'Pay18', N'پاداش درصدي', N'پاداش درصدي', 10, 12, 1, 27, N'', 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (19, N'Pay19', N'کارانه نقدي', N'کارانه نقدي', 10, 11, 1, 28, N'', 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (20, N'Pay20', N'کارانه درصدي', N'کارانه درصدي', 10, 12, 1, 29, N'', 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (21, N'Pay21', N'اياب و ذهاب', N'اياب و ذهاب', 10, 12, 1, 30, N'', 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (22, N'Pay22', N'اياب و ذهاب نقدي', N'اياب و ذهاب نقدي', 10, 11, 1, 31, N'', 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (23, N'Pay23', N'حق غذا', N'حق غذا', 10, 12, 1, 32, N'', 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (24, N'Pay24', N'حق غذا نقدي', N'حق غذا نقدي', 10, 11, 1, 33, N'', 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (25, N'Pay25', N'ساير مطالبات', N'ساير مطالبات', 10, 11, 1, 34, N'', 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (26, N'Pay26', N'مزاياي مستمر ويژه', N'مزاياي مستمر ويژه', 10, 10, 2, 35, N'', 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (27, N'Pay27', N'مزاياي مستمر عادي', N'مزاياي مستمر عادي', 10, 10, 1, 36, N'', 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (28, N'Pay28', N'مزاياي غير مستمر ويژه', N'مزاياي غير مستمر ويژه', 10, 11, 2, 37, N'', 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (29, N'Pay29', N'مزاياي غير مستمر عادي', N'مزاياي غير مستمر عادي', 10, 11, 1, 38, N'', 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (30, N'Pay30', N'بيمه تکميلي سهم کارمند', N'بيمه تکميلي سهم کارمند', 20, 10, 1, 70, N'', 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (31, N'Pay31', N'مساعده', N'مساعده', 20, 11, 1, 71, N'Pay31', 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 1, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (32, N'Pay32', N'پس انداز', N'پس انداز', 20, 10, 1, 72, N'', 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (33, N'Pay33', N'جريمه کسر کار', N'جريمه کسر کار', 20, 12, 1, 73, N'', 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (34, N'Pay34', N'ساير کسور', N'ساير کسور', 20, 11, 1, 74, N'Pay34', 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 1, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (35, N'Pay35', N'کسور مستمر ويژه', N'کسور مستمر ويژه', 20, 10, 2, 75, N'', 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (36, N'Pay36', N'کسور مستمر عادي', N'کسور مستمر عادي', 20, 10, 1, 76, N'', 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (37, N'Pay37', N'کسور غير مستمر ويژه', N'کسور غير مستمر ويژه', 20, 11, 2, 77, N'', 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (38, N'Pay38', N'کسور غير مستمر عادي', N'کسور غير مستمر عادي', 20, 11, 1, 78, N'', 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (39, N'Pay39', N'بيمه تکميلي سهم کارفرما', N'بيمه تکميلي سهم کارفرما', 30, 10, 1, 90, N'', 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		--							  																																																																																	
		-- عوامل کارکرد																																																																																				
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (01, N'Wrk01', N'کارکرد روزانه', N'کارکرد روزانه', 40, 20, 1, 10, N'', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (02, N'Wrk02', N'کارکرد ساعتي', N'کارکرد ساعتي', 40, 21, 1, 11, N'', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (03, N'Wrk03', N'کسر کار', N'کسر کار', 40, 21, 1, 12, N'', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (04, N'Wrk04', N'غيبت', N'غيبت', 40, 20, 1, 13, N'', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (05, N'Wrk05', N'اضافه کاري', N'اضافه کاري', 40, 21, 1, 14, N'', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (06, N'Wrk06', N'اضافه کاري تعطيلي', N'اضافه کاري تعطيلي', 40, 21, 1, 15, N'', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (07, N'Wrk07', N'ماموريت روزانه', N'ماموريت روزانه', 40, 20, 1, 16, N'', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (08, N'Wrk08', N'ماموريت ساعتي', N'ماموريت ساعتي', 40, 21, 1, 17, N'', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (09, N'Wrk09', N'نوبتکاري 10 %', N'نوبتکاري 10 %', 40, 20, 1, 18, N'', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (10, N'Wrk10', N'نوبتکاري 15 %', N'نوبتکاري 15 %', 40, 20, 1, 19, N'', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (11, N'Wrk11', N'نوبتکاري 25 %', N'نوبتکاري 25 %', 40, 20, 1, 20, N'', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (12, N'Wrk12', N'نوبتکاري 30 %', N'نوبتکاري 30 %', 40, 20, 1, 21, N'', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		--																																																																																												
		-- عوامل مرخصی																																																																																									
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (01, N'Vac01', N'مرخصي روزانه', N'مرخصي روزانه', 80, 30, 1, 10, N'', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (02, N'Vac02', N'مرخصي ساعتي', N'مرخصي ساعتي', 80, 31, 1, 11, N'', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (03, N'Vac03', N'مرخصي استعلاجي', N'مرخصي استعلاجي', 80, 30, 1, 12, N'', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)
		Insert Into PAY.Factor (Code, Symbol, FADes, ENDes, FactorGroupRef, FactorCategoryRef, FactorClassRef, Periority, Formula, IncludedSSI, IncludedTax, DebitAccAdjutantL1CodeBookRef, DebitAccEntityL1CodeBookRef, DebitAccEntityL2CodeBookRef, CreditAccAdjutantL1CodeBookRef, CreditAccEntityL1CodeBookRef, CreditAccEntityL2CodeBookRef, Active, RecorderRef, RecordDate, EditorRef, EditDate, Comment, OfficeDetailRef) VALUES (04, N'Vac04', N'مرخصي بدون حقوق', N'مرخصي بدون حقوق', 80, 30, 1, 13, N'', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, @RecorderRef, dbo.Solar_Date_Converter(getdate()), Null, Null, Null, @OfficeDetailRef)

		Fetch Next From Tmp_Cursor2 Into @OfficeDetailRef
	End
	Close Tmp_Cursor2
	Deallocate Tmp_Cursor2
