Commit 5a98ba61 by Tuukka Kivilahti

Bill expire by minutes is quite nice impruvement, when event ticket sells starts

1 parent 9e7069a1
Pipeline #170 passed
in 0 seconds
...@@ -647,6 +647,10 @@ public class BootstrapBean implements BootstrapBeanLocal { ...@@ -647,6 +647,10 @@ public class BootstrapBean implements BootstrapBeanLocal {
dbUpdates.add(new String[]{ dbUpdates.add(new String[]{
"UPDATE place_slots SET used = now() WHERE used is null AND product_id in (SELECT product_id FROM product_productflags WHERE productflags = 'CREATE_NEW_PLACE_WHEN_BOUGHT')" "UPDATE place_slots SET used = now() WHERE used is null AND product_id in (SELECT product_id FROM product_productflags WHERE productflags = 'CREATE_NEW_PLACE_WHEN_BOUGHT')"
}); });
dbUpdates.add(new String[] {
"UPDATE event_properties SET long_value = (long_value * 60), key = 'BILL_EXPIRE_MINS' WHERE key = 'BILL_EXPIRE_HOURS'"
});
} }
......
...@@ -254,8 +254,8 @@ public class Bill extends GenericEntity { ...@@ -254,8 +254,8 @@ public class Bill extends GenericEntity {
this.event = event; this.event = event;
} }
public Bill(LanEvent event, EventUser user, long expireTimeHours) { public Bill(LanEvent event, EventUser user, long expireTimeMins) {
this(event, user, new Date(System.currentTimeMillis() + (expireTimeHours * 60 * 60 * 1000))); this(event, user, new Date(System.currentTimeMillis() + (expireTimeMins * 60 * 1000)));
} }
public Bill(LanEvent event, long expireTimeHours) { public Bill(LanEvent event, long expireTimeHours) {
......
...@@ -36,7 +36,7 @@ public enum LanEventPropertyKey { ...@@ -36,7 +36,7 @@ public enum LanEventPropertyKey {
GATHER_OTHER_BILL_INFO(Type.BOOL), GATHER_OTHER_BILL_INFO(Type.BOOL),
GATHER_SHIRT_SIZE(Type.BOOL), GATHER_SHIRT_SIZE(Type.BOOL),
ALLOW_BILLING(Type.BOOL), ALLOW_BILLING(Type.BOOL),
BILL_EXPIRE_HOURS(Type.LONG, 1l), BILL_EXPIRE_MINS(Type.LONG, 30l),
TEMPLATE_PROPERTY1(Type.TEXT), TEMPLATE_PROPERTY1(Type.TEXT),
TEMPLATE_PROPERTY2(Type.TEXT), TEMPLATE_PROPERTY2(Type.TEXT),
TEMPLATE_PROPERTY3(Type.TEXT), TEMPLATE_PROPERTY3(Type.TEXT),
......
...@@ -150,7 +150,7 @@ public class FoodWaveFoodView extends GenericCDIView { ...@@ -150,7 +150,7 @@ public class FoodWaveFoodView extends GenericCDIView {
* @return * @return
*/ */
public Bill createBillFromShoppingcart() { public Bill createBillFromShoppingcart() {
Bill bill = new Bill(eventBean.getCurrentEvent(), userview.getSelectedUser(), eventBean.getPropertyLong(LanEventPropertyKey.BILL_EXPIRE_HOURS)); Bill bill = new Bill(eventBean.getCurrentEvent(), userview.getSelectedUser(), eventBean.getPropertyLong(LanEventPropertyKey.BILL_EXPIRE_MINS));
bill.setOurReference(eventBean.getCurrentEvent().getName()); bill.setOurReference(eventBean.getCurrentEvent().getName());
for (ProductShopItem shopitem : shoppingcart) { for (ProductShopItem shopitem : shoppingcart) {
......
...@@ -351,7 +351,7 @@ public class ProductShopView extends GenericCDIView { ...@@ -351,7 +351,7 @@ public class ProductShopView extends GenericCDIView {
return null; return null;
} }
Bill bill = new Bill(eventbean.getCurrentEvent(), userView.getSelectedUser(), eventbean.getPropertyLong(LanEventPropertyKey.BILL_EXPIRE_HOURS)); Bill bill = new Bill(eventbean.getCurrentEvent(), userView.getSelectedUser(), eventbean.getPropertyLong(LanEventPropertyKey.BILL_EXPIRE_MINS));
bill.setNotes(otherInfo); bill.setNotes(otherInfo);
bill.setOurReference(eventbean.getCurrentEvent().getName()); bill.setOurReference(eventbean.getCurrentEvent().getName());
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!