Commit ca8bb0dd by Tuomas Riihimäki

foooood

1 parent 543f6031
......@@ -419,7 +419,7 @@ public class Bill extends GenericEntity {
boolean ret = false;
for (BillLine bl : billLines)
{
if (bl.getFoodwave() != null && (bl.getFoodwave().getClosed() || bl.getFoodwave().getTime().after(Calendar.getInstance())))
if (bl.getFoodwave() != null && (bl.getFoodwave().getClosed() || bl.getFoodwave().getTime().before(Calendar.getInstance())))
{
ret = true;
break;
......
......@@ -42,7 +42,7 @@
</p:column>
<p:column>
<f:facet name="header">
<h:outputLabel id="name" value="#{i18n['billLine.eventuser']}" />
<h:outputLabel value="#{i18n['billLine.eventuser']}" />
</f:facet>
<h:link outcome="/useradmin/edit" value="#{bill_line.bill.user.wholeName}">
<f:param name="userid" value="#{bill_line.bill.user.id}" />
......@@ -50,7 +50,7 @@
</p:column>
<p:column>
<f:facet name="header">
<h:outputLabel id="name" value="#{i18n['billLine.nick']}" />
<h:outputLabel value="#{i18n['billLine.nick']}" />
</f:facet>
<h:link outcome="/useradmin/edit" value="#{bill_line.bill.user.nick}">
<f:param name="userid" value="#{bill_line.bill.user.id}" />
......@@ -79,20 +79,21 @@
</p:column> -->
</p:dataTable>
</h:form>
<br />
<br />
<h1>
<h:outputLabel value="#{i18n['foodwave.orders']}" />
</h1>
<h:form>
<p:dataTable styleClass="bordertable" value="#{foodWaveView.accountEventLines}" var="acc_lines">
<f:facet name="header">
<h:outputLabel value="#{i18n['foodWave.accountevents']}" />
</f:facet>
<p:column>
<f:facet name="header">
<h:outputLabel id="name" value="${i18n['acc_lines.time']}" />
<h:outputLabel value="${i18n['acc_lines.time']}" />
</f:facet>
<h:outputText value="#{acc_line.eventTime.getTime()}">
<f:convertDateTime pattern="hh:mm d/M/yy" />
......@@ -100,19 +101,19 @@
</p:column>
<p:column>
<f:facet name="header">
<h:outputLabel id="name" value="${i18n['acc_line.quantity']}" />
<h:outputLabel value="${i18n['acc_line.quantity']}" />
</f:facet>
<h:outputText value="#{acc_line.quantity}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputLabel id="name" value="${i18n['acc_line.product']}" />
<h:outputLabel value="${i18n['acc_line.product']}" />
</f:facet>
<h:outputText value="#{acc_line.product.name}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputLabel id="name" value="${i18n['acc_line.eventuser']}" />
<h:outputLabel value="${i18n['acc_line.eventuser']}" />
</f:facet>
<h:link outcome="/useradmin/edit" value="#{acc_line.user.wholeName}">
<f:param name="userid" value="#{acc_line.user.id}" />
......@@ -120,7 +121,7 @@
</p:column>
<p:column>
<f:facet name="header">
<h:outputLabel id="name" value="${i18n['acc_line.nick']}" />
<h:outputLabel value="${i18n['acc_line.nick']}" />
</f:facet>
<h:link outcome="/useradmin/edit" value="#{acc_line.user.nick}">
<f:param name="userid" value="#{acc_line.user.id}" />
......@@ -128,7 +129,7 @@
</p:column>
<p:column>
<f:facet name="header">
<h:outputLabel id="name" value="${i18n['accountEvent.delivered']}" />
<h:outputLabel value="${i18n['accountEvent.delivered']}" />
</f:facet>
<h:outputText rendered="#{acc_line.delivered}" value="#{i18n['accountEvent.delivered']}" />
<h:commandButton rendered="#{not acc_line.delivered}" value="#{i18n['accountEvent.deliver']}" action="#{foodWaveView.deliverAccountEvent}" />
......
......@@ -174,10 +174,14 @@ public class FoodWaveView extends GenericCDIView {
if (permbean.hasPermission(BillPermission.WRITE_ALL) && getBillLines().isRowAvailable()) {
Bill b = getBillLines().getRowData().getBill();
b = getBillbean().markPaid(b, Calendar.getInstance());
foodWaveId = selectedFoodWave.getId();
selectedFoodWave = null;
initFoodWaveOrderList();
}
return null;
}
}
public String deliverAccountEvent() {
if (getAccountEventLines().isRowAvailable()) {
......@@ -189,8 +193,6 @@ public class FoodWaveView extends GenericCDIView {
return null;
}
public void initFoodWaveOrderList() {
if (super.requirePermissions(ShopPermission.MANAGE_FOODWAVES) && selectedFoodWave == null) {
......@@ -208,7 +210,6 @@ public class FoodWaveView extends GenericCDIView {
setBillLines(new ListDataModel<BillLine>(tmpLines));
setAccountEventLines(new ListDataModel<AccountEvent>(selectedFoodWave.getAccountEvents()));
super.beginConversation();
......@@ -295,6 +296,7 @@ public class FoodWaveView extends GenericCDIView {
public void setAccountEventLines(ListDataModel<AccountEvent> accountEventLines) {
this.accountEventLines = accountEventLines;
}
/*
* public List<BillLine> getUnpaidBills() { return unpaidBills; }
*
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!