Skip to content

Commit

Permalink
Backend Update 38
Browse files Browse the repository at this point in the history
  • Loading branch information
gayanukabulegoda committed Dec 2, 2023
1 parent b392a64 commit d0b06cb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void reportOnMouseClick(MouseEvent event) throws SQLException, JRException {
HashMap<String, Object> hashMap = new HashMap<>();

hashMap.put("date", supplierOrderDto.getDate());
hashMap.put("time", supplierOrderDto.getDate());
hashMap.put("time", supplierOrderDto.getTime());
hashMap.put("orderId", supplierOrderDto.getSupplier_Order_Id());
hashMap.put("supplierId", supplierOrderDto.getSupplier_Id());
hashMap.put("supplierName", supplierDto.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public String[] descAndUnitPriceGet(String id) throws SQLException {

public String getQtyTotal(String id) throws SQLException {

String sql = ("SELECT qty FROM product_Stock WHERE product_Id=?");
String sql = ("SELECT qty_On_Hand FROM product_Stock WHERE product_Id=?");
PreparedStatement statement = DbConnection.getInstance().getConnection().prepareStatement(sql);
statement.setString(1,id);

Expand Down
33 changes: 7 additions & 26 deletions src/main/resources/sql/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,9 @@ CREATE TABLE employee(


INSERT INTO employee (employee_Id, first_Name, last_Name, nic, house_No, street, city, contact_No, email, role, date, time, user_Name)
VALUES ('E-001', 'John', 'Doe', '200109801752', '123', 'Main Street', 'Cityville', '0702410111', '[email protected]', 'Manager', '2023-11-12', '10:15:00', 'grb');
VALUES ('E-001', 'John', 'Doe', '200109801752', '123', 'Main Street', 'Cityville', '0702410231', '[email protected]', 'Manager', '2023-11-12', '10:15:00', 'grb');


INSERT INTO employee (employee_Id, first_Name, last_Name, nic, house_No, street, city, contact_No, email, role, date, time, user_Name)
VALUES ('E-002', 'Jane', 'Smith', '200109801733', '456', 'Broadway', 'Towntown', '0702410222', '[email protected]', 'Sales staff', '2023-11-13', '10:15:00', 'rgb');


INSERT INTO employee (employee_Id, first_Name, last_Name, nic, house_No, street, city, contact_No, email, role, date, time, user_Name)
VALUES ('E-003', 'Alice', 'Johnson', '200109809912', '789', 'Park Avenue', 'Villageton', '0702410333', '[email protected]', 'Manufacturing Staff', '2023-11-14', '10:15:00', 'rgb');


INSERT INTO employee (employee_Id, first_Name, last_Name, nic, house_No, street, city, contact_No, email, role, date, time, user_Name)
VALUES ('E-004', 'Bob', 'Williams', '200109801212', '1011', 'Sunset Boulevard', 'Cityscape', '0702410444', '[email protected]', 'Other', '2023-11-15', '10:15:00', 'rgb');


INSERT INTO employee (employee_Id, first_Name, last_Name, nic, house_No, street, city, contact_No, email, role, date, time, user_Name)
VALUES ('E-005', 'Eva', 'Miller', '200109807894', '1314', 'Ocean Drive', 'Seaville', '0702410555', '[email protected]', 'Sales staff', '2023-11-16', '10:15:00', 'rgb');


CREATE TABLE user(
user_Name VARCHAR(20) PRIMARY KEY,
Expand All @@ -48,11 +33,7 @@ CREATE TABLE user(
);

INSERT INTO user (user_Name, password, employee_Id)
VALUES ('grb', '1234', 'E-001');


INSERT INTO user (user_Name, password, employee_Id)
VALUES ('rgb', '1234', 'E-002');
VALUES ('grb', '123456', 'E-001');


ALTER TABLE employee ADD CONSTRAINT user_Name FOREIGN KEY(user_Name) REFERENCES user(user_Name) ON DELETE CASCADE ON UPDATE CASCADE;
Expand All @@ -77,11 +58,11 @@ VALUES ('C-002', 'Jane Smith', '0702410222', '[email protected]', '2023-11-1


INSERT INTO customer (customer_Id, name, contact_No, email, date, time, user_Name)
VALUES ('C-003', 'Alice Johnson', '0702410333', '[email protected]', '2023-11-12', '10:15:00', 'rgb');
VALUES ('C-003', 'Alice Johnson', '0702410333', '[email protected]', '2023-11-12', '10:15:00', 'grb');


INSERT INTO customer (customer_Id, name, contact_No, email, date, time, user_Name)
VALUES ('C-004', 'Bob Williams', '0702410444', '[email protected]', '2023-11-13', '14:00:00', 'rgb');
VALUES ('C-004', 'Bob Williams', '0702410444', '[email protected]', '2023-11-13', '14:00:00', 'grb');


INSERT INTO customer (customer_Id, name, contact_No, email, date, time, user_Name)
Expand Down Expand Up @@ -132,23 +113,23 @@ CREATE TABLE supplier(
);

INSERT INTO supplier (supplier_Id, name, email, contact_No, time, date, user_Name)
VALUES ('S-001', 'ABC Suppliers', '[email protected]', '0702410111', '08:00:00', '2023-11-10', 'rgb');
VALUES ('S-001', 'ABC Suppliers', '[email protected]', '0702410111', '08:00:00', '2023-11-10', 'grb');


INSERT INTO supplier (supplier_Id, name, email, contact_No, time, date, user_Name)
VALUES ('S-002', 'XYZ Distributors', '[email protected]', '0702410222', '10:30:00', '2023-11-11', 'grb');


INSERT INTO supplier (supplier_Id, name, email, contact_No, time, date, user_Name)
VALUES ('S-003', 'LMN Traders', '[email protected]', '0702410333', '13:15:00', '2023-11-12', 'rgb');
VALUES ('S-003', 'LMN Traders', '[email protected]', '0702410333', '13:15:00', '2023-11-12', 'grb');


INSERT INTO supplier (supplier_Id, name, email, contact_No, time, date, user_Name)
VALUES ('S-004', 'PQR Importers', '[email protected]', '0702410444', '15:45:00', '2023-11-13', 'grb');


INSERT INTO supplier (supplier_Id, name, email, contact_No, time, date, user_Name)
VALUES ('S-005', 'MNO Wholesalers', '[email protected]', '0702410555', '18:20:00', '2023-11-14', 'rgb');
VALUES ('S-005', 'MNO Wholesalers', '[email protected]', '0702410555', '18:20:00', '2023-11-14', 'grb');


CREATE TABLE supplier_Order(
Expand Down

0 comments on commit d0b06cb

Please sign in to comment.