Commit abad39a1 by Tuukka Kivilahti

ruokatilauksen maksuasiaa

1 parent e9da7339
...@@ -428,6 +428,16 @@ public class Bill extends GenericEntity { ...@@ -428,6 +428,16 @@ public class Bill extends GenericEntity {
public void setSentDate(Calendar sentDate) { public void setSentDate(Calendar sentDate) {
this.sentDate = sentDate; this.sentDate = sentDate;
} }
public boolean isFoodwaveBill() {
for (BillLine bl : billLines)
{
if (bl.getFoodwave() != null) {
return true;
}
}
return false;
}
public boolean isFoowavePaymentOver() { public boolean isFoowavePaymentOver() {
for (BillLine bl : billLines) for (BillLine bl : billLines)
...@@ -473,7 +483,7 @@ public class Bill extends GenericEntity { ...@@ -473,7 +483,7 @@ public class Bill extends GenericEntity {
if(l == null || l.getQuantity() == null) if(l == null || l.getQuantity() == null)
continue; continue;
total.add(l.getQuantity()); total = total.add(l.getQuantity());
} }
return total; return total;
......
...@@ -225,12 +225,11 @@ public class FoodWave extends GenericEntity { ...@@ -225,12 +225,11 @@ public class FoodWave extends GenericEntity {
public Integer getUnpaidCount() { public Integer getUnpaidCount() {
Integer ret = 0; Integer ret = 0;
for (BillLine line : getBillLines()) { for (BillLine line : getBillLines()) {
if (!line.getBill().isPaid()) { if (!line.getBill().isPaid() && !line.getBill().isExpired()) {
ret += line.getQuantity().intValue(); ret += line.getQuantity().intValue();
} }
} }
return ret; return ret;
} }
public Integer getOrderedCount() { public Integer getOrderedCount() {
......
...@@ -62,6 +62,10 @@ ...@@ -62,6 +62,10 @@
</ui:fragment> </ui:fragment>
<p:outputPanel rendered="#{billEditView.bill.foodwaveBill}">
<span class="notify"><h:outputText value="#{i18n['foodshop.canBuyToCounter']}" /></span>
</p:outputPanel>
<br />
<p:outputPanel rendered="#{!billEditView.bill.paid and !billEditView.bill.expired}"> <p:outputPanel rendered="#{!billEditView.bill.paid and !billEditView.bill.expired}">
<h:form> <h:form>
<p:commandButton id="cancelbtn" actionListener="#{billEditView.expireBill()}" onerror="location.reload(true);" value="#{i18n['bill.cancel']}" update=":billPanel"> <p:commandButton id="cancelbtn" actionListener="#{billEditView.expireBill()}" onerror="location.reload(true);" value="#{i18n['bill.cancel']}" update=":billPanel">
......
...@@ -37,7 +37,8 @@ ...@@ -37,7 +37,8 @@
<f:facet name="header"> <f:facet name="header">
<h:outputLabel value="#{i18n['acc_line.product']}" /> <h:outputLabel value="#{i18n['acc_line.product']}" />
</f:facet> </f:facet>
<h:outputText value="#{acc_line.product.name}" /> <h:outputText id="foodname" value="#{acc_line.product.name}" />
<p:tooltip rendered="#{acc_line.product.description != null}" for="foodname" value="#{acc_line.product.description}" showEffect="fade" hideEffect="fade" />
</p:column> </p:column>
<p:column sortBy="#{acc_line.user.wholeName}"> <p:column sortBy="#{acc_line.user.wholeName}">
<f:facet name="header"> <f:facet name="header">
...@@ -67,7 +68,7 @@ ...@@ -67,7 +68,7 @@
<br></br> <br></br>
<h:form id="billList"> <h:form id="billList">
<p:dataTable styleClass="bordertable" value="#{foodWaveView.bills}" var="bill" sortBy="#{bill.user.nick}"> <p:dataTable styleClass="bordertable" value="#{foodWaveView.bills}" var="bill" sortBy="#{bill.user.nick}" rowStyleClass="#{bill.expired ? 'expired' : null}">
<f:facet name="header"> <f:facet name="header">
<h:outputLabel value="#{i18n['foodWave.billLines']}" /> <h:outputLabel value="#{i18n['foodWave.billLines']}" />
</f:facet> </f:facet>
...@@ -97,9 +98,7 @@ ...@@ -97,9 +98,7 @@
<f:facet name="header"> <f:facet name="header">
<h:outputLabel value="#{i18n['billLine.eventuser']}" /> <h:outputLabel value="#{i18n['billLine.eventuser']}" />
</f:facet> </f:facet>
<h:link outcome="/useradmin/edit" value="#{bill.user.wholeName}"> <h:outputText outcome="/useradmin/edit" value="#{bill.user.wholeName}" />
<f:param name="userid" value="#{bill.user.user.id}" />
</h:link>
</p:column> </p:column>
<p:column sortBy="#{bill.user.user.id}"> <p:column sortBy="#{bill.user.user.id}">
<f:facet name="header"> <f:facet name="header">
...@@ -119,12 +118,18 @@ ...@@ -119,12 +118,18 @@
</p:column> </p:column>
<p:column> <p:column>
<p:commandButton value="#{i18n['bill.markPaid']}" actionListener="#{foodWaveView.markBillPaid}" update=":billList :accountEventList" /> <p:commandButton rendered="#{not bill.expired and not foodWaveView.selectedFoodWave.paymentOver}" value="#{i18n['bill.markPaid']}" actionListener="#{foodWaveView.markBillPaid}" update=":billList :accountEventList" />
<p:commandButton rendered="#{bill.expired or foodWaveView.selectedFoodWave.paymentOver}" value="#{i18n['bill.markPaid']}" actionListener="#{foodWaveView.markBillPaid}" update=":billList :accountEventList">
<p:confirm header="Confirmation" message="#{i18n['confirmation.message']}" icon="ui-icon-alert" />
</p:commandButton>
</p:column> </p:column>
<!--
<p:column> <p:column>
<h:commandButton value="#{i18n['bill.remove']}" action="foodWaveView.markBillRemoved" /> <p:commandButton rendered="#{not bill.expired}" id="removeBill" value="#{i18n['foodwave.cancelOrder']}" actionListener="#{foodWaveView.markBillExpired}" update=":billList :accountEventList">
</p:column> --> <p:confirm header="Confirmation" message="#{i18n['confirmation.message']}" icon="ui-icon-alert" />
</p:commandButton>
</p:column>
</p:dataTable> </p:dataTable>
</h:form> </h:form>
...@@ -161,7 +166,9 @@ ...@@ -161,7 +166,9 @@
<f:facet name="header"> <f:facet name="header">
<h:outputLabel value="#{i18n['product.name']}" /> <h:outputLabel value="#{i18n['product.name']}" />
</f:facet> </f:facet>
<h:outputText value="#{summ.product.name}" /> <h:outputText id="productName" value="#{summ.product.name}" />
<p:tooltip rendered="#{summ.product.description != null}" for="productName" value="#{summ.product.description}" showEffect="fade" hideEffect="fade" />
</p:column> </p:column>
<p:column> <p:column>
<f:facet name="header"> <f:facet name="header">
......
...@@ -23,8 +23,7 @@ ...@@ -23,8 +23,7 @@
<ui:define name="content"> <ui:define name="content">
<!-- products:shop commitaction="#{foodWaveFoodView.commitShoppingCart()}" items="#{foodWaveFoodView.shoppingcart}" commitValue="#{i18n['productshop.commit']}" /--> <!-- products:shop commitaction="#{foodWaveFoodView.commitShoppingCart()}" items="#{foodWaveFoodView.shoppingcart}" commitValue="#{i18n['productshop.commit']}" /-->
<foodwave:listFoods selectaction="#{foodWaveFoodView.buyFromCounter()}" <foodwave:listFoods selectaction="#{foodWaveFoodView.buyFromInternet()}" items="#{foodWaveFoodView.shoppingcart}" commitValue="foodshop.buyAndPay"/>
items="#{foodWaveFoodView.shoppingcart}" commitValue="foodshop.buyFromCounter"/>
</ui:define> </ui:define>
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<h:outputText value="${i18n['bill.sentDate']}" /> <h:outputText value="${i18n['bill.sentDate']}" />
</f:facet> </f:facet>
<h:outputText value="#{bill.sentDateTime}"> <h:outputText value="#{bill.sentDateTime}">
<f:convertDateTime pattern="#{sessionHandler.dateFormat}" timeZone="#{sessionHandler.timezone}" /> <f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:outputText> </h:outputText>
</p:column> </p:column>
<p:column> <p:column>
......
...@@ -54,6 +54,17 @@ ...@@ -54,6 +54,17 @@
</p:column> </p:column>
<p:column> <p:column>
<f:facet name="header"> <f:facet name="header">
<h:outputText value="${i18n['product.description']}" />
</f:facet>
<h:outputText id="description" value="#{cart.product.description}" />
<p:tooltip rendered="#{cart.product.name != null}" for="description" value="#{cart.product.name}" showEffect="fade" hideEffect="fade" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="${i18n['product.price']}" /> <h:outputText value="${i18n['product.price']}" />
</f:facet> </f:facet>
<h:outputText id="price" value="#{cart.product.price.abs()}"> <h:outputText id="price" value="#{cart.product.price.abs()}">
...@@ -87,14 +98,16 @@ ...@@ -87,14 +98,16 @@
</p:column> </p:column>
</p:dataTable> </p:dataTable>
<div> <div>
<h:outputLabel for="total" value="#{i18n['foodshop.total']}: "/>
<h:outputText id="total" value="#{foodWaveFoodView.totalPrice}" > <h:outputLabel for="total" value="#{i18n['foodshop.total']}: "/>
<f:convertNumber minFractionDigits="0" maxFractionDigits="2" /> <h:outputText id="total" value="#{foodWaveFoodView.totalPrice}" style="font-weight: bold;" >
</h:outputText> <f:convertNumber minFractionDigits="0" maxFractionDigits="2" />
</h:outputText>
</div> </div>
<h:commandButton action="#{cc.attrs.selectaction}" value="#{i18n[cc.attrs.commitValue]}" /> <br />
<h:commandButton action="#{foodWaveFoodView.buyFromInternet}" value="#{i18n['foodshop.buyFromInternet']}" /> <p:commandButton action="#{cc.attrs.selectaction}" value="#{i18n[cc.attrs.commitValue]}" ajax="false" />
<!-- <h:commandButton action="#{foodWaveFoodView.buyFromInternet}" value="#{i18n['foodshop.buyFromInternet']}" /> -->
</h:form> </h:form>
......
...@@ -186,6 +186,10 @@ a.shopItem:active { ...@@ -186,6 +186,10 @@ a.shopItem:active {
color: red; color: red;
} }
.notify {
color: red;
}
.success { .success {
color: #006600; color: #006600;
} }
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<configuration> <configuration>
<warSourceDirectory>WebContent</warSourceDirectory> <warSourceDirectory>WebContent</warSourceDirectory>
<failOnMissingWebXml>false</failOnMissingWebXml> <failOnMissingWebXml>false</failOnMissingWebXml>
<packagingIncludes>WEB-INF/lib/javamelody-core*,WEB-INF/lib/primefaces*,**/*.xml,**/*.xhtml,**/*.properties,**/*.class,**/*.png,**/*.css,**/*.js,resources/*</packagingIncludes> <packagingIncludes>WEB-INF/lib/javamelody-core*,WEB-INF/lib/primefaces*,WEB-INF/lib/*-1.0.8.jar,**/*.xml,**/*.xhtml,**/*.properties,**/*.class,**/*.png,**/*.css,**/*.js,resources/*</packagingIncludes>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
......
...@@ -119,6 +119,8 @@ cardTemplate.emptyCardTemplate = ---- ...@@ -119,6 +119,8 @@ cardTemplate.emptyCardTemplate = ----
code.inputfield = Sy\u00F6t\u00E4 viivakoodi code.inputfield = Sy\u00F6t\u00E4 viivakoodi
confirmation.message = Oletko varma?
create = Luo create = Luo
delete = Poista delete = Poista
...@@ -163,8 +165,11 @@ foodWave.closeNow = Close now ...@@ -163,8 +165,11 @@ foodWave.closeNow = Close now
foodWave.deliveredCount = Luovutetut foodWave.deliveredCount = Luovutetut
foodWave.openNow = Open now foodWave.openNow = Open now
foodshop.canBuyToCounter = Huomaathan ett\u00E4 voit maksaa tilauksen my\u00F6s infotiskille.
foodwave.cancelOrder = Peruuta
foodwave.foodwaveLastBillPayTime = Maksut viimeist\u00E4\u00E4n foodwave.foodwaveLastBillPayTime = Maksut viimeist\u00E4\u00E4n
foodwave.ordersBefore = Tilaukset ennen foodwave.ordersBefore = Tilaukset ennen
foodwave.template.waitPaymentsMinutes = Verkkomaksujen odotusaika foodwave.template.waitPaymentsMinutes = Verkkomaksujen odotusaika
game.active = Aktiivinen game.active = Aktiivinen
...@@ -319,9 +324,10 @@ poll.edit = edit ...@@ -319,9 +324,10 @@ poll.edit = edit
print = Print print = Print
product.description = Kuvaus
product.providedRole = Product defines role product.providedRole = Product defines role
product.returnProductEdit = Return to product: product.returnProductEdit = Return to product:
product.saved = Product saved product.saved = Product saved
productshop.minusOne = -1 productshop.minusOne = -1
productshop.minusTen = -10 productshop.minusTen = -10
......
...@@ -305,6 +305,8 @@ compofile.shaChecksum = SHA checksum ...@@ -305,6 +305,8 @@ compofile.shaChecksum = SHA checksum
compofile.upload = Upload file compofile.upload = Upload file
compofile.uploadTime = Upload time compofile.uploadTime = Upload time
confirmation.message = Are you sure?
content.showContentEditLinks = Show content edit links content.showContentEditLinks = Show content edit links
create = Create create = Create
...@@ -429,9 +431,11 @@ foodadmin.editTemplate = Edit ...@@ -429,9 +431,11 @@ foodadmin.editTemplate = Edit
foodshop.buyAndPay = Buy and Pay foodshop.buyAndPay = Buy and Pay
foodshop.buyFromCounter = Pay at info foodshop.buyFromCounter = Pay at info
foodshop.buyFromInternet = Pay at Internet foodshop.buyFromInternet = Pay at Internet
foodshop.canBuyToCounter = You can also pay food order to infodesk.
foodshop.total = Total foodshop.total = Total
foodwave.buyInPrice = Buy In Price foodwave.buyInPrice = Buy In Price
foodwave.cancelOrder = Cancel
foodwave.foodwaveBuyInPrice = Total buy in price foodwave.foodwaveBuyInPrice = Total buy in price
foodwave.foodwaveLastBillPayTime = Last payments time foodwave.foodwaveLastBillPayTime = Last payments time
foodwave.markPaid = Foodwave marked paid foodwave.markPaid = Foodwave marked paid
...@@ -941,6 +945,7 @@ product.color = Color in UI ...@@ -941,6 +945,7 @@ product.color = Color in UI
product.create = Create product product.create = Create product
product.createDiscount = Add volumediscount product.createDiscount = Add volumediscount
product.createLimit = Create product limitation product.createLimit = Create product limitation
product.description = Description
product.edit = edit product.edit = edit
product.inventoryQuantity = Inventory count product.inventoryQuantity = Inventory count
product.name = Name of product product.name = Name of product
......
...@@ -306,6 +306,8 @@ compofile.shaChecksum = SHA tarkistesumma ...@@ -306,6 +306,8 @@ compofile.shaChecksum = SHA tarkistesumma
compofile.upload = L\u00E4het\u00E4 tiedosto compofile.upload = L\u00E4het\u00E4 tiedosto
compofile.uploadTime = Tallennusaika compofile.uploadTime = Tallennusaika
confirmation.message = Oletko varma?
content.showContentEditLinks = N\u00E4yt\u00E4 sis\u00E4ll\u00F6nmuokkauslinkit content.showContentEditLinks = N\u00E4yt\u00E4 sis\u00E4ll\u00F6nmuokkauslinkit
create = Luo create = Luo
...@@ -430,9 +432,11 @@ foodadmin.editTemplate = Muokkaa ...@@ -430,9 +432,11 @@ foodadmin.editTemplate = Muokkaa
foodshop.buyAndPay = Varaa ja maksa foodshop.buyAndPay = Varaa ja maksa
foodshop.buyFromCounter = Maksa infossa foodshop.buyFromCounter = Maksa infossa
foodshop.buyFromInternet = Maksa Internetiss\u00E4 foodshop.buyFromInternet = Maksa Internetiss\u00E4
foodshop.canBuyToCounter = Voit maksaa ruokatilaukset my\u00F6s infotiskille.
foodshop.total = Yhteens\u00E4 foodshop.total = Yhteens\u00E4
foodwave.buyInPrice = Sis\u00E4\u00E4nostohinta foodwave.buyInPrice = Sis\u00E4\u00E4nostohinta
foodwave.cancelOrder = Peruuta
foodwave.foodwaveBuyInPrice = Sis\u00E4\u00E4nostohinta foodwave.foodwaveBuyInPrice = Sis\u00E4\u00E4nostohinta
foodwave.foodwaveLastBillPayTime = Maksut viimeist\u00E4\u00E4n foodwave.foodwaveLastBillPayTime = Maksut viimeist\u00E4\u00E4n
foodwave.markPaid = Merkitty maksetuksi foodwave.markPaid = Merkitty maksetuksi
...@@ -924,6 +928,7 @@ product.color = V\u00E4ri k\u00E4ytt\u00F6liittym\u00E4ss\u00E4 ...@@ -924,6 +928,7 @@ product.color = V\u00E4ri k\u00E4ytt\u00F6liittym\u00E4ss\u00E4
product.create = Luo tuote product.create = Luo tuote
product.createDiscount = Lis\u00E4\u00E4 m\u00E4\u00E4r\u00E4alennus product.createDiscount = Lis\u00E4\u00E4 m\u00E4\u00E4r\u00E4alennus
product.createLimit = Luo tuoterajoite product.createLimit = Luo tuoterajoite
product.description = Kuvaus
product.edit = Muokkaa product.edit = Muokkaa
product.inventoryQuantity = Varastotilanne product.inventoryQuantity = Varastotilanne
product.name = Tuotteen nimi product.name = Tuotteen nimi
......
...@@ -109,12 +109,11 @@ public class FoodWaveView extends GenericCDIView { ...@@ -109,12 +109,11 @@ public class FoodWaveView extends GenericCDIView {
if (super.requirePermissions(ShopPermission.MANAGE_FOODWAVES)) if (super.requirePermissions(ShopPermission.MANAGE_FOODWAVES))
{ {
if (foodWaves == null) { if (foodWaves == null) {
super.beginConversation(); super.beginConversation();
foodWaves = new ListDataModel<FoodWave>(foodWaveBean.getEventFoodWaves());
} }
} }
foodWaves = new ListDataModel<FoodWave>(foodWaveBean.getEventFoodWaves());
} }
public String createFoodwave() { public String createFoodwave() {
...@@ -251,6 +250,20 @@ public class FoodWaveView extends GenericCDIView { ...@@ -251,6 +250,20 @@ public class FoodWaveView extends GenericCDIView {
// ListDataModel<FoodWave>(foodWaveBean.getEventFoodWaves()); // ListDataModel<FoodWave>(foodWaveBean.getEventFoodWaves());
// } // }
public String markBillExpired() {
if (permbean.hasPermission(BillPermission.WRITE_ALL) && bills != null && bills.isRowAvailable()) {
Bill b = bills.getRowData();
b = billbean.expireBill(b);
foodWaveId = selectedFoodWave.getId();
selectedFoodWave = null;
bills = null;
initFoodWaveOrderList();
}
return null;
}
public String markBillPaid() { public String markBillPaid() {
if (permbean.hasPermission(BillPermission.WRITE_ALL) && bills != null && bills.isRowAvailable()) { if (permbean.hasPermission(BillPermission.WRITE_ALL) && bills != null && bills.isRowAvailable()) {
Bill b = bills.getRowData(); Bill b = bills.getRowData();
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!