Bladeren bron

Contrast mobile 1.99

HMLG scan order: modify price logic, remove net price, remove surcharge
Ray Zhang 3 jaren geleden
bovenliggende
commit
7d6ee05508
43 gewijzigde bestanden met toevoegingen van 1208 en 261 verwijderingen
  1. 2 2
      Ants Contract/Granite Expo eSign/Granite Expo eSign.xcodeproj/project.pbxproj
  2. BIN
      RA TradeFiling/RA TradeFiling.xcodeproj/project.xcworkspace/xcuserdata/ruizhang.xcuserdatad/UserInterfaceState.xcuserstate
  3. 54 22
      RA TradeFiling/RA TradeFiling.xcodeproj/xcuserdata/ruizhang.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
  4. 4 4
      RedAnt ERP Mobile/HMLG Scan Order.xcodeproj/project.pbxproj
  5. 19 18
      RedAnt ERP Mobile/HMLG Scan Order/CartViewController.m
  6. 27 14
      RedAnt ERP Mobile/HMLG Scan Order/MainViewController.m
  7. 33 31
      RedAnt ERP Mobile/HMLG Scan Order/SO.storyboard
  8. 53 35
      RedAnt ERP Mobile/HMLG Scan Order/ScanListCell.m
  9. 49 35
      RedAnt ERP Mobile/HMLG Scan Order/ScanModelListCell.m
  10. 2 0
      RedAnt ERP Mobile/HMLG Scan Order/ScanOrderModelListViewController.m
  11. 1 1
      RedAnt ERP Mobile/HMLG Scan Order/config.h
  12. 1 1
      RedAnt ERP Mobile/common/ActiveViewController.m
  13. 5 4
      RedAnt ERP Mobile/common/AppDelegateBase.m
  14. 9 4
      RedAnt ERP Mobile/common/CartUtils.m
  15. 10 10
      RedAnt ERP Mobile/common/ERP_Mobile_Cart.storyboard
  16. 2 1
      RedAnt ERP Mobile/common/Functions/OLO/ScanOrderListViewController.m
  17. 1 1
      RedAnt ERP Mobile/common/Functions/camscan/ScannerViewController.m
  18. 2 2
      RedAnt ERP Mobile/common/Functions/cart/CartViewController.m
  19. 4 2
      RedAnt ERP Mobile/common/Functions/contact/ContactListViewController.m
  20. 18 8
      RedAnt ERP Mobile/common/Functions/modelDetail/DetailViewController.m
  21. 314 33
      RedAnt ERP Mobile/common/Functions/offline/OLDataProvider.m
  22. 1 1
      RedAnt ERP Mobile/common/Functions/order/OrderListViewController.m
  23. 1 1
      RedAnt ERP Mobile/common/Functions/portfolio/PortfolioEditQTYViewController.m
  24. 1 1
      RedAnt ERP Mobile/common/Functions/search+itemsearch/ItemSearchFilterViewController.m
  25. 19 3
      RedAnt ERP Mobile/common/Functions/sidemenu/FunctionTestViewController.m
  26. 1 1
      RedAnt ERP Mobile/common/Functions/sidemenu/ScannerSettingViewController.m
  27. 1 1
      RedAnt ERP Mobile/common/Functions/sidemenu/SimplifiedBuyingProgramViewController.m
  28. 1 1
      RedAnt ERP Mobile/common/Functions/sidemenu/UserListViewController.m
  29. 3 0
      RedAnt ERP Mobile/common/RASingleton.h
  30. 1 1
      RedAnt ERP Mobile/common/data_provider/RADataProvider.m
  31. 5 1
      RedAnt ERP Mobile/common/data_provider/iSalesDB.m
  32. 22 14
      RedAnt ERP Mobile/iSales-CONTRAST.xcodeproj/project.pbxproj
  33. 1 1
      RedAnt ERP Mobile/iSales-CONTRAST.xcodeproj/xcuserdata/ruizhang.xcuserdatad/xcschemes/xcschememanagement.plist
  34. 2 2
      RedAnt ERP Mobile/iSales-CONTRAST/config.h
  35. 183 0
      RedAnt ERP Mobile/iSales-CONTRAST/createContact.json
  36. 154 0
      RedAnt ERP Mobile/iSales-CONTRAST/customer_info_template.json
  37. 189 0
      RedAnt ERP Mobile/iSales-CONTRAST/editContact.json
  38. BIN
      Redant Drivers/Apex And Drivers.xcodeproj/project.xcworkspace/xcuserdata/ruizhang.xcuserdatad/UserInterfaceState.xcuserstate
  39. 1 0
      Redant Drivers/Apex And Drivers/Info.plist
  40. 2 2
      Redant Drivers/Apex And Drivers/config.h
  41. 1 1
      common/RAConvertor.m
  42. 5 0
      common/customUI/commoneditor/CommonEditorCellModel.m
  43. 4 2
      common/customUI/commoneditor/CommonEditorViewController.m

+ 2 - 2
Ants Contract/Granite Expo eSign/Granite Expo eSign.xcodeproj/project.pbxproj

@@ -915,7 +915,7 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
-				CURRENT_PROJECT_VERSION = 51294;
+				CURRENT_PROJECT_VERSION = 51590;
 				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				INFOPLIST_FILE = "Granite Expo eSign/Info.plist";
 				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
@@ -930,7 +930,7 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
-				CURRENT_PROJECT_VERSION = 51294;
+				CURRENT_PROJECT_VERSION = 51590;
 				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				INFOPLIST_FILE = "Granite Expo eSign/Info.plist";
 				IPHONEOS_DEPLOYMENT_TARGET = 12.0;

BIN
RA TradeFiling/RA TradeFiling.xcodeproj/project.xcworkspace/xcuserdata/ruizhang.xcuserdatad/UserInterfaceState.xcuserstate


+ 54 - 22
RA TradeFiling/RA TradeFiling.xcodeproj/xcuserdata/ruizhang.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -16,7 +16,7 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "1971"
             endingLineNumber = "1971"
-            landmarkName = "-prepareReturn:"
+            landmarkName = "-didReceiveMemoryWarning"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -32,7 +32,7 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "2935"
             endingLineNumber = "2935"
-            landmarkName = "-returnValue:indexPath:"
+            landmarkName = "-HideSction:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -96,7 +96,7 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "5913"
             endingLineNumber = "5913"
-            landmarkName = "-textField:shouldChangeCharactersInRange:replacementString:"
+            landmarkName = "-textView:shouldChangeTextInRange:replacementText:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -272,8 +272,8 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "1387"
             endingLineNumber = "1387"
-            landmarkName = "-refresh:discardDirty:"
-            landmarkType = "7">
+            landmarkName = "CommonEditorViewController"
+            landmarkType = "3">
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
@@ -288,7 +288,7 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "1985"
             endingLineNumber = "1985"
-            landmarkName = "-handle_action_return:indexPath:action:"
+            landmarkName = "-prepareReturn:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -320,7 +320,7 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "1345"
             endingLineNumber = "1345"
-            landmarkName = "-CopyDirty:to:"
+            landmarkName = "-get_refresh_param"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -352,7 +352,7 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "6675"
             endingLineNumber = "6675"
-            landmarkName = "-keyboardWillChangeFrame:"
+            landmarkName = "-fill_enum_subitem:subid:source:mapping:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -368,7 +368,7 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "6815"
             endingLineNumber = "6815"
-            landmarkName = "-keyboardDidChangeFrame:"
+            landmarkName = "-keyboardWillChangeFrame:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -384,8 +384,8 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "6700"
             endingLineNumber = "6700"
-            landmarkName = "-keyboardWillChangeFrame:"
-            landmarkType = "7">
+            landmarkName = "CommonEditorViewController"
+            landmarkType = "3">
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
@@ -400,7 +400,7 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "5793"
             endingLineNumber = "5793"
-            landmarkName = "-textView:shouldChangeTextInRange:replacementText:"
+            landmarkName = "-textViewDidEndEditing:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -416,8 +416,8 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "5762"
             endingLineNumber = "5762"
-            landmarkName = "-textView:shouldChangeTextInRange:replacementText:"
-            landmarkType = "7">
+            landmarkName = "CommonEditorViewController"
+            landmarkType = "3">
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
@@ -432,7 +432,7 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "5449"
             endingLineNumber = "5449"
-            landmarkName = "-setEnumValue:indexPath:"
+            landmarkName = "-MPValueChanged:indexPath:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -448,7 +448,7 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "5501"
             endingLineNumber = "5501"
-            landmarkName = "-setEnumValue:indexPath:"
+            landmarkName = "-DateTimeValueChanged:indexPath:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -464,7 +464,7 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "5500"
             endingLineNumber = "5500"
-            landmarkName = "-setEnumValue:indexPath:"
+            landmarkName = "-DateTimeValueChanged:indexPath:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -480,8 +480,8 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "1388"
             endingLineNumber = "1388"
-            landmarkName = "-refresh:discardDirty:"
-            landmarkType = "7">
+            landmarkName = "CommonEditorViewController"
+            landmarkType = "3">
          </BreakpointContent>
       </BreakpointProxy>
       <BreakpointProxy
@@ -496,7 +496,7 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "1240"
             endingLineNumber = "1240"
-            landmarkName = "-get_refresh_param"
+            landmarkName = "-download_failed"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -560,7 +560,7 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "1986"
             endingLineNumber = "1986"
-            landmarkName = "-handle_action_return:indexPath:action:"
+            landmarkName = "-prepareReturn:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
@@ -640,7 +640,39 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "5545"
             endingLineNumber = "5545"
-            landmarkName = "-setEnumValue:indexPath:"
+            landmarkName = "-DateTimeValueChanged:indexPath:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "035792BC-6753-4DEF-BC24-E4670D692937"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "../common/customUI/commoneditor/CommonEditorViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "6394"
+            endingLineNumber = "6394"
+            landmarkName = "-sync_loadCadidate:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "DD70583A-A239-4850-992A-94CE297D7A84"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "../common/customUI/commoneditor/CommonEditorViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "6367"
+            endingLineNumber = "6367"
+            landmarkName = "-textFieldShouldBeginEditing:"
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>

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

@@ -2519,7 +2519,7 @@
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				CURRENT_PROJECT_VERSION = 52038;
+				CURRENT_PROJECT_VERSION = 52062;
 				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -2536,7 +2536,7 @@
 					"$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib",
 					"$(PROJECT_DIR)/GoogleAnalytics/GoogleAnalytics/Libraries",
 				);
-				MARKETING_VERSION = 1.29;
+				MARKETING_VERSION = 1.30;
 				OTHER_LDFLAGS = (
 					"$(inherited)",
 					"-ObjC",
@@ -2567,7 +2567,7 @@
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				CURRENT_PROJECT_VERSION = 52038;
+				CURRENT_PROJECT_VERSION = 52062;
 				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -2584,7 +2584,7 @@
 					"$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib",
 					"$(PROJECT_DIR)/GoogleAnalytics/GoogleAnalytics/Libraries",
 				);
-				MARKETING_VERSION = 1.29;
+				MARKETING_VERSION = 1.30;
 				OTHER_LDFLAGS = (
 					"$(inherited)",
 					"-ObjC",

+ 19 - 18
RedAnt ERP Mobile/HMLG Scan Order/CartViewController.m

@@ -3032,23 +3032,24 @@
 //            NSDictionary * bundle_item =[item_json objectForKey:@"combine"];
             
             double msurcharge =0;
-            if(RASingleton.sharedInstance.price_type==1)
-            {
-                if([item_json[@"special_price"] boolValue])
-                {
-                    msurcharge=([item_json[price_group[@"price_3"][@"name"]] doubleValue]-[item_json[price_group[@"price_2"][@"name"]] doubleValue])*count*(1-discount/100.0);
-                    if(msurcharge<0)
-                        msurcharge = 0;
-                }
-                else
-                {
-                    msurcharge=([item_json[price_group[@"price_3"][@"name"]] doubleValue]-[item_json[price_group[@"price_1"][@"name"]] doubleValue])*count*(1-discount/100.0);
-                    if(msurcharge<0)
-                        msurcharge = 0;
-
-                    
-                }
-            }
+            // remove net price
+//            if(RASingleton.sharedInstance.price_type==1)
+//            {
+//                if([item_json[@"special_price"] boolValue])
+//                {
+//                    msurcharge=([item_json[price_group[@"price_3"][@"name"]] doubleValue]-[item_json[price_group[@"price_2"][@"name"]] doubleValue])*count*(1-discount/100.0);
+//                    if(msurcharge<0)
+//                        msurcharge = 0;
+//                }
+//                else
+//                {
+//                    msurcharge=([item_json[price_group[@"price_3"][@"name"]] doubleValue]-[item_json[price_group[@"price_1"][@"name"]] doubleValue])*count*(1-discount/100.0);
+//                    if(msurcharge<0)
+//                        msurcharge = 0;
+//
+//
+//                }
+//            }
 
             
 //            double dprice=0;
@@ -4132,7 +4133,7 @@
     
     if(/*appDelegate.user_type==USER_ROLE_CUSTOMER*/ true)
  {
-#ifdef IGNORE_MPACK
+#ifdef IGNORE_SOLD_IN_QTY
         [cell init_Stepper:1 max:9999 min:1 value:count];
 #else
         [cell init_Stepper:stockUom max:9999 min:stockUom value:count];

+ 27 - 14
RedAnt ERP Mobile/HMLG Scan Order/MainViewController.m

@@ -1428,17 +1428,19 @@
         int mcount = [cartitem[@"count"] intValue];
         order_qty+=mcount;
         double msurcharge =0;
-        if(RASingleton.sharedInstance.price_type==1)
-        {
-            if([cartitem[@"special_price"] boolValue])
-            {
-                msurcharge=([cartitem[price_group[@"price_3"][@"name"]] doubleValue]-[cartitem[price_group[@"price_2"][@"name"]] doubleValue])*mcount*(1-[cartitem[@"discount"]doubleValue]/100.0);
-            }
-            else
-            {
-                msurcharge=([cartitem[price_group[@"price_3"][@"name"]] doubleValue]-[cartitem[price_group[@"price_1"][@"name"]] doubleValue])*mcount*(1-[cartitem[@"discount"]doubleValue]/100.0);
-            }
-        }
+        
+        // remove net price
+//        if(RASingleton.sharedInstance.price_type==1)
+//        {
+//            if([cartitem[@"special_price"] boolValue])
+//            {
+//                msurcharge=([cartitem[price_group[@"price_3"][@"name"]] doubleValue]-[cartitem[price_group[@"price_2"][@"name"]] doubleValue])*mcount*(1-[cartitem[@"discount"]doubleValue]/100.0);
+//            }
+//            else
+//            {
+//                msurcharge=([cartitem[price_group[@"price_3"][@"name"]] doubleValue]-[cartitem[price_group[@"price_1"][@"name"]] doubleValue])*mcount*(1-[cartitem[@"discount"]doubleValue]/100.0);
+//            }
+//        }
 
         s+=msurcharge;
     }
@@ -3166,11 +3168,19 @@
         NSMutableDictionary* guestjson=[OLDataProvider loadScanTemplate:@"guest.json"];
         if(!guestjson)
         {
-            [RADataProvider updateTemplate:self];
+            dispatch_async(dispatch_get_main_queue(), ^{
+                [RADataProvider updateTemplate:self];
+                
+            });
+            
             
         }
         else
-            [self onUserButtonClick:nil];
+            dispatch_async(dispatch_get_main_queue(), ^{
+                [self onUserButtonClick:nil];
+                
+            });
+            
     }
     else
     {
@@ -3185,7 +3195,10 @@
 
             }
             
-            [RADataProvider updateTemplate:self];
+            dispatch_async(dispatch_get_main_queue(), ^{
+                [RADataProvider updateTemplate:self];
+                
+            });
         };
         [self.navigationController pushViewController:servervc animated:true];
     }

+ 33 - 31
RedAnt ERP Mobile/HMLG Scan Order/SO.storyboard

@@ -2152,9 +2152,8 @@ Stock</string>
                                     <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" restorationIdentifier="ScanListCell" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="ScanListCell" rowHeight="136" id="RBD-TT-DqV" customClass="ScanListCell">
                                         <rect key="frame" x="0.0" y="50" width="744" height="136"/>
                                         <autoresizingMask key="autoresizingMask"/>
-                                        <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="RBD-TT-DqV" id="h6v-P5-Y6J">
+                                        <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="RBD-TT-DqV" translatesAutoresizingMaskIntoConstraints="NO" id="h6v-P5-Y6J">
                                             <rect key="frame" x="0.0" y="0.0" width="744" height="136"/>
-                                            <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Model" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ToU-Mo-Rx3" userLabel="item label">
                                                     <rect key="frame" x="16" y="13" width="50.5" height="21"/>
@@ -2163,25 +2162,25 @@ Stock</string>
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Available:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uDf-2P-7UC" userLabel="available">
-                                                    <rect key="frame" x="611" y="44.5" width="72" height="21"/>
+                                                    <rect key="frame" x="611" y="41.5" width="72" height="21"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                                     <nil key="textColor"/>
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="252" verticalHuggingPriority="251" text="Now" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="8er-u1-DZo" userLabel="item label">
-                                                    <rect key="frame" x="693" y="44.5" width="35" height="21"/>
+                                                    <rect key="frame" x="693" y="41.5" width="35" height="21"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                                     <nil key="textColor"/>
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="252" verticalHuggingPriority="251" text="Description" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="H92-P3-tCf" userLabel="description">
-                                                    <rect key="frame" x="16" y="49" width="712" height="21"/>
+                                                    <rect key="frame" x="16" y="46" width="87.5" height="21"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                                     <nil key="textColor"/>
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Port" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="56k-bL-ui2" userLabel="item label">
-                                                    <rect key="frame" x="194" y="80" width="89" height="24"/>
+                                                    <rect key="frame" x="194" y="77" width="89" height="24"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="15"/>
                                                     <nil key="textColor"/>
                                                     <nil key="highlightedColor"/>
@@ -2196,7 +2195,7 @@ Stock</string>
                                                     </userDefinedRuntimeAttributes>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Origin" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Raa-F8-Tim" userLabel="item label">
-                                                    <rect key="frame" x="105" y="80" width="89" height="24"/>
+                                                    <rect key="frame" x="105" y="77" width="89" height="24"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="15"/>
                                                     <nil key="textColor"/>
                                                     <nil key="highlightedColor"/>
@@ -2211,7 +2210,7 @@ Stock</string>
                                                     </userDefinedRuntimeAttributes>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="DDP" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6Or-u7-4VU" userLabel="item label">
-                                                    <rect key="frame" x="283" y="80" width="89" height="24"/>
+                                                    <rect key="frame" x="283" y="77" width="89" height="24"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="15"/>
                                                     <nil key="textColor"/>
                                                     <nil key="highlightedColor"/>
@@ -2226,7 +2225,7 @@ Stock</string>
                                                     </userDefinedRuntimeAttributes>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Special" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="CZn-lW-zFb" userLabel="item label">
-                                                    <rect key="frame" x="461" y="80" width="89" height="24"/>
+                                                    <rect key="frame" x="461" y="77" width="89" height="24"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="15"/>
                                                     <nil key="textColor"/>
                                                     <nil key="highlightedColor"/>
@@ -2241,7 +2240,7 @@ Stock</string>
                                                     </userDefinedRuntimeAttributes>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Net Price" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qux-TP-f6L" userLabel="item label">
-                                                    <rect key="frame" x="550" y="80" width="89" height="24"/>
+                                                    <rect key="frame" x="550" y="77" width="89" height="24"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="15"/>
                                                     <nil key="textColor"/>
                                                     <nil key="highlightedColor"/>
@@ -2256,7 +2255,7 @@ Stock</string>
                                                     </userDefinedRuntimeAttributes>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Unit Price" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="MB0-nt-BnH" userLabel="item label">
-                                                    <rect key="frame" x="372" y="80" width="89" height="24"/>
+                                                    <rect key="frame" x="372" y="77" width="89" height="24"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="15"/>
                                                     <nil key="textColor"/>
                                                     <nil key="highlightedColor"/>
@@ -2271,7 +2270,7 @@ Stock</string>
                                                     </userDefinedRuntimeAttributes>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Available" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="51Y-wy-2ET" userLabel="item label">
-                                                    <rect key="frame" x="639" y="80" width="89" height="24"/>
+                                                    <rect key="frame" x="639" y="77" width="89" height="24"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="15"/>
                                                     <nil key="textColor"/>
                                                     <nil key="highlightedColor"/>
@@ -2286,7 +2285,7 @@ Stock</string>
                                                     </userDefinedRuntimeAttributes>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" verticalHuggingPriority="251" text="CuFT" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="rL8-9w-zqg" userLabel="item label">
-                                                    <rect key="frame" x="16" y="80" width="89" height="24"/>
+                                                    <rect key="frame" x="16" y="77" width="89" height="24"/>
                                                     <constraints>
                                                         <constraint firstAttribute="height" constant="24" id="u6k-Gf-9GP"/>
                                                     </constraints>
@@ -2304,7 +2303,7 @@ Stock</string>
                                                     </userDefinedRuntimeAttributes>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="123.45" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="P0q-Yt-GXv" userLabel="item label">
-                                                    <rect key="frame" x="16" y="104" width="89" height="24"/>
+                                                    <rect key="frame" x="16" y="101" width="89" height="24"/>
                                                     <constraints>
                                                         <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="24" id="U5h-gl-ZBK"/>
                                                         <constraint firstAttribute="height" constant="24" id="bil-dH-OnK"/>
@@ -2323,7 +2322,7 @@ Stock</string>
                                                     </userDefinedRuntimeAttributes>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="ABCD" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qLh-8g-4bz" userLabel="item label">
-                                                    <rect key="frame" x="105" y="104" width="89" height="24"/>
+                                                    <rect key="frame" x="105" y="101" width="89" height="24"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="15"/>
                                                     <nil key="textColor"/>
                                                     <nil key="highlightedColor"/>
@@ -2338,7 +2337,7 @@ Stock</string>
                                                     </userDefinedRuntimeAttributes>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="ABCD" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="TEW-3R-q3j" userLabel="item label">
-                                                    <rect key="frame" x="194" y="104" width="89" height="24"/>
+                                                    <rect key="frame" x="194" y="101" width="89" height="24"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="15"/>
                                                     <nil key="textColor"/>
                                                     <nil key="highlightedColor"/>
@@ -2353,7 +2352,7 @@ Stock</string>
                                                     </userDefinedRuntimeAttributes>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="123.45" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dPf-p7-b3A" userLabel="item label">
-                                                    <rect key="frame" x="283" y="104" width="89" height="24"/>
+                                                    <rect key="frame" x="283" y="101" width="89" height="24"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="15"/>
                                                     <nil key="textColor"/>
                                                     <nil key="highlightedColor"/>
@@ -2368,7 +2367,7 @@ Stock</string>
                                                     </userDefinedRuntimeAttributes>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="234.56" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dvh-cr-GdM" userLabel="item label">
-                                                    <rect key="frame" x="372" y="104" width="89" height="24"/>
+                                                    <rect key="frame" x="372" y="101" width="89" height="24"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="15"/>
                                                     <nil key="textColor"/>
                                                     <nil key="highlightedColor"/>
@@ -2383,7 +2382,7 @@ Stock</string>
                                                     </userDefinedRuntimeAttributes>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="234.56" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Fgw-LJ-KR5" userLabel="item label">
-                                                    <rect key="frame" x="461" y="104" width="89" height="24"/>
+                                                    <rect key="frame" x="461" y="101" width="89" height="24"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="15"/>
                                                     <nil key="textColor"/>
                                                     <nil key="highlightedColor"/>
@@ -2398,7 +2397,7 @@ Stock</string>
                                                     </userDefinedRuntimeAttributes>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Now" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="W0g-JU-H8J" userLabel="item label">
-                                                    <rect key="frame" x="639" y="104" width="89" height="24"/>
+                                                    <rect key="frame" x="639" y="101" width="89" height="24"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="15"/>
                                                     <nil key="textColor"/>
                                                     <nil key="highlightedColor"/>
@@ -2413,7 +2412,7 @@ Stock</string>
                                                     </userDefinedRuntimeAttributes>
                                                 </label>
                                                 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="LEh-OL-gzO">
-                                                    <rect key="frame" x="620.5" y="3" width="108.5" height="41"/>
+                                                    <rect key="frame" x="619.5" y="6.5" width="108.5" height="34.5"/>
                                                     <state key="normal" title="Button"/>
                                                     <buttonConfiguration key="configuration" style="plain" title="Add to cart"/>
                                                     <connections>
@@ -2421,7 +2420,7 @@ Stock</string>
                                                     </connections>
                                                 </button>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="234.56" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ua7-Qu-TE2" userLabel="item label">
-                                                    <rect key="frame" x="550" y="104" width="89" height="24"/>
+                                                    <rect key="frame" x="550" y="101" width="89" height="24"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="15"/>
                                                     <nil key="textColor"/>
                                                     <nil key="highlightedColor"/>
@@ -2443,13 +2442,12 @@ Stock</string>
                                                 </label>
                                             </subviews>
                                             <constraints>
+                                                <constraint firstItem="rL8-9w-zqg" firstAttribute="leading" secondItem="ToU-Mo-Rx3" secondAttribute="leading" id="0Eg-8G-CwM"/>
                                                 <constraint firstItem="dvh-cr-GdM" firstAttribute="top" secondItem="P0q-Yt-GXv" secondAttribute="top" id="0Y4-ez-Yv5"/>
                                                 <constraint firstItem="Raa-F8-Tim" firstAttribute="leading" secondItem="rL8-9w-zqg" secondAttribute="trailing" id="0yz-qa-W3N"/>
                                                 <constraint firstItem="6Or-u7-4VU" firstAttribute="height" secondItem="rL8-9w-zqg" secondAttribute="height" id="2j5-xK-hTt"/>
                                                 <constraint firstItem="51Y-wy-2ET" firstAttribute="height" secondItem="rL8-9w-zqg" secondAttribute="height" id="47y-9B-Agq"/>
-                                                <constraint firstAttribute="trailing" secondItem="51Y-wy-2ET" secondAttribute="trailing" constant="16" id="4ue-jy-ex5"/>
                                                 <constraint firstItem="dPf-p7-b3A" firstAttribute="top" secondItem="P0q-Yt-GXv" secondAttribute="top" id="56B-OM-0Va"/>
-                                                <constraint firstAttribute="trailing" secondItem="H92-P3-tCf" secondAttribute="trailing" constant="16" id="7JM-do-2Ot"/>
                                                 <constraint firstItem="dPf-p7-b3A" firstAttribute="leading" secondItem="TEW-3R-q3j" secondAttribute="trailing" id="83R-5x-6dD"/>
                                                 <constraint firstItem="MB0-nt-BnH" firstAttribute="leading" secondItem="6Or-u7-4VU" secondAttribute="trailing" id="8gj-lP-RRH"/>
                                                 <constraint firstItem="Ua7-Qu-TE2" firstAttribute="width" secondItem="P0q-Yt-GXv" secondAttribute="width" id="A9e-Ig-BKf"/>
@@ -2460,11 +2458,11 @@ Stock</string>
                                                 <constraint firstItem="CZn-lW-zFb" firstAttribute="centerY" secondItem="rL8-9w-zqg" secondAttribute="centerY" id="DGn-BE-YVL"/>
                                                 <constraint firstItem="8er-u1-DZo" firstAttribute="leading" secondItem="uDf-2P-7UC" secondAttribute="trailing" constant="10" id="DUP-Tp-IQ3"/>
                                                 <constraint firstItem="56k-bL-ui2" firstAttribute="top" secondItem="H92-P3-tCf" secondAttribute="bottom" constant="10" id="DZi-NE-yda"/>
-                                                <constraint firstAttribute="trailing" secondItem="LEh-OL-gzO" secondAttribute="trailing" constant="15" id="DqL-Np-Nm4"/>
                                                 <constraint firstItem="Raa-F8-Tim" firstAttribute="centerY" secondItem="rL8-9w-zqg" secondAttribute="centerY" id="Dvz-DX-hzb"/>
                                                 <constraint firstItem="TEW-3R-q3j" firstAttribute="leading" secondItem="qLh-8g-4bz" secondAttribute="trailing" id="E6P-UU-Gab"/>
                                                 <constraint firstItem="6Or-u7-4VU" firstAttribute="leading" secondItem="56k-bL-ui2" secondAttribute="trailing" id="F3e-Ny-CuS"/>
                                                 <constraint firstItem="51Y-wy-2ET" firstAttribute="centerY" secondItem="rL8-9w-zqg" secondAttribute="centerY" id="FIH-2I-Es7"/>
+                                                <constraint firstAttribute="trailing" secondItem="LEh-OL-gzO" secondAttribute="trailing" constant="16" id="HfR-Cw-wP1"/>
                                                 <constraint firstItem="TEW-3R-q3j" firstAttribute="top" secondItem="P0q-Yt-GXv" secondAttribute="top" id="IDk-xT-nod"/>
                                                 <constraint firstItem="8er-u1-DZo" firstAttribute="centerY" secondItem="uDf-2P-7UC" secondAttribute="centerY" id="ILO-GO-v2L"/>
                                                 <constraint firstItem="Ua7-Qu-TE2" firstAttribute="height" secondItem="P0q-Yt-GXv" secondAttribute="height" id="JUq-4I-DCn"/>
@@ -2473,7 +2471,6 @@ Stock</string>
                                                 <constraint firstItem="CZn-lW-zFb" firstAttribute="width" secondItem="rL8-9w-zqg" secondAttribute="width" id="KHX-G1-Xk9"/>
                                                 <constraint firstItem="dvh-cr-GdM" firstAttribute="height" secondItem="P0q-Yt-GXv" secondAttribute="height" id="MXn-o5-K99"/>
                                                 <constraint firstItem="qLh-8g-4bz" firstAttribute="width" secondItem="P0q-Yt-GXv" secondAttribute="width" id="NDd-0W-VwO"/>
-                                                <constraint firstItem="ToU-Mo-Rx3" firstAttribute="top" secondItem="h6v-P5-Y6J" secondAttribute="top" constant="13" id="NJC-A5-N3y"/>
                                                 <constraint firstItem="CXZ-rU-fI4" firstAttribute="centerY" secondItem="ToU-Mo-Rx3" secondAttribute="centerY" id="P1J-ap-Uu3"/>
                                                 <constraint firstItem="Ua7-Qu-TE2" firstAttribute="leading" secondItem="Fgw-LJ-KR5" secondAttribute="trailing" id="Qqx-oE-AZR"/>
                                                 <constraint firstItem="MB0-nt-BnH" firstAttribute="width" secondItem="rL8-9w-zqg" secondAttribute="width" id="RPU-Cm-wgK"/>
@@ -2490,39 +2487,44 @@ Stock</string>
                                                 <constraint firstItem="TEW-3R-q3j" firstAttribute="height" secondItem="P0q-Yt-GXv" secondAttribute="height" id="YqC-Dt-t0c"/>
                                                 <constraint firstItem="Raa-F8-Tim" firstAttribute="width" secondItem="rL8-9w-zqg" secondAttribute="width" id="YuQ-r3-y0u"/>
                                                 <constraint firstItem="qLh-8g-4bz" firstAttribute="top" secondItem="P0q-Yt-GXv" secondAttribute="top" id="Z3D-B5-faG"/>
-                                                <constraint firstItem="rL8-9w-zqg" firstAttribute="leading" secondItem="h6v-P5-Y6J" secondAttribute="leading" constant="16" id="ZL7-PI-RsM"/>
                                                 <constraint firstItem="W0g-JU-H8J" firstAttribute="width" secondItem="P0q-Yt-GXv" secondAttribute="width" id="a7h-hW-sLh"/>
                                                 <constraint firstItem="6Or-u7-4VU" firstAttribute="width" secondItem="rL8-9w-zqg" secondAttribute="width" id="aCz-bM-56r"/>
+                                                <constraint firstItem="ToU-Mo-Rx3" firstAttribute="top" secondItem="h6v-P5-Y6J" secondAttribute="top" constant="13" id="b8M-cn-QtL"/>
                                                 <constraint firstItem="Raa-F8-Tim" firstAttribute="height" secondItem="rL8-9w-zqg" secondAttribute="height" id="bjP-Lj-nA6"/>
                                                 <constraint firstItem="CZn-lW-zFb" firstAttribute="leading" secondItem="MB0-nt-BnH" secondAttribute="trailing" id="bkn-ff-dNy"/>
                                                 <constraint firstItem="qux-TP-f6L" firstAttribute="top" secondItem="uDf-2P-7UC" secondAttribute="bottom" constant="14.5" id="c1u-3u-kam"/>
                                                 <constraint firstItem="Ua7-Qu-TE2" firstAttribute="top" secondItem="P0q-Yt-GXv" secondAttribute="top" id="cF0-l1-1TG"/>
-                                                <constraint firstAttribute="trailing" secondItem="8er-u1-DZo" secondAttribute="trailing" constant="16" id="dJE-Tq-Zeb"/>
                                                 <constraint firstItem="6Or-u7-4VU" firstAttribute="centerY" secondItem="rL8-9w-zqg" secondAttribute="centerY" id="eRm-dB-In8"/>
                                                 <constraint firstItem="H92-P3-tCf" firstAttribute="top" secondItem="LEh-OL-gzO" secondAttribute="bottom" constant="5" id="euM-1a-bUh"/>
                                                 <constraint firstItem="Fgw-LJ-KR5" firstAttribute="height" secondItem="P0q-Yt-GXv" secondAttribute="height" id="fb2-hx-RoW"/>
                                                 <constraint firstItem="dPf-p7-b3A" firstAttribute="width" secondItem="P0q-Yt-GXv" secondAttribute="width" id="gko-un-oWF"/>
                                                 <constraint firstItem="H92-P3-tCf" firstAttribute="leading" secondItem="ToU-Mo-Rx3" secondAttribute="leading" id="hSy-MA-lRZ"/>
-                                                <constraint firstItem="ToU-Mo-Rx3" firstAttribute="leading" secondItem="h6v-P5-Y6J" secondAttribute="leadingMargin" id="iAJ-hd-n0J"/>
                                                 <constraint firstItem="dPf-p7-b3A" firstAttribute="height" secondItem="P0q-Yt-GXv" secondAttribute="height" id="iJg-7n-INN"/>
                                                 <constraint firstItem="56k-bL-ui2" firstAttribute="leading" secondItem="Raa-F8-Tim" secondAttribute="trailing" id="ikf-1J-Hsd"/>
+                                                <constraint firstItem="ToU-Mo-Rx3" firstAttribute="leading" secondItem="h6v-P5-Y6J" secondAttribute="leading" constant="16" id="kXQ-AV-Tkp"/>
                                                 <constraint firstItem="Fgw-LJ-KR5" firstAttribute="width" secondItem="P0q-Yt-GXv" secondAttribute="width" id="lxe-GL-98Z"/>
                                                 <constraint firstItem="qux-TP-f6L" firstAttribute="height" secondItem="rL8-9w-zqg" secondAttribute="height" id="nDc-Jf-TfN"/>
                                                 <constraint firstItem="51Y-wy-2ET" firstAttribute="width" secondItem="P0q-Yt-GXv" secondAttribute="width" id="qTj-rg-CyA"/>
                                                 <constraint firstItem="56k-bL-ui2" firstAttribute="centerY" secondItem="rL8-9w-zqg" secondAttribute="centerY" id="qXl-33-iOh"/>
                                                 <constraint firstItem="dvh-cr-GdM" firstAttribute="leading" secondItem="dPf-p7-b3A" secondAttribute="trailing" id="rWo-Lx-ZIP"/>
-                                                <constraint firstItem="ToU-Mo-Rx3" firstAttribute="leading" secondItem="h6v-P5-Y6J" secondAttribute="leading" constant="16" id="rol-TC-lUD"/>
                                                 <constraint firstItem="W0g-JU-H8J" firstAttribute="trailing" secondItem="51Y-wy-2ET" secondAttribute="trailing" id="syA-Ob-zLC"/>
                                                 <constraint firstItem="LEh-OL-gzO" firstAttribute="centerY" secondItem="ToU-Mo-Rx3" secondAttribute="centerY" id="uXH-JK-tUT"/>
                                                 <constraint firstItem="TEW-3R-q3j" firstAttribute="width" secondItem="P0q-Yt-GXv" secondAttribute="width" id="v1T-1w-70V"/>
                                                 <constraint firstItem="dvh-cr-GdM" firstAttribute="width" secondItem="P0q-Yt-GXv" secondAttribute="width" id="vpT-yK-eRT"/>
+                                                <constraint firstItem="LEh-OL-gzO" firstAttribute="trailing" secondItem="51Y-wy-2ET" secondAttribute="trailing" id="vtC-RL-aNd"/>
+                                                <constraint firstItem="LEh-OL-gzO" firstAttribute="trailing" secondItem="8er-u1-DZo" secondAttribute="trailing" id="vub-bS-lEy"/>
                                                 <constraint firstItem="qux-TP-f6L" firstAttribute="leading" secondItem="CZn-lW-zFb" secondAttribute="trailing" id="vxv-vd-l8B"/>
                                                 <constraint firstItem="W0g-JU-H8J" firstAttribute="leading" secondItem="Ua7-Qu-TE2" secondAttribute="trailing" id="wBR-3N-ZGg"/>
                                                 <constraint firstItem="51Y-wy-2ET" firstAttribute="leading" secondItem="qux-TP-f6L" secondAttribute="trailing" id="wO5-4P-9i6"/>
                                                 <constraint firstItem="CXZ-rU-fI4" firstAttribute="leading" secondItem="ToU-Mo-Rx3" secondAttribute="trailing" constant="10" id="xBH-HB-4VK"/>
-                                                <constraint firstAttribute="bottom" secondItem="P0q-Yt-GXv" secondAttribute="bottom" constant="8" id="yaZ-5a-iUt"/>
                                             </constraints>
                                         </tableViewCellContentView>
+                                        <constraints>
+                                            <constraint firstItem="h6v-P5-Y6J" firstAttribute="leading" secondItem="RBD-TT-DqV" secondAttribute="leading" id="7nR-WY-aaD"/>
+                                            <constraint firstItem="h6v-P5-Y6J" firstAttribute="top" secondItem="RBD-TT-DqV" secondAttribute="top" id="MBy-89-eGL"/>
+                                            <constraint firstAttribute="trailing" secondItem="h6v-P5-Y6J" secondAttribute="trailing" id="ZqG-Al-qyp"/>
+                                            <constraint firstAttribute="bottom" secondItem="h6v-P5-Y6J" secondAttribute="bottom" id="kxl-8Q-8FR"/>
+                                        </constraints>
                                         <connections>
                                             <outlet property="labelAvailable" destination="W0g-JU-H8J" id="Wyr-yH-k7y"/>
                                             <outlet property="labelCuft" destination="P0q-Yt-GXv" id="91a-pC-ldO"/>

+ 53 - 35
RedAnt ERP Mobile/HMLG Scan Order/ScanListCell.m

@@ -158,12 +158,12 @@
     self.labelPrice1.text = price_group[@"price_1"][@"display"];//appDelegate.price1_name;
     self.labelPrice2.text = price_group[@"price_2"][@"display"];//appDelegate.price2_name;
     self.labelPrice3.text = price_group[@"price_3"][@"display"];//appDelegate.price3_name;
-
-    if(price_group[@"price_4"])
-    {
-        self.labelPrice3.text = price_group[@"price_4"][@"display"];
-    }
-    
+    //    remove net price
+//    if(price_group[@"price_4"])
+//    {
+//        self.labelPrice3.text = price_group[@"price_4"][@"display"];
+//    }
+//
     
     
     NSLog( [RAConvertor dict2string:modelJson]);
@@ -210,6 +210,8 @@
     {
 //        if(RASingleton.sharedInstance.price_type==1)
             _modelJson [@"net_price"] = @true;
+        // remove net price
+        _modelJson [@"net_price"] = @false;
     }
     
     
@@ -239,6 +241,8 @@
 //    _labelPrice25p.text=price2;
     
     
+    
+    
     if([_modelJson [@"special_price"] boolValue])
     {
         if([_modelJson[price_group[@"price_2"][@"name"]] isEqualToString:@"N/A"])
@@ -251,48 +255,62 @@
         _labelPriceSpecial.text=@"";//@"N/A";
     }
     
-    
-    if([_modelJson [@"net_price"] boolValue])
-    {
-//        if([_modelJson[@"price1"] isEqualToString:@"N/A"])
+    // remove net price
+//    if([_modelJson [@"net_price"] boolValue])
+//    {
+////        if([_modelJson[@"price1"] isEqualToString:@"N/A"])
+////        {
+////            _labelPriceNet.text=_modelJson[@"price1"];
+//////            _labelPriceNCA.text=@"N/A";
+////        }
+////        else
+////        {
+////            _labelPriceNet.text=[RAConvertor currencyNumber:[_modelJson[@"price1"] floatValue]];
+//////            _labelPriceNCA.text=@"N/A";
+////        }
+//
+//        if([_modelJson[price_group[@"price_3"][@"name"]] isEqualToString:@"N/A"])
 //        {
-//            _labelPriceNet.text=_modelJson[@"price1"];
+//            _labelPriceNet.text=@"";//_modelJson[@"price3"];
 ////            _labelPriceNCA.text=@"N/A";
 //        }
 //        else
 //        {
-//            _labelPriceNet.text=[RAConvertor currencyNumber:[_modelJson[@"price1"] floatValue]];
+//            _labelPriceNet.text=[RAConvertor currencyNumber:[_modelJson[price_group[@"price_3"][@"name"]] floatValue]];
 ////            _labelPriceNCA.text=@"N/A";
 //        }
-        
-        if([_modelJson[price_group[@"price_3"][@"name"]] isEqualToString:@"N/A"])
-        {
-            _labelPriceNet.text=@"";//_modelJson[@"price3"];
-//            _labelPriceNCA.text=@"N/A";
-        }
-        else
-        {
-            _labelPriceNet.text=[RAConvertor currencyNumber:[_modelJson[price_group[@"price_3"][@"name"]] floatValue]];
+//
+//    }
+//    else
+//    {
+//        _labelPriceNet.text=@"";//@"N/A";
+//    }
+   
+    
+    
+    if([_modelJson[price_group[@"price_3"][@"name"]] isEqualToString:@"N/A"])
+    {
+        _labelPriceNet.text=@"";//_modelJson[@"price3"];
 //            _labelPriceNCA.text=@"N/A";
-        }
-        
     }
     else
     {
-        _labelPriceNet.text=@"";//@"N/A";
+        _labelPriceNet.text=[RAConvertor currencyNumber:[_modelJson[price_group[@"price_3"][@"name"]] floatValue]];
+//            _labelPriceNCA.text=@"N/A";
     }
     
-    if(price_group[@"price_4"])
-    {
-        // price4 如果存在,会显示在price3的位置
-        NSString* price4=_modelJson[price_group[@"price_4"][@"name"]]; //%25
-        
-        if(![price4 isEqualToString: @"N/A"])
-            price4 = [NSString stringWithFormat:@"%.2f",[_modelJson[price_group[@"price_4"][@"name"]] doubleValue]];
-        else
-            price4 =@"";
-        _labelPriceNet.text=price4;
-    }
+    //    remove net price
+//    if(price_group[@"price_4"])
+//    {
+//        // price4 如果存在,会显示在price3的位置
+//        NSString* price4=_modelJson[price_group[@"price_4"][@"name"]]; //%25
+//
+//        if(![price4 isEqualToString: @"N/A"])
+//            price4 = [NSString stringWithFormat:@"%.2f",[_modelJson[price_group[@"price_4"][@"name"]] doubleValue]];
+//        else
+//            price4 =@"";
+//        _labelPriceNet.text=price4;
+//    }
     
     {
         if([_modelJson[price_group[@"price_1"][@"name"]] isEqualToString:@"N/A"])

+ 49 - 35
RedAnt ERP Mobile/HMLG Scan Order/ScanModelListCell.m

@@ -44,11 +44,11 @@
     self.labelPrice2.text = price_group[@"price_2"][@"display"];//appDelegate.price2_name;
     self.labelPrice3.text = price_group[@"price_3"][@"display"];//appDelegate.price3_name;
     
-    
-    if(price_group[@"price_4"])
-    {
-        self.labelPrice3.text = price_group[@"price_4"][@"display"];
-    }
+    //    remove net price
+//    if(price_group[@"price_4"])
+//    {
+//        self.labelPrice3.text = price_group[@"price_4"][@"display"];
+//    }
     
     _modelJson = modelJson;
 
@@ -116,6 +116,9 @@
     {
 //        if(RASingleton.sharedInstance.price_type==1)
             _modelJson [@"net_price"] = @true;
+        
+        // remove net price
+        _modelJson [@"net_price"] = @false;
     }
     
     
@@ -142,49 +145,60 @@
         _labelPriceSpecial.text=@"";//@"N/A";
     }
     
-    
-    if([_modelJson [@"net_price"] boolValue])
-    {
-//        if([_modelJson[@"price1"] isEqualToString:@"N/A"])
+    // remove net price
+//    if([_modelJson [@"net_price"] boolValue])
+//    {
+////        if([_modelJson[@"price1"] isEqualToString:@"N/A"])
+////        {
+////            _labelPriceNet.text=_modelJson[@"price1"];
+//////            _labelPriceNCA.text=@"N/A";
+////        }
+////        else
+////        {
+////            _labelPriceNet.text=[RAConvertor currencyNumber:[_modelJson[@"price1"] floatValue]];
+//////            _labelPriceNCA.text=@"N/A";
+////        }
+//
+//        if([_modelJson[price_group[@"price_3"][@"name"]] isEqualToString:@"N/A"])
 //        {
-//            _labelPriceNet.text=_modelJson[@"price1"];
+//            _labelPriceNet.text=@"";//_modelJson[@"price3"];
 ////            _labelPriceNCA.text=@"N/A";
 //        }
 //        else
 //        {
-//            _labelPriceNet.text=[RAConvertor currencyNumber:[_modelJson[@"price1"] floatValue]];
+//            _labelPriceNet.text=[RAConvertor currencyNumber:[_modelJson[price_group[@"price_3"][@"name"]] floatValue]];
 ////            _labelPriceNCA.text=@"N/A";
 //        }
-        
-        if([_modelJson[price_group[@"price_3"][@"name"]] isEqualToString:@"N/A"])
-        {
-            _labelPriceNet.text=@"";//_modelJson[@"price3"];
-//            _labelPriceNCA.text=@"N/A";
-        }
-        else
-        {
-            _labelPriceNet.text=[RAConvertor currencyNumber:[_modelJson[price_group[@"price_3"][@"name"]] floatValue]];
+//
+//    }
+//    else
+//    {
+//        _labelPriceNet.text=@"";//@"N/A";
+//    }
+    
+    if([_modelJson[price_group[@"price_3"][@"name"]] isEqualToString:@"N/A"])
+    {
+        _labelPriceNet.text=@"";//_modelJson[@"price3"];
 //            _labelPriceNCA.text=@"N/A";
-        }
-        
     }
     else
     {
-        _labelPriceNet.text=@"";//@"N/A";
+        _labelPriceNet.text=[RAConvertor currencyNumber:[_modelJson[price_group[@"price_3"][@"name"]] floatValue]];
+//            _labelPriceNCA.text=@"N/A";
     }
         
-    
-    if(price_group[@"price_4"])
-    {
-        // price4 如果存在,会显示在price3的位置
-        NSString* price4=_modelJson[price_group[@"price_4"][@"name"]]; //%25
-        
-        if(![price4 isEqualToString: @"N/A"])
-            price4 = [NSString stringWithFormat:@"%.2f",[_modelJson[price_group[@"price_4"][@"name"]] doubleValue]];
-        else
-            price4 =@"";
-        _labelPriceNet.text=price4;
-    }
+//    remove net price
+//    if(price_group[@"price_4"])
+//    {
+//        // price4 如果存在,会显示在price3的位置
+//        NSString* price4=_modelJson[price_group[@"price_4"][@"name"]]; //%25
+//
+//        if(![price4 isEqualToString: @"N/A"])
+//            price4 = [NSString stringWithFormat:@"%.2f",[_modelJson[price_group[@"price_4"][@"name"]] doubleValue]];
+//        else
+//            price4 =@"";
+//        _labelPriceNet.text=price4;
+//    }
 
 //    {
 //        if([_modelJson[@"price1"] isEqualToString:@"N/A"])

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

@@ -118,6 +118,8 @@
         if(![jitem [@"special_price"] boolValue]&& ![price1 isEqualToString: @"N/A"] && [price1 isEqual:price3])
         {
             jitem [@"net_price"] = @true;
+            // remove net price
+            jitem [@"net_price"] = @false;
         }
         
         

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

@@ -17,7 +17,7 @@
 #define RA_NOTIFICATION
 
 # ifdef DEBUG
-#define test_server
+//#define test_server
 # endif
 
 #define exception_switch 1

+ 1 - 1
RedAnt ERP Mobile/common/ActiveViewController.m

@@ -108,7 +108,7 @@
 //}
 -(void)viewDidAppear:(BOOL)animated
 {
-    [super viewWillAppear:animated];
+    [super viewDidAppear:animated];
 #ifdef RA_NOTIFICATION
     UIApplication * app = [UIApplication sharedApplication];
     AppDelegate *appDelegate = (AppDelegate *)[app delegate];

+ 5 - 4
RedAnt ERP Mobile/common/AppDelegateBase.m

@@ -119,6 +119,7 @@
 
 - (void)setUser:(NSString *)user {
     _user = user;
+    RASingleton.sharedInstance.user = user;
     [RASingleton.sharedInstance setGlobalParameter:_user forKey:@"user"];
 }
 - (void)setUser_type:(long)user_type
@@ -2679,7 +2680,7 @@ void UncaughtExceptionHandler(NSException *exception) {
                     if (sqlite3_exec(tdb, "begin", NULL, NULL, &errmsg)==SQLITE_OK)
                     {
                         
-                        sqlite3_exec(tdb, "drop trigger if exists wishlist_insert;drop trigger if exists wishlist_update;drop trigger if exists wishlist_delete;drop trigger if exists offline_portfolio_insert;drop trigger if exists offline_portfolio_update;drop trigger if exists offline_portfolio_delete;drop trigger if exists offline_pdf_insert;drop trigger if exists offline_pdf_update;drop trigger if exists offline_pdf_delete;offline_pdf;", NULL, NULL, &errmsg);
+                        sqlite3_exec(tdb, "drop trigger if exists wishlist_insert;drop trigger if exists wishlist_update;drop trigger if exists wishlist_delete;drop trigger if exists offline_portfolio_insert;drop trigger if exists offline_portfolio_update;drop trigger if exists offline_portfolio_delete;drop trigger if exists offline_pdf_insert;drop trigger if exists offline_pdf_update;drop trigger if exists offline_pdf_delete;drop trigger if exists offline_pdf;", NULL, NULL, &errmsg);
                         
                         sqlite3_free(errmsg);
                         DebugLog(@"开启事务");
@@ -2962,9 +2963,9 @@ void UncaughtExceptionHandler(NSException *exception) {
 #endif
     
     
-#ifdef OFFLINE_ORDER
-    
-#endif
+//#ifdef OFFLINE_ORDER
+//
+//#endif
     
     
     self.window.backgroundColor = [UIColor whiteColor];

+ 9 - 4
RedAnt ERP Mobile/common/CartUtils.m

@@ -182,6 +182,7 @@
                             if(appDelegate.customerInfo==nil)// select contact if current contact not exist
                             {
                                 ContactListViewController* cvc = [[UIStoryboard storyboardWithName:@"ERP_Mobile_Contact" bundle:nil] instantiateViewControllerWithIdentifier:@"ContactListViewController" ];
+                                __weak typeof(cvc) weakcvc = cvc;
                                 cvc.showNavibar = true;
                                 cvc.contact_type = @"Sales_Order_Customer";
                                 cvc.returnValue = ^(NSMutableDictionary* value,NSIndexPath* source){
@@ -191,7 +192,7 @@
 
 
                                     if(appDelegate.order_code==nil)
-                                        [self neworder:vc selectorholder:holder selector:addtocart];
+                                        [self neworder:weakcvc selectorholder:holder selector:addtocart];
                                     //                                                            neworder();
 
                                     //    [main_vc checklogin:true];
@@ -339,6 +340,8 @@
                         if(appDelegate.customerInfo==nil)// select contact if current contact not exist
                         {
                             ContactListViewController* cvc = [[UIStoryboard storyboardWithName:@"ERP_Mobile_Contact" bundle:nil] instantiateViewControllerWithIdentifier:@"ContactListViewController" ];
+                            
+                            __weak typeof(cvc) weakcvc = cvc;
                             cvc.showNavibar = true;
                             cvc.contact_type = @"Sales_Order_Customer";
                             cvc.returnValue = ^(NSMutableDictionary* value,NSIndexPath* source){
@@ -348,7 +351,7 @@
 
 
                                 if(appDelegate.order_code==nil)
-                                    [self neworder:vc selectorholder:holder selector:addtocart];
+                                    [self neworder:weakcvc selectorholder:holder selector:addtocart];
                                 //                                                            neworder();
 
                                 //    [main_vc checklogin:true];
@@ -475,6 +478,7 @@
                                             if(appDelegate.customerInfo==nil)// select contact if current contact not exist
                                             {
                                                 ContactListViewController* cvc = [[UIStoryboard storyboardWithName:@"ERP_Mobile_Contact" bundle:nil] instantiateViewControllerWithIdentifier:@"ContactListViewController" ];
+                                                __weak typeof(cvc) weakcvc = cvc;
                                                 cvc.showNavibar = true;
                                                 cvc.contact_type = @"Sales_Order_Customer";
                                                 cvc.returnValue = ^(NSMutableDictionary* value,NSIndexPath* source){
@@ -484,7 +488,7 @@
                                                     
                                                     
                                                     if(appDelegate.order_code==nil)
-                                                        [self neworder:vc selectorholder:holder selector:addtocart];
+                                                        [self neworder:weakcvc selectorholder:holder selector:addtocart];
                                                     //                                                            neworder();
                                                     
                                                     //    [main_vc checklogin:true];
@@ -633,6 +637,7 @@
                                                 if(appDelegate.customerInfo==nil)// select contact if current contact not exist
                                                 {
                                                     ContactListViewController* cvc = [[UIStoryboard storyboardWithName:@"ERP_Mobile_Contact" bundle:nil] instantiateViewControllerWithIdentifier:@"ContactListViewController" ];
+                                                    __weak typeof(cvc) weakcvc = cvc;
                                                     cvc.showNavibar = true;
                                                     cvc.contact_type = @"Sales_Order_Customer";
                                                     cvc.returnValue = ^(NSMutableDictionary* value,NSIndexPath* source){
@@ -642,7 +647,7 @@
                                                         
                                                         
                                                         if(appDelegate.order_code==nil)
-                                                            [self neworder:vc selectorholder:holder selector:addtocart];
+                                                            [self neworder:weakcvc selectorholder:holder selector:addtocart];
                                                         //                                                            neworder();
                                                         
                                                         //    [main_vc checklogin:true];

+ 10 - 10
RedAnt ERP Mobile/common/ERP_Mobile_Cart.storyboard

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21225" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
     <device id="ipad7_9" orientation="portrait" layout="fullscreen" appearance="light"/>
     <dependencies>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21207"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="System colors in document resources" minToolsVersion="11.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
@@ -29,7 +29,7 @@
                                         <color key="sectionIndexBackgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                         <prototypes>
                                             <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="ContrastCartItemCell" rowHeight="146" id="9d9-Fh-IGR" customClass="ContrastModelItemCell">
-                                                <rect key="frame" x="0.0" y="50" width="744" height="146"/>
+                                                <rect key="frame" x="0.0" y="44.5" width="744" height="146"/>
                                                 <autoresizingMask key="autoresizingMask"/>
                                                 <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="9d9-Fh-IGR" id="NLP-mv-Q7E">
                                                     <rect key="frame" x="0.0" y="0.0" width="744" height="146"/>
@@ -223,7 +223,7 @@ Stock</string>
                                                 </connections>
                                             </tableViewCell>
                                             <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="CartItemCell" rowHeight="146" id="IPG-eZ-Ldx" customClass="ModelItemCell">
-                                                <rect key="frame" x="0.0" y="196" width="744" height="146"/>
+                                                <rect key="frame" x="0.0" y="190.5" width="744" height="146"/>
                                                 <autoresizingMask key="autoresizingMask"/>
                                                 <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="IPG-eZ-Ldx" id="aV7-ct-m80">
                                                     <rect key="frame" x="0.0" y="0.0" width="744" height="146"/>
@@ -440,7 +440,7 @@ Stock</string>
                                                 </connections>
                                             </tableViewCell>
                                             <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" restorationIdentifier="ScanCartItemCell" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="ScanCartItemCell" rowHeight="120" id="fca-Fb-rTa" customClass="ScanCartItemCell">
-                                                <rect key="frame" x="0.0" y="342" width="744" height="120"/>
+                                                <rect key="frame" x="0.0" y="336.5" width="744" height="120"/>
                                                 <autoresizingMask key="autoresizingMask"/>
                                                 <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="fca-Fb-rTa" id="efk-9P-2wE">
                                                     <rect key="frame" x="0.0" y="0.0" width="744" height="120"/>
@@ -520,7 +520,7 @@ Stock</string>
                                                             <nil key="highlightedColor"/>
                                                         </label>
                                                         <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Kns-xs-xWh">
-                                                            <rect key="frame" x="425" y="74.5" width="169" height="34.5"/>
+                                                            <rect key="frame" x="425" y="78" width="169" height="31"/>
                                                             <state key="normal" title="Button"/>
                                                             <buttonConfiguration key="configuration" style="plain" title="Discount"/>
                                                             <connections>
@@ -565,7 +565,7 @@ Stock</string>
                                                 </connections>
                                             </tableViewCell>
                                             <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="section_header_cell" rowHeight="50" id="XyA-7C-sJn">
-                                                <rect key="frame" x="0.0" y="462" width="744" height="50"/>
+                                                <rect key="frame" x="0.0" y="456.5" width="744" height="50"/>
                                                 <autoresizingMask key="autoresizingMask"/>
                                                 <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="XyA-7C-sJn" translatesAutoresizingMaskIntoConstraints="NO" id="Ugp-AX-JtS">
                                                     <rect key="frame" x="0.0" y="0.0" width="744" height="50"/>
@@ -874,7 +874,7 @@ Stock</string>
                                         </connections>
                                     </button>
                                     <button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Q8b-hd-FFZ">
-                                        <rect key="frame" x="113" y="8" width="92" height="34.5"/>
+                                        <rect key="frame" x="123.5" y="9.5" width="81.5" height="31"/>
                                         <state key="normal" title="Button"/>
                                         <buttonConfiguration key="configuration" style="plain" title="Discount"/>
                                         <connections>
@@ -1274,7 +1274,7 @@ Stock</string>
                                 <nil key="highlightedColor"/>
                             </label>
                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Mp7-AD-fSK">
-                                <rect key="frame" x="313.5" y="235.5" width="76.5" height="34.5"/>
+                                <rect key="frame" x="321.5" y="239" width="68.5" height="31"/>
                                 <state key="normal" title="Button"/>
                                 <buttonConfiguration key="configuration" style="plain" title="Cancel"/>
                                 <connections>
@@ -1282,7 +1282,7 @@ Stock</string>
                                 </connections>
                             </button>
                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="6tg-ic-Sng">
-                                <rect key="frame" x="90" y="235.5" width="80" height="34.5"/>
+                                <rect key="frame" x="90" y="239" width="71.5" height="31"/>
                                 <state key="normal" title="Button"/>
                                 <buttonConfiguration key="configuration" style="plain" title="Update"/>
                                 <connections>

+ 2 - 1
RedAnt ERP Mobile/common/Functions/OLO/ScanOrderListViewController.m

@@ -43,6 +43,7 @@
 @property (strong, nonatomic) IBOutlet UISegmentedControl *orderTypeSegmentControl;
 @property (weak, nonatomic) IBOutlet NSLayoutConstraint *tableTopConstraint;
 
+
 @end
 
 @implementation ScanOrderListViewController
@@ -174,7 +175,7 @@
 }
 - (void)viewDidLoad {
     [super viewDidLoad];
-    self.edgesForExtendedLayout = UIRectEdgeNone;
+//    self.edgesForExtendedLayout = UIRectEdgeNone;
     
     self.loading_queue = dispatch_queue_create("orderlist_loading", NULL);
     

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

@@ -243,7 +243,7 @@
     {
 //        self.scan_val = @"[[\"1111\",\"name0\",\"description\",\"10.1 X 20.2 X 30.3\",\"2\",\"12.34\",\"VIET\",\"VCSF\",\"May\",\"123.45\",\"234.56\",\"123.45\",\"234.56\",\"123.45\",\"234.56\",\"123.45\",\"234.56\",\"123.45\",\"234.56\",\"123.45\",\"234.56\",\"123.45\",\"234.56\",\"123.45\",\"234.56\"],[\"2222\",\"name1\",\"description\",\"10.1 X 20.2 X 30.3\",\"2\",\"12.34\",\"VIET\",\"VCSF\",\"May\",\"123.45\",\"234.56\",\"123.45\",\"234.56\",\"123.45\",\"234.56\",\"123.45\",\"234.56\",\"123.45\",\"234.56\",\"123.45\",\"234.56\",\"123.45\",\"234.56\",\"123.45\",\"234.56\"]]";
         
-        self.scan_val =@"[\"1430K-1CK*\",\"1430K-1EK*\",\"5477N-40\",\"1002A70BK\"]";// @"[\"1002A70BK\"]";// 
+        self.scan_val =@"[\"normal\",\"normal+\",\"special\",\"special+\"]";// @"[\"1002A70BK\"]";// 
         [self addtocart];
     }
 

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

@@ -4151,8 +4151,8 @@
     
     if(/*appDelegate.user_type==USER_ROLE_CUSTOMER*/ true)
  {
-#ifdef IGNORE_MPACK
-        [cell init_Stepper:1 max:9999 min:1 value:count];
+#ifdef BUILD_CONTRAST
+        [cell init_Stepper:stockUom max:9999 min:1 value:count];
 #else
         [cell init_Stepper:stockUom max:9999 min:stockUom value:count];
 #endif

+ 4 - 2
RedAnt ERP Mobile/common/Functions/contact/ContactListViewController.m

@@ -58,7 +58,7 @@
     self.label_net_err.layer.borderWidth = 2.0;
     self.label_net_err.layer.cornerRadius=15;
     self.label_net_err.layer.masksToBounds=true;
-    self.edgesForExtendedLayout = UIRectEdgeNone;
+//    self.edgesForExtendedLayout = UIRectEdgeNone;
     
     
     UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(refresh_btn_click:)];
@@ -618,14 +618,16 @@
                     
                     data_init[@"is_subaction"]=self.is_subaction;
                     data_init[@"subaction_tag"]= self.subaction_tag;
-                    [self.navigationController popToRootViewControllerAnimated:false];
+                    
                     
                     
                     [self.table reloadData];
                     NSLog(@"%s reloadData",__FUNCTION__);
+                    [self.navigationController popToRootViewControllerAnimated:false];
                     if(self.returnValue)
                         self.returnValue(data_init,self.from);
                     
+                    
                     //                dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
                     //                    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
                     //                    NSDictionary* editor_json = [iSalesNetwork update_OrderCustomer:appDelegate.order_code customerinfo:data_init];

+ 18 - 8
RedAnt ERP Mobile/common/Functions/modelDetail/DetailViewController.m

@@ -141,8 +141,8 @@ dispatch_async(dispatch_get_main_queue(), ^{
             //          AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
             if(/*appDelegate.user_type==USER_ROLE_CUSTOMER*/true)
             {
-#ifdef IGNORE_MPACK
-                self.quantity = 1;
+#ifdef BUILD_CONTRAST
+                self.quantity = [[imgsection valueForKey:@"stockUom"] intValue];
 #else
                 
                 self.quantity =[[imgsection valueForKey:@"stockUom"] intValue];
@@ -443,6 +443,15 @@ dispatch_async(dispatch_get_main_queue(), ^{
     
     
     [super viewDidLoad];
+    if(self.ispush)
+    {
+
+       [[self navigationController] setNavigationBarHidden:NO animated:NO];
+        
+    }
+    [self setupNavigationBar];
+    
+    
 #ifdef RA_NOTIFICATION
     self.support_scanner = true;
 #endif
@@ -450,12 +459,12 @@ dispatch_async(dispatch_get_main_queue(), ^{
     self.refresh_type =  REFRESH_VIEW;
     
     [self registNotification];
-    [self setupNavigationBar];
     
+  
   //  self.detailTable.style = UITableViewStylePlain;
-    
-    self.edgesForExtendedLayout = UIRectEdgeNone;
-    
+//    return;
+//    self.edgesForExtendedLayout = UIRectEdgeNone;
+   
     
      if(self.ispush)
      {
@@ -470,7 +479,7 @@ dispatch_async(dispatch_get_main_queue(), ^{
     self.quantity=1;
     
     
-    
+   
     UIRefreshControl *ref = [[UIRefreshControl alloc]init];
     ref.tag = 300 ;
     ref.attributedTitle = [[NSAttributedString alloc]initWithString:@"Pull to refresh"];
@@ -503,9 +512,10 @@ dispatch_async(dispatch_get_main_queue(), ^{
 }
 - (void)viewWillAppear:(BOOL)animated
 {
+    [super viewWillAppear:animated];
     if(self.ispush)
     {
-        [super viewWillAppear:animated];
+ 
        [[self navigationController] setNavigationBarHidden:NO animated:NO];
         
     }

+ 314 - 33
RedAnt ERP Mobile/common/Functions/offline/OLDataProvider.m

@@ -891,7 +891,7 @@
             data[@"sales_terms"]=sales_terms;
             data[@"port_destination"]=port_destination;
             data[@"terms"]=terms;
-            data[@"carrier"]=carrier;
+            data[@"truck_carrier"]=carrier;
             data[@"vendor_no"]=vendor_no;
             data[@"customer_sign"]=sign_picpath;
             data[@"print_status"]=print_status;
@@ -1957,6 +1957,31 @@
     }
     return submitlist;
 }
+//+(NSMutableDictionary*) getScanOrderList:(NSString*)userdir{
+////    NSString *userdir = [self getUserPath:user];
+//    NSMutableDictionary* orderlist = nil;
+//    NSString *orderlistPath = [userdir stringByAppendingPathComponent:@"orderlist.json"];
+//    
+//    if (![[NSFileManager defaultManager] fileExistsAtPath:orderlistPath]) {
+//        
+//        
+//        orderlist = [NSMutableDictionary new];
+//        
+//        //                    [orderlist addObject:appDelegate.order_code];
+//        //                    [RAUtils dicttofile:orderlistPath dict:orderlist];
+//        
+//    }
+//    else
+//    {
+//        orderlist=[[RAUtils dictfromfile:orderlistPath] mutableCopy];
+//        
+//        //                    [orderlist insertObject:appDelegate.order_code atIndex:0];
+//        
+//        //                    [RAUtils dicttofile:orderlistPath dict:orderlist];
+//    }
+//    return orderlist;
+//}
+
 +(NSMutableDictionary*) getScanOrderList{
     NSString *userdir = [OLDataProvider getUserPath];
     NSMutableDictionary* orderlist = nil;
@@ -2272,7 +2297,20 @@
 ////    
 //    
 //}
-
+//+(NSString*) getUserPath: (NSString*) user
+//{
+//    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
+//    NSString *documents = [paths objectAtIndex:0];
+//
+//    NSDictionary *addressDic = [[NSUserDefaults standardUserDefaults] valueForKey:@"ScanAddress"];
+//
+//    NSString* servername = addressDic[@"name"];
+////    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+////    NSString* user = appDelegate.user;
+//    NSString* userpath = [documents stringByAppendingPathComponent:servername];
+//    userpath = [userpath stringByAppendingPathComponent:user];
+//    return userpath;
+//}
 +(NSString*) getUserPath
 {
     NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
@@ -2281,8 +2319,9 @@
     NSDictionary *addressDic = [[NSUserDefaults standardUserDefaults] valueForKey:@"ScanAddress"];
     
     NSString* servername = addressDic[@"name"];
-    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-    NSString* user = appDelegate.user;
+//    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+//    NSString* user = appDelegate.user;
+    NSString* user = RASingleton.sharedInstance.user;
     NSString* userpath = [documents stringByAppendingPathComponent:servername];
     userpath = [userpath stringByAppendingPathComponent:user];
     return userpath;
@@ -2483,6 +2522,7 @@
 +(void) updateScanOrder:(NSString*) order_code 
 {
     
+#ifdef SCANNER_ORDER
     NSString *userdir = [OLDataProvider getUserPath];
     
     if(order_code.length==0)
@@ -2543,17 +2583,18 @@
         p+=[cartitem[@"unit_price"] doubleValue]*[cartitem[@"count"]intValue] * (1-[cartitem[@"discount"]doubleValue]/100.0);
         int mcount = [cartitem[@"count"] intValue];
         double msurcharge =0;
-        if(RASingleton.sharedInstance.price_type==1)
-        {
-            if([cartitem[@"special_price"] boolValue])
-            {
-                msurcharge=([cartitem[price_group[@"price_3"][@"name"]] doubleValue]-[cartitem[price_group[@"price_2"][@"name"]] doubleValue])*mcount*(1-[cartitem[@"discount"]doubleValue]/100.0);
-            }
-            else
-            {
-                msurcharge=([cartitem[price_group[@"price_3"][@"name"]] doubleValue]-[cartitem[price_group[@"price_1"][@"name"]] doubleValue])*mcount*(1-[cartitem[@"discount"]doubleValue]/100.0);
-            }
-        }
+        // remove net price
+//        if(RASingleton.sharedInstance.price_type==1)
+//        {
+//            if([cartitem[@"special_price"] boolValue])
+//            {
+//                msurcharge=([cartitem[price_group[@"price_3"][@"name"]] doubleValue]-[cartitem[price_group[@"price_2"][@"name"]] doubleValue])*mcount*(1-[cartitem[@"discount"]doubleValue]/100.0);
+//            }
+//            else
+//            {
+//                msurcharge=([cartitem[price_group[@"price_3"][@"name"]] doubleValue]-[cartitem[price_group[@"price_1"][@"name"]] doubleValue])*mcount*(1-[cartitem[@"discount"]doubleValue]/100.0);
+//            }
+//        }
 
         s+=msurcharge;
     }
@@ -2585,7 +2626,7 @@
 //    [RAUtils dicttofile:orderlistPath dict:orderlist];
 
     [ActiveViewController Notify:@"ScanOrderListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
-
+#endif
 }
 +(void) deleteScanOrder:(NSString*) order_code
 {
@@ -2780,6 +2821,9 @@
     {
 //        if(RASingleton.sharedInstance.price_type==1)
             _modelJson [@"net_price"] = @true;
+        
+        // remove net price
+        _modelJson [@"net_price"] = @false;
     }
     
     
@@ -3391,7 +3435,8 @@ if(stockUom==0)
             if(sync_data!=nil)
             {
                 nssync_data= [[NSString alloc]initWithUTF8String:sync_data];
-                
+//                NSMutableDictionary* sync_dic = [RAConvertor string2dict:sync_data];
+//                sync_dic[@"truck_carrier"] = sync_dic[@"carrier"]
             }
             char *img_1 = (char*)sqlite3_column_text(statement, 2);
             NSString* nsimg_1=nil;
@@ -5375,6 +5420,7 @@ if(stockUom==0)
     double cuft=0;
     double weight=0;
     int carton=0;
+    int impack=0;
     
     
     NSString *sqlQuery = [NSString stringWithFormat:@"select ulength ,uwidth ,uheight ,uweight  ,mlength ,mwidth ,mheight ,mweigth  ,ilength ,iwidth ,iheight , iweight ,pcs ,mpack ,ipack,ucbf,icbf,mcbf from catalog where item_id=%d;",item_id];
@@ -5400,6 +5446,7 @@ if(stockUom==0)
             double iweight = sqlite3_column_double(statement, 11);
             //            int pcs = sqlite3_column_int(statement,12);
             int mpack = sqlite3_column_int(statement, 13);
+            impack = mpack;
             int ipack = sqlite3_column_int(statement, 14);
             double ucbf = sqlite3_column_double(statement, 15);
             //            double icbf = sqlite3_column_double(statement, 16);
@@ -5493,6 +5540,7 @@ if(stockUom==0)
         }
     }
     ret[@"cuft"]= [NSNumber numberWithDouble:cuft];
+    ret[@"mpack"]= [NSNumber numberWithInteger:impack];
     ret[@"weight"]= [NSNumber numberWithDouble:weight];
     ret[@"carton"]= [NSNumber numberWithInteger:carton];
     ret[@"items"]=dict_item;
@@ -5890,7 +5938,7 @@ if(stockUom==0)
     
     
     
-    
+    NSMutableDictionary* item = [[NSMutableDictionary alloc] init];
     
     
     sqlite3 *db = [iSalesDB get_db];
@@ -5903,7 +5951,7 @@ if(stockUom==0)
     
     
     {
-        sqlQuery=[NSString stringWithFormat:@"select editable,company_name,country,addr,zipcode,state,city,contact_name,phone,contact_id,addr_1,addr_2,addr_3,addr_4,first_name,last_name,fax,email,img_0,img_1,img_2,price_type,notes,sales_rep,type from offline_contact where contact_id='%@'",contactId];
+        sqlQuery=[NSString stringWithFormat:@"select editable,company_name,country,addr,zipcode,state,city,contact_name,phone,contact_id,addr_1,addr_2,addr_3,addr_4,first_name,last_name,fax,email,img_0,img_1,img_2,price_type,notes,sales_rep,type,carrier from offline_contact where contact_id='%@'",contactId];
         
     }
     
@@ -5915,6 +5963,8 @@ if(stockUom==0)
     [ret setValue:@"2" forKey:@"result"];
     
     
+    int carrier = -1;
+    
     if (sqlite3_prepare_v2(db, [sqlQuery UTF8String], -1, &statement, nil) == SQLITE_OK)
     {
         
@@ -5924,7 +5974,7 @@ if(stockUom==0)
             
             [ret setValue:[NSNumber numberWithInt:AP_USER_AUTH ] forKey:@"result"];
             
-            NSMutableDictionary* item = [[NSMutableDictionary alloc] init];
+            
             
             
             //            int editable  = sqlite3_column_int(statement, 0);
@@ -6085,6 +6135,10 @@ if(stockUom==0)
             
             NSString *contact_type = [self textAtColumn:24 statement:statement];
             
+            carrier = sqlite3_column_int(statement, 25);
+            
+            
+            
             
             {
                 // decrypt
@@ -6153,13 +6207,16 @@ if(stockUom==0)
             [item setValue:nsemail   forKey:@"customer_email"];
             [item setValue:contact_type   forKey:@"customer_contact_type"];
             
-            
-            [ret setObject:item forKey:@"customerInfo"];
+
             // i++;
             
             
             
         }
+        
+        
+        
+        
         //        UIApplication * app = [UIApplication sharedApplication];
         //        AppDelegate *appDelegate = (AppDelegate *)[app delegate];
         [ret setValue:params[@"mode"]   forKey:@"mode"];
@@ -6174,7 +6231,12 @@ if(stockUom==0)
     
     [iSalesDB close_db:db];
     
+    NSString* scarrier = [self offline_getCarrier:carrier];
+    
     
+    item[@"customer_truck_carrier"] = scarrier;
+    
+    [ret setObject:item forKey:@"customerInfo"];
     
     
     DebugLog(@"data string: %@",[RAConvertor dict2string:ret] );
@@ -7017,6 +7079,133 @@ if(stockUom==0)
     [ret setValue:[NSNumber numberWithLong:ret.allKeys.count] forKey:@"count"];
     return ret;
 }
++ (NSDictionary *)offline_OrderCarrier:(NSString *)order_code  db:(sqlite3 *)db  {
+    //    "val_227" : {
+    //        "check" : 1,
+    //        "value" : "US United States",
+    //        "value_id" : "228"
+    //    },
+    
+
+    __block NSString* OrderCarrier =@"";
+    
+//    sqlite3 *db = [iSalesDB get_db];
+    
+//    sqlite3_stmt * statement;
+    
+    
+    [iSalesDB jk_query:[NSString stringWithFormat:@"select carrier from offline_order where so_id='%@';",order_code] db:db close:NO completion:^(sqlite3_stmt *statment, NSMutableDictionary *container, long *count) {
+        
+        OrderCarrier = [self textAtColumn:0 statement:statment];
+//        sqlite3_finalize(statement);
+        
+    }];
+//    [iSalesDB close_db:db];
+    
+    __block int c=0;
+    
+    NSMutableDictionary *ret = [[iSalesDB jk_query:@"select _id,name,code_id from carrier order by name;" db:db close:NO completion:^(sqlite3_stmt *stmt, NSMutableDictionary *container, long *count) {
+        
+        char *name = (char *) sqlite3_column_text(stmt, 1); // 全称
+        int code_id = sqlite3_column_int(stmt, 2); // id
+        
+        NSMutableDictionary *carrierDic = [NSMutableDictionary dictionaryWithCapacity:2];
+        [carrierDic setValue:[NSString stringWithFormat:@"%s",name] forKey:@"value"];
+        [carrierDic setValue:[NSString stringWithFormat:@"%d",code_id] forKey:@"value_id"];
+        [carrierDic setValue:[NSNumber numberWithInt:0] forKey:@"check"];
+        
+        if ([OrderCarrier isEqualToString:[NSString stringWithUTF8String:name]]) {
+            [carrierDic setValue:[NSNumber numberWithInt:1] forKey:@"check"];
+        }
+        c++;
+        long n = *count;
+        *count = n + 1;
+        NSString *key = [NSString stringWithFormat:@"val_%ld",n];
+        [container setValue:carrierDic forKey:key];
+        
+    }] mutableCopy];
+    
+    
+
+    
+    [ret setValue:[NSNumber numberWithLong:c] forKey:@"count"];
+
+    
+    
+    
+ 
+    
+    return ret;
+}
++ (NSDictionary *)offline_getAllCarrier:(NSString *)carrierName {
+    //    "val_227" : {
+    //        "check" : 1,
+    //        "value" : "US United States",
+    //        "value_id" : "228"
+    //    },
+    
+
+    
+    NSMutableDictionary *ret = [[iSalesDB jk_query:@"select _id,name,code_id from carrier order by name;" completion:^(sqlite3_stmt *stmt, NSMutableDictionary *container,long *count) {
+        char *name = (char *) sqlite3_column_text(stmt, 1); // 全称
+        int code_id = sqlite3_column_int(stmt, 2); // id
+        
+        NSMutableDictionary *carrierDic = [NSMutableDictionary dictionaryWithCapacity:2];
+        [carrierDic setValue:[NSString stringWithFormat:@"%s",name] forKey:@"value"];
+        [carrierDic setValue:[NSString stringWithFormat:@"%d",code_id] forKey:@"value_id"];
+        [carrierDic setValue:[NSNumber numberWithInt:0] forKey:@"check"];
+        
+        if ([carrierName isEqualToString:[NSString stringWithUTF8String:name]]) {
+            [carrierDic setValue:[NSNumber numberWithInt:1] forKey:@"check"];
+        }
+        
+        long n = *count;
+        *count = n + 1;
+        NSString *key = [NSString stringWithFormat:@"val_%ld",n];
+        [container setValue:carrierDic forKey:key];
+    }] mutableCopy];
+    
+    [ret setValue:[NSNumber numberWithLong:ret.allKeys.count] forKey:@"count"];
+    return ret;
+}
+//+ (NSString *)offline_getContactCarrier:(int)contact_id {
+//    //    "val_227" : {
+//    //        "check" : 1,
+//    //        "value" : "US United States",
+//    //        "value_id" : "228"
+//    //    },
+//    
+//    NSString *Sql = [NSString stringWithFormat: @"select carrier from offline_contact where contact_id = %d;",contact_id];
+//    NSString * code = [iSalesDB jk_queryText:Sql];
+//    
+//    return [self offline_getCarrier:code];
+//    
+//}
++ (NSString *)offline_getCarrier:(int)code {
+    //    "val_227" : {
+    //        "check" : 1,
+    //        "value" : "US United States",
+    //        "value_id" : "228"
+    //    },
+    
+    NSString *Sql = [NSString stringWithFormat: @"select name from carrier where code_id = %d;",code];
+    NSString * ret = [iSalesDB jk_queryText:Sql];
+    
+    return ret;
+}
+
++ (int )offline_getCarrierCode:(NSString*)name {
+    //    "val_227" : {
+    //        "check" : 1,
+    //        "value" : "US United States",
+    //        "value_id" : "228"
+    //    },
+    
+    NSString *Sql = [NSString stringWithFormat: @"select code from carrier where name = '%@';",name];
+    NSString * ret = [iSalesDB jk_queryText:Sql];
+    
+    return [ret intValue];
+}
 
 + (NSDictionary *)offline_getStateByCountryCode:(NSString *)countryCode checkedState:(NSString *)state_code{
     countryCode = [self translateSingleQuote:countryCode];
@@ -7542,6 +7731,7 @@ if(stockUom==0)
     NSString *stateCode = nil;
     NSString *city = nil;
     NSString *zipCode = nil;
+    NSString *carrierCode = nil;
     
     if ([params.allKeys containsObject:@"refresh_trigger"]) {
         
@@ -7639,6 +7829,12 @@ if(stockUom==0)
     NSDictionary *repDic = [self offline_getSalesRep:params[@"user"]];
     [self setValue:repDic forItemKey:@"item_18" valueKey:@"cadedate" inDictionary:section_0];
     
+#ifdef BUILD_CONTRAST
+    //carrier
+    NSDictionary *carrierDic = [self offline_getAllCarrier:params[@"carrier"]];
+    [self setValue:carrierDic forItemKey:@"item_19" valueKey:@"cadedate" inDictionary:section_0];
+#endif
+    
     [ret setValue:section_0 forKey:@"section_0"];
     
     return [RAConvertor dict2data:ret];
@@ -7650,7 +7846,7 @@ if(stockUom==0)
     
     NSString *addr = nil;
     NSString *contact_name = nil;
-    
+//    int carrier = [params[@"carrier"] intValue];
     NSString *companyName = [params objectForKey:@"company"];
     if (companyName) {
         companyName = [AESCrypt fastencrypt:companyName];
@@ -7703,6 +7899,12 @@ if(stockUom==0)
     } else {
         country = @"";
     }
+    
+    int carrier = [params[@"carrier"] intValue];
+    
+    
+    
+    
     DebugLog(@"country");
     country = [self translateSingleQuote:country];
     
@@ -7843,6 +8045,8 @@ if(stockUom==0)
         [sync_dic setValue:@"Sales_Order_Ship_To" forKey:@"contactType"];
     }
     
+    
+    sync_dic[@"truck_carrier"] = [self offline_getCarrier: [sync_dic[@"carrier"] intValue]];
     NSString *sync_data = nil;
     
     NSString *sql = nil;
@@ -7858,7 +8062,7 @@ if(stockUom==0)
         sync_data = [RAConvertor dict2string:sync_dic];
         sync_data = [self translateSingleQuote:sync_data];
         
-        sql = [NSString stringWithFormat:@"update offline_contact set company_name = '%@',addr_1 = '%@',addr_2 = '%@',addr_3 = '%@',addr_4 = '%@',country = '%@',state = '%@',city = '%@',zipcode = '%@',first_name = '%@',last_name = '%@',phone = '%@',fax = '%@',email = '%@',notes = '%@',price_type = '%@',sales_rep = '%@',img_0 = '%@',img_1 = '%@',img_2 = '%@',sync_data = '%@',contact_name = '%@',addr = '%@',type = '%@' where contact_id = '%@';",companyName,addr1,addr2,addr3,addr4,country,state,city,zipcode,fistName,lastName,phone,fax,email,notes,price,salesRep,img_0,img_1,img_2,sync_data,contact_name,addr,contact_type,contact_id];
+        sql = [NSString stringWithFormat:@"update offline_contact set company_name = '%@',addr_1 = '%@',addr_2 = '%@',addr_3 = '%@',addr_4 = '%@',country = '%@',state = '%@',city = '%@',zipcode = '%@',first_name = '%@',last_name = '%@',phone = '%@',fax = '%@',email = '%@',notes = '%@',price_type = '%@',sales_rep = '%@',img_0 = '%@',img_1 = '%@',img_2 = '%@',sync_data = '%@',contact_name = '%@',addr = '%@',type = '%@' ,carrier = %d where contact_id = '%@';",companyName,addr1,addr2,addr3,addr4,country,state,city,zipcode,fistName,lastName,phone,fax,email,notes,price,salesRep,img_0,img_1,img_2,sync_data,contact_name,addr,contact_type,carrier,contact_id];
     } else {
         
         contact_id = [self translateSingleQuote:contact_id];
@@ -7868,7 +8072,7 @@ if(stockUom==0)
         sync_data = [RAConvertor dict2string:sync_dic];
         sync_data = [self translateSingleQuote:sync_data];
         
-        sql = [NSString stringWithFormat:@"insert into offline_contact (is_active,company_name,addr_1,addr_2,addr_3,addr_4,country,state,city,zipcode,first_name,last_name,phone,fax,email,notes,price_type,sales_rep,img_0,img_1,img_2,editable,contact_id,Sales_Order_Customer,Sales_Order_Freight_Bill_To,Sales_Order_Ship_From,Sales_Order_Merchandise_Bill_To,Contact_Return_To,Sales_Order_Ship_To,sync_data,contact_name,addr,type) values (1,'%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%@',1,'%@',%d,%d,0,%d,0,1,'%@','%@','%@','%@')",companyName,addr1,addr2,addr3,addr4,country,state,city,zipcode,fistName,lastName,phone,fax,email,notes,price,salesRep,img_0,img_1,img_2,contact_id,isCustomer ? 1 : 0,isCustomer ? 1 : 0,isCustomer ? 1 : 0,sync_data,contact_name,addr,contact_type];
+        sql = [NSString stringWithFormat:@"insert into offline_contact (is_active,company_name,addr_1,addr_2,addr_3,addr_4,country,state,city,zipcode,first_name,last_name,phone,fax,email,notes,price_type,sales_rep,img_0,img_1,img_2,editable,contact_id,Sales_Order_Customer,Sales_Order_Freight_Bill_To,Sales_Order_Ship_From,Sales_Order_Merchandise_Bill_To,Contact_Return_To,Sales_Order_Ship_To,sync_data,contact_name,addr,type,carrier) values (1,'%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%@',1,'%@',%d,%d,0,%d,0,1,'%@','%@','%@','%@',%d)",companyName,addr1,addr2,addr3,addr4,country,state,city,zipcode,fistName,lastName,phone,fax,email,notes,price,salesRep,img_0,img_1,img_2,contact_id,isCustomer ? 1 : 0,isCustomer ? 1 : 0,isCustomer ? 1 : 0,sync_data,contact_name,addr,contact_type,carrier];
     }
     
     int result = [iSalesDB execSql:sql];
@@ -7908,6 +8112,7 @@ if(stockUom==0)
     NSString *countryCode = nil;
     NSString *countryCode_id = nil;
     NSString *stateCode = nil;
+    __block int carrierCode = -1;
     
     /*------contact infor------*/
     __block NSString *country = nil;
@@ -7925,7 +8130,7 @@ if(stockUom==0)
     __block NSString *contact_type;
     
     contact_id = [self translateSingleQuote:contact_id];
-    NSString *sql = [NSString stringWithFormat:@"select country,company_name,addr_1,addr_2,addr_3,addr_4,zipcode,state,city,first_name,last_name,phone,fax,email,notes,price_type,sales_rep,img_0,img_1,img_2,type from offline_contact where contact_id = '%@';",contact_id];
+    NSString *sql = [NSString stringWithFormat:@"select country,company_name,addr_1,addr_2,addr_3,addr_4,zipcode,state,city,first_name,last_name,phone,fax,email,notes,price_type,sales_rep,img_0,img_1,img_2,type,carrier from offline_contact where contact_id = '%@';",contact_id];
     
     [iSalesDB jk_query:sql completion:^(sqlite3_stmt *stmt, NSMutableDictionary *container, long *count) {
         
@@ -7950,6 +8155,7 @@ if(stockUom==0)
         img_1 = [self textAtColumn:18 statement:stmt];
         img_2 = [self textAtColumn:19 statement:stmt];
         contact_type = [self textAtColumn:20 statement:stmt];
+        carrierCode  = sqlite3_column_int(stmt, 21);
     }];
     
     // decrypt
@@ -8133,6 +8339,15 @@ if(stockUom==0)
     }
     [self setValue:repDic forItemKey:@"item_19" valueKey:@"cadedate" inDictionary:section_0];
     
+#ifdef BUILD_CONTRAST
+    //carrier
+    
+    NSString* scarrier = [self offline_getCarrier:carrierCode];
+    NSDictionary *carrierDic = [self offline_getAllCarrier:scarrier];
+    [self setValue:carrierDic forItemKey:@"item_20" valueKey:@"cadedate" inDictionary:section_0];
+#endif
+    
+    
     [ret setValue:section_0 forKey:@"section_0"];
     
     return [RAConvertor dict2data:ret];
@@ -11126,6 +11341,9 @@ if(stockUom==0)
         double cuft=[bsubtotaljson[@"cuft"] doubleValue];
         double weight=[bsubtotaljson[@"weight"] doubleValue];
         int carton=[bsubtotaljson[@"carton"] intValue];
+        int mpack=[bsubtotaljson[@"mpack"] intValue];
+        
+        model_dic[@"mpack"]=[NSNumber numberWithInt:mpack];
         
         TotalCuft += cuft;
         TotalWeight += weight;
@@ -11435,10 +11653,11 @@ if(stockUom==0)
     NSString *orderCode = [self valueInParams:params key:@"orderCode"];
     orderCode = [self translateSingleQuote:orderCode];
     
-    NSString *sql = [NSString stringWithFormat:@"select logist,lift_gate,logistic_note from offline_order where so_id = '%@';",orderCode];
+    NSString *sql = [NSString stringWithFormat:@"select logist,lift_gate,logistic_note,carrier from offline_order where so_id = '%@';",orderCode];
     
     
     __block NSString *logist = @"";
+    __block NSString *carrier = @"";
     __block NSString *lift_gate = @"";
     __block int lift_gate_integer = 0;
     __block NSString *logistic_note = @"";
@@ -11449,6 +11668,7 @@ if(stockUom==0)
         lift_gate_integer = sqlite3_column_int(stmt, 1);
         
         logistic_note = [self textAtColumn:2 statement:stmt];
+        carrier = [self textAtColumn:3 statement:stmt];
         
     }];
     
@@ -11542,17 +11762,38 @@ if(stockUom==0)
         
     }
     
+    
+//    carrier = [self valueInParams:params key:@"carrier"];
+//    if([carrier isEqualToString:@""]) {
+//
+//        if (lift_gate_integer == 1) {
+//            lift_gate = @"true";
+//        } else {
+//            lift_gate = @"false";
+//        }
+//
+//    }
+    
     int common_carrier_check = 0;
     if (logist && [logist isEqualToString:@"COMMON CARRIER"]) {
         
         common_carrier_check = 1;
         [params setValue:lift_gate forKey:@"lift_gate"];
+#ifdef BUILD_CONTRAST
+        [params setValue:carrier forKey:@"carrier"];
+#endif
     }
     
+    //    NSString *Sql = [NSString stringWithFormat: @"select carrier from offline_contact where contact_id = %d;",contact_id];
+    //    NSString * code = [iSalesDB jk_queryText:Sql];
+    
+//    [self offline_getCarrierCode:offline_getCarrierCode];
+    
+    NSDictionary *carrierDic = [self offline_OrderCarrier:params[@"orderCode"] db:db];
+    
     NSDictionary *val_1 = @{
         @"check" : [NSNumber numberWithInteger:common_carrier_check],
         @"sub_item" : @{
-            @"count" : [NSNumber numberWithInteger:1],
             @"item_0" : @{
                 @"aname" : @"Do you have Loading Dock Available ? Slide to green for YES",
                 @"control" : @"switch",
@@ -11560,7 +11801,23 @@ if(stockUom==0)
                 @"refresh" : [NSNumber numberWithInteger:1],
                 @"required" : @"true",
                 @"value" : lift_gate
+            },
+#ifdef BUILD_CONTRAST
+            @"count" : [NSNumber numberWithInteger:2],
+            @"item_1" : @{
+                @"aname" : @"Carrier",
+                @"cadedate" :carrierDic,
+                @"control" : @"enum",
+                @"name" : @"carrier",
+                @"required" : @"false",
+                @"value" : @"",
+                @"single_select" : @"true"
             }
+#else
+            @"count" : [NSNumber numberWithInteger:1]
+#endif
+            
+
         },
         @"value" : @"COMMON CARRIER",
         @"value_id" : @"COMMON CARRIER"
@@ -11781,14 +12038,14 @@ if(stockUom==0)
                                     @"keyboard" : @"int",
                                     @"length" : @"16",
                                     @"name" : @"credit_card_number",
-                                    @"required" : @"true",
+                                    @"required" : @"false",
                                     @"value" : cardNumber
                                 },
                                                                @"item_1" : @{
                                     @"aname" : @"Expiration Date",
                                     @"control" : @"monthpicker",
                                     @"name" : @"credit_card_expiration",
-                                    @"required" : @"true",
+                                    @"required" : @"false",
                                     @"type" : @"date",
                                     @"value" : [month isEqualToString:@""] || [year isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"%@/%@",month,year]
                                 },
@@ -11798,7 +12055,7 @@ if(stockUom==0)
                                     @"keyboard" : @"int",
                                     @"length" : @"4",
                                     @"name" : @"credit_card_security_code",
-                                    @"required" : @"true",
+                                    @"required" : @"false",
                                     @"value" : securityCode
                                 },
                
@@ -12981,16 +13238,21 @@ if(stockUom==0)
     }
     
     //    NSString *sync_data = [AESCrypt fastencrypt:[RAUtils dict2string:param]];
+    NSString* carrier = [self offline_getCarrier:[param[@"carrier"] intValue]];
+    
+    NSString* scarrier = [NSString stringWithFormat:@"carrier = '%@',",carrier];
     
     NSString *sync_sql = @"";
     if (submit) {
+        param[@"truck_carrier"]=carrier;
         NSString *sales_rep = [iSalesDB jk_queryText:[NSString stringWithFormat:@"select sales_rep from offline_order where so_id = '%@';",so_id]];
         [param setValue:sales_rep forKey:@"sales_rep"];
         NSString *sync_data = [self translateSingleQuote:[RAConvertor dict2string:param]];
         sync_sql = [NSString stringWithFormat:@",sync_data = '%@' ",sync_data];
     }
+
     
-    NSString *orderSql = [NSString stringWithFormat:@"update offline_order set %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ so_id = '%@' %@ where so_id = '%@';",schedule_date, order_status,general_notes,internal_notes,poNumber,must_call,sign_picpath,total_price,paymentsAndCredits,handling_fee_placeholder,lift_gate,lift_gate_placeholder,logist,logistic_note,erpOrderStatus,paymentType,credit_card_address1,credit_card_address2,credit_card_city,credit_card_first_name,credit_card_last_name,credit_card_number,credit_card_security_code,credit_card_state,credit_card_type,credit_card_zipcode,credit_card_expiration_year,credit_card_expiration_month,customer_cid,customer_contact,customer_email,customer_phone,customer_fax,receive_cid,receive_name,receive_ext,receive_contact,receive_phone,receive_email,receive_fax,sender_cid,sender_name,sender_ext,sender_contact,sender_phone,sender_fax,sender_email,shipping_billto_cid,shipping_billto_name,shipping_billto_ext,shipping_billto_contact,shipping_billto_phone,shipping_billto_fax,shipping_billto_email,billing_cid,billing_name,billing_ext,billing_contact,billing_phone,billing_fax,billing_email,returnto_cid,returnto_name,returnto_ext,returnto_contact,returnto_phone,returnto_fax,returnto_email,so_id,sync_sql,so_id];
+    NSString *orderSql = [NSString stringWithFormat:@"update offline_order set %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ so_id = '%@' %@ where so_id = '%@';",schedule_date, order_status,general_notes,internal_notes,poNumber,must_call,sign_picpath,total_price,paymentsAndCredits,handling_fee_placeholder,lift_gate,lift_gate_placeholder,logist,logistic_note,erpOrderStatus,paymentType,credit_card_address1,credit_card_address2,credit_card_city,credit_card_first_name,credit_card_last_name,credit_card_number,credit_card_security_code,credit_card_state,credit_card_type,credit_card_zipcode,credit_card_expiration_year,credit_card_expiration_month,customer_cid,customer_contact,customer_email,customer_phone,customer_fax,receive_cid,receive_name,receive_ext,receive_contact,receive_phone,receive_email,receive_fax,sender_cid,sender_name,sender_ext,sender_contact,sender_phone,sender_fax,sender_email,shipping_billto_cid,shipping_billto_name,shipping_billto_ext,shipping_billto_contact,shipping_billto_phone,shipping_billto_fax,shipping_billto_email,billing_cid,billing_name,billing_ext,billing_contact,billing_phone,billing_fax,billing_email,returnto_cid,returnto_name,returnto_ext,returnto_contact,returnto_phone,returnto_fax,returnto_email,scarrier,so_id,sync_sql,so_id];
     
     DebugLog(@"save order contactSql: %@",contactSql);
     DebugLog(@"save order orderSql: %@",orderSql);
@@ -16602,11 +16864,28 @@ if(stockUom==0)
             
         }];
         
+        
+        
+        
+        
+        
+        // default carrier
+        NSString *carrier_sql = [NSString stringWithFormat:@"select name from carrier where code_id = (select carrier from offline_contact where contact_id = '%@');",customer_cid];
+        
+        __block NSString *carrier = @"";
+        
+        [iSalesDB jk_query:carrier_sql db:db close:NO completion:^(sqlite3_stmt *statment, NSMutableDictionary *container, long *count) {
+            
+            carrier = [self textAtColumn:0 statement:statment];
+            
+            
+        }];
+        
         NSString* so_id = [self get_offline_soid:db];
         if(so_id==nil)
             so_id=[NSString stringWithFormat:@"OFFLINE%@",[NSUUID UUID].UUIDString ];
         
-        NSString* sql_neworder=[NSString stringWithFormat:@"insert into offline_order(so_id,status,customer_cid,customer_contact,customer_email,customer_fax,customer_phone,sales_rep,create_by,customer_contact,must_call,sender_cid,sender_name,sender_ext,sender_contact,sender_phone,sender_fax,sender_email,billing_cid,billing_name,billing_ext,billing_contact,billing_phone,billing_fax,billing_email,sales_terms) values('%@',0,'%@','%@','%@','%@','%@','%@','%@','%@',1,'%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','FOB')",so_id,customer_cid,customer_contact,customer_email,customer_fax,customer_phone,customer_sales_rep,create_by ,contact_name,cid,name,ext,contact,phone,fax,email,customer_cid,customer_name,customer_contact_ext,customer_contact,customer_phone,customer_fax,customer_email];
+        NSString* sql_neworder=[NSString stringWithFormat:@"insert into offline_order(so_id,status,customer_cid,customer_contact,customer_email,customer_fax,customer_phone,sales_rep,create_by,customer_contact,must_call,sender_cid,sender_name,sender_ext,sender_contact,sender_phone,sender_fax,sender_email,billing_cid,billing_name,billing_ext,billing_contact,billing_phone,billing_fax,billing_email,sales_terms,carrier) values('%@',0,'%@','%@','%@','%@','%@','%@','%@','%@',1,'%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','FOB','%@')",so_id,customer_cid,customer_contact,customer_email,customer_fax,customer_phone,customer_sales_rep,create_by ,contact_name,cid,name,ext,contact,phone,fax,email,customer_cid,customer_name,customer_contact_ext,customer_contact,customer_phone,customer_fax,customer_email,carrier];
         
         
         
@@ -16801,6 +17080,7 @@ if(stockUom==0)
                 double weight=[bsubtotaljson[@"weight"] doubleValue];
                 int carton=[bsubtotaljson[@"carton"] intValue];
                 cart_count+=[bsubtotaljson[@"items"] allKeys].count;
+                int mpack =[bsubtotaljson[@"mpack"] intValue];
                 
                 //            itemjson[@"img_url"]= [self model_category_img:[NSString stringWithFormat:@"%@",[NSNumber numberWithInt:item_id]] model_name:nil db:db];
                 //            NSDate *img_date = [NSDate date];
@@ -16820,6 +17100,7 @@ if(stockUom==0)
                 itemjson[@"discount"]=[NSNumber numberWithInt:discount];
                 itemjson[@"description"]=[NSString stringWithFormat:@"%@\n%@",nsname,nsdescription ];
                 itemjson[@"stockUom"]=[NSNumber numberWithInt:stockUom];
+                itemjson[@"mpack"]=[NSNumber numberWithInt:mpack];
                 itemjson[@"note"]=nsline_note;
                 if (!can_create_backorder) {
                     itemjson[@"is_out_of_stock"] = [NSNumber numberWithBool:availability >= item_count ? NO : YES];

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

@@ -111,7 +111,7 @@
 
 - (void)viewDidLoad {
     [super viewDidLoad];
-    self.edgesForExtendedLayout = UIRectEdgeNone;
+//    self.edgesForExtendedLayout = UIRectEdgeNone;
     
     self.loading_queue = dispatch_queue_create("orderlist_loading", NULL);
     

+ 1 - 1
RedAnt ERP Mobile/common/Functions/portfolio/PortfolioEditQTYViewController.m

@@ -23,7 +23,7 @@
 - (void)viewDidLoad {
     [super viewDidLoad];
     
-    self.edgesForExtendedLayout = UIRectEdgeNone;
+//    self.edgesForExtendedLayout = UIRectEdgeNone;
     self.checkedCount = 0;
     self.saveButton.hidden = YES;
     [self addObserver:self forKeyPath:@"checkedCount" options:NSKeyValueObservingOptionNew context:nil];

+ 1 - 1
RedAnt ERP Mobile/common/Functions/search+itemsearch/ItemSearchFilterViewController.m

@@ -214,7 +214,7 @@
     self.navigationItem.rightBarButtonItem = closeButton;
     
     
-    self.edgesForExtendedLayout = UIRectEdgeNone;
+//    self.edgesForExtendedLayout = UIRectEdgeNone;
     
     CGRect rect_tframe = CGRectMake(0,0,self.treeContainer.frame.size.width,self.treeContainer.frame.size.height);
     

+ 19 - 3
RedAnt ERP Mobile/common/Functions/sidemenu/FunctionTestViewController.m

@@ -30,13 +30,29 @@ self.airPrinterController = [UIPrintInteractionController sharedPrintController]
     [super viewWillAppear:animated];
     [[self navigationController] setNavigationBarHidden:NO animated:NO];
     
-    self.filename = @"print_test";
+//    self.filename = @"print_test";
     
-    NSData* data =[NSData dataWithContentsOfFile:[[NSBundle mainBundle]  pathForResource:@"I25418359" ofType:@"pdf" ]];
+//    NSData* data =[NSData dataWithContentsOfFile:[[NSBundle mainBundle]  pathForResource:@"I25418359" ofType:@"pdf" ]];
     
-    [self startAirPrintWithData1:data];
+//    [self startAirPrintWithData1:data];
+    [self testUI];
 }
 
+-(void)testUI
+{
+    __block UIAlertController * waitalert = [RAUtils waiting_alert:self title:@"waiting" completion:^{
+        dispatch_async(dispatch_get_global_queue(0, 0), ^{
+            sleep(2);
+            dispatch_async(dispatch_get_main_queue(), ^{
+                [waitalert dismissViewControllerAnimated:false completion:^{
+                    
+                    [RAUtils message_alert:@"message" title:@"message" controller:self];
+                }];
+                
+            });
+        });
+    }];
+}
 - (void)startAirPrintWithData:(id )data
 {
     

+ 1 - 1
RedAnt ERP Mobile/common/Functions/sidemenu/ScannerSettingViewController.m

@@ -49,7 +49,7 @@
 #ifdef RA_NOTIFICATION
     self.support_scanner = true;
 #endif
-    self.edgesForExtendedLayout = UIRectEdgeNone ;
+//    self.edgesForExtendedLayout = UIRectEdgeNone ;
     
     UIBarButtonItem *closeButton = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"close"] imageWithRenderingMode:UIImageRenderingModeAutomatic]
                                                                     style:UIBarButtonItemStylePlain

+ 1 - 1
RedAnt ERP Mobile/common/Functions/sidemenu/SimplifiedBuyingProgramViewController.m

@@ -26,7 +26,7 @@
     self.navigationItem.rightBarButtonItem = closeButton;
     
     
-    self.edgesForExtendedLayout = UIRectEdgeNone;
+//    self.edgesForExtendedLayout = UIRectEdgeNone;
     // Do any additional setup after loading the view.
 }
 

+ 1 - 1
RedAnt ERP Mobile/common/Functions/sidemenu/UserListViewController.m

@@ -18,7 +18,7 @@
 - (void)viewDidLoad {
     [super viewDidLoad];
     
-    self.edgesForExtendedLayout = UIRectEdgeNone;
+//    self.edgesForExtendedLayout = UIRectEdgeNone;
     
     self.bb_close.image=[[UIImage imageNamed:@"close"] imageWithRenderingMode:UIImageRenderingModeAutomatic];
     

+ 3 - 0
RedAnt ERP Mobile/common/RASingleton.h

@@ -45,6 +45,9 @@ typedef enum {
 //@property (nonatomic,strong) NSString *scan_temp_code;///<扫码订单创建前的零时单号
 //@property int price_index; //qr code 里的价格位置
 @property int price_type; //当前设置的价格类型
+
+
+@property (nonatomic,  copy) NSString *user;///替代appdelegate里的user访问
 ///
 ///
 ///

+ 1 - 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-10-15"];
+NSDate * ddate =[dateFormatter dateFromString:@"2022-10-16"];
     
 //    bool review=[cdate earlierDate:ddate];
     NSTimeInterval secondsInterval= [cdate timeIntervalSinceDate:ddate];

+ 5 - 1
RedAnt ERP Mobile/common/data_provider/iSalesDB.m

@@ -695,6 +695,7 @@ void decryptfield (sqlite3_context *context, int argc, sqlite3_value **argv) {
     //NSString* create_model_ext=@"CREATE TABLE IF NOT EXISTS model_ext ( _id INTEGER PRIMARY KEY, product_id INTEGER,carton integer, cuft double, weight double;";
     
     NSString* create_category=@"CREATE TABLE IF NOT EXISTS category ( _id INTEGER PRIMARY KEY, code VARCHAR(20),name VARCHAR(20));";
+    NSString* create_carrier=@"CREATE TABLE IF NOT EXISTS carrier ( _id INTEGER PRIMARY KEY, code_id integer,name text);";
     NSString* create_offline_setting=@"CREATE TABLE IF NOT EXISTS offline_setting ( _id INTEGER PRIMARY KEY, name VARCHAR(20),value VARCHAR(40));";
     
     
@@ -710,7 +711,7 @@ void decryptfield (sqlite3_context *context, int argc, sqlite3_value **argv) {
     NSString* create_wishlist=@"CREATE TABLE IF NOT EXISTS wishlist ( _id INTEGER PRIMARY KEY, user_id INTEGER,  product_id integer ,item_id integer , qty integer, is_delete integer, is_dirty integer,create_time TIMESTAMP default (datetime('now', 'localtime')),modify_time TIMESTAMP default (datetime('now', 'localtime')));";
 
     
-    NSString* create_offline_contact=@"CREATE TABLE IF NOT EXISTS offline_contact (_id INTEGER, country VARCHAR(40,0), company_name VARCHAR(40,0), contact_id VARCHAR(20,0), addr_1 text, addr_2 text, addr_3 text, addr_4 text, zipcode varchar(20,0), state VARCHAR(40,0), city VARCHAR(40,0), first_name VARCHAR(40,0), last_name VARCHAR(40,0), phone VARCHAR(40,0), fax VARCHAR(40,0), email VARCHAR(40,0), notes text, price_type VARCHAR(40,0), sales_rep VARCHAR(40,0), type VARCHAR(40,0), create_time timestamp default (datetime('now', 'localtime')), editable integer, contact_name text, addr text, Sales_Order_Customer integer, Sales_Order_Freight_Bill_To integer, Sales_Order_Ship_From integer, Sales_Order_Merchandise_Bill_To integer, Contact_Return_To integer, Sales_Order_Ship_To integer,img_0 TEXT,img_1 TEXT,img_2 TEXT,related_cid VARCHAR(20,0),is_active integer,sync_data text,modify_time TIMESTAMP default (datetime('now', 'localtime')), PRIMARY KEY(_id) );";
+    NSString* create_offline_contact=@"CREATE TABLE IF NOT EXISTS offline_contact (_id INTEGER, country VARCHAR(40,0), company_name VARCHAR(40,0), contact_id VARCHAR(20,0), addr_1 text, addr_2 text, addr_3 text, addr_4 text, zipcode varchar(20,0), state VARCHAR(40,0), city VARCHAR(40,0), first_name VARCHAR(40,0), last_name VARCHAR(40,0), phone VARCHAR(40,0), fax VARCHAR(40,0), email VARCHAR(40,0), notes text, price_type VARCHAR(40,0), sales_rep VARCHAR(40,0), type VARCHAR(40,0), create_time timestamp default (datetime('now', 'localtime')), editable integer, contact_name text, addr text, Sales_Order_Customer integer, Sales_Order_Freight_Bill_To integer, Sales_Order_Ship_From integer, Sales_Order_Merchandise_Bill_To integer, Contact_Return_To integer, Sales_Order_Ship_To integer,img_0 TEXT,img_1 TEXT,img_2 TEXT,related_cid VARCHAR(20,0),is_active integer,sync_data text,modify_time TIMESTAMP default (datetime('now', 'localtime')), carrier integer, PRIMARY KEY(_id) );";
     
 //    NSString* create_contact_image=@"CREATE TABLE IF NOT EXISTS contact_image ( _id INTEGER PRIMARY KEY, name VARCHAR(20), url VARCHAR(256), contact_id VARCHAR(20));";
     
@@ -766,6 +767,8 @@ void decryptfield (sqlite3_context *context, int argc, sqlite3_value **argv) {
         
         [self execSql:create_model_price db:db];
         [self execSql:create_category db:db];
+        [self execSql:create_carrier db:db];
+        
         [self execSql:create_offline_setting db:db];
         
         [self execSql:create_offline_login db:db];
@@ -817,6 +820,7 @@ void decryptfield (sqlite3_context *context, int argc, sqlite3_value **argv) {
     
     [self alterTable:@"offline_contact" columns:@"is_active integer;sync_data text" rename:NO db:db];
     [self alterTable:@"offline_contact" columns:@"modify_time TIMESTAMP" rename:NO db:db];
+    [self alterTable:@"offline_contact" columns:@"carrier integer " rename:NO db:db];
     
     [self alterTable:@"offline_login" columns:@"can_update_contact_info integer;sales_code text" rename:NO db:db];
     

+ 22 - 14
RedAnt ERP Mobile/iSales-CONTRAST.xcodeproj/project.pbxproj

@@ -8,6 +8,9 @@
 
 /* Begin PBXBuildFile section */
 		3C2F99B8237BE1790000808F /* PortfolioListTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C2F99B6237BE1790000808F /* PortfolioListTableViewCell.m */; };
+		3C3C92772906874A00EC3500 /* createContact.json in Resources */ = {isa = PBXBuildFile; fileRef = 3C3C92762906874A00EC3500 /* createContact.json */; };
+		3C3C92792907BF4B00EC3500 /* editContact.json in Resources */ = {isa = PBXBuildFile; fileRef = 3C3C92782907BF4B00EC3500 /* editContact.json */; };
+		3C3C927B2907C0C400EC3500 /* customer_info_template.json in Resources */ = {isa = PBXBuildFile; fileRef = 3C3C927A2907C0C400EC3500 /* customer_info_template.json */; };
 		3C51492F273CF9B900F78617 /* DBUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C51492E273CF9B900F78617 /* DBUtil.m */; };
 		3C514932273D092A00F78617 /* EnumSelectViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C514931273D092A00F78617 /* EnumSelectViewController.m */; };
 		3C514947273D095900F78617 /* CommonEditorCellSwitch.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C514934273D095800F78617 /* CommonEditorCellSwitch.m */; };
@@ -165,8 +168,6 @@
 		7143E212202FCF7600451903 /* CategoryCellNPD.m in Sources */ = {isa = PBXBuildFile; fileRef = 7143E211202FCF7600451903 /* CategoryCellNPD.m */; };
 		7143E214202FCFC000451903 /* debug_category_filter.json in Resources */ = {isa = PBXBuildFile; fileRef = 7143E213202FCFC000451903 /* debug_category_filter.json */; };
 		7143E217202FD15A00451903 /* category.json in Resources */ = {isa = PBXBuildFile; fileRef = 7143E216202FD15A00451903 /* category.json */; };
-		7143E21B202FD1DC00451903 /* createContact.json in Resources */ = {isa = PBXBuildFile; fileRef = 7143E219202FD1DC00451903 /* createContact.json */; };
-		7143E21D202FD21F00451903 /* editContact.json in Resources */ = {isa = PBXBuildFile; fileRef = 7143E21C202FD21F00451903 /* editContact.json */; };
 		7143E220202FD28900451903 /* TearSheet.json in Resources */ = {isa = PBXBuildFile; fileRef = 7143E21E202FD28800451903 /* TearSheet.json */; };
 		7143E221202FD28900451903 /* placeOrderTemplate.json in Resources */ = {isa = PBXBuildFile; fileRef = 7143E21F202FD28900451903 /* placeOrderTemplate.json */; };
 		7143E226202FD2CA00451903 /* so_thumb.json in Resources */ = {isa = PBXBuildFile; fileRef = 7143E222202FD2CA00451903 /* so_thumb.json */; };
@@ -210,7 +211,6 @@
 		7162A55C1C58724700AB630E /* ContactListTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 7162A5521C58724700AB630E /* ContactListTableViewCell.m */; };
 		7162A55D1C58724700AB630E /* ContactListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7162A5541C58724700AB630E /* ContactListViewController.m */; };
 		7162A55E1C58724700AB630E /* customer_advanced_search.json in Resources */ = {isa = PBXBuildFile; fileRef = 7162A5551C58724700AB630E /* customer_advanced_search.json */; };
-		7162A55F1C58724700AB630E /* customer_info_template.json in Resources */ = {isa = PBXBuildFile; fileRef = 7162A5561C58724700AB630E /* customer_info_template.json */; };
 		7162A5601C58724700AB630E /* CustomerEditViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7162A5581C58724700AB630E /* CustomerEditViewController.m */; };
 		7162A5611C58724700AB630E /* CustomerInfoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7162A55A1C58724700AB630E /* CustomerInfoViewController.m */; };
 		7162A5701C58728D00AB630E /* DetailHeaderCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 7162A5631C58728D00AB630E /* DetailHeaderCell.m */; };
@@ -315,6 +315,9 @@
 /* Begin PBXFileReference section */
 		3C2F99B6237BE1790000808F /* PortfolioListTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PortfolioListTableViewCell.m; path = common/Functions/portfolio/PortfolioListTableViewCell.m; sourceTree = SOURCE_ROOT; };
 		3C2F99B7237BE1790000808F /* PortfolioListTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PortfolioListTableViewCell.h; path = common/Functions/portfolio/PortfolioListTableViewCell.h; sourceTree = SOURCE_ROOT; };
+		3C3C92762906874A00EC3500 /* createContact.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = createContact.json; sourceTree = "<group>"; };
+		3C3C92782907BF4B00EC3500 /* editContact.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = editContact.json; sourceTree = "<group>"; };
+		3C3C927A2907C0C400EC3500 /* customer_info_template.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = customer_info_template.json; sourceTree = "<group>"; };
 		3C51492D273CF9B900F78617 /* DBUtil.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = DBUtil.h; path = common/DBUtil.h; sourceTree = SOURCE_ROOT; };
 		3C51492E273CF9B900F78617 /* DBUtil.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = DBUtil.m; path = common/DBUtil.m; sourceTree = SOURCE_ROOT; };
 		3C514930273D092A00F78617 /* EnumSelectViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EnumSelectViewController.h; path = ../../common/customUI/commoneditor/EnumSelectViewController.h; sourceTree = "<group>"; };
@@ -598,8 +601,6 @@
 		7143E211202FCF7600451903 /* CategoryCellNPD.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CategoryCellNPD.m; path = "iSales-NPD/CategoryCellNPD.m"; sourceTree = SOURCE_ROOT; };
 		7143E213202FCFC000451903 /* debug_category_filter.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = debug_category_filter.json; path = "iSales-NPD/debug_category_filter.json"; sourceTree = SOURCE_ROOT; };
 		7143E216202FD15A00451903 /* category.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = category.json; path = "iSales-NPD/category.json"; sourceTree = SOURCE_ROOT; };
-		7143E219202FD1DC00451903 /* createContact.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = createContact.json; path = "iSales-NPD/createContact.json"; sourceTree = SOURCE_ROOT; };
-		7143E21C202FD21F00451903 /* editContact.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = editContact.json; path = "iSales-NPD/editContact.json"; sourceTree = SOURCE_ROOT; };
 		7143E21E202FD28800451903 /* TearSheet.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = TearSheet.json; path = "iSales-NPD/TearSheet.json"; sourceTree = SOURCE_ROOT; };
 		7143E21F202FD28900451903 /* placeOrderTemplate.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = placeOrderTemplate.json; path = "iSales-NPD/placeOrderTemplate.json"; sourceTree = SOURCE_ROOT; };
 		7143E222202FD2CA00451903 /* so_thumb.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = so_thumb.json; path = "iSales-NPD/so_thumb.json"; sourceTree = SOURCE_ROOT; };
@@ -673,7 +674,6 @@
 		7162A5531C58724700AB630E /* ContactListViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ContactListViewController.h; path = common/Functions/contact/ContactListViewController.h; sourceTree = SOURCE_ROOT; };
 		7162A5541C58724700AB630E /* ContactListViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ContactListViewController.m; path = common/Functions/contact/ContactListViewController.m; sourceTree = SOURCE_ROOT; };
 		7162A5551C58724700AB630E /* customer_advanced_search.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = customer_advanced_search.json; path = common/Functions/contact/customer_advanced_search.json; sourceTree = SOURCE_ROOT; };
-		7162A5561C58724700AB630E /* customer_info_template.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = customer_info_template.json; path = common/Functions/contact/customer_info_template.json; sourceTree = SOURCE_ROOT; };
 		7162A5571C58724700AB630E /* CustomerEditViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CustomerEditViewController.h; path = common/Functions/contact/CustomerEditViewController.h; sourceTree = SOURCE_ROOT; };
 		7162A5581C58724700AB630E /* CustomerEditViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CustomerEditViewController.m; path = common/Functions/contact/CustomerEditViewController.m; sourceTree = SOURCE_ROOT; };
 		7162A5591C58724700AB630E /* CustomerInfoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CustomerInfoViewController.h; path = common/Functions/contact/CustomerInfoViewController.h; sourceTree = SOURCE_ROOT; };
@@ -1477,11 +1477,12 @@
 		7143E215202FD12B00451903 /* json */ = {
 			isa = PBXGroup;
 			children = (
+				3C3C927A2907C0C400EC3500 /* customer_info_template.json */,
+				3C3C92762906874A00EC3500 /* createContact.json */,
+				3C3C92782907BF4B00EC3500 /* editContact.json */,
 				3CE660A7287FCD3A00DDB14A /* contactAdvanceSearch.json */,
 				7143E213202FCFC000451903 /* debug_category_filter.json */,
 				7143E216202FD15A00451903 /* category.json */,
-				7143E219202FD1DC00451903 /* createContact.json */,
-				7143E21C202FD21F00451903 /* editContact.json */,
 				7143E21F202FD28900451903 /* placeOrderTemplate.json */,
 				7143E21E202FD28800451903 /* TearSheet.json */,
 				7143E22A202FD37500451903 /* orderDetail.json */,
@@ -1714,7 +1715,6 @@
 				7162A5531C58724700AB630E /* ContactListViewController.h */,
 				7162A5541C58724700AB630E /* ContactListViewController.m */,
 				7162A5551C58724700AB630E /* customer_advanced_search.json */,
-				7162A5561C58724700AB630E /* customer_info_template.json */,
 				7111E5711C76C557004763B3 /* customer_info_template_edit.json */,
 				7162A5571C58724700AB630E /* CustomerEditViewController.h */,
 				7162A5581C58724700AB630E /* CustomerEditViewController.m */,
@@ -2117,6 +2117,7 @@
 				7142E87A1DBF577A0077EFA2 /* KALINGA.TTF in Resources */,
 				7142E87B1DBF577A0077EFA2 /* KALINGAB.TTF in Resources */,
 				7143E228202FD2CA00451903 /* portfolio_2x3.json in Resources */,
+				3C3C92792907BF4B00EC3500 /* editContact.json in Resources */,
 				713F76C21929F4A7006A7305 /* Images.xcassets in Resources */,
 				3CE660A8287FCD3B00DDB14A /* contactAdvanceSearch.json in Resources */,
 				3C6831572396082800AD5BD7 /* ERP_Mobile_Cart.storyboard in Resources */,
@@ -2143,8 +2144,8 @@
 				71DF74951C57614C00F2789C /* PhotoBorder.png in Resources */,
 				7143E229202FD2CA00451903 /* so.json in Resources */,
 				3C6831562396082800AD5BD7 /* ERP_Mobile_Discard.storyboard in Resources */,
-				7162A55F1C58724700AB630E /* customer_info_template.json in Resources */,
 				7141DD3D1C5726B700F7DF59 /* softScanBeep.wav in Resources */,
+				3C3C92772906874A00EC3500 /* createContact.json in Resources */,
 				3C68316F2396094200AD5BD7 /* iPadCommonEditorCellModel.xib in Resources */,
 				4295AE1D1FE74D46007BE365 /* CommonEditorAutoCompleteView.xib in Resources */,
 				7141DD341C57269B00F7DF59 /* include in Resources */,
@@ -2163,14 +2164,13 @@
 				7143E226202FD2CA00451903 /* so_thumb.json in Resources */,
 				7165662E1EF3ACD900CB897F /* photostack_image.html in Resources */,
 				3C6831692396094200AD5BD7 /* CommonEditor.iPad.xib in Resources */,
+				3C3C927B2907C0C400EC3500 /* customer_info_template.json in Resources */,
 				3C51497D273E07D600F78617 /* EnumSelectAndSort.storyboard in Resources */,
 				712AFEE51DBDAF0300254965 /* pdfcreator.xcassets in Resources */,
-				7143E21B202FD1DC00451903 /* createContact.json in Resources */,
 				7162A55E1C58724700AB630E /* customer_advanced_search.json in Resources */,
 				3C514961273D09E700F78617 /* CommonEditor.storyboard in Resources */,
 				3C68316E2396094200AD5BD7 /* iPadCommonEditorCellAction.xib in Resources */,
 				7143E22E202FD3CD00451903 /* more_info.html in Resources */,
-				7143E21D202FD21F00451903 /* editContact.json in Resources */,
 				7162A5A11C58733400AB630E /* offline_status_filter_cadedate.json in Resources */,
 				42B309791E45BA32007AFC62 /* status_filter_cadedate_po.json in Resources */,
 			);
@@ -2549,7 +2549,7 @@
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				CURRENT_PROJECT_VERSION = 220718;
+				CURRENT_PROJECT_VERSION = 221108;
 				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -2583,6 +2583,10 @@
 				PRODUCT_BUNDLE_IDENTIFIER = "usai.apex.CONTRAST-Mobile";
 				PRODUCT_NAME = "CONTRAST Mobile";
 				PROVISIONING_PROFILE = "";
+				SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
+				SUPPORTS_MACCATALYST = NO;
+				SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
+				TARGETED_DEVICE_FAMILY = 2;
 				WRAPPER_EXTENSION = app;
 			};
 			name = Debug;
@@ -2593,7 +2597,7 @@
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				CURRENT_PROJECT_VERSION = 220718;
+				CURRENT_PROJECT_VERSION = 221108;
 				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -2627,6 +2631,10 @@
 				PRODUCT_BUNDLE_IDENTIFIER = "usai.apex.CONTRAST-Mobile";
 				PRODUCT_NAME = "CONTRAST Mobile";
 				PROVISIONING_PROFILE = "";
+				SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
+				SUPPORTS_MACCATALYST = NO;
+				SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
+				TARGETED_DEVICE_FAMILY = 2;
 				WRAPPER_EXTENSION = app;
 			};
 			name = Release;

+ 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>

+ 2 - 2
RedAnt ERP Mobile/iSales-CONTRAST/config.h

@@ -12,7 +12,7 @@
 #define BACKORDER_PROCESS // 允许backorder process
 #define JSON_TIMEOUT 30
 
-#define IGNORE_MPACK
+//#define IGNORE_SOLD_IN_QTY
 
 #define RA_NOTIFICATION
 
@@ -192,7 +192,7 @@
 #else
 
 
-//------------------- NPD server-----------------------
+//------------------- NPD server-----------------------OAt5HU
 
 #define URL_CHANGE_PASSWORD @""
 #define URL_SIGN_UP @""

+ 183 - 0
RedAnt ERP Mobile/iSales-CONTRAST/createContact.json

@@ -0,0 +1,183 @@
+{
+  "mode" : "Regular Mode",
+  "result" : 2,
+  "section_0" : {
+    "count" : 20,
+    "item_0" : {
+      "aname" : "Company Name",
+      "control" : "edit",
+      "keyboard" : "text",
+      "name" : "company",
+      "required" : "true",
+      "value" : ""
+    },
+    "item_19" : {
+      "aname" : "Carrier",
+      "cadedate" : "",
+      "control" : "enum",
+      "name" : "carrier",
+      "required" : "false",
+      "value" : "",
+      "single_select" : "true"
+    },
+    "item_1" : {
+      "aname" : "Contact ID",
+      "control" : "img",
+      "img_url_0" : "",
+      "img_url_1" : "",
+      "img_url_2" : "",
+      "name" : "business_card",
+      "value" : ""
+    },
+    "item_11" : {
+      "aname" : "Zip Code",
+      "control" : "edit",
+      "keyboard" : "text",
+      "name" : "zipcode",
+      "refresh" : 1,
+      "restore" : {
+        "count" : 3,
+        "item_0" : "state",
+        "item_1" : "city",
+        "item_2" : "country"
+      },
+      "value" : ""
+    },
+    "item_12" : {
+      "aname" : "State/Province",
+      "cadedate" : "",
+      "control" : "enum",
+      "name" : "state",
+      "required" : "true",
+      "single_select" : "true"
+    },
+    "item_13" : {
+      "aname" : "City",
+      "control" : "edit",
+      "keyboard" : "text",
+      "name" : "city",
+      "value" : ""
+    },
+    "item_14" : {
+      "aname" : "Contact First Name",
+      "capital" : "1",
+      "control" : "edit",
+      "keyboard" : "text",
+      "name" : "firstname",
+      "value" : ""
+    },
+    "item_15" : {
+      "aname" : "Contact Last Name",
+      "capital" : "1",
+      "control" : "edit",
+      "keyboard" : "text",
+      "name" : "lastname",
+      "value" : ""
+    },
+    "item_16" : {
+      "aname" : "Fax",
+      "control" : "edit",
+      "keyboard" : "text",
+      "name" : "fax",
+      "value" : ""
+    },
+    "item_17" : {
+      "aname" : "Contact Notes",
+      "control" : "text_view",
+      "name" : "contact_notes",
+      "value" : ""
+    },
+    "item_18" : {
+      "aname" : "Sales Rep",
+      "cadedate" : "",
+      "control" : "enum",
+      "max" : "3",
+      "name" : "sales_rep",
+      "single_select" : "true"
+    },
+    "item_2" : {
+      "aname" : "Price Type",
+      "cadedate" : "",
+      "control" : "enum",
+      "name" : "price_name",
+      "required" : "true",
+      "single_select" : "true"
+    },
+  "item_3" : {
+      "aname" : "Contact Type",
+      "cadedate" : "",
+      "control" : "enum",
+      "name" : "type_name",
+      "required" : "true",
+      "single_select" : "true"
+  },
+    "item_4" : {
+      "aname" : "Email",
+      "control" : "edit",
+      "keyboard" : "text",
+      "name" : "email",
+      "required" : "true",
+      "value" : ""
+    },
+    "item_5" : {
+      "aname" : "Phone",
+      "control" : "edit",
+      "keyboard" : "text",
+      "name" : "phone",
+      "required" : "true",
+      "value" : ""
+    },
+    "item_6" : {
+      "aname" : "Country",
+      "cadedate" : "",
+      "control" : "enum",
+      "name" : "country",
+      "refresh" : 1,
+      "restore" : {
+        "count" : 3,
+        "item_0" : "state",
+        "item_1" : "city",
+        "item_2" : "zipcode"
+      },
+      "single_select" : "true"
+    },
+    "item_7" : {
+      "aname" : "Address 1",
+      "control" : "edit",
+      "keyboard" : "text",
+      "name" : "address",
+      "value" : ""
+    },
+    "item_8" : {
+      "aname" : "Address 2",
+      "control" : "edit",
+      "keyboard" : "text",
+      "name" : "address2",
+      "value" : ""
+    },
+    "item_9" : {
+      "aname" : "Address 3",
+      "control" : "edit",
+      "keyboard" : "text",
+      "name" : "address_3",
+      "value" : ""
+    },
+    "item_10" : {
+      "aname" : "Address 4",
+      "control" : "edit",
+      "keyboard" : "text",
+      "name" : "address_4",
+      "value" : ""
+    },
+    "title" : "* field is required(NO RESIDENTIAL DELIVERY)"
+  },
+  "section_count" : 1,
+  "title" : "New Contact",
+  "up_params" : {
+    "count" : 4,
+    "val_0" : "zipcode",
+    "val_1" : "country",
+    "val_2" : "state",
+    "val_3" : "city"
+  }
+}

+ 154 - 0
RedAnt ERP Mobile/iSales-CONTRAST/customer_info_template.json

@@ -0,0 +1,154 @@
+{
+    "result": 1,
+    "readonly":"1",
+    "title": "Customer Information",
+    "section_count": 1,
+    "section_0": {
+        "title": "Customer Info",
+        "count": 20,
+        
+        "item_0": {
+            "aname": "Country",
+            "name": "customer_country",
+            "control": "text",
+            "value": ""
+        },
+        "item_19" : {
+          "aname" : "Carrier",
+          "cadedate" : "",
+          "control" : "text",
+          "name" : "customer_truck_carrier",
+        
+          "value" : "",
+        },
+        "item_1": {
+            "aname": "Company Name",
+            "name": "customer_name",
+            "control": "text",
+            "value": ""
+        },
+        "item_2": {
+            "aname": "Contact ID",
+            "name": "customer_cid",
+            "control": "img",
+            "img_url_0":"business_card_0",
+            "img_url_1":"business_card_1",
+            "img_url_2":"business_card_2",
+            "img_url_aname_0":"business_card_0",
+            "img_url_aname_1":"business_card_1",
+            "img_url_aname_2":"business_card_2",
+            "value": ""
+        },
+
+        "item_3": {
+            "aname": "Address 1",
+            "name": "customer_address1",
+            "control": "text",
+            "value": ""
+        },
+        "item_4": {
+            "aname": "Address 2",
+            "name": "customer_address2",
+            "control": "text",
+            "value": ""
+        },
+        "item_5": {
+            "aname": "Address 3",
+            "name": "customer_address3",
+            "control": "text",
+            "value": ""
+        },
+        "item_6": {
+            "aname": "Address 4",
+            "name": "customer_address4",
+            "control": "text",
+            "value": ""
+        },
+        "item_7": {
+            "aname": "Zip Code",
+            "name": "customer_zipcode",
+            "control": "text",
+            "value": ""
+        },
+        "item_8": {
+            "aname": "State/Province",
+            "name": "customer_state",
+            "control": "text",
+            "value": ""
+        },
+        "item_9": {
+            "aname": "City",
+            "name": "customer_city",
+            "control": "text",
+            "value": ""
+        },
+        "item_10": {
+            "aname": "Contact First Name",
+            "name": "customer_first_name",
+            "control": "edit",
+            "value": "",
+            "keyboard": "default"
+        },
+        "item_11": {
+            "aname": "Contact Last Name",
+            "name": "customer_last_name",
+            "control": "edit",
+            "value": "",
+            "keyboard": "default"
+        },
+        "item_12": {
+            "aname": "Phone",
+            "name": "customer_phone",
+            "control": "edit",
+            "value": "",
+            "keyboard": "phone"
+        },
+        "item_13": {
+            "aname": "Fax",
+            "name": "customer_fax",
+            "control": "edit",
+            "value": "",
+            "keyboard": "phone"
+        },
+        "item_14": {
+            "aname": "Email",
+            "name": "customer_email",
+            "control": "edit",
+            "value": "",
+            "keyboard": "email"
+        },
+        "item_15": {
+            "aname": "Contact Notes",
+            "name": "customer_contact_notes",
+            "control": "text_view",
+            "value": "",
+            "disable":"1",
+            
+        },
+        "item_16": {
+            "aname": "Price Type",
+            "name": "customer_price_type",
+            "control": "text",
+            "value": "",
+            
+        },
+        "item_17": {
+            "aname": "Contact Type",
+            "name": "customer_contact_type",
+            "control": "text",
+            "value": "",
+            
+        },
+        "item_18": {
+            "aname": "Sales Rep",
+            "name": "customer_sales_rep",
+            "control": "text",
+            "value": "",
+            
+        }
+
+
+        
+
+    }
+}

+ 189 - 0
RedAnt ERP Mobile/iSales-CONTRAST/editContact.json

@@ -0,0 +1,189 @@
+{
+  "mode" : "Regular Mode",
+  "result" : 2,
+  "section_0" : {
+    "count" : 21,
+    "item_0" : {
+      "aname" : "Country",
+      "cadedate" : "",
+      "control" : "enum",
+      "name" : "country",
+      "refresh" : 1,
+      "restore" : {
+        "count" : 3,
+        "item_0" : "state",
+        "item_1" : "city",
+        "item_2" : "zipcode"
+      },
+      "single_select" : "true"
+    },
+    "item_20" : {
+      "aname" : "Carrier",
+      "cadedate" : "",
+      "control" : "enum",
+      "name" : "carrier",
+      "required" : "false",
+      "value" : "",
+      "single_select" : "true"
+    },
+    "item_1" : {
+      "aname" : "Company Name",
+      "control" : "edit",
+      "keyboard" : "text",
+      "name" : "company",
+      "required" : "true",
+      "value" : ""
+    },
+    "item_10" : {
+      "aname" : "City",
+      "control" : "edit",
+      "keyboard" : "text",
+      "name" : "city",
+      "value" : ""
+    },
+    "item_11" : {
+      "aname" : "Contact First Name",
+      "capital" : "1",
+      "control" : "edit",
+      "keyboard" : "text",
+      "name" : "firstname",
+      "value" : ""
+    },
+    "item_12" : {
+      "aname" : "Contact Last Name",
+      "capital" : "1",
+      "control" : "edit",
+      "keyboard" : "text",
+      "name" : "lastname",
+      "value" : ""
+    },
+    "item_13" : {
+      "aname" : "Phone",
+      "control" : "edit",
+      "keyboard" : "text",
+      "name" : "phone",
+      "required" : "true",
+      "value" : ""
+    },
+    "item_14" : {
+      "aname" : "Fax",
+      "control" : "edit",
+      "keyboard" : "text",
+      "name" : "fax",
+      "value" : ""
+    },
+    "item_15" : {
+      "aname" : "Email",
+      "control" : "edit",
+      "keyboard" : "text",
+      "name" : "email",
+      "value" : ""
+    },
+    "item_16" : {
+      "aname" : "Contact Notes",
+      "control" : "text_view",
+      "name" : "contact_notes",
+      "value" : ""
+    },
+    "item_17" : {
+      "aname" : "Price Type",
+      "cadedate" : "",
+      "control" : "enum",
+      "name" : "price_name",
+      "single_select" : "true"
+    },
+  "item_18" : {
+      "aname" : "Contact Type",
+      "cadedate" : "",
+      "control" : "enum",
+      "name" : "type_name",
+      "single_select" : "true"
+  },
+    "item_19" : {
+      "aname" : "Sales Rep",
+      "cadedate" : "",
+      "control" : "enum",
+      "max" : "3",
+      "name" : "sales_rep",
+      "single_select" : "true"
+    },
+    "item_2" : {
+      "aname" : "Contact ID",
+      "control" : "edit",
+      "disable" : 1,
+      "name" : "contact_id",
+      "value" : ""
+    },
+    "item_3" : {
+      "aname" : "Picture",
+      "avalue" : "",
+      "control" : "img",
+      "img_url_0" : "",
+      "img_url_1" : "",
+      "img_url_2" : "",
+      "img_url_aname_0" : "",
+      "img_url_aname_1" : "",
+      "img_url_aname_2" : "",
+      "name" : "business_card"
+    },
+    "item_4" : {
+      "aname" : "Address 1",
+      "control" : "edit",
+      "keyboard" : "text",
+      "name" : "address",
+      "value" : ""
+    },
+    "item_5" : {
+      "aname" : "Address 2",
+      "control" : "edit",
+      "keyboard" : "text",
+      "name" : "address2",
+      "value" : ""
+    },
+    "item_6" : {
+      "aname" : "Address 3",
+      "control" : "edit",
+      "keyboard" : "text",
+      "name" : "address_3",
+      "value" : ""
+    },
+    "item_7" : {
+      "aname" : "Address 4",
+      "control" : "edit",
+      "keyboard" : "text",
+      "name" : "address_4",
+      "value" : ""
+    },
+    "item_8" : {
+      "aname" : "Zip Code",
+      "control" : "edit",
+      "keyboard" : "text",
+      "name" : "zipcode",
+      "refresh" : 1,
+      "restore" : {
+        "count" : 3,
+        "item_0" : "state",
+        "item_1" : "city",
+        "item_2" : "country"
+      },
+      "value" : ""
+    },
+    "item_9" : {
+      "aname" : "State/Province",
+      "cadedate" : "",
+      "control" : "enum",
+      "name" : "state",
+      "single_select" : "true"
+    },
+    "title" : "* field is required"
+  },
+  "section_count" : 1,
+  "title" : "Edit Customer",
+  "up_params" : {
+      "count" : 4,
+      "val_0" : "zipcode",
+      "val_1" : "country",
+      "val_2" : "state",
+      "val_3" : "city"
+  }
+}

BIN
Redant Drivers/Apex And Drivers.xcodeproj/project.xcworkspace/xcuserdata/ruizhang.xcuserdatad/UserInterfaceState.xcuserstate


+ 1 - 0
Redant Drivers/Apex And Drivers/Info.plist

@@ -44,6 +44,7 @@
 	<key>UIBackgroundModes</key>
 	<array>
 		<string>remote-notification</string>
+		<string>location</string>
 	</array>
 	<key>UILaunchStoryboardName</key>
 	<string>LaunchScreen</string>

+ 2 - 2
Redant Drivers/Apex And Drivers/config.h

@@ -18,11 +18,11 @@
 #define ApexDriverRedColor UIColorFromRGB(0xAE2838)
 
 # ifdef DEBUG
-//#define test_server
+#define test_server
 # endif
 
 #ifdef test_server
-    #define URL_HOST                @"http://192.168.0.138:8080/TruckingSuiteOnline/"
+    #define URL_HOST                @"http://10.0.0.123:8080/TruckingSuiteOnline/"
 # else
 
     #define URL_HOST                @"https://ra.apexshipping.com/t"

+ 1 - 1
common/RAConvertor.m

@@ -174,7 +174,7 @@ begin:
     NSDictionary *string2dic = [NSJSONSerialization JSONObjectWithData: [str dataUsingEncoding:NSUTF8StringEncoding]
                                                                options: NSJSONReadingMutableContainers
                                                                  error: &error];
-    DebugLog(@"%@",string2dic);
+//    DebugLog(@"%@",string2dic);
     return string2dic;
 }
 

+ 5 - 0
common/customUI/commoneditor/CommonEditorCellModel.m

@@ -30,6 +30,11 @@
     self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
     if (self) {
         // Initialization code
+#ifndef BUILD_CONTRAST
+        self.labelMasterPack.hidden=true;
+#else
+        self.labelMasterPack.hidden=false;
+#endif
     }
     return self;
 }

+ 4 - 2
common/customUI/commoneditor/CommonEditorViewController.m

@@ -4292,7 +4292,7 @@ if(!self.alert.isBeingDismissed)
             //            NSString* mp = [item_json valueForKey:@"stockUom"];
             double unitprice=[[item_json valueForKey:@"unit_price"] doubleValue];
             int stockUom =[[item_json valueForKey:@"stockUom"] intValue];
-            int mPack =[[item_json valueForKey:@"mPack"] intValue];
+            int mPack =[[item_json valueForKey:@"mpack"] intValue];
             double discount =[[item_json valueForKey:@"discount"] doubleValue];
             NSString* discountstr=[NSString stringWithFormat:@"%@%% off", [RAUtils FloatFormat:discount]];
 
@@ -4351,7 +4351,9 @@ if(!self.alert.isBeingDismissed)
             cell.labelOldPrice.text = oldprice;
             cell.labelMasterPack.text =[NSString stringWithFormat:@"Sold in QTY of:%d", stockUom];
             cell.labelmPack.text =[NSString stringWithFormat:@"MPack:%d", mPack];
-            
+#ifdef BUILD_CONTRAST
+            cell.labelmPack.hidden = false;
+#endif
             bool isfree = [[item_json valueForKey:@"is_free"]boolValue];