Просмотр исходного кода

place order 中payment type 为credit card时,expiration时间若查询没有结果那么默认为当前年的01月

Pen Li 9 лет назад
Родитель
Сommit
035e90d508

BIN
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/macmini1.xcuserdatad/UserInterfaceState.xcuserstate


+ 10 - 1
RedAnt ERP Mobile/common/Functions/offline/OLDataProvider.m

@@ -7576,6 +7576,15 @@
         state = [self textAtColumn:12 statement:stmt];
     }];
     
+    if ([year isEqualToString:@""]) {
+        NSDate *date = [NSDate date];
+        NSCalendar *calendar = [NSCalendar currentCalendar];
+        int year_integer = [calendar component:NSCalendarUnitYear fromDate:date];
+        year = [NSString stringWithFormat:@"%d",year_integer];
+    }
+    if ([month isEqualToString:@""]) {
+        month = @"01";
+    }
     
     // "section_2"
     NSDictionary *dic = @{
@@ -7685,7 +7694,7 @@
                                             @"name" : @"credit_card_expiration",
                                             @"required" : @"true",
                                             @"type" : @"date",
-                                            @"value" : @"08/16"/*[NSString stringWithFormat:@"%@/%@",month,year]*/
+                                            @"value" : [NSString stringWithFormat:@"%@/%@",month,year]
                                         },
                                         @"item_3" : @{
                                             @"aname" : @"Security Code",