diff --git a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/strings/GUIStringTool.java b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/strings/GUIStringTool.java index 22fe69f3..0b69d406 100644 --- a/Workspace/client/src/main/java/com/pqt/client/gui/ressources/strings/GUIStringTool.java +++ b/Workspace/client/src/main/java/com/pqt/client/gui/ressources/strings/GUIStringTool.java @@ -36,9 +36,17 @@ public class GUIStringTool { public static IObjectStringRenderer getDetailledProductStringRenderer(){ return product->{ - if(product!=null) - return String.format("%s - %.2f€ (%s)", product.getName(), product.getPrice(), (product.getAmountRemaining()>=30?"30+": Integer.toString(product.getAmountRemaining()))); - else + if(product!=null){ + String amountStr; + if(product.getAmountRemaining()<=0){ + amountStr = "OUT OF STOCK"; + }else if(product.getAmountRemaining()>=30){ + amountStr = "30+"; + }else{ + amountStr = Integer.toString(product.getAmountRemaining()); + } + return String.format("%s - %.2f€ (%s)", product.getName(), product.getPrice(), amountStr); + }else return "null"; }; }