added invoice and order collection

This commit is contained in:
2023-01-07 23:14:41 +01:00
parent 58fb02875a
commit 573e17161b
6 changed files with 160 additions and 13 deletions

View File

@@ -246,20 +246,50 @@ public class ConsoleLib {
String[] foodPlanParts = Database.select("food_plan", new String[]{"date"}, new String[]{date}).get(0).split(":");
food_selectionData[1] = foodPlanParts[0];
System.out.println("Hauptspeisen: ");
System.out.println(Database.select("food",new String[]{"food"},new String[]{foodPlanParts[2]}).get(0));
System.out.println(Database.select("food",new String[]{"food"},new String[]{foodPlanParts[3]}).get(0));
System.out.println(Database.select("food",new String[]{"id"},new String[]{foodPlanParts[2]}).get(0));
System.out.println(Database.select("food",new String[]{"id"},new String[]{foodPlanParts[3]}).get(0));
System.out.print("Id: ");
food_selectionData[2] = sc.nextLine();
if(FoodMgr.createFood_selection(food_selectionData) < 1){
System.out.println("Fehler");
}
System.out.println("Nachspeisen: ");
System.out.println(Database.select("food",new String[]{"food"},new String[]{foodPlanParts[4]}).get(0));
System.out.println(Database.select("food",new String[]{"food"},new String[]{foodPlanParts[5]}).get(0));
System.out.println(Database.select("food",new String[]{"id"},new String[]{foodPlanParts[4]}).get(0));
System.out.println(Database.select("food",new String[]{"id"},new String[]{foodPlanParts[5]}).get(0));
System.out.print("Id: ");
food_selectionData[2] = sc.nextLine();
if(FoodMgr.createFood_selection(food_selectionData) < 1){
System.out.println("Fehler");
}
}
public static void dayOrderPrompt(){
System.out.println("Zusammenfassung des Tages");
System.out.print("Datum eingeben: ");
Scanner sc = new Scanner(System.in);
String date = sc.nextLine();
List<String> dayOrder = FoodMgr.getDayOrder(date);
for (String food : dayOrder) {
System.out.println(food);
}
}
public static void invoicePrompt(){
System.out.println("Monatsabrechnung");
System.out.print("Monat(YYYY-MM): ");
Scanner sc = new Scanner(System.in);
String date = sc.nextLine();
System.out.print("ID des Kindes: ");
String id = sc.nextLine();
List<String> invoice = AccountMgr.getInvoice(date,id);
printConsole(invoice);
}
public static void changePricePrompt(){
System.out.print("Neuer Preis: ");
Scanner sc = new Scanner(System.in);
double price = sc.nextDouble();
sc.nextLine();
AccountMgr.price = price;
}
}