Tuesday, September 10, 2013

Java Reporting - ITEXT (sample code segment)

Reporting in Java - Itext

 Document document = new Document();
            PdfWriter.getInstance(document, new FileOutputStream("C:\\Users\\Rivi Rajapakse\\Desktop\\Report" + empid + ".pdf"));
            document.open();
            document.add(new Paragraph("-----------------------------------Thamali  Super--------------------------------", FontFactory.getFont(FontFactory.TIMES_BOLD, 18, Font.BOLD, BaseColor.BLACK)));
            document.add(new Paragraph(new Date().toString()));
            document.add(new Paragraph("----------------------------------------------------------------------------------------------------------------------------------"));
            document.add(new Paragraph("Salary Sheet of Employee NO :  " + empid));
            document.add(new Paragraph("  Month of "+ month+",   Year " + year ));
            document.add(new Paragraph("_________________________________________", FontFactory.getFont(FontFactory.TIMES_BOLD, 18, Font.BOLD, BaseColor.WHITE)));



            document.add(new Paragraph("Employee No   : " + empid, FontFactory.getFont(FontFactory.TIMES_BOLD, 12, Font.BOLD, BaseColor.BLACK)));
            document.add(new Paragraph("Employee Name : " + empName, FontFactory.getFont(FontFactory.TIMES_BOLD, 12, Font.BOLD, BaseColor.BLACK)));
            document.add(new Paragraph("Basic Salary  : " + bSal, FontFactory.getFont(FontFactory.TIMES_BOLD, 12, Font.BOLD, BaseColor.BLACK)));
            document.add(new Paragraph("Bonus         : " + bonus, FontFactory.getFont(FontFactory.TIMES_BOLD, 12, Font.BOLD, BaseColor.BLACK)));

            document.add(new Paragraph("_________________________________________", FontFactory.getFont(FontFactory.TIMES_BOLD, 18, Font.BOLD, BaseColor.WHITE)));

            document.add(new Paragraph("Total Salary    : Rs " + tot, FontFactory.getFont(FontFactory.TIMES_BOLD, 12, Font.BOLD, BaseColor.BLACK)));


            document.add(new Paragraph("_________________________________________", FontFactory.getFont(FontFactory.TIMES_BOLD, 18, Font.BOLD, BaseColor.WHITE)));
            document.add(new Paragraph("------------------------------------------------Thank you--------------------------------------------------", FontFactory.getFont(FontFactory.TIMES_BOLD, 14, Font.BOLD, BaseColor.BLACK)));
            document.close();


            Desktop desktop = Desktop.getDesktop();
            File file = new File("C:\\Users\\Rivi Rajapakse\\Desktop\\Report" + empid + ".pdf");
            desktop.open(file);

Monday, July 29, 2013

Handling Key Events ( adding a KEYPRESS event)

== Sample Code ===
-- consider about the code in RED --

if (evt.getKeyCode() == KeyEvent.VK_ENTER) {
            String name = txt_bSal.getText();
            if (name.trim().isEmpty()) {
                net_sal = 0 + Double.parseDouble(txt_bonus.getText());
                txt_NetSal.setText(Double.toString(net_sal));
            } else {
                net_sal = Double.parseDouble(txt_bSal.getText()) + Double.parseDouble(txt_bonus.getText());
                txt_NetSal.setText(Double.toString(net_sal));
            }
        }

Wednesday, June 12, 2013

ER diagram for POS system


this is the our ER diagram for the SEP project and based on the ER diagram we planned to implement our whole system. it is very easy to implement the system after decide the basis of the system called ER diagram.
In software engineering, an entity–relationship model (ER model) is a data model for describing a database in an abstract way.

Monday, June 3, 2013

project new functions.... POS system --> Advanced POS system

As our project have some more functions and methods added here are the main categories (tables) which will be in our DB.

1.    Transactions
·       Cash
·       Credit/Debit Card
·       Cheques   à only for Suppliers
2.    Employee Details
·       Super admin
·       Sub admin
·       Accountant
·       Cashier
3.    Department à (optional)
·       Managing
·       Finance etc.
4.    Salary à basic, epf, etf, ot, bonus (for good employees àtrack)
5.    Supplier Details à contact no and address **
6.    Purchase order à many PO items and total for one supplier
·       Purchase order item
7.    Stock items à include expiry date and batch no **
8.    Invoice (Bill) à for customers
9.    Customer details
10.                        Credit customer details à cash exceed amount**
11.                        Tax à tax1, tax2, tax3, tax4 and value include % **
12.                        Bank Details
·       Bank accounts details
13.                        Utility Bills à water, electricity, telephone, internet etc.
14.                        Assets Bills à for long term items (chairs, tables, machines, PCs etc.)
·       Asset item
15.                        Vehicle details à transport services
16.                        Vehicle Finance Details (OPT)
17.                        Loans à employee loan (6,12,24,36 months etc.) deduct from emp salary
18.                        Cash handling à cash details about issuing to the cashier and balancing daily
19.                        Report Generating
20.                        Menu item à. For restaurants/ hotels

Thursday, May 16, 2013

Agile Methodology

What Is Agile?

Agile methodology is an alternative to traditional project management, typically used in software development. It helps teams respond to unpredictability through incremental, iterative work cadences, known as sprints. Agile methodologies are an alternative to waterfall, or traditional sequential development.