coupon fix

This commit is contained in:
cimenmus
2018-09-03 00:22:11 +03:00
parent e46d6e701f
commit fc91f33388
3 changed files with 5 additions and 5 deletions

2
.idea/misc.xml generated
View File

@@ -25,7 +25,7 @@
</value>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">

View File

@@ -247,8 +247,8 @@ public class PaymentMethodFragment extends CreateOrderBaseFragment {
couponModel = response.body().getData();
couponModel.setStoreName(SessionHelper.getSelectedStore().getStoreName());
couponModel.checkNull();
SessionHelper.saveSelectedCoupon(couponModel);
if(couponModel.isActive()){
SessionHelper.saveSelectedCoupon(couponModel);
DialogHelper.showDialogWithPositiveButton(
couponUsedDialogTitle,
BaseActivity.currentActivity,

View File

@@ -148,15 +148,15 @@ public class CheckCouponModel {
calendarEnd = Calendar.getInstance();
calendarEnd.setTime(dateEnd);
if(calendarNow.get(Calendar.YEAR) > calendarEnd.get(Calendar.YEAR)){
if(calendarEnd.get(Calendar.YEAR) > calendarNow.get(Calendar.YEAR)){
return true;
}
if(calendarNow.get(Calendar.MONTH) + 1 > calendarEnd.get(Calendar.MONTH) + 1){
if(calendarEnd.get(Calendar.MONTH) > calendarNow.get(Calendar.MONTH)){
return true;
}
if(calendarNow.get(Calendar.DAY_OF_MONTH) >= calendarEnd.get(Calendar.DAY_OF_MONTH)){
if(calendarEnd.get(Calendar.DAY_OF_MONTH) >= calendarNow.get(Calendar.DAY_OF_MONTH)){
return true;
}