package com.gitrekt.resort.controller;

import java.net.URL;
import java.util.ResourceBundle;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;

/**
 * FXML controller class for the customer bill view screen.
 */
public class CustomerBillScreenController implements Initializable {

    @FXML
    private Button backButton;
    
    @FXML
    private Label billTotalText;
    
    @FXML
    private Label customerNameText;
    
    @FXML
    private Label billingPeriodText;
    
    @FXML
    private Label bookingNumberText;
    
    // TODO: Fix rawtype
    @FXML
    private TableView billTable;
    
    // TODO: Fix rawtype
    @FXML
    private TableColumn itemNameColumn;
    
    // TODO: Fix rawtype
    @FXML
    private TableColumn qtyColumn;
    
    // TODO: Fix rawtype
    @FXML
    private TableColumn priceColumn;
    
    /**
     * Initializes the controller class.
     */
    @Override
    public void initialize(URL url, ResourceBundle rb) {
        // TODO
    }    
    
    public void onBackButtonClicked() {
        ScreenManager.getInstance().switchToScreen(
            "/fxml/BookingDetailsScreen.fxml"
        );
    }
    
    public void onPrintBillButtonClicked() {
        // TODO
    }
    
}

@@ -33,16 +33,185 @@
 oller;%0A%0A
+import com.gitrekt.resort.model.entities.Bill;%0Aimport com.gitrekt.resort.model.services.BillService;%0Aimport java.awt.print.PrinterException;%0Aimport java.io.IOException;%0A
 import j
@@ -1521,33 +1521,227 @@
 icked() 
-%7B%0A        // TODO
+%0A            throws IOException, PrinterException %7B%0A        // TODO: Replace with an actual bill, not an empty one.%0A        BillService billService = new BillService();%0A        billService.printBill(new Bill());
 %0A    %7D%0A 

Implement print bill button