shopizer-developers

Merging from master

1/13/2017 8:02:26 PM

Details

diff --git a/shopizer-canadapost/target/classes/META-INF/maven/com.shopizer/shopizer-shipping-canadapost-module/pom.properties b/shopizer-canadapost/target/classes/META-INF/maven/com.shopizer/shopizer-shipping-canadapost-module/pom.properties
index a0e98b1..20899d0 100644
--- a/shopizer-canadapost/target/classes/META-INF/maven/com.shopizer/shopizer-shipping-canadapost-module/pom.properties
+++ b/shopizer-canadapost/target/classes/META-INF/maven/com.shopizer/shopizer-shipping-canadapost-module/pom.properties
@@ -1,5 +1,5 @@
 #Generated by Maven Integration for Eclipse
-#Thu Jan 12 13:16:17 EST 2017
+#Fri Jan 13 16:58:25 EST 2017
 version=2.0.5-SNAPSHOT
 groupId=com.shopizer
 m2e.projectName=shopizer-canadapost
diff --git a/shopizer-shipping-distance-module/target/classes/META-INF/maven/com.shopizer/shopizer-shipping-distance-processor/pom.properties b/shopizer-shipping-distance-module/target/classes/META-INF/maven/com.shopizer/shopizer-shipping-distance-processor/pom.properties
index c6134c5..81eec8b 100644
--- a/shopizer-shipping-distance-module/target/classes/META-INF/maven/com.shopizer/shopizer-shipping-distance-processor/pom.properties
+++ b/shopizer-shipping-distance-module/target/classes/META-INF/maven/com.shopizer/shopizer-shipping-distance-processor/pom.properties
@@ -1,5 +1,5 @@
 #Generated by Maven Integration for Eclipse
-#Thu Jan 12 13:16:18 EST 2017
+#Fri Jan 13 16:58:26 EST 2017
 version=2.0.5-SNAPSHOT
 groupId=com.shopizer
 m2e.projectName=shopizer-shipping-distance-processor
diff --git a/sm-core/src/main/java/com/salesmanager/core/business/modules/integration/shipping/impl/PriceByDistanceShippingQuoteRules.java b/sm-core/src/main/java/com/salesmanager/core/business/modules/integration/shipping/impl/PriceByDistanceShippingQuoteRules.java
index 9bff0db..fba3391 100644
--- a/sm-core/src/main/java/com/salesmanager/core/business/modules/integration/shipping/impl/PriceByDistanceShippingQuoteRules.java
+++ b/sm-core/src/main/java/com/salesmanager/core/business/modules/integration/shipping/impl/PriceByDistanceShippingQuoteRules.java
@@ -90,7 +90,7 @@ public class PriceByDistanceShippingQuoteRules implements ShippingQuoteModule {
 		}
 		
 		//maximum distance TODO configure from admin
-		if(distance > 350D) {
+		if(distance > 150D) {
 			return null;
 		}
 		
@@ -101,9 +101,19 @@ public class PriceByDistanceShippingQuoteRules implements ShippingQuoteModule {
 			quote.setShippingOptions(options);
 		}
 		
+		BigDecimal price = null;
+		BigDecimal total = null;
 		
-		BigDecimal price = new BigDecimal(1.5);//TODO from the admin
-		BigDecimal total = new BigDecimal(distance).multiply(price);
+		if(distance<=20) {
+			price = new BigDecimal(69);//TODO from the admin
+			total = new BigDecimal(distance).multiply(price);
+		} else {
+			price = new BigDecimal(3);//TODO from the admin
+			total = new BigDecimal(distance).multiply(price);
+		}
+		
+		
+
 
 		ShippingOption shippingOption = new ShippingOption();
 			
@@ -121,4 +131,4 @@ public class PriceByDistanceShippingQuoteRules implements ShippingQuoteModule {
 		
 	}
 
-}
+}
\ No newline at end of file
diff --git a/sm-search/target/classes/META-INF/maven/com.shopizer/sm-search/pom.properties b/sm-search/target/classes/META-INF/maven/com.shopizer/sm-search/pom.properties
index 1ba884b..016204a 100644
--- a/sm-search/target/classes/META-INF/maven/com.shopizer/sm-search/pom.properties
+++ b/sm-search/target/classes/META-INF/maven/com.shopizer/sm-search/pom.properties
@@ -1,5 +1,5 @@
 #Generated by Maven Integration for Eclipse
-#Thu Jan 12 13:16:22 EST 2017
+#Fri Jan 13 16:58:32 EST 2017
 version=2.0.5-SNAPSHOT
 groupId=com.shopizer
 m2e.projectName=sm-search
diff --git a/sm-shop/SALESMANAGER.h2.db b/sm-shop/SALESMANAGER.h2.db
index b098481..90d0a23 100644
Binary files a/sm-shop/SALESMANAGER.h2.db and b/sm-shop/SALESMANAGER.h2.db differ
diff --git a/sm-shop/SALESMANAGER.lock.db b/sm-shop/SALESMANAGER.lock.db
index 374bce7..b1ac53a 100644
--- a/sm-shop/SALESMANAGER.lock.db
+++ b/sm-shop/SALESMANAGER.lock.db
@@ -1,4 +1,4 @@
 #FileLock
-#Thu Jan 12 13:17:08 EST 2017
-id=15993e5c751808c7ebcc315eb71970264fe21a80519
+#Fri Jan 13 17:00:19 EST 2017
+id=15999d878b2f874d838fded54e89fad6433e03d7352
 method=file
diff --git a/sm-shop/src/main/java/com/salesmanager/shop/model/order/ReadableOrderTotal.java b/sm-shop/src/main/java/com/salesmanager/shop/model/order/ReadableOrderTotal.java
index acc2b67..eaa529a 100644
--- a/sm-shop/src/main/java/com/salesmanager/shop/model/order/ReadableOrderTotal.java
+++ b/sm-shop/src/main/java/com/salesmanager/shop/model/order/ReadableOrderTotal.java
@@ -9,11 +9,18 @@ public class ReadableOrderTotal extends OrderTotal implements Serializable {
 	 */
 	private static final long serialVersionUID = 1L;
 	private String total;
+	private boolean discounted;
 	public String getTotal() {
 		return total;
 	}
 	public void setTotal(String total) {
 		this.total = total;
 	}
+	public boolean isDiscounted() {
+		return discounted;
+	}
+	public void setDiscounted(boolean discounted) {
+		this.discounted = discounted;
+	}
 
 }
diff --git a/sm-shop/src/main/webapp/pages/shop/common/checkout/checkout.jsp b/sm-shop/src/main/webapp/pages/shop/common/checkout/checkout.jsp
index e08ea87..db69fc9 100644
--- a/sm-shop/src/main/webapp/pages/shop/common/checkout/checkout.jsp
+++ b/sm-shop/src/main/webapp/pages/shop/common/checkout/checkout.jsp
@@ -26,8 +26,8 @@ response.setDateHeader ("Expires", -1);
 <script type="text/html" id="subTotalsTemplate">
 		{{#subTotals}}
 			<tr class="subt"> 
-				<td colspan="2">{{title}}</td> 
-				<td><strong>{{total}}</strong></td> 
+				<td colspan="2">{{#discounted}}<s:message code="label.generic.rebate" text="Rebate" />&nbsp;-&nbsp;{{text}}{{/discounted}}{{^discounted}}{{title}}{{/discounted}}</td> 
+				<td><strong>{{#discounted}}<font color="red">-{{total}}</font>{{/discounted}}{{^discounted}}{{total}}{{/discounted}}</strong></td> 
 			</tr>
 		{{/subTotals}}
 </script>
@@ -1401,10 +1401,23 @@ $(document).ready(function() {
 													<!-- subtotals -->
 													<c:forEach items="${order.orderTotalSummary.totals}" var="total">
 													<c:if test="${total.orderTotalCode!='order.total.total'}">
+
+
 													<tr class="subt"> 
-														<td colspan="2"><s:message code="${total.orderTotalCode}" text="${total.orderTotalCode}"/></td> 
-														<td><strong><sm:monetary value="${total.value}" /></strong></td> 
+														<td colspan="2">
+														<c:choose>
+																<c:when test="${total.orderTotalCode=='order.total.discount'}">
+														<s:message code="label.generic.rebate" text="Rebate"/>&nbsp;-&nbsp;<s:message code="${total.text}" text="${total.text}"/>
+																</c:when>
+																<c:otherwise>
+																	<s:message code="${total.orderTotalCode}" text="${total.orderTotalCode}"/>
+																</c:otherwise>
+														</c:choose>
+														</td> 
+														<td><strong><c:choose><c:when test="${total.orderTotalCode=='order.total.discount'}"><font color="red">- <sm:monetary value="${total.value}" /></font></c:when><c:otherwise><sm:monetary value="${total.value}" /></c:otherwise></c:choose></strong></td> 
 													</tr> 
+
+ 
 													</c:if>
 													</c:forEach>
 												</tbody>