Stock Book Pro 1.0

A multi-user Windows desktop application built for Krishi Vigyan Kendra Dhalai, Salema, Tripura - a digital stock book with role-based domains, a full record of who changed what, protected backups and print-ready statements.

Developer
Guide Mr. Subrata Shib, Programme Coordinator, KVK Dhalai

The Problem

Every office keeps a stock book to track the commodities that come in and go out. Krishi Vigyan Kendra Dhalai (KVK Dhalai) is a district level Farm Science Centre under the Indian Council of Agricultural Research, and its stock book needed to be quick to keep and easy to trace - every entry tied to the person who made it and the time they made it.

Core ask: Build a stock book that saves paper and makes tracking easy - with user login, separate access domains, a record of every change and who made it, safe database backup and restore, and printable statements for any commodity.

Stock Book Pro was one of three applications I built for KVK Dhalai during my third year MCA internship (Internship Program II, CA660) at ICFAI University, Tripura, from January to June 2014, under the guidance of Mr. Subrata Shib (Programme Coordinator, KVK Dhalai). The other two are Cash Book Pro and Estimate Pro.


Technology

Visual Studio 2008 / 2010VB.NETWinFormsMS SQL ServerMicrosoft Reporting (RDLC).NET Framework 3.5

Built as a Windows Forms desktop application in VB.NET, with a local SQL Server Express database attached from the application folder. Stock statements are produced with Microsoft Reporting (an RDLC report) so the printed output matches what the screen shows.

The model is built around critical inputs - the commodities the office tracks. Each critical input has a name, a unit and opening and closing stock balances; every stock detail entry records a receipt (memo details and quantity), a disposal (distribution details, quantity and remarks), or both, and carries the identity of the user who created it.


What It Does

Domains & Roles

An Administrator domain holds the higher privileges - changing login details, backup and restore, creating and deleting user domains. Other domains get standard access.

Login Tracking

Every successful and unsuccessful login is saved, so unauthorised access attempts can be checked later.

Full Audit Trail

When a user creates, modifies or deletes a stock record, their details and the time of the operation are saved against it.

Backup & Restore

Administrators can back up and restore the database on demand, with the user and path recorded. A scheduled backup also runs every seven days of use, kept off the Windows drive.

Logout, State Kept

A user can log out and leave work unsaved; the software status stays unchanged until the next login.

Stock Statements

Periodic statements for all critical inputs, or only selected ones, can be generated and printed.

Entry rules by design: entries must be made in sequence - no entry can be made before an existing one. To correct an earlier entry, the later entries after it must be deleted first. Any domain member can create a stock record, but only the Administrator domain can delete one. Every one of these operations is logged, so there is no route to unauthorised modification.

Stock Book Pro login screen
Login - domain, user ID and password; every attempt, successful or not, is recorded

Working with Stock

After login, the start menu groups everything the office needs day to day: critical inputs, stock details (update, edit, delete), the stockbook statement, current status, transactions and system tools.

Start menu options
Start menu - critical input, stock details, statement, current status, transactions, system tools

System Design

The use case diagram shows the full function map of the application for a logged-in user: Login; the KVK Stockbook group (Critical Input with New and Delete, Stock Details with Update, Edit and Delete, and Stockbook Statement); Current Status; Transaction; System Tool (database tasks and user account tasks); About; Logout; and Exit.

Use case diagram - StockBook Pro v1.0
Use Case Diagram - StockBook Pro v1.0: system functions under the Database Tasks and User Accounts Task groups

The Audit Trail

Audit records are kept in dedicated tables by event class, so each stream can be queried and reported on its own. The Transactions screen lets any authorised user pick an event type and see every matching record: who did it (domain and user), when, what type of operation, and whether it succeeded.


The Backup Architecture

Data loss is the main risk for a record that is audited. Backup works in layers. An administrator can take a manual backup and restore one on demand; the user, the path and the outcome of each are written to the database audit table. On top of that, a scheduled backup copy is made every seven days of use, and a separate failsafe copy of the database is refreshed each time the application starts - so a restore can be checked against the state of the last use. The backups are kept off the Windows drive so that a Windows crash does not take the data with it.


Accounts & Access

Only a member of the Administrator domain can create a new user ID, create or delete a domain, or create and delete critical inputs. Any user can change their own login details.


Database Schema

Seven tables cover the data model: the stock record itself, the list of tracked commodities, the user accounts, and four audit tables of identical shape. Column names and lengths below are read from the repository's dataset definition and queries.

STOCKBOOK - one stock book entry per row
ColumnTypeDescription
tidsbdecimalTransaction ID - unique per stock entry
cistring(50)Critical input (commodity) name
unitstring(20)Unit of measure
datedatetimeDate of entry
srmdstring(250)Stock receive memo details
srqtydecimalStock receive quantity
sddetailstring(250)Stock disposal / distribution details
sdqtydecimalStock disposal quantity
sdremstring(250)Stock disposal remarks
osb / csbdecimalOpening / closing stock balance
ruistringRecord entry user info - who created the entry
CRITICALINPUT / USERACCOUNTS - reference tables
ColumnTypeDescription
criticalInputstringCommodity name
ciUnitstringUnit of measure
osb / csbdecimalOpening / closing stock balance for the commodity
domainstringAccess domain of the user (e.g. Administrator)
useridstringUser ID
passstringPassword
TTABLELOGIN / TTABLEDATABASE / TTABLENEWDETAILS / TTABLESTOCKBOOK - shared audit table structure
ColumnTypeDescription
tididTransaction ID
doedatetimeDate of entry
domtextDomain of the user at the time of operation
userInfotextUser identity at the time of operation
typetextOperation type (e.g. Login Status, Password Change, Backup Database, Stock Detail Update)
remtextOutcome / remarks (e.g. Successful, Unsuccessful)

TTABLELOGIN records login attempts, TTABLEDATABASE records backup, scheduled backup and restore, TTABLENEWDETAILS records new users, domains and critical inputs, and TTABLESTOCKBOOK records stock detail update, edit and delete. The four tables share one schema so the audit pattern stays uniform and each stream can be reported on independently.


The Printed Statement

The stockbook statement can be produced for all critical inputs or selected ones over a chosen date range. Each row carries the commodity, unit, date, receipt memo details and quantity, disposal details, remarks and quantity, and the opening and closing balances; the report footer names the application and the print time, with space for Prepared By and Approved By.


Design Decisions & Limitations

Design Decisions

  • Entries must be sequential - nothing can be inserted before an existing entry
  • Correcting an earlier entry means deleting the later ones first, and that deletion is itself logged
  • Only the Administrator domain can delete a stock record; any domain member can create one
  • Audit streams split into separate tables by event class, all with one schema
  • Backup kept off the Windows drive, with a scheduled copy and a failsafe copy

Known Limitations

  • Windows desktop application on a single machine with a local SQL Server Express database
  • Strict entry ordering means a correction deep in history is costly by design
  • Statements are produced per critical input or a selection - no cross-commodity analytics

Code

The full source code - VB.NET forms, report definition, database files and design diagrams - is available on GitHub.

← All Projects SUBHAJITDEBNATH.COM Get in touch →