Commit abad39a1 by Tuukka Kivilahti

ruokatilauksen maksuasiaa

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