DELETE FROM dbo.ReportLookUpFields WHERE parametr_id IN ( SELECT ReportParametrs.id FROM dbo.ReportObject INNER JOIN ReportDataObjectSource ON dbo.ReportObject.id = dbo.ReportDataObjectSource.report_object_id INNER JOIN ReportParametrs ON dbo.ReportParametrs.data_object_id = ReportDataObjectSource.id WHERE report_type= 'Standard') GO DELETE FROM dbo.ReportParametrs WHERE data_object_id IN ( SELECT ReportDataObjectSource.id FROM dbo.ReportObject INNER JOIN ReportDataObjectSource ON dbo.ReportObject.id = dbo.ReportDataObjectSource.report_object_id WHERE report_type= 'Standard') GO DELETE FROM dbo.ReportDataObjectSource WHERE report_object_id IN ( SELECT ReportObject.id FROM dbo.ReportObject WHERE report_type= 'Standard') GO DELETE FROM dbo.ReportObject WHERE report_type= 'Standard' GO ----------------------------------- residualMaturity.rpt ----------------------------------------------- DECLARE @ObjectID INT DECLARE @SourceID INT DECLARE @ParametrID INT INSERT INTO ReportObject (report_name, report_type) VALUES ('residualMaturity.rpt', 'Standard') SELECT @ObjectID = @@IDENTITY INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'residualMaturity.rpt', 'residualMaturity', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') GO ----------------------------------- Repayments.rpt ------------------------------------------------------ DECLARE @ObjectID INT DECLARE @SourceID INT DECLARE @ParametrID INT INSERT INTO ReportObject (report_name, report_type) VALUES ('Repayments.rpt', 'Standard') SELECT @ObjectID = @@IDENTITY INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'Repayments.rpt', 'Repayments_sqlQuery', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@beginDate', 'DateTimeType', '') INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, 'INTERNAL_CURRENCY', 'SystemConstantType', '') INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, 'EXTERNAL_CURRENCY', 'SystemConstantType', '') GO ----------------------------------- QualityReport.rpt ------------------------------------------------------ DECLARE @ObjectID INT DECLARE @SourceID INT DECLARE @ParametrID INT INSERT INTO ReportObject (report_name, report_type) VALUES ('QualityReport.rpt', 'Standard') SELECT @ObjectID = @@IDENTITY INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'ContractWithoutLoanOfficer', 'QualityReport_noLoanOfficer', 'V') INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'EstablishmentDate', 'QualityReport_EstablishmentDate', 'V') INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'Eventdate', 'QualityReport_eventdate', 'V') INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'GroupMembers', 'QualityReport_GroupMembers', 'V') INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'GroupMembersOld', 'QualityReport_GroupMembersOld', 'V') INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'LoanShareAmountClosed.rpt', 'QualityReport_LoanShareAmount', 'V') INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'NullLoanShareAmount', 'QualityReport_NullLoanShareAmount', 'V') INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'OLBDiscrepancy', 'QualityReport_OLB', 'V') INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'SameContractCode', 'QualityReport_SameContractCodes', 'V') INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'WeirdContracts', 'QualityReport_WeirdContracts', 'V') GO ----------------------------------- PARAnalysis.rpt ------------------------------------------------------ DECLARE @ObjectID INT DECLARE @SourceID INT DECLARE @ParametrID INT INSERT INTO ReportObject (report_name, report_type) VALUES ('PARAnalysis.rpt', 'Standard') SELECT @ObjectID = @@IDENTITY INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'ByDistrict', 'LoansPAR_proc', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'ByLoanOfficer', 'LoansPAR_proc', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'ByProduct', 'LoansPAR_proc', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') GO ----------------------------------- OLB_per_Loan.rpt ------------------------------------------------------ DECLARE @ObjectID INT DECLARE @SourceID INT DECLARE @ParametrID INT INSERT INTO ReportObject (report_name, report_type) VALUES ('OLB_per_Loan.rpt', 'Standard') SELECT @ObjectID = @@IDENTITY INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'OLB_per_Loan.rpt', 'LoanSizeMaturityGraceDomainDistrict_proc', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, 'INTERNAL_CURRENCY', 'SystemConstantType', '') GO ----------------------------------- NBTquarterly.rpt ------------------------------------------------------ DECLARE @ObjectID INT DECLARE @SourceID INT DECLARE @ParametrID INT INSERT INTO ReportObject (report_name, report_type) VALUES ('NBTquarterly.rpt', 'Standard') SELECT @ObjectID = @@IDENTITY INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'NBTreport.rpt', 'NBT_quarter', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@beginDate', 'DateTimeType', '') INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'activities.rpt', 'NBT_quarter_domain', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@beginDate', 'DateTimeType', '') INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') GO ----------------------------------- nbtmonthly.rpt ------------------------------------------------------ DECLARE @ObjectID INT DECLARE @SourceID INT DECLARE @ParametrID INT INSERT INTO ReportObject (report_name, report_type) VALUES ('nbtmonthly.rpt', 'Standard') SELECT @ObjectID = @@IDENTITY INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'nbtmonthly.rpt', 'NBT_monthly', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@beginDate', 'DateTimeType', '') INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') GO ----------------------------------- LoansDisbursed.rpt ------------------------------------------------------ DECLARE @ObjectID INT DECLARE @SourceID INT DECLARE @ParametrID INT INSERT INTO ReportObject (report_name, report_type) VALUES ('LoansDisbursed.rpt', 'Standard') SELECT @ObjectID = @@IDENTITY INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'ByActivity', 'loansDisbursed', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@beginDate', 'DateTimeType', '') INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'ByDistrict', 'loansDisbursed', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@beginDate', 'DateTimeType', '') INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'ByLoanOfficer', 'loansDisbursed', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@beginDate', 'DateTimeType', '') INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'ByProduct', 'loansDisbursed', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@beginDate', 'DateTimeType', '') INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') GO ----------------------------------- FollowUp.rpt ------------------------------------------------------ DECLARE @ObjectID INT DECLARE @SourceID INT DECLARE @ParametrID INT INSERT INTO ReportObject (report_name, report_type) VALUES ('FollowUp.rpt', 'Standard') SELECT @ObjectID = @@IDENTITY INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'FollowUpPAR.rpt', 'LoansPAR_proc', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'followuprd.rpt', 'FollowUp_PrincipalAndInterest', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@beginDate', 'DateTimeType', '') INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') GO ----------------------------------- FinancialStock.rpt ------------------------------------------------------ DECLARE @ObjectID INT DECLARE @SourceID INT DECLARE @ParametrID INT INSERT INTO ReportObject (report_name, report_type) VALUES ('FinancialStock.rpt', 'Standard') SELECT @ObjectID = @@IDENTITY INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'Assets', 'FinancialStock_Assets', 'V') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, 'INTERNAL_CURRENCY', 'SystemConstantType', '') INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'Expenses', 'FinancialStock_Expenses', 'V') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, 'INTERNAL_CURRENCY', 'SystemConstantType', '') INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'Income', 'FinancialStock_Income', 'V') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, 'INTERNAL_CURRENCY', 'SystemConstantType', '') INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'Liabilities', 'FinancialStock_Liabilities', 'V') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, 'INTERNAL_CURRENCY', 'SystemConstantType', '') GO ----------------------------------- DropOut_months.rpt ------------------------------------------------------ DECLARE @ObjectID INT DECLARE @SourceID INT DECLARE @ParametrID INT INSERT INTO ReportObject (report_name, report_type, description) VALUES ('DropOut_months.rpt', 'Standard', 'This report will display all contracts closed between @beginDate and @endDate.Renewed contracts are contracts that have been reconducted after @period days. The calculation of drop-out is as following: (1- (closed contracts /renewed contracts))*100.The same applies to loans.') SELECT @ObjectID = @@IDENTITY INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'ByDistrict', 'DropOut_byDistrict', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@beginDate', 'DateTimeType', '') INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@period', 'LookupType', '') SELECT @ParametrID = @@IDENTITY INSERT INTO ReportLookUpFields (parametr_id, field_to_send, field_to_show, data_object) VALUES (@ParametrID, 'period', 'period', 'NumberDayPeriod') INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'ByLoanOfficer', 'DropOut_byLoanOfficer', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@beginDate', 'DateTimeType', '') INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@period', 'LookupType', '') SELECT @ParametrID = @@IDENTITY INSERT INTO ReportLookUpFields (parametr_id, field_to_send, field_to_show, data_object) VALUES (@ParametrID, 'period', 'period', 'NumberDayPeriod') INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'ByProduct', 'DropOut_byProduct', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@beginDate', 'DateTimeType', '') INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@period', 'LookupType', '') SELECT @ParametrID = @@IDENTITY INSERT INTO ReportLookUpFields (parametr_id, field_to_send, field_to_show, data_object) VALUES (@ParametrID, 'period', 'period', 'NumberDayPeriod') GO ----------------------------------- Disbursments.rpt ------------------------------------------------------ DECLARE @ObjectID INT DECLARE @SourceID INT DECLARE @ParametrID INT INSERT INTO ReportObject (report_name, report_type) VALUES ('Disbursments.rpt', 'Standard') SELECT @ObjectID = @@IDENTITY INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'Disbursments.rpt', 'Disbursments_sqlQuery', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@beginDate', 'DateTimeType', '') INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, 'INTERNAL_CURRENCY', 'SystemConstantType', '') INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, 'EXTERNAL_CURRENCY', 'SystemConstantType', '') GO ----------------------------------- Disbursements_and_Reimbursements.rpt ------------------------------------------------------ DECLARE @ObjectID INT DECLARE @SourceID INT DECLARE @ParametrID INT INSERT INTO ReportObject (report_name, report_type) VALUES ('Disbursements_and_Reimbursements.rpt', 'Standard') SELECT @ObjectID = @@IDENTITY INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'ByDistrict', 'Disbursements_and_Reimbursements', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@beginDate', 'DateTimeType', '') INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'ByLoanOfficer', 'Disbursements_and_Reimbursements', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@beginDate', 'DateTimeType', '') INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'ByProduct', 'Disbursements_and_Reimbursements', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@beginDate', 'DateTimeType', '') INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') GO ----------------------------------- DelinquentLoans.rpt ------------------------------------------------------ DECLARE @ObjectID INT DECLARE @SourceID INT DECLARE @ParametrID INT INSERT INTO ReportObject (report_name, report_type) VALUES ('DelinquentLoans.rpt', 'Standard') SELECT @ObjectID = @@IDENTITY INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'DelinquentLoans.rpt', 'DelinquentLoans_sqlQuery', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, 'INTERNAL_CURRENCY', 'SystemConstantType', '') GO ----------------------------------- ClientsAndShareOfWomen.rpt ------------------------------------------------------ DECLARE @ObjectID INT DECLARE @SourceID INT DECLARE @ParametrID INT INSERT INTO ReportObject (report_name, report_type) VALUES ('ClientsAndShareOfWomen.rpt', 'Standard') SELECT @ObjectID = @@IDENTITY INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'ByDistrict', 'ClientsAndShareOfWomen_ByDistrict', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'ByLoanOfficer', 'ClientsAndShareOfWomen_ByLoanOfficer', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'ByProduct', 'ClientsAndShareOfWomen_ByProduct', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') GO ----------------------------------- ClientsAndShareOfWomen.rpt ------------------------------------------------------ DECLARE @ObjectID INT DECLARE @SourceID INT DECLARE @ParametrID INT INSERT INTO ReportObject (report_name, report_type) VALUES ('ClientAndLoansStatistics.rpt', 'Standard') SELECT @ObjectID = @@IDENTITY INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'LoanActivity', 'LoanSizeMaturityGraceDomainDistrict_proc', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'LoanDistrict', 'LoanSizeMaturityGraceDomainDistrict_proc', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'LoanGender', 'LoanSizeMaturityGraceDomainDistrict_proc', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'LoanGrace', 'LoanSizeMaturityGraceDomainDistrict_proc', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'LoanMaturity', 'LoanSizeMaturityGraceDomainDistrict_proc', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'LoanSizePerLoanScale', 'LoanSizeMaturityGraceDomainDistrict_proc', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'LoansSize', 'LoanSizeMaturityGraceDomainDistrict_proc', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') GO ----------------------------------- ActiveLoans.rpt ------------------------------------------------------ DECLARE @ObjectID INT DECLARE @SourceID INT DECLARE @ParametrID INT INSERT INTO ReportObject (report_name, report_type) VALUES ('ActiveLoans.rpt', 'Standard') SELECT @ObjectID = @@IDENTITY INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'ByActivity', 'LoanSizeMaturityGraceDomainDistrict_proc', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'ByDistrict', 'LoanSizeMaturityGraceDomainDistrict_proc', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'ByLoanOfficer', 'LoanSizeMaturityGraceDomainDistrict_proc', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'ByProduct', 'LoanSizeMaturityGraceDomainDistrict_proc', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'ByRangeOfAmount', 'LoanSizeMaturityGraceDomainDistrict_proc', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'ByRangeOfInterestRate', 'LoanSizeMaturityGraceDomainDistrict_proc', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'ByRangeOfLoanScale', 'LoanSizeMaturityGraceDomainDistrict_proc', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') GO -- WrittenOffLoans.rpt DECLARE @ObjectID INT DECLARE @SourceID INT DECLARE @ParametrID INT INSERT INTO ReportObject (report_name, report_type) VALUES ('WrittenOffLoans.rpt', 'Standard') SELECT @ObjectID = @@IDENTITY INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'WrittenOffLoans.rpt', 'WrittenOffLoansReport', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@beginDate', 'DateTimeType', '') INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') GO -- NotChargedPenalties.rpt DECLARE @ObjectID INT DECLARE @SourceID INT DECLARE @ParametrID INT INSERT INTO ReportObject (report_name, report_type, description) VALUES ('notChargedPenalties.rpt', 'Standard', '') SELECT @ObjectID = @@IDENTITY INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'notChargedPenalties.rpt', 'notChargedPenalties', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@beginDate', 'DateTimeType', '') INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') GO ---- OLBPERCOLLATERAL.rpt ------ DECLARE @ObjectID INT DECLARE @SourceID INT DECLARE @ParametrID INT INSERT INTO ReportObject (report_name, report_type, description) VALUES ('OLBperCollateral.rpt', 'Custom', '') SELECT @ObjectID = @@IDENTITY INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'OLBperCollateral.rpt', 'OLBPerCollateral', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '') GO -- Repayment collection sheet (internal report) DELETE FROM ReportParametrs WHERE data_object_id IN ( SELECT ReportDataObjectSource.id FROM ReportDataObjectSource LEFT JOIN ReportObject ON ReportDataObjectSource.report_object_id = ReportObject.id WHERE ReportObject.report_name IN ( 'RepaymentCollectionSheetWithoutDelinquent.rpt', 'RepaymentCollectionSheetWithDelinquent.rpt' ) ) DELETE FROM ReportDataObjectSource WHERE report_object_id IN ( SELECT id FROM ReportObject WHERE report_name IN ( 'RepaymentCollectionSheetWithoutDelinquent.rpt', 'RepaymentCollectionSheetWithDelinquent.rpt' ) ) DELETE FROM ReportObject WHERE report_name IN ( 'RepaymentCollectionSheetWithoutDelinquent.rpt', 'RepaymentCollectionSheetWithDelinquent.rpt' ) GO DECLARE @ObjectID INT DECLARE @SourceID INT INSERT INTO ReportObject (report_name, report_type) VALUES ('RepaymentCollectionSheetWithoutDelinquent.rpt', 'Internal') SELECT @ObjectID = @@IDENTITY INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'RepaymentCollectionSheetWithoutDelinquent.rpt', 'GetRepaymentCollectionSheet', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@user', 'TextType', '0') INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@beginDate', 'DateTimeType', '0') INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '0') INSERT INTO ReportObject (report_name, report_type) VALUES ('RepaymentCollectionSheetWithDelinquent.rpt', 'Internal') SELECT @ObjectID = @@IDENTITY INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'RepaymentCollectionSheetDelinquent.rpt', 'GetDelinquentLoans', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@user', 'TextType', '0') INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@beginDate', 'DateTimeType', '0') INSERT INTO ReportDataObjectSource (report_object_id, sub_report_name, data_object_source, data_object_type) VALUES (@ObjectID, 'RepaymentCollectionSheet.rpt', 'GetRepaymentCollectionSheet', 'P') SELECT @SourceID = @@IDENTITY INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@user', 'TextType', '0') INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@beginDate', 'DateTimeType', '0') INSERT INTO ReportParametrs (data_object_id, name, type, value) VALUES (@SourceID, '@endDate', 'DateTimeType', '0') GO