Sei sulla pagina 1di 75

INTEGRATED INFORMATION SYSTEM

FOR
HEAVY WATER BOARD
Dissertation submitted to

GOVERNMENT INSTITUTE OF ELECTRONICS

EAST MARREDPALLY, SECUNDERABAD – 500 026

In partial fulfillment for the award of the degree of

DIPLOMA IN ELECTRONICS WITH SPECIALIZATION IN

COMPUTER ENGINEERING

By

B. KAVYA (15054-CP-011)

MAY-NOVEMBER 2018

STATE BOARD OF TECHNICAL EDUCATION & TRAINING


HYDERABAD, TELANGANA

1
ELECTRONICS CORPORATION OF INDIA LIMITED
(A Government of India Enterprise)

CORPORATE RESEARCH AND DEVELOPMENT


ECIL, HYDERABAD – 500 062, INDIA.
Phone: 040 – 2718 6509

E-mail : chvenumadhav@ecil.co.in

CERTIFICATE
This is to certify that the project report on “INTEGRATED INFORMATION
SYSTEM FOR HEAVY WATER BOARD” is being done by B. KAVYA
(15054-CP-011) in partial fulfillment for the award of SPECIAL DIPLOMA IN
ELECLTRONICS WITH SPECIALIZATION IN COMPUTER
PROGRAMMING from GOVERNMENT INSTITUTE OF ELECTRONICS.
This work is carried out under my guidance and supervision.

She is sincere and hardworking and has shown great zeal of enthusiasm in group
participation and practical aspects. Her conduct has been good during the course of
project in “ELECTRONICS CORPORATION OF INDIA LIMITED”,
HYDERABAD.

Project In-Charge / Guide


Mr. CH. VENU MADHAV
S.M , CR&D, ECIL.

2
GOVERNMENT INSTITUTE OF ELECTRONICS

EASTMARREDPALLY,
Secunderabad-500 026,
TELANGANA, INDIA.

__________________________________________________________

CERTIFICATE

This is to certify that the thesis entitled “INTEGRATED INFORMATION


SYSTEM FOR HEAVY WATER BOARD” is a Bonafied work done and
submitted by B. KAVYA bearing PIN 15054-CP-011, partial fulfillment for the
award of SPECIAL DIPLOMA IN ELECTRONICS WITH
SPECIALIZATION IN COMPUTER PROGRAMMING to STATE BOARD
OF TECHNICAL EDUCATION AND TRAINING.

Certified further that to the best of our knowledge the work presented in this thesis
has not been submitted to any other College / Institute for the award of any Degree
or Diploma.

Sri PULLAIAH Sri DAVID RAJ


PRINCIPAL HEAD OF THE DEPARTMENT
GOVT.INSTITUTE OF ELECTRONICS, GOVT.INSTITTE OF ELECTRONICS,
EAST MARREDPALLY, EAST MARREDPALLY,
SECUNDERABAD-500026 SECUNDERABAD-500026,
TELANGANA, INDIA TELANGANA, INDIA

3
ACKNOWLEDGEMENT

We are indebted to our Principal Shri A. PULLAIAH for his constant


encouragement in carrying our Industrial Training. We also thank our Head of
the Department Prof. DAVID RAJ and Training In-Charge Smt
T.SWAROOPA, for guiding us in choosing ECIL to undergo training. And we
sincerely thank all our staff members.

It is our privilege to express our gratitude and respect to all those who guided,
inspired and helped us in the completion of this project.

We express our Sincere Gratitude to Shri CH. VENU MADHAV, S.M, CR&D,
ECIL and Smt. Sabahat Fatima, S.T.O, CR&D, ECIL who guided and
encouraged us in every step till the successful completion of our project.

B. KAVYA
15054-CP-011

4
ORGANIZATION PROFILE

ECIL was setup under the Department of Atomic Energy on 11th April, 1967 with
a view to generate a strong indigenous capability in the field of professional grade
electronics. The initial accent was on total self-reliance and ECIL was engaged in
the Design, Development, Manufacture and Marketing of several products with
emphasis on three technology lines viz. Computers, Control Systems and
Communications.

Over the years, ECIL pioneered the development of various complex electronic
products without any external technological help and scored several 'firsts' in
these fields prominent among them being country's
 First Digital Computer
 First Solid State TV
 First Control & Instrumentation for Nuclear Power Plants
 First Earth Station Antenna
 First Computerized Operator Information System
 First Radiation Monitoring & Detection Systems
 First Automatic Message Switching Systems
 First Operation & Maintenance Center For E-108 Exchange
 First Programmable Logic Controller
 First Solid State Cockpit Voice Recorder
 First Electronic Voting Machines

The company played a very significant role in the training and growth of high
caliber technical and managerial manpower especially in the fields of Computers

5
and Information Technology. Though the initial thrust was on meeting
the Control & Instrumentation requirements of the Nuclear Power Program, the
expanded scope of self-reliance pursued by ECIL enabled the company to develop
various products to cater to the needs of Defence, Civil Aviation, Information &
Broadcasting, Telecommunications, Insurance, Banking, Police, and Para-Military
Forces, Oil & Gas, Power, Space Education, Health, Agriculture, Steel and Coal
sectors and various user departments in the Government domain. ECIL thus
evolved as a multi-product company serving multiple sectors of Indian economy
with emphasis on import of country substitution and development of products &
services that are of economic and strategic significance to the country.

Vision

To contribute to the country in achieving self reliance in strategic electronics.

Mission

ECIL's mission is to consolidate its status as a valued national asset in the area of
strategic electronics with specific focus on Atomic Energy, Defence, Security and
such critical sectors of strategic national importance.

Objectives

 To continue services to the country's needs for the peaceful uses Atomic
Energy. Special and Strategic requirements of Defence and Space,
Electronics Security Systems and Support for Civil Aviation sector.

 To establish newer technology products such as Container Scanning Systems

6
and Explosive Detectors.

 To explore new avenues of business and work for growth in strategic sectors
in addition to working for realizing technological solutions for the benefit of
society in areas like Agriculture, Education, Health, Power, Transportation,
Food, Disaster Management etc.

 To progressively improve shareholder value of the company.

 To strengthen the technology base, enhance skill base and ensure succession
planning in the company.

 To re-engineer the company to become nationally and internationally


competitive by paying particular attention to delivery, cost and quality in all
its activities.

 To consciously work for finding export markets for the company's products.

7
ABSTRACT

Integrated Information System for HWB (IIS-HWB) is being established in HWB

to support management functions of HWB and its Plants for information

dissemination within HWB. IIS-HWB is being developed to primarily provide a

HWB-wide integrated database of Human Resource, status of Projects undertaken

by the HWB and financial accounting functions in Heavy Water Plants and

Corporate Office of HWB. The IIS-HWB will provide:

 Human Resource Management System and Payroll

 Finance and Accounts

 Project Monitoring and Reporting

 Plants Status Reporting

 Maintenance Management

 Stores Inventory

 Purchase (excluding tender enquiry and order placement)

 Safety Event Reporting

The IIS-HWB Platform is RHEL Server 7.4, PostgreSQL version 9.2


Database and Front-end programs are in PHP.

8
Table of Contents
CHAPTER 1 ............................................................................................................12

INTRODUCTION .............................................................................. 12
Objective of Integrated Information System: ..................................................................................... 12

Scope: .................................................................................................................................................. 12

Block diagram of IIS-HWB ................................................................................................................... 13

IIS-HWB Project Software Architecture .............................................................................................. 14

CHAPTER 2 ............................................................................................................15

APPLICATION SOFTWARE .......................................................... 15


Tools & Technologies .......................................................................................................................... 15

IIS-HWB Software Block Diagram........................................................................................................ 16

Hardware and Software Resources..................................................................................................... 17

Hardware Specifications ..................................................................................................................... 17

CHAPTER 3 ............................................................................................................18

DATABASE DESCRIPTION ........................................................... 18


Introduction to PostgreSQL................................................................................................................. 18

Procedural Languages Support ........................................................................................................... 19

PostgreSQL Functions ......................................................................................................................... 19

CHAPTER 4 ............................................................................................................22

PHP DESCRIPTION ......................................................................... 22


Introduction to PHP ............................................................................................................................ 22

Canonical PHP tags.............................................................................................................................. 23

Short-open (SGML-style) tags ............................................................................................................. 23

9
PHP – Variable Types .......................................................................................................................... 24

PHP – Datatypes .................................................................................................................................. 24

CHAPTER 5 ............................................................................................................26

MODULE DESCRIPTION ............................................................... 26


Modules and Interaction..................................................................................................................... 26

Data flow Diagram .............................................................................................................................. 31

CHAPTER 6 ............................................................................................................32

OVERTIME AND UNDERTIME PROGRAM .............................. 32


Pre-Conditions to Calculate OT ........................................................................................................... 32

Input .................................................................................................................................................... 32

Processing ........................................................................................................................................... 32

Output ................................................................................................................................................. 32

Design of Over Time and Undertime Calculation Program................................................................. 33

Functionality Description .................................................................................................................... 37

Flowchart of Over Time and Undertime Calculation Program ........................................................... 38

Test Cases............................................................................................................................................ 39

PostgreSQL Functions for Overtime and Undertime .......................................................................... 55

PostgreSQL Functions for Overtime and Undertime Accumulation ................................................... 63

PostgreSQL Functions for Applying Overtime and Undertime ........................................................... 67

PostgreSQL Functions for Approval of Overtime and Undertime ...................................................... 69

PostgreSQL Functions for Applying C-Off ........................................................................................... 71

PostgreSQL Functions for Approval of C-Off ....................................................................................... 72

PostgreSQL Functions for C-Off Accumulation ................................................................................... 73

REFERENCES ................................................................................... 75

10
List of Figures

CHAPTER 1 ...........................................................................................................12

Fig 1.1 Block diagram of IIS-HWB.......................................................................13

Fig 1.2 IIS-HWB Project Software Architecture .....................................................14

CHAPTER 2 ...........................................................................................................15

Fig 2.1 Process Flow Diagram – Leave and Attendance Processing ......................16

CHAPTER 3 ...........................................................................................................18

CHAPTER 4 ...........................................................................................................22

CHAPTER 5 ...........................................................................................................26

Fig 5.1 Leave and Attendance Module ....................................................................31

CHAPTER 6 ...........................................................................................................32

Fig 6.1 Employee Overtime/Undertime Apply........................................................33

Fig 6.2 Employee Overtime/Undertime with Swipe Data .......................................34

Fig 6.3 Attendance OT/UT Approval ......................................................................35

Fig 6.4 Attendance OT/UT Approval with Employee Data ....................................36

Fig 6.5 Flowchart for OT/UT Calculation ...............................................................38

11
CHAPTER 1

INTRODUCTION

Objective of Integrated Information System:


The objective of Integrated Information System for HWB is to revamp existing

Integrated Information System (IIS) Application Software at Heavy Water Board

(Central Office) at Mumbai and Heavy Water Plants at Baroda, Kota, Manuguru,

Hazira, Thal, Talcher and Tuticorin.

Scope:
Integrated Information System for HWB (IIS-HWB) is being established in HWB

to support management functions of HWB and its Plants for information

dissemination within HWB. IIS-HWB is being developed to primarily provide a

HWB-wide integrated database of Human Resource, status of Projects undertaken

by the HWB and financial accounting functions in Heavy Water Plants and

Corporate Office of HWB with Open source platform (PHP, RHEL, PostgreSQL

and Reporting tools).

12
Block diagram of IIS-HWB

Fig 1.1 Block diagram of IIS-HWB

HWB Main Server and Backup Server is LAPP (Linux Apache PostgreSQL PHP)

Platform. There are 7 Plants of HWB which are connected to HWB Main Server

through HWB Net

13
IIS-HWB Project Software Architecture

Fig 1.2 IIS-HWB Project Software Architecture

IIS-HWB has 3-tier architecture. Database Server, Web Server and Client Tier.
A Client typically a web browser sends a request for a resource to the web server
and the web server collects the information from the database server and sends
back a response corresponding to the resource.

14
CHAPTER 2

APPLICATION SOFTWARE

The system provides menu driven application package with exhaustive


reports generation.

The application software is web based software to be installed at HWB Main


Server. This application software can be accessed by HWB and all Heavy Water
Plants.

Tools & Technologies

Platform : LAPP (Linux Apache PostgreSQL PHP)

OS : RHEL 7.4 Server

Database : PostgreSQL 9.2

Web Server : Apache 2.4

Scripting Language : PHP 5.4

Reports Tool : Reportico

DB Programming : Pl/PgSQL

Shell Scripts : Bourne Shell

15
IIS-HWB Software Block Diagram

Fig 2.1 Process Flow Diagram – Leave and Attendance Processing

16
Hardware and Software Resources
Main Servers : 02

Workstation (5-10 TB HDD) : 01

Rack : 02

UPS : 02

KVM Switch : 02

RHEL : 02

Hardware Specifications
Main Server Specs:

 Rack Model
 2 * Intel Xeon Gold 6148 Processor 64 bit 20 core @ 2.40 GHz or
better 27 MB cache
 Intel Mother Board with built in RAID 0/1 support for SAS drives
 256 GB RAM (32 GB * 8) DDR4 2666 MHz. Registered ECC
expandable to 512 GB
 2*1 TB SAS hot-plug drives, scope for adding 2 more drives.
 6 * 1.8 TB SAS hot-plug drives, scope for adding 2 more drives.
 A separate RAID controller for SAS supporting RAID 1+0, 5 and 6.
 2* Dual port gigabit ethernet card, at least two ports supporting
SAS/iSCSI connectivity
 Certified for Latest Redhat Server Edition
 Hot Plug and Redundant Power Supply
 DVD r/w drive

17
CHAPTER 3

DATABASE DESCRIPTION

IIS-HWB database environment is a Centralized Database System


located at HWB. Heavy Water Plants will use the Central database.

PostgreSQL 9.2 is employed in IIS-HWB as RDBMS. It is open


source product comply with SQL: 92 and SQL: 1999 standards.

Introduction to PostgreSQL

PostgreSQL is an open source relational Database Management System


(DBMS) developed by a worldwide team of volunteers. PostgreSQL is not
controlled by any corporation or other private entity and the source code is
available free of charge.

PostgreSQL runs on all major operating systems, including Linux, UNIX


(AIX, BSD, HP-UX, SGI IRIX, Mac OS X, Solaris, Tru64), and Windows. It
supports text, images, sounds, and video, and includes programming interfaces for
C / C++, Java, Perl, Python, Ruby, Tcl and Open Database Connectivity (ODBC).

PostgreSQL supports a large part of the SQL standard and offers many modern
features including the following:

 Complex SQL queries


 SQL Sub-selects
 Foreign keys
 Trigger

18
 Views
 Transactions
 Multiversion concurrency control (MVCC)
 Streaming Replication (as of 9.0)
 Hot Standby (as of 9.0)
PostgreSQL can be extended by the user in many ways. For example by adding
new:
 Data types
 Functions
 Operators
 Aggregate functions
 Index methods

Procedural Languages Support

PostgreSQL supports four standard procedural languages, which allows the


users to write their own code in any of the languages and it can be executed by
PostgreSQL database server. These procedural languages are - PL/pgSQL, PL/Tcl,
PL/Perl and PL/Python. Besides, other non-standard procedural languages like
PL/PHP, PL/V8, PL/Ruby, PL/Java, etc., are also supported.

PostgreSQL Functions

PostgreSQL functions, also known as Stored Procedures, allow to carry out


operations that would normally take several queries and round trips in a single
function within the database. Functions allow database reuse as other applications

19
can interact directly with stored procedures instead of a middle-tier or duplicating
code. Functions can be created in a language of choice like SQL, PL/pgSQL, C,
Python, etc.

Syntax
The basic syntax to create a function is as follows-

CREATE [OR REPLACE] FUNCTION function_name (arguments)


RETURNS return_datatype AS $variable_name$
DECLARE
declaration;
[...]
BEGIN
< function_body >
[...]
RETURN { variable_name | value }
END;
LANGUAGE plpgsql;

Where,
 function-name specifies the name of the function.
 [OR REPLACE] option allows modifying an existing function.
 The function must contain a return statement.

20
 RETURN clause specifies that data type to return from the function.
 The return_datatype can be a base, composite, or domain type, or
can reference
 the type of a table column.
 function-body contains the executable part.
 The AS keyword is used for creating a standalone function.
 Plpgsql is the name of the language that the function is implemented
in. Here, we Use this option for PostgreSQL, it can be SQL, C,
internal, or the name of a user defined Procedural language. For
backward compatibility, the name can be enclosed by single quotes.

21
CHAPTER 4

PHP DESCRIPTION

PHP started out as a small open source project that evolved as more and more
people found out how useful it was. Rasmus Lerdorf unleashed the first
version of PHP way back in 1994.

Introduction to PHP

 PHP is a recursive acronym for "PHP: Hypertext Preprocessor".


 PHP is a server side scripting language that is embedded in HTML. It is
used to manage dynamic content, databases, session tracking, even build
entire ecommerce sites.
 It is integrated with a number of popular databases, including MySQL,
PostgreSQL, Oracle, Sybase, Informix, and Microsoft SQL Server.
 PHP is pleasingly zippy in its execution, especially when compiled as
an Apache module on the Unix side. The MySQL server, once started,
executes even very complex queries with huge result sets in record-
setting time.
 PHP supports a large number of major protocols such as POP3, IMAP,
and LDAP. PHP4 added support for Java and distributed object
architectures (COM and CORBA), making n-tier development a
possibility for the first time.

22
 PHP is forgiving: PHP language tries to be as forgiving as possible.
 PHP Syntax is C-Like.

Canonical PHP tags

 The most universally effective PHP tag style is:


<?php...?>
 If this style is used then tags will always be correctly interpreted.

Short-open (SGML-style) tags

 Short or short-open tags look like this:


<?...?>
 Short tags are, as one might expect, the shortest option must do one of
two things
 to enable PHP to recognize the tags:
 Choose the --enable-short-tags configuration option when building PHP.
 Set the short_open_tag setting in php.ini file to on. This option must be
disabled to parse XML with PHP because the same syntax is used for
XML tags.

23
PHP – Variable Types

The main way to store information in the middle of a PHP program is by


using a variable.

Here are the most important things to know about variables in PHP.

 All variables in PHP are denoted with a leading dollar sign ($).
 The value of a variable is the value of its most recent assignment.
 Variables are assigned with the = operator, with the variable on the
left-hand side and the expression to be evaluated on the right.
 Variables can, but do not need, to be declared before assignment.
 Variables in PHP do not have intrinsic types - a variable does not
know in advance whether it will be used to store a number or a string
of characters.
 Variables used before they are assigned have default values.
 PHP does a good job of automatically converting types from one to
another when necessary.
 PHP variables are Perl-like.

PHP – Datatypes

PHP has a total of eight data types which we use to construct our variables:
 Integers: are whole numbers, without a decimal point, like 4195.
 Doubles: are floating-point numbers, like 3.14159 or 49.1.
 Booleans: have only two possible values either true or false.
 NULL: is a special type that only has one value: NULL.

24
 Strings: are sequences of characters, like 'PHP supports string operations.
 Arrays: are named and indexed collections of other values.
 Objects: are instances of programmer-defined classes, which can package
up both other kinds of values and functions that are specific to the class.

 Resources: are special variables that hold references to resources external


to PHP (such as database connections).

The first five are simple types, and the next two (arrays and objects) are
compound – the compound types can package up other arbitrary values of
arbitrary type, whereas the simple types cannot.

25
CHAPTER 5

MODULE DESCRIPTION

The Modules in the IIS-HWB are written in PHP Scripting Language,


which in turn includes HTML, Bootstrap and JavaScript Web Designing
Technologies. Each Module performs the specific task to support
management functions of HWB and its Plants for information dissemination
within HWB

The IIS-HWB consists of following main Modules:

• Human Resource Management System

• Finance & Accounts

• Project Monitoring & Reporting

Modules and Interaction


This system is used for storing Employee data, managing payrolls,
recruitment processes, transfer, Performance Related Information Scheme
(PRIS) Amount, Leaves, Pension, Loans & Advances, Medical Allowances
and keeping track of attendance records etc.

Finance & Accounts is used to approve pay orders, payments are


initiated, Approval of Loans, Interest Calculations, EMIs, Tour bills
settlement etc and all financial transfers are taken care under this module

26
Project Monitoring is used to check the status of all projects which are
undertaken by HWB and Heavy Water Plants

Introduction to Human Resource Management System Module

A Human Resource Management System is a form of HR software


that combines a number of systems and processes to ensure the easy
management of human resources, business processes and data. Human
Resources software is used by businesses to combine a number of necessary
HR functions, such as storing Employee data, managing payrolls,
recruitment processes, benefits administration, and keeping track of
attendance records. It ensures everyday Human Resources processes are
manageable and easy to access.

Human Resource Information Systems provide a means of acquiring,


storing, analyzing and distributing information to various stakeholders.

The function of human resources departments is administrative and


common to all organizations. Organizations may have formalized
selection, evaluation, and payroll processes. Management of "human
capital" progressed to an imperative and complex process. The HR function
consists of tracking existing Employee data which traditionally includes
personal histories, skills, capabilities, accomplishments, and salary. To
reduce the manual workload of these administrative activities, organizations
began to electronically automate many of these processes by introducing
specialized human resource management systems.

The HR management module is a component covering many other HR


aspects from application to retirement. The system records basic
demographic and address data, selection, training and development,
27
capabilities and skills management, compensation planning records and
other related activities. Leading edge systems provide the ability to "read"
applications and enter relevant data to applicable database fields, notify
employers and provide position management and position control. Human
resource management function involves the recruitment, placement,
evaluation, compensation, and development of the Employees of an
organization

Introduction to Finance & Accounts Module

Financial accounting is the field of accounting concerned with the


summary, analysis and reporting of financial transactions pertaining to a
business. This involves the preparation of financial statements available for
public consumption.

Financial accounting (or financial accountancy) is the field of


accounting concerned with the summary, analysis and reporting of financial
transactions pertaining to a business. This involves the preparation of
financial statements available for public consumption. Stockholders,
suppliers, banks, Employees, government agencies, business owners, and
other stakeholders are examples of people interested in receiving such
information for decision making purposes.

Systematic recording of transactions: basic objective of accounting is


to systematically record the financial aspects of business transactions (i.e.
book-keeping). These recorded transactions are later on classified and
summarized logically for the preparation of financial statements and for their
analysis and interpretation.

28
Ascertainment of result of above recorded transactions: accountant
prepares profit and loss account to know the result of business operations for
a particular period of time. If expenses exceed revenue then it is said that the
business is running under loss. The profit and loss account helps the
management and different stakeholders in taking rational decisions. For
example, if business is not proved to be remunerative or profitable, the cause
of such a state of affairs can be investigated by the management for taking
remedial steps.

Financial accounting is used to prepare accounting information for


people outside the organization or not involved in the day-to-day running of
the company; managerial accounting provides accounting information to
help managers make decisions to manage the business.

Introduction to Project Monitoring & Reporting Module

Project Monitoring refers to the process of keeping track of all


project-related metrics including team performance and task duration,
identifying potential problems and taking corrective actions necessary to
ensure that the project is within scope, on budget and meets the specified
deadlines.

Project monitoring is defined as a process which is performed to track


the progress of project execution so that potential problems can be identified
well in time for the taking of the corrective actions for the purpose of
controlling the execution of the project. It is a continuing function during
project implementation which provides management of an ongoing
development intervention with indications of the extent of progress and
achievement of objectives and progress in the use of allocated funds. It

29
provides information and ensures the use of such information by
management to assess project effects – both intentional and unintentional –
and their impact. It aims at determining whether or not the intended project
goals and objectives are being on the track.

Project monitoring is an integral part of the project management. It


provides understanding of the progress of the project so that appropriate
corrective actions can be taken when the performance deviates significantly
from the planned path. It consists of regular systematic collection and
analysis of information to track the progress of the project implementation
against pre-set targets and objectives. It is an important management tool
which, if used properly, provides continuous feedback on the project
implementation progress as well assists in the identification of potential
successes and constraints to facilitate timely decisions.

Timing and method of project monitoring are significant aspects of


the project management. Important steps in project monitoring include the
following.

Study of the project, its schedule, and costs.

Selection of the parameters to be monitored.

Selection of the frequency of reporting and its format.

Collection of data for the parameters being monitored.

Analysis of the data by using appropriate monitoring technique.

Presentation of the analyzed data and reporting it to the management.

Review of the presented data by the management for decision making.

30
Data flow Diagram

Fig 5.1 Leave and Attendance Module

31
CHAPTER 6

OVERTIME AND UNDERTIME PROGRAM

Pre-Conditions to Calculate OT
 Employee Master Data should be available.
 Shift Master Data should be available.
 Overtime and Undertime is calculated for current attendance month.
 Overtime hours worked will be considered if >= 1 hour prior to shift or
after the shift.
Input
 Enter required attendance date
 Enter Overtime or Undertime Reasons.
 Click on Apply
Processing
 Get Employee Details by Employee No..
 Get Swipe Details of entered attendance date.
 Calculate Work Hours of each day of current attendance month
 Add Overtime hours, if Overtime is >=1 and < 4 hours.
 Add Half day C-Off, if Overtime >= 4 hours and <= 8 hours.
 Add Full day C-Off, If Overtime >= 8 hours.
 Undertime is calculated when Work hours is less than Shift hours
 If Overtime or Undertime exists, then Approving authority is assigned
Output
After clicking on apply button the Overtime and Undertime is forwarded to
his approving authority for approval.

32
Design of Over Time and Undertime Calculation Program

Fig 6.1 Employee Overtime/Undertime Apply

33
Fig 6.2 Employee Overtime/Undertime with Swipe Data

34
Fig 6.3 Attendance OT/UT Approval

35
Fig 6.4 Attendance OT/UT Approval with Employee Data

36
Functionality Description

OVERTIME AND UNDERTIME APPROVAL PROGRAM

Input

Selection of desired Employee No.

Selection of desired OT/UT

Click on Approve

Processing

 Get Overtime or Undertime of Selected Employee


 Get Overtime or Undertime Reasons
 If Overtime, then Overtime hours are added to Selected Employee
 If Undertime, then Undertime is approved and gap is regularized

Output

After clicking on Approve button then, Overtime hours are added or


Undertime is approved and gap is regularized for selected Employee.

37
Flowchart of Over Time and Undertime Calculation Program
The processing of inputs and generation of the output is as per the following
flowchart.

Fig 6.5 Flowchart for OT/UT Calculation

38
Test Cases

System Test Cases

Test Case Test Case Prerequisites Test Exec Expected Actual Reference
No Description Procedure uted results Results to Defect
By Report Id
( for
failed
cases
alone)
1. Browser must be
HWB_STC Start the Available. 1. Enter * Heavy Water
_M10_01 "Login Page 2. HWB Server should be "http://local Board Login
of HWB" connected host" in Screen must be
Application. 3. Web server must be in Browser. opened.
running mode. 4. 2. Enter Couldn't
Database Server should be User connect to
in running mode. Credentials HWB with
5. Employee/ and "HWB
Recommending Database
Officer/Approving 3. Click on Server IP
Officer/Sanctioning Officer “Login address" error
must be available with Button”. message will
validity be displayed if

39
HWB Server
was not
connected.
HWB_STC Open This web page should be Click * Attendance
_M10_02 Attendance accessed by HWB Sites “Attendance Module must
Module only for the authorized user Module” be opened
1. Login user should be 1. Enter
HWB_STC Open IIS- from establishment section. Login * If the
_M10_03_ HWB Login 2. Employee Master data details validation is
1 Screen should be available 2. Click on successful
“Login Employee is
Button”. logged in
successfully.
HWB_STC Open Time Time Office Data Upload Click “Time * Time Office
_M10_03_ Office Data Screen must be accessed by Office Data Data Upload
2 Upload HWPs and HWB for Upload” Screen must be
Screen authorized users menu. opened.
HWB_STC Data Upload Time Office Data Upload Select * The
_M10_03_ Screen must be accessed by Swipe Data Attendance
3 HWPs and HWB file to Data file will
upload to be uploaded.
HWB
Server Message “File
Uploaded
Successfully!”i
s displayed

40
HWB_STC Validate Data Time Office Data Upload Don’t select * An error
_M10_03_ Upload file Screen must be accessed by any file to message "No
4 HWPs and HWB upload. file selected.
Click Please select
"Upload" file!!” must be
Button. displayed.
Employee Master and 1. Enter
HWB_STC Open IIS- Reporting Officer data Login * If the
_M10_04_ HWB Login should be available. details validation is
1 Screen 2. Click on successful
“Login Employee is
Button”. logged in
successfully.
HWB_STC Open Employee master and Click on Based on the
_M10_04_ Employee Employee OT/UT data “Apply logged in
2 Overtime/Un must be available OT/UT” Employee,
dertime Employee
screen name and
Employee No.
will be
displayed
HWB_STC Get Employee OT and UT data Enter * Swipe in time,
_M10_04_ Overtime/Un must be available required Swipe out time
3 dertime attendance and OT/UT
details date to view must be
OT/UT displayed.

41
HWB_STC Apply Employee OT and UT data 1. Enter * Employee
_M10_04_ Overtime/Un must be available Reason for Overtime or
4 dertime OT/UT Undertime is
screen applied.
2. Click
“Apply”
button
1. Employees, having the 1. Enter
HWB_STC Open IIS- role of leave Login * If the
_M10_05_ HWB Login recommendation. details validation is
1 Screen 2. Click on successful
“Login” Employee is
Button. logged in
successfully.
HWB_STC Open OT/UT Employee master and Click on OT/UT
_M10_05_ Approval Employee OT/UT data “Approve Approval
2 Menu must be available OT/UT” screen must be
menu displayed
1. Reporting Employees
HWB_STC Employee data should be available. Select * Employee No.,
_M10_05_ OT/ UT 2. Reporting Employees Reporting Employee
3 Approval should apply for OT/UT. Employee swipe details
Screen No. and OT/UT
with reasons
must be
displayed.

42
1. Reporting Employees
HWB_STC Select data should be available. 1. Select * Employee
_M10_05_ Employee for desired Overtime or
4 approval 2. Reporting Employees OT/UT for Undertime is
should apply for OT/UT. approval approved and
regularized.
2. Click
“Approve”
button
HWB_STC Close OT/UT OT/UT approval Screen Click * HWB Login
_M10_05_ approval must be active "Logout" web page will
5 Screen Button be displayed.

Note: * To be filled by tester at the time of system testing.

43
Integration Test Cases

Test Case Test Case Prerequisites Test Procedure Execu Expected Actua Reference to
No Descripti ted By results l Defect Report
on Result Id ( for failed
s cases alone)
1. Browser must be
HWB_ITC Start the Available. 1. Enter * Heavy Water
_M10_01 "Login 2. HWB Server should be "http://localhost Board Login
Page of connected " in Browser. Screen must
HWB" 3. Web server must be in be opened.
Applicatio 2. Enter User
running mode. Credentials and Couldn't
n. 4. Database Server should connect to
be in running mode. 3. Click on HWB with
5. Employee/ “Login Button”. "HWB
Recommending Database
Officer/Approving Server IP
Officer/Sanctioning address" error
Officer must be available message will
with validity be displayed
if HWB
Server was
not
connected.
HWB_ITC Open This web page should be Click * Attendance
_M10_02 Attendanc accessed by HWB Sites “Attendance Module must
e Module only for the authorized Module” be opened

44
user
1. Login user should be 1. Enter Login
HWB_ITC Open IIS- from establishment details * If the
_M10_03_ HWB section. 2. Click on validation is
1 Login 2. Employee Master data “Login Button”. successful
Screen should be available Employee is
logged in
successfully.
HWB_ITC Open Time Office Data Upload Click “Time * Time Office
_M10_03_ Time Screen must be accessed Office Data Data Upload
2 Office by HWPs and HWB for Upload” menu. Screen must
Data authorized users be opened.
Upload
Screen
HWB_ITC Data Time Office Data Upload Select Swipe * The
_M10_03_ Upload Screen must be accessed Data file to Attendance
3 by HWPs and HWB upload to HWB Data file will
Server be uploaded.
Message
“File
Uploaded
Successfully!
”is displayed

45
HWB_ITC Validate Time Office Data Upload Don’t select any * An error
_M10_03_ Data Screen must be accessed file to upload. message "No
4 Upload by HWPs and HWB Click "Upload" file selected.
file Button. Please select
file!!” must
be displayed.
Employee Master and 1. Enter Login
HWB_ITC Open IIS- Reporting Officer data details * If the
_M10_04_ HWB should be available. 2. Click on validation is
1 Login “Login Button”. successful
Screen Employee is
logged in
successfully.
HWB_ITC Open Employee master and Click on “Apply Based on the
_M10_04_ Employee Employee OT/UT data OT/UT” logged in
2 Overtime/ must be available Employee,
Undertime Employee
screen name and
Employee
No. will be
displayed
HWB_ITC Get Employee OT and UT Enter required * Swipe in
_M10_04_ Overtime/ data must be available attendance date time, Swipe
3 Undertime to view OT/UT out time and
details OT/UT must
be displayed.

46
HWB_ITC Apply Employee OT and UT 1. Enter Reason * Employee
_M10_04_ Overtime/ data must be available for OT/UT Overtime or
4 Undertime Undertime is
screen 2. Click applied.
“Apply” button
1. Employees, having the 1. Enter Login
HWB_ITC Open IIS- role of leave details * If the
_M10_05_ HWB recommendation. 2. Click on validation is
1 Login 2. Employee Master & “Login Button”. successful
Screen Reporting officer data Employee is
should be available logged in
successfully.
HWB_ITC OT/UT Employee master and Click on OT/UT
_M10_05_ Approval Employee OT/UT data “Approve Approval
2 Menu must be available OT/UT” menu screen must
be displayed
1. Reporting Employees
HWB_ITC Employee data should be available. Select * Employee
_M10_05_ OT/ UT 2. Reporting Employees Reporting No.,
3 Approval should apply for OT/UT. Employee No. Employee
Screen swipe details
and OT/UT
must be
displayed.
HWB_ITC Select Applied OT and UT data 1. Select desired * Employee
_M10_05_ Employee of an Employee must be OT/UT for Overtime is
4 for available approval approved.

47
approval
2. Click
“Approve”
button
HWB_ITC Close OT/UT approval Screen Click "Logout" * HWB Login
_M10_05_ OT/UT must be active Button web page will
5 approval be displayed.
Screen

Note: * To be filled by tester at the time of integration testing.

48
Unit Test Cases

Test Test Case Prerequisites Test Procedure Ex Expected Actual Results Referen
Case Description ecu results ce to
No ted Defect
By Report
Id ( for
failed
cases
alone)
1. Browser must be
HWB_ Start the "Login Available. 1. Enter * Heavy Water
UTC_M Page of HWB" 2. HWB Server "http://localhost Board Login
10_01 Application. should be connected " in Browser. Screen must
3. Web server must be opened.
2. Enter User
be in running mode. Credentials and Couldn't
4. Database Server connect to
should be in 3. Click on HWB with
running mode. “Login Button”. "HWB
5. Employee/ Database
Recommending Server IP
Officer/Approving address" error
Officer/Sanctioning message will
Officer must be be displayed
available with if HWB
validity Server was

49
not
connected.

HWB_ Open Attendance This web page Click * Attendance


UTC_M Module should be accessed “Attendance Module must
10_02 by HWB Sites only Module” be opened
for the authorized
user
1. Login user should 1. Enter Login
HWB_ Open IIS-HWB be from details * If the
UTC_M Login Screen establishment 2. Click on validation is
10_03_ section. “Login Button”. successful
1 2. Employee Master Employee is
data should be logged in
available successfully.

HWB_ Open Time Office Time Office Data Click “Time * Time Office
UTC_M Data Upload Upload Screen must Office Data Data Upload
10_03_ Screen be accessed by Upload” menu. Screen must
2 HWPs and HWB be opened.
for authorized users

50
HWB_ Data Upload Time Office Data Select Swipe * The
UTC_M Upload Screen must Data file to Attendance
10_03_ be accessed by upload to HWB Data file will
3 HWPs and HWB Server be uploaded.
Message
“File
Uploaded
Successfully!
”is displayed
Employee Master 1. Enter Login
HWB_ Open IIS-HWB and Reporting details * If the
UTC_M Login Screen Officer data should 2. Click on validation is
10_04_ be available. “Login Button”. successful
1 Employee is
logged in
successfully.
HWB_ Open Employee Employee master Click on “Apply Based on the
UTC_M Overtime/Undertim and Employee OT/UT” logged in
10_04_ e screen OT/UT data must Employee,
2 be available Employee
name and
Employee
No. will be
displayed

51
HWB_ Get Employee OT and Enter required * Swipe in
UTC_M Overtime/Undertim UT data must be attendance date time, Swipe
10_04_ e details available to view OT/UT out time and
3 OT/UT must
be displayed.
HWB_ Validate Swipe date must be Enter required * Attendance
UTC_M Attendance Date available in data attendance date date must be
10_04_ base YYYY-MM-
4 DD format. It
should not
accept
characters.
Based on the
HWB_ Employee Employee master logged in Employee
UTC_M Overtime/Undertim and Employee Employee, Name and
10_04_ e screen OT/UT data must his/her name Employee
5 be available and Employee Number must
No. will be be displayed
displayed
HWB_ Apply Employee OT and 1. Enter Reason * Employee
UTC_M Overtime/Undertim UT data must be for OT/UT Overtime or
10_04_ e screen available Undertime is
4 2. Click applied.
“Apply” button
HWB_ Validate Reason Reason Description Enter Reason * Reason can
UTC_M must be available in for OT/UT be of 50
52
10_04_ database characters.
5
1. Employees, 1. Enter Login
HWB_ Open IIS-HWB having the role of details * If the
UTC_M Login Screen leave 2. Click on validation is
10_05_ recommendation. “Login Button”. successful
1 2. Employee Master Employee is
& Reporting officer logged in
data should be successfully.
available
HWB_ OT/UT Approval Employee master Click on OT/UT
UTC_M Menu and Employee “Approve Approval
10_05_ OT/UT data must OT/UT” menu screen must
2 be available be displayed
1. Reporting
HWB_ Employee OT/ UT Employees data Select * Employee
UTC_M Approval Screen should be available. Reporting No.,
10_05_ 2. Reporting Employee No. Employee
3 Employees should swipe details
apply for OT/UT. and OT/UT
must be
displayed.
HWB_ Select Employee Applied OT and UT 1. Select desired * Employee
UTC_M for approval data of an OT/UT for Overtime is
10_05_ Employee must be approval approved.
4 available
2. Click

53
“Approve”
button

HWB_ Close OT/UT OT/UT approval Click "Logout" * HWB Login


UTC_M approval Screen Screen must be Button web page will
10_05_ active be displayed.
5

Note: * To be filled by tester at the time of unit testing.

54
PostgreSQL Functions for Overtime and Undertime

CREATE OR REPLACE FUNCTION iismasterdb.a_ot_ut_calculations

( param_site_code numeric , param_shift_start_time timestamp with


time zone, param_shift_end_time timestamp with time zone,
param_modified_userid numeric)

RETURNS boolean AS $$

DECLARE
max_overtime numeric(4,2) := 6.00;
min_overtime numeric(4,2) := 1.00;
max_balance numeric(3,0) := 120;
min_adjusted_ot_ut numeric := 0 ;
no_ot_ut numeric(1,0) := 0;
ot_ut_not_applied numeric(1,0) := 1;
ot_approved numeric(1,0) := 3;
ut_coff_approved numeric(1,0) := 3;
gap_reason_undertime numeric(2,0) := 1;
gap_reason_overtime numeric(2,0) := 2;
no_coff numeric(1,0) := 0;
min_ot_hrs numeric(4,2) := 1.0;
min_coff_hrs numeric(4,2) := 4.00;
coff_halfday numeric(2,1) := 0.5;
max_coff_hrs numeric(4,2) := 8.00;
coff_fullday numeric(2,1) := 1.0;
coff_approved numeric(1,0) := 6;
BEGIN

-- Roll back

55
UPDATE iismasterdb.att_ot_ut_dtl SET work_hours= 0.0, overtime
= 0.0, undertime = 0.0, balance_120min = 120, approving_auth = 0,
ot_status = no_ot_ut, ut_status = no_ot_ut ,coff_status = 0.0,
modified_userid = param_modified_userid, modified_timestamp =
current_timestamp ,reason_code = null WHERE (ot_status <=
ot_ut_not_applied or ut_status <= ot_ut_not_applied) and (ot_status <
ot_approved or ut_status < ut_coff_approved ) and
site_code=param_site_code and (in_time between
param_shift_start_time and param_shift_end_time) and (out_time
between param_shift_start_time and param_shift_end_time);

UPDATE iismasterdb.att_ot_ut SET total_ot = 0.0 , total_ut = null,


modified_userid=param_modified_userid,modified_timestamp=curre
nt_timestamp , total_coff = null WHERE site_code =
param_site_code ;

UPDATE iismasterdb.att_ot_ut_dtl SET adjusted_ot = NULL ,


remaining_undertime = null WHERE site_code = param_site_code ;

-- CALCULATION OF WORK HOURS

UPDATE iismasterdb.att_ot_ut_dtl set WORK_HOURS =


to_number(extract(hours from (out_time - in_time)) || '.' ||
extract(minute from (out_time - in_time)),'09D99'),modified_userid =
param_modified_userid, modified_timestamp = current_timestamp
WHERE (in_time between param_shift_start_time and

56
param_shift_end_time) and (out_time between param_shift_start_time
and param_shift_end_time) and site_code = param_site_code;

-- CALCULATION OF OVERTIME

UPDATE iismasterdb.att_ot_ut_dtl SET overtime = work_hours -


shift_hours, modified_userid = param_modified_userid,
modified_timestamp = current_timestamp WHERE work_hours >=
(shift_hours + min_overtime) and in_time <= shift_start_time and
out_time >=shift_end_time and (in_time between
param_shift_start_time and param_shift_end_time) and (out_time
between param_shift_start_time and param_shift_end_time) and
site_code = param_site_code;

UPDATE iismasterdb.att_ot_ut_dtl SET OVERTIME =


,modified_userid = param_modified_userid, modified_timestamp =
current_timestamp WHERE work_hours < (shift_hours +
min_overtime) and (in_time between param_shift_start_time and
param_shift_end_time) and (out_time between param_shift_start_time
and param_shift_end_time) and site_code = param_site_code;

UPDATE iismasterdb.att_ot_ut_dtl SET overtime = overtime


WHERE overtime >= min_ot_hrs and overtime < min_coff_hrs and
site_code = param_site_code and (in_time between
param_shift_start_time and param_shift_end_time) and (out_time
between param_shift_start_time and param_shift_end_time);

57
-- CALCULATION OF UNDERTIME

UPDATE iismasterdb.att_ot_ut_dtl SET undertime = shift_hours -


work_hours,modified_userid=param_modified_userid,modified_times
tamp = current_timestamp WHERE work_hours < shift_hours and
(in_time between param_shift_start_time and param_shift_end_time)
and (out_time between param_shift_start_time and
param_shift_end_time) and site_code = param_site_code;

UPDATE iismasterdb.att_ot_ut_dtl SET undertime = 0


,modified_userid = param_modified_userid, modified_timestamp =
current_timestamp WHERE work_hours >= shift_hours and (in_time
between param_shift_start_time and param_shift_end_time) and
(out_time between param_shift_start_time and param_shift_end_time)
and site_code = param_site_code;

UPDATE iismasterdb.att_ot_ut_dtl SET undertime = shift_hours -


(to_number(extract(hours from ( out_time))|| '.' || extract(minute from
(out_time )),'09d99') - (to_number(extract(hours from (
shift_start_time))|| '.' || extract(minute from (shift_start_time
)),'09d99')), modified_userid = param_modified_userid,
modified_timestamp = current_timestamp WHERE (work_hours <
shift_hours or work_hours > shift_hours) and (in_time between
param_shift_start_time and param_shift_end_time) and (out_time
between param_shift_start_time and param_shift_end_time) and
(in_time < shift_start_time or in_time > shift_start_time )and
out_time < shift_end_time and site_code = param_site_code;

58
UPDATE iismasterdb.att_ot_ut_dtl set undertime = shift_hours -
(to_number(extract(hours from ( shift_end_time))|| '.' || extract(minute
from (shift_end_time )),'09d99') - (to_number(extract(hours from (
in_time))|| '.' || extract(minute from (in_time
)),'09d99')),modified_userid = param_modified_userid,
modified_timestamp = current_timestamp WHERE (work_hours <
shift_hours or work_hours > shift_hours) and (in_time between
param_shift_start_time and param_shift_end_time) and (out_time
between param_shift_start_time and param_shift_end_time) and
in_time > shift_start_time and (out_time > shift_end_time or
out_time < shift_end_time ) and site_code = param_site_code;

--CALCULATION OF WORK_HRS_MINUS_LUNCH

UPDATE iismasterdb.att_ot_ut_dtl SET work_hrs_minus_lunch =


work_hours - double precision '0.3' ,modified_userid =
param_modified_userid, modified_timestamp = current_timestamp
WHERE (in_time between param_shift_start_time and
param_shift_end_time) and (out_time between param_shift_start_time
and param_shift_end_time) and site_code = param_site_code;

--UPDATION OF OT STATUS

UPDATE iismasterdb.att_ot_ut_dtl SET ot_status =


ot_ut_not_applied ,modified_userid = param_modified_userid,
modified_timestamp = current_timestamp , reason_code =

59
gap_reason_overtime WHERE overtime > 0 and (in_time between
param_shift_start_time and param_shift_end_time) and (out_time
between param_shift_start_time and param_shift_end_time) and
site_code = param_site_code;

UPDATE iismasterdb.att_ot_ut_dtl SET ot_status = no_ot_ut


,modified_userid = param_modified_userid, modified_timestamp =
current_timestamp WHERE overtime = 0 and (in_time between
param_shift_start_time and param_shift_end_time) and (out_time
between param_shift_start_time and param_shift_end_time) and
site_code = param_site_code;

--UPDATION OF UT STATUS

UPDATE iismasterdb.att_ot_ut_dtl SET ut_status =


ot_ut_not_applied ,modified_userid = param_modified_userid,
modified_timestamp = current_timestamp , reason_code =
gap_reason_undertime WHERE undertime > 0 and (in_time between
param_shift_start_time and param_shift_end_time) and (out_time
between param_shift_start_time and param_shift_end_time) and
site_code = param_site_code;

UPDATE iismasterdb.att_ot_ut_dtl SET ut_status = no_ot_ut ,


modified_userid =param_modified_userid, modified_timestamp =
current_timestamp WHERE undertime = 0 and (in_time between
param_shift_start_time and param_shift_end_time) and (out_time

60
between param_shift_start_time and param_shift_end_time) and
site_code = param_site_code;

--ASSIGNING APRROVING AUTHORITY

UPDATE iismasterdb.att_ot_ut_dtl dtl SET approving_auth = (select


approving_auth from iismasterdb.Employee_master where emp_no
=dtl.emp_no),modified_userid=param_modified_userid,modified_tim
estamp = current_timestamp WHERE (overtime > 0 or undertime > 0
) and (in_time between param_shift_start_time and
param_shift_end_time) and (out_time between param_shift_start_time
and param_shift_end_time) and site_code = param_site_code;

--CALCULATION OF COFF CREDIT

UPDATE iismasterdb.att_ot_ut_dtl SET coff_credit = coff_halfday


,overtime = 0 WHERE overtime >= min_coff_hrs and overtime <
max_coff_hrs andsite_code = param_site_code and emp_no =
emp_no and (in_time between param_shift_start_time and
param_shift_end_time) and (out_time between
param_shift_start_time and param_shift_end_time) ;

UPDATE iismasterdb.att_ot_ut_dtl SET coff_credit = coff_fullday ,


overtime = 0 WHERE overtime >= max_coff_hrs and site_code =
param_site_code and emp_no = emp_no and (in_time between
param_shift_start_time and param_shift_end_time) and (out_time
between param_shift_start_time and param_shift_end_time) ;
61
--UPDATION OF COFF STATUS

UPDATE iismasterdb.att_ot_ut_dtl SET coff_status = no_coff


,modified_userid = param_modified_userid, modified_timestamp =
current_timestamp , reason_code = gap_reason_overtimeWHERE
coff_credit <= 1 and (in_time between param_shift_start_time and
param_shift_end_time) and (out_time between param_shift_start_time
and param_shift_end_time) and site_code = param_site_code;

RETURN true;

END;

$$ LANGUAGE plpgsql VOLATILE ;

62
PostgreSQL Functions for Overtime and Undertime Accumulation

CREATE OR REPLACE FUNCTION


iismasterdb.PER_MONTH_CALCULATIONS

(param_site_code numeric ,param_shift_start_time timestamp with time


zone, param_shift_end_time timestamp with time
zone,param_modified_userid numeric)

RETURNS BOOLEAN AS $$

DECLARE
min_ot_hrs numeric(4,2) := 1.0;
max_ot_hrs numeric(4,2) := 3.59;
min_coff_hrs numeric(4,2) := 4.00;
coff_halfday numeric(2,1) := 0.5;
max_coff_hrs numeric(4,2) := 8.00;
coff_fullday numeric(2,1) := 1.0;
no_ot_ut numeric(1,0) := 0;
ot_ut_not_applied numeric(1,0) := 1;
ot_approved numeric(1,0) := 3;
ut_coff_approved numeric(1,0) := 3;
coff_approved numeric(1,0) := 6;
BEGIN

--ROLLBACK

UPDATE iismasterdb.att_ot_ut_dtl SET approving_auth =


0.0,adjusted_ot = null , remaining_undertime = null,modified_userid

63
=param_modified_userid,modified_timestamp=current_timestamprea
son_code = null WHERE (ot_status <= ot_ut_not_applied or
ut_status <= ot_ut_not_applied) and(ot_status < ot_approved or
ut_status < ut_coff_approved ) and (in_time between
param_shift_start_time and param_shift_end_time) and (out_time
between param_shift_start_time and param_shift_end_time) and
site_code = param_site_code ;

UPDATE iismasterdb.att_ot_ut SET total_ot = 0.0 ,total_ut = 0.0 ,


modified_userid = param_modified_userid, modified_timestamp =
current_timestamp ,total_coff = 0.0 WHERE site_code =
param_site_code and pert_month = extract (month from
param_shift_start_time) andpert_year = extract (year from
param_shift_start_time) ;

--CALCULATION OF OT PER MONTH

UPDATE iismasterdb.att_ot_ut dt SET total_ot = (select


sum(overtime) from iismasterdb.att_ot_ut_dtl where emp_no =
dt.emp_no and (in_time between param_shift_start_time and
param_shift_end_time) and

(out_time between param_shift_start_time andparam_shift_end_time)


and ot_status = ot_approved), modified_userid =
param_modified_userid, modified_timestamp = current_timestamp
WHERE site_code = param_site_code and pert_month = extract

64
(month from param_shift_start_time) and pert_year = extract (year
from param_shift_start_time);

--CALCULATION OF UT PER MONTH

UPDATE iismasterdb.att_ot_ut dt SET total_ut = (select


sum(undertime) from iismasterdb.att_ot_ut_dtl where emp_no =
dt.emp_no and (in_time between param_shift_start_time and
param_shift_end_time) and (out_time between param_shift_start_time
and param_shift_end_time) and ut_status <
ut_coff_approved),modified_userid = param_modified_userid,
modified_timestamp = current_timestamp WHERE site_code =
param_site_code and pert_month = extract (month from
param_shift_start_time) and pert_year = extract (year from
param_shift_start_time);

--CALCULATION OF TOTAL COFF

UPDATE iismasterdb.att_ot_ut dt SET total_coff = (select


sum(coff_credit) from iismasterdb.att_ot_ut_dtl where emp_no =
dt.emp_no and (in_time between param_shift_start_time and
param_shift_end_time) and (out_time between param_shift_start_time
and param_shift_end_time) and coff_status = coff_approved),
modified_userid = param_modified_userid, modified_timestamp =
current_timestamp WHERE site_code = param_site_code and
65
pert_month = extract (month from param_shift_start_time) and
pert_year = extract (year from param_shift_start_time);

RETURN true;

END;

$$ LANGUAGE PLPGSQL VOLATILE ;

66
PostgreSQL Functions for Applying Overtime and Undertime

CREATE OR REPLACE FUNCTION iismasterdb.a_apply_ot_ut

(param_site_code numeric, param_emp_no numeric ,


param_reason_code numeric , param_shift_start_time timestamp with
time zone, param_shift_end_time timestamp with time
zone,param_modified_userid numeric)

RETURNS BOOLEAN AS $$

DECLARE
ot_ut_applied numeric(1,0) := 2;
gap_reason_ot numeric(2,0) := 2;

BEGIN

if (param_reason_code = gap_reason_ot) then

UPDATE iismasterdb.att_ot_ut_dtl SET ot_status = ot_ut_applied ,


reason_code = param_reason_code , modified_userid =
param_modified_userid, modified_timestamp = current_timestamp
WHERE emp_no = param_emp_no and (in_time between
param_shift_start_time and param_shift_end_time) and (out_time
between param_shift_start_time and param_shift_end_time) and
site_code = param_site_code;

else

67
UPDATE iismasterdb.att_ot_ut_dtl SET ut_status = ot_ut_applied ,

reason_code = param_reason_code , modified_userid =


param_modified_userid, modified_timestamp = current_timestamp
WHERE emp_no = param_emp_no and (in_time between
param_shift_start_time and param_shift_end_time) and (out_time
between param_shift_start_time and param_shift_end_time) and
site_code = param_site_code;

end if;

RETURN TRUE;

END;

$$ LANGUAGE PLPGSQL VOLATILE;

68
PostgreSQL Functions for Approval of Overtime and Undertime

CREATE OR REPLACE FUNCTION iismasterdb.A_APPROVE_OT_ut

(param_site_code numeric , param_emp_no numeric ,


param_ot_ut_status numeric , param_reason_code
numeric,param_shift_start_time timestamp with time zone,
param_shift_end_time timestamp with time
zone,param_modified_userid numeric)

RETURNS BOOLEAN AS $$

DECLARE

gap_reason_ot numeric(2,0) := 2;

BEGIN

--param_ot_ut_status should 3 or 4

--3 = OT APPROVED, 4 = OT REJECTED

--3 = UT SETTLED WITH GAP REASON, 4 = REJECTED - UT


SETTLEMENT WITH GAP REASONS

if (param_reason_code = gap_reason_ot) then

UPDATE iismasterdb.att_ot_ut_dtl SET ot_status =


param_ot_ut_status ,modified_userid = param_modified_userid,
modified_timestamp = current_timestamp WHERE emp_no =
param_emp_no and (in_time between param_shift_start_time and

69
param_shift_end_time) and (out_time between param_shift_start_time
and param_shift_end_time) and site_code = param_site_code;

else

UPDATE iismasterdb.att_ot_ut_dtl SET ut_status =


param_ot_ut_status ,modified_userid = param_modified_userid,
modified_timestamp = current_timestamp WHERE emp_no =
param_emp_no and (in_time between param_shift_start_time and
param_shift_end_time) and (out_time between param_shift_start_time
and param_shift_end_time) and site_code = param_site_code;

end if;

RETURN TRUE;

END;

$$ LANGUAGE PLPGSQL VOLATILE;

70
PostgreSQL Functions for Applying C-Off

CREATE OR REPLACE FUNCTION iismasterdb.a_apply_coff


(param_emp_no numeric, param_reason_code numeric ,
param_site_code numeric ,param_shift_start_time timestamp with
time zone, param_shift_end_time timestamp with time
zone,param_modified_userid numeric)
RETURNS BOOLEAN AS $$

DECLARE
coff_applied numeric(1,0) := 5;
min_coff_hrs NUMERIC(4,2) := 4.00;
coff_halfday numeric(2,1) := 0.5;
max_coff_hrs NUMERIC(4,2) := 8.00;
coff_fullday numeric(2,1) := 1.0;

BEGIN

UPDATE iismasterdb.att_ot_ut_dtl SET coff_status = coff_applied ,


reason_code = param_reason_code , modified_userid =
param_modified_userid, modified_timestamp = current_timestamp
WHERE emp_no = param_emp_no and (in_time between
param_shift_start_time and param_shift_end_time) and (out_time
between param_shift_start_time and param_shift_end_time) and
site_code = param_site_code;
RETURN TRUE;
END;
$$ LANGUAGE PLPGSQL VOLATILE;

71
PostgreSQL Functions for Approval of C-Off

CREATE OR REPLACE FUNCTION iismasterdb.a_approve_coff

(param_emp_no numeric, param_reason_code numeric ,


param_site_code numeric ,param_shift_start_time timestamp with
time zone, param_shift_end_time timestamp with time
zone,param_modified_userid numeric)

RETURNS BOOLEAN AS $$

DECLARE

coff_approved numeric(1,0) := 6;

BEGIN

UPDATE iismasterdb.att_ot_ut_dtl SET coff_status = coff_approved ,


reason_code = param_reason_code , modified_userid =
param_modified_userid, modified_timestamp = current_timestamp
WHERE emp_no = param_emp_no and (in_time between
param_shift_start_time and param_shift_end_time) and (out_time
between param_shift_start_time and param_shift_end_time) and
site_code = param_site_code ;

RETURN TRUE;

END;

$$ LANGUAGE PLPGSQL VOLATILE;

72
PostgreSQL Functions for C-Off Accumulation

CREATE OR REPLACE FUNCTION iismasterdb.update_coff

(param_emp_no numeric,param_site_code numeric,param_pert_year


numeric,param_pert_month numeric, param_coff
numeric,param_pay_year numeric,param_pay_month
numeric,param_modified_userid numeric)

RETURNS BOOLEAN AS $$

BEGIN

UPDATE iismasterdb.att_ot_ut dt SET total_coff = total_coff + param_coff


, modified_userid = param_modified_userid WHERE emp_no =
param_emp_no and site_code = param_site_code and pert_month =
param_pert_month and pert_year = param_pert_year and pay_year =
param_pay_year and pay_month = param_pay_month ;

RETURN TRUE;

END;

$$ LANGUAGE PLPGSQL VOLATILE;

73
CONCLUSION

The IIS-HWB Project is Design and Development to support management


functions of HWB and its Plants for information dissemination within HWB. IIS-
HWB is being developed to primarily provide a HWB-wide integrated database of
Human Resource, status of Projects undertaken by the HWB and financial
accounting functions in Heavy Water Plants and Corporate Office of HWB.

Over Time/ Under Time Calculation Program is one of the utilities in


Human Resource Management System Module. It is used to calculate the
Overtime and Undertime of an Employee. It allows Employee to get Approvals of
Overtime and Undertime regularization. This module is written in PHP Scripting
Language, which in turn consists of HTML, Bootstrap and Java Script Web
Designing Technologies.

74
REFERENCES

http://www.w3schools.org

http://www.php.net

http://www.tutorialspoint.com - POSTGRESQL

PHP Manual by,

Mehdi Achour

Friedhelm Betz

Antony Dovgal

75

Potrebbero piacerti anche