Explorar o código

161020

merge customer and employee logic
Ray Zhang %!s(int64=9) %!d(string=hai) anos
pai
achega
0c7bcf6fe9

BIN=BIN
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/Ray.xcuserdatad/UserInterfaceState.xcuserstate


+ 24 - 24
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/Ray.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -52,11 +52,11 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "iSales-NPD/AppDelegate.m"
-            timestampString = "496717981.770043"
+            timestampString = "498634265.963326"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1719"
-            endingLineNumber = "1719"
+            startingLineNumber = "1721"
+            endingLineNumber = "1721"
             landmarkName = "-download_offline:checkdiskspace:"
             landmarkType = "7">
          </BreakpointContent>
@@ -68,11 +68,11 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "iSales-NPD/AppDelegate.m"
-            timestampString = "496717981.770043"
+            timestampString = "498634265.963326"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2100"
-            endingLineNumber = "2100"
+            startingLineNumber = "2102"
+            endingLineNumber = "2102"
             landmarkName = "-connectionDidFinishLoading:"
             landmarkType = "7">
          </BreakpointContent>
@@ -84,11 +84,11 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "iSales-NPD/AppDelegate.m"
-            timestampString = "497778128.158403"
+            timestampString = "498634265.963326"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2166"
-            endingLineNumber = "2166"
+            startingLineNumber = "2168"
+            endingLineNumber = "2168"
             landmarkName = "-connectionDidFinishLoading:"
             landmarkType = "7">
          </BreakpointContent>
@@ -100,11 +100,11 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "iSales-NPD/AppDelegate.m"
-            timestampString = "497778128.158403"
+            timestampString = "498634265.963326"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2215"
-            endingLineNumber = "2215"
+            startingLineNumber = "2217"
+            endingLineNumber = "2217"
             landmarkName = "-connectionDidFinishLoading:"
             landmarkType = "7">
          </BreakpointContent>
@@ -116,11 +116,11 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "iSales-NPD/AppDelegate.m"
-            timestampString = "497778128.158403"
+            timestampString = "498634265.963326"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2219"
-            endingLineNumber = "2219"
+            startingLineNumber = "2221"
+            endingLineNumber = "2221"
             landmarkName = "-connectionDidFinishLoading:"
             landmarkType = "7">
          </BreakpointContent>
@@ -196,11 +196,11 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "iSales-NPD/AppDelegate.m"
-            timestampString = "497778128.158403"
+            timestampString = "498634265.963326"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2220"
-            endingLineNumber = "2220"
+            startingLineNumber = "2222"
+            endingLineNumber = "2222"
             landmarkName = "-connectionDidFinishLoading:"
             landmarkType = "7">
          </BreakpointContent>
@@ -755,11 +755,11 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "iSales-NPD/AppDelegate.m"
-            timestampString = "497778168.303518"
+            timestampString = "498634265.963326"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "2163"
-            endingLineNumber = "2163"
+            startingLineNumber = "2165"
+            endingLineNumber = "2165"
             landmarkName = "-connectionDidFinishLoading:"
             landmarkType = "7">
          </BreakpointContent>
@@ -771,11 +771,11 @@
             ignoreCount = "0"
             continueAfterRunningActions = "No"
             filePath = "iSales-NPD/AppDelegate.m"
-            timestampString = "497779807.104589"
+            timestampString = "498634265.963326"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1361"
-            endingLineNumber = "1361"
+            startingLineNumber = "1363"
+            endingLineNumber = "1363"
             landmarkName = "-check_offline:useInternalAddress:parentvc:"
             landmarkType = "7">
          </BreakpointContent>

+ 4 - 4
RedAnt ERP Mobile/common/Functions/MainViewController.m

@@ -244,7 +244,7 @@
         [self.btnLogin setTitle:@"Sign in" forState:UIControlStateNormal];
     [iSalesNetwork LoadImage:appDelegate.user_icon into:self.user_head ];
     
-    if(appDelegate.user_type==USER_ROLE_EMPLOYEE)
+    if(/*appDelegate.user_type==USER_ROLE_EMPLOYEE*/true)
         self.btnContact.hidden = NO;
     else
         self.btnContact.hidden = YES;
@@ -975,7 +975,7 @@
     
     [iSalesNetwork LoadImage:appDelegate.user_icon into:self.user_head ];
     
-    if(appDelegate.user_type==USER_ROLE_EMPLOYEE)
+    if(/*appDelegate.user_type==USER_ROLE_EMPLOYEE*/true)
         self.btnContact.hidden = NO;
     else
         self.btnContact.hidden = YES;
@@ -1231,7 +1231,7 @@
             
             if(blogin)
             {
-                if(appDelegate.user_type==USER_ROLE_EMPLOYEE)
+                if(/*appDelegate.user_type==USER_ROLE_EMPLOYEE*/true)
                 {
                     
                     [self checklogin:false];
@@ -1297,7 +1297,7 @@
     }
     else
     {
-        if(appDelegate.user_type==USER_ROLE_EMPLOYEE&&/*appDelegate.contact_id==nil&&*/appDelegate.order_code==nil)
+        if(/*appDelegate.user_type==USER_ROLE_EMPLOYEE&&/*appDelegate.contact_id==nil&&*/appDelegate.order_code==nil)
         {
             [self checklogin:false];
             if(appDelegate.can_create_order)

+ 2 - 2
RedAnt ERP Mobile/common/Functions/camscan/ScannerViewController.m

@@ -465,7 +465,7 @@
             
             if(blogin)
             {
-                if(appDelegate.user_type==USER_ROLE_EMPLOYEE)
+                if(/*appDelegate.user_type==USER_ROLE_EMPLOYEE*/ true)
                 {
                     [((MainViewController*)appDelegate.main_vc) reloadCategory:true immediately:false];
                     [main_vc checklogin:false];
@@ -509,7 +509,7 @@
     {
         
         
-        if(appDelegate.user_type==USER_ROLE_EMPLOYEE&&/*appDelegate.contact_id==nil&&*/appDelegate.order_code==nil)
+        if(/*appDelegate.user_type==USER_ROLE_EMPLOYEE&&/*appDelegate.contact_id==nil&&*/appDelegate.order_code==nil)
         {
             [main_vc checklogin:false];
             

+ 2 - 2
RedAnt ERP Mobile/common/Functions/category/CategoryViewController.m

@@ -326,7 +326,7 @@
             
             if(blogin)
             {
-                if(appDelegate.user_type==USER_ROLE_EMPLOYEE)
+                if(/*appDelegate.user_type==USER_ROLE_EMPLOYEE*/true)
                 {
                     [main_vc checklogin:false];
                     if(appDelegate.can_create_order)
@@ -389,7 +389,7 @@
     }
     else
     {
-        if(appDelegate.user_type==USER_ROLE_EMPLOYEE&&/*appDelegate.contact_id==nil&&*/appDelegate.order_code==nil)
+        if(/*appDelegate.user_type==USER_ROLE_EMPLOYEE&&*//*appDelegate.contact_id==nil&&*/appDelegate.order_code==nil)
         {
            // [main_vc checklogin:false];
             

+ 2 - 2
RedAnt ERP Mobile/common/Functions/modelDetail/DetailHeaderCell.m

@@ -346,7 +346,7 @@
             
             if(blogin)
             {
-                if(appDelegate.user_type==USER_ROLE_EMPLOYEE)
+                if(/*appDelegate.user_type==USER_ROLE_EMPLOYEE*/ true)
                 {
                     if(self.set_update_data)
                         self.set_update_data(true);
@@ -422,7 +422,7 @@
     {
         
         
-        if(appDelegate.user_type==USER_ROLE_EMPLOYEE&&/*appDelegate.contact_id==nil&&*/appDelegate.order_code==nil)
+        if(/*appDelegate.user_type==USER_ROLE_EMPLOYEE&&/*appDelegate.contact_id==nil&&*/appDelegate.order_code==nil)
         {
             [main_vc checklogin:false];
             

+ 8 - 6
RedAnt ERP Mobile/common/Functions/order/CreateOrderViewController.m

@@ -840,9 +840,10 @@
                                                             AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
                                                             // appDelegate.customerInfo = customerInfo;
                                                             
-                                                            NSString* orderCode = [editor_json valueForKey:@"orderCode"];
-                                                            appDelegate.order_code = orderCode;
-                                                            appDelegate.order_status = [[editor_json valueForKey:@"orderStatus"] intValue];
+//                                                            NSString* orderCode = [editor_json valueForKey:@"orderCode"];
+//                                                            appDelegate.order_code = orderCode;
+//                                                            appDelegate.order_status = [[editor_json valueForKey:@"orderStatus"] intValue];
+                                                            [appDelegate closeOrder];
                                                             [((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
                                                             
                                                             NSString* title=nil;
@@ -1073,9 +1074,10 @@
                                 AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
                                 // appDelegate.customerInfo = customerInfo;
                                 
-                                NSString* orderCode = [editor_json valueForKey:@"orderCode"];
-                                appDelegate.order_code = orderCode;
-                                appDelegate.order_status = [[editor_json valueForKey:@"orderStatus"] intValue];
+//                                NSString* orderCode = [editor_json valueForKey:@"orderCode"];
+//                                appDelegate.order_code = orderCode;
+//                                appDelegate.order_status = [[editor_json valueForKey:@"orderStatus"] intValue];
+                                [appDelegate closeOrder];
                                 [((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
                                 
                                 NSString* title=nil;

+ 2 - 1
RedAnt ERP Mobile/common/Functions/order/OrderListViewController.m

@@ -601,7 +601,8 @@
                 };
                 
                 [self.navigationController pushViewController:cvc animated:true];
-            } else if (appDelegate.user_type == USER_ROLE_CUSTOMER){
+            }
+            else if (appDelegate.user_type == USER_ROLE_CUSTOMER){
                 [self neworder];
             }
             

+ 2 - 2
RedAnt ERP Mobile/common/Functions/search+itemsearch/ItemSearchViewController.m

@@ -732,7 +732,7 @@
             
             if(blogin)
             {
-                if(appDelegate.user_type==USER_ROLE_EMPLOYEE)
+                if(/*appDelegate.user_type==USER_ROLE_EMPLOYEE*/true)
                 {
                     
                     [main_vc checklogin:false];
@@ -797,7 +797,7 @@
     }
     else
     {
-        if(appDelegate.user_type==USER_ROLE_EMPLOYEE&&/*appDelegate.contact_id==nil&&*/appDelegate.order_code==nil)
+        if(/*appDelegate.user_type==USER_ROLE_EMPLOYEE&&/*appDelegate.contact_id==nil&&*/appDelegate.order_code==nil)
         {
             [main_vc checklogin:false];
             

+ 2 - 2
RedAnt ERP Mobile/common/Functions/search+itemsearch/SearchViewController.m

@@ -557,7 +557,7 @@
             
             if(blogin)
             {
-                if(appDelegate.user_type==USER_ROLE_EMPLOYEE)
+                if(/*appDelegate.user_type==USER_ROLE_EMPLOYEE*/ true)
                 {
                     
                     [main_vc checklogin:false];
@@ -621,7 +621,7 @@
     }
     else
     {
-        if(appDelegate.user_type==USER_ROLE_EMPLOYEE&&/*appDelegate.contact_id==nil&&*/appDelegate.order_code==nil)
+        if(/*appDelegate.user_type==USER_ROLE_EMPLOYEE&&/*appDelegate.contact_id==nil&&*/appDelegate.order_code==nil)
         {
          //   [main_vc checklogin:false];
             if(appDelegate.can_create_order)

+ 2 - 2
RedAnt ERP Mobile/common/Functions/watchlist/WatchListViewController.m

@@ -83,7 +83,7 @@
             
             if(blogin)
             {
-                if(appDelegate.user_type==USER_ROLE_EMPLOYEE)
+                if(/*appDelegate.user_type==USER_ROLE_EMPLOYEE*/ true)
                 {
                     
                     [main_vc checklogin:false];
@@ -145,7 +145,7 @@
     }
     else
     {
-        if(appDelegate.user_type==USER_ROLE_EMPLOYEE&&/*appDelegate.contact_id==nil&&*/appDelegate.order_code==nil)
+        if(/*appDelegate.user_type==USER_ROLE_EMPLOYEE&&/*appDelegate.contact_id==nil&&*/appDelegate.order_code==nil)
         {
             [main_vc checklogin:false];
             if(appDelegate.can_create_order)

+ 2 - 2
RedAnt ERP Mobile/common/RAUtils.m

@@ -429,7 +429,7 @@
             
             if(blogin)
             {
-                if(appDelegate.user_type==USER_ROLE_EMPLOYEE)
+                if(/*appDelegate.user_type==USER_ROLE_EMPLOYEE*/ true)
                 {
                     
                     [main_vc checklogin:false];
@@ -586,7 +586,7 @@
     }
     else
     {
-        if(appDelegate.user_type==USER_ROLE_EMPLOYEE&&/*appDelegate.contact_id==nil&&*/appDelegate.order_code==nil)
+        if(/*appDelegate.user_type==USER_ROLE_EMPLOYEE&&/*appDelegate.contact_id==nil&&*/appDelegate.order_code==nil)
         {
             if(appDelegate.contact_id.length==0)
             {

+ 3 - 3
RedAnt ERP Mobile/common/data_provider/iSalesNetwork.m

@@ -3533,9 +3533,9 @@ repeat:
         {
             appDelegate.customerInfo = [objheader objectForKeyedSubscript:@"customerInfo"];
             appDelegate.contact_id = [objheader valueForKey:@"customer_cid"];
-            appDelegate.order_code =[objheader valueForKey:@"orderCode"];
-            appDelegate.order_status =[[objheader valueForKey:@"orderStatus"] intValue];
-            [appDelegate SetSo:[objheader valueForKey:@"soId"]];
+//            appDelegate.order_code =[objheader valueForKey:@"orderCode"];
+//            appDelegate.order_status =[[objheader valueForKey:@"orderStatus"] intValue];
+//            [appDelegate SetSo:[objheader valueForKey:@"soId"]];
         }
         NSString* mode =[jsobj valueForKey:@"mode"] ;
         [appDelegate SetMode:mode];

+ 1 - 1
RedAnt ERP Mobile/iSales-NPD/Base.lproj/Main.storyboard

@@ -2364,7 +2364,7 @@
                                                 <rect key="frame" x="0.0" y="22" width="768" height="146"/>
                                                 <autoresizingMask key="autoresizingMask"/>
                                                 <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="0QE-xl-8q8" id="tZa-g0-y6H">
-                                                    <frame key="frameInset" width="768" height="145"/>
+                                                    <frame key="frameInset" width="768" height="146"/>
                                                     <autoresizingMask key="autoresizingMask"/>
                                                     <subviews>
                                                         <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="name aaaaaaaaaaaaa aaaaaaaaaa BBBBB  CCCCC" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="S98-fV-nsC" userLabel="name and description">