mirror of
https://github.com/klmp200/PQT_Gestionnaire_vente_stock.git
synced 2024-12-22 23:41:09 +00:00
Module Core, clss Sale : ajout méthd getTotalPrice
This commit is contained in:
parent
064b35aaea
commit
5a84ed76a1
@ -100,4 +100,12 @@ public class Sale implements ILoggable, Serializable{
|
||||
public void setStatus(SaleStatus status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public double getTotalPrice() {
|
||||
double totalPrice = 0;
|
||||
for(Product product : this.products.keySet()){
|
||||
totalPrice+=product.getPrice()*(double)this.products.get(product);
|
||||
}
|
||||
return totalPrice;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user