Commit 653d2668 by Antti Tönkyrä

reverse-jyräys :)

1 parent 5d97b618
......@@ -67,7 +67,7 @@ public class FoodWaveView extends GenericCDIView {
private Integer foodWaveId;
private ListDataModel<AccountEvent> accountEventLines;
private List<FoodWave> foodWaves;
private ListDataModel<FoodWave> foodWaves;
private static final Logger logger = LoggerFactory.getLogger(FoodWaveView.class);
public List<Product> getProducts() {
......@@ -79,6 +79,11 @@ public class FoodWaveView extends GenericCDIView {
public void onEdit() {
this.foodWaveBean.saveTemplate(template);
}
public void onEditFoodWave() {
FoodWave fw = foodWaves.getRowData();
this.foodWaveBean.merge(fw);
}
public void initTemplateList() {
super.requirePermissions(ShopPermission.SHOP_FOODWAVE);
......@@ -87,7 +92,11 @@ public class FoodWaveView extends GenericCDIView {
public void initFoodwaveManagerList() {
if (super.requirePermissions(ShopPermission.MANAGE_FOODWAVES))
{
foodWaves = foodWaveBean.getEventFoodWaves();
if(foodWaves == null) {
super.beginConversation();
foodWaves = new ListDataModel<FoodWave>(foodWaveBean.getEventFoodWaves());
}
}
}
......@@ -110,9 +119,9 @@ public class FoodWaveView extends GenericCDIView {
if (templateId != null)
{
template = foodWaveBean.findTemplate(templateId);
foodWaves = template.getFoodwaves();
foodWaves = new ListDataModel<FoodWave>(template.getFoodwaves());
} else {
foodWaves = foodWaveBean.getOpenFoodWaves();
foodWaves = new ListDataModel<FoodWave>(foodWaveBean.getOpenFoodWaves());
}
super.beginConversation();
}
......@@ -235,7 +244,8 @@ public class FoodWaveView extends GenericCDIView {
public String deliverAccountEvent() {
if (getAccountEventLines().isRowAvailable()) {
AccountEvent e = getAccountEventLines().getRowData();
e = accountEventBean.markDelivered(e, Calendar.getInstance());
e.setDelivered(Calendar.getInstance());
e = accountEventBean.merge(e);
foodWaveId = selectedFoodWave.getId();
selectedFoodWave = null;
......@@ -334,11 +344,11 @@ public class FoodWaveView extends GenericCDIView {
this.billLines = billLines;
}
public void setFoodWaves(List<FoodWave> foodWaves) {
public void setFoodWaves(ListDataModel<FoodWave> foodWaves) {
this.foodWaves = foodWaves;
}
public List<FoodWave> getFoodWaves() {
public ListDataModel<FoodWave> getFoodWaves() {
return foodWaves;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!