Commit 87d8f64c by Tuukka Kivilahti, TKffTK

Merge branch 'master' of codecrew.fi:bortal

2 parents af57bbd5 6ccbd31f
...@@ -205,6 +205,12 @@ public class BillBean implements BillBeanLocal { ...@@ -205,6 +205,12 @@ public class BillBean implements BillBeanLocal {
if (bill.getAccountEvent() != null || bill.getPaidDate() != null) { if (bill.getAccountEvent() != null || bill.getPaidDate() != null) {
throw new EJBException("Bill already marked paid!"); throw new EJBException("Bill already marked paid!");
} }
if (bill.isFoowavePaymentOver())
{
throw new EJBException("Trying to mark paid a closed or left foodwave");
}
bill = billFacade.reload(bill); bill = billFacade.reload(bill);
Product creditproduct = productBean.findCreditProduct(); Product creditproduct = productBean.findCreditProduct();
...@@ -222,7 +228,7 @@ public class BillBean implements BillBeanLocal { ...@@ -222,7 +228,7 @@ public class BillBean implements BillBeanLocal {
bill.setPaidDate(when.getTime()); bill.setPaidDate(when.getTime());
// bill = billFacade.merge(bill); // bill = billFacade.merge(bill);
boolean checked = false;
for (BillLine bl : bill.getBillLines()) { for (BillLine bl : bill.getBillLines()) {
Product prod = bl.getLineProduct(); Product prod = bl.getLineProduct();
......
...@@ -107,6 +107,11 @@ public class CheckoutFiBean implements CheckoutFiBeanLocal { ...@@ -107,6 +107,11 @@ public class CheckoutFiBean implements CheckoutFiBeanLocal {
@RolesAllowed(BillPermission.S_CREATE_VERKKOMAKSU) @RolesAllowed(BillPermission.S_CREATE_VERKKOMAKSU)
public List<CheckoutBank> getToken(Bill bill) public List<CheckoutBank> getToken(Bill bill)
{ {
if (bill.isFoowavePaymentOver())
{
return null;
}
final LanEventPrivateProperty expire = eventbean.getPrivateProperty(LanEventPrivatePropertyKey.CHECKOUT_FI_KEY_EXPIRE); final LanEventPrivateProperty expire = eventbean.getPrivateProperty(LanEventPrivatePropertyKey.CHECKOUT_FI_KEY_EXPIRE);
final String merchantid = eventbean.getPrivatePropertyString(LanEventPrivatePropertyKey.CHECKOUT_FI_MERCHANT_ID); final String merchantid = eventbean.getPrivatePropertyString(LanEventPrivatePropertyKey.CHECKOUT_FI_MERCHANT_ID);
final String merchantPassword = eventbean.getPrivatePropertyString(LanEventPrivatePropertyKey.CHECKOUT_FI_MERCHANT_PASSWORD); final String merchantPassword = eventbean.getPrivatePropertyString(LanEventPrivatePropertyKey.CHECKOUT_FI_MERCHANT_PASSWORD);
......
...@@ -116,7 +116,7 @@ public class MenuBean implements MenuBeanLocal { ...@@ -116,7 +116,7 @@ public class MenuBean implements MenuBeanLocal {
MenuNavigation foodwaveTopmenu = usernavi.addPage(null, null); MenuNavigation foodwaveTopmenu = usernavi.addPage(null, null);
foodwaveTopmenu.setKey("topnavi.foodwave"); foodwaveTopmenu.setKey("topnavi.foodwave");
foodwaveTopmenu.addPage(menuitemfacade.findOrCreate("/foodwave/list"), ShopPermission.SHOP_FOODWAVE); foodwaveTopmenu.addPage(menuitemfacade.findOrCreate("/foodwave/listTemplates"), ShopPermission.SHOP_FOODWAVE);
MenuNavigation pollTopmenu = usernavi.addPage(null, null); MenuNavigation pollTopmenu = usernavi.addPage(null, null);
pollTopmenu.setKey("topnavi.poll"); pollTopmenu.setKey("topnavi.poll");
......
...@@ -132,7 +132,7 @@ public class Bill extends GenericEntity { ...@@ -132,7 +132,7 @@ public class Bill extends GenericEntity {
@ManyToOne(optional = false) @ManyToOne(optional = false)
@JoinColumn(updatable = false, name = "eventuser_id") @JoinColumn(updatable = false, name = "eventuser_id")
private EventUser user; private EventUser user;
@SuppressWarnings("unused") @SuppressWarnings("unused")
private static final Logger logger = LoggerFactory.getLogger(Bill.class); private static final Logger logger = LoggerFactory.getLogger(Bill.class);
...@@ -342,7 +342,7 @@ public class Bill extends GenericEntity { ...@@ -342,7 +342,7 @@ public class Bill extends GenericEntity {
public void addProduct(Product product, BigDecimal count) { public void addProduct(Product product, BigDecimal count) {
this.addProduct(product, count, null); this.addProduct(product, count, null);
} }
public void addProduct(Product product, BigDecimal count, FoodWave foodwave) { public void addProduct(Product product, BigDecimal count, FoodWave foodwave) {
// If bill number > 0 bill has been sent and extra privileges are needed // If bill number > 0 bill has been sent and extra privileges are needed
// to modify. // to modify.
...@@ -415,4 +415,16 @@ public class Bill extends GenericEntity { ...@@ -415,4 +415,16 @@ public class Bill extends GenericEntity {
this.sentDate = sentDate; this.sentDate = sentDate;
} }
public boolean isFoowavePaymentOver() {
boolean ret = false;
for (BillLine bl : billLines)
{
if (bl.getFoodwave() != null && (bl.getFoodwave().getClosed() || bl.getFoodwave().getTime().after(Calendar.getInstance())))
{
ret = true;
break;
}
}
return ret;
}
} }
...@@ -23,8 +23,7 @@ ...@@ -23,8 +23,7 @@
<ui:define name="content"> <ui:define name="content">
Kiitoksia tilauksesta, muista käydä maksamassa tilaukset tiskillä. Kiitoksia tilauksesta, muista käydä maksamassa tilaukset tiskillä.
Maksamattomia tilauksia ei pistetä etiäpäin. Maksamattomia tilauksia ei pistetä eteenpäin.
</ui:define> </ui:define>
......
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
<f:convertNumber maxFractionDigits="2" minFractionDigits="2" /> <f:convertNumber maxFractionDigits="2" minFractionDigits="2" />
</h:outputText> </h:outputText>
</p:column> </p:column>
<p:column> <p:column style="text-align: center;">
<f:facet name="header"> <f:facet name="header">
<h:outputText id="count" value="${i18n['product.cart.count']}" /> <h:outputText id="count" value="${i18n['product.cart.count']}" />
</f:facet> </f:facet>
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
</f:facet> </f:facet>
<h:outputText id="description" value="#{template.description}" /> <h:outputText id="description" value="#{template.description}" />
</p:column> </p:column>
<p:column size="20px"> <p:column style="width:20px;text-align:center;">
<f:facet name="header"> <f:facet name="header">
<h:outputText value="${i18n['foodWave.template.waves']}" /> <h:outputText value="${i18n['foodWave.template.waves']}" />
</f:facet> </f:facet>
......
...@@ -136,4 +136,4 @@ resetMail.username = Username ...@@ -136,4 +136,4 @@ resetMail.username = Username
resetmailSent.body = Email has been sent containing a link where you can change the password. resetmailSent.body = Email has been sent containing a link where you can change the password.
resetmailSent.header = Email sent resetmailSent.header = Email sent
user.unauthenticated = Kirjautumaton user.unauthenticated = Kirjautumaton
...@@ -189,6 +189,7 @@ foodWave.orders = Amount of Orders ...@@ -189,6 +189,7 @@ foodWave.orders = Amount of Orders
foodWave.paid = Paid foodWave.paid = Paid
foodWave.show = Show foodWave.show = Show
foodWave.template.name = Template foodWave.template.name = Template
foodWave.template.waves = Foodwaves
foodWave.templatename = Choose Products foodWave.templatename = Choose Products
foodWave.time = Time foodWave.time = Time
foodWave.totalReserved = Total foodWave.totalReserved = Total
...@@ -692,6 +693,7 @@ user.edit.title = My information ...@@ -692,6 +693,7 @@ user.edit.title = My information
user.email = Email user.email = Email
user.firstNames = Firstname user.firstNames = Firstname
user.food.title = Choose Menu user.food.title = Choose Menu
user.foodwave.products.title = Choose Products
user.foodwavelist.title = Choose Foodwave user.foodwavelist.title = Choose Foodwave
user.hasImage = Image user.hasImage = Image
user.image = Image user.image = Image
......
...@@ -187,6 +187,7 @@ foodWave.orders = Tilausten M\u00E4\u00E4r\u00E4 ...@@ -187,6 +187,7 @@ foodWave.orders = Tilausten M\u00E4\u00E4r\u00E4
foodWave.paid = Maksettuja foodWave.paid = Maksettuja
foodWave.show = N\u00E4yt\u00E4 foodWave.show = N\u00E4yt\u00E4
foodWave.template.name = Template foodWave.template.name = Template
foodWave.template.waves = Foodwaves
foodWave.templatename = Valitse tuotteet foodWave.templatename = Valitse tuotteet
foodWave.time = Aika foodWave.time = Aika
foodWave.totalReserved = Yhteens\u00E4 foodWave.totalReserved = Yhteens\u00E4
...@@ -675,6 +676,7 @@ user.edit.title = Omat tiedot ...@@ -675,6 +676,7 @@ user.edit.title = Omat tiedot
user.email = S\u00E4hk\u00F6posti user.email = S\u00E4hk\u00F6posti
user.firstNames = Etunimi user.firstNames = Etunimi
user.food.title = Valitse Menu user.food.title = Valitse Menu
user.foodwave.products.title = Valitse tuotteet
user.foodwavelist.title = Valitse Ruokatilaus user.foodwavelist.title = Valitse Ruokatilaus
user.hasImage = Kuva user.hasImage = Kuva
user.imageUploaded = Kuva l\u00E4hetetty. user.imageUploaded = Kuva l\u00E4hetetty.
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!