first commit
This commit is contained in:
@@ -0,0 +1,416 @@
|
||||
package Controllers.FactureClt;
|
||||
|
||||
|
||||
import Models.CommandeClt.CommandeCltDB;
|
||||
import Models.CommandeClt.CommandeCltListe;
|
||||
import com.gluonhq.charm.glisten.control.ProgressBar;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.ResourceBundle;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javafx.beans.value.ChangeListener;
|
||||
import javafx.beans.value.ObservableValue;
|
||||
import javafx.collections.FXCollections;
|
||||
import javafx.collections.ObservableList;
|
||||
import javafx.concurrent.Service;
|
||||
import javafx.concurrent.Task;
|
||||
import javafx.concurrent.WorkerStateEvent;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.Group;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.ChoiceBox;
|
||||
import javafx.scene.control.DatePicker;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.RadioButton;
|
||||
import javafx.scene.control.TableCell;
|
||||
import javafx.scene.control.TableColumn;
|
||||
import javafx.scene.control.TableView;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.control.cell.PropertyValueFactory;
|
||||
import javafx.scene.image.Image;
|
||||
import javafx.scene.image.ImageView;
|
||||
import javafx.scene.input.KeyCode;
|
||||
import javafx.scene.input.KeyEvent;
|
||||
import javafx.scene.input.MouseEvent;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import javafx.scene.text.Text;
|
||||
import javafx.util.Callback;
|
||||
|
||||
/**
|
||||
* FXML Controller class
|
||||
* @author Maher Ben Tili
|
||||
*/
|
||||
public class FactureCltAjouterController implements Initializable {
|
||||
|
||||
@FXML private AnchorPane PaneFactCltAjouter ;
|
||||
|
||||
@FXML private ProgressBar ProgressBarFactureCltCommande;
|
||||
|
||||
@FXML private Button ButtonSearchFactureCltCommande ;
|
||||
|
||||
@FXML private Text ActuellePage ;
|
||||
@FXML private Text NbrPage ;
|
||||
@FXML private Group nextgroupe ;
|
||||
@FXML private Group avancergroupe ;
|
||||
@FXML private Group lastgroupe ;
|
||||
@FXML private Group retourgroupe ;
|
||||
@FXML private Label LabelCount;
|
||||
@FXML private ChoiceBox NbrLigne ;
|
||||
|
||||
|
||||
ObservableList cursors = FXCollections.observableArrayList("10","15","20");
|
||||
private Integer nbrligne = 10 ;
|
||||
private Integer totalcount = 0 ;
|
||||
private Integer nbrpage = 0;
|
||||
private Integer actuellepage = 1;
|
||||
Integer position = 0;
|
||||
|
||||
@FXML public TableView<CommandeCltListe> TableViewGestionCommande;
|
||||
|
||||
@FXML public TableColumn<CommandeCltListe ,String> TabColCodeCommande;
|
||||
@FXML public TableColumn<CommandeCltListe ,String> TabColModePaiement;
|
||||
@FXML public TableColumn<CommandeCltListe ,String> TabColTypeClient;
|
||||
@FXML public TableColumn<CommandeCltListe ,String> TabColCodeClient;
|
||||
@FXML public TableColumn<CommandeCltListe ,String> TabColTotalCommande;
|
||||
@FXML public TableColumn<CommandeCltListe ,String> TabColDateCreation ;
|
||||
@FXML public TableColumn<CommandeCltListe ,Boolean>TabColAction ;
|
||||
|
||||
@FXML public TextField TextFieldCodeCommande;
|
||||
@FXML public TextField TextFieldCodeClient;
|
||||
@FXML public TextField TextFieldNameClient;
|
||||
@FXML public TextField TextFieldCodeDevis;
|
||||
@FXML public DatePicker DatePickerCreation;
|
||||
@FXML public RadioButton RadioComptant;
|
||||
@FXML public RadioButton RadioFacilite;
|
||||
|
||||
private Service<Void> ThreadSearchFactureCltCommande;
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
//comboboxnombre des lignes tableview
|
||||
NbrLigne.setItems(cursors);
|
||||
NbrLigne.getSelectionModel().selectFirst();
|
||||
|
||||
TableViewGestionCommande.setEditable(true);
|
||||
|
||||
TabColCodeCommande.setStyle( "-fx-alignment: CENTER;");TabColCodeCommande.getStyleClass().add("Center");
|
||||
TabColCodeCommande.setCellValueFactory(new PropertyValueFactory<CommandeCltListe, String>("CodeCommande"));
|
||||
|
||||
TabColTypeClient.setStyle( "-fx-alignment: CENTER;");TabColTypeClient.getStyleClass().add("Center");
|
||||
TabColTypeClient.setCellValueFactory(new PropertyValueFactory<CommandeCltListe, String>("TypeClient"));
|
||||
|
||||
TabColCodeClient.setStyle( "-fx-alignment: CENTER;");TabColCodeClient.getStyleClass().add("Center");
|
||||
TabColCodeClient.setCellValueFactory(new PropertyValueFactory<CommandeCltListe, String>("CodeClient"));
|
||||
|
||||
TabColModePaiement.setStyle( "-fx-alignment: CENTER;");TabColModePaiement.getStyleClass().add("Center");
|
||||
TabColModePaiement.setCellValueFactory(new PropertyValueFactory<CommandeCltListe, String>("ModePaiement"));
|
||||
|
||||
TabColTotalCommande.setStyle( "-fx-alignment: CENTER;");TabColTotalCommande.getStyleClass().add("Center");
|
||||
TabColTotalCommande.setCellValueFactory(new PropertyValueFactory<CommandeCltListe, String>("TotalCommande"));
|
||||
|
||||
TabColDateCreation.setStyle( "-fx-alignment: CENTER;");TabColDateCreation.getStyleClass().add("Center");
|
||||
TabColDateCreation.setCellValueFactory(new PropertyValueFactory<CommandeCltListe, String>("DateCreation"));
|
||||
|
||||
TabColAction.setSortable(true);
|
||||
TabColAction.setStyle( "-fx-alignment: CENTER;");TabColAction.getStyleClass().add("Center");
|
||||
TabColAction.setCellFactory(new Callback<TableColumn<CommandeCltListe, Boolean>, TableCell<CommandeCltListe, Boolean>>() {
|
||||
@Override
|
||||
public TableCell<CommandeCltListe, Boolean> call(TableColumn<CommandeCltListe, Boolean> personBooleanTableColumn) {
|
||||
return new ButtonCell();
|
||||
}
|
||||
});
|
||||
|
||||
ButtonSearchFactureCltCommande.setOnMouseClicked(new EventHandler<MouseEvent>() {
|
||||
public void handle(MouseEvent me) {
|
||||
SearchFactureCltCommande();
|
||||
}
|
||||
});
|
||||
|
||||
PaneFactCltAjouter.setOnKeyPressed(new EventHandler<KeyEvent>() {
|
||||
@Override
|
||||
public void handle(KeyEvent ke) {
|
||||
if (ke.getCode().equals(KeyCode.ENTER)) {
|
||||
SearchFactureCltCommande();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
RadioComptant.setOnMouseClicked(new EventHandler<MouseEvent>() {
|
||||
public void handle(MouseEvent me) {
|
||||
SearchFactureCltCommande();
|
||||
}
|
||||
});
|
||||
|
||||
RadioFacilite.setOnMouseClicked(new EventHandler<MouseEvent>() {
|
||||
public void handle(MouseEvent me) {
|
||||
SearchFactureCltCommande();
|
||||
}
|
||||
});
|
||||
|
||||
GestionSearchFactureCltCommande();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//Define the button cell
|
||||
private class ButtonCell extends TableCell<CommandeCltListe, Boolean> {
|
||||
|
||||
final Button cellButton = new Button();
|
||||
ButtonCell(){
|
||||
cellButton.getStyleClass().add("btn-icon-primary");
|
||||
Image coffeeImage = new Image(getClass().getResourceAsStream("/Public/icon/iconedit.png"));
|
||||
ImageView buttonGraphic = new ImageView();
|
||||
buttonGraphic.setImage(coffeeImage);
|
||||
cellButton.setGraphic(buttonGraphic);
|
||||
cellButton.setOnAction(new EventHandler<ActionEvent>(){ //Action when the button is pressed
|
||||
@Override
|
||||
public void handle(ActionEvent t) {
|
||||
try {
|
||||
// get Selected Item
|
||||
CommandeCltListe current = (CommandeCltListe) ButtonCell.this.getTableView().getItems().get(ButtonCell.this.getIndex());
|
||||
String codeCommande = current.getCodeCommande();
|
||||
|
||||
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/Views/FactureClt/FactureCltAjouterDetailSelect.fxml"));
|
||||
Parent NodeDetailSelect = (Parent)fxmlLoader.load();
|
||||
FactureCltAjouterDetailSelectController FactureCltAjouterDetailSelect = fxmlLoader.getController();
|
||||
FactureCltAjouterDetailSelect.setDataCommande(codeCommande);
|
||||
PaneFactCltAjouter.getChildren().clear();
|
||||
PaneFactCltAjouter.getChildren().add(NodeDetailSelect);
|
||||
} catch (IOException ex) {
|
||||
Logger.getLogger(FactureCltAjouterController.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
//Display button if the row is not empty
|
||||
@Override
|
||||
protected void updateItem(Boolean t, boolean empty) {
|
||||
if(!empty){
|
||||
setGraphic(cellButton);
|
||||
} else {
|
||||
setGraphic(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/****************************************************************************** *
|
||||
* *
|
||||
* Methode last Next TableView *
|
||||
* * *
|
||||
******************************************************************************/
|
||||
|
||||
private void SearchFactureCltCommande()
|
||||
{
|
||||
ProgressBarFactureCltCommande.setVisible(true);
|
||||
|
||||
ButtonSearchFactureCltCommande.setDisable(true);
|
||||
|
||||
ThreadSearchFactureCltCommande = new Service<Void>(){
|
||||
@Override
|
||||
protected Task<Void> createTask(){
|
||||
return new Task<Void>(){
|
||||
@Override
|
||||
protected Void call() throws Exception{
|
||||
|
||||
position = 0;
|
||||
|
||||
actuellepage = 1;
|
||||
|
||||
String DateCreation = "";
|
||||
if(DatePickerCreation.getValue() != null){
|
||||
DateCreation = DatePickerCreation.getValue().toString();
|
||||
}
|
||||
|
||||
// 0comptant 1facilité
|
||||
String TypeRegement = "";
|
||||
if(RadioComptant.isSelected()){
|
||||
TypeRegement = "0";
|
||||
}else if(RadioFacilite.isSelected()){
|
||||
TypeRegement = "1";
|
||||
}
|
||||
|
||||
ObservableList<CommandeCltListe> ListFactureCltCommandes = new CommandeCltDB().SearchCommande(
|
||||
position,
|
||||
nbrligne,
|
||||
TypeRegement,
|
||||
TextFieldCodeCommande.getText(),
|
||||
TextFieldCodeClient.getText(),
|
||||
TextFieldNameClient.getText(),
|
||||
TextFieldCodeDevis.getText(),
|
||||
DateCreation);
|
||||
|
||||
TableViewGestionCommande.setItems(ListFactureCltCommandes);
|
||||
|
||||
totalcount = new CommandeCltDB().nbrSearchCommande(TypeRegement, TextFieldCodeCommande.getText(), TextFieldCodeClient.getText(), TextFieldNameClient.getText(), TextFieldCodeDevis.getText(), DateCreation);
|
||||
|
||||
if(totalcount > 0){
|
||||
ActuellePage.setText("1");
|
||||
}else{
|
||||
ActuellePage.setText("0");
|
||||
}
|
||||
|
||||
if(totalcount % nbrligne==0){
|
||||
nbrpage = totalcount / nbrligne ;
|
||||
}
|
||||
else{
|
||||
nbrpage = (totalcount / nbrligne) + 1 ;
|
||||
}
|
||||
NbrPage.setText(Integer.toString(nbrpage));
|
||||
|
||||
return null;
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
ThreadSearchFactureCltCommande.setOnSucceeded(new EventHandler<WorkerStateEvent>(){
|
||||
@Override
|
||||
public void handle(WorkerStateEvent event){
|
||||
ProgressBarFactureCltCommande.setVisible(false);
|
||||
ButtonSearchFactureCltCommande.setDisable(false);
|
||||
LabelCount.setText(totalcount.toString());
|
||||
|
||||
}
|
||||
});
|
||||
ThreadSearchFactureCltCommande.start();
|
||||
}
|
||||
|
||||
|
||||
private void NextLastSearchFactureCltCommande(Integer ParmPosition, Integer ParamNbrligne)
|
||||
{
|
||||
ProgressBarFactureCltCommande.setVisible(true);
|
||||
|
||||
ButtonSearchFactureCltCommande.setDisable(true);
|
||||
|
||||
ThreadSearchFactureCltCommande = new Service<Void>(){
|
||||
@Override
|
||||
protected Task<Void> createTask(){
|
||||
return new Task<Void>(){
|
||||
@Override
|
||||
protected Void call() throws Exception{
|
||||
|
||||
String DateCreation = "";
|
||||
if(DatePickerCreation.getValue() != null){
|
||||
DateCreation = DatePickerCreation.getValue().toString();
|
||||
}
|
||||
|
||||
// 0comptant 1facilité
|
||||
String TypeRegement = "";
|
||||
if(RadioComptant.isSelected()){
|
||||
TypeRegement = "0";
|
||||
}else if(RadioFacilite.isSelected()){
|
||||
TypeRegement = "1";
|
||||
}
|
||||
|
||||
ObservableList<CommandeCltListe> ListFactureCltCommandes = new CommandeCltDB().SearchCommande(ParmPosition, ParamNbrligne, TypeRegement, TextFieldCodeCommande.getText(), TextFieldCodeClient.getText(), TextFieldNameClient.getText(), TextFieldCodeDevis.getText(), DateCreation);
|
||||
|
||||
TableViewGestionCommande.setItems(ListFactureCltCommandes);
|
||||
|
||||
return null;
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
ThreadSearchFactureCltCommande.setOnSucceeded(new EventHandler<WorkerStateEvent>(){
|
||||
@Override
|
||||
public void handle(WorkerStateEvent event){
|
||||
ProgressBarFactureCltCommande.setVisible(false);
|
||||
ButtonSearchFactureCltCommande.setDisable(false);
|
||||
}
|
||||
});
|
||||
ThreadSearchFactureCltCommande.start();
|
||||
}
|
||||
|
||||
private void GestionSearchFactureCltCommande()
|
||||
{
|
||||
NbrLigne.getSelectionModel().selectedIndexProperty().addListener(new ChangeListener<Number>() {
|
||||
|
||||
public void changed(ObservableValue ov, Number value, Number new_value) {
|
||||
nbrligne= Integer.parseInt((String) cursors.get(new_value.intValue()));
|
||||
if(totalcount % nbrligne==0){ nbrpage = totalcount / nbrligne ;}
|
||||
else{ nbrpage = (totalcount / nbrligne) + 1 ; }
|
||||
NbrPage.setText(Integer.toString(nbrpage));
|
||||
position=0;
|
||||
ActuellePage.setText("1");
|
||||
actuellepage=1;
|
||||
NextLastSearchFactureCltCommande(position, nbrligne);
|
||||
}
|
||||
});
|
||||
|
||||
if(totalcount % nbrligne==0){ nbrpage = totalcount / nbrligne ;}
|
||||
else{ nbrpage = (totalcount / nbrligne) + 1 ; }
|
||||
NbrPage.setText(Integer.toString(nbrpage));
|
||||
|
||||
|
||||
//next page
|
||||
nextgroupe.setOnMousePressed(new EventHandler<MouseEvent>(){
|
||||
@Override
|
||||
public void handle(MouseEvent event) {
|
||||
if(actuellepage<nbrpage)
|
||||
{
|
||||
position=position+nbrligne;
|
||||
NextLastSearchFactureCltCommande(position, nbrligne);
|
||||
actuellepage=actuellepage+1 ;
|
||||
ActuellePage.setText(Integer.toString(actuellepage));
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//last page
|
||||
lastgroupe.setOnMousePressed(new EventHandler<MouseEvent>(){
|
||||
@Override
|
||||
public void handle(MouseEvent event) {
|
||||
if(actuellepage>1)
|
||||
{
|
||||
position=position-nbrligne;
|
||||
NextLastSearchFactureCltCommande(position, nbrligne);
|
||||
actuellepage=actuellepage-1 ;
|
||||
ActuellePage.setText(Integer.toString(actuellepage));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//next page avec pas de 5
|
||||
avancergroupe.setOnMousePressed(new EventHandler<MouseEvent>(){
|
||||
@Override
|
||||
public void handle(MouseEvent event) {
|
||||
if(actuellepage+3<nbrpage)
|
||||
{
|
||||
position=(position+4)+nbrligne;
|
||||
NextLastSearchFactureCltCommande(position, nbrligne);
|
||||
actuellepage=actuellepage+3 ;
|
||||
ActuellePage.setText(Integer.toString(actuellepage));
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//last page avec un pas de -5
|
||||
retourgroupe.setOnMousePressed(new EventHandler<MouseEvent>(){
|
||||
@Override
|
||||
public void handle(MouseEvent event) {
|
||||
if(actuellepage-3>1){
|
||||
position=(position-4)-nbrligne;
|
||||
NextLastSearchFactureCltCommande(position, nbrligne);
|
||||
actuellepage=actuellepage-3 ;
|
||||
ActuellePage.setText(Integer.toString(actuellepage));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,184 @@
|
||||
package Controllers.FactureClt;
|
||||
|
||||
import Controllers.Traitement.Adaptateur;
|
||||
import Models.Produit.ListeProduit;
|
||||
import Controllers.Traitement.ParametreSystem;
|
||||
import Models.CommandeClt.CommandeClt;
|
||||
import Models.CommandeClt.CommandeCltDB;
|
||||
import Models.FactureClt.FactureClt;
|
||||
import Models.User.User;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.Date;
|
||||
import java.util.ResourceBundle;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.Node;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.control.TableColumn;
|
||||
import javafx.scene.control.TableView;
|
||||
import javafx.scene.control.cell.PropertyValueFactory;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import javafx.scene.text.Text;
|
||||
|
||||
/**
|
||||
* FXML Controller class
|
||||
* @author Maher Ben Tili
|
||||
*/
|
||||
public class FactureCltAjouterDetailSelectController implements Initializable {
|
||||
|
||||
@FXML private AnchorPane AnchorPaneFactAddDetailSelect ;
|
||||
|
||||
private String TypeRegement;
|
||||
public CommandeClt Commande;
|
||||
public FactureClt Facture = new FactureClt();
|
||||
@FXML private Text InfoCltNom ;
|
||||
@FXML private Text InfoCltPrenom ;
|
||||
@FXML private Text InfoCltAdress ;
|
||||
@FXML private Text InfoCommCode ;
|
||||
@FXML private Text InfoCommDateCreation ;
|
||||
@FXML private Text InfoCommTypeReglement ;
|
||||
@FXML private Text InfoCommTotalTVA ;
|
||||
@FXML private Text InfoCommRemise ;
|
||||
@FXML private Text InfoCommTotalHTNet ;
|
||||
@FXML private Text InfoCommNetAPayer ;
|
||||
@FXML private Text TextPrenomMatricule;
|
||||
|
||||
@FXML private TableView<ListeProduit> TableViewListeProduitCommClt ;
|
||||
@FXML private TableColumn<ListeProduit ,String> TabColReference;
|
||||
@FXML private TableColumn<ListeProduit ,String> TabColDesignaton;
|
||||
@FXML private TableColumn<ListeProduit ,String> TabColQuantite ;
|
||||
@FXML private TableColumn<ListeProduit ,String> TabColPrixHT;
|
||||
@FXML private TableColumn<ListeProduit ,String> TabColRemise;
|
||||
@FXML private TableColumn<ListeProduit ,String> TabColTotalHT;
|
||||
@FXML private TableColumn<ListeProduit ,String> TabColTVA;
|
||||
@FXML private TableColumn<ListeProduit ,String> TabColTotalTTC;
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
|
||||
TableViewListeProduitCommClt.setEditable(false);
|
||||
|
||||
TabColReference.setCellValueFactory(new PropertyValueFactory<ListeProduit, String>("reference"));
|
||||
TabColDesignaton.setCellValueFactory(new PropertyValueFactory<ListeProduit, String>("designation"));
|
||||
|
||||
TabColQuantite.setCellValueFactory(new PropertyValueFactory<ListeProduit, String>("quantite"));
|
||||
TabColQuantite.setStyle( "-fx-alignment: CENTER; -fx-font-weight:bold; -fx-font-size: 10pt;");
|
||||
TabColQuantite.getStyleClass().add("Center");
|
||||
|
||||
TabColPrixHT.setCellValueFactory(new PropertyValueFactory<ListeProduit, String>("PrixHT"));
|
||||
TabColPrixHT.setStyle( "-fx-alignment: CENTER;");
|
||||
TabColPrixHT.getStyleClass().add("Center");
|
||||
|
||||
TabColRemise.setCellValueFactory(new PropertyValueFactory<ListeProduit, String>("Remise"));
|
||||
TabColRemise.setStyle( "-fx-alignment: CENTER;");
|
||||
TabColRemise.getStyleClass().add("Center");
|
||||
|
||||
TabColTotalHT.setCellValueFactory(new PropertyValueFactory<ListeProduit, String>("TotalHT"));
|
||||
TabColTotalHT.setStyle( "-fx-alignment: CENTER;");
|
||||
TabColTotalHT.getStyleClass().add("Center");
|
||||
|
||||
TabColTVA.setCellValueFactory(new PropertyValueFactory<ListeProduit, String>("TVA"));
|
||||
TabColTVA.setStyle( "-fx-alignment: CENTER;");
|
||||
TabColTVA.getStyleClass().add("Center");
|
||||
|
||||
TabColTotalTTC.setCellValueFactory(new PropertyValueFactory<ListeProduit, String>("TotalTTC"));
|
||||
TabColTotalTTC.setStyle( "-fx-alignment: CENTER; -fx-font-weight:bold; -fx-font-size: 10pt;");
|
||||
TabColTotalTTC.getStyleClass().add("Center");
|
||||
|
||||
}
|
||||
|
||||
public void setDataCommande(String CodeCommande){
|
||||
CommandeCltDB CommandeDB = new CommandeCltDB();
|
||||
Commande = CommandeDB.getCommandeClt(CodeCommande);
|
||||
|
||||
if(Commande.getTypeClient()==0){
|
||||
InfoCltNom.setText(Commande.CltPersonne.getNom());
|
||||
InfoCltPrenom.setText(Commande.CltPersonne.getPrenom());
|
||||
InfoCltAdress.setText(Commande.CltPersonne.getAdresse());
|
||||
}
|
||||
|
||||
if(Commande.getTypeClient()==1){
|
||||
InfoCltNom.setText(Commande.CltEntreprise.getNom());
|
||||
InfoCltPrenom.setText(Commande.CltEntreprise.getMatricule());
|
||||
InfoCltAdress.setText(Commande.CltEntreprise.getAdresse());
|
||||
TextPrenomMatricule.setText("Matricule");
|
||||
}
|
||||
|
||||
if(Commande.getTypeClient()==2){
|
||||
InfoCltNom.setText(Commande.CltPassager.getNom());
|
||||
InfoCltPrenom.setText(Commande.CltPassager.getPrenom());
|
||||
InfoCltAdress.setText(Commande.CltPassager.getAdresse());
|
||||
}
|
||||
|
||||
//Adaptateur.StringToStringEspaceCurrency()
|
||||
InfoCommCode.setText(Commande.getCodecommandeclt());
|
||||
InfoCommDateCreation.setText(Adaptateur.NormalDateFormat(Commande.getDate()));
|
||||
InfoCommTypeReglement.setText(Commande.getTypeRegementString());
|
||||
TypeRegement = Commande.getTypeRegement();
|
||||
InfoCommTotalTVA.setText(Adaptateur.StringToStringEspaceCurrency(Commande.getTotalTVA()));
|
||||
InfoCommRemise.setText(Adaptateur.StringToStringEspaceCurrency(Commande.getRemise()));
|
||||
InfoCommTotalHTNet.setText(Adaptateur.StringToStringEspaceCurrency(Commande.getTotalHorsTaxNet()));
|
||||
InfoCommNetAPayer.setText(Adaptateur.StringToStringEspaceCurrency(Commande.getNetAPayer()));
|
||||
TableViewListeProduitCommClt.setItems(Commande.getListeproduit());
|
||||
this.SetDataFacture();
|
||||
}
|
||||
|
||||
public void SetDataFacture(){
|
||||
Facture.setIdCommandeClt(Commande.getCodecommandeclt());
|
||||
Facture.setIdBonLivraisonClt(Commande.getCodeBonLivraison());
|
||||
|
||||
Facture.setTypeClient(Commande.getTypeClient());
|
||||
|
||||
if(Commande.getTypeClient() == 0){
|
||||
Facture.setCltPersonne(Commande.getCltPersonne());
|
||||
}else if(Commande.getTypeClient() == 1){
|
||||
Facture.setCltEntreprise(Commande.getCltEntreprise());
|
||||
}else if(Commande.getTypeClient() == 2){
|
||||
Facture.setCltPassager(Commande.getCltPassager());
|
||||
}
|
||||
Facture.setDateFacture(new Date().toString());
|
||||
Facture.setTypeRegement(Commande.getTypeRegement());
|
||||
Facture.setNetAPayer(Commande.getNetAPayer());
|
||||
Facture.setTotalTVA(Commande.getTotalTVA());
|
||||
Facture.setTotalHorsTaxNet(Commande.getTotalHorsTaxNet());
|
||||
Facture.setRemise(Commande.getRemise());
|
||||
Facture.setTimbre(Commande.getTimbre());
|
||||
Facture.setDevise(Commande.getCodeDevis());
|
||||
Facture.setCodeUser(User.idprofile);
|
||||
}
|
||||
|
||||
|
||||
//Boutton Présédent
|
||||
@FXML
|
||||
private void FactureCltAjouterButtonAction(ActionEvent event) throws IOException {
|
||||
AnchorPaneFactAddDetailSelect.getChildren().clear();
|
||||
AnchorPaneFactAddDetailSelect.getChildren().add((Node) FXMLLoader.load(getClass().getResource("/Views/FactureClt/FactureCltAjouter.fxml")));
|
||||
}
|
||||
|
||||
//Boutton Suivant
|
||||
@FXML
|
||||
private void FactureCltPaiementButtonAction(ActionEvent event) throws IOException {
|
||||
AnchorPaneFactAddDetailSelect.getChildren().clear();
|
||||
if(TypeRegement.equals("0")){
|
||||
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/Views/FactureClt/FactureCltAjouterPaiementComptent.fxml"));
|
||||
Parent NodeAjouterPaiementComptent = (Parent)fxmlLoader.load();
|
||||
FactureCltAjouterPaiementComptentController FactureCltAjouterPaiementComptent = fxmlLoader.getController();
|
||||
FactureCltAjouterPaiementComptent.commande = Commande;
|
||||
FactureCltAjouterPaiementComptent.TextNetaPayer.setText(Adaptateur.StringToStringEspaceCurrency(Commande.getNetAPayer()));
|
||||
AnchorPaneFactAddDetailSelect.getChildren().add(NodeAjouterPaiementComptent);
|
||||
}
|
||||
else if(TypeRegement.equals("1")){
|
||||
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/Views/FactureClt/FactureCltAjouterPaiementFacilite.fxml"));
|
||||
Parent NodeAjouterPaiementFacilite= (Parent)fxmlLoader.load();
|
||||
FactureCltAjouterPaiementFaciliteController FactureCltAjouterPaiementFacilite= fxmlLoader.getController();
|
||||
FactureCltAjouterPaiementFacilite.commande = Commande;
|
||||
FactureCltAjouterPaiementFacilite.Facture = Facture;
|
||||
FactureCltAjouterPaiementFacilite.TextNetaPayer.setText(Adaptateur.StringToStringEspaceCurrency(Commande.getNetAPayer()));
|
||||
AnchorPaneFactAddDetailSelect.getChildren().add(NodeAjouterPaiementFacilite);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,209 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package Controllers.FactureClt;
|
||||
|
||||
import Controllers.Traitement.ParametreSystem;
|
||||
import Models.CommandeClt.CommandeClt;
|
||||
import Models.FactureClt.FactureClt;
|
||||
import Models.ChequeClt.ChequeList;
|
||||
import Models.FactureClt.FactureCltChequeListe;
|
||||
import Models.FactureClt.FactureCltDB;
|
||||
import Models.TraiteClt.TraiteList;
|
||||
import Models.FactureClt.FactureCltTraiteListe;
|
||||
import Models.ChequeClt.ChequeClt;
|
||||
import Models.TraiteClt.TraiteClt;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.ResourceBundle;
|
||||
import javafx.collections.FXCollections;
|
||||
import javafx.collections.ObservableList;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.control.TableColumn;
|
||||
import javafx.scene.control.TableView;
|
||||
import javafx.scene.control.cell.PropertyValueFactory;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import javafx.scene.text.Text;
|
||||
|
||||
/**
|
||||
* FXML Controller class
|
||||
*
|
||||
* @author PC-Maher
|
||||
*/
|
||||
public class FactureCltAjouterDetailTraiteController implements Initializable {
|
||||
|
||||
@FXML private AnchorPane PaneFactureCltAjouterDetailTraite;
|
||||
|
||||
@FXML public AnchorPane PaneTableViewTraites ;
|
||||
@FXML public AnchorPane PaneTableViewCheques;
|
||||
|
||||
@FXML public Text TextNom ;
|
||||
@FXML public Text TextPrenomMatricule;
|
||||
@FXML public Text TextPrenom ;
|
||||
@FXML public Text TextAdress ;
|
||||
|
||||
@FXML public Text TextAvance ;
|
||||
@FXML public Text TextTypeReglement ; // Traite | Cheque
|
||||
@FXML public Text TextMontantInteret ;
|
||||
|
||||
|
||||
@FXML public Text TextDetail ;
|
||||
@FXML public Text TextNbrTraite ;
|
||||
@FXML public Text TextBanque ;
|
||||
@FXML public Text Banque ;
|
||||
@FXML public Text TextMontantTraite ;
|
||||
@FXML public Text ValMontantTraite;
|
||||
@FXML public TableView<FactureCltTraiteListe> TableViewListeTraites ;
|
||||
@FXML public TableColumn<FactureCltTraiteListe ,String> TabColDateTraites;
|
||||
@FXML public TableColumn<FactureCltTraiteListe ,String> TabColMontantTraites;
|
||||
|
||||
@FXML public TableView<FactureCltChequeListe> TableViewListeCheques ;
|
||||
@FXML public TableColumn<FactureCltChequeListe ,String> TabColDateCheques;
|
||||
@FXML public TableColumn<FactureCltChequeListe ,String> TabColNumeroCheques;
|
||||
@FXML public TableColumn<FactureCltChequeListe ,String> TabColBanqueCheques;
|
||||
@FXML public TableColumn<FactureCltChequeListe ,String> TabColMontantCheques;
|
||||
|
||||
final ObservableList<FactureCltTraiteListe> dataListe = FXCollections.observableArrayList();
|
||||
final ObservableList<FactureCltChequeListe> dataListeCheque = FXCollections.observableArrayList();
|
||||
|
||||
public ObservableList<TraiteList> data_List_Traite = FXCollections.observableArrayList();
|
||||
public ObservableList<ChequeList> data_List_Cheque = FXCollections.observableArrayList();
|
||||
|
||||
public boolean TypeFacilite = true; // True Traite | False Cheque
|
||||
|
||||
public CommandeClt commande;
|
||||
public FactureClt Facture ;
|
||||
public String TextTauxInteret;
|
||||
public String Net_A_Payer;
|
||||
public String Avance ;
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
TabColDateTraites.setStyle( "-fx-alignment: CENTER;");
|
||||
TabColDateTraites.getStyleClass().add("Center");
|
||||
TabColDateTraites.setCellValueFactory(new PropertyValueFactory<FactureCltTraiteListe, String>("DateTraites"));
|
||||
|
||||
TabColMontantTraites.setStyle( "-fx-alignment: CENTER;");
|
||||
TabColMontantTraites.getStyleClass().add("Center");
|
||||
TabColMontantTraites.setCellValueFactory(new PropertyValueFactory<FactureCltTraiteListe, String>("MontantTraites"));
|
||||
|
||||
TabColDateCheques.setStyle( "-fx-alignment: CENTER;");
|
||||
TabColDateCheques.getStyleClass().add("Center");
|
||||
TabColDateCheques.setCellValueFactory(new PropertyValueFactory<FactureCltChequeListe, String>("DateCheques"));
|
||||
|
||||
TabColNumeroCheques.setStyle( "-fx-alignment: CENTER;");
|
||||
TabColNumeroCheques.getStyleClass().add("Center");
|
||||
TabColNumeroCheques.setCellValueFactory(new PropertyValueFactory<FactureCltChequeListe, String>("NumeroCheques"));
|
||||
|
||||
TabColBanqueCheques.setStyle( "-fx-alignment: CENTER;");
|
||||
TabColBanqueCheques.getStyleClass().add("Center");
|
||||
TabColBanqueCheques.setCellValueFactory(new PropertyValueFactory<FactureCltChequeListe, String>("BanqueCheques"));
|
||||
|
||||
TabColMontantCheques.setStyle( "-fx-alignment: CENTER;");
|
||||
TabColMontantCheques.getStyleClass().add("Center");
|
||||
TabColMontantCheques.setCellValueFactory(new PropertyValueFactory<FactureCltChequeListe, String>("MontantCheques"));
|
||||
|
||||
|
||||
}
|
||||
public void SetDataTraiteFacilite(FactureClt facture){
|
||||
this.Facture = facture;
|
||||
TextAvance.setText(Facture.getAvance()+" "+ParametreSystem.CurrencySign);
|
||||
TextMontantInteret.setText(Facture.getMontantInteret());
|
||||
ValMontantTraite.setText(Facture.getTotalMontantTraite()+" "+ParametreSystem.CurrencySign);
|
||||
TextNbrTraite.setText(Facture.getNbrTraite());
|
||||
TextTauxInteret = Facture.getTauxInteret();
|
||||
Net_A_Payer = Facture.getNetAPayer();
|
||||
TypeFacilite = Facture.getTypeFaciliteBoolean();
|
||||
if(TypeFacilite == true){
|
||||
TextTypeReglement.setText("Traite");
|
||||
PaneTableViewCheques.setVisible(false);
|
||||
PaneTableViewTraites.setVisible(true);
|
||||
TextMontantTraite.setText("Montant Traite:");
|
||||
ArrayList<TraiteClt> ListTraites = Facture.getListeTraites();
|
||||
for(int i=0; i<ListTraites.size(); i++){
|
||||
//data_List_Traite.add(new FactureCltTraiteList(ListTraites.get(i).getMontantTraiteClt(),new Date()));
|
||||
dataListe.add(new FactureCltTraiteListe(ListTraites.get(i).getDateTraiteClt(),ListTraites.get(i).getMontantTraiteClt()+" "+ParametreSystem.CurrencySign ));
|
||||
}
|
||||
TableViewListeTraites.setItems(dataListe);
|
||||
}else if(TypeFacilite == false){
|
||||
Banque.setVisible(true);
|
||||
TextTypeReglement.setText("Cheque");
|
||||
PaneTableViewTraites.setVisible(false);
|
||||
PaneTableViewCheques.setVisible(true);
|
||||
TextMontantTraite.setText("Montant Chéques:");
|
||||
ArrayList<ChequeClt> dataListCheque = Facture.getListeCheques();
|
||||
TextBanque.setText( dataListCheque.get(0).getBanqueChequeClt());
|
||||
for(int i=0; i<dataListCheque.size(); i++){
|
||||
dataListeCheque.add(new FactureCltChequeListe( dataListCheque.get(i).getDatePaiement(),
|
||||
dataListCheque.get(i).getNumeroChequeClt(),
|
||||
dataListCheque.get(i).getBanqueChequeClt(),
|
||||
dataListCheque.get(i).getMontantChequeClt()));
|
||||
}
|
||||
TableViewListeCheques.setItems(dataListeCheque);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//Boutton Présédent
|
||||
@FXML
|
||||
private void FactureCltAjouterLastButtonAction(ActionEvent event) throws IOException {
|
||||
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/Views/FactureClt/FactureCltAjouterPaiementFacilite.fxml"));
|
||||
Parent NodePaneFactureCltAjouterPaiementFacilite = (Parent)fxmlLoader.load();
|
||||
FactureCltAjouterPaiementFaciliteController FactureCltAjouterPaiementFacilite = fxmlLoader.getController();
|
||||
FactureCltAjouterPaiementFacilite.TextFieldAvance.setText(Avance);
|
||||
FactureCltAjouterPaiementFacilite.TextFieldNbrTraite.setText(TextNbrTraite.getText());
|
||||
FactureCltAjouterPaiementFacilite.TextFieldTauxIntere.setText(TextTauxInteret);
|
||||
FactureCltAjouterPaiementFacilite.TextMontant_Traite.setVisible(true);
|
||||
FactureCltAjouterPaiementFacilite.TextMontant_Interet.setVisible(true);
|
||||
FactureCltAjouterPaiementFacilite.TextMontantTraite.setVisible(true);
|
||||
FactureCltAjouterPaiementFacilite.TextMontantInteret.setVisible(true);
|
||||
FactureCltAjouterPaiementFacilite.TextNetaPayer.setText(TextTauxInteret);
|
||||
FactureCltAjouterPaiementFacilite.TextMontantTraite.setText(ValMontantTraite.getText());
|
||||
FactureCltAjouterPaiementFacilite.TextMontantInteret.setText(TextMontantInteret.getText());
|
||||
FactureCltAjouterPaiementFacilite.TextNetaPayer.setText(Net_A_Payer+" "+ParametreSystem.CurrencySign);
|
||||
FactureCltAjouterPaiementFacilite.commande = commande;
|
||||
if(TypeFacilite == true){
|
||||
FactureCltAjouterPaiementFacilite.TypeSelect = true;
|
||||
FactureCltAjouterPaiementFacilite.RadioTraite.setSelected(true);
|
||||
FactureCltAjouterPaiementFacilite.dataList = data_List_Traite;
|
||||
FactureCltAjouterPaiementFacilite.SetTableViewTraite();
|
||||
|
||||
}
|
||||
else if(TypeFacilite == false){
|
||||
FactureCltAjouterPaiementFacilite.TypeSelect = false;
|
||||
FactureCltAjouterPaiementFacilite.RadioCheque.setSelected(true);
|
||||
FactureCltAjouterPaiementFacilite.dataListCheque = data_List_Cheque;
|
||||
FactureCltAjouterPaiementFacilite.SetTableViewCheque();
|
||||
}
|
||||
|
||||
PaneFactureCltAjouterDetailTraite.getChildren().clear();
|
||||
PaneFactureCltAjouterDetailTraite.getChildren().add(NodePaneFactureCltAjouterPaiementFacilite);
|
||||
|
||||
}
|
||||
|
||||
//Boutton Suivant
|
||||
@FXML
|
||||
private void FactureCltSaveButtonAction(ActionEvent event) throws IOException {
|
||||
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/Views/FactureClt/FactureCltDetail.fxml"));
|
||||
Parent NodeFactureCltDetail = (Parent)fxmlLoader.load();
|
||||
FactureCltDetailController FactureCltDetail= fxmlLoader.getController();
|
||||
FactureCltDB FactureDB= new FactureCltDB();
|
||||
String CodeFacture = FactureDB.AddFactureClt(Facture);
|
||||
FactureCltDetail.codeFactClt = CodeFacture;
|
||||
FactureCltDetail.SowDetailFactureClt(true);
|
||||
PaneFactureCltAjouterDetailTraite.getChildren().clear();
|
||||
PaneFactureCltAjouterDetailTraite.getChildren().add(NodeFactureCltDetail);
|
||||
}
|
||||
|
||||
}
|
||||
+193
@@ -0,0 +1,193 @@
|
||||
package Controllers.FactureClt;
|
||||
|
||||
import Controllers.Traitement.ParametreSystem;
|
||||
import Controllers.Traitement.contro;
|
||||
import Models.Caisse.CarteBancaireClt;
|
||||
import Models.CommandeClt.CommandeClt;
|
||||
import Models.FactureClt.FactureClt;
|
||||
import Models.FactureClt.FactureCltDB;
|
||||
import Models.User.User;
|
||||
import Models.ChequeClt.ChequeClt;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.Date;
|
||||
import java.util.ResourceBundle;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.control.DatePicker;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import javafx.scene.text.Text;
|
||||
|
||||
|
||||
/**
|
||||
* FXML Controller class
|
||||
* @author Maher Ben Tili
|
||||
*/
|
||||
public class FactureCltAjouterPaiementComptentController implements Initializable {
|
||||
|
||||
@FXML public Text TextNetaPayer ;
|
||||
|
||||
@FXML private AnchorPane PaneFactureCltAjouterPaiementComptent;
|
||||
@FXML public AnchorPane PaneCheque;
|
||||
@FXML public AnchorPane PaneCarte;
|
||||
@FXML public TextField FactureCltChequeNomBanque;
|
||||
@FXML public TextField FactureCltChequeNumero;
|
||||
@FXML public TextField FactureCltChequeNomComple;
|
||||
@FXML public DatePicker FactureCltChequeDatePaiement;
|
||||
|
||||
@FXML public Text MsgCltChequeNomBanque;
|
||||
@FXML public Text MsgCltChequeNumero;
|
||||
@FXML public Text MsgCltChequeNomComple;
|
||||
@FXML public Text MsgCltChequeDatePaiement;
|
||||
|
||||
@FXML public TextField TextFieldCarteNumeroTransation;
|
||||
@FXML public TextField TextFieldCarteNomBanque;
|
||||
@FXML public TextField TextFieldCarteNumero;
|
||||
@FXML public TextField TextFieldCarteNomComplet;
|
||||
|
||||
@FXML public Text MsgCltCarteNumeroTransation;
|
||||
@FXML public Text MsgCltCarteNumeroCarte;
|
||||
|
||||
public Integer TypeSelect = 0; // 0:espace 1:Cheque 2:Carte Bancaire
|
||||
|
||||
public FactureClt Facture = new FactureClt();
|
||||
public CommandeClt commande;
|
||||
|
||||
contro clt = new contro();
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@FXML
|
||||
public void RadioEspaceAction(ActionEvent event) throws IOException {
|
||||
PaneCheque.setVisible(false);
|
||||
PaneCarte.setVisible(false);
|
||||
TypeSelect = 0;
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void RadioChequeAction(ActionEvent event) throws IOException {
|
||||
PaneCarte.setVisible(false);
|
||||
PaneCheque.setVisible(true);
|
||||
TypeSelect = 1;
|
||||
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void RadioCarteAction(ActionEvent event) throws IOException {
|
||||
PaneCheque.setVisible(false);
|
||||
PaneCarte.setVisible(true);
|
||||
TypeSelect = 2;
|
||||
}
|
||||
|
||||
//Boutton Suivant
|
||||
@FXML
|
||||
private void FactureCltAjouterSuivantAction(ActionEvent event) throws IOException {
|
||||
this.SetDataFacture();
|
||||
FactureCltDB FactureDB= new FactureCltDB();
|
||||
if(TypeSelect == 0){
|
||||
Facture.setModePaiement("0");
|
||||
String CodeFacture = FactureDB.AddFactureClt(Facture);
|
||||
if(CodeFacture != null){
|
||||
this.FactureCltDetail(CodeFacture);
|
||||
}
|
||||
}else if(TypeSelect == 1){
|
||||
Facture.setModePaiement("1");
|
||||
|
||||
if( clt.ContrNull(FactureCltChequeNomBanque, MsgCltChequeNomBanque) &&
|
||||
clt.ContrNumeriqueNotnull(FactureCltChequeNumero, MsgCltChequeNumero) &&
|
||||
clt.ContrNullDatePicker(FactureCltChequeDatePaiement, MsgCltChequeDatePaiement)){
|
||||
|
||||
ChequeClt Cheque = new ChequeClt();
|
||||
Cheque.setBanqueChequeClt(FactureCltChequeNomBanque.getText());
|
||||
Cheque.setNumeroChequeClt(FactureCltChequeNumero.getText());
|
||||
Cheque.setNomCompletChequeClt(FactureCltChequeNomComple.getText());
|
||||
Cheque.setDatePaiement(FactureCltChequeDatePaiement.getValue().toString());
|
||||
Cheque.setMontantChequeClt(Facture.getNetAPayer());
|
||||
Facture.setCheque(Cheque);
|
||||
|
||||
String CodeFacture = FactureDB.AddFactureClt(Facture);
|
||||
if(CodeFacture != null){
|
||||
this.FactureCltDetail(CodeFacture);
|
||||
}
|
||||
}
|
||||
}else if(TypeSelect == 2){
|
||||
Facture.setModePaiement("2");
|
||||
if( clt.ContrNull(TextFieldCarteNumeroTransation, MsgCltCarteNumeroTransation) &&
|
||||
clt.ContrNumerique(TextFieldCarteNumero, MsgCltCarteNumeroCarte) )
|
||||
{
|
||||
CarteBancaireClt CarteBancaire = new CarteBancaireClt();
|
||||
CarteBancaire.setNumeroTransation(TextFieldCarteNumeroTransation.getText());
|
||||
CarteBancaire.setNomBanque(TextFieldCarteNomBanque.getText());
|
||||
CarteBancaire.setNumeroCarte(TextFieldCarteNumero.getText());
|
||||
CarteBancaire.setNomComplet(TextFieldCarteNomComplet.getText());
|
||||
CarteBancaire.setMontant(Facture.getNetAPayer());
|
||||
CarteBancaire.setLocalNom(ParametreSystem.NomLocalPC);
|
||||
CarteBancaire.setIdProfile(User.idprofile);
|
||||
Facture.setCarteBancaire(CarteBancaire);
|
||||
String CodeFacture = FactureDB.AddFactureClt(Facture);
|
||||
if(CodeFacture != null){
|
||||
this.FactureCltDetail(CodeFacture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Boutton Présédent
|
||||
@FXML
|
||||
private void FactureCltAjouterButtonAction(ActionEvent event) throws IOException {
|
||||
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/Views/FactureClt/FactureCltAjouterDetailSelect.fxml"));
|
||||
Parent NodeFactureCltAjouterDetailSelect = (Parent)fxmlLoader.load();
|
||||
FactureCltAjouterDetailSelectController FactureCltAjouterDetailSelect = fxmlLoader.getController();
|
||||
FactureCltAjouterDetailSelect.setDataCommande(commande.getCodecommandeclt());
|
||||
PaneFactureCltAjouterPaiementComptent.getChildren().clear();
|
||||
PaneFactureCltAjouterPaiementComptent.getChildren().add(NodeFactureCltAjouterDetailSelect);
|
||||
|
||||
}
|
||||
|
||||
public void FactureCltDetail(String CodeFacture) throws IOException{
|
||||
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/Views/FactureClt/FactureCltDetail.fxml"));
|
||||
Parent NodeFactureCltDetail = (Parent)fxmlLoader.load();
|
||||
FactureCltDetailController FactureCltDetail= fxmlLoader.getController();
|
||||
|
||||
FactureCltDetail.codeFactClt = CodeFacture;
|
||||
FactureCltDetail.SowDetailFactureClt(true);
|
||||
PaneFactureCltAjouterPaiementComptent.getChildren().clear();
|
||||
PaneFactureCltAjouterPaiementComptent.getChildren().add(NodeFactureCltDetail);
|
||||
}
|
||||
|
||||
public void SetDataFacture(){
|
||||
Facture.setIdCommandeClt(commande.getCodecommandeclt());
|
||||
Facture.setTypeClient(commande.getTypeClient());
|
||||
|
||||
if(commande.getTypeClient() == 0){
|
||||
Facture.setCltPersonne(commande.getCltPersonne());
|
||||
}else if(commande.getTypeClient() == 1){
|
||||
Facture.setCltEntreprise(commande.getCltEntreprise());
|
||||
}else if(commande.getTypeClient() == 2){
|
||||
Facture.setCltPassager(commande.getCltPassager());
|
||||
}
|
||||
Facture.setDateFacture(new Date().toString());
|
||||
Facture.setTypeRegement(commande.getTypeRegement());
|
||||
Facture.setNetAPayer(commande.getNetAPayer());
|
||||
Facture.setTotalTVA(commande.getTotalTVA());
|
||||
Facture.setTotalHorsTaxNet(commande.getTotalHorsTaxNet());
|
||||
Facture.setRemise(commande.getRemise());
|
||||
Facture.setTimbre(commande.getTimbre());
|
||||
Facture.setDevise(commande.getCodeDevis());
|
||||
Facture.setCodeUser(User.idprofile);
|
||||
Facture.setListeproduit(commande.getListeproduit());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+624
@@ -0,0 +1,624 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package Controllers.FactureClt;
|
||||
|
||||
|
||||
import Controllers.Dialog.MessageControle;
|
||||
import Controllers.Traitement.Adaptateur;
|
||||
import Controllers.Traitement.ParametreSystem;
|
||||
import Controllers.Traitement.contro;
|
||||
import Models.CommandeClt.CommandeClt;
|
||||
import Models.TraiteClt.DatePickerCell;
|
||||
import Models.ChequeClt.DatePickerCellCheque;
|
||||
import Models.FactureClt.FactureClt;
|
||||
import Models.ChequeClt.ChequeList;
|
||||
import Models.TraiteClt.TraiteList;
|
||||
import Models.ChequeClt.ChequeClt;
|
||||
import Models.TraiteClt.TraiteClt;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.ResourceBundle;
|
||||
import javafx.collections.FXCollections;
|
||||
import javafx.collections.ObservableList;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.control.RadioButton;
|
||||
import javafx.scene.control.TableCell;
|
||||
import javafx.scene.control.TableColumn;
|
||||
import javafx.scene.control.TableView;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.control.cell.PropertyValueFactory;
|
||||
import javafx.scene.control.cell.TextFieldTableCell;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import javafx.scene.paint.Color;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.scene.text.FontWeight;
|
||||
import javafx.scene.text.Text;
|
||||
import javafx.util.Callback;
|
||||
|
||||
|
||||
/**
|
||||
* FXML Controller class
|
||||
*
|
||||
* @author PC-Maher
|
||||
*/
|
||||
public class FactureCltAjouterPaiementFaciliteController implements Initializable {
|
||||
|
||||
|
||||
@FXML private AnchorPane PaneFactureCltAjouterPaiementFacilite;
|
||||
|
||||
@FXML public AnchorPane PaneTableViewTraite ;
|
||||
@FXML public AnchorPane PaneTableViewCheque;
|
||||
@FXML public Text TextMontant_Traite;
|
||||
@FXML public Text TextMontant_Interet;
|
||||
|
||||
@FXML public RadioButton RadioCheque;
|
||||
@FXML public RadioButton RadioTraite;
|
||||
|
||||
@FXML public Text TextNetaPayer ;
|
||||
@FXML public Text TextMontantTraite;
|
||||
@FXML public Text TextMontantInteret;
|
||||
|
||||
@FXML public TextField TextFieldAvance;
|
||||
@FXML public TextField TextFieldNbrTraite;
|
||||
@FXML public TextField TextFieldTauxIntere;
|
||||
@FXML public Text TextAvance;
|
||||
@FXML public Text TextNbrTraite;
|
||||
@FXML public Text TextTauxIntere;
|
||||
|
||||
@FXML public TableView<TraiteList> TableViewListeTraite ;
|
||||
@FXML public TableColumn TabColDateTraite;
|
||||
@FXML public TableColumn<TraiteList ,String> TabColMontantTraite;
|
||||
|
||||
@FXML public TableView<ChequeList> TableViewListeCheque ;
|
||||
@FXML public TableColumn TabColDateCheque;
|
||||
@FXML public TableColumn<ChequeList ,String> TabColNumeroCheque;
|
||||
@FXML public TableColumn<ChequeList ,String> TabColBanqueCheque;
|
||||
@FXML public TableColumn<ChequeList ,String> TabColMontantCheque;
|
||||
|
||||
public CommandeClt commande;
|
||||
public FactureClt Facture ;
|
||||
public boolean TypeSelect = true; // True Traite | False Cheque
|
||||
|
||||
float NetaPayer, TotalMontantTraite, MontantInteret, Avance, NbrTraite, TauxIntere;
|
||||
|
||||
public ObservableList<TraiteList> dataList = FXCollections.observableArrayList();
|
||||
public ObservableList<ChequeList> dataListCheque = FXCollections.observableArrayList();
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
|
||||
TableViewListeTraite.setEditable(true);
|
||||
|
||||
TabColMontantTraite.setStyle( "-fx-alignment: CENTER;");
|
||||
TabColMontantTraite.getStyleClass().add("Center");
|
||||
TabColMontantTraite.setCellValueFactory(new PropertyValueFactory<TraiteList, String>("MontantTraite"));
|
||||
TabColMontantTraite.setCellFactory(TextFieldTableCell.<TraiteList>forTableColumn()); //Ajouter l'option textfield
|
||||
//Valier l'opertion
|
||||
TabColMontantTraite.setOnEditCommit(new EventHandler<TableColumn.CellEditEvent<TraiteList, String>>() {
|
||||
@Override
|
||||
public void handle(TableColumn.CellEditEvent<TraiteList, String> t) {
|
||||
String NewQuantite = t.getNewValue();
|
||||
((TraiteList) t.getTableView().getItems().get(t.getTablePosition().getRow())).setMontantTraite(NewQuantite);
|
||||
}
|
||||
});
|
||||
|
||||
TabColDateTraite.setStyle( "-fx-alignment: CENTER; -fx-font-weight:bold; -fx-font-size: 10pt;");
|
||||
TabColDateTraite.getStyleClass().add("Center");
|
||||
TabColDateTraite.setCellValueFactory(new PropertyValueFactory<TraiteList, Date>("date"));
|
||||
TabColDateTraite.setEditable(true);
|
||||
|
||||
TabColDateTraite.setCellFactory(new Callback<TableColumn, TableCell>() {
|
||||
@Override
|
||||
public TableCell call(TableColumn p) {
|
||||
DatePickerCell datePick = new DatePickerCell(dataList);
|
||||
return datePick;
|
||||
}
|
||||
});
|
||||
TableViewListeTraite.setItems(dataList);
|
||||
|
||||
|
||||
//Cheque
|
||||
TabColNumeroCheque.setStyle( "-fx-alignment: CENTER;");
|
||||
TabColNumeroCheque.getStyleClass().add("Center");
|
||||
TabColNumeroCheque.setCellValueFactory(new PropertyValueFactory<ChequeList, String>("NumeroCheque"));
|
||||
TabColNumeroCheque.setCellFactory(TextFieldTableCell.<ChequeList>forTableColumn()); //Ajouter l'option textfield
|
||||
//Valier l'opertion
|
||||
TabColNumeroCheque.setOnEditCommit(new EventHandler<TableColumn.CellEditEvent<ChequeList, String>>() {
|
||||
@Override
|
||||
public void handle(TableColumn.CellEditEvent<ChequeList, String> t) {
|
||||
String NewNumeroCheque = t.getNewValue();
|
||||
contro clt = new contro();
|
||||
if(!clt.isNumeric(NewNumeroCheque)){
|
||||
if(t.getTablePosition().getRow() == 0){
|
||||
Integer NumeroCheque = Integer.valueOf(NewNumeroCheque);
|
||||
int indise = 0;
|
||||
while(indise<dataListCheque.size()){
|
||||
((ChequeList) t.getTableView().getItems().get(indise)).setNumeroCheque(NumeroCheque.toString());
|
||||
indise++;NumeroCheque++;
|
||||
}
|
||||
}else{
|
||||
((ChequeList) t.getTableView().getItems().get(t.getTablePosition().getRow())).setNumeroCheque(NewNumeroCheque);
|
||||
}
|
||||
}else{
|
||||
((ChequeList) t.getTableView().getItems().get(t.getTablePosition().getRow())).setNumeroCheque(null);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
TabColBanqueCheque.setStyle( "-fx-alignment: CENTER;");
|
||||
TabColBanqueCheque.getStyleClass().add("Center");
|
||||
TabColBanqueCheque.setCellValueFactory(new PropertyValueFactory<ChequeList, String>("BanqueCheque"));
|
||||
TabColBanqueCheque.setCellFactory(TextFieldTableCell.<ChequeList>forTableColumn()); //Ajouter l'option textfield
|
||||
//Valier l'opertion
|
||||
TabColBanqueCheque.setOnEditCommit(new EventHandler<TableColumn.CellEditEvent<ChequeList, String>>() {
|
||||
@Override
|
||||
public void handle(TableColumn.CellEditEvent<ChequeList, String> t) {
|
||||
String NewBanque = t.getNewValue();
|
||||
if(t.getTablePosition().getRow() == 0){
|
||||
int indise = 0;
|
||||
while(indise<dataListCheque.size()){
|
||||
((ChequeList) t.getTableView().getItems().get(indise)).setBanqueCheque(NewBanque);
|
||||
indise++;
|
||||
}
|
||||
}else{
|
||||
((ChequeList) t.getTableView().getItems().get(t.getTablePosition().getRow())).setBanqueCheque(NewBanque);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
TabColMontantCheque.setStyle( "-fx-alignment: CENTER;");
|
||||
TabColMontantCheque.getStyleClass().add("Center");
|
||||
TabColMontantCheque.setCellValueFactory(new PropertyValueFactory<ChequeList, String>("MontantCheque"));
|
||||
TabColMontantCheque.setCellFactory(TextFieldTableCell.<ChequeList>forTableColumn()); //Ajouter l'option textfield
|
||||
//Valier l'opertion
|
||||
TabColMontantCheque.setOnEditCommit(new EventHandler<TableColumn.CellEditEvent<ChequeList, String>>() {
|
||||
@Override
|
||||
public void handle(TableColumn.CellEditEvent<ChequeList, String> t) {
|
||||
String NewQuantite = t.getNewValue();
|
||||
((ChequeList) t.getTableView().getItems().get(t.getTablePosition().getRow())).setMontantCheque(NewQuantite);
|
||||
}
|
||||
});
|
||||
|
||||
TabColDateCheque.setStyle( "-fx-alignment: CENTER; -fx-font-weight:bold; -fx-font-size: 10pt;");
|
||||
TabColDateCheque.getStyleClass().add("Center");
|
||||
TabColDateCheque.setCellValueFactory(new PropertyValueFactory<ChequeList, Date>("date"));
|
||||
TabColDateCheque.setEditable(true);
|
||||
TabColDateCheque.setCellFactory(new Callback<TableColumn, TableCell>() {
|
||||
@Override
|
||||
public TableCell call(TableColumn p) {
|
||||
DatePickerCellCheque datePick = new DatePickerCellCheque(dataListCheque);
|
||||
return datePick;
|
||||
}
|
||||
});
|
||||
|
||||
TableViewListeCheque.setItems(dataListCheque);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void CalculeTraite(){
|
||||
dataList.clear();
|
||||
PaneTableViewCheque.setVisible(false);
|
||||
PaneTableViewTraite.setVisible(true);
|
||||
|
||||
NbrTraite = Adaptateur.StringToFloat(TextFieldNbrTraite.getText());
|
||||
TauxIntere = Adaptateur.StringToFloat(TextFieldTauxIntere.getText());
|
||||
|
||||
MontantInteret = ((NetaPayer - Avance) * TauxIntere) / 100 ;
|
||||
TotalMontantTraite = (NetaPayer - Avance) + MontantInteret ;
|
||||
|
||||
TextMontantInteret.setText(Adaptateur.ArrondFloatToString(MontantInteret)+" "+ParametreSystem.CurrencySign);
|
||||
TextMontantTraite.setText(Adaptateur.ArrondFloatToString(TotalMontantTraite)+" "+ParametreSystem.CurrencySign);
|
||||
|
||||
Integer divTotal = Adaptateur.Diviseur(TotalMontantTraite);
|
||||
float modeTotal = Adaptateur.Modulo(TotalMontantTraite);
|
||||
|
||||
float Value = (float) TotalMontantTraite / NbrTraite;
|
||||
Integer div = Adaptateur.Diviseur(Value);
|
||||
|
||||
|
||||
Date date= new Date();
|
||||
Calendar cal = Calendar.getInstance();
|
||||
|
||||
Integer Somme = 0;
|
||||
|
||||
for(int i=0; i<NbrTraite; i++){
|
||||
cal.setTime(date);
|
||||
cal.add(Calendar.MONTH, i+1);
|
||||
if(i != NbrTraite-1){
|
||||
Somme = Somme + div ;
|
||||
dataList.add(new TraiteList(Adaptateur.floatDeleZero(div), cal.getTime()));
|
||||
}else{
|
||||
dataList.add(new TraiteList(Adaptateur.floatDeleZero((divTotal - Somme) + modeTotal) , cal.getTime()));
|
||||
}
|
||||
}
|
||||
TextMontantInteret.setVisible(true);
|
||||
TextMontantTraite.setVisible(true);
|
||||
TextMontant_Traite.setVisible(true);
|
||||
TextMontant_Interet.setVisible(true);
|
||||
|
||||
}
|
||||
|
||||
private void CalculeCheque(){
|
||||
dataListCheque.clear();
|
||||
PaneTableViewTraite.setVisible(false);
|
||||
PaneTableViewCheque.setVisible(true);
|
||||
|
||||
NbrTraite = Adaptateur.StringToFloat(TextFieldNbrTraite.getText());
|
||||
TauxIntere = Adaptateur.StringToFloat(TextFieldTauxIntere.getText());
|
||||
|
||||
MontantInteret = ((NetaPayer - Avance) * TauxIntere) / 100 ;
|
||||
TotalMontantTraite = (NetaPayer - Avance) + MontantInteret ;
|
||||
|
||||
TextMontantInteret.setText(Adaptateur.ArrondFloatToString(MontantInteret)+" "+ParametreSystem.CurrencySign);
|
||||
TextMontantTraite.setText(Adaptateur.ArrondFloatToString(TotalMontantTraite)+" "+ParametreSystem.CurrencySign);
|
||||
|
||||
Integer divTotal = Adaptateur.Diviseur(TotalMontantTraite);
|
||||
float modeTotal = Adaptateur.Modulo(TotalMontantTraite);
|
||||
|
||||
float Value = (float) TotalMontantTraite / NbrTraite;
|
||||
Integer div = Adaptateur.Diviseur(Value);
|
||||
|
||||
|
||||
Date date= new Date();
|
||||
Calendar cal = Calendar.getInstance();
|
||||
|
||||
Integer Somme = 0;
|
||||
|
||||
for(int i=0; i<NbrTraite; i++){
|
||||
cal.setTime(date);
|
||||
cal.add(Calendar.MONTH, i+1);
|
||||
if(i != NbrTraite-1){
|
||||
Somme = Somme + div ;
|
||||
dataListCheque.add(new ChequeList(cal.getTime(),"","",Adaptateur.floatDeleZero(div)));
|
||||
}else{
|
||||
dataListCheque.add(new ChequeList(cal.getTime(),"","",Adaptateur.floatDeleZero((divTotal - Somme) + modeTotal)));
|
||||
}
|
||||
}
|
||||
TextMontantInteret.setVisible(true);
|
||||
TextMontantTraite.setVisible(true);
|
||||
TextMontant_Traite.setVisible(true);
|
||||
TextMontant_Interet.setVisible(true);
|
||||
}
|
||||
|
||||
|
||||
//Suivant
|
||||
@FXML
|
||||
private void FactureCltAjouterSuivantButtonAction(ActionEvent event) throws IOException {
|
||||
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/Views/FactureClt/FactureCltAjouterDetailTraite.fxml"));
|
||||
Parent NodeDetailTraite = (Parent)fxmlLoader.load();
|
||||
FactureCltAjouterDetailTraiteController FactureCltAjouterDetailTraite = fxmlLoader.getController();
|
||||
|
||||
|
||||
if(commande.getTypeClient()==0){
|
||||
FactureCltAjouterDetailTraite.TextNom.setText(commande.CltPersonne.getNom());
|
||||
FactureCltAjouterDetailTraite.TextPrenom.setText(commande.CltPersonne.getPrenom());
|
||||
FactureCltAjouterDetailTraite.TextAdress.setText(commande.CltPersonne.getAdresse());
|
||||
}else if(commande.getTypeClient()==1){
|
||||
FactureCltAjouterDetailTraite.TextNom.setText(commande.CltEntreprise.getNom());
|
||||
FactureCltAjouterDetailTraite.TextPrenom.setText(commande.CltEntreprise.getMatricule());
|
||||
FactureCltAjouterDetailTraite.TextAdress.setText(commande.CltEntreprise.getAdresse());
|
||||
FactureCltAjouterDetailTraite.TextPrenomMatricule.setText("Matricule");
|
||||
FactureCltAjouterDetailTraite.TextPrenom.setText(commande.CltEntreprise.getMatricule());
|
||||
}else if(commande.getTypeClient()==2){
|
||||
FactureCltAjouterDetailTraite.TextNom.setText(commande.CltPassager.getNom());
|
||||
FactureCltAjouterDetailTraite.TextPrenom.setText(commande.CltPassager.getPrenom());
|
||||
FactureCltAjouterDetailTraite.TextAdress.setText(commande.CltPassager.getAdresse());
|
||||
}
|
||||
|
||||
|
||||
if(TypeSelect == true){
|
||||
if(this.ControleListTraite()){
|
||||
SetDataFactureClt(true);
|
||||
PaneFactureCltAjouterPaiementFacilite.getChildren().clear();
|
||||
PaneFactureCltAjouterPaiementFacilite.getChildren().add(NodeDetailTraite);
|
||||
FactureCltAjouterDetailTraite.data_List_Traite = dataList;
|
||||
FactureCltAjouterDetailTraite.SetDataTraiteFacilite(Facture);
|
||||
}
|
||||
}else{
|
||||
if(this.ControleListCheque()){
|
||||
SetDataFactureClt(false);
|
||||
PaneFactureCltAjouterPaiementFacilite.getChildren().clear();
|
||||
PaneFactureCltAjouterPaiementFacilite.getChildren().add(NodeDetailTraite);
|
||||
FactureCltAjouterDetailTraite.data_List_Cheque = dataListCheque;
|
||||
FactureCltAjouterDetailTraite.SetDataTraiteFacilite(Facture);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void SetDataFactureClt(boolean type_reglement){
|
||||
Facture.setAvance(TextFieldAvance.getText());
|
||||
Facture.setTotalMontantTraite(Adaptateur.ArrondFloatToString(TotalMontantTraite));
|
||||
Facture.setNbrTraite(TextFieldNbrTraite.getText());
|
||||
Facture.setMontantInteret(Adaptateur.ArrondFloatToString(MontantInteret));
|
||||
Facture.setTauxInteret(TextFieldTauxIntere.getText());
|
||||
Facture.setTypeRegement(commande.getTypeRegement());
|
||||
if(commande.getTypeClient() == 0){
|
||||
Facture.setCltPersonne(commande.getCltPersonne());
|
||||
}else if(commande.getTypeClient() == 1){
|
||||
Facture.setCltEntreprise(commande.getCltEntreprise());
|
||||
}else if(commande.getTypeClient() == 2){
|
||||
Facture.setCltPassager(commande.getCltPassager());
|
||||
}
|
||||
|
||||
Facture.setListeproduit(commande.getListeproduit());
|
||||
if(type_reglement == true){
|
||||
Facture.setTypeFacilite("0");
|
||||
ArrayList<TraiteClt> ListTraites = new ArrayList();
|
||||
for(int i=0; i<dataList.size(); i++){
|
||||
TraiteClt Traite = new TraiteClt();
|
||||
Traite.setDateCreationTraiteClt(new Date().toString());
|
||||
String DateTraite = new SimpleDateFormat("dd/MM/yyyy").format(dataList.get(i).getDate());
|
||||
Traite.setDateTraiteClt(DateTraite);
|
||||
Traite.setMontantTraiteClt(dataList.get(i).getMontantTraite());
|
||||
ListTraites.add(Traite);
|
||||
}
|
||||
Facture.setListeTraites(ListTraites);
|
||||
}else if(type_reglement == false){
|
||||
Facture.setTypeFacilite("1");
|
||||
ArrayList<ChequeClt> ListCheque = new ArrayList();
|
||||
for(int i=0; i<dataListCheque.size(); i++){
|
||||
ChequeClt Cheque = new ChequeClt();
|
||||
Cheque.setNumeroChequeClt(dataListCheque.get(i).getNumeroCheque());
|
||||
Cheque.setBanqueChequeClt(dataListCheque.get(i).getBanqueCheque());
|
||||
Cheque.setMontantChequeClt(dataListCheque.get(i).getMontantCheque());
|
||||
String DateChequePaiement = new SimpleDateFormat("yyyy-MM-dd").format(dataListCheque.get(i).getDate());
|
||||
Cheque.setDatePaiement(DateChequePaiement);
|
||||
Cheque.setDateCreation(new Date().toString());
|
||||
ListCheque.add(Cheque);
|
||||
}
|
||||
Facture.setListeCheques(ListCheque);
|
||||
}
|
||||
}
|
||||
//Boutton Traitement
|
||||
@FXML
|
||||
private void FactureCltAjouterTraitementButtonAction(ActionEvent event) throws IOException {
|
||||
if(this.Controle()){
|
||||
if(TypeSelect == true){
|
||||
this.CalculeTraite();
|
||||
}else{
|
||||
this.CalculeCheque();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Radio Cheque
|
||||
@FXML
|
||||
private void FactureCltAjouterChequeButtonAction(ActionEvent event) throws IOException {
|
||||
TypeSelect = false;
|
||||
TextMontant_Traite.setVisible(false);TextMontant_Interet.setVisible(false);
|
||||
PaneTableViewTraite.setVisible(false);PaneTableViewCheque.setVisible(false);
|
||||
TextMontantInteret.setVisible(false);TextMontantTraite.setVisible(false);
|
||||
if(this.Controle()){
|
||||
this.CalculeCheque();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//Radio Traite
|
||||
@FXML
|
||||
private void FactureCltAjouterTraiteButtonAction(ActionEvent event) throws IOException {
|
||||
TypeSelect = true;
|
||||
TextMontant_Traite.setVisible(false);TextMontant_Interet.setVisible(false);
|
||||
PaneTableViewTraite.setVisible(false);PaneTableViewCheque.setVisible(false);
|
||||
TextMontantInteret.setVisible(false);TextMontantTraite.setVisible(false);
|
||||
if(this.Controle()){
|
||||
this.CalculeTraite();
|
||||
}
|
||||
}
|
||||
|
||||
//Boutton Présédent
|
||||
@FXML
|
||||
private void FactureCltAjouterButtonAction(ActionEvent event) throws IOException {
|
||||
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/Views/FactureClt/FactureCltAjouterDetailSelect.fxml"));
|
||||
Parent NodeFactureCltAjouterDetailSelect = (Parent)fxmlLoader.load();
|
||||
FactureCltAjouterDetailSelectController FactureCltAjouterDetailSelect = fxmlLoader.getController();
|
||||
FactureCltAjouterDetailSelect.setDataCommande(commande.getCodecommandeclt());
|
||||
PaneFactureCltAjouterPaiementFacilite.getChildren().clear();
|
||||
PaneFactureCltAjouterPaiementFacilite.getChildren().add(NodeFactureCltAjouterDetailSelect);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void SetTableViewTraite(){
|
||||
PaneTableViewTraite.setVisible(true);
|
||||
TableViewListeTraite.setItems(dataList);
|
||||
}
|
||||
|
||||
public void SetTableViewCheque(){
|
||||
PaneTableViewCheque.setVisible(true);
|
||||
TableViewListeCheque.setItems(dataListCheque);
|
||||
}
|
||||
|
||||
private Boolean ControleListTraite(){
|
||||
boolean Resulta = true;
|
||||
boolean MontantTraite = true;
|
||||
int indise = 0;
|
||||
float Somme = 0;
|
||||
while(indise<dataList.size()){
|
||||
if(dataList.get(indise).getMontantTraite().equals("0")){
|
||||
MontantTraite = false;
|
||||
}
|
||||
Somme = Somme + Adaptateur.ArrondStringToFloat(dataList.get(indise).getMontantTraite());
|
||||
indise++;
|
||||
}
|
||||
if(!MontantTraite){
|
||||
final MessageControle messagecontrol = new MessageControle();
|
||||
Text text3 = new Text();
|
||||
text3.setText("Le montant des traites doit être différent de zéro (0)");
|
||||
text3.setFont(Font.font("Arial", FontWeight.BOLD, 13));
|
||||
text3.setFill(Color.web("#363a38"));
|
||||
messagecontrol.DetailMSG.getChildren().add(text3);
|
||||
messagecontrol.bouttonOK.setOnAction(new EventHandler<ActionEvent>() {
|
||||
@Override
|
||||
public void handle(ActionEvent event) {
|
||||
messagecontrol.stackpane.setVisible(false);
|
||||
}
|
||||
});
|
||||
messagecontrol.ShowNotification();
|
||||
Resulta = false;
|
||||
}
|
||||
else if(Adaptateur.ArrondFloatToFloat(Somme) != Adaptateur.ArrondFloatToFloat(TotalMontantTraite)){
|
||||
final MessageControle messagecontrol = new MessageControle();
|
||||
|
||||
Text text3 = new Text();
|
||||
text3.setText("La sommes des traites est différent à la montant de TotalMontantTraite");
|
||||
text3.setFont(Font.font("Arial", FontWeight.BOLD, 13));
|
||||
text3.setFill(Color.web("#363a38"));
|
||||
messagecontrol.DetailMSG.getChildren().add(text3);
|
||||
|
||||
messagecontrol.bouttonOK.setOnAction(new EventHandler<ActionEvent>() {
|
||||
@Override
|
||||
public void handle(ActionEvent event) {
|
||||
messagecontrol.stackpane.setVisible(false);
|
||||
}
|
||||
});
|
||||
|
||||
messagecontrol.ShowNotification();
|
||||
|
||||
Resulta = false;
|
||||
}
|
||||
|
||||
return Resulta;
|
||||
}
|
||||
|
||||
private Boolean ControleListCheque(){
|
||||
boolean Resulta = true;
|
||||
boolean NumeroCheque = true;
|
||||
boolean MontantCheque = true;
|
||||
boolean Banque = true;
|
||||
int indise = 0;
|
||||
float Somme = 0;
|
||||
contro clt = new contro();
|
||||
|
||||
while(indise<dataListCheque.size()){
|
||||
|
||||
if(!clt.isNumericNotnull(dataListCheque.get(indise).getNumeroCheque())){
|
||||
NumeroCheque = false;
|
||||
}
|
||||
if(dataListCheque.get(indise).getBanqueCheque().isEmpty()){
|
||||
Banque = false;
|
||||
}
|
||||
if(dataListCheque.get(indise).getMontantCheque().equals("0") || dataListCheque.get(indise).getNumeroCheque().isEmpty()){
|
||||
MontantCheque = false;
|
||||
}
|
||||
Somme = Somme + Adaptateur.ArrondStringToFloat(dataListCheque.get(indise).getMontantCheque());
|
||||
indise++;
|
||||
}
|
||||
|
||||
System.out.println(Adaptateur.ArrondFloatToFloat(Somme));
|
||||
System.out.println(Adaptateur.ArrondFloatToFloat(TotalMontantTraite));
|
||||
|
||||
if(NumeroCheque){
|
||||
final MessageControle messagecontrol = new MessageControle();
|
||||
Text text3 = new Text();
|
||||
text3.setText("Incorrect Numéro Chéque");
|
||||
text3.setFont(Font.font("Arial", FontWeight.BOLD, 13));
|
||||
text3.setFill(Color.web("#363a38"));
|
||||
messagecontrol.DetailMSG.getChildren().add(text3);
|
||||
|
||||
messagecontrol.bouttonOK.setOnAction(new EventHandler<ActionEvent>() {
|
||||
@Override
|
||||
public void handle(ActionEvent event) {
|
||||
messagecontrol.stackpane.setVisible(false);
|
||||
}
|
||||
});
|
||||
messagecontrol.ShowNotification();
|
||||
Resulta = false;
|
||||
}
|
||||
else if(!Banque){
|
||||
final MessageControle messagecontrol = new MessageControle();
|
||||
Text text3 = new Text();
|
||||
text3.setText("Le nom de la banque est vide");
|
||||
text3.setFont(Font.font("Arial", FontWeight.BOLD, 13));
|
||||
text3.setFill(Color.web("#363a38"));
|
||||
messagecontrol.DetailMSG.getChildren().add(text3);
|
||||
messagecontrol.bouttonOK.setOnAction(new EventHandler<ActionEvent>() {
|
||||
@Override
|
||||
public void handle(ActionEvent event) {
|
||||
messagecontrol.stackpane.setVisible(false);
|
||||
}
|
||||
});
|
||||
messagecontrol.ShowNotification();
|
||||
Resulta = false;
|
||||
}
|
||||
else if(!MontantCheque){
|
||||
final MessageControle messagecontrol = new MessageControle();
|
||||
Text text3 = new Text();
|
||||
text3.setText("Incorrect montant chéque");
|
||||
text3.setFont(Font.font("Arial", FontWeight.BOLD, 13));
|
||||
text3.setFill(Color.web("#363a38"));
|
||||
messagecontrol.DetailMSG.getChildren().add(text3);
|
||||
messagecontrol.bouttonOK.setOnAction(new EventHandler<ActionEvent>() {
|
||||
@Override
|
||||
public void handle(ActionEvent event) {
|
||||
messagecontrol.stackpane.setVisible(false);
|
||||
}
|
||||
});
|
||||
messagecontrol.ShowNotification();
|
||||
Resulta = false;
|
||||
}
|
||||
else if(Adaptateur.ArrondFloatToFloat(Somme) != Adaptateur.ArrondFloatToFloat(TotalMontantTraite)){
|
||||
final MessageControle messagecontrol = new MessageControle();
|
||||
Text text3 = new Text();
|
||||
text3.setText("La sommes des chéques est différent à la montant de TotalMontantTraite");
|
||||
text3.setFont(Font.font("Arial", FontWeight.BOLD, 13));
|
||||
text3.setFill(Color.web("#363a38"));
|
||||
messagecontrol.DetailMSG.getChildren().add(text3);
|
||||
messagecontrol.bouttonOK.setOnAction(new EventHandler<ActionEvent>() {
|
||||
@Override
|
||||
public void handle(ActionEvent event) {
|
||||
messagecontrol.stackpane.setVisible(false);
|
||||
}
|
||||
});
|
||||
messagecontrol.ShowNotification();
|
||||
Resulta = false;
|
||||
}
|
||||
|
||||
return Resulta;
|
||||
}
|
||||
|
||||
|
||||
private Boolean Controle(){
|
||||
contro clt = new contro();
|
||||
|
||||
if(clt.ContrNumeriqueNotnull(TextFieldAvance, TextAvance) &&
|
||||
clt.ContrNumeriqueNotnull(TextFieldNbrTraite, TextNbrTraite) &&
|
||||
clt.ContrNumeriqueNotnull(TextFieldTauxIntere, TextTauxIntere)){
|
||||
|
||||
NetaPayer = Adaptateur.StringToFloat(commande.getNetAPayer());
|
||||
Avance = Adaptateur.StringToFloat(TextFieldAvance.getText());
|
||||
if(NetaPayer< Avance){
|
||||
TextFieldAvance.setStyle("-fx-border-color:#f20606;");
|
||||
TextAvance.setText("doit être inférieur a Net A payer");
|
||||
return false ;
|
||||
}else if(Adaptateur.StringToFloat(TextFieldNbrTraite.getText())<= 0){
|
||||
TextFieldNbrTraite.setStyle("-fx-border-color:#f20606;");
|
||||
TextNbrTraite.setText("doit être supérieur a 0");
|
||||
return false ;
|
||||
}else{
|
||||
TextAvance.setText("");
|
||||
TextFieldAvance.setStyle("-fx-border-color: transparent;");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,363 @@
|
||||
package Controllers.FactureClt;
|
||||
|
||||
import Controllers.TraiteClt.TraiteCltPrintController;
|
||||
import Controllers.Traitement.Adaptateur;
|
||||
import Models.Produit.ListeProduit;
|
||||
import Models.FactureClt.FactureClt;
|
||||
import Models.FactureClt.FactureCltChequeListe;
|
||||
import Models.FactureClt.FactureCltDB;
|
||||
import Models.FactureClt.FactureCltTraiteListe;
|
||||
import Models.ChequeClt.ChequeClt;
|
||||
import Models.TraiteClt.TraiteClt;
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.ResourceBundle;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javafx.collections.FXCollections;
|
||||
import javafx.collections.ObservableList;
|
||||
import javafx.concurrent.Service;
|
||||
import javafx.concurrent.Task;
|
||||
import javafx.concurrent.WorkerStateEvent;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.print.JobSettings;
|
||||
import javafx.print.PageLayout;
|
||||
import javafx.print.PageOrientation;
|
||||
import javafx.print.PageRange;
|
||||
import javafx.print.Paper;
|
||||
import javafx.print.Printer;
|
||||
import javafx.print.PrinterJob;
|
||||
import javafx.scene.Node;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Tab;
|
||||
import javafx.scene.control.TableColumn;
|
||||
import javafx.scene.control.TableView;
|
||||
import javafx.scene.control.cell.PropertyValueFactory;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import javafx.scene.text.Text;
|
||||
|
||||
/**
|
||||
* FXML Controller class
|
||||
* @author PC-Maher
|
||||
*/
|
||||
public class FactureCltDetailController implements Initializable{
|
||||
|
||||
@FXML public AnchorPane PaneSucces;
|
||||
|
||||
@FXML public AnchorPane AnchorPaneLoading;
|
||||
@FXML public AnchorPane AnchorPaneDetailFactureClt;
|
||||
|
||||
@FXML private Text DateCreation;
|
||||
@FXML private Text Reglement;
|
||||
@FXML private Text NetAPayer;
|
||||
@FXML private Text TotalHorsTaxNet;
|
||||
@FXML private Text TotalTVA;
|
||||
@FXML private Text CodeFactClt;
|
||||
|
||||
@FXML private Text TypeClt;
|
||||
@FXML private Text Nom;
|
||||
@FXML private Text Prenom;
|
||||
@FXML private Text Adresse;
|
||||
@FXML private Text TELE1;
|
||||
@FXML private Text TELE2;
|
||||
|
||||
@FXML private Text TextPrenom ;
|
||||
@FXML private Text TextMatricule ;
|
||||
|
||||
@FXML private Text TextMontant;
|
||||
@FXML private Text ValMontant;
|
||||
|
||||
|
||||
@FXML private TableView<ListeProduit> TableViewListeProduit ;
|
||||
@FXML private TableColumn<ListeProduit ,String> TabColReference;
|
||||
@FXML private TableColumn<ListeProduit ,String> TabColDesignation;
|
||||
@FXML private TableColumn<ListeProduit ,String> TabColQuantite ;
|
||||
@FXML private TableColumn<ListeProduit ,String> TabColPrixHT;
|
||||
@FXML private TableColumn<ListeProduit ,String> TabColRemise;
|
||||
@FXML private TableColumn<ListeProduit ,String> TabColTotalHT;
|
||||
@FXML private TableColumn<ListeProduit ,String> TabColTVA;
|
||||
@FXML private TableColumn<ListeProduit ,String> TabColTotalTTC;
|
||||
|
||||
|
||||
@FXML private TableView<FactureCltTraiteListe> TableViewListeTraites ;
|
||||
@FXML private TableColumn<FactureCltTraiteListe ,String> TabColDateTraites;
|
||||
@FXML private TableColumn<FactureCltTraiteListe ,String> TabColMontantTraites;
|
||||
|
||||
@FXML private TableView<FactureCltChequeListe> TableViewListeCheques ;
|
||||
@FXML private TableColumn<FactureCltChequeListe ,String> TabColDateCheques;
|
||||
@FXML private TableColumn<FactureCltChequeListe ,String> TabColNumeroCheques;
|
||||
@FXML private TableColumn<FactureCltChequeListe ,String> TabColBanqueCheques;
|
||||
@FXML private TableColumn<FactureCltChequeListe ,String> TabColMontantCheques;
|
||||
|
||||
@FXML public Button ButtonImprimerTraite;
|
||||
@FXML private Tab TabTypeRegement;
|
||||
|
||||
private Service<Void> ThreadFactureCltDetail;
|
||||
|
||||
FactureClt factureClt;
|
||||
|
||||
public String codeFactClt;
|
||||
|
||||
public boolean NewFacture;
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
|
||||
TableViewListeProduit.setEditable(false);
|
||||
|
||||
TabColReference.setCellValueFactory(new PropertyValueFactory<ListeProduit, String>("reference"));
|
||||
TabColDesignation.setCellValueFactory(new PropertyValueFactory<ListeProduit, String>("designation"));
|
||||
|
||||
TabColQuantite.setCellValueFactory(new PropertyValueFactory<ListeProduit, String>("quantite"));
|
||||
TabColQuantite.setStyle( "-fx-alignment: CENTER; -fx-font-weight:bold; -fx-font-size: 10pt;");
|
||||
TabColQuantite.getStyleClass().add("Center");
|
||||
|
||||
TabColPrixHT.setCellValueFactory(new PropertyValueFactory<ListeProduit, String>("PrixHT"));
|
||||
TabColPrixHT.setStyle( "-fx-alignment: CENTER;");
|
||||
TabColPrixHT.getStyleClass().add("Center");
|
||||
|
||||
TabColRemise.setCellValueFactory(new PropertyValueFactory<ListeProduit, String>("Remise"));
|
||||
TabColRemise.setStyle( "-fx-alignment: CENTER;");
|
||||
TabColRemise.getStyleClass().add("Center");
|
||||
|
||||
TabColTotalHT.setCellValueFactory(new PropertyValueFactory<ListeProduit, String>("TotalHT"));
|
||||
TabColTotalHT.setStyle( "-fx-alignment: CENTER;");
|
||||
TabColTotalHT.getStyleClass().add("Center");
|
||||
|
||||
TabColTVA.setCellValueFactory(new PropertyValueFactory<ListeProduit, String>("TVA"));
|
||||
TabColTVA.setStyle( "-fx-alignment: CENTER;");
|
||||
TabColTVA.getStyleClass().add("Center");
|
||||
|
||||
TabColTotalTTC.setCellValueFactory(new PropertyValueFactory<ListeProduit, String>("TotalTTC"));
|
||||
TabColTotalTTC.setStyle( "-fx-alignment: CENTER; -fx-font-weight:bold; -fx-font-size: 10pt;");
|
||||
TabColTotalTTC.getStyleClass().add("Center");
|
||||
|
||||
TabColDateTraites.setStyle( "-fx-alignment: CENTER;");
|
||||
TabColDateTraites.getStyleClass().add("Center");
|
||||
TabColDateTraites.setCellValueFactory(new PropertyValueFactory<FactureCltTraiteListe, String>("DateTraites"));
|
||||
|
||||
TabColMontantTraites.setStyle( "-fx-alignment: CENTER;");
|
||||
TabColMontantTraites.getStyleClass().add("Center");
|
||||
TabColMontantTraites.setCellValueFactory(new PropertyValueFactory<FactureCltTraiteListe, String>("MontantTraites"));
|
||||
|
||||
TabColDateCheques.setStyle( "-fx-alignment: CENTER;");
|
||||
TabColDateCheques.getStyleClass().add("Center");
|
||||
TabColDateCheques.setCellValueFactory(new PropertyValueFactory<FactureCltChequeListe, String>("DateCheques"));
|
||||
|
||||
TabColNumeroCheques.setStyle( "-fx-alignment: CENTER;");
|
||||
TabColNumeroCheques.getStyleClass().add("Center");
|
||||
TabColNumeroCheques.setCellValueFactory(new PropertyValueFactory<FactureCltChequeListe, String>("NumeroCheques"));
|
||||
|
||||
TabColBanqueCheques.setStyle( "-fx-alignment: CENTER;");
|
||||
TabColBanqueCheques.getStyleClass().add("Center");
|
||||
TabColBanqueCheques.setCellValueFactory(new PropertyValueFactory<FactureCltChequeListe, String>("BanqueCheques"));
|
||||
|
||||
TabColMontantCheques.setStyle( "-fx-alignment: CENTER;");
|
||||
TabColMontantCheques.getStyleClass().add("Center");
|
||||
TabColMontantCheques.setCellValueFactory(new PropertyValueFactory<FactureCltChequeListe, String>("MontantCheques"));
|
||||
|
||||
|
||||
ButtonPrintTraite();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@FXML
|
||||
private void FactureCltPrintButtonAction(ActionEvent event) throws IOException {
|
||||
|
||||
PrinterJob jobPrint = PrinterJob.createPrinterJob();
|
||||
|
||||
try {
|
||||
|
||||
jobPrint.getJobSettings().setPageRanges(new PageRange(1, 1));
|
||||
|
||||
if (jobPrint.showPrintDialog(null)) {
|
||||
|
||||
FXMLLoader fxmlLoaderPrintFactureClt = new FXMLLoader(getClass().getResource("/Views/FactureClt/FactureCltPrint.fxml"));
|
||||
final Node ParentFxmlPrintFactureClt = (Node)fxmlLoaderPrintFactureClt.load();
|
||||
FactureCltPrintController PrintFactureClt = fxmlLoaderPrintFactureClt.getController();
|
||||
|
||||
if(NewFacture){
|
||||
PrintFactureClt.setFactureClt(factureClt, false);
|
||||
}else{
|
||||
PrintFactureClt.setFactureClt(factureClt, true);
|
||||
}
|
||||
|
||||
jobPrint.printPage(ParentFxmlPrintFactureClt);
|
||||
|
||||
jobPrint.endJob();
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
System.err.println("Erreur dans: Controllers.FactureClt.FactureCltDetailController.FactureCltPrintButtonAction ");
|
||||
System.err.println(ex.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public void SowDetailFactureClt(boolean newFacture)
|
||||
{
|
||||
ThreadFactureCltDetail = new Service<Void>(){
|
||||
@Override
|
||||
protected Task<Void> createTask(){
|
||||
return new Task<Void>(){
|
||||
@Override
|
||||
protected Void call() throws Exception{
|
||||
NewFacture = newFacture;
|
||||
FactureCltDB factureCltDB = new FactureCltDB();
|
||||
|
||||
factureClt = factureCltDB.getFactureClt(codeFactClt);
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
ThreadFactureCltDetail.setOnSucceeded(new EventHandler<WorkerStateEvent>(){
|
||||
@Override
|
||||
public void handle(WorkerStateEvent event){
|
||||
CodeFactClt.setText(factureClt.getCodeFactureClt());
|
||||
DateCreation.setText(Adaptateur.NormalDateFormat(factureClt.getDateFacture()));
|
||||
Reglement.setText(factureClt.getTypeRegementString());
|
||||
TotalHorsTaxNet.setText(Adaptateur.StringToStringEspaceCurrency(factureClt.getTotalHorsTaxNet()));
|
||||
TotalTVA.setText(Adaptateur.StringToStringEspaceCurrency(factureClt.getTotalTVA()));
|
||||
TypeClt.setText(factureClt.getTypeClientString());
|
||||
NetAPayer.setText(Adaptateur.StringToStringEspaceCurrency(factureClt.getNetAPayer()));
|
||||
|
||||
if(factureClt.getTypeClient()==0 ){
|
||||
TextPrenom.setVisible(true);
|
||||
TextMatricule.setVisible(false);
|
||||
|
||||
Nom.setText(factureClt.CltPersonne.getNom());
|
||||
Prenom.setText(factureClt.CltPersonne.getPrenom());
|
||||
Adresse.setText(factureClt.CltPersonne.getAdresse());
|
||||
TELE1.setText(factureClt.CltPersonne.getTelemobileString());
|
||||
TELE2.setText(factureClt.CltPersonne.getTelefixString());
|
||||
}
|
||||
|
||||
if(factureClt.getTypeClient()==1){
|
||||
TextPrenom.setVisible(false);
|
||||
TextMatricule.setVisible(true);
|
||||
|
||||
Nom.setText(factureClt.CltEntreprise.getNom());
|
||||
Prenom.setText(factureClt.CltEntreprise.getMatricule());
|
||||
Adresse.setText(factureClt.CltEntreprise.getAdresse());
|
||||
TELE1.setText(factureClt.CltEntreprise.getTele1String());
|
||||
TELE2.setText(factureClt.CltEntreprise.getTele2String());
|
||||
}
|
||||
|
||||
if(factureClt.getTypeClient()==2 ){
|
||||
TextPrenom.setVisible(true);
|
||||
TextMatricule.setVisible(false);
|
||||
|
||||
Nom.setText(factureClt.CltPassager.getNom());
|
||||
Prenom.setText(factureClt.CltPassager.getPrenom());
|
||||
Adresse.setText(factureClt.CltPassager.getAdresse());
|
||||
TELE1.setText(factureClt.CltPassager.getTelefixString());
|
||||
TELE2.setText(factureClt.CltPassager.getTelemobileString());
|
||||
}
|
||||
TableViewListeProduit.setItems(factureClt.getListeproduit());
|
||||
|
||||
if(factureClt.getTypeRegementInteger() == 1)
|
||||
{
|
||||
ValMontant.setText(Adaptateur.StringToStringEspaceCurrency(factureClt.getTotalMontantTraite()));
|
||||
TabTypeRegement.setClosable(false);
|
||||
TabTypeRegement.setDisable(false);
|
||||
if(factureClt.getTypeFaciliteBoolean()){ //true Traite | false Cheque
|
||||
TabTypeRegement.setText("Liste des traites");
|
||||
TextMontant.setText("Total Montant Traites:");
|
||||
TableViewListeTraites.setVisible(true);
|
||||
//ButtonImprimerTraite.setVisible(true);
|
||||
ObservableList<FactureCltTraiteListe> dataListe = FXCollections.observableArrayList();
|
||||
ArrayList<TraiteClt> ListTraites = factureClt.getListeTraites();
|
||||
for(int i=0; i<ListTraites.size(); i++)
|
||||
{
|
||||
dataListe.add(new FactureCltTraiteListe(ListTraites.get(i).getDateTraiteClt(), Adaptateur.StringToStringEspaceCurrency(ListTraites.get(i).getMontantTraiteClt()) ));
|
||||
}
|
||||
TableViewListeTraites.setItems(dataListe);
|
||||
}else{
|
||||
TextMontant.setText("Total Montant Cheques:");
|
||||
TableViewListeCheques.setVisible(true);
|
||||
TabTypeRegement.setText("Liste des Chéques");
|
||||
ArrayList<ChequeClt> dataListCheque = factureClt.getListeCheques();
|
||||
ObservableList<FactureCltChequeListe> dataListeCheque = FXCollections.observableArrayList();
|
||||
for(int i=0; i<dataListCheque.size(); i++){
|
||||
dataListeCheque.add(new FactureCltChequeListe(dataListCheque.get(i).getDatePaiement(),dataListCheque.get(i).getNumeroChequeClt(),dataListCheque.get(i).getBanqueChequeClt(),dataListCheque.get(i).getMontantChequeClt()));
|
||||
}
|
||||
TableViewListeCheques.setItems(dataListeCheque);
|
||||
}
|
||||
}
|
||||
AnchorPaneLoading.setVisible(false);
|
||||
AnchorPaneDetailFactureClt.setVisible(true);
|
||||
|
||||
}
|
||||
});
|
||||
ThreadFactureCltDetail.start();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void ButtonPrintTraite()
|
||||
{
|
||||
ButtonImprimerTraite.setOnAction(new EventHandler<ActionEvent>() {
|
||||
@Override
|
||||
public void handle(ActionEvent e) {
|
||||
ArrayList<TraiteClt> ListTraites = factureClt.getListeTraites();
|
||||
String strCIN= "";
|
||||
String strNomComplet = "";
|
||||
|
||||
if(factureClt.getTypeClient() == 0){
|
||||
strCIN = factureClt.getCltPersonne().getCinString();
|
||||
strNomComplet = factureClt.getCltPersonne().getNomcomplet();
|
||||
}else if(factureClt.getTypeClient() == 1){
|
||||
strCIN = factureClt.getCltEntreprise().getMatricule();
|
||||
strNomComplet = factureClt.getCltEntreprise().getNom();
|
||||
}
|
||||
|
||||
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/Views/TraiteClt/TraiteCltPrint.fxml"));
|
||||
try {
|
||||
Parent FxmlPrintTraite = (Parent)fxmlLoader.load();
|
||||
TraiteCltPrintController TraiteCltPrint = fxmlLoader.getController();
|
||||
|
||||
PrinterJob jobPrint = PrinterJob.createPrinterJob();
|
||||
|
||||
Printer printer = Printer.getDefaultPrinter();
|
||||
PageLayout pageLayout = printer.createPageLayout(Paper.NA_LETTER,PageOrientation.PORTRAIT, 0, 0, 0, 0);
|
||||
JobSettings jobSettings = jobPrint.getJobSettings();
|
||||
jobSettings.setPageLayout(pageLayout);
|
||||
|
||||
jobPrint.getJobSettings().setPageRanges(new PageRange(1, ListTraites.size()));
|
||||
if (jobPrint.showPrintDialog(null))
|
||||
{
|
||||
for(int i=0; i<ListTraites.size(); i++)
|
||||
{
|
||||
TraiteCltPrint.SetData(Adaptateur.ChiffreToLettre(new BigDecimal(ListTraites.get(i).getMontantTraiteClt())),
|
||||
Adaptateur.StringToStringEspaceCurrency(ListTraites.get(i).getMontantTraiteClt()),
|
||||
ListTraites.get(i).getDateTraiteClt(),
|
||||
strNomComplet,
|
||||
strCIN);
|
||||
jobPrint.printPage(FxmlPrintTraite);
|
||||
}
|
||||
}
|
||||
jobPrint.endJob();
|
||||
|
||||
} catch (IOException ex) {
|
||||
Logger.getLogger(FactureCltDetailController.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,186 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package Controllers.FactureClt;
|
||||
|
||||
import Controllers.CommandeClt.*;
|
||||
import Models.Produit.ListeProduit;
|
||||
import Controllers.Traitement.MyWindow;
|
||||
import Models.CommandeClt.CommandeClt;
|
||||
import Models.FactureClt.FactureClt;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.ResourceBundle;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.Node;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.TableColumn;
|
||||
import javafx.scene.control.TableView;
|
||||
import javafx.scene.control.cell.PropertyValueFactory;
|
||||
import javafx.scene.image.Image;
|
||||
import javafx.scene.image.ImageView;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import javafx.scene.layout.StackPane;
|
||||
import javafx.scene.text.Text;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author PC-Maher
|
||||
*/
|
||||
public class FactureCltDialogConfirmationController implements Initializable {
|
||||
/**
|
||||
* Initializes the controller class.
|
||||
*/
|
||||
public Node nodeFxml ;
|
||||
|
||||
@FXML public AnchorPane AnchorPrincipal ;
|
||||
@FXML public Button Enregister ;
|
||||
@FXML private Text DateCreation;
|
||||
@FXML private Text Reglement;
|
||||
@FXML private Text NetAPayer;
|
||||
@FXML private Text TotalHorsTaxNet;
|
||||
@FXML private Text TotalTVA;
|
||||
|
||||
@FXML private Text TypeClt;
|
||||
@FXML private Text Nom;
|
||||
@FXML private Text Prenom;
|
||||
@FXML private Text Adresse;
|
||||
@FXML private Text TELE1;
|
||||
@FXML private Text TELE2;
|
||||
|
||||
@FXML private Text TextPrenom ;
|
||||
@FXML private Text TextMatricule ;
|
||||
|
||||
@FXML public TableView<ListeProduit> TableViewListeProduitPassCommClt ;
|
||||
@FXML public TableColumn<ListeProduit ,String> TabColReference;
|
||||
@FXML public TableColumn<ListeProduit ,String> TabColDesignaton;
|
||||
@FXML public TableColumn<ListeProduit ,String> TabColQuantite ;
|
||||
@FXML public TableColumn<ListeProduit ,String> TabColPrixHT;
|
||||
@FXML public TableColumn<ListeProduit ,String> TabColRemise;
|
||||
@FXML public TableColumn<ListeProduit ,String> TabColTotalHT;
|
||||
@FXML public TableColumn<ListeProduit ,String> TabColTVA;
|
||||
@FXML public TableColumn<ListeProduit ,String> TabColTotalTTC;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
|
||||
TabColReference.setCellValueFactory(new PropertyValueFactory<ListeProduit, String>("reference"));
|
||||
TabColDesignaton.setCellValueFactory(new PropertyValueFactory<ListeProduit, String>("designation"));
|
||||
|
||||
TabColQuantite.setCellValueFactory(new PropertyValueFactory<ListeProduit, String>("quantite"));
|
||||
TabColQuantite.setStyle( "-fx-alignment: CENTER; -fx-font-weight:bold; -fx-font-size: 10pt;");
|
||||
TabColQuantite.getStyleClass().add("Center");
|
||||
|
||||
TabColPrixHT.setCellValueFactory(new PropertyValueFactory<ListeProduit, String>("PrixHT"));
|
||||
TabColPrixHT.setStyle( "-fx-alignment: CENTER;");
|
||||
TabColPrixHT.getStyleClass().add("Center");
|
||||
|
||||
TabColRemise.setCellValueFactory(new PropertyValueFactory<ListeProduit, String>("Remise"));
|
||||
TabColRemise.setStyle( "-fx-alignment: CENTER;");
|
||||
TabColRemise.getStyleClass().add("Center");
|
||||
|
||||
TabColTotalHT.setCellValueFactory(new PropertyValueFactory<ListeProduit, String>("TotalHT"));
|
||||
TabColTotalHT.setStyle( "-fx-alignment: CENTER;");
|
||||
TabColTotalHT.getStyleClass().add("Center");
|
||||
|
||||
TabColTVA.setCellValueFactory(new PropertyValueFactory<ListeProduit, String>("TVA"));
|
||||
TabColTVA.setStyle( "-fx-alignment: CENTER;");
|
||||
TabColTVA.getStyleClass().add("Center");
|
||||
|
||||
TabColTotalTTC.setCellValueFactory(new PropertyValueFactory<ListeProduit, String>("TotalTTC"));
|
||||
TabColTotalTTC.setStyle( "-fx-alignment: CENTER; -fx-font-weight:bold; -fx-font-size: 10pt;");
|
||||
TabColTotalTTC.getStyleClass().add("Center");
|
||||
|
||||
Image coffeeImage = new Image(getClass().getResourceAsStream("/Public/icon/iconsave.png"));
|
||||
ImageView buttonGraphic = new ImageView();
|
||||
buttonGraphic.setImage(coffeeImage);
|
||||
Enregister.setGraphic(buttonGraphic);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void GetFactureClt(FactureClt factureclt){
|
||||
DateCreation.setText(factureclt.getDateFacture());
|
||||
Reglement.setText(factureclt.getTypeRegement());
|
||||
|
||||
NetAPayer.setText(factureclt.getNetAPayer());
|
||||
TotalHorsTaxNet.setText(factureclt.getTotalHorsTaxNet());
|
||||
TotalTVA.setText(factureclt.getTotalTVA());
|
||||
|
||||
TypeClt.setText(factureclt.getTypeClientString());
|
||||
|
||||
/*
|
||||
if(FactureCltAjouterController.TypeClient == 0){
|
||||
TextPrenom.setVisible(true);
|
||||
TextMatricule.setVisible(false);
|
||||
Nom.setText(factureclt.CltPersonne.getNom());
|
||||
Prenom.setText(factureclt.CltPersonne.getPrenom());
|
||||
Adresse.setText(factureclt.CltPersonne.getAdresse());
|
||||
TELE1.setText(factureclt.CltPersonne.getTelefixString());
|
||||
TELE2.setText(factureclt.CltPersonne.getTelemobileString());
|
||||
}
|
||||
else if(FactureCltAjouterController.TypeClient == 1){
|
||||
TextPrenom.setVisible(false);
|
||||
TextMatricule.setVisible(true);
|
||||
Prenom.setText(factureclt.CltEntreprise.getMatricule());
|
||||
Adresse.setText(factureclt.CltEntreprise.getAdresse());
|
||||
TELE1.setText(factureclt.CltEntreprise.getTele1().toString());
|
||||
TELE2.setText(factureclt.CltEntreprise.getTele2().toString());
|
||||
}
|
||||
else if(FactureCltAjouterController.TypeClient == 2){
|
||||
TextPrenom.setVisible(true);
|
||||
TextMatricule.setVisible(false);
|
||||
Nom.setText(factureclt.CltPassager.getNom());
|
||||
Prenom.setText(factureclt.CltPassager.getPrenom());
|
||||
Adresse.setText(factureclt.CltPassager.getAdresse());
|
||||
TELE1.setText(factureclt.CltPassager.getTelefix().toString());
|
||||
TELE2.setText(factureclt.CltPassager.getTelemobile().toString());
|
||||
}
|
||||
*/
|
||||
TableViewListeProduitPassCommClt.setItems(factureclt.getListeproduit());
|
||||
}
|
||||
|
||||
|
||||
public FactureCltDialogConfirmationController(){
|
||||
try {
|
||||
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/Views/FactureClt/FactureCltDialogConfirmation.fxml"));
|
||||
fxmlLoader.setController(this);
|
||||
nodeFxml = (Node) fxmlLoader.load();
|
||||
} catch (IOException ex) {
|
||||
Logger.getLogger(FactureCltDialogConfirmationController.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
}
|
||||
|
||||
public void Show()
|
||||
{
|
||||
StackPane Sp = new StackPane();
|
||||
|
||||
Scene scene = new Scene(Sp);
|
||||
|
||||
Sp.setPrefSize((double)MyWindow.PrincipalContentWidth, (double)MyWindow.PrincipalContentHeight);
|
||||
|
||||
Sp.getChildren().add(MyWindow.myParent);
|
||||
Sp.getChildren().add(nodeFxml);
|
||||
|
||||
Stage stage = MyWindow.myStage;
|
||||
stage.setScene(scene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void ExitButtonAction(ActionEvent event) throws IOException {
|
||||
AnchorPrincipal.setVisible(false);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,454 @@
|
||||
package Controllers.FactureClt;
|
||||
|
||||
import Models.FactureClt.FactureCltDB;
|
||||
import javafx.collections.FXCollections;
|
||||
import Models.FactureClt.FactureCltGestionList;
|
||||
import com.gluonhq.charm.glisten.control.ProgressBar;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.ResourceBundle;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javafx.beans.value.ChangeListener;
|
||||
import javafx.beans.value.ObservableValue;
|
||||
import javafx.collections.ObservableList;
|
||||
import javafx.concurrent.Service;
|
||||
import javafx.concurrent.Task;
|
||||
import javafx.concurrent.WorkerStateEvent;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.Group;
|
||||
import javafx.scene.Node;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.ChoiceBox;
|
||||
import javafx.scene.control.DatePicker;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.RadioButton;
|
||||
import javafx.scene.control.TableCell;
|
||||
import javafx.scene.control.TableColumn;
|
||||
import javafx.scene.control.TableView;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.control.cell.PropertyValueFactory;
|
||||
import javafx.scene.image.Image;
|
||||
import javafx.scene.image.ImageView;
|
||||
import javafx.scene.input.KeyCode;
|
||||
import javafx.scene.input.KeyEvent;
|
||||
import javafx.scene.input.MouseEvent;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import javafx.scene.paint.Color;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.scene.text.FontWeight;
|
||||
import javafx.scene.text.Text;
|
||||
import javafx.util.Callback;
|
||||
|
||||
/**
|
||||
* FXML Controller class
|
||||
* @author Maher Ben Tili
|
||||
*/
|
||||
public class FactureCltGestionController implements Initializable {
|
||||
|
||||
@FXML private AnchorPane PaneFactureGestion ;
|
||||
|
||||
@FXML private ProgressBar ProgressBarFactureClt;
|
||||
|
||||
@FXML private Button ButtonSearchFactureClt;
|
||||
|
||||
@FXML public TableView<FactureCltGestionList> TableViewFactureCltListGestion;
|
||||
|
||||
@FXML public TableColumn<FactureCltGestionList ,String> TabColCodeFacture;
|
||||
@FXML public TableColumn<FactureCltGestionList ,String> TabColTypeClient;
|
||||
@FXML public TableColumn<FactureCltGestionList ,String> TabColCodeClient;
|
||||
@FXML public TableColumn<FactureCltGestionList ,String> TabColMode ;
|
||||
@FXML public TableColumn<FactureCltGestionList ,String> TabColTotal;
|
||||
@FXML public TableColumn<FactureCltGestionList ,String> TabColCodeCommande;
|
||||
@FXML public TableColumn<FactureCltGestionList ,String> TabColCreation;
|
||||
@FXML public TableColumn<FactureCltGestionList ,Boolean>TabColDetail ;
|
||||
|
||||
@FXML public TextField TextFieldCodeFacture ;
|
||||
@FXML public TextField TextFieldCodeClient ;
|
||||
@FXML public TextField TextFieldCodeCommande ;
|
||||
@FXML public DatePicker PickerDateCreation;
|
||||
|
||||
@FXML public RadioButton RadioComptant;
|
||||
@FXML public RadioButton RadioFacilite;
|
||||
|
||||
@FXML private Text ActuellePage ;
|
||||
@FXML private Text NbrPage ;
|
||||
@FXML private Group nextgroupe ;
|
||||
@FXML private Group avancergroupe ;
|
||||
@FXML private Group lastgroupe ;
|
||||
@FXML private Group retourgroupe ;
|
||||
@FXML private Label LabelCount;
|
||||
@FXML private ChoiceBox NbrLigne ;
|
||||
|
||||
private Service<Void> ThreadSearchFactureClt;
|
||||
|
||||
ObservableList cursors = FXCollections.observableArrayList("10","15","20");
|
||||
private Integer nbrligne = 10 ;
|
||||
private Integer totalcount = 0;
|
||||
private Integer nbrpage = 0;
|
||||
private Integer actuellepage = 1;
|
||||
Integer position = 0;
|
||||
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
|
||||
//comboboxnombre des lignes tableview
|
||||
NbrLigne.setItems(cursors);
|
||||
NbrLigne.getSelectionModel().selectFirst();
|
||||
|
||||
TableViewFactureCltListGestion.setEditable(true);
|
||||
|
||||
TabColCodeFacture.setStyle( "-fx-alignment: CENTER;");TabColCodeFacture.getStyleClass().add("Center");
|
||||
TabColCodeFacture.setCellValueFactory(new PropertyValueFactory<FactureCltGestionList, String>("CodeFacture"));
|
||||
|
||||
TabColTypeClient.setStyle( "-fx-alignment: CENTER;");TabColTypeClient.getStyleClass().add("Center");
|
||||
TabColTypeClient.setCellValueFactory(new PropertyValueFactory<FactureCltGestionList, String>("TypeClient"));
|
||||
|
||||
TabColCodeClient.setStyle( "-fx-alignment: CENTER;");TabColCodeClient.getStyleClass().add("Center");
|
||||
TabColCodeClient.setCellValueFactory(new PropertyValueFactory<FactureCltGestionList, String>("CodeClient"));
|
||||
|
||||
TabColMode.setStyle( "-fx-alignment: CENTER;");TabColMode.getStyleClass().add("Center");
|
||||
TabColMode.setCellValueFactory(new PropertyValueFactory<FactureCltGestionList, String>("Mode"));
|
||||
TabColMode.setCellFactory(new Callback<TableColumn<FactureCltGestionList,String>,TableCell<FactureCltGestionList,String>>(){
|
||||
@Override
|
||||
public TableCell<FactureCltGestionList, String> call(TableColumn<FactureCltGestionList, String> param) {
|
||||
TableCell<FactureCltGestionList, String> cell = new TableCell<FactureCltGestionList, String>(){
|
||||
@Override
|
||||
public void updateItem(String item, boolean empty) {
|
||||
if(item!= null && item.equals("Comptant")){
|
||||
Text text = new Text(item);
|
||||
text.setFill(Color.web("#428BCA"));
|
||||
text.setFont(Font.font("Arial", FontWeight.BOLD, 14));
|
||||
setGraphic(text);
|
||||
}else if(item!= null && item.equals("Facilité")){
|
||||
Text text = new Text(item);
|
||||
text.setFill(Color.web("#000000"));
|
||||
text.setFont(Font.font("Arial", FontWeight.BOLD, 14));
|
||||
setGraphic(text);
|
||||
}else{
|
||||
setGraphic(null);
|
||||
}
|
||||
}
|
||||
};
|
||||
return cell;
|
||||
}
|
||||
});
|
||||
|
||||
TabColTotal.setStyle( "-fx-alignment: CENTER;");TabColTotal.getStyleClass().add("Center");
|
||||
TabColTotal.setCellValueFactory(new PropertyValueFactory<FactureCltGestionList, String>("Total"));
|
||||
|
||||
TabColCodeCommande.setStyle( "-fx-alignment: CENTER;");TabColCodeCommande.getStyleClass().add("Center");
|
||||
TabColCodeCommande.setCellValueFactory(new PropertyValueFactory<FactureCltGestionList, String>("CodeCommande"));
|
||||
|
||||
TabColCreation.setStyle( "-fx-alignment: CENTER;");TabColCreation.getStyleClass().add("Center");
|
||||
TabColCreation.setCellValueFactory(new PropertyValueFactory<FactureCltGestionList, String>("DateCreation"));
|
||||
|
||||
TabColDetail.setStyle( "-fx-alignment: CENTER;");TabColDetail.getStyleClass().add("Center");
|
||||
TabColDetail.setCellFactory(new Callback<TableColumn<FactureCltGestionList, Boolean>, TableCell<FactureCltGestionList, Boolean>>() {
|
||||
@Override
|
||||
public TableCell<FactureCltGestionList, Boolean> call(TableColumn<FactureCltGestionList, Boolean> personBooleanTableColumn) {
|
||||
return new ButtonCell();
|
||||
}
|
||||
});
|
||||
|
||||
ButtonSearchFactureClt.setOnMouseClicked(new EventHandler<MouseEvent>() {
|
||||
public void handle(MouseEvent me) {
|
||||
SearchFactureClt();
|
||||
}
|
||||
});
|
||||
|
||||
PaneFactureGestion.setOnKeyPressed(new EventHandler<KeyEvent>() {
|
||||
@Override
|
||||
public void handle(KeyEvent ke) {
|
||||
if (ke.getCode().equals(KeyCode.ENTER)) {
|
||||
SearchFactureClt();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
RadioComptant.setOnMouseClicked(new EventHandler<MouseEvent>() {
|
||||
public void handle(MouseEvent me) {
|
||||
SearchFactureClt();
|
||||
}
|
||||
});
|
||||
|
||||
RadioFacilite.setOnMouseClicked(new EventHandler<MouseEvent>() {
|
||||
public void handle(MouseEvent me) {
|
||||
SearchFactureClt();
|
||||
}
|
||||
});
|
||||
|
||||
GestionSearchFactureClt();
|
||||
|
||||
}
|
||||
|
||||
|
||||
private class ButtonCell extends TableCell<FactureCltGestionList, Boolean> {
|
||||
|
||||
final Button cellButton = new Button();
|
||||
ButtonCell(){
|
||||
cellButton.getStyleClass().add("btn-icon-primary");
|
||||
Image coffeeImage = new Image(getClass().getResourceAsStream("/Public/icon/detailbutton.png"));
|
||||
ImageView buttonGraphic = new ImageView();
|
||||
buttonGraphic.setImage(coffeeImage);
|
||||
cellButton.setGraphic(buttonGraphic);
|
||||
cellButton.setOnAction(new EventHandler<ActionEvent>(){ //Action when the button is pressed
|
||||
@Override
|
||||
public void handle(ActionEvent t) {
|
||||
try {
|
||||
// get Selected Item
|
||||
FactureCltGestionList current = (FactureCltGestionList) ButtonCell.this.getTableView().getItems().get(ButtonCell.this.getIndex());
|
||||
String code_facture = current.getCodeFacture();
|
||||
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/Views/FactureClt/FactureCltDetail.fxml"));
|
||||
Parent NodeFactureCltDetail = (Parent)fxmlLoader.load();
|
||||
FactureCltDetailController FactureCltDetail= fxmlLoader.getController();
|
||||
FactureCltDetail.PaneSucces.setVisible(false);
|
||||
|
||||
FactureCltDetail.codeFactClt = code_facture;
|
||||
FactureCltDetail.SowDetailFactureClt(false);
|
||||
PaneFactureGestion.getChildren().clear();
|
||||
PaneFactureGestion.getChildren().add(NodeFactureCltDetail);
|
||||
FactureCltDetail.ButtonImprimerTraite.setVisible(false);
|
||||
} catch (IOException ex) {
|
||||
Logger.getLogger(FactureCltAjouterController.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//Display button if the row is not empty
|
||||
@Override
|
||||
protected void updateItem(Boolean t, boolean empty) {
|
||||
if(!empty){
|
||||
setGraphic(cellButton);
|
||||
} else {
|
||||
setGraphic(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void FactureCltAjouterButtonAction(ActionEvent event) throws IOException {
|
||||
PaneFactureGestion.getChildren().clear();
|
||||
PaneFactureGestion.getChildren().add((Node) FXMLLoader.load(getClass().getResource("/Views/FactureClt/FactureCltAjouter.fxml")));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/****************************************************************************** *
|
||||
* *
|
||||
* Methode last Next TableView *
|
||||
* * *
|
||||
******************************************************************************/
|
||||
|
||||
private void SearchFactureClt()
|
||||
{
|
||||
ProgressBarFactureClt.setVisible(true);
|
||||
|
||||
ButtonSearchFactureClt.setDisable(true);
|
||||
|
||||
ThreadSearchFactureClt = new Service<Void>(){
|
||||
@Override
|
||||
protected Task<Void> createTask(){
|
||||
return new Task<Void>(){
|
||||
@Override
|
||||
protected Void call() throws Exception{
|
||||
|
||||
position = 0;
|
||||
|
||||
actuellepage = 1;
|
||||
|
||||
String DateCreation = "";
|
||||
if(PickerDateCreation.getValue() != null){
|
||||
DateCreation = PickerDateCreation.getValue().toString();
|
||||
}
|
||||
|
||||
// 0comptant 1facilité
|
||||
String TypeRegement = "";
|
||||
if(RadioComptant.isSelected()){
|
||||
TypeRegement = "0";
|
||||
}else if(RadioFacilite.isSelected()){
|
||||
TypeRegement = "1";
|
||||
}
|
||||
|
||||
ObservableList<FactureCltGestionList> ListFactureClts = new FactureCltDB().SearchFactureCltGestion(
|
||||
position,
|
||||
nbrligne,
|
||||
TextFieldCodeFacture.getText(),
|
||||
TextFieldCodeClient.getText(),
|
||||
TypeRegement,
|
||||
TextFieldCodeCommande.getText(),
|
||||
DateCreation);
|
||||
|
||||
TableViewFactureCltListGestion.setItems(ListFactureClts);
|
||||
|
||||
totalcount = new FactureCltDB().nbrFactureCltGestion(TextFieldCodeFacture.getText(),
|
||||
TextFieldCodeClient.getText(),
|
||||
TypeRegement,
|
||||
TextFieldCodeCommande.getText(),
|
||||
DateCreation);
|
||||
|
||||
if(totalcount > 0){
|
||||
ActuellePage.setText("1");
|
||||
}else{
|
||||
ActuellePage.setText("0");
|
||||
}
|
||||
|
||||
if(totalcount % nbrligne==0){
|
||||
nbrpage = totalcount / nbrligne ;
|
||||
}
|
||||
else{
|
||||
nbrpage = (totalcount / nbrligne) + 1 ;
|
||||
}
|
||||
NbrPage.setText(Integer.toString(nbrpage));
|
||||
|
||||
return null;
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
ThreadSearchFactureClt.setOnSucceeded(new EventHandler<WorkerStateEvent>(){
|
||||
@Override
|
||||
public void handle(WorkerStateEvent event){
|
||||
ProgressBarFactureClt.setVisible(false);
|
||||
ButtonSearchFactureClt.setDisable(false);
|
||||
LabelCount.setText(totalcount.toString());
|
||||
|
||||
}
|
||||
});
|
||||
ThreadSearchFactureClt.start();
|
||||
}
|
||||
|
||||
|
||||
private void NextLastSearchFactureClt(Integer ParmPosition, Integer ParamNbrligne)
|
||||
{
|
||||
ProgressBarFactureClt.setVisible(true);
|
||||
|
||||
ButtonSearchFactureClt.setDisable(true);
|
||||
|
||||
ThreadSearchFactureClt = new Service<Void>(){
|
||||
@Override
|
||||
protected Task<Void> createTask(){
|
||||
return new Task<Void>(){
|
||||
@Override
|
||||
protected Void call() throws Exception{
|
||||
|
||||
String DateCreation = "";
|
||||
if(PickerDateCreation.getValue() != null){
|
||||
DateCreation = PickerDateCreation.getValue().toString();
|
||||
}
|
||||
|
||||
ObservableList<FactureCltGestionList> ListFactureClts = new FactureCltDB().SearchFactureCltGestion(ParmPosition, ParamNbrligne, TextFieldCodeFacture.getText(), TextFieldCodeClient.getText(), "", TextFieldCodeCommande.getText(), DateCreation);
|
||||
|
||||
TableViewFactureCltListGestion.setItems(ListFactureClts);
|
||||
|
||||
return null;
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
ThreadSearchFactureClt.setOnSucceeded(new EventHandler<WorkerStateEvent>(){
|
||||
@Override
|
||||
public void handle(WorkerStateEvent event){
|
||||
ProgressBarFactureClt.setVisible(false);
|
||||
ButtonSearchFactureClt.setDisable(false);
|
||||
}
|
||||
});
|
||||
ThreadSearchFactureClt.start();
|
||||
}
|
||||
|
||||
private void GestionSearchFactureClt()
|
||||
{
|
||||
NbrLigne.getSelectionModel().selectedIndexProperty().addListener(new ChangeListener<Number>() {
|
||||
|
||||
public void changed(ObservableValue ov, Number value, Number new_value) {
|
||||
nbrligne= Integer.parseInt((String) cursors.get(new_value.intValue()));
|
||||
if(totalcount % nbrligne==0){ nbrpage = totalcount / nbrligne ;}
|
||||
else{ nbrpage = (totalcount / nbrligne) + 1 ; }
|
||||
NbrPage.setText(Integer.toString(nbrpage));
|
||||
position=0;
|
||||
ActuellePage.setText("1");
|
||||
actuellepage=1;
|
||||
NextLastSearchFactureClt(position, nbrligne);
|
||||
}
|
||||
});
|
||||
|
||||
if(totalcount % nbrligne==0){ nbrpage = totalcount / nbrligne ;}
|
||||
else{ nbrpage = (totalcount / nbrligne) + 1 ; }
|
||||
NbrPage.setText(Integer.toString(nbrpage));
|
||||
|
||||
|
||||
//next page
|
||||
nextgroupe.setOnMousePressed(new EventHandler<MouseEvent>(){
|
||||
@Override
|
||||
public void handle(MouseEvent event) {
|
||||
if(actuellepage<nbrpage)
|
||||
{
|
||||
position=position+nbrligne;
|
||||
NextLastSearchFactureClt(position, nbrligne);
|
||||
actuellepage=actuellepage+1 ;
|
||||
ActuellePage.setText(Integer.toString(actuellepage));
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//last page
|
||||
lastgroupe.setOnMousePressed(new EventHandler<MouseEvent>(){
|
||||
@Override
|
||||
public void handle(MouseEvent event) {
|
||||
if(actuellepage>1)
|
||||
{
|
||||
position=position-nbrligne;
|
||||
NextLastSearchFactureClt(position, nbrligne);
|
||||
actuellepage=actuellepage-1 ;
|
||||
ActuellePage.setText(Integer.toString(actuellepage));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//next page avec pas de 5
|
||||
avancergroupe.setOnMousePressed(new EventHandler<MouseEvent>(){
|
||||
@Override
|
||||
public void handle(MouseEvent event) {
|
||||
if(actuellepage+3<nbrpage)
|
||||
{
|
||||
position=(position+4)+nbrligne;
|
||||
NextLastSearchFactureClt(position, nbrligne);
|
||||
actuellepage=actuellepage+3 ;
|
||||
ActuellePage.setText(Integer.toString(actuellepage));
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//last page avec un pas de -5
|
||||
retourgroupe.setOnMousePressed(new EventHandler<MouseEvent>(){
|
||||
@Override
|
||||
public void handle(MouseEvent event) {
|
||||
if(actuellepage-3>1){
|
||||
position=(position-4)-nbrligne;
|
||||
NextLastSearchFactureClt(position, nbrligne);
|
||||
actuellepage=actuellepage-3 ;
|
||||
ActuellePage.setText(Integer.toString(actuellepage));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,228 @@
|
||||
package Controllers.FactureClt;
|
||||
|
||||
import Controllers.Traitement.Adaptateur;
|
||||
import Controllers.Traitement.ParametreSystem;
|
||||
import Models.Client.Client;
|
||||
import Models.Client.ClientEntreprise;
|
||||
import Models.Client.ClientPassager;
|
||||
import Models.FactureClt.FactureClt;
|
||||
import Models.Produit.ListeProduit;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.ResourceBundle;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.print.PageRange;
|
||||
import javafx.print.PrinterJob;
|
||||
import javafx.scene.control.Control;
|
||||
import javafx.scene.control.TableCell;
|
||||
import javafx.scene.control.TableColumn;
|
||||
import javafx.scene.control.TableView;
|
||||
import javafx.scene.control.cell.PropertyValueFactory;
|
||||
import javafx.scene.control.cell.TextFieldTableCell;
|
||||
import javafx.scene.image.Image;
|
||||
import javafx.scene.image.ImageView;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import javafx.scene.text.Text;
|
||||
import javafx.util.Callback;
|
||||
import javax.xml.XMLConstants;
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
/**
|
||||
* FXML Controller class
|
||||
* @author Maher Ben Tili
|
||||
*/
|
||||
public class FactureCltPrintController implements Initializable {
|
||||
|
||||
@FXML private AnchorPane AnchorPaneTotal;
|
||||
|
||||
@FXML public ImageView ImageViewLogo;
|
||||
|
||||
@FXML private Text TextSteNom;
|
||||
@FXML private Text TextSteAdress;
|
||||
@FXML private Text TextSteTeleFax;
|
||||
@FXML private Text TextSteIFCR;
|
||||
@FXML private Text TextSteRIB;
|
||||
@FXML private Text TextSteEmailSite;
|
||||
|
||||
@FXML private Text TextNumFacture;
|
||||
@FXML private Text TextDateFacture;
|
||||
@FXML private Text TextNumCommande;
|
||||
@FXML private Text TextPagination;
|
||||
|
||||
@FXML private Text TextCltNomPrenom;
|
||||
@FXML private Text TextCltTele;
|
||||
@FXML private Text TextCltAdress;
|
||||
|
||||
@FXML private Text TextDuplicata;
|
||||
|
||||
@FXML private TableView<ListeProduit> TableViewListeProduit ;
|
||||
@FXML private TableColumn<ListeProduit ,String> TabColReference;
|
||||
@FXML private TableColumn<ListeProduit ,String> TabColDesignation;
|
||||
@FXML private TableColumn<ListeProduit ,String> TabColQuantite ;
|
||||
@FXML private TableColumn<ListeProduit ,String> TabColPrixHT;
|
||||
@FXML private TableColumn<ListeProduit ,String> TabColRemise;
|
||||
@FXML private TableColumn<ListeProduit ,String> TabColTotalHT;
|
||||
@FXML private TableColumn<ListeProduit ,String> TabColTVA;
|
||||
@FXML private TableColumn<ListeProduit ,String> TabColTotalTTC;
|
||||
|
||||
@FXML private Text TextTotalRemise;
|
||||
@FXML private Text TextTotalHT;
|
||||
@FXML private Text TextTotalTVA;
|
||||
@FXML private Text TextTimbre;
|
||||
@FXML private Text TextNetPayer;
|
||||
|
||||
|
||||
/**
|
||||
* Initializes the controller class.
|
||||
*/
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
|
||||
setImageLogo();
|
||||
|
||||
TextSteNom.setText(ParametreSystem.CompanyName);
|
||||
TextSteAdress.setText(ParametreSystem.CompanyAddress);
|
||||
TextSteTeleFax.setText(ParametreSystem.CompanyTele+" | Fax: "+ParametreSystem.CompanyFax);
|
||||
TextSteIFCR.setText(ParametreSystem.CompanyIF+" | M.F: "+ParametreSystem.CompanyMF);
|
||||
TextSteRIB.setText(ParametreSystem.RIB);
|
||||
TextSteEmailSite.setText(ParametreSystem.CompanyMail+" | Site:"+ParametreSystem.CompanySite);
|
||||
|
||||
|
||||
TabColReference.setCellValueFactory(new PropertyValueFactory<ListeProduit, String>("reference"));
|
||||
TabColReference.setStyle( "-fx-alignment: CENTER;");
|
||||
TabColReference.getStyleClass().add("Center");
|
||||
|
||||
TabColDesignation.setCellValueFactory(new PropertyValueFactory<ListeProduit, String>("designation"));
|
||||
TabColDesignation.setCellFactory(new Callback<TableColumn<ListeProduit,String>,TableCell<ListeProduit,String>>(){
|
||||
@Override
|
||||
public TableCell<ListeProduit, String> call(TableColumn<ListeProduit, String> param) {
|
||||
TableCell<ListeProduit, String> cell = new TableCell<ListeProduit, String>(){
|
||||
@Override
|
||||
public void updateItem(String item, boolean empty) {
|
||||
if (item == null) {
|
||||
super.setText(null);
|
||||
super.setGraphic(null);
|
||||
} else {
|
||||
String newItem = item.trim().toLowerCase();
|
||||
Text text = new Text(newItem);
|
||||
super.setPrefHeight(Control.USE_COMPUTED_SIZE);
|
||||
text.wrappingWidthProperty().bind(super.widthProperty());
|
||||
super.setGraphic(text);
|
||||
}
|
||||
}
|
||||
};
|
||||
return cell;
|
||||
}
|
||||
});
|
||||
|
||||
TabColQuantite.setCellValueFactory(new PropertyValueFactory<ListeProduit, String>("quantite"));
|
||||
TabColQuantite.setStyle( "-fx-alignment: CENTER;");
|
||||
TabColQuantite.getStyleClass().add("Center");
|
||||
|
||||
TabColPrixHT.setCellValueFactory(new PropertyValueFactory<ListeProduit, String>("PrixHT"));
|
||||
TabColPrixHT.setStyle( "-fx-alignment: CENTER;");
|
||||
TabColPrixHT.getStyleClass().add("Center");
|
||||
|
||||
TabColRemise.setCellValueFactory(new PropertyValueFactory<ListeProduit, String>("Remise"));
|
||||
TabColRemise.setStyle( "-fx-alignment: CENTER;");
|
||||
TabColRemise.getStyleClass().add("Center");
|
||||
|
||||
TabColTotalHT.setCellValueFactory(new PropertyValueFactory<ListeProduit, String>("TotalHT"));
|
||||
TabColTotalHT.setStyle( "-fx-alignment: CENTER;");
|
||||
TabColTotalHT.getStyleClass().add("Center");
|
||||
|
||||
TabColTVA.setCellValueFactory(new PropertyValueFactory<ListeProduit, String>("TVA"));
|
||||
TabColTVA.setStyle( "-fx-alignment: CENTER;");
|
||||
TabColTVA.getStyleClass().add("Center");
|
||||
|
||||
TabColTotalTTC.setCellValueFactory(new PropertyValueFactory<ListeProduit, String>("TotalTTC"));
|
||||
TabColTotalTTC.setStyle( "-fx-alignment: CENTER;");
|
||||
TabColTotalTTC.getStyleClass().add("Center");
|
||||
|
||||
TabColReference.setCellFactory(TextFieldTableCell.<ListeProduit>forTableColumn());
|
||||
TabColQuantite.setCellFactory(TextFieldTableCell.<ListeProduit>forTableColumn());
|
||||
TabColRemise.setCellFactory(TextFieldTableCell.<ListeProduit>forTableColumn());
|
||||
}
|
||||
|
||||
|
||||
public void setFactureClt(FactureClt factureClt, boolean duplicata)
|
||||
{
|
||||
if(duplicata){
|
||||
TextDuplicata.setVisible(true);
|
||||
}else{
|
||||
TextDuplicata.setVisible(false);
|
||||
}
|
||||
|
||||
TableViewListeProduit.setItems(factureClt.getListeproduit());
|
||||
|
||||
TextNumFacture.setText(factureClt.getCodeFactureClt());
|
||||
TextDateFacture.setText(Adaptateur.NormalDateFormat(factureClt.getDateFacture()));
|
||||
TextNumCommande.setText(factureClt.getIdCommandeClt());
|
||||
TextPagination.setText("1/1");
|
||||
|
||||
//0 Personne 1 Entreprise 2 Passager
|
||||
if(factureClt.getTypeClient() == 0){
|
||||
Client client = factureClt.getCltPersonne();
|
||||
TextCltNomPrenom.setText(client.getNom()+" "+client.getPrenom());
|
||||
TextCltTele.setText(client.getTelefixString());
|
||||
TextCltAdress.setText(client.getAdresse());
|
||||
}else if(factureClt.getTypeClient() == 1){
|
||||
ClientEntreprise entreprise = factureClt.getCltEntreprise();
|
||||
TextCltNomPrenom.setText(entreprise.getNom());
|
||||
TextCltTele.setText(entreprise.getTele1String());
|
||||
TextCltAdress.setText(entreprise.getAdresse());
|
||||
}else if(factureClt.getTypeClient() == 2){
|
||||
ClientPassager passager = factureClt.getCltPassager();
|
||||
TextCltNomPrenom.setText(passager.getNom()+" "+passager.getPrenom());
|
||||
TextCltTele.setText(passager.getTelefixString());
|
||||
TextCltAdress.setText(passager.adresse);
|
||||
}
|
||||
|
||||
TextTotalRemise.setText(Adaptateur.StringToStringEspace(factureClt.getRemise()));
|
||||
TextTotalHT.setText(Adaptateur.StringToStringEspace(factureClt.getTotalHorsTaxNet()));
|
||||
TextTotalTVA.setText(Adaptateur.StringToStringEspace(factureClt.getTotalTVA()));
|
||||
TextTimbre.setText(Adaptateur.StringToStringEspace(factureClt.getTimbre()));
|
||||
TextNetPayer.setText(Adaptateur.StringToStringEspace(factureClt.getNetAPayer()));
|
||||
|
||||
}
|
||||
|
||||
private void setImageLogo()
|
||||
{
|
||||
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
|
||||
try {
|
||||
// optional, but recommended
|
||||
// process XML securely, avoid attacks like XML External Entities (XXE)
|
||||
dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
|
||||
|
||||
// parse XML file
|
||||
DocumentBuilder db = dbf.newDocumentBuilder();
|
||||
|
||||
//PowerERP\conf\logo.xml
|
||||
Document doc = db.parse(new File("./conf/logo.xml"));
|
||||
|
||||
doc.getDocumentElement().normalize();
|
||||
|
||||
Element elementCNX = (Element) doc.getElementsByTagName("FactureCltPrint").item(0);
|
||||
|
||||
String pathLogo = elementCNX.getElementsByTagName("PathImage").item(0).getTextContent();
|
||||
FileInputStream fis = new FileInputStream(pathLogo);
|
||||
ImageViewLogo.setImage(new Image(fis));
|
||||
|
||||
ImageViewLogo.setFitWidth(Double.parseDouble(elementCNX.getElementsByTagName("FitWidth").item(0).getTextContent()));
|
||||
ImageViewLogo.setFitHeight(Double.parseDouble(elementCNX.getElementsByTagName("FitHeight").item(0).getTextContent()));
|
||||
ImageViewLogo.setLayoutX(Double.parseDouble(elementCNX.getElementsByTagName("LayoutX").item(0).getTextContent()));
|
||||
ImageViewLogo.setLayoutY(Double.parseDouble(elementCNX.getElementsByTagName("LayoutY").item(0).getTextContent()));
|
||||
}
|
||||
catch (ParserConfigurationException | SAXException | IOException e) {
|
||||
System.out.println("error AuthentificationController/setImageLogo "+e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user