muhammadbadrul1234 / ElDorado-Travel-and-Tour-Management-System

The main purpose of this system is to provide a efficient way for a customer to book hotels, flight, train and bus. Also it automates the processes and activities of a travel agency.
MIT License
16 stars 5 forks source link

Payment Methoods and Refund Menu #7

Open muhammadbadrul1234 opened 2 years ago

muhammadbadrul1234 commented 2 years ago

Convert Following C++ Code to JAVA https://github.com/MDBadrulAlomTawsyat/MegamartSolution_AlgorithmProject

void payment_details_of_an_invoice(); void invoice_query(); void customer_invoice(); void create_new_invoice(); void refund_invoice(); void return_payment();

niloysi commented 2 years ago

import java.util.; import java.lang.; import java.io.*;

/ Name of the class has to be "Main" only if the class is public. / class Ideone { public static void main (String[] args) throws java.lang.Exception { // your code goes here payment_details_of_an_invoice(); } private static void payment_details_of_an_invoice() { System.out.flush();

    //loading();
    //megamartlogo();

    String date, number, employee_id, name, phone_no, sum, card, cardno, otp, invoice_no;

    String searchuser;

    String consoleText =
                     "\n\n\t\t\t\t\t\t\t====================================="
                    + "\n\t\t\t\t\t\t\t|          EMPLOYEE PORTAL            |"
                    + "\n\t\t\t\t\t\t\t|        Payment Details Query        |"
                    + "\n\t\t\t\t\t\t\t======================================="
                    + "\n\t\t\t\t\t\t\t|  1. Individual Payment Details      |"
                    + "\n\t\t\t\t\t\t\t|  2. All Payment And Transaction     |"
                    + "\n\t\t\t\t\t\t\t|  3. Returned Payment And Transaction|"
                    + "\n\t\t\t\t\t\t\t|  4. Return to Previous Menu         |"
                    + "\n\t\t\t\t\t\t\t***************************************"
                    + "\n\t\t\t\t\t\t\t Enter Your choice: ";

    System.out.println(consoleText);

    Scanner scanner = new Scanner(System.in);
    int choice = scanner.nextInt();

    switch (choice) {
        case 1:

            System.out.println("\n\t\t\t\t\t\t\t Enter The Customer Name : ");
            searchuser = scanner.nextLine();

            // Get these data from database use a for loop or while loop here
            date = "";
            number = "";
            employee_id = "";
            name = "";
            phone_no = "";
            sum = "";
            card = "";
            cardno = "";
            otp = "";
            invoice_no = "";

            if (name.equals(searchuser)) {
                System.out.println("\n\t\t\t\t\t\tDetails found\n");
                System.out.flush();

                //megamartlogo();

                consoleText =
                                 "\n\n\t\t\t\t\t\t\t======================================"
                                + "\n\t\t\t\t\t\t\t|          EMPLOYEE PORTAL            |"
                                + "\n\t\t\t\t\t\t\t|        Payment Details Query        |"
                                + "\n\t\t\t\t\t\t\t======================================"
                                + "\n\n\t\t\t\t\t\t\t          Query of " + name
                                + "\n\n\t\t\t\t\t\t\t        Personal Information: "
                                + "\n\t\t\t\t\t\t\t Name        : " + name
                                + "\n\n\t\t\t\t\t\t\t        Contact Information: "
                                + "\n\t\t\t\t\t\t\t Mobile No   : " + phone_no
                                + "\n\n\t\t\t\t\t\t\t       Transaction Information: "
                                + "\n\t\t\t\t\t\t\t Date        : " + date
                                + "\n\t\t\t\t\t\t\t Sold by     : " + employee_id
                                + "\n\t\t\t\t\t\t\t Payment Type: " + card
                                + "\n\t\t\t\t\t\t\t Number      : " + cardno
                                + "\n\t\t\t\t\t\t\t Total Paid  : TK " + sum
                                + "\n\n\t\t\t\t\t\t\tPress Enter to Return to Previous Page";

                System.out.println(consoleText);
            } else {
                System.out.println("\n\t\t\t\t\t\t\t\t   Details not found!\n");
                System.out.println("\n\n\t\t\t\t\t\t\tPress Enter to Return to Previous Page");
            }
            payment_details_of_an_invoice();

            break;
        case 2:
            //loading();
            System.out.flush();
            //megamartlogo();

            consoleText =
                             "\n\t\t\t\t\t\t=========================================================="
                            + "\n\t\t\t\t\t\t|                    Employee PORTAL                     |"
                            + "\n\t\t\t\t\t\t|                All Payment And Transaction             |"
                            + "\n\t\t\t\t\t\t=========================================================="
                            + "\n_________________________________________________________________________________________________________________________________________________________________"
                            + "\n|  ID   |         NAME          |        MOBILE         |    PAYMENT METHOOD    |         NUMBER        |   TOTAL PAID  |SOLD BY|      DATE     |  INVOICE NO   |"
                            + "\n_________________________________________________________________________________________________________________________________________________________________\n";
            System.out.println(consoleText);

            // Get these data from database use a for loop or while loop here
            date = "";
            number = "";
            employee_id = "";
            name = "";
            phone_no = "";
            sum = "";
            card = "";
            cardno = "";
            otp = "";
            invoice_no = "";

            System.out.println("|  " + employee_id + "\t|  " + name + "\t\t|     " + phone_no + "\t|    " + card + "\t\t|  " + cardno + " \t|  \t" + sum + " \t|  " + employee_id + " \t|  " + date + " \t|  " + number + " \t|  " + invoice_no + "");

            System.out.println("\t\t\t\t\t\t\tPress Enter to Return to Previous Page");
            payment_details_of_an_invoice();
            break;

        case 3:
            //loading();
            System.out.flush();
            //megamartlogo();

            consoleText =
                             "\n\t\t\t\t\t\t=========================================================="
                            + "\n\t\t\t\t\t\t|                    Employee PORTAL                     |"
                            + "\n\t\t\t\t\t\t|                All Payment And Transaction             |"
                            + "\n\t\t\t\t\t\t=========================================================="
                            + "\n_________________________________________________________________________________________________________________________________________________________________"
                            + "\n|  ID   |         NAME          |        MOBILE         |    PAYMENT METHOOD    |         NUMBER        |   TOTAL PAID  |SOLD BY|      DATE     |  INVOICE NO   |"
                            + "\n_________________________________________________________________________________________________________________________________________________________________\n";
            System.out.println(consoleText);

            // Get these data from database use a for loop or while loop here
            date = "";
            number = "";
            employee_id = "";
            name = "";
            phone_no = "";
            sum = "";
            card = "";
            cardno = "";
            otp = "";
            invoice_no = "";

            System.out.println("|  " + employee_id + "\t|  " + name + "\t\t|     " + phone_no + "\t|    " + card + "\t\t|  " + cardno + " \t|  \t" + sum + " \t|  " + employee_id + " \t|  " + date + " \t|  " + number + " \t|  " + invoice_no + "-----------------------------------------------------------------------------------------------------------------------------------------------------------------\n");
            System.out.println("\t\t\t\t\t\t\tPress Enter to Return to Previous Page");
            payment_details_of_an_invoice();
            break;

        case 4:
            //employeemenu();
            break;
        default:
            System.out.println("\n\t\t\t\t\t\t\t You've made a mistake , Try again..\n");
            payment_details_of_an_invoice();
            break;
    }
}

private static void invoice_query() {
    String user, pass, u, p;
    System.out.flush();
    //megamartlogo();

    String consoleText =
                     "\n\n\t\t\t\t\t\t\t====================================="
                    + "\n\t\t\t\t\t\t\t|          EMPLOYEE PORTAL            |"
                    + "\n\t\t\t\t\t\t\t|           Invoice Query             |"
                    + "\n\t\t\t\t\t\t\t======================================="
                    + "\n\t\t\t\t\t\t\t***************************************"
                    + "\n\t\t\t\t\t\t\t|  1.  Show All Sold Invoices         |"
                    + "\n\t\t\t\t\t\t\t|  2.  Show All Returned Invoices     |"
                    + "\n\t\t\t\t\t\t\t|  3.  Show Invoices By Customer      |"
                    + "\n\t\t\t\t\t\t\t|  4.  Show Invoices By Mobile Number |"
                    + "\n\t\t\t\t\t\t\t|  5.  Show Invoices By Date          |"
                    + "\n\t\t\t\t\t\t\t|  6.  Return to Previous Menu        |"
                    + "\n\t\t\t\t\t\t\t***************************************\n";

    System.out.println(consoleText);
    System.out.println("\n\t\t\t\t\t\t\t Enter Your choice: ");

    Scanner scanner = new Scanner(System.in);
    int choice = scanner.nextInt();

    switch (choice) {

    }
}

private static void customer_invoice() {
    System.out.flush();
    //megamartlogo();

    String consoleText =
                     "\n\n\t\t\t\t\t\t\t======================================"
                    + "\n\t\t\t\t\t\t\t|          EMPLOYEE PORTAL            |"
                    + "\n\t\t\t\t\t\t\t|         Customer Invoice            |"
                    + "\n\t\t\t\t\t\t\t======================================="
                    + "\n\t\t\t\t\t\t\t|  1.  Create New Invoice             |"
                    + "\n\t\t\t\t\t\t\t|  2.  Refund of Invoice              |"
                    + "\n\t\t\t\t\t\t\t|  3.  Return to previous Menu        |"
                    + "\n\t\t\t\t\t\t\t**************************************\n";

    System.out.println(consoleText);
    System.out.println("\n\t\t\t\t\t\t\t Enter Your choice: ");

    Scanner scanner = new Scanner(System.in);
    int choice = scanner.nextInt();

    switch (choice) {
        case 1:
            create_new_invoice();
            break;

        case 2:
            //refund_invoice();
            break;

        case 3:
            //employeemenu();
            break;

        default:
            System.out.println("\n\t\t\t\t\t\t\t Sorry! I don't understand that! \n");
            customer_invoice();
            break;
    }
}

private static void create_new_invoice() {
    System.out.flush();
    //loading();
    //megamartlogo();

    String consoleText =
                     "\n\n\t\t\t\t\t\t\t======================================"
                    + "\n\t\t\t\t\t\t\t|          EMPLOYEE PORTAL            |"
                    + "\n\t\t\t\t\t\t\t|        New Customer Invoice         |"
                    + "\n\t\t\t\t\t\t\t=======================================";

    System.out.println(consoleText);

    Scanner scanner = new Scanner(System.in);

    String employee_id;
    System.out.println("\n\t\t\t\t\t\t\t Employee_ID: ");
    employee_id = scanner.nextLine();

    String number;
    System.out.println("\t\t\t\t\t\t\t Type Order no: ");
    number = scanner.nextLine();

    String date;
    System.out.println("\t\t\t\t\t\t\t Enter Date : ");
    date = scanner.nextLine();

    String name;
    System.out.println("\t\t\t\t\t\t\t Enter Customer Name: ");
    name = scanner.nextLine();

    String phone;
    System.out.println("\t\t\t\t\t\t\t Phone No: ");
    phone = scanner.nextLine();

    String product;
    System.out.println("\t\t\t\t\t\t\t How many Product would you like to order: ");
    product = scanner.nextLine();

    String id, name1, net, sellingprice, buyingprice, quantity, profit, sellingprice1;
    double sellingprice2, buyingprice2, profit2;

    consoleText =
             "\n\t\t\t\t_________________________________________________________________________________________"
            +"\n\t\t\t\t|  ID   |         NAME          |      WEIGHT      |      PRICE         |    QUANTITY   |"
            +"\n\t\t\t\t_________________________________________________________________________________________\n";

    System.out.println(consoleText);

    // get these data from database use
    id = "";
    name1 = "";
    net = "";
    sellingprice = "";
    buyingprice = "";
    sellingprice1 = "";
    quantity = "";
    profit = "";

    System.out.println("\t\t\t\t|  "+id+"\t|  "+name1+"\t\t|      "+net+"\t   |      "+sellingprice+" \t|    "+quantity+" \t|");

    //order taking

    int x, menu2;

    int i;

    double amount;

    int quantity1;

    String id1;

    int sum=0;
    int sum1=0;
    int sum2=0;

    int Unit_Total;
    int Unit_Total2;

    //do database works here
}

}