View
219
Download
0
Category
Preview:
Citation preview
7/28/2019 Purchase Process System
1/71
1.0 INTRODUCTION
1.1 Objective or scope of the project
The project entitled PURCHASE PROCESSING SYSTEM is a material purchase
based project. This project is helpful for maintaining the purchase management system of
the company. The project includes information of the suppliers who supplies the material
for the company that totally based on the product requirement and material availability of
the company. The company always needs to maintain a particular amount of stock in the
company. The purchase Indent (order) also needs to maintain the company for which
Indent Confirmation is required. Were the company will offer purchase Indent so as to
supply the required stock to the company. The project includes Modules Supplier
Information, Material Information, Stock information, Purchase Indent, Indent
Confirmation. The project is developed using Visual Basic.6.0 as Front End and SQL
Server 7.0 as Back End.
Modules In this Project
Supplier
Material Information
Stock Information
Purchase Indent
Indent Confirmation
1.2 Need for computerized system
The main aim of developing the Purchase Process System is to maintain
the companies day today transaction related to companies purchase and
production the system now the company is following its transaction is through
writing. For bring cost effective system, a computerized system must be
1
7/28/2019 Purchase Process System
2/71
socially and politically acceptable. To be cost effective, a new software
system must provide the same services and information as the whole system
using the less time and personnel, or it must provide services and information
that were impractical without the new system. In manual system there are lots
of difficulties faced by the organization .so to solve this problem we thus
proposed an computerization of the system.
3 Salient features of the system
The proposed software has the following essential features:
The system uses VISUAL BASIC 6.0 as the front-end tool for user
interaction. And SQL Server as Back End
The system provides security for using the data.
The software maintains different levels of security like Login, Password
and Designation.
The software is developed in VISUAL BASIC 6.0 and was tested for its
successful working.
Records can be processed, sequentially, randomly or dynamically.
2
7/28/2019 Purchase Process System
3/71
2.0 BACKGROUND STUDY
After analyzing the whole system we are able to understood the company require agood and fast programming language with high security level database. The company is not
having any proper networking system customer or administrator has to approach several
departments in order to get any information. The company has allotted separate staffs for
each section. Because of this the company is maintaining separate books and files for all
sections.
The existing system is manual. Manual system has lot of limitations. The management is
they have to spend a lot time for searching and selecting the exact records and the
particular details of each and every item of the firm. If the Boss Of the company asks for a
Particular detail of an Item or stock details then they have to first find out the Register year
and month of sales or purchase, supplier Id or name to the find out the details. The
company is spending a huge amount towards maintaining staffs, files and services. As
everyone knows that today customer service is very important in order to flourish in this
competitive world. So the company is having problem in order to keep records and satisfy
the customer.
3.0 SELECTION OF ORGANIZATION
Digital Dreams is one of the leading wholesale Computer and Computer
Peripherals Distributing Company at Palakkad. It has 10 years experience in this field, and
deal with more than 150 clients in Palakkad and Thrissur Districts. More than 20 dedicated
staffs working in this firm. Digital Dreams provide all Hardware equipments sales and
services. The company distributes the hardware equipments for the leading IT Companies,
the main companies are HCL, IBM, INTEL, LG, SAMSUNG, MERCURY, CANON etc.
The main customers are Retail Distributors, Software Companies, industrial Companies,
and other business enterprises. The main advantages are to maintain good customer
relationship and good services.
3
7/28/2019 Purchase Process System
4/71
4.0 PROBLEM FORMULATION
4.1 Main objective
A business may have several departments such as Supplier, Material Information,,
Stock Information, Purchase Indent, Indent Confirmation. They can use various means to
keep its operation records. The data of every driver are stored in a standardized format. It is
this systematic organization of data.
Softwares that are used to design this project include Visual basic 6.0 for all
connection to and between database with the support of MS-SQL Server 7.0 for storage
and retrieval of data.
The main purpose of this project is manage and maintain the purchase processing
system that is ongoing now, which makes the work easier and to maintain accuracy. This
project is designed so, as to be handled by any user who may or may not be aware of
computer.
4.2 Methodology
Methodology fundamentally attempts to do the following.
Improve productivity of analysis and programmers.
Improve documentation and subsequent maintenance and enhancements.
Cut down drastically on cost over runs and delays.
Improves communication among the users, analyst, designer, and programmer.
Standardize the approach the analysis and design.
Simplify design by segmentation.
4.3 Platform
This specifies the minimum hardware and Software requirements that
are needed to develop and implement this project. This would help the
4
7/28/2019 Purchase Process System
5/71
management to understand the minimum hardware and software
required to use the developed product effectively.
HARDWARE REQUIREMENTS
Processor : Pentium II To 1V , Celeron or AMD
CPU clock : 1 GHZ
Memory : 256 MB
Hard Disk : 40 GB
Cache Memory : 512 KB
Monitor : 21 inch
Keyboard : Sandard 106 key
Mouse : Any mouse suitable for Windows
SOFTWARE REQUIREMENTS
Operating System : Windows 2000
Front End : VISUAL BASIC 6.0
Back End : SQL Server 7.0
Documentation : Microsoft Word.
ABOUT FRONT END - VISUAL BASIC 6.0
Visual Basic is a structured programming language and a complete application
development environment, all in a package. As a programming language, Visual Basic
provides tools to develop computer applications of all varieties-small, large, simple,
5
7/28/2019 Purchase Process System
6/71
complex, single purpose or multifaceted. The programmer has to plan and write the code
that guides the computer through basic activities, such as input and output data storage,
calculations and decisions.
Microsoft Visual Basic, the fastest and easiest way to create applications for
Microsoft Windows. Whether you are an experienced professional or brand new to
Windows programming, Visual Basic provides you with a complete set of tools to simplify
rapid application development.
Data access features allow you to create databases, front-end applications and
scalable server-side components for most popular database formats, including Microsoft
SQL Server and other enterprise-level databases.
ActiveX technologies allow you to use the functionality provided by other
applications, such as Microsoft Word Processor, Microsoft Excel spreadsheet and other
Windows applications. You can even automate applications and objects created using the
Professional or Enterprise editions of Visual Basic.
Internet capabilities make it easy to provide access to documents and applications
across the Internet or Intranet from within your application, or to create Internet server
applications.
SQL-SERVER 7.0
The SQL-Server 7.0 database from Microsoft Corporation is a cooperative server
and open database used to support mission critical application. It is fully portable to more
than 80 distinct hardware and operating system platforms, room development system,
mainframe and super computer.
These platforms are Unix, VMS, MVS, VM, HP, MPE/XL, OS/2, NT, Windows-95
and Novell NetWare. This portability enables to select SQL Server database server
platform that meet current and future needs without effecting already existing applications.
In practice it provides an asset of the more or the less flexible and sophisticated
tools for handling information. We can use these tools for handling information and define
a database query, secure data from public access, communicate within a networks exports
and imports data because it gives so much control over your data
6
7/28/2019 Purchase Process System
7/71
5.0 SYSTEM ANALYSIS AND DESIGN
5.1 Fact finding
System Analysis is the process of totally of understanding the current system by
gathering and interpreting facts diagnosing problems and using the facts to improve the
current system. In the analysis phase we must thoroughly understand the old system and
determine how computers can best be used to make its operations more effective.
5.2 Feasibility analysis
After problem is clearly understood and solutions are proposed the next steps is to conduct
the feasibility study which is the part of system analysis. The main objective of this study is
to determine whether the proposed system is feasible or not. The feasibility of a project can
be ascertained in terms of technical factors, economic factors, or both. A feasibility study is
documented with a report showing all the ramifications of the project. In project finance, the
pre-financing work (sometimes referred to as due diligence) is to make sure there is no "dry
rot" in the project and to identify project risks ensuring they can be mitigated and managed in
addition to ascertaining "debt service" capability.
Technical Feasibility
Technical feasibility refers to the ability of the process to take advantage of the current state
of the technology in pursuing further improvement. The technical capability of the personnel as
well as the capability of the available technology should be considered. Technology transfer
between geographical areas and cultures needs to be analyzed to understand productivity loss (or
gain) due to differences.
Managerial Feasibility
Managerial feasibility involves the capability of the infrastructure of a process to achieve
and sustain process improvement. Management support, employee involvement, and commitment
are key elements required to ascertain managerial feasibility.
7
7/28/2019 Purchase Process System
8/71
Economic Feasibility
This involves the feasibility of the proposed project to generate economic benefits. A
benefit-cost analysis and a breakeven analysis are important aspects of evaluating the economic
feasibility of new industrial projects. The tangible and intangible aspects of a project should betranslated into economic terms to facilitate a consistent basis for evaluation.
Financial Feasibility
Financial feasibility should be distinguished from economic feasibility. Financial
feasibility involves the capability of the project organization to raise the appropriate funds needed
to implement the proposed project. Project financing can be a major obstacle in large multi-party
projects because of the level of capital required. Loan availability, credit worthiness, equity, and
loan schedule are important aspects of financial feasibility analysis.
Social Feasibility
Social feasibility addresses the influences that a proposed project may have on the social
system in the project environment. The ambient social structure may be such that certain categories
of workers may be in short supply or nonexistent. The effect of the project on the social status of
the
project participants must be assessed to ensure compatibility. It should be recognized that
workers in certain industries may have certain status symbols within the society.
Environmental Feasibility
Often a killer of projects through long, drawn out approval processes and outright active
opposition by those claiming environmental concerns. This is an aspect worthy of real attention in
the very early stages of a project. Concern must be shown and action must be taken to address any
and all environmental concerns raised or anticipated. A perfect example was the recent attempt byDisney to build a theme park in Virginia. After a lot of funds and efforts, Disney could not
overcome the local opposition to the environmental impact that the Disney project would have on
the historic Manassas battleground area.
Market Feasibility
8
7/28/2019 Purchase Process System
9/71
Another concern is market variability and impact on the project. This area should not be
confused with the Economic Feasibility. The market needs analysis to view the potential impacts
of market demand, competitive activities, etc. and "divertible" market share available. Price war
activities by competitors, whether local, regional, national or international, must also be analyzed
for early contingency funding and debt service negotiations during the start-up, ramp-up, and
commercial start-up phases of the project.
5.3 output design
One of the most important features of an information system for users is the output
it produces. They are the only contact between users and data processing system. The
output may be given and printed report or it can be displayed in the screen.
5.4 Input design
The design of the input subsystem starts with the organization of the source data. In Visual
Basic the acquisition of source data is done through Forms. The forms will be having components
like textbox, combo box, List box, radio button, check boxes, push buttons, etc. The data items in
the combo box and in list boxes is pre entered and user just has to select the contents from it.
Data validation:
The two main types of data checks are input validation and feasibility checking.
Input validation
This is more of an absolute proof than in feasibility checking because the computer based
system checks the input data against known values. In the system input validation are duplication
of data has been occurred or not is checked when we input the data.
Feasibility study
Feasibility checks looks for the like hood errors. In the system data types and size are
checked against acceptable type and size and any difference results in rejection of data item.
Error Messages
Whenever an error is detected appropriate error messages are displayed to the user
specifying the reason for errors.
9
7/28/2019 Purchase Process System
10/71
5.5 Database Design
The menu designed in this project is very user friendly models were the user can
easily identify its purpose of it. The generalized definition of menus is ultimately justified
in the proposed system. The menus are properly constructed in such a way that the end
user can easily understand each and every choice of the menus and executes them
with at most perfection by case .The toolbar control is for the easy navigation to different
forms. The menus consist of Modules Supplier Information, Material Information, Stock
information, Purchase Indent, Indent Confirmation.
\
10
7/28/2019 Purchase Process System
11/71
TABLES
Indent details
Indent material
11
7/28/2019 Purchase Process System
12/71
Material stock
Material usage
12
7/28/2019 Purchase Process System
13/71
Purchase order
13
7/28/2019 Purchase Process System
14/71
Purchase verification
Raw material
14
7/28/2019 Purchase Process System
15/71
Supplier Details
15
7/28/2019 Purchase Process System
16/71
DATA FLOW DIAGRAM
16
User
Raw
Mater
ial Raw
MaterialStock
Purcha
se
RawMaterial
Details
Material Stock
Indent Details
Confirmation
Details
Purchase Order
A
Purcha
seIndent
Purchas
e
Confirm
Purcha
se
Order
7/28/2019 Purchase Process System
17/71
17
User
A
Supplier Details
Material Stock
Supplier Details
Supplier
Details
Purchase
dMaterial
Stock
Suppli
er
7/28/2019 Purchase Process System
18/71
5.6 Menu Design
Menus provide a convenient and consistent way to a group command and
with a means of initiating different actions. A well-designed menu always decreases
the user strain. Menu acts like a gateway for input forms. Usually a main menu item
displays another menu containing more menu items. Such a menu is called a pop-up
menu or sub menu. In our project we have an MDI form in which there are somemenus like: Supplier, Raw material Details, Material Stock, Material Usage
Purchased Material Entry Purchase Indent, Purchase Indent Confirmation and
Purchase Order. Report menu is also created through which the report for the
concerned person can be received.
5.7 Validation check
Validation is made for each and every data entered. Help messages are also
provided whenever the users enter a wrong data into a particular field. This makes the user
to understand what is to be entered, moreover whenever an erroneous data is entered the
error message is displayed and the user can move to the next field only after entering the
correct data. The clear label for the menus and fields are also provided. Consultations are
provided so that a user can view the details of any process at any time.
6.0 DEVELOPMENT OF SYSTEM AND TESTING
Role of testing
18
7/28/2019 Purchase Process System
19/71
The increasing cost of failures and mission critical nature of software has
brought a high focus on software testing in development organization. Software
testing has become the most critical element in software quality assurance.
The approach to development is to focus sharply on the first two stages of the above
cycle, so that only a minimum number of defects reach the third stage of testing. The
product has to be put through carefully planned test cycles to ensure quality. As we know
testing only releases the defects but does not prove the absence of defects.
Objectives of testing:
A clear objective is essential for the success of any task. A critical activity like
software testing is no exception. However there is a common misconception that software
testing is an activity to prove the correctness of the software. The reality however is that
testing should be viewed more as destructive process than a constructive process of
software development.
Testing in Software Product Industry
Testing strategies are most often directly adaptable only to a project development
organization since they have evolved parallel to software development life cycle (SDLC).
Software product development involves continuous maintenance, which calls for
stringent measures of quality control.
Product development involves maintaining the software products for the present
customers and developing future releases, incorporating additional features. There is a
constant need for correction and enhancement activities. Change is hence permanent.
Problems due to this constantly changing scenario are like
1. Change without proper impact study creates havoc on configuration management.
2. Unplanned changes lead to old defects reappearing and fresh defects surfacing.
3. Loss or change in original functionality of a given feature is also a common outcome of
unplanned defect rectification.
Since a software product services multiple clients, these problems take a heavy toll of client
confidence, credibility and a good client referral base. Hence we are likely to lose out on
factors, which are major marketing strengths of any software product. To ensure that
constant change does not affect product quality and performance a means of quality control
19
7/28/2019 Purchase Process System
20/71
has to be adapted which will streamline effective changes and provide greater control over
maintenance activity.
This calls for:
1. Proactive problem identification and resolution
2. Generating results through pre-defined data
3. Regression testing through recorded sequence of test steps for comparison
with expected outcomes.
4. Performance measures built into the test sequences to monitor performance
of functional features.
Effective Testing:
Implementing software testing in a structured manner involves preparation of well
designed Test Plans and Test cases for checking the functionality of the software. Though
mechanisms like automation of test cases for increasing the efficiency of testing are
available, the critical success factor of effective testing lies in the test plan and test case
design to meet the objective of testing.
Methods of testing
Once all development process are over the module is subject to UNIT TESTING
by the developer himself. In this phase, he fixes all the bugs all he notices and also tests a
cycle of test cases for the module, which he had already prepared.
Unit testing comprises the set of tests performed by the developer prior to integration of the
unit into a larger system. Once the module is through wit the unit testing then it is subject
to various other testing such as:
Functional Tests
Performance Tests
Stress Tests
Structure TestsAfter all these tests are performed, the module is tested by a Business Analysts to
check the business rules and logics applied onto the module. In spite of such a long and
careful process of testing being done, no product is bug free. Any bug encountered by
anyone May it be the developer himself or the end user, it will be rectified.
20
7/28/2019 Purchase Process System
21/71
7.0 IMPLEMENTATION
Documentation consists of documents, which describes the system. Documentation
is used for all the phrases. In the development cycle and it is a significant factor in
measuring progress and controlling quality. Preparation for this is necessary as
documentation essentially depicts what the system is supposed to be and how it could
perform. Besides improving overall operating management it also serves the purposes:
1. Supervising review of programs of development of an application.
2. Provision of operating instruction to users and operators.3. Assistance in instructing new personnel is providing background in the application
and the program.
4. Communication about the system to the user.
5. Communication between personnel working on a development project.
8.0 CONCLUSION
The PURCHASE PROCESSING SYSTEM software helps in many ways. It
overcomes the difficulties in manual processing in regard to accuracy, processing-time,
response time, manual calculation, etc and the system has been designed such that it makes
the transactions very easier and efficient. This system is developed as a user friendly one,
so that any literate person with proper training can use this system. The programmer can
modify the application very easily to meet any particular requirement.
At present the system is a vital tool in the organization and it plays an important
rule too, which acts as a backbone to any organization, which has been developed by using
Visual Basic6.0 and SQL Server 7.0. This project is very user friendly. Since it is a large
storage system, the implementation will be done full fledged only after the completion of
all modules. Required information can be promptly accessed without delay and with
maximum ease. An integrated highly secured database is used to store the information
21
7/28/2019 Purchase Process System
22/71
correctly. The system provides different ways to retrieve any specific information required
for different type of users
9.0 SUGGESTION FOR FUTURE WORKS
A future enhancement completely depends on the customer requirements and the software
can be modified at that time by adding various modules to the existing software.
10.0 BIBLIOGRAPHY
VISUAL BASIC 6.0 PROGRAMMING BIBLE - By ERIC A SMITH
VISUAL BASIC 6.0 FROM THE GROUP UP BY GARY CORNEL
SYSTEM ANALYSIS & DESIGN -- BY ELIAS .M.A.WAD
PRINCIPLES OF DATABASE SYSTEM BY ULLIMAN
DATABASE SYSTEM CONCEPTBY KORTH & SILBERSCHATZ
22
7/28/2019 Purchase Process System
23/71
APPENDICES
LOGIN
23
7/28/2019 Purchase Process System
24/71
SPLASH
24
7/28/2019 Purchase Process System
25/71
MDI
25
7/28/2019 Purchase Process System
26/71
SUPPLIER DETAILS
26
7/28/2019 Purchase Process System
27/71
RAW MATERIALS DETAILS
27
7/28/2019 Purchase Process System
28/71
MATERIAL STOCK DETAILS
28
7/28/2019 Purchase Process System
29/71
RAW MATERILAS USAGE DETAILS
29
7/28/2019 Purchase Process System
30/71
PURCHASED MATERIALS ENTRY DETAILS
30
7/28/2019 Purchase Process System
31/71
PURCHASE INDENT DETAILS
31
7/28/2019 Purchase Process System
32/71
PURCHASE ORDER CONFIRMATION DETAILS
32
7/28/2019 Purchase Process System
33/71
PURCHASE ORDER DETAILS
33
7/28/2019 Purchase Process System
34/71
REPORTS
SUPPLIER REPORT
34
7/28/2019 Purchase Process System
35/71
RAW MATERIALS REPORT
1
35
7/28/2019 Purchase Process System
36/71
MATERIAL STOCK REPORT
36
7/28/2019 Purchase Process System
37/71
RAW MATERIAL USAGE REPORT
37
7/28/2019 Purchase Process System
38/71
RCHASE INDENT REPORT
38
7/28/2019 Purchase Process System
39/71
INDENT MATERIALS REPORT
39
7/28/2019 Purchase Process System
40/71
PURCHASE CONFIRMATION REPORT
40
7/28/2019 Purchase Process System
41/71
PURCHASE ORDER REPORT
41
7/28/2019 Purchase Process System
42/71
EXTRACTED SOURCE CODE
SUPPLIER DETAILS
dim rs as new adodb.recordset
dim rss as new adodb.recordset
dim ks as new adodb.recordset
private sub add_click()
if add.caption = "add new" then
clear
add.caption = "cancel"
if rs.state = 1 then rs.close
rs.open "select max(suppliernumber) from supplierdetails", module1.con
if isnull(rs(0)) then
txtsuppliernunber.text = 1
else
txtsuppliernunber.text = rs(0) + 1end if
else
add.caption = "add new"
clear
end if
end sub
private sub cmdcancel_click()
fralocate.visible = false
end sub
private sub cmddel_click()
42
7/28/2019 Purchase Process System
43/71
dim tmp as string
tmp = msgbox("do you want to delete the record", vbquestion + vbyesno, "production
monitoring")
if tmp = vbyes then
if txtsuppliernunber.text = "" or txtsupliername.text = "" or cmbstatus.text = "" or
txtgstno.text = "" or txtcstno.text = "" or txtcompanyaddress.text = "" or
txtphonenumber.text = "" or txtemail.text = "" or txtp_name.text = "" or txtp_phone.text =
"" or txtmobile.text = "" or txtp_email.text = "" or txtp_address.text = "" or
txtmainproducts.text = "" then
msgbox "please fill the necessary fields", vbinformation, "production monitoring"
else
con.execute "delete from supplierdetails where suppliernumber='" &
trim(txtsuppliernunber) & "'"
msgbox "record deleted sucessfully....", vbinformation, "production monitoring"
clear
end if
end if
end sub
private sub cmdmod_click()
if txtsuppliernunber.text = "" or txtsupliername.text = "" or cmbstatus.text = "" or
txtgstno.text = "" or txtcstno.text = "" or txtcompanyaddress.text = "" or
txtphonenumber.text = "" or txtemail.text = "" or txtp_name.text = "" or txtp_phone.text =
"" or txtmobile.text = "" or txtp_email.text = "" or txtp_address.text = "" or
txtmainproducts.text = "" then
msgbox " necessary fields have to be fill to modify...", vbinformation, "production
monitoring"
else
con.execute "update supplierdetails set suppliername='" & txtsupliername.text &
"',status='" & cmbstatus.text & "',gstno='" & txtgstno.text & "',cstno='" & txtcstno.text &
"',companyaddress='" & txtcompanyaddress.text & "',phonenumber='" &
txtphonenumber.text & "',email='" & txtemail.text & "',p_name='" & txtp_name.text &
43
7/28/2019 Purchase Process System
44/71
"',p_phone='" & txtp_phone.text & "',mobile='" & txtmobile.text & "',p_email='" &
txtp_email.text & "',p_address='" & txtp_address.text & "',mainproducts='" &
txtmainproducts.text & "' where suppliernumber ='" & txtsuppliernunber.text & "'"
msgbox " record modified sucessfully...", vbinformation, "production monitoring"
clear
end if
end sub
private sub cmdok_click()
if cmbsupplierno.text = "" then
adodc2.recordsource = "select * from supplierdetails"
adodc2.refresh
else
adodc2.recordsource = "select * from supplierdetails where suppliernumber='" &
trim(cmbsupplierno) & "'"
adodc2.refresh
end if
end sub
private sub datagrid1_mousedown(button as integer, shift as integer, x as single, y as
single)
clear
dg = datagrid1.rowcontaining(y)
if dg >= 0 and datagrid1.row -1 then
locid = datagrid1.columns(0).cellvalue(datagrid1.rowbookmark(dg))
end if
if locid = empty then
else
if rs.state = 1 then rs.close
rs.open "select * from supplierdetails where suppliernumber='" & locid & "'", module1.con
if not rs.eof then
44
7/28/2019 Purchase Process System
45/71
txtsuppliernunber.text = rs!suppliernumber
txtsupliername.text = rs!suppliername
cmbstatus.text = rs!status
txtgstno.text = rs!gstno
txtcstno.text = rs!cstno
txtcompanyaddress.text = rs!companyaddress
txtphonenumber.text = rs!phonenumber
txtemail.text = rs!email
txtp_name.text = rs!p_name
txtp_phone.text = rs!p_phone
txtmobile.text = rs!mobile
txtp_email.text = rs!p_email
txtp_address.text = rs!p_address
txtmainproducts.text = rs!mainproducts
fralocate.visible = false
end if
end if
end sub
private sub exit_click()
unload me
end sub
private sub form_load()
lbldate.caption = now
fralocate.visible = false
module1.connection
adodc2.connectionstring = "provider=sqloledb.1;persist security info=false;user
id=sa;initial catalog=productionmonitoring"
end sub
public sub clear()
txtsuppliernunber.text = ""
45
7/28/2019 Purchase Process System
46/71
txtsupliername.text = ""
cmbstatus.text = ""
txtgstno.text = ""
txtcstno.text = ""
txtcompanyaddress.text = ""
txtphonenumber.text = ""
txtemail.text = ""
txtp_name.text = ""
txtp_phone.text = ""
txtmobile.text = ""
txtp_email.text = ""
txtp_address.text = ""
txtmainproducts.text = ""
end sub
private sub save_click()
if txtsuppliernunber.text = "" or txtsupliername.text = "" or cmbstatus.text = "" or
txtgstno.text = "" or txtcstno.text = "" or txtcompanyaddress.text = "" or
txtphonenumber.text = "" or txtemail.text = "" or txtp_name.text = "" or txtp_phone.text =
"" or txtmobile.text = "" or txtp_email.text = "" or txtp_address.text = "" or
txtmainproducts.text = "" then
msgbox "please fill the necessary fields", vbinformation, "production monitoring"
else
con.execute "insert into supplierdetails values('" & txtsuppliernunber.text & "','" &
txtsupliername.text & "','" & cmbstatus.text & "','" & txtgstno.text & "','" & txtcstno.text &
"','" & txtcompanyaddress.text & "','" & txtphonenumber.text & "','" & txtemail.text & "','"
& txtp_name.text & "','" & txtp_phone.text & "','" & txtmobile.text & "','" &
txtp_email.text & "','" & txtp_address.text & "','" & txtmainproducts.text & "')"
msgbox "details of supplier is inserted successecfully", vbinformation, "production
monitoring"
clear
end if
46
7/28/2019 Purchase Process System
47/71
end sub
private sub search_click()
adodc2.recordsource = "select null"
adodc2.refresh
fralocate.visible = true
cmbsupplierno.clear
cmbsupplierno.text = ""
dim rs as new adodb.recordset
if rs.state = 1 then rs.close
rs.open "select suppliernumber from supplierdetails", module1.con
while not rs.eof
cmbsupplierno.additem (rs!suppliernumber)
rs.movenext
wend
end sub
47
7/28/2019 Purchase Process System
48/71
RAW MATERIAL DETAILS
Dim rs As New ADODB.Recordset
Private Sub add_Click()
If add.Caption = "Add New" Then
clear
add.Caption = "Cancel"
If rs.State = 1 Then rs.Close
rs.Open "select max(materialnumber) from rawmaterial", Module1.con
If IsNull(rs(0)) Then
txtMaterialNumber.Text = 1
Else
txtMaterialNumber.Text = rs(0) + 1
End If
Else
add.Caption = "Add New"
clear
End If
End Sub
Private Sub cmdCancel_Click()
fraLocate.Visible = False
End Sub
Private Sub cmddel_Click()
Dim tmp As String
tmp = MsgBox("Do You Want To Delete The Record", vbQuestion + vbYesNo,
"Production Monitoring")
If tmp = vbYes Then
If txtMaterialNumber.Text = "" Or txtMaterialName.Text = "" Or txtModel.Text = "" Or
txtUnit.Text = "" Or txtRate.Text = "" Then
MsgBox "Please fill the necessary fields", vbInformation, "Production Monitoring"
Else
48
7/28/2019 Purchase Process System
49/71
con.Execute "delete from rawmaterial where materialnumber='" &
Trim(txtMaterialNumber) & "'"
MsgBox "Record Deleted Sucessfully....", vbInformation, "Production Monitoring"
clear
End If
End If
End Sub
Private Sub cmdmod_Click()
If txtMaterialNumber.Text = "" Or txtMaterialName.Text = "" Or txtModel.Text = "" Or
txtUnit.Text = "" Or txtRate.Text = "" Then
MsgBox " Necessary Fields Have To Be Fill To Modify...", vbInformation, "Production
Monitoring"
Else
con.Execute "update rawmaterial set materialname='" & txtMaterialName.Text &
"',model='" & txtModel.Text & "',unit='" & txtUnit.Text & "',rate='" & txtRate.Text & "'
where materialnumber ='" & txtMaterialNumber.Text & "'"
MsgBox " Record Modified Sucessfully...", vbInformation, "Production Monitoring"
clear
End If
End Sub
Private Sub cmdOK_Click()
If cmbMaterialNo.Text = "" Then
Adodc1.RecordSource = "select * from rawmaterial"
Adodc1.Refresh
Else
Adodc1.RecordSource = "select * from rawmaterial where materialnumber='" &
Trim(cmbMaterialNo) & "'"
Adodc1.Refresh
End If
End Sub
49
7/28/2019 Purchase Process System
50/71
Private Sub DataGrid1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y
As Single)
clear
DG = DataGrid1.RowContaining(Y)
If DG >= 0 And DataGrid1.Row -1 Then
locid = DataGrid1.Columns(0).CellValue(DataGrid1.RowBookmark(DG))
End If
If locid = Empty Then
Else
If rs.State = 1 Then rs.Close
rs.Open "select * from rawmaterial where materialnumber='" & locid & "'", Module1.con
If Not rs.EOF Then
txtMaterialNumber.Text = rs!materialnumber
txtMaterialName.Text = rs!materialname
txtModel.Text = rs!model
txtUnit.Text = rs!unit
txtRate.Text = rs!Rate
fraLocate.Visible = False
End If
End If
End Sub
Private Sub exit_Click()
Unload Me
End Sub
Private Sub Form_Load()
LBLDATE.Caption = Now
fraLocate.Visible = False
Module1.connection
Adodc1.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=False;User
ID=sa;Initial Catalog=productionmonitoring"
End Sub
50
7/28/2019 Purchase Process System
51/71
Public Sub clear()
txtMaterialNumber.Text = ""
txtMaterialName.Text = ""
txtModel.Text = ""
txtUnit.Text = ""
txtRate.Text = ""
End Sub
Private Sub save_Click()
If txtMaterialNumber.Text = "" Or txtMaterialName.Text = "" Or txtModel.Text = "" Or
txtUnit.Text = "" Or txtRate.Text = "" Then
MsgBox "Please fill the necessary fields", vbInformation, "Production Monitoring"
Else
con.Execute "insert into rawmaterial values('" & txtMaterialNumber.Text & "','" &
txtMaterialName.Text & "','" & txtModel.Text & "','" & txtUnit.Text & "','" & txtRate.Text
& "')"
MsgBox "details of staff is inserted successecfully", vbInformation, "Production
Monitoring"
clear
End If
End Sub
Private Sub search_Click()
Adodc1.RecordSource = "select null"
Adodc1.Refresh
fraLocate.Visible = True
cmbMaterialNo.clear
cmbMaterialNo.Text = ""
Dim rs As New ADODB.Recordset
If rs.State = 1 Then rs.Close
rs.Open "select materialnumber from rawmaterial", Module1.con
While Not rs.EOF
cmbMaterialNo.AddItem (rs!materialnumber)
51
7/28/2019 Purchase Process System
52/71
rs.MoveNext
Wend
End Sub
MATERIAL STOCK
Dim rs As New ADODB.Recordset
Dim ks As New ADODB.Recordset
Private Sub add_Click()
If add.Caption = "Add New" Then
clear
add.Caption = "Cancel"
If rs.State = 1 Then rs.Close
rs.Open "select max(stocknumber) from materialstock", Module1.con
If IsNull(rs(0)) Then
txtStockNumber.Text = 1
Else
txtStockNumber.Text = rs(0) + 1
End If
If ks.State = 1 Then ks.Close
ks.Open "select * from rawmaterial", Module1.con
While Not ks.EOF
cmbMaterialNumber.AddItem (ks!materialnumber)
ks.MoveNext
Wend
Else
add.Caption = "Add New"
clear
End If
End Sub
52
7/28/2019 Purchase Process System
53/71
Private Sub cmbMaterialNumber_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If cmbMaterialNumber.Text = "" Then
MsgBox "Please Select A Material Number", vbInformation + vbOKOnly, "Production
Monitoring"
cmbMaterialNumber.SetFocus
Else
If rs.State = 1 Then rs.Close
rs.Open "select * from rawmaterial where materialnumber='" & cmbMaterialNumber.Text
& "'", Module1.con
If Not rs.EOF Then
txtMaterialName.Text = rs!materialname
txtModel.Text = rs!model
txtUnit.Text = rs!unit
txtRate.Text = rs!Rate
txtQuantity.SetFocus
End If
End If
End If
End Sub
Private Sub cmdCancel_Click()
fraLocate.Visible = False
End Sub
Private Sub cmddel_Click()
Dim tmp As String
tmp = MsgBox("Do You Want To Delete The Record", vbQuestion + vbYesNo,
"Production Monitoring")
If tmp = vbYes Then
If txtStockNumber.Text = "" Or cmbMaterialNumber.Text = "" Or txtMaterialName.Text =
"" Or txtModel.Text = "" Or txtUnit.Text = "" Or txtRate.Text = "" Or txtQuantity.Text =
"" Or txtTotal.Text = "" Then
53
7/28/2019 Purchase Process System
54/71
MsgBox "Please fill the necessary fields", vbInformation, "Production Monitoring"
Else
con.Execute "delete from materialstock where stocknumber='" & Trim(txtStockNumber)
& "'"
MsgBox "Record Deleted Sucessfully....", vbInformation, "Production Monitoring"
clear
End If
End If
End Sub
Private Sub cmdmod_Click()
If txtStockNumber.Text = "" Or cmbMaterialNumber.Text = "" Or txtMaterialName.Text =
"" Or txtModel.Text = "" Or txtUnit.Text = "" Or txtRate.Text = "" Or txtQuantity.Text =
"" Or txtTotal.Text = "" Then
MsgBox " Necessary Fields Have To Be Fill To Modify...", vbInformation, "Production
Monitoring"
Else
con.Execute "update materialstock set quantity='" & txtQuantity.Text & "',total='" &
txtTotal.Text & "' where stocknumber ='" & txtStockNumber.Text & "'"
MsgBox " Record Modified Sucessfully...", vbInformation, "Production Monitoring"
clear
End If
End Sub
Private Sub cmdOK_Click()
If cmbstockno.Text = "" Then
Adodc1.RecordSource = "select * from materialstock"
Adodc1.Refresh
Else
Adodc1.RecordSource = "select * from materialstock where stocknumber='" &
Trim(cmbstockno) & "'"
Adodc1.Refresh
End If
54
7/28/2019 Purchase Process System
55/71
End Sub
Private Sub DataGrid1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y
As Single)
clear
DG = DataGrid1.RowContaining(Y)
If DG >= 0 And DataGrid1.Row -1 Then
locid = DataGrid1.Columns(0).CellValue(DataGrid1.RowBookmark(DG))
End If
If locid = Empty Then
Else
If rs.State = 1 Then rs.Close
rs.Open "select * from materialstock where stocknumber='" & locid & "'", Module1.con
If Not rs.EOF Then
txtStockNumber.Text = rs!stocknumber
cmbMaterialNumber.Text = rs!materialnumber
txtQuantity.Text = rs!quantity
txtTotal.Text = rs!total
LBLDATE.Caption = rs!stockdate
If ks.State = 1 Then ks.Close
ks.Open "select * from rawmaterial where materialnumber='" & cmbMaterialNumber.Text
& "'", Module1.con
If Not ks.EOF Then
txtMaterialName.Text = ks!materialname
txtModel.Text = ks!model
txtUnit.Text = ks!unit
txtRate.Text = ks!Rate
txtQuantity.SetFocus
End If
fraLocate.Visible = False
End If
End If
55
7/28/2019 Purchase Process System
56/71
End Sub
Private Sub exit_Click()
Unload Me
End Sub
Private Sub Form_Load()
Module1.connection
fraLocate.Visible = False
LBLDATE.Caption = Now
Adodc1.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=False;User
ID=sa;Initial Catalog=productionmonitoring"
End Sub
Public Sub clear()
txtStockNumber.Text = ""
txtMaterialName.Text = ""
cmbMaterialNumber.Text = ""
cmbMaterialNumber.clear
txtModel.Text = ""
txtUnit.Text = ""
txtRate.Text = ""
txtQuantity.Text = ""
txtTotal.Text = ""
End Sub
Private Sub save_Click()
If txtStockNumber.Text = "" Or cmbMaterialNumber.Text = "" Or txtMaterialName.Text =
"" Or txtModel.Text = "" Or txtUnit.Text = "" Or txtRate.Text = "" Or txtQuantity.Text =
"" Or txtTotal.Text = "" Then
MsgBox "Please fill the necessary fields", vbInformation, "Production Monitoring"
Else
con.Execute "insert into materialstock values('" & txtStockNumber.Text & "','" &
cmbMaterialNumber.Text & "','" & txtQuantity.Text & "','" & txtTotal.Text & "','" &
LBLDATE.Caption & "')"
56
7/28/2019 Purchase Process System
57/71
MsgBox "details of Stock is inserted successecfully", vbInformation, "Production
Monitoring"
clear
End If
End Sub
Private Sub search_Click()
Adodc1.RecordSource = "select null"
Adodc1.Refresh
fraLocate.Visible = True
cmbstockno.clear
cmbstockno.Text = ""
Dim rs As New ADODB.Recordset
If rs.State = 1 Then rs.Close
rs.Open "select stocknumber from materialstock", Module1.con
While Not rs.EOF
cmbstockno.AddItem (rs!stocknumber)
rs.MoveNext
Wend
End Sub
Private Sub txtQuantity_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtTotal.Text = Val(txtQuantity.Text) * Val(txtRate)
save.SetFocus
End If
End Sub
MATERIAL USAGE
57
7/28/2019 Purchase Process System
58/71
Dim ks As New ADODB.Recordset
Dim rs As New ADODB.Recordset
Private Sub add_Click()
If add.Caption = "Add New" Then
clear
add.Caption = "Cancel"
If rs.State = 1 Then rs.Close
rs.Open "select * from materialstock", Module1.con
While Not rs.EOF
cmbStockNumber.AddItem (rs!stocknumber)
rs.MoveNext
Wend
Else
add.Caption = "Add New"
clear
End If
End Sub
Private Sub cmbStockNumber_KeyPress(KeyAscii As Integer)
If cmbStockNumber.Text = "" Then
MsgBox "Please Select A Stock Number", vbInformation + vbOKOnly, "Production
Monitoring"
cmbStockNumber.SetFocus
Else
If rs.State = 1 Then rs.Close
rs.Open "select * from materialstock where stocknumber='" & cmbStockNumber.Text &
"'", Module1.con
If Not rs.EOF Then
txtMaterialNumber.Text = rs!materialnumber
txtExistingQuantity.Text = rs!quantity
End If
If ks.State = 1 Then ks.Close
58
7/28/2019 Purchase Process System
59/71
ks.Open "select * from rawmaterial where materialnumber='" & txtMaterialNumber.Text &
"'", Module1.con
If Not ks.EOF Then
txtMaterialName.Text = ks!materialname
txtModel.Text = ks!model
txtUnit.Text = ks!unit
txtRate.Text = ks!Rate
End If
End If
End Sub
Private Sub exit_Click()
Unload Me
End Sub
Private Sub Form_Load()
Module1.connection
LBLDATE.Caption = Now
End Sub
Public Sub clear()
cmbStockNumber.Text = ""
cmbStockNumber.clear
txtMaterialNumber.Text = ""
txtMaterialName.Text = ""
txtModel.Text = ""
txtUnit.Text = ""
txtRate.Text = ""
txtExistingQuantity.Text = ""
txtUsedQty.Text = ""
txtReciever.Text = ""
LBLDATE.Caption = Now
End Sub
59
7/28/2019 Purchase Process System
60/71
Private Sub save_Click()
Dim ss As Integer
ss = Val(txtExistingQuantity) - Val(txtUsedQty)
If cmbStockNumber.Text = "" Or txtMaterialNumber.Text = "" Or txtMaterialName.Text =
"" Or txtModel.Text = "" Or txtUnit.Text = "" Or txtRate.Text = "" Or
txtExistingQuantity.Text = "" Or txtUsedQty.Text = "" Or txtReciever.Text = "" Then
MsgBox "Please fill the necessary fields", vbInformation, "Production Monitoring"
Else
con.Execute "insert into materialusage values('" & cmbStockNumber.Text & "','" &
txtUsedQty.Text & "','" & txtReciever.Text & "','" & LBLDATE.Caption & "')"
con.Execute "update materialstock set quantity='" & ss & "' where stocknumber ='" &
cmbStockNumber.Text & "'"
MsgBox "details of Supplier is inserted successecfully", vbInformation, "Production
Monitoring"
clear
End If
End Sub
PURCHASE MATERIAL ENTRY
Dim rs As New ADODB.Recordset
Dim ks As New ADODB.Recordset
Dim kl As New ADODB.Recordset
Private Sub add_Click()
60
7/28/2019 Purchase Process System
61/71
If add.Caption = "Add New" Then
clear
add.Caption = "Cancel"
If rs.State = 1 Then rs.Close
rs.Open "select * from materialstock", Module1.con
While Not rs.EOF
cmbStockNumber.AddItem (rs!stocknumber)
rs.MoveNext
Wend
Else
add.Caption = "Add New"
clear
End If
End Sub
Private Sub cmbStockNumber_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If cmbStockNumber.Text = "" Then
MsgBox "Please Select A Stock Number", vbInformation + vbOKOnly, "Production
Monitoring"
cmbStockNumber.SetFocus
Else
If rs.State = 1 Then rs.Close
rs.Open "select * from materialstock where stocknumber='" & cmbStockNumber.Text &
"'", Module1.con
If Not rs.EOF Then
lblstockdate.Caption = rs!stockdate
txtMaterialNumber.Text = rs!materialnumber
txtExistingQuantity.Text = rs!quantity
If ks.State = 1 Then ks.Close
ks.Open "select * from rawmaterial where materialnumber='" & txtMaterialNumber.Text &
"'", Module1.con
61
7/28/2019 Purchase Process System
62/71
If Not ks.EOF Then
txtMaterialName.Text = ks!materialname
txtModel.Text = ks!model
txtUnit.Text = ks!unit
txtRate.Text = ks!Rate
txtPurchasedQty.SetFocus
End If
End If
End If
End If
End Sub
Private Sub exit_Click()
Unload Me
End Sub
Private Sub Form_Load()
Module1.connection
LBLDATE.Caption = Now
End Sub
Public Sub clear()
cmbStockNumber.Text = ""
cmbStockNumber.clear
LBLDATE.Caption = Now
lblstockdate.Caption = ""
txtMaterialNumber.Text = ""
txtMaterialName.Text = ""
txtRate.Text = ""
txtUnit.Text = ""
txtModel.Text = ""
62
7/28/2019 Purchase Process System
63/71
txtExistingQuantity.Text = ""
txtPurchasedQty.Text = ""
End Sub
Private Sub save_Click()
If cmbStockNumber.Text = "" Or txtMaterialNumber.Text = "" Or txtMaterialName.Text =
"" Or LBLDATE.Caption = "" Or txtPurchasedQty.Text = "" Then
MsgBox " Necessary Fields Have To Be Fill To Modify...", vbInformation, "Production
Monitoring"
Else
Dim aa As Double
aa = Val(txtExistingQuantity) + Val(txtPurchasedQty)
con.Execute "update materialstock set quantity='" & aa & "' where stocknumber ='" &
cmbStockNumber.Text & "'"
MsgBox " Material Add Sucessfully...", vbInformation, "Production Monitoring"
clear
End If
End Sub
PURCHASE INDENT
Dim rs As New ADODB.Recordset
Dim ks As New ADODB.Recordset
Dim rss As New ADODB.Recordset
Dim kl As New ADODB.Recordset
Private Sub add_Click()
If add.Caption = "Add New" Then
clear
63
7/28/2019 Purchase Process System
64/71
add.Caption = "Cancel"
If rs.State = 1 Then rs.Close
rs.Open "select max(indentnumber) from indentdetails", Module1.con
If IsNull(rs(0)) Then
txtIndentNumber.Text = 1
Else
txtIndentNumber.Text = rs(0) + 1
End If
If rss.State = 1 Then rss.Close
rss.Open "select * from rawmaterial", Module1.con
While Not rss.EOF
cmbMaterialNo.AddItem (rss!materialnumber)
rss.MoveNext
Wend
Else
add.Caption = "Add New"
clear
End If
End Sub
Private Sub cmbMaterialNo_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If cmbMaterialNo.Text = "" Then
MsgBox "Please Selsct A Material Number", vbInformation + vbOKOnly, "Production
Monitoring"
cmbMaterialNo.SetFocus
Else
If rs.State = 1 Then rs.Close
rs.Open "select * from rawmaterial where materialnumber='" & cmbMaterialNo.Text & "'",
Module1.con
If Not rs.EOF Then
txtMaterialName.Text = rs!materialname
64
7/28/2019 Purchase Process System
65/71
End If
If ks.State = 1 Then ks.Close
ks.Open "select * from materialstock where materialnumber='" & cmbMaterialNo.Text &
"'", Module1.con
While Not ks.EOF
txtExistingQty.Text = Val(txtExistingQty) + ks!quantity
ks.MoveNext
Wend
End If
txtRequiredQty.SetFocus
End If
End Sub
Private Sub cmdCancel_Click()
fraLocate.Visible = False
End Sub
Private Sub cmddel_Click()
Dim tmp As String
tmp = MsgBox("Do You Want To Delete The Record", vbQuestion + vbYesNo,
"Production Monitoring")
If tmp = vbYes Then
If txtIndentNumber.Text = "" Or txtPurchaseValue.Text = "" Or LBLDATE.Caption = ""
Then
MsgBox "Please fill the necessary fields", vbInformation, "Production Monitoring"
Else
con.Execute "delete from indentdetails where indentnumber='" & Trim(txtIndentNumber)
& "'"
con.Execute "delete from indentmaterial where indentnumber='" &
Trim(txtIndentNumber) & "'"
MsgBox "Record Deleted Sucessfully....", vbInformation, "Production Monitoring"
clear
End If
65
7/28/2019 Purchase Process System
66/71
End If
End Sub
Private Sub cmdmod_Click()
If txtIndentNumber.Text = "" Or txtPurchaseValue.Text = "" Or LBLDATE.Caption = ""
Then
MsgBox " Necessary Fields Have To Be Fill To Modify...", vbInformation, "Production
Monitoring"
Else
con.Execute "update indentdetails set purchasevalue='" & txtPurchaseValue.Text & "'
where indentnumber ='" & txtIndentNumber.Text & "'"
MsgBox " Record Modified Sucessfully...", vbInformation, "Production Monitoring"
clear
End If
End Sub
Private Sub cmdOK_Click()
If cmbindentno.Text = "" Then
Adodc1.RecordSource = "select * from indentdetails"
Adodc1.Refresh
Else
Adodc1.RecordSource = "select * from indentdetails where indentnumber='" &
Trim(cmbindentno) & "'"
Adodc1.Refresh
End If
End Sub
Private Sub DataGrid1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y
As Single)
clear
DG = DataGrid1.RowContaining(Y)
If DG >= 0 And DataGrid1.Row -1 Then
locid = DataGrid1.Columns(0).CellValue(DataGrid1.RowBookmark(DG))
End If
66
7/28/2019 Purchase Process System
67/71
If locid = Empty Then
Else
If rs.State = 1 Then rs.Close
rs.Open "select * from indentdetails where indentnumber='" & locid & "'", Module1.con
If Not rs.EOF Then
txtIndentNumber.Text = rs!indentnumber
LBLDATE.Caption = rs!indentdate
txtPurchaseValue.Text = rs!purchasevalue
If ks.State = 1 Then ks.Close
ks.Open "select * from indentmaterial where indentnumber='" & txtIndentNumber.Text &
"'", Module1.con
While Not ks.EOF
lstMaterialNo.AddItem (ks!materialno)
lstRequiredQty.AddItem (ks!requiredqty)
lstLastPOValue.AddItem (ks!lastpovalue)
lstLastPONo.AddItem (ks!lastpono)
If rss.State = 1 Then rss.Close
rss.Open "select * from rawmaterial where materialnumber='" & ks!materialno & "'",
Module1.con
If Not rss.EOF Then
lstMaterialName.AddItem (rss!materialname)
End If
If kl.State = 1 Then kl.Close
kl.Open "select * from materialstock where materialnumber='" & ks!materialno & "'",
Module1.con
If Not kl.EOF Then
lstExistingQty.AddItem (kl!quantity)
End If
ks.MoveNext
Wend
fraLocate.Visible = False
67
7/28/2019 Purchase Process System
68/71
End If
End If
End Sub
Private Sub exit_Click()
Unload Me
End Sub
Private Sub Form_Load()
Module1.connection
fraLocate.Visible = False
LBLDATE.Caption = Now
Adodc1.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=False;User
ID=sa;Initial Catalog=productionmonitoring"
End Sub
Public Sub clear()
LBLDATE.Caption = Now
txtIndentNumber.Text = ""
cmbMaterialNo.Text = ""
cmbMaterialNo.clear
txtMaterialName.Text = ""
txtExistingQty.Text = ""
txtRequiredQty.Text = ""
txtLastPOValue.Text = ""
txtLastPOno.Text = ""
lstMaterialNo.clear
lstMaterialName.clear
lstExistingQty.clear
lstRequiredQty.clear
lstLastPOValue.clear
lstLastPONo.clear
68
7/28/2019 Purchase Process System
69/71
txtPurchaseValue.Text = ""
End Sub
Private Sub save_Click()
If txtIndentNumber.Text = "" Or txtPurchaseValue.Text = "" Or LBLDATE.Caption = ""
Then
MsgBox "Please fill the necessary fields", vbInformation, "Production Monitoring"
Else
con.Execute "insert into indentdetails values('" & txtIndentNumber.Text & "','" &
LBLDATE.Caption & "','" & txtPurchaseValue.Text & "')"
con.Execute "insert into beforeindent values('" & txtIndentNumber.Text & "')"
MsgBox "details of Purchase Indent is inserted successecfully", vbInformation,
"Production Monitoring"
clear
End If
End Sub
Private Sub search_Click()
Adodc1.RecordSource = "select null"
Adodc1.Refresh
fraLocate.Visible = True
cmbindentno.clear
cmbindentno.Text = ""
Dim rs As New ADODB.Recordset
If rs.State = 1 Then rs.Close
rs.Open "select indentnumber from indentdetails", Module1.con
While Not rs.EOF
cmbindentno.AddItem (rs!indentnumber)
rs.MoveNext
Wend
End Sub
Private Sub txtLastPOno_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
69
7/28/2019 Purchase Process System
70/71
Dim ss As String
Dim aa As Integer
If rs.State = 1 Then rs.Close
rs.Open "select * from rawmaterial where materialnumber='" & cmbMaterialNo.Text & "'",
Module1.con
If Not rs.EOF Then
aa = rs!Rate
End If
txtPurchaseValue.Text = Val(txtPurchaseValue) + (aa * Val(txtRequiredQty))
lstMaterialNo.AddItem (cmbMaterialNo.Text)
lstMaterialName.AddItem (txtMaterialName.Text)
lstExistingQty.AddItem (txtExistingQty.Text)
lstRequiredQty.AddItem (txtRequiredQty.Text)
lstLastPOValue.AddItem (txtLastPOValue.Text)
lstLastPONo.AddItem (txtLastPOno.Text)
If cmbMaterialNo.Text = "" Or txtMaterialName.Text = "" Or txtExistingQty.Text = "" Or
txtRequiredQty.Text = "" Or txtLastPOno.Text = "" Or txtLastPOValue.Text = "" Then
MsgBox "Please fill the necessary fields", vbInformation, "Production Monitoring"
Else
con.Execute "insert into indentmaterial values('" & txtIndentNumber.Text & "','" &
cmbMaterialNo.Text & "','" & txtRequiredQty.Text & "','" & txtLastPOValue.Text & "','"
& txtLastPOno.Text & "')"
End If
ss = MsgBox("If You Want Add Next Material", vbYesNo, "Production Monitoring")
If ss = vbYes Then
cmbMaterialNo.Text = ""
txtMaterialName.Text = ""
txtExistingQty.Text = ""
txtRequiredQty.Text = ""
txtLastPOValue.Text = ""
txtLastPOno.Text = ""
70
7/28/2019 Purchase Process System
71/71
cmbMaterialNo.SetFocus
Else
cmbMaterialNo.Text = ""
txtMaterialName.Text = ""
txtExistingQty.Text = ""
txtRequiredQty.Text = ""
txtLastPOValue.Text = ""
txtLastPOno.Text = ""
save.SetFocus
End If
End If
End Sub
Recommended