|
|
@@ -1217,7 +1217,64 @@ typedef enum {
|
|
|
tv.text = newvalue;
|
|
|
|
|
|
}
|
|
|
- }
|
|
|
+ NSMutableDictionary* json_cd=action[@"conditional_constraint"][checked?@"true":@"false"] ;
|
|
|
+ {
|
|
|
+ for(int i=0;i<[json_cd[@"count"] intValue];i++)
|
|
|
+ {
|
|
|
+
|
|
|
+ NSMutableDictionary * destination = json_cd [[NSString stringWithFormat:@"item_%d",i] ];
|
|
|
+ int page = [destination[@"page"] intValue];
|
|
|
+ NSString* control = destination[@"control"];
|
|
|
+ self.doc_controlTemplate[[NSString stringWithFormat:@"page_%d",page]][control][@"disable"]=destination[@"disable"];
|
|
|
+ id value =destination[@"set_val"];
|
|
|
+ self.doc_controlTemplate[[NSString stringWithFormat:@"page_%d",page]][control][@"value"]=value;
|
|
|
+ // UITextView* tv = (UITextView*) [self findControl:destination[@"control"]];
|
|
|
+ // NSString* value = control[@"value"];
|
|
|
+ //
|
|
|
+ // UITextView* tv6 = (UITextView*) [self findControl:@"control_10"];
|
|
|
+ // NSString* text = tv6.text;
|
|
|
+ // NSString* newvalue = nil;
|
|
|
+ // if([value isEqualToString:@"*0.1"])
|
|
|
+ // {
|
|
|
+ //
|
|
|
+ // NSNumberFormatter *formatter = [[NSNumberFormatter alloc]init];
|
|
|
+ // formatter.numberStyle =kCFNumberFormatterCurrencyStyle;
|
|
|
+ // NSString* prefix_str= self.page_controlTemplate [control[@"control"] ][@"prefix_str"];
|
|
|
+ // if(prefix_str.length==0)
|
|
|
+ // prefix_str = @"";
|
|
|
+ // text=[text stringByReplacingOccurrencesOfString:prefix_str withString:@"$"];
|
|
|
+ // double f = [[formatter numberFromString:text] doubleValue]*0.1;
|
|
|
+ // newvalue = [formatter stringFromNumber:[NSNumber numberWithDouble: f]];
|
|
|
+ //
|
|
|
+ // newvalue=[newvalue stringByReplacingOccurrencesOfString:@"$" withString:prefix_str];
|
|
|
+ // // float f= [[text stringByReplacingOccurrencesOfString:@"$" withString:@"" ] floatValue]*0.1;
|
|
|
+ // // newvalue = [NSString stringWithFormat:@"$ %.2f",f];
|
|
|
+ // self.page_controlTemplate [control[@"control"] ][@"value"] = newvalue;
|
|
|
+ // self.page_controlTemplate [control[@"control"] ][@"dirty"] = [NSNumber numberWithBool:true];
|
|
|
+ // }
|
|
|
+ // else if([value isEqualToString:@"*0.9"])
|
|
|
+ // {
|
|
|
+ // // float f= [[text stringByReplacingOccurrencesOfString:@"$" withString:@"" ] floatValue]*0.9;
|
|
|
+ // NSNumberFormatter *formatter = [[NSNumberFormatter alloc]init];
|
|
|
+ // formatter.numberStyle =kCFNumberFormatterCurrencyStyle;
|
|
|
+ // NSString* prefix_str= self.page_controlTemplate [control[@"control"] ][@"prefix_str"];
|
|
|
+ // if(prefix_str.length==0)
|
|
|
+ // prefix_str = @"";
|
|
|
+ // text=[text stringByReplacingOccurrencesOfString:prefix_str withString:@"$"];
|
|
|
+ // double f = [[formatter numberFromString:text] doubleValue]*0.9;
|
|
|
+ // newvalue = [formatter stringFromNumber:[NSNumber numberWithDouble: f]];
|
|
|
+ // newvalue=[newvalue stringByReplacingOccurrencesOfString:@"$" withString:prefix_str];
|
|
|
+ // // newvalue = [NSString stringWithFormat:@"$ %.2f",f];
|
|
|
+ // self.page_controlTemplate [control[@"control"] ][@"value"] = newvalue;
|
|
|
+ // self.page_controlTemplate [control[@"control"] ][@"dirty"] = [NSNumber numberWithBool:true];
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ //
|
|
|
+ // tv.text = newvalue;
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
else if([action[@"type"] isEqualToString:@"change contract"] )
|
|
|
{
|
|
|
NSString* pdf = action[@"contract"];
|
|
|
@@ -1228,63 +1285,7 @@ typedef enum {
|
|
|
}
|
|
|
|
|
|
|
|
|
- NSMutableDictionary* json_cd=action[@"conditional_constraint"][checked?@"true":@"false"] ;
|
|
|
- {
|
|
|
- for(int i=0;i<[json_cd[@"count"] intValue];i++)
|
|
|
- {
|
|
|
-
|
|
|
- NSMutableDictionary * destination = json_cd [[NSString stringWithFormat:@"item_%d",i] ];
|
|
|
- int page = [destination[@"page"] intValue];
|
|
|
- NSString* control = destination[@"control"];
|
|
|
- self.doc_controlTemplate[[NSString stringWithFormat:@"page_%d",page]][control][@"disable"]=destination[@"disable"];
|
|
|
- id value =destination[@"set_val"];
|
|
|
- self.doc_controlTemplate[[NSString stringWithFormat:@"page_%d",page]][control][@"value"]=value;
|
|
|
-// UITextView* tv = (UITextView*) [self findControl:destination[@"control"]];
|
|
|
-// NSString* value = control[@"value"];
|
|
|
-//
|
|
|
-// UITextView* tv6 = (UITextView*) [self findControl:@"control_10"];
|
|
|
-// NSString* text = tv6.text;
|
|
|
-// NSString* newvalue = nil;
|
|
|
-// if([value isEqualToString:@"*0.1"])
|
|
|
-// {
|
|
|
-//
|
|
|
-// NSNumberFormatter *formatter = [[NSNumberFormatter alloc]init];
|
|
|
-// formatter.numberStyle =kCFNumberFormatterCurrencyStyle;
|
|
|
-// NSString* prefix_str= self.page_controlTemplate [control[@"control"] ][@"prefix_str"];
|
|
|
-// if(prefix_str.length==0)
|
|
|
-// prefix_str = @"";
|
|
|
-// text=[text stringByReplacingOccurrencesOfString:prefix_str withString:@"$"];
|
|
|
-// double f = [[formatter numberFromString:text] doubleValue]*0.1;
|
|
|
-// newvalue = [formatter stringFromNumber:[NSNumber numberWithDouble: f]];
|
|
|
-//
|
|
|
-// newvalue=[newvalue stringByReplacingOccurrencesOfString:@"$" withString:prefix_str];
|
|
|
-// // float f= [[text stringByReplacingOccurrencesOfString:@"$" withString:@"" ] floatValue]*0.1;
|
|
|
-// // newvalue = [NSString stringWithFormat:@"$ %.2f",f];
|
|
|
-// self.page_controlTemplate [control[@"control"] ][@"value"] = newvalue;
|
|
|
-// self.page_controlTemplate [control[@"control"] ][@"dirty"] = [NSNumber numberWithBool:true];
|
|
|
-// }
|
|
|
-// else if([value isEqualToString:@"*0.9"])
|
|
|
-// {
|
|
|
-// // float f= [[text stringByReplacingOccurrencesOfString:@"$" withString:@"" ] floatValue]*0.9;
|
|
|
-// NSNumberFormatter *formatter = [[NSNumberFormatter alloc]init];
|
|
|
-// formatter.numberStyle =kCFNumberFormatterCurrencyStyle;
|
|
|
-// NSString* prefix_str= self.page_controlTemplate [control[@"control"] ][@"prefix_str"];
|
|
|
-// if(prefix_str.length==0)
|
|
|
-// prefix_str = @"";
|
|
|
-// text=[text stringByReplacingOccurrencesOfString:prefix_str withString:@"$"];
|
|
|
-// double f = [[formatter numberFromString:text] doubleValue]*0.9;
|
|
|
-// newvalue = [formatter stringFromNumber:[NSNumber numberWithDouble: f]];
|
|
|
-// newvalue=[newvalue stringByReplacingOccurrencesOfString:@"$" withString:prefix_str];
|
|
|
-// // newvalue = [NSString stringWithFormat:@"$ %.2f",f];
|
|
|
-// self.page_controlTemplate [control[@"control"] ][@"value"] = newvalue;
|
|
|
-// self.page_controlTemplate [control[@"control"] ][@"dirty"] = [NSNumber numberWithBool:true];
|
|
|
-// }
|
|
|
-//
|
|
|
-//
|
|
|
-// tv.text = newvalue;
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|