Prechádzať zdrojové kódy

hmlg scan order 1.23, testflight
fix price1 n/a display issue

Ray Zhang 3 rokov pred
rodič
commit
007e1ea90f

+ 4 - 4
RedAnt ERP Mobile/HMLG Scan Order.xcodeproj/project.pbxproj

@@ -2717,7 +2717,7 @@
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				CURRENT_PROJECT_VERSION = 51487;
+				CURRENT_PROJECT_VERSION = 51497;
 				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -2734,7 +2734,7 @@
 					"$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib",
 					"$(PROJECT_DIR)/GoogleAnalytics/GoogleAnalytics/Libraries",
 				);
-				MARKETING_VERSION = 1.21;
+				MARKETING_VERSION = 1.23;
 				OTHER_LDFLAGS = (
 					"$(inherited)",
 					"-ObjC",
@@ -2761,7 +2761,7 @@
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				CURRENT_PROJECT_VERSION = 51487;
+				CURRENT_PROJECT_VERSION = 51497;
 				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -2778,7 +2778,7 @@
 					"$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib",
 					"$(PROJECT_DIR)/GoogleAnalytics/GoogleAnalytics/Libraries",
 				);
-				MARKETING_VERSION = 1.21;
+				MARKETING_VERSION = 1.23;
 				OTHER_LDFLAGS = (
 					"$(inherited)",
 					"-ObjC",

+ 1 - 1
RedAnt ERP Mobile/HMLG Scan Order.xcodeproj/xcuserdata/ruizhang.xcuserdatad/xcschemes/xcschememanagement.plist

@@ -7,7 +7,7 @@
 		<key>HMLG Scan Order.xcscheme_^#shared#^_</key>
 		<dict>
 			<key>orderHint</key>
-			<integer>6</integer>
+			<integer>1</integer>
 		</dict>
 	</dict>
 </dict>

+ 8 - 2
RedAnt ERP Mobile/HMLG Scan Order/Base.lproj/Main.storyboard

@@ -1155,6 +1155,12 @@
                                     <action selector="OnPrintParamsClick:" destination="kPm-vh-Xir" eventType="touchUpInside" id="5NP-He-9AA"/>
                                 </connections>
                             </button>
+                            <textField opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="abcd" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="hMR-gf-tjy">
+                                <rect key="frame" x="232" y="585" width="97" height="34"/>
+                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                                <textInputTraits key="textInputTraits" autocapitalizationType="allCharacters"/>
+                            </textField>
                         </subviews>
                         <viewLayoutGuide key="safeArea" id="TDE-LW-r8Y"/>
                         <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -2029,10 +2035,10 @@ Email: redantsupport@united-us.net</string>
         <image name="btn_retrieve" width="102" height="30"/>
         <image name="btn_signin" width="100" height="30"/>
         <image name="camera" width="48" height="48"/>
-        <image name="cart_empty" width="72" height="72"/>
+        <image name="cart_empty" width="96" height="96"/>
         <image name="check_1_24" width="24" height="24"/>
         <image name="checkbox" width="16" height="16"/>
-        <image name="close" width="32" height="32"/>
+        <image name="close" width="40" height="40"/>
         <image name="menu_open" width="36" height="36"/>
         <image name="npd_logo" width="110" height="13"/>
         <image name="order" width="72" height="72"/>

+ 12 - 0
RedAnt ERP Mobile/HMLG Scan Order/SO.storyboard

@@ -823,6 +823,10 @@
                                             <outlet property="labelModel" destination="w8x-0O-3TJ" id="jAJ-U7-sEQ"/>
                                             <outlet property="labelOrigin" destination="826-Bv-Afw" id="Lcm-6u-kih"/>
                                             <outlet property="labelPort" destination="xLb-sH-DDc" id="2LA-p6-VJp"/>
+                                            <outlet property="labelPrice0" destination="kwx-rV-AXC" id="pHX-Dd-bxk"/>
+                                            <outlet property="labelPrice1" destination="w2F-g1-5dN" id="kn4-a2-wly"/>
+                                            <outlet property="labelPrice2" destination="2me-vx-6M3" id="eZ6-c4-fs1"/>
+                                            <outlet property="labelPrice3" destination="Pyr-9z-nFr" id="F8m-bX-DQj"/>
                                             <outlet property="labelPriceCTNR" destination="Snb-I4-W0D" id="fR4-hp-1GC"/>
                                             <outlet property="labelPriceNCA" destination="fkA-kv-8ja" id="xAX-Ba-wYC"/>
                                             <outlet property="labelPriceNet" destination="e4y-a4-rZx" id="Prz-Ev-JeU"/>
@@ -1255,6 +1259,10 @@
                                             <outlet property="labelModel" destination="Z2Y-LD-RFG" id="pej-PG-D8q"/>
                                             <outlet property="labelOrigin" destination="dcE-Le-QMW" id="tTy-if-nuP"/>
                                             <outlet property="labelPort" destination="Mbc-CV-To1" id="Tcm-RS-bae"/>
+                                            <outlet property="labelPrice0" destination="bVe-RI-TAM" id="pMi-Tx-KcI"/>
+                                            <outlet property="labelPrice1" destination="uHg-xx-aR0" id="yyD-Od-Dns"/>
+                                            <outlet property="labelPrice2" destination="9hH-Br-ZKJ" id="PkD-Cf-ujv"/>
+                                            <outlet property="labelPrice3" destination="1kO-eZ-rr3" id="14T-b5-Ymx"/>
                                             <outlet property="labelPriceCTNR" destination="N3z-jY-g8U" id="lCb-SO-DXC"/>
                                             <outlet property="labelPriceNCA" destination="IEa-T1-E8F" id="TZm-Xx-1VY"/>
                                             <outlet property="labelPriceNet" destination="NfL-2K-HAE" id="GNR-hm-VP6"/>
@@ -2511,6 +2519,10 @@ Stock</string>
                                             <outlet property="labelModel" destination="ToU-Mo-Rx3" id="DrI-ba-gvb"/>
                                             <outlet property="labelOrigin" destination="qLh-8g-4bz" id="EtH-bo-O7j"/>
                                             <outlet property="labelPort" destination="TEW-3R-q3j" id="ts5-u7-rGb"/>
+                                            <outlet property="labelPrice0" destination="6Or-u7-4VU" id="C3K-Ca-sM7"/>
+                                            <outlet property="labelPrice1" destination="MB0-nt-BnH" id="L2q-Et-XGK"/>
+                                            <outlet property="labelPrice2" destination="CZn-lW-zFb" id="QRy-G3-hY5"/>
+                                            <outlet property="labelPrice3" destination="qux-TP-f6L" id="TNX-DN-ZDt"/>
                                             <outlet property="labelPriceCTNR" destination="dPf-p7-b3A" id="gw6-pI-QFm"/>
                                             <outlet property="labelPriceNCA" destination="dvh-cr-GdM" id="jEe-lE-SjP"/>
                                             <outlet property="labelPriceNet" destination="Ua7-Qu-TE2" id="3aE-lD-fYf"/>

+ 7 - 0
RedAnt ERP Mobile/HMLG Scan Order/ScanListCell.h

@@ -23,6 +23,13 @@ NS_ASSUME_NONNULL_BEGIN
 @property (weak, nonatomic) IBOutlet UILabel *labelAvailable;
 @property (weak, nonatomic) IBOutlet UILabel *labelPriceNet;
 
+
+
+@property (weak, nonatomic) IBOutlet UILabel *labelPrice0;
+@property (weak, nonatomic) IBOutlet UILabel *labelPrice1;
+@property (weak, nonatomic) IBOutlet UILabel *labelPrice2;
+@property (weak, nonatomic) IBOutlet UILabel *labelPrice3;
+
 @property (weak, nonatomic) IBOutlet UILabel *labelPriceSpecial;
 
 @property (strong, nonatomic) NSMutableDictionary *modelJson;

+ 11 - 1
RedAnt ERP Mobile/HMLG Scan Order/ScanListCell.m

@@ -12,6 +12,7 @@
 #import "ActiveViewController.h"
 #import "RAConvertor.h"
 #import "RAUtils.h"
+#import "AppDelegate.h"
 
 @implementation ScanListCell
 
@@ -141,6 +142,15 @@
 - (void)setModelJson:(NSMutableDictionary *)modelJson
 {
     _modelJson = modelJson;
+    
+    
+    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+    
+    self.labelPrice0.text = appDelegate.price0_name;
+    self.labelPrice1.text = appDelegate.price1_name;
+    self.labelPrice2.text = appDelegate.price2_name;
+    self.labelPrice3.text = appDelegate.price3_name;
+    
 
     NSLog( [RAConvertor dict2string:modelJson]);
     
@@ -261,7 +271,7 @@
     {
         if([_modelJson[@"price1"] isEqualToString:@"N/A"])
         {
-            _labelPriceNet.text=@"";//_modelJson[@"price1"];
+            _labelPriceNCA.text=@"";//_modelJson[@"price1"];
 //            _labelPriceNCA.text=@"N/A";
         }
         else

+ 4 - 1
RedAnt ERP Mobile/HMLG Scan Order/ScanModelListCell.h

@@ -28,7 +28,10 @@ NS_ASSUME_NONNULL_BEGIN
 @property (weak, nonatomic) IBOutlet UIStepper *steper;
 
 //@property int pre_val;
-
+@property (weak, nonatomic) IBOutlet UILabel *labelPrice0;
+@property (weak, nonatomic) IBOutlet UILabel *labelPrice1;
+@property (weak, nonatomic) IBOutlet UILabel *labelPrice2;
+@property (weak, nonatomic) IBOutlet UILabel *labelPrice3;
 @end
 
 NS_ASSUME_NONNULL_END

+ 16 - 1
RedAnt ERP Mobile/HMLG Scan Order/ScanModelListCell.m

@@ -11,6 +11,7 @@
 #import "RAConvertor.h"
 #import "RAUtils.h"
 #import "RASingleton.h"
+#import "AppDelegate.h"
 
 
 #define NUMBERS @"0123456789\n"
@@ -35,6 +36,14 @@
 
 - (void)setModelJson:(NSMutableDictionary *)modelJson
 {
+    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+    
+    self.labelPrice0.text = appDelegate.price0_name;
+    self.labelPrice1.text = appDelegate.price1_name;
+    self.labelPrice2.text = appDelegate.price2_name;
+    self.labelPrice3.text = appDelegate.price3_name;
+    
+    
     _modelJson = modelJson;
 
     
@@ -168,7 +177,7 @@
     {
         if([_modelJson[@"price1"] isEqualToString:@"N/A"])
         {
-            _labelPriceNet.text=@"";//_modelJson[@"price1"];
+            _labelPriceNCA.text=@"";//_modelJson[@"price1"];
 //            _labelPriceNCA.text=@"N/A";
         }
         else
@@ -198,8 +207,14 @@
     int c =[_modelJson[@"count"] intValue];
     int s =[_modelJson[@"stockUom"] intValue];
     [self init_Stepper:s max:9999 min:0 value:c];
+    
+    
+    
 }
 
+
+
+
 -(void) init_Stepper:(int) step max:(int) max min:(int)min value:(int)value
 {
     

+ 1 - 1
RedAnt ERP Mobile/HMLG Scan Order/ScanOrderModelListViewController.m

@@ -219,7 +219,7 @@
         {
             if([RASingleton.sharedInstance.scan_list[sli][@"product_id"] isEqualToString:jitem[@"product_id"]])
             {
-                [RASingleton.sharedInstance.scan_list removeObject:jitem];
+                [RASingleton.sharedInstance.scan_list removeObject:RASingleton.sharedInstance.scan_list[sli]];
             }
 
         }

+ 4 - 1
RedAnt ERP Mobile/common/AppDelegateBase.h

@@ -204,7 +204,10 @@ typedef enum {
 #ifdef SCANNER_ORDER
 @property (strong, nonatomic) NSDictionary* scan_model;
 @property (strong, nonatomic) NSArray* scan_model_key;
-
+@property (strong, nonatomic) NSString* price0_name;
+@property (strong, nonatomic) NSString* price1_name;
+@property (strong, nonatomic) NSString* price2_name;
+@property (strong, nonatomic) NSString* price3_name;
 
 #endif
 @end

+ 38 - 0
RedAnt ERP Mobile/common/AppDelegateBase.m

@@ -1790,6 +1790,44 @@ void UncaughtExceptionHandler(NSException *exception) {
 //
 //    });
 }
+#ifdef SCANNER_ORDER
+- (NSString *)price0_name
+{
+    if(_price0_name.length==0)
+    {
+        return @"DDP";
+    }
+    else
+        return _price0_name;
+}
+- (NSString *)price1_name
+{
+    if(_price1_name.length==0)
+    {
+        return @"Unit Price";
+    }
+    else
+        return _price1_name;
+}
+- (NSString *)price2_name
+{
+    if(_price2_name.length==0)
+    {
+        return @"Special";
+    }
+    else
+        return _price2_name;
+}
+- (NSString *)price3_name
+{
+    if(_price3_name.length==0)
+    {
+        return @"Net Price";
+    }
+    else
+        return _price3_name;
+}
+#endif
 -(void) check_offline:(NSString*) ver useInternalAddress:(bool)buseinternaladdress parentvc:(UIViewController*) parent
 {
     

+ 17 - 9
RedAnt ERP Mobile/common/Functions/cart/CartViewController.m

@@ -1112,15 +1112,18 @@
     NSString * shortname = arrsn[0];
     if(shortname.length==0)
         shortname = servername;
+    
+    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+    
     switch(RASingleton.sharedInstance.price_type)
     {
         case 0:
 //            pricename =[NSString stringWithFormat:@"%@_DDP",shortname];
-            pricename = @"DDP";
+            pricename = appDelegate.price0_name;;
             break;;
         case 1:
 //            pricename = [NSString stringWithFormat:@"%@_WHSE",shortname];;
-            pricename=@"WHSE";
+            pricename=appDelegate.price1_name;//@"WHSE";
             break;;
 //        case 2: pricename = @"25%";
 //            break;
@@ -1630,6 +1633,9 @@
 }
 - (IBAction)onChangePrice:(id)sender {
     
+    
+    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+    
     if(RASingleton.sharedInstance.scan_cart ==nil)
     {
 //            NSData* json =[NSData dataWithContentsOfFile:[[NSBundle mainBundle]  pathForResource:URL_SO_CART ofType:@"json" ]];
@@ -1638,10 +1644,10 @@
     }
     
     UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:@"Change Price Type" message:nil preferredStyle:UIAlertControllerStyleAlert];
-    UIAlertAction *action1 = [UIAlertAction actionWithTitle:@"DDP" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
+    UIAlertAction *action1 = [UIAlertAction actionWithTitle:appDelegate.price0_name style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
 
 //        self.btnPrice.titleLabel.text = @"FOB CTNR";
-        [self.btnPrice setTitle: @"DDP" forState:UIControlStateNormal];
+        [self.btnPrice setTitle: appDelegate.price0_name forState:UIControlStateNormal];
         RASingleton.sharedInstance.price_type=0;
         NSMutableDictionary* section = [RASingleton.sharedInstance.scan_cart[@"section_0"] mutableCopy];
             int count = [section[@"count"] intValue];
@@ -1661,9 +1667,9 @@
         [self.view addSubview:self.cartIndicatorBar];
         [self reload_data];
     }];
-    UIAlertAction *action2 = [UIAlertAction actionWithTitle:@"WHSE" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
+    UIAlertAction *action2 = [UIAlertAction actionWithTitle:appDelegate.price1_name style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
 
-        [self.btnPrice setTitle: @"WHSE" forState:UIControlStateNormal];
+        [self.btnPrice setTitle: appDelegate.price1_name forState:UIControlStateNormal];
         RASingleton.sharedInstance.price_type=1;
         NSMutableDictionary* section = [RASingleton.sharedInstance.scan_cart[@"section_0"] mutableCopy];
             int count = [section[@"count"] intValue];
@@ -2830,11 +2836,13 @@
    NSString * shortname = arrsn[0];
    if(shortname.length==0)
        shortname = servername;
+    
+    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
     switch(RASingleton.sharedInstance.price_type )
     {
-        case 0: pricename =@"DDP";//[NSString stringWithFormat:@"%@_DDP",shortname];
+        case 0: pricename =appDelegate.price0_name;//@"DDP";//[NSString stringWithFormat:@"%@_DDP",shortname];
             break;;
-        case 1: pricename = @"WHSE";//[NSString stringWithFormat:@"%@_WHSE",shortname];;
+        case 1: pricename =appDelegate.price1_name;//@"WHSE";//[NSString stringWithFormat:@"%@_WHSE",shortname];;
             break;;
 //        case 2: pricename = @"25%";
 //            break;
@@ -2947,7 +2955,7 @@
     }
     
 #else
-    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+//    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
     [OLDataProvider updateScanOrder:appDelegate.order_code];
 #endif
     

+ 12 - 1
RedAnt ERP Mobile/common/data_provider/RADataProvider.m

@@ -143,7 +143,7 @@
 //    2022-07-14。1.17
     //    2022-07-14。1.19
     
-NSDate * ddate =[dateFormatter dateFromString:@"2022-07-1"];
+NSDate * ddate =[dateFormatter dateFromString:@"2022-07-23"];
     
 //    bool review=[cdate earlierDate:ddate];
     NSTimeInterval secondsInterval= [cdate timeIntervalSinceDate:ddate];
@@ -344,6 +344,17 @@ NSDate * ddate =[dateFormatter dateFromString:@"2022-07-1"];
     appDelegate.scan_model = of;
     appDelegate.scan_model_key=keysort;
     
+    NSString* templatefile1 = [unZipTo stringByAppendingPathComponent:@"price_name.json"];
+    
+    NSString* str1 = [NSString stringWithContentsOfFile:templatefile1 encoding:NSUTF8StringEncoding error:nil];
+  
+    NSMutableDictionary* pn = [[RAConvertor string2dict:str1] mutableCopy];
+    
+    appDelegate.price0_name=pn[@"price_0"];
+    appDelegate.price1_name=pn[@"price_1"];
+    appDelegate.price2_name=pn[@"price_2"];
+    appDelegate.price3_name=pn[@"price_3"];
+    
     
 }
 

+ 1 - 1
RedAnt ERP Mobile/iSales-CONTRAST.xcodeproj/xcuserdata/ruizhang.xcuserdatad/xcschemes/xcschememanagement.plist

@@ -7,7 +7,7 @@
 		<key>iSales-CONTRAST.xcscheme_^#shared#^_</key>
 		<dict>
 			<key>orderHint</key>
-			<integer>4</integer>
+			<integer>2</integer>
 		</dict>
 		<key>iSales-USAI.xcscheme_^#shared#^_</key>
 		<dict>

+ 1 - 0
common/NetworkUtils.m

@@ -760,6 +760,7 @@ repeat:
         NSURLSessionDataTask *dataTask =[urlSession dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
             
                         NSData *responseData =data;
+            DebugLog(@"request_interface result length:%ld", data.length);
                         NSHTTPURLResponse* urlResponse =(NSHTTPURLResponse*)response;
                         if (responseData==nil) {
 

+ 1 - 1
common/common_const.h

@@ -57,7 +57,7 @@
 #define URL_LOCAL 0
 #define URL_NONE 2
 #define URL_RESTORE 3
-
+#define URL_FILE 4
 
 // 对应接口状态的部分message
 #define MSG_NET_NOTAVAILABLE @"No available network, please check your network setting."