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