Selaa lähdekoodia

Scan order 1.05

Ray Zhang 3 vuotta sitten
vanhempi
commit
61168a35a7
71 muutettua tiedostoa jossa 3027 lisäystä ja 1162 poistoa
  1. 21 13
      RedAnt ERP Mobile/HMLG Scan Order.xcodeproj/project.pbxproj
  2. 1 1
      RedAnt ERP Mobile/HMLG Scan Order.xcodeproj/xcuserdata/ruizhang.xcuserdatad/xcschemes/xcschememanagement.plist
  3. 189 36
      RedAnt ERP Mobile/HMLG Scan Order/Base.lproj/Main.storyboard
  4. 6 6
      RedAnt ERP Mobile/HMLG Scan Order/Images.xcassets/LaunchIcon.imageset/Contents.json
  5. BIN
      RedAnt ERP Mobile/HMLG Scan Order/Images.xcassets/LaunchIcon.imageset/appicon-1.png
  6. BIN
      RedAnt ERP Mobile/HMLG Scan Order/Images.xcassets/LaunchIcon.imageset/appicon-2.png
  7. BIN
      RedAnt ERP Mobile/HMLG Scan Order/Images.xcassets/LaunchIcon.imageset/appicon.png
  8. 6 6
      RedAnt ERP Mobile/HMLG Scan Order/Images.xcassets/about.imageset/Contents.json
  9. BIN
      RedAnt ERP Mobile/HMLG Scan Order/Images.xcassets/about.imageset/appicon-1.png
  10. BIN
      RedAnt ERP Mobile/HMLG Scan Order/Images.xcassets/about.imageset/appicon-2.png
  11. BIN
      RedAnt ERP Mobile/HMLG Scan Order/Images.xcassets/about.imageset/appicon.png
  12. 23 0
      RedAnt ERP Mobile/HMLG Scan Order/Images.xcassets/btn_bg.imageset/Contents.json
  13. BIN
      RedAnt ERP Mobile/HMLG Scan Order/Images.xcassets/btn_bg.imageset/appicon-1.png
  14. BIN
      RedAnt ERP Mobile/HMLG Scan Order/Images.xcassets/btn_bg.imageset/appicon-2.png
  15. BIN
      RedAnt ERP Mobile/HMLG Scan Order/Images.xcassets/btn_bg.imageset/appicon.png
  16. BIN
      RedAnt ERP Mobile/HMLG Scan Order/Images.xcassets/order.imageset/appicon-1.png
  17. BIN
      RedAnt ERP Mobile/HMLG Scan Order/Images.xcassets/order.imageset/appicon-2.png
  18. BIN
      RedAnt ERP Mobile/HMLG Scan Order/Images.xcassets/order.imageset/appicon.png
  19. 1 1
      RedAnt ERP Mobile/HMLG Scan Order/Images.xcassets/server_bg.imageset/Contents.json
  20. BIN
      RedAnt ERP Mobile/HMLG Scan Order/Images.xcassets/server_bg.imageset/{3976D19D-91F0-B17C-F624-62CB9BD6882C}.jpg
  21. 10 0
      RedAnt ERP Mobile/HMLG Scan Order/MainViewController.h
  22. 97 40
      RedAnt ERP Mobile/HMLG Scan Order/MainViewController.m
  23. 151 154
      RedAnt ERP Mobile/HMLG Scan Order/SO.storyboard
  24. 1 1
      RedAnt ERP Mobile/HMLG Scan Order/ScanCartItemCell.h
  25. 23 13
      RedAnt ERP Mobile/HMLG Scan Order/ScanCartItemCell.m
  26. 20 0
      RedAnt ERP Mobile/HMLG Scan Order/ScanHomeCell.h
  27. 24 0
      RedAnt ERP Mobile/HMLG Scan Order/ScanHomeCell.m
  28. 20 0
      RedAnt ERP Mobile/HMLG Scan Order/ScanHomeViewController.h
  29. 194 0
      RedAnt ERP Mobile/HMLG Scan Order/ScanHomeViewController.m
  30. 53 6
      RedAnt ERP Mobile/HMLG Scan Order/ScanListCell.m
  31. 3 1
      RedAnt ERP Mobile/HMLG Scan Order/ScanModelListCell.h
  32. 114 5
      RedAnt ERP Mobile/HMLG Scan Order/ScanModelListCell.m
  33. 3 0
      RedAnt ERP Mobile/HMLG Scan Order/ScanOrderModelListViewController.h
  34. 67 6
      RedAnt ERP Mobile/HMLG Scan Order/ScanOrderModelListViewController.m
  35. 7 1
      RedAnt ERP Mobile/HMLG Scan Order/ScanOrderScanModelViewController.m
  36. 9 0
      RedAnt ERP Mobile/HMLG Scan Order/ScanSearchViewController.m
  37. 1 1
      RedAnt ERP Mobile/HMLG Scan Order/ScanServerListViewController.m
  38. 25 3
      RedAnt ERP Mobile/HMLG Scan Order/ServerSettingViewController.m
  39. 9 1
      RedAnt ERP Mobile/HMLG Scan Order/SetupServerViewController.m
  40. 6 3
      RedAnt ERP Mobile/HMLG Scan Order/config.h
  41. 3 5
      RedAnt ERP Mobile/Launch Screen.storyboard
  42. 9 1
      RedAnt ERP Mobile/common/AppDelegateBase.m
  43. 44 44
      RedAnt ERP Mobile/common/ERP_Mobile_Cart.storyboard
  44. 225 99
      RedAnt ERP Mobile/common/ERP_Mobile_Order.storyboard
  45. 1 1
      RedAnt ERP Mobile/common/Functions/OLO/OLOSettingViewController.m
  46. 2 0
      RedAnt ERP Mobile/common/Functions/OLO/ScanOrderListViewController.h
  47. 673 249
      RedAnt ERP Mobile/common/Functions/OLO/ScanOrderListViewController.m
  48. 18 0
      RedAnt ERP Mobile/common/Functions/OLO/guest.json
  49. 31 12
      RedAnt ERP Mobile/common/Functions/camscan/ScannerViewController.m
  50. 4 1
      RedAnt ERP Mobile/common/Functions/cart/CartGeneralNotesViewController.m
  51. 1 0
      RedAnt ERP Mobile/common/Functions/cart/CartViewController.h
  52. 57 22
      RedAnt ERP Mobile/common/Functions/cart/CartViewController.m
  53. 3 0
      RedAnt ERP Mobile/common/Functions/offline/OLDataProvider.h
  54. 264 264
      RedAnt ERP Mobile/common/Functions/offline/OLDataProvider.m
  55. 8 1
      RedAnt ERP Mobile/common/Functions/order/CreateOrderViewController.h
  56. 497 115
      RedAnt ERP Mobile/common/Functions/order/CreateOrderViewController.m
  57. 3 2
      RedAnt ERP Mobile/common/Functions/sidemenu/AboutViewController.m
  58. 1 0
      RedAnt ERP Mobile/common/Functions/signature/SignatureView.m
  59. 1 0
      RedAnt ERP Mobile/common/data_provider/RADataProvider.h
  60. 8 0
      RedAnt ERP Mobile/common/data_provider/RADataProvider.m
  61. 4 0
      RedAnt ERP Mobile/common/data_provider/RANetwork.h
  62. 30 7
      RedAnt ERP Mobile/common/data_provider/RANetwork.m
  63. 1 7
      RedAnt ERP Mobile/iSales-CONTRAST.xcodeproj/project.pbxproj
  64. 1 1
      RedAnt ERP Mobile/iSales-CONTRAST.xcodeproj/xcuserdata/ruizhang.xcuserdatad/xcschemes/xcschememanagement.plist
  65. 1 7
      RedAnt ERP Mobile/iSales-NPD.xcodeproj/project.pbxproj
  66. 9 9
      RedAnt ERP Mobile/iSales-NPD/Base.lproj/OLM.storyboard
  67. 1 7
      RedAnt ERP Mobile/iSales-USAI.xcodeproj/project.pbxproj
  68. 18 7
      RedAnt ERP Mobile/iSales-USAI/config.h
  69. 1 0
      common/NetworkUtils.m
  70. 3 0
      common/customUI/commoneditor/CommonEditorViewController.h
  71. 21 3
      common/customUI/commoneditor/CommonEditorViewController.m

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

@@ -14,7 +14,6 @@
 		3C3A5B0127D74F91005F4EFB /* ScanOrderScanModelViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C3A5B0027D74F91005F4EFB /* ScanOrderScanModelViewController.m */; };
 		3C3A5B0327D87BA1005F4EFB /* SO.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3C3A5B0227D87BA1005F4EFB /* SO.storyboard */; };
 		3C473C9127C4D22900CC8C12 /* ScanUserListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C473C9027C4D22900CC8C12 /* ScanUserListViewController.m */; };
-		3C4DA61627B4E95C001EB44E /* HMLG Scan Order-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3C4DA61527B4E95C001EB44E /* HMLG Scan Order-Info.plist */; };
 		3C4DA61F27B50199001EB44E /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3C4DA61D27B50199001EB44E /* Main.storyboard */; };
 		3C4DA62527B503B1001EB44E /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C4DA62327B503B1001EB44E /* MainViewController.m */; };
 		3C51492F273CF9B900F78617 /* DBUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C51492E273CF9B900F78617 /* DBUtil.m */; };
@@ -48,7 +47,6 @@
 		3C514995273E091500F78617 /* PhotoPreviewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C514990273E091500F78617 /* PhotoPreviewCell.m */; };
 		3C514999273E097C00F78617 /* RAProgressHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C514998273E097B00F78617 /* RAProgressHUD.m */; };
 		3C51E7BD27B2599E00E61163 /* ScanOrderListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C51E7BC27B2599E00E61163 /* ScanOrderListViewController.m */; };
-		3C51E7CA27B261EC00E61163 /* RANetworkTaskDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C51E7C227B261EC00E61163 /* RANetworkTaskDelegate.m */; };
 		3C51E7CB27B261EC00E61163 /* RAUploadOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C51E7C327B261EC00E61163 /* RAUploadOperation.m */; };
 		3C51E7CC27B261EC00E61163 /* RAUploadListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C51E7C527B261EC00E61163 /* RAUploadListViewController.m */; };
 		3C51E7CD27B261EC00E61163 /* RAUploadManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C51E7C827B261EC00E61163 /* RAUploadManager.m */; };
@@ -85,7 +83,10 @@
 		3C8855AA27E85A0C005DC3FA /* ScanCartItemCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C8855A927E85A0C005DC3FA /* ScanCartItemCell.m */; };
 		3C9F81D427F6E04300B4C511 /* SetupServerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C9F81D327F6E04300B4C511 /* SetupServerViewController.m */; };
 		3C9F81D727F831A500B4C511 /* ScanServerListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C9F81D627F831A500B4C511 /* ScanServerListViewController.m */; };
+		3CABBF122836224500FA3352 /* guest.json in Resources */ = {isa = PBXBuildFile; fileRef = 3CABBF112836224400FA3352 /* guest.json */; };
 		3CC1122B279163F4004ACA57 /* offline_order_new_contact.json in Resources */ = {isa = PBXBuildFile; fileRef = 3CC1122A279163F4004ACA57 /* offline_order_new_contact.json */; };
+		3CD54A79282CF21D0073A15D /* ScanHomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CD54A78282CF21D0073A15D /* ScanHomeViewController.m */; };
+		3CD54A7C282CF4930073A15D /* ScanHomeCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CD54A7B282CF4930073A15D /* ScanHomeCell.m */; };
 		3CDDB25C273A564200681F78 /* DefaultTableHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CDDB25A273A564200681F78 /* DefaultTableHeaderView.m */; };
 		3CDDB262273A59DF00681F78 /* TouchImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CDDB260273A59DF00681F78 /* TouchImageView.m */; };
 		3CDDB265273A59EF00681F78 /* RTLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CDDB264273A59EF00681F78 /* RTLabel.m */; };
@@ -415,11 +416,9 @@
 		3C51499A273E0B6400F78617 /* common_const.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = common_const.h; path = ../../common/common_const.h; sourceTree = "<group>"; };
 		3C51E7BB27B2599E00E61163 /* ScanOrderListViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ScanOrderListViewController.h; path = common/Functions/OLO/ScanOrderListViewController.h; sourceTree = SOURCE_ROOT; };
 		3C51E7BC27B2599E00E61163 /* ScanOrderListViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = ScanOrderListViewController.m; path = common/Functions/OLO/ScanOrderListViewController.m; sourceTree = SOURCE_ROOT; };
-		3C51E7C227B261EC00E61163 /* RANetworkTaskDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RANetworkTaskDelegate.m; sourceTree = "<group>"; };
 		3C51E7C327B261EC00E61163 /* RAUploadOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RAUploadOperation.m; sourceTree = "<group>"; };
 		3C51E7C427B261EC00E61163 /* RAUploadManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RAUploadManager.h; sourceTree = "<group>"; };
 		3C51E7C527B261EC00E61163 /* RAUploadListViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RAUploadListViewController.m; sourceTree = "<group>"; };
-		3C51E7C627B261EC00E61163 /* RANetworkTaskDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RANetworkTaskDelegate.h; sourceTree = "<group>"; };
 		3C51E7C727B261EC00E61163 /* RAUploadOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RAUploadOperation.h; sourceTree = "<group>"; };
 		3C51E7C827B261EC00E61163 /* RAUploadManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RAUploadManager.m; sourceTree = "<group>"; };
 		3C51E7C927B261EC00E61163 /* RAUploadListViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RAUploadListViewController.h; sourceTree = "<group>"; };
@@ -467,7 +466,12 @@
 		3C9F81D327F6E04300B4C511 /* SetupServerViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SetupServerViewController.m; sourceTree = "<group>"; };
 		3C9F81D527F831A500B4C511 /* ScanServerListViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ScanServerListViewController.h; sourceTree = "<group>"; };
 		3C9F81D627F831A500B4C511 /* ScanServerListViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ScanServerListViewController.m; sourceTree = "<group>"; };
+		3CABBF112836224400FA3352 /* guest.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = guest.json; path = common/Functions/OLO/guest.json; sourceTree = SOURCE_ROOT; };
 		3CC1122A279163F4004ACA57 /* offline_order_new_contact.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = offline_order_new_contact.json; path = common/Functions/contact/offline_order_new_contact.json; sourceTree = SOURCE_ROOT; };
+		3CD54A77282CF21D0073A15D /* ScanHomeViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ScanHomeViewController.h; sourceTree = "<group>"; };
+		3CD54A78282CF21D0073A15D /* ScanHomeViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ScanHomeViewController.m; sourceTree = "<group>"; };
+		3CD54A7A282CF4930073A15D /* ScanHomeCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ScanHomeCell.h; sourceTree = "<group>"; };
+		3CD54A7B282CF4930073A15D /* ScanHomeCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ScanHomeCell.m; sourceTree = "<group>"; };
 		3CDDB25A273A564200681F78 /* DefaultTableHeaderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DefaultTableHeaderView.m; path = ../../common/customUI/commoneditor/DefaultTableHeaderView.m; sourceTree = "<group>"; };
 		3CDDB25B273A564200681F78 /* DefaultTableHeaderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DefaultTableHeaderView.h; path = ../../common/customUI/commoneditor/DefaultTableHeaderView.h; sourceTree = "<group>"; };
 		3CDDB25F273A597B00681F78 /* const.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = const.h; path = common/const.h; sourceTree = SOURCE_ROOT; };
@@ -1027,11 +1031,9 @@
 		3C51E7C127B261EC00E61163 /* upload */ = {
 			isa = PBXGroup;
 			children = (
-				3C51E7C227B261EC00E61163 /* RANetworkTaskDelegate.m */,
 				3C51E7C327B261EC00E61163 /* RAUploadOperation.m */,
 				3C51E7C427B261EC00E61163 /* RAUploadManager.h */,
 				3C51E7C527B261EC00E61163 /* RAUploadListViewController.m */,
-				3C51E7C627B261EC00E61163 /* RANetworkTaskDelegate.h */,
 				3C51E7C727B261EC00E61163 /* RAUploadOperation.h */,
 				3C51E7C827B261EC00E61163 /* RAUploadManager.m */,
 				3C51E7C927B261EC00E61163 /* RAUploadListViewController.h */,
@@ -1048,6 +1050,7 @@
 				3C51E7C127B261EC00E61163 /* upload */,
 				3CF33C8927BF4936001CBEEC /* ServerSettingViewController.h */,
 				3CF33C8A27BF4936001CBEEC /* ServerSettingViewController.m */,
+				3CABBF112836224400FA3352 /* guest.json */,
 				3C872A1D27955CF300BE1FC8 /* scan_cart.json */,
 				3C872A252797FE7C00BE1FC8 /* scan_order.json */,
 				3C51E7BB27B2599E00E61163 /* ScanOrderListViewController.h */,
@@ -1081,6 +1084,10 @@
 				3C16916B27FE7E3000026FE5 /* SignUpViewController.m */,
 				3C16916D280004E000026FE5 /* ChangePasswordViewController.h */,
 				3C16916E280004E000026FE5 /* ChangePasswordViewController.m */,
+				3CD54A77282CF21D0073A15D /* ScanHomeViewController.h */,
+				3CD54A78282CF21D0073A15D /* ScanHomeViewController.m */,
+				3CD54A7A282CF4930073A15D /* ScanHomeCell.h */,
+				3CD54A7B282CF4930073A15D /* ScanHomeCell.m */,
 			);
 			name = OLO;
 			sourceTree = "<group>";
@@ -2184,7 +2191,7 @@
 		713F769E1929F4A7006A7305 /* Project object */ = {
 			isa = PBXProject;
 			attributes = {
-				LastUpgradeCheck = 1200;
+				LastUpgradeCheck = 1330;
 				ORGANIZATIONNAME = "United Software Applications, Inc";
 				TargetAttributes = {
 					713F76A51929F4A7006A7305 = {
@@ -2237,6 +2244,7 @@
 				42E489611EE63F4E007256A0 /* more_color_64.png in Resources */,
 				713F76B41929F4A7006A7305 /* InfoPlist.strings in Resources */,
 				7165662F1EF3ACD900CB897F /* photostack_video.html in Resources */,
+				3CABBF122836224500FA3352 /* guest.json in Resources */,
 				3C6831712396094200AD5BD7 /* iPadCommonEditorCellSignature.xib in Resources */,
 				3C6831722396094200AD5BD7 /* iPadCommonEditorCellEdit.xib in Resources */,
 				7162A5A01C58733400AB630E /* status_filter_cadedate_open.json in Resources */,
@@ -2260,7 +2268,6 @@
 				7162A55F1C58724700AB630E /* customer_info_template.json in Resources */,
 				7141DD3D1C5726B700F7DF59 /* softScanBeep.wav in Resources */,
 				3C68316F2396094200AD5BD7 /* iPadCommonEditorCellModel.xib in Resources */,
-				3C4DA61627B4E95C001EB44E /* HMLG Scan Order-Info.plist in Resources */,
 				3C3A5B0327D87BA1005F4EFB /* SO.storyboard in Resources */,
 				4295AE1D1FE74D46007BE365 /* CommonEditorAutoCompleteView.xib in Resources */,
 				3C872A1E27955CF300BE1FC8 /* scan_cart.json in Resources */,
@@ -2317,6 +2324,7 @@
 				712AFEDC1DBA050200254965 /* PDFDrawable.m in Sources */,
 				7195623C1CF57D1800C74A49 /* CategoryHeaderView.m in Sources */,
 				3C51E7D327B2628900E61163 /* UIView+Toast.m in Sources */,
+				3CD54A79282CF21D0073A15D /* ScanHomeViewController.m in Sources */,
 				712AFED81DBA050200254965 /* GridDrawable.m in Sources */,
 				424A02D11FFB3A0B0088DC56 /* RABackOrderSubmitAlertController.m in Sources */,
 				7162A5C11C5873BB00AB630E /* FilterCellCadedate.m in Sources */,
@@ -2443,6 +2451,7 @@
 				712AFEDE1DBA050200254965 /* TableDrawable.m in Sources */,
 				7162A5CB1C58761500AB630E /* SignatureViewController.m in Sources */,
 				7162A5DD1C5876E300AB630E /* PopupNavigationController.m in Sources */,
+				3CD54A7C282CF4930073A15D /* ScanHomeCell.m in Sources */,
 				7162A59E1C58733400AB630E /* OrderListTableViewCell.m in Sources */,
 				714B1F401C7BF74100539193 /* OrderDetailSignatureCell.m in Sources */,
 				4289802E1E2492D2005F1BD8 /* SetCategoryPriceController.m in Sources */,
@@ -2501,7 +2510,6 @@
 				713F76B61929F4A7006A7305 /* main.m in Sources */,
 				71BF06FE1D2F3CBA00981938 /* OfflineSettingViewController.m in Sources */,
 				71DF74341C5757DA00F2789C /* ActiveViewController.m in Sources */,
-				3C51E7CA27B261EC00E61163 /* RANetworkTaskDelegate.m in Sources */,
 				7162A5431C58719D00AB630E /* RATreeNodeInfo.m in Sources */,
 				3C51494B273D095900F78617 /* CommonEditorCellLabel.m in Sources */,
 				71FFBBE91C60894900D91DC2 /* iSalesDB.m in Sources */,
@@ -2687,7 +2695,7 @@
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				CURRENT_PROJECT_VERSION = 50448;
+				CURRENT_PROJECT_VERSION = 50780;
 				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -2704,7 +2712,7 @@
 					"$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib",
 					"$(PROJECT_DIR)/GoogleAnalytics/GoogleAnalytics/Libraries",
 				);
-				MARKETING_VERSION = 1.02;
+				MARKETING_VERSION = 1.05;
 				OTHER_LDFLAGS = (
 					"$(inherited)",
 					"-ObjC",
@@ -2731,7 +2739,7 @@
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				CURRENT_PROJECT_VERSION = 50448;
+				CURRENT_PROJECT_VERSION = 50780;
 				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -2748,7 +2756,7 @@
 					"$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib",
 					"$(PROJECT_DIR)/GoogleAnalytics/GoogleAnalytics/Libraries",
 				);
-				MARKETING_VERSION = 1.02;
+				MARKETING_VERSION = 1.05;
 				OTHER_LDFLAGS = (
 					"$(inherited)",
 					"-ObjC",

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

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

+ 189 - 36
RedAnt ERP Mobile/HMLG Scan Order/Base.lproj/Main.storyboard

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="19529" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="jsC-F8-zYF">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="jsC-F8-zYF">
     <device id="ipad7_9" orientation="portrait" layout="fullscreen" appearance="light"/>
     <dependencies>
         <deployment version="4352" identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19519"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -25,13 +25,17 @@
                                 <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                 <subviews>
                                     <view clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="hTL-PV-pUp" customClass="MainHeaderViewColorPanel">
-                                        <rect key="frame" x="130" y="20" width="460" height="72"/>
+                                        <rect key="frame" x="130" y="24" width="460" height="76"/>
                                         <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
                                         <subviews>
-                                            <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="qK2-gY-nOG" userLabel="cart button">
-                                                <rect key="frame" x="0.0" y="0.0" width="72" height="72"/>
+                                            <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="qK2-gY-nOG" userLabel="cart button">
+                                                <rect key="frame" x="0.0" y="0.0" width="72" height="76"/>
                                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
-                                                <state key="normal" image="cart_empty"/>
+                                                <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                                                <state key="normal" image="cart_empty">
+                                                    <color key="titleColor" systemColor="systemYellowColor"/>
+                                                    <preferredSymbolConfiguration key="preferredSymbolConfiguration"/>
+                                                </state>
                                                 <connections>
                                                     <action selector="switchToCart:" destination="BYZ-38-t0r" eventType="touchUpInside" id="MmJ-aK-UGJ"/>
                                                 </connections>
@@ -49,32 +53,32 @@
                                                     </userDefinedRuntimeAttribute>
                                                 </userDefinedRuntimeAttributes>
                                             </label>
-                                            <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="wordWrap" translatesAutoresizingMaskIntoConstraints="NO" id="04b-vI-vkz" userLabel="order button">
-                                                <rect key="frame" x="79" y="0.0" width="72" height="72"/>
-                                                <autoresizingMask key="autoresizingMask" flexibleMaxY="YES"/>
-                                                <state key="normal" image="order"/>
-                                                <connections>
-                                                    <action selector="switchToOrder:" destination="BYZ-38-t0r" eventType="touchUpInside" id="GdL-E5-zaV"/>
-                                                </connections>
-                                            </button>
-                                            <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Nz4-iJ-NSG" userLabel="setting button">
-                                                <rect key="frame" x="388" y="0.0" width="72" height="72"/>
+                                            <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Nz4-iJ-NSG" userLabel="setting button">
+                                                <rect key="frame" x="388" y="0.0" width="72" height="76"/>
                                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                                 <state key="normal" image="setting"/>
                                                 <connections>
                                                     <action selector="onScanOrderSetting:" destination="BYZ-38-t0r" eventType="touchUpInside" id="LzV-0I-k5y"/>
                                                 </connections>
                                             </button>
-                                            <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="OLi-re-vUv" userLabel="list button">
-                                                <rect key="frame" x="230" y="0.0" width="72" height="72"/>
+                                            <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="wordWrap" translatesAutoresizingMaskIntoConstraints="NO" id="04b-vI-vkz" userLabel="order button">
+                                                <rect key="frame" x="79" y="0.0" width="72" height="76"/>
+                                                <autoresizingMask key="autoresizingMask" flexibleMaxY="YES"/>
+                                                <state key="normal" image="order"/>
+                                                <connections>
+                                                    <action selector="switchToOrder:" destination="BYZ-38-t0r" eventType="touchUpInside" id="GdL-E5-zaV"/>
+                                                </connections>
+                                            </button>
+                                            <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="OLi-re-vUv" userLabel="list button">
+                                                <rect key="frame" x="230" y="0.0" width="72" height="76"/>
                                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                                 <state key="normal" image="wishlist"/>
                                                 <connections>
                                                     <action selector="switchToList:" destination="BYZ-38-t0r" eventType="touchUpInside" id="a6g-zn-YIl"/>
                                                 </connections>
                                             </button>
-                                            <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="U68-uF-QmO" userLabel="search button">
-                                                <rect key="frame" x="309" y="0.0" width="72" height="72"/>
+                                            <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="U68-uF-QmO" userLabel="search button">
+                                                <rect key="frame" x="309" y="0.0" width="72" height="76"/>
                                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                                 <state key="normal" image="search"/>
                                                 <connections>
@@ -82,7 +86,7 @@
                                                 </connections>
                                             </button>
                                             <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="nIa-ra-HBo" userLabel="scan button">
-                                                <rect key="frame" x="151" y="0.0" width="72" height="72"/>
+                                                <rect key="frame" x="151" y="0.0" width="72" height="76"/>
                                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                                 <state key="normal" image="scan"/>
                                                 <connections>
@@ -98,6 +102,9 @@
                                         <state key="normal" image="npd_logo">
                                             <color key="titleColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                         </state>
+                                        <connections>
+                                            <action selector="switchToHome:" destination="BYZ-38-t0r" eventType="touchUpInside" id="R5g-Vs-NdR"/>
+                                        </connections>
                                     </button>
                                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="A6K-Xr-CN6" userLabel="server">
                                         <rect key="frame" x="5" y="50" width="120" height="21"/>
@@ -123,7 +130,7 @@
                                         <fontDescription key="fontDescription" type="system" pointSize="15"/>
                                         <nil key="highlightedColor"/>
                                     </label>
-                                    <button opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="top" buttonType="system" lineBreakMode="wordWrap" translatesAutoresizingMaskIntoConstraints="NO" id="A7D-bo-1PR" userLabel="contact">
+                                    <button hidden="YES" opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="top" buttonType="system" lineBreakMode="wordWrap" translatesAutoresizingMaskIntoConstraints="NO" id="A7D-bo-1PR" userLabel="contact">
                                         <rect key="frame" x="583" y="50" width="161" height="50"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
                                         <fontDescription key="fontDescription" type="system" pointSize="14"/>
@@ -158,7 +165,6 @@
                                 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                             </imageView>
                             <button hidden="YES" opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="DGA-Jz-ciO">
-                                <rect key="frame" x="0.0" y="0.0" width="744" height="1133"/>
                                 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                 <state key="normal">
                                     <color key="titleColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
@@ -290,6 +296,11 @@
                         <outlet property="btnScan" destination="nIa-ra-HBo" id="9NC-Bf-vic"/>
                         <outlet property="btn_LogoHome" destination="W7z-q5-hQg" id="lr2-rw-0yi"/>
                         <outlet property="btn_sideMenu_UserName" destination="Rki-F9-VV1" id="U1D-pK-gzg"/>
+                        <outlet property="btncart" destination="qK2-gY-nOG" id="aqC-p5-Agr"/>
+                        <outlet property="btnlist" destination="OLi-re-vUv" id="mGh-no-SPe"/>
+                        <outlet property="btnorder" destination="04b-vI-vkz" id="d9x-9n-75Q"/>
+                        <outlet property="btnsearch" destination="U68-uF-QmO" id="jFv-Xz-JGP"/>
+                        <outlet property="btnsetting" destination="Nz4-iJ-NSG" id="bKj-Vu-fqX"/>
                         <outlet property="buttonUser" destination="0eT-W5-bga" id="F4r-LC-G5r"/>
                         <outlet property="container" destination="Knj-5z-t35" id="xY9-0x-HET"/>
                         <outlet property="employee_bp" destination="hTL-PV-pUp" id="WrQ-II-a4s"/>
@@ -1584,7 +1595,7 @@
                                 <rect key="frame" x="0.0" y="0.0" width="480" height="320"/>
                                 <subviews>
                                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="NPD Mobile" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="u8k-9F-gQG">
-                                        <rect key="frame" x="139" y="33" width="306" height="21"/>
+                                        <rect key="frame" x="128" y="33" width="317" height="21"/>
                                         <constraints>
                                             <constraint firstAttribute="height" constant="21" id="Ifh-bc-FmB"/>
                                         </constraints>
@@ -1593,27 +1604,27 @@
                                         <nil key="highlightedColor"/>
                                     </label>
                                     <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="about" translatesAutoresizingMaskIntoConstraints="NO" id="tQE-Kl-1v3">
-                                        <rect key="frame" x="35" y="19" width="96" height="96"/>
+                                        <rect key="frame" x="24" y="19" width="96" height="96"/>
                                         <constraints>
                                             <constraint firstAttribute="width" constant="96" id="CbL-zf-w1P"/>
                                             <constraint firstAttribute="height" constant="96" id="kzE-hA-dq5"/>
                                         </constraints>
                                     </imageView>
                                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="New Pacific Direct" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Jh9-JO-Lbj">
-                                        <rect key="frame" x="139" y="54" width="306" height="61"/>
+                                        <rect key="frame" x="128" y="54" width="317" height="61"/>
                                         <fontDescription key="fontDescription" type="system" pointSize="24"/>
                                         <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                         <nil key="highlightedColor"/>
                                     </label>
                                     <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="red_ant_logo" translatesAutoresizingMaskIntoConstraints="NO" id="7er-Pu-WBZ">
-                                        <rect key="frame" x="35" y="236" width="36" height="36"/>
+                                        <rect key="frame" x="24" y="223" width="36" height="36"/>
                                         <constraints>
                                             <constraint firstAttribute="width" constant="36" id="EKI-by-JCU"/>
                                             <constraint firstAttribute="height" constant="36" id="eWz-Oq-rWf"/>
                                         </constraints>
                                     </imageView>
                                     <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" editable="NO" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="4Fi-0g-FiI">
-                                        <rect key="frame" x="35" y="115" width="409" height="60"/>
+                                        <rect key="frame" x="24" y="115" width="420" height="60"/>
                                         <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                         <constraints>
                                             <constraint firstAttribute="height" constant="60" id="xaf-0H-Hqr"/>
@@ -1625,11 +1636,11 @@ Phone: 510.818.9388</string>
                                         <dataDetectorType key="dataDetectorTypes" phoneNumber="YES" link="YES"/>
                                     </textView>
                                     <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" scrollEnabled="NO" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" editable="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dd8-jB-tBc">
-                                        <rect key="frame" x="79" y="202" width="366" height="78"/>
+                                        <rect key="frame" x="68" y="202" width="377" height="78"/>
                                         <constraints>
                                             <constraint firstAttribute="height" constant="78" id="vl3-wA-qey"/>
                                         </constraints>
-                                        <string key="text">Developed &amp; Copyright: 
+                                        <string key="text">Developed &amp; Tech support: 
 United Software Applications, Inc
 Email: redantsupport@united-us.net</string>
                                         <fontDescription key="fontDescription" name="HelveticaNeue" family="Helvetica Neue" pointSize="17"/>
@@ -1645,29 +1656,39 @@ Email: redantsupport@united-us.net</string>
                                         <color key="textColor" white="0.33333333329999998" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                         <nil key="highlightedColor"/>
                                     </label>
+                                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Copyright © 2022 Homelegance, Inc. All rights reserved." textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="psC-ka-GOT">
+                                        <rect key="frame" x="24" y="175" width="432" height="20.5"/>
+                                        <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                        <nil key="textColor"/>
+                                        <nil key="highlightedColor"/>
+                                    </label>
                                 </subviews>
                                 <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <constraints>
                                     <constraint firstItem="Jh9-JO-Lbj" firstAttribute="bottom" secondItem="tQE-Kl-1v3" secondAttribute="bottom" id="30T-aa-DX3"/>
+                                    <constraint firstItem="dd8-jB-tBc" firstAttribute="top" secondItem="psC-ka-GOT" secondAttribute="bottom" constant="6.5" id="4lv-9C-qYk"/>
                                     <constraint firstItem="tQE-Kl-1v3" firstAttribute="top" secondItem="cA7-od-VYw" secondAttribute="top" constant="19" id="5D2-z5-yzm"/>
-                                    <constraint firstAttribute="bottom" secondItem="7er-Pu-WBZ" secondAttribute="bottom" constant="48" id="6O1-uP-rKx"/>
                                     <constraint firstItem="Jh9-JO-Lbj" firstAttribute="leading" secondItem="tQE-Kl-1v3" secondAttribute="trailing" constant="8" id="HhC-Bt-opW"/>
+                                    <constraint firstItem="7er-Pu-WBZ" firstAttribute="centerY" secondItem="dd8-jB-tBc" secondAttribute="centerY" id="KIH-iC-jAq"/>
+                                    <constraint firstAttribute="trailing" secondItem="psC-ka-GOT" secondAttribute="trailing" constant="24" id="Lua-ZY-Wbg"/>
                                     <constraint firstItem="4Fi-0g-FiI" firstAttribute="top" secondItem="tQE-Kl-1v3" secondAttribute="bottom" id="Ov7-7q-WJk"/>
                                     <constraint firstItem="7er-Pu-WBZ" firstAttribute="leading" secondItem="tQE-Kl-1v3" secondAttribute="leading" id="PFN-CZ-AHd"/>
                                     <constraint firstItem="4Fi-0g-FiI" firstAttribute="leading" secondItem="tQE-Kl-1v3" secondAttribute="leading" id="SMw-y6-DXY"/>
                                     <constraint firstAttribute="trailing" secondItem="dd8-jB-tBc" secondAttribute="trailing" constant="35" id="Sok-zA-gtO"/>
+                                    <constraint firstItem="psC-ka-GOT" firstAttribute="top" secondItem="4Fi-0g-FiI" secondAttribute="bottom" id="Tvu-9K-V12"/>
                                     <constraint firstItem="dd8-jB-tBc" firstAttribute="leading" secondItem="7er-Pu-WBZ" secondAttribute="trailing" constant="8" id="V8R-pV-uvV"/>
                                     <constraint firstItem="u8k-9F-gQG" firstAttribute="leading" secondItem="tQE-Kl-1v3" secondAttribute="trailing" constant="8" id="YoF-cp-eWd"/>
+                                    <constraint firstItem="E4o-71-lCF" firstAttribute="top" secondItem="dd8-jB-tBc" secondAttribute="bottom" constant="11" id="aPc-K0-fVv"/>
                                     <constraint firstItem="E4o-71-lCF" firstAttribute="leading" secondItem="cA7-od-VYw" secondAttribute="leading" constant="35" id="au8-di-wNh"/>
                                     <constraint firstAttribute="trailing" secondItem="u8k-9F-gQG" secondAttribute="trailing" constant="35" id="e2B-3d-Aux"/>
                                     <constraint firstItem="Jh9-JO-Lbj" firstAttribute="top" secondItem="u8k-9F-gQG" secondAttribute="bottom" id="ixV-8Q-ANq"/>
-                                    <constraint firstItem="dd8-jB-tBc" firstAttribute="bottom" secondItem="7er-Pu-WBZ" secondAttribute="bottom" constant="8" id="jD4-6d-bqe"/>
                                     <constraint firstItem="u8k-9F-gQG" firstAttribute="top" secondItem="cA7-od-VYw" secondAttribute="top" constant="33" id="kO7-vX-yhS"/>
                                     <constraint firstAttribute="trailing" secondItem="E4o-71-lCF" secondAttribute="trailing" constant="35" id="mYM-nL-C7f"/>
                                     <constraint firstAttribute="bottom" secondItem="E4o-71-lCF" secondAttribute="bottom" constant="8" id="nRR-WB-1lb"/>
-                                    <constraint firstItem="tQE-Kl-1v3" firstAttribute="leading" secondItem="cA7-od-VYw" secondAttribute="leading" constant="35" id="pek-99-Bvi"/>
+                                    <constraint firstItem="tQE-Kl-1v3" firstAttribute="leading" secondItem="cA7-od-VYw" secondAttribute="leading" constant="24" id="pek-99-Bvi"/>
                                     <constraint firstAttribute="trailing" secondItem="4Fi-0g-FiI" secondAttribute="trailing" constant="36" id="tEH-Sm-Shg"/>
                                     <constraint firstAttribute="trailing" secondItem="Jh9-JO-Lbj" secondAttribute="trailing" constant="35" id="vac-8t-Kb9"/>
+                                    <constraint firstItem="psC-ka-GOT" firstAttribute="leading" secondItem="4Fi-0g-FiI" secondAttribute="leading" id="vxE-RP-woF"/>
                                 </constraints>
                             </view>
                         </subviews>
@@ -1692,7 +1713,7 @@ Email: redantsupport@united-us.net</string>
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="awE-OU-fB9" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="4485.9375" y="365.0390625"/>
+            <point key="canvasLocation" x="4485.4838709677424" y="364.87202118270079"/>
         </scene>
         <!--Sign up-->
         <scene sceneID="Oii-ov-sOV">
@@ -1863,6 +1884,132 @@ Email: redantsupport@united-us.net</string>
             </objects>
             <point key="canvasLocation" x="1710" y="-669"/>
         </scene>
+        <!--Scan Home View Controller-->
+        <scene sceneID="OBM-QJ-KzY">
+            <objects>
+                <viewController storyboardIdentifier="ScanHomeViewController" automaticallyAdjustsScrollViewInsets="NO" useStoryboardIdentifierAsRestorationIdentifier="YES" id="lB8-nn-lZh" customClass="ScanHomeViewController" sceneMemberID="viewController">
+                    <view key="view" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="4kl-uG-nDU">
+                        <rect key="frame" x="0.0" y="0.0" width="744" height="1133"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <subviews>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ybY-eH-YB2">
+                                <rect key="frame" x="606" y="625" width="108" height="31"/>
+                                <state key="normal" title="Button"/>
+                                <buttonConfiguration key="configuration" style="plain" title="Create Order"/>
+                                <connections>
+                                    <action selector="onCreateOrder:" destination="lB8-nn-lZh" eventType="touchUpInside" id="iFy-lp-d1V"/>
+                                </connections>
+                            </button>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="tM1-3D-HDl">
+                                <rect key="frame" x="302.5" y="625" width="139" height="31"/>
+                                <state key="normal" title="Button"/>
+                                <buttonConfiguration key="configuration" style="plain" title="Submitted Orders"/>
+                                <connections>
+                                    <action selector="onSubmit:" destination="lB8-nn-lZh" eventType="touchUpInside" id="bE6-nx-IMk"/>
+                                </connections>
+                            </button>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="WiH-ii-7Rw">
+                                <rect key="frame" x="30" y="625" width="156" height="31"/>
+                                <state key="normal" title="Button"/>
+                                <buttonConfiguration key="configuration" style="plain" title="Unsubmitted Orders"/>
+                                <connections>
+                                    <action selector="onUnsubmit:" destination="lB8-nn-lZh" eventType="touchUpInside" id="mzS-9u-hPS"/>
+                                </connections>
+                            </button>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Site News" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="MX7-kc-9FV">
+                                <rect key="frame" x="30" y="34" width="76" height="21"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                <nil key="textColor"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                            <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="4aE-ib-gZl">
+                                <rect key="frame" x="30" y="65" width="684" height="500"/>
+                                <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="500" id="BxA-Dt-JzC"/>
+                                </constraints>
+                                <prototypes>
+                                    <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" restorationIdentifier="ScanHomeCell" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="ScanHomeCell" id="dw7-MG-fSB" customClass="ScanHomeCell">
+                                        <rect key="frame" x="0.0" y="44.5" width="684" height="43.5"/>
+                                        <autoresizingMask key="autoresizingMask"/>
+                                        <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="dw7-MG-fSB" id="6ok-87-DrJ">
+                                            <rect key="frame" x="0.0" y="0.0" width="684" height="43.5"/>
+                                            <autoresizingMask key="autoresizingMask"/>
+                                            <subviews>
+                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xBk-1n-UFG">
+                                                    <rect key="frame" x="16" y="11.5" width="456" height="21"/>
+                                                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                    <nil key="textColor"/>
+                                                    <nil key="highlightedColor"/>
+                                                </label>
+                                                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ahn-8c-uI7">
+                                                    <rect key="frame" x="598" y="6.5" width="70" height="31"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="width" constant="70" id="zVr-eW-EQc"/>
+                                                    </constraints>
+                                                    <state key="normal" title="Button"/>
+                                                    <buttonConfiguration key="configuration" style="plain" title="View"/>
+                                                </button>
+                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2022-12-30" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="oBw-iB-pSQ">
+                                                    <rect key="frame" x="492" y="12" width="90" height="19.5"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="width" constant="90" id="xA4-EQ-Cx1"/>
+                                                    </constraints>
+                                                    <fontDescription key="fontDescription" type="system" pointSize="16"/>
+                                                    <nil key="textColor"/>
+                                                    <nil key="highlightedColor"/>
+                                                </label>
+                                            </subviews>
+                                            <constraints>
+                                                <constraint firstItem="oBw-iB-pSQ" firstAttribute="leading" secondItem="xBk-1n-UFG" secondAttribute="trailing" constant="20" id="1ca-iQ-1Il"/>
+                                                <constraint firstItem="xBk-1n-UFG" firstAttribute="leading" secondItem="6ok-87-DrJ" secondAttribute="leadingMargin" id="8re-vX-Sgw"/>
+                                                <constraint firstItem="ahn-8c-uI7" firstAttribute="leading" secondItem="oBw-iB-pSQ" secondAttribute="trailing" constant="16" id="LOW-dv-ci6"/>
+                                                <constraint firstItem="oBw-iB-pSQ" firstAttribute="centerY" secondItem="6ok-87-DrJ" secondAttribute="centerY" id="RLm-Yw-gr9"/>
+                                                <constraint firstAttribute="trailing" secondItem="ahn-8c-uI7" secondAttribute="trailing" constant="16" id="ewY-9F-5fn"/>
+                                                <constraint firstItem="xBk-1n-UFG" firstAttribute="centerY" secondItem="6ok-87-DrJ" secondAttribute="centerY" id="gRa-Fh-1ac"/>
+                                                <constraint firstItem="ahn-8c-uI7" firstAttribute="centerY" secondItem="6ok-87-DrJ" secondAttribute="centerY" id="xxF-Ka-BVt"/>
+                                            </constraints>
+                                        </tableViewCellContentView>
+                                        <connections>
+                                            <outlet property="btnview" destination="ahn-8c-uI7" id="FAH-Jp-Zqj"/>
+                                            <outlet property="labeldate" destination="oBw-iB-pSQ" id="Uy7-Bh-JSX"/>
+                                            <outlet property="labeltitle" destination="xBk-1n-UFG" id="Cs4-bA-jlg"/>
+                                        </connections>
+                                    </tableViewCell>
+                                </prototypes>
+                                <connections>
+                                    <outlet property="dataSource" destination="lB8-nn-lZh" id="siW-wI-Ppq"/>
+                                    <outlet property="delegate" destination="lB8-nn-lZh" id="VcY-NB-kCE"/>
+                                </connections>
+                            </tableView>
+                        </subviews>
+                        <viewLayoutGuide key="safeArea" id="jYV-1f-hJ3"/>
+                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                        <constraints>
+                            <constraint firstItem="4aE-ib-gZl" firstAttribute="top" secondItem="MX7-kc-9FV" secondAttribute="bottom" constant="10" id="515-Zg-XqX"/>
+                            <constraint firstItem="ybY-eH-YB2" firstAttribute="trailing" secondItem="4aE-ib-gZl" secondAttribute="trailing" id="AtJ-sO-usD"/>
+                            <constraint firstItem="MX7-kc-9FV" firstAttribute="top" secondItem="jYV-1f-hJ3" secondAttribute="top" constant="10" id="C1k-SF-SLW"/>
+                            <constraint firstItem="WiH-ii-7Rw" firstAttribute="leading" secondItem="4aE-ib-gZl" secondAttribute="leading" id="FhZ-UM-k0w"/>
+                            <constraint firstItem="MX7-kc-9FV" firstAttribute="leading" secondItem="jYV-1f-hJ3" secondAttribute="leading" constant="30" id="HTQ-r8-JWF"/>
+                            <constraint firstItem="tM1-3D-HDl" firstAttribute="top" secondItem="4aE-ib-gZl" secondAttribute="bottom" constant="60" id="Xgs-gM-Aeh"/>
+                            <constraint firstItem="WiH-ii-7Rw" firstAttribute="top" secondItem="tM1-3D-HDl" secondAttribute="top" id="Y45-XP-iTu"/>
+                            <constraint firstItem="4aE-ib-gZl" firstAttribute="leading" secondItem="jYV-1f-hJ3" secondAttribute="leading" constant="30" id="hAx-BB-pvk"/>
+                            <constraint firstItem="tM1-3D-HDl" firstAttribute="centerX" secondItem="4kl-uG-nDU" secondAttribute="centerX" id="kZC-Nf-Uzn"/>
+                            <constraint firstItem="ybY-eH-YB2" firstAttribute="top" secondItem="tM1-3D-HDl" secondAttribute="top" id="lnu-p6-F36"/>
+                            <constraint firstItem="jYV-1f-hJ3" firstAttribute="trailing" secondItem="4aE-ib-gZl" secondAttribute="trailing" constant="30" id="tKY-s6-uHH"/>
+                        </constraints>
+                    </view>
+                    <toolbarItems/>
+                    <connections>
+                        <outlet property="btn_submit" destination="tM1-3D-HDl" id="AI4-Ft-gtp"/>
+                        <outlet property="btn_unsubmit" destination="WiH-ii-7Rw" id="MXC-HO-aoU"/>
+                        <outlet property="table" destination="4aE-ib-gZl" id="WQl-un-p8O"/>
+                    </connections>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="Nz0-k4-PMR" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="2492.9390997352161" y="40.322580645161288"/>
+        </scene>
     </scenes>
     <resources>
         <image name="about" width="96" height="96"/>
@@ -1871,10 +2018,10 @@ Email: redantsupport@united-us.net</string>
         <image name="btn_retrieve" width="102" height="30"/>
         <image name="btn_signin" width="100" height="30"/>
         <image name="camera" width="48" height="48"/>
-        <image name="cart_empty" width="96" height="96"/>
+        <image name="cart_empty" width="72" height="72"/>
         <image name="check_1_24" width="24" height="24"/>
         <image name="checkbox" width="16" height="16"/>
-        <image name="close" width="32" height="32"/>
+        <image name="close" width="40" height="40"/>
         <image name="menu_open" width="36" height="36"/>
         <image name="npd_logo" width="110" height="13"/>
         <image name="order" width="72" height="72"/>
@@ -1886,5 +2033,11 @@ Email: redantsupport@united-us.net</string>
         <image name="setting" width="72" height="72"/>
         <image name="upload" width="48" height="48"/>
         <image name="wishlist" width="72" height="72"/>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
+        <systemColor name="systemYellowColor">
+            <color red="1" green="0.80000000000000004" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+        </systemColor>
     </resources>
 </document>

+ 6 - 6
RedAnt ERP Mobile/HMLG Scan Order/Images.xcassets/LaunchIcon.imageset/Contents.json

@@ -1,23 +1,23 @@
 {
   "images" : [
     {
+      "filename" : "appicon.png",
       "idiom" : "universal",
-      "filename" : "LaunchIcon.png",
       "scale" : "1x"
     },
     {
+      "filename" : "appicon-1.png",
       "idiom" : "universal",
-      "filename" : "LaunchIcon@2x.png",
       "scale" : "2x"
     },
     {
+      "filename" : "appicon-2.png",
       "idiom" : "universal",
-      "filename" : "LaunchIcon@3x.png",
       "scale" : "3x"
     }
   ],
   "info" : {
-    "version" : 1,
-    "author" : "xcode"
+    "author" : "xcode",
+    "version" : 1
   }
-}
+}

BIN
RedAnt ERP Mobile/HMLG Scan Order/Images.xcassets/LaunchIcon.imageset/appicon-1.png


BIN
RedAnt ERP Mobile/HMLG Scan Order/Images.xcassets/LaunchIcon.imageset/appicon-2.png


BIN
RedAnt ERP Mobile/HMLG Scan Order/Images.xcassets/LaunchIcon.imageset/appicon.png


+ 6 - 6
RedAnt ERP Mobile/HMLG Scan Order/Images.xcassets/about.imageset/Contents.json

@@ -1,23 +1,23 @@
 {
   "images" : [
     {
+      "filename" : "appicon.png",
       "idiom" : "universal",
-      "filename" : "red_ant_logo.png",
       "scale" : "1x"
     },
     {
+      "filename" : "appicon-1.png",
       "idiom" : "universal",
-      "filename" : "red_ant_logo@2x.png",
       "scale" : "2x"
     },
     {
+      "filename" : "appicon-2.png",
       "idiom" : "universal",
-      "filename" : "red_ant_logo@3x.png",
       "scale" : "3x"
     }
   ],
   "info" : {
-    "version" : 1,
-    "author" : "xcode"
+    "author" : "xcode",
+    "version" : 1
   }
-}
+}

BIN
RedAnt ERP Mobile/HMLG Scan Order/Images.xcassets/about.imageset/appicon-1.png


BIN
RedAnt ERP Mobile/HMLG Scan Order/Images.xcassets/about.imageset/appicon-2.png


BIN
RedAnt ERP Mobile/HMLG Scan Order/Images.xcassets/about.imageset/appicon.png


+ 23 - 0
RedAnt ERP Mobile/HMLG Scan Order/Images.xcassets/btn_bg.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "filename" : "appicon.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "appicon-1.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "appicon-2.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
RedAnt ERP Mobile/HMLG Scan Order/Images.xcassets/btn_bg.imageset/appicon-1.png


BIN
RedAnt ERP Mobile/HMLG Scan Order/Images.xcassets/btn_bg.imageset/appicon-2.png


BIN
RedAnt ERP Mobile/HMLG Scan Order/Images.xcassets/btn_bg.imageset/appicon.png


BIN
RedAnt ERP Mobile/HMLG Scan Order/Images.xcassets/order.imageset/appicon-1.png


BIN
RedAnt ERP Mobile/HMLG Scan Order/Images.xcassets/order.imageset/appicon-2.png


BIN
RedAnt ERP Mobile/HMLG Scan Order/Images.xcassets/order.imageset/appicon.png


+ 1 - 1
RedAnt ERP Mobile/HMLG Scan Order/Images.xcassets/server_bg.imageset/Contents.json

@@ -1,7 +1,7 @@
 {
   "images" : [
     {
-      "filename" : "QQ20220401-151220.png",
+      "filename" : "{3976D19D-91F0-B17C-F624-62CB9BD6882C}.jpg",
       "idiom" : "universal",
       "scale" : "1x"
     },

BIN
RedAnt ERP Mobile/HMLG Scan Order/Images.xcassets/server_bg.imageset/{3976D19D-91F0-B17C-F624-62CB9BD6882C}.jpg


+ 10 - 0
RedAnt ERP Mobile/HMLG Scan Order/MainViewController.h

@@ -9,6 +9,7 @@
 #import <UIKit/UIKit.h>
 //#import "CategoryViewController.h"
 //#import "HomeViewController.h"
+#import "ScanHomeViewController.h"
 #import "CartViewController.h"
 //#import "WatchListViewController.h"
 //#import "LoginViewController.h"
@@ -33,6 +34,13 @@
 // scan order 
 
 @interface MainViewController : UIViewController<UITableViewDataSource,UITableViewDelegate,CategoryMenuDelegate/*,CommonEditorViewControllerDelegate*/>
+
+@property (weak, nonatomic) IBOutlet UIButton *btncart;
+@property (weak, nonatomic) IBOutlet UIButton *btnorder;
+@property (weak, nonatomic) IBOutlet UIButton *btnsetting;
+@property (weak, nonatomic) IBOutlet UIButton *btnlist;
+@property (weak, nonatomic) IBOutlet UIButton *btnsearch;
+
 @property (strong, nonatomic) IBOutlet UIImageView *user_head;
 @property (strong, nonatomic) IBOutlet UIImageView *blurView;
 @property (strong, nonatomic) IBOutlet UIView *sideMenu;
@@ -40,6 +48,8 @@
 @property (weak, nonatomic) IBOutlet UIButton *btnScan;
 @property (strong, nonatomic) IBOutlet UITableView *sideMenuTable;
 //@property  (strong,nonatomic)HomeViewController* homeViewController;
+@property  (strong,nonatomic)ScanHomeViewController* homeViewController;
+
 //@property  (strong,nonatomic)CategoryViewController* categoryViewController;
 @property  (strong,nonatomic)CartViewController* cartViewController;
 //@property  (strong,nonatomic)OrderListViewController* orderViewController;

+ 97 - 40
RedAnt ERP Mobile/HMLG Scan Order/MainViewController.m

@@ -76,6 +76,11 @@
 //     [self.categoryViewController logout];
 }
 - (IBAction)onScanOrderSetting:(id)sender {
+    
+    [self clearSelected];
+    self.btnsetting.selected = true;
+
+    
     if([self.current_VC isKindOfClass:[ServerSettingViewController class]])
         return;
     [self flipFromViewController:self.current_VC toViewController:self.settingViewController withDirection:UIViewAnimationOptionTransitionCrossDissolve];
@@ -93,7 +98,7 @@
     ScanUserListViewController * userVC =[ [UIStoryboard storyboardWithName:@"OLM" bundle:nil] instantiateViewControllerWithIdentifier:@"ScanUserListViewController"];
    userVC.returnValue=^(NSString* user)
     {
-        self.btnContact.hidden = false;
+//        self.btnContact.hidden = false;
         appDelegate.user = user;
         [self.buttonUser setTitle:user forState:UIControlStateNormal];
         
@@ -338,8 +343,8 @@
     });
     
     
-    if(/*appDelegate.user_type==USER_ROLE_EMPLOYEE*/true)
-        self.btnContact.hidden = NO;
+//    if(/*appDelegate.user_type==USER_ROLE_EMPLOYEE*/true)
+//        self.btnContact.hidden = NO;
 //    else
 //        self.btnContact.hidden = YES;
     
@@ -366,7 +371,7 @@
         }
     }
     
-    self.btnContact.hidden = !appDelegate.bLogin;// 修复登出后仍旧显示select contact
+//    self.btnContact.hidden = !appDelegate.bLogin;// 修复登出后仍旧显示select contact
     
     
     NSMutableArray* arr_contact = [[NSMutableArray alloc] init];
@@ -593,6 +598,14 @@
     
     
     
+}
+-(void) clearSelected
+{
+    self.btncart.selected = false;
+    self.btnorder.selected = false;
+    self.btnlist.selected = false;
+    self.btnsearch.selected = false;
+    self.btnsetting.selected = false;
 }
 - (void)viewDidLoad
 {
@@ -602,10 +615,19 @@
 //    NSLog(@"decrypt:%@",[AESCrypt fastdecrypt:@"vafHUwfRPIUbPNVnKhLc5aAVK7sOFRztlfJVRHW7QVa/qGgm11E5UwfYWZEBTQpH"]);
  
     
+    [self.btncart setBackgroundImage:[UIImage imageNamed:@"btn_bg"] forState:UIControlStateSelected];
+    [self.btnorder setBackgroundImage:[UIImage imageNamed:@"btn_bg"] forState:UIControlStateSelected];
+    [self.btnlist setBackgroundImage:[UIImage imageNamed:@"btn_bg"] forState:UIControlStateSelected];
+    [self.btnsearch setBackgroundImage:[UIImage imageNamed:@"btn_bg"] forState:UIControlStateSelected];
+    [self.btnsetting setBackgroundImage:[UIImage imageNamed:@"btn_bg"] forState:UIControlStateSelected];
+//    [self.btncart setTintColor:UIColor.whiteColor];
+//    self.btncart.configuration.baseForegroundColor = UIColor.redColor;
+//    [self.btncart updateConfiguration];
+//    [self.btncart setBackgroundImage:[UIImage imageNamed:@"btn_bg"] forState:UIControlStateHighlighted];
     NSDictionary *addressDic = [[NSUserDefaults standardUserDefaults] valueForKey:@"ScanAddress"];
     if (addressDic) {
      
-        self.labelServer.text = [addressDic objectForKey:@"name"];
+        self.labelServer.text = [addressDic objectForKey:@"show_name"];
 //        NSUInteger selectedIndex = [[addressDic objectForKey:@"selectedIndex"] integerValue];
 //        switch (selectedIndex) {
 //            case 0:
@@ -624,7 +646,7 @@
     }
     
     
-    self.btnContact.hidden = NO;
+//    self.btnContact.hidden = NO;
     
     self.automaticallyAdjustsScrollViewInsets = NO;
     NSString* value =[DefaultAppearance get_noneappearance_value:@"DefaultColor" valuename:@"labelcolor"];
@@ -695,7 +717,7 @@
 //#endif
     
     [self initMenuItems];
-//    self.homeViewController =[[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"HomeViewController"];
+    self.homeViewController =[[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"ScanHomeViewController"];
 //    self.categoryViewController =[ [UIStoryboard storyboardWithName:@"ERP_Mobile_Search" bundle:nil] instantiateViewControllerWithIdentifier:@"CategoryViewController"];
     
     self.settingViewController=[ [UIStoryboard storyboardWithName:@"OLM" bundle:nil] instantiateViewControllerWithIdentifier:@"ServerSettingViewController"];
@@ -741,19 +763,27 @@
     self.scanHistoryViewController =[[UIStoryboard storyboardWithName:@"SO" bundle:nil] instantiateViewControllerWithIdentifier:@"ScanHistoryViewController"];
 //    self.portfolioViewController = [[UIStoryboard storyboardWithName:@"ERP_Mobile_Portfolio" bundle:nil] instantiateViewControllerWithIdentifier:@"PortfolioViewController" ];
     
-    
+//    [self addChildViewController:self.scanHistoryViewController];
 //    self.pdfListViewController = [[UIStoryboard storyboardWithName:@"ERP_Mobile_Portfolio" bundle:nil] instantiateViewControllerWithIdentifier:@"PortfolioListViewController" ];
     
 //    self.itemSearchViewController=[[UIStoryboard storyboardWithName:@"ERP_Mobile_Search" bundle:nil] instantiateViewControllerWithIdentifier:@"ItemSearchViewController"];
     self.scansearchViewController=[ [UIStoryboard storyboardWithName:@"SO" bundle:nil] instantiateViewControllerWithIdentifier:@"ScanSearchViewController"];
+   
+    [self addChildViewController:self.homeViewController];  //1
+    
+    self.homeViewController.view.frame = self.container.bounds;
+    [self.container addSubview:self.homeViewController.view]; //2
+    [self.homeViewController didMoveToParentViewController:self];
+    self.current_VC = self.homeViewController;
     
-    [self addChildViewController:self.scanorderViewController];  //1
     
-    self.scanorderViewController.view.frame = self.container.bounds;
-    [self.container addSubview:self.scanorderViewController.view]; //2
-    [self.scanorderViewController didMoveToParentViewController:self];
-    self.current_VC = self.scanorderViewController;
-    //   self.is_home = true;
+//    [self addChildViewController:self.scanorderViewController];  //1
+//
+//    self.scanorderViewController.view.frame = self.container.bounds;
+//    [self.container addSubview:self.scanorderViewController.view]; //2
+//    [self.scanorderViewController didMoveToParentViewController:self];
+//    self.current_VC = self.scanorderViewController;
+//    //   self.is_home = true;
     
     //    [UIBezierPath bezierPathWithRect:self.headerView.bounds].CGPath;
     
@@ -1014,6 +1044,9 @@
     
 }
 - (IBAction)switchToSearch:(UIButton *)sender {
+    [self clearSelected];
+    self.btnsearch.selected = true;
+
     if([self.current_VC isKindOfClass:[ScanSearchViewController class]])
         return;
     [self flipFromViewController:self.current_VC toViewController:self.scansearchViewController withDirection:UIViewAnimationOptionTransitionCrossDissolve];
@@ -1025,6 +1058,9 @@
 //}
 
 - (IBAction)switchToList:(UIButton *)sender {
+    [self clearSelected];
+    self.btnlist.selected = true;
+
     [self switchtowishlist];
 }
 -(void)switchtowishlist
@@ -1037,8 +1073,8 @@
 //        return;
 
 
-    UIApplication * app = [UIApplication sharedApplication];
-    AppDelegate *appDelegate = (AppDelegate *)[app delegate];
+//    UIApplication * app = [UIApplication sharedApplication];
+//    AppDelegate *appDelegate = (AppDelegate *)[app delegate];
 //    if(appDelegate.bLogin==false)
 //    {
 //        LoginViewController * loginvc =[[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"LoginViewController"];
@@ -1151,7 +1187,7 @@
 }
 - (void) reload
 {
-    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+//    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
     
 
     return;
@@ -1180,9 +1216,11 @@
     
     DebugLog(@"header view login");
     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-    if( appDelegate.user ==nil)
+    if( appDelegate.user ==nil /*|| [appDelegate.user isEqualToString:@"GUEST"]*/)
     {
 
+//        appDelegate.user = nil;
+//        appDelegate.password = nil;
         LoginViewController * loginvc =[[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"LoginViewController"];
         //        loginvc.delegate = self;
         //    loginvc.modalPresentationStyle = UIModalPresentationFormSheet;//有三种状态,自己看看是哪种
@@ -1284,8 +1322,8 @@
         
         [RANetwork LoadImage:appDelegate.user_icon into:self.user_head ];
         
-        if(/*appDelegate.user_type==USER_ROLE_EMPLOYEE*/true)
-            self.btnContact.hidden = NO;
+//        if(/*appDelegate.user_type==USER_ROLE_EMPLOYEE*/true)
+//            self.btnContact.hidden = NO;
         //    else
         //        self.btnContact.hidden = YES;
         
@@ -1486,24 +1524,33 @@
 //    //    [self.container addSubview:self.cagegoryViewController.view]; //2
 //    //    [self.cagegoryViewController didMoveToParentViewController:self];
 //}
-//  - (IBAction)switchToHome:(UIButton *)sender {
-//
-//    [self switchToHome];
-//    //    self.current_vc = VC_HOME;
-//
-//    //    self.is_home = true;
-//    //
-//    //    [self.cagegoryViewController willMoveToParentViewController:nil]; //1
-//    //    [self.cagegoryViewController.view removeFromSuperview]; //2
-//    //    [self.cagegoryViewController removeFromParentViewController]; //3
-//    //
-//    //    [self.container addSubview:self.homeViewController.view]; //2
-//    //    [self.homeViewController didMoveToParentViewController:self];
-//}
+  - (IBAction)switchToHome:(UIButton *)sender {
+      [self clearSelected];
+    [self switchToHome];
+    //    self.current_vc = VC_HOME;
+
+    //    self.is_home = true;
+    //
+    //    [self.cagegoryViewController willMoveToParentViewController:nil]; //1
+    //    [self.cagegoryViewController.view removeFromSuperview]; //2
+    //    [self.cagegoryViewController removeFromParentViewController]; //3
+    //
+    //    [self.container addSubview:self.homeViewController.view]; //2
+    //    [self.homeViewController didMoveToParentViewController:self];
+}
 -(void)switchToHome
 {
-  
-    [self switchToOrder];
+    [self clearSelected];
+    if([self.current_VC isKindOfClass:[ScanHomeViewController class]])
+        return;
+    
+    if(self.homeViewController == nil)
+    {
+        self.homeViewController =[[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"ScanHomeViewController"];
+        self.homeViewController.view.frame = self.container.bounds;
+    }
+    [self flipFromViewController:self.current_VC toViewController:self.homeViewController withDirection:UIViewAnimationOptionTransitionCrossDissolve];
+    
 }
 
 -(void) switchToPreviousVC
@@ -1520,15 +1567,22 @@
 }
 
 - (IBAction)switchToCart:(UIButton *)sender {
+//    [self.btncart setBackgroundColor:UIColor.whiteColor];
+//    [self.btncart setTintColor:UIColor.clearColor];
+//    UIColor *color0=[self.btncart titleColorForState:UIControlStateNormal];
+//    UIColor *color1=[self.btncart titleColorForState:UIControlStateSelected];
+
     [self switchToCart];
     
     //    self.current_vc = VC_HOME;
 }
 -(void) switchToCart
 {
+    
     if([self.current_VC isKindOfClass:[CartViewController class]])
         return;
-    
+    [self clearSelected];
+    self.btncart.selected = true;
 //
 //
 //    UIApplication * app = [UIApplication sharedApplication];
@@ -1923,7 +1977,8 @@
 }
 -(void) switchToOrder
 {
-
+    [self clearSelected];
+    self.btnorder.selected = true;
     if([self.current_VC isKindOfClass:[ScanOrderListViewController class]])
         return;
     
@@ -1933,7 +1988,8 @@
         
 }
 - (IBAction)switchToOrder:(id)sender {
-    
+
+
     [self switchToOrder];
     
 
@@ -2723,6 +2779,7 @@
 //            self.address = [addressDic objectForKey:@"serverAddress"];
 //        }
         appDelegate.address = [addressDic objectForKey:@"serverAddress"];
+        [OLDataProvider guestLogin];
     }
     else
     {
@@ -2733,7 +2790,7 @@
             NSDictionary *addressDic = [[NSUserDefaults standardUserDefaults] valueForKey:@"ScanAddress"];
             if (addressDic) {
              
-                self.labelServer.text = [addressDic objectForKey:@"name"];
+                self.labelServer.text = [addressDic objectForKey:@"show_name"];
 
             }
         };

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 151 - 154
RedAnt ERP Mobile/HMLG Scan Order/SO.storyboard


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

@@ -22,7 +22,7 @@ NS_ASSUME_NONNULL_BEGIN
 @property double unit_price;
 @property bool noprice;
 @property (strong,nonatomic) NSString* cart_id;
-
+@property int pre_val;
 -(void) set_Count:(int) count;
 -(void) init_Stepper:(int) step max:(int) max min:(int)min value:(int)value;
 @property (nonatomic , copy) void (^onReturnQTY)(int qty , NSDictionary* ext);

+ 23 - 13
RedAnt ERP Mobile/HMLG Scan Order/ScanCartItemCell.m

@@ -41,7 +41,7 @@
         
         self.setpperQTY.value= value;
         
-//        self.pre_val = value;
+        self.pre_val = value;
         
         [self.setpperQTY addTarget:self action:@selector(valueChanged:) forControlEvents:UIControlEventValueChanged];
 //        self.totalchange=0;
@@ -242,7 +242,7 @@
     
     
     
-    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+//    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
     NSString* price = [NSString stringWithFormat:@"%.2f",self.unit_price*count ];
 //    if(appDelegate.can_see_price&&appDelegate.price_hidden==false)
 //    {
@@ -292,28 +292,38 @@
 {
     
     
-    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+//    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
     int qty = [textField.text intValue];
     
     if(qty==0)
         qty=self.setpperQTY.minimumValue;
     
-#ifdef MPACK
-    if ((int)qty % (int)self.stepper.stepValue != 0) {
-        UIViewController* vc=[RAUtils getViewController :self];
-        [((CartViewController *)vc).itemListTable reloadData];
-        [RAUtils message_alert:[NSString stringWithFormat:@"Sold in quantities of %d",(int)(self.stepper.stepValue)] title:@"Change Model Count" controller:vc];
+
+    
+    
+    
+//    NSMutableDictionary* item= self.modellist[indexPath.row];
+//    int qty = [textField.text intValue];
+//
+    int c=qty;
+    
+    int mpack= self.setpperQTY.stepValue;
+    
+    int m=c%mpack;
+    if(m!=0)
+        
+    {
+        [RAUtils message_alert:[NSString stringWithFormat:@"QTY must be a multiple of %d",mpack] title:@"Warrning" controller:[RAUtils getViewController:self]];
+        textField.text = [NSString stringWithFormat:@"%d",self.pre_val];
         return;
     }
-#endif
-    
         
-        int c=qty;
+//        int c=qty;
         
 //        int m=c%(int)(self.setpperQTY.stepValue);
 //        if(m!=0&&appDelegate.alert_sold_in_quantities)
 //
-//        else
+        else
         {
             [self set_Count:qty];
             
@@ -382,7 +392,7 @@
     NSString* text = textField.text;
     if(text.length==0)
         text=@"0";
-//    self.pre_val = [textField.text intValue];
+    self.pre_val = [textField.text intValue];
     
    // self.last_edit = textField.text;
 }

+ 20 - 0
RedAnt ERP Mobile/HMLG Scan Order/ScanHomeCell.h

@@ -0,0 +1,20 @@
+//
+//  ScanHomeCellTableViewCell.h
+//  HMLG Scan Order
+//
+//  Created by Rui Zhang on 5/12/22.
+//  Copyright © 2022 United Software Applications, Inc. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface ScanHomeCell : UITableViewCell
+@property (weak, nonatomic) IBOutlet UILabel *labeltitle;
+@property (weak, nonatomic) IBOutlet UIButton *btnview;
+@property (weak, nonatomic) IBOutlet UILabel *labeldate;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 24 - 0
RedAnt ERP Mobile/HMLG Scan Order/ScanHomeCell.m

@@ -0,0 +1,24 @@
+//
+//  ScanHomeCellTableViewCell.m
+//  HMLG Scan Order
+//
+//  Created by Rui Zhang on 5/12/22.
+//  Copyright © 2022 United Software Applications, Inc. All rights reserved.
+//
+
+#import "ScanHomeCell.h"
+
+@implementation ScanHomeCell
+
+- (void)awakeFromNib {
+    [super awakeFromNib];
+    // Initialization code
+}
+
+- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
+    [super setSelected:selected animated:animated];
+
+    // Configure the view for the selected state
+}
+
+@end

+ 20 - 0
RedAnt ERP Mobile/HMLG Scan Order/ScanHomeViewController.h

@@ -0,0 +1,20 @@
+//
+//  ScanHomeViewController.h
+//  HMLG Scan Order
+//
+//  Created by Rui Zhang on 5/12/22.
+//  Copyright © 2022 United Software Applications, Inc. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "ActiveViewController.h"
+NS_ASSUME_NONNULL_BEGIN
+
+@interface ScanHomeViewController : ActiveViewController<UITableViewDataSource,UITableViewDelegate>
+@property (weak, nonatomic) IBOutlet UITableView *table;
+@property (strong, nonatomic) NSArray* newslist;
+@property (weak, nonatomic) IBOutlet UIButton *btn_unsubmit;
+@property (weak, nonatomic) IBOutlet UIButton *btn_submit;
+@end
+
+NS_ASSUME_NONNULL_END

+ 194 - 0
RedAnt ERP Mobile/HMLG Scan Order/ScanHomeViewController.m

@@ -0,0 +1,194 @@
+//
+//  ScanHomeViewController.m
+//  HMLG Scan Order
+//
+//  Created by Rui Zhang on 5/12/22.
+//  Copyright © 2022 United Software Applications, Inc. All rights reserved.
+//
+
+#import "ScanHomeViewController.h"
+#import "ScanHomeCell.h"
+#import "AppDelegate.h"
+#import "MainViewController.h"
+#import "WebViewController.h"
+@interface ScanHomeViewController ()
+
+@end
+
+@implementation ScanHomeViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    
+    self.table.layer.borderColor = [UIColor darkGrayColor].CGColor;
+    self.table.layer.borderWidth = 1.0;
+    [self loadNewsList];
+    // Do any additional setup after loading the view.
+}
+
+/*
+#pragma mark - Navigation
+
+// In a storyboard-based application, you will often want to do a little preparation before navigation
+- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
+    // Get the new view controller using [segue destinationViewController].
+    // Pass the selected object to the new view controller.
+}
+*/
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
+    
+    return self.newslist.count;
+
+    
+
+}
+- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
+    return 44;
+}
+
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
+{
+    
+    
+   
+    ScanHomeCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ScanHomeCell"];
+    if (!cell) {
+        cell = [[ScanHomeCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"ScanHomeCell"];
+    }
+
+//    NSArray* arr = self.newslist;
+    
+    cell.labeltitle.text = self.newslist[indexPath.row][@"title"];
+    cell.labeldate.text = self.newslist[indexPath.row][@"date"];
+    
+    [cell.btnview addTarget:self action:@selector(onview:) forControlEvents:UIControlEventTouchUpInside];
+    
+//    [cell setModelJson:arr[indexPath.row]];
+   
+    
+    return cell;
+    
+}
+-(void) onview:(id)sender
+{
+    UIButton* b = sender;
+    ScanHomeCell *cell = b.superview.superview;
+    
+    NSIndexPath* indexPath=[self.table indexPathForCell:cell];
+    
+    NSString* url = self.newslist[indexPath.row][@"url"];
+    NSString* title =  self.newslist[indexPath.row][@"title"];
+    
+    WebViewController *ViewController = [[UIStoryboard storyboardWithName:@"wkweb" bundle:nil] instantiateViewControllerWithIdentifier:@"WebViewController"];
+    ViewController.url = url;
+    ViewController.title = title;
+    
+
+    
+    [self.navigationController pushViewController:ViewController animated:YES];
+    
+}
+
+- (IBAction)onCreateOrder:(id)sender {
+    AppDelegate* appDelegate = (AppDelegate*)UIApplication.sharedApplication.delegate;
+    MainViewController * mainvc = (MainViewController*)appDelegate.main_vc;
+    
+    [ActiveViewController Notify:@"ScanOrderListViewController" Message:@"NewOrder"];
+    [mainvc switchToOrder];
+}
+
+- (IBAction)onSubmit:(id)sender {
+    AppDelegate* appDelegate = (AppDelegate*)UIApplication.sharedApplication.delegate;
+    MainViewController * mainvc = (MainViewController*)appDelegate.main_vc;
+    
+    [ActiveViewController Notify:@"ScanOrderListViewController" Message:@"ShowSubmit"];
+    [mainvc switchToOrder];
+}
+- (IBAction)onUnsubmit:(id)sender {
+    AppDelegate* appDelegate = (AppDelegate*)UIApplication.sharedApplication.delegate;
+    MainViewController * mainvc = (MainViewController*)appDelegate.main_vc;
+
+    [ActiveViewController Notify:@"ScanOrderListViewController" Message:@"ShowUnSubmit"];
+    [mainvc switchToOrder];
+}
+-(void) loadNewsList
+{
+    {
+        [RADataProvider request_scan_news:^(NSMutableDictionary *result) {
+            
+            NSMutableDictionary* return_json = result;
+            
+//            [waitalert dismissViewControllerAnimated:YES completion:^{
+//                if([[return_json valueForKey:@"result"] intValue]==2)
+//                {
+//
+//
+//                    self.newslist = return_json[@"newslist"];
+//
+//                    [self.table reloadData];
+////                    if(self.newslist.count>0)
+////                    {
+////
+////                    }
+//
+//                }
+//                else
+//                {
+//                    [RAUtils message_alert:[return_json valueForKey:@"err_msg"] title:@"Load Site News" controller:self] ;
+//                }
+//            }];
+            {
+                if([[return_json valueForKey:@"result"] intValue]==2)
+                {
+
+                    
+                    self.newslist = return_json[@"newslist"];
+                        
+                    [self.table reloadData];
+//                    if(self.newslist.count>0)
+//                    {
+//
+//                    }
+
+                }
+                else
+                {
+//                    [RAUtils message_alert:[return_json valueForKey:@"err_msg"] title:@"Load Site News" controller:self] ;
+                }
+            }
+               
+        }];
+    }
+    
+    
+//    __block UIAlertController * waitalert =[RAUtils waiting_alert:self title:@"Loading Site News" completion:^{
+//        [RADataProvider request_scan_news:^(NSMutableDictionary *result) {
+//
+//            NSMutableDictionary* return_json = result;
+//
+//            [waitalert dismissViewControllerAnimated:YES completion:^{
+//                if([[return_json valueForKey:@"result"] intValue]==2)
+//                {
+//
+//
+//                    self.newslist = return_json[@"newslist"];
+//
+//                    [self.table reloadData];
+////                    if(self.newslist.count>0)
+////                    {
+////
+////                    }
+//
+//                }
+//                else
+//                {
+//                    [RAUtils message_alert:[return_json valueForKey:@"err_msg"] title:@"Load Site News" controller:self] ;
+//                }
+//            }];
+//
+//        }];
+//    }];
+  
+}
+@end

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

@@ -30,7 +30,7 @@
     
     
     
-    
+ 
         
         if(RASingleton.sharedInstance.scan_cart ==nil)
         {
@@ -52,7 +52,9 @@
         
         NSMutableDictionary* jitem = nil;
          jitem = [self.modelJson mutableCopy];
-        
+    int stockUom =[jitem[@"stockUom"] intValue];
+    if(stockUom==0)
+        stockUom=1;
         bool newitem = true;
         for(int i=0;i<count;i++)
         {
@@ -79,8 +81,35 @@
         }
         if(newitem)
         {
+            jitem[@"count"]=@(stockUom);
             jitem[@"check"]=@(true);
             jitem[@"cart_item_id"]=[NSUUID UUID].UUIDString;
+            
+            NSString * unit_price;
+            if(RASingleton.sharedInstance.price_type==2)
+            {
+                unit_price=jitem[@"price2"];
+            }
+            else if(RASingleton.sharedInstance.price_type==1)
+            {
+                unit_price=jitem[@"price1"];
+            }
+            else
+            {
+                unit_price=jitem[@"price0"];
+            }
+            if(unit_price.length==0)
+                unit_price = @"0";
+            else
+            {
+                
+                unit_price = [NSString stringWithFormat:@"%.2f", [unit_price doubleValue]];
+            }
+            
+            
+            jitem[@"unit_price"] = unit_price;
+            
+            
             section[[NSString stringWithFormat:@"item_%i",count]] = jitem;
             section[@"count"]= @(count+1);
             count++;
@@ -113,14 +142,23 @@
 
     NSLog( [RAConvertor dict2string:modelJson]);
     
+    NSString * port=_modelJson[@"port"];
+    if(port.length==0)
+        port = @"N/A";
     
+    NSString * origin=_modelJson[@"origin"];
+    if(origin.length==0)
+        origin = @"N/A";
+    NSString * dimension=_modelJson[@"dimension"];
+    if(dimension.length==0)
+        dimension = @"N/A";
     
     _labelModel.text=_modelJson[@"model"];
     _labelDescription.text=_modelJson[@"description"];
-    _labelDimension.text=_modelJson[@"dimension"];
+    _labelDimension.text=dimension;
     _labelCuft.text=_modelJson[@"unit_cuft"];
-    _labelOrigin.text=_modelJson[@"origin"];
-    _labelPort.text=_modelJson[@"port"];
+    _labelOrigin.text=origin;
+    _labelPort.text=port;
     NSString* price0=_modelJson[@"price0"];
     NSString* price1=_modelJson[@"price1"];
     NSString* price2;
@@ -146,10 +184,19 @@
         price2=@"N/A";
     }
     
+    
+
+    
     _labelPriceCTNR.text=price0;
     _labelPriceNCA.text=price1;
     _labelPrice25p.text=price2;
-    _labelAvailable.text=_modelJson[@"available"];
+    
+    
+    NSString * available=_modelJson[@"available"];
+    if(available.length==0)
+        available = @"N/A";
+    
+    _labelAvailable.text=available;
     NSString * unit_cuft=_modelJson[@"unit_cuft"];
     if(unit_cuft.length==0)
         unit_cuft = @"N/A";

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

@@ -10,7 +10,7 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
-@interface ScanModelListCell : UITableViewCell
+@interface ScanModelListCell : UITableViewCell//<UITextFieldDelegate>
 @property (weak, nonatomic) IBOutlet UILabel *labelModel;
 @property (weak, nonatomic) IBOutlet UILabel *labelDescription;
 @property (weak, nonatomic) IBOutlet UILabel *labelDimension;
@@ -23,7 +23,9 @@ NS_ASSUME_NONNULL_BEGIN
 @property (weak, nonatomic) IBOutlet UILabel *labelAvailable;
 @property (weak, nonatomic) IBOutlet UITextField *editQTY;
 @property (strong, nonatomic) NSMutableDictionary *modelJson;
+@property (weak, nonatomic) IBOutlet UIStepper *steper;
 
+//@property int pre_val;
 
 @end
 

+ 114 - 5
RedAnt ERP Mobile/HMLG Scan Order/ScanModelListCell.m

@@ -8,12 +8,21 @@
 
 #import "ScanModelListCell.h"
 
+
+#import "RAUtils.h"
+
+
+#define NUMBERS @"0123456789\n"
 @implementation ScanModelListCell
+//- (IBAction)stepChange:(id)sender {
+//    self.editQTY.text = [NSString stringWithFormat:@"%d",(int)((UIStepper*)sender).value ];
+////    self.pre_val =(int)((UIStepper*)sender).value;
+//}
 
 - (void)awakeFromNib {
     [super awakeFromNib];
 //    self.editQTY.delegate = self;
-    
+//    _editQTY.delegate = self;
     // Initialization code
 }
 
@@ -40,10 +49,110 @@
     _labelPrice25p.text=_modelJson[@"price2"];
     _labelAvailable.text=_modelJson[@"available"];
         _editQTY.text=_modelJson[@"count"];
+    
+    int c =[_modelJson[@"count"] intValue];
+    int s =[_modelJson[@"stockUom"] intValue];
+    [self init_Stepper:s max:9999 min:0 value:c];
 }
 
-
-
-
-
+-(void) init_Stepper:(int) step max:(int) max min:(int)min value:(int)value
+{
+    
+//    [self.stepper becomeFirstResponder];
+    if(self.steper!=nil)
+    {
+//        if(min<=0)
+//            min=1;
+        if(step<=0)
+            step=1;
+        self.steper.minimumValue= min;
+        
+        
+        
+        self.steper.stepValue= step;
+        
+        self.steper.value= value;
+        
+       
+        
+//        [self.qtystepper addTarget:self action:@selector(valueChanged:) forControlEvents:UIControlEventValueChanged];
+        
+        
+    }
+}
+//
+//#pragma mark textField delegate
+//
+//- (BOOL)textFieldShouldReturn:(UITextField *)textField {
+//    [textField resignFirstResponder];
+//    return NO;
+//}
+//-(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{
+//    
+//    
+////    DebugLog(@"text:%@",textField.text);
+//    
+//    
+//  
+//    NSCharacterSet *cs;
+//    cs = [[NSCharacterSet characterSetWithCharactersInString:NUMBERS]invertedSet];
+//    
+//    NSString *filtered = [[string componentsSeparatedByCharactersInSet:cs]componentsJoinedByString:@""];
+//    
+//    BOOL canChange = [string isEqualToString:filtered];
+//    
+//    
+//    
+//    
+//    return canChange;
+//}
+//- (void)textFieldDidEndEditing:(UITextField *)textField
+//{
+//    
+//    
+////    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+//    int qty = [textField.text intValue];
+//    
+//    if(qty==0)
+//        qty=self.steper.minimumValue;
+//    
+//
+////    if ((int)qty % (int)self.stepper.stepValue != 0) {
+////        UIViewController* vc=[RAUtils getViewController :self];
+////        [((CartViewController *)vc).itemListTable reloadData];
+////        [RAUtils message_alert:[NSString stringWithFormat:@"Sold in quantities of %d",(int)(self.stepper.stepValue)] title:@"Change Model Count" controller:vc];
+////        return;
+////    }
+////
+//        
+//        int c=qty;
+//        
+//        int m=c%(int)(self.steper.stepValue);
+//        if(m!=0)
+//            
+//        {
+//            [RAUtils message_alert:[NSString stringWithFormat:@"QTY must be a multiple of %d",(int)self.steper.stepValue] title:@"Warrning" controller:[RAUtils getViewController:self]];
+//            textField.text = [NSString stringWithFormat:@"%d",self.pre_val];
+//        }
+//    
+//    self.pre_val = qty;
+//
+//    
+//        
+//    
+//    
+//    
+//    
+//
+//}
+//
+//- (void)textFieldDidBeginEditing:(UITextField *)textField
+//{
+//    NSString* text = textField.text;
+//    if(text.length==0)
+//        text=@"0";
+//    self.pre_val = [textField.text intValue];
+//    
+//   // self.last_edit = textField.text;
+//}
 @end

+ 3 - 0
RedAnt ERP Mobile/HMLG Scan Order/ScanOrderModelListViewController.h

@@ -14,6 +14,9 @@ NS_ASSUME_NONNULL_BEGIN
 @property (weak, nonatomic) IBOutlet UITableView *tableView;
 
 @property (strong, nonatomic) NSMutableArray* modellist;
+@property (strong, nonatomic) UITextField* lastedit;
+@property bool edit_check;
+@property int pre_val;
 @end
 
 NS_ASSUME_NONNULL_END

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

@@ -11,6 +11,7 @@
 #define NUMBERS @"0123456789\n"
 #import "RASingleton.h"
 #import "ActiveViewController.h"
+#import "RAUtils.h"
 @interface ScanOrderModelListViewController ()
 
 @end
@@ -19,8 +20,25 @@
 
 - (void)viewDidLoad {
     [super viewDidLoad];
+    self.edit_check = true;
     // Do any additional setup after loading the view.
 }
+- (IBAction)stepChange:(id)sender {
+    
+    UIStepper * stepper = (UIStepper *) sender;
+    UITableViewCell *cell = (UITableViewCell *) stepper.superview.superview;
+    NSIndexPath *   indexPath = [self.tableView indexPathForCell:cell];
+    ScanModelListCell * scancell = (ScanModelListCell*)cell;
+    NSMutableDictionary* item= self.modellist[indexPath.row];
+    int qty = (int)((UIStepper*)sender).value;
+    scancell.editQTY.text = [NSString stringWithFormat:@"%d",qty ];
+    item[@"count"] = @(qty);
+    item[@"subtotal_price"] = @(qty*[item[@"unit_price"] doubleValue]);
+    
+    self.modellist[indexPath.row] = item;
+    
+    
+}
 
 - (void)setScan_val:(id)scan_val
 {
@@ -30,6 +48,9 @@
     self.modellist = [NSMutableArray new];
     
     NSArray* arr = (NSArray*) self.scan_val;
+    bool iscollection=false;
+    if(arr.count>1)
+        iscollection = true;
     for(int i=0;i<arr.count;i++)
     {
         NSArray* item = arr[i];
@@ -48,7 +69,7 @@
         
         NSString * dimension=item[3];
         if(dimension.length==0)
-            dimension = @"";
+            dimension = @"N/A";
         
         NSString * mpack=item[4];
         if(mpack.length==0)
@@ -145,7 +166,10 @@
         jitem[@"price1"] =price1;
         jitem[@"price2"] =price2;
         jitem[@"stockUom"] = mpack;
-        jitem[@"count"] = mpack;
+        if(iscollection)
+            jitem[@"count"]=@"0";
+        else
+            jitem[@"count"] = mpack;
         jitem[@"subtotal_price"] = @([mpack intValue]* [jitem[@"unit_price"] doubleValue]);
 
         jitem[@"dimension"] = dimension;
@@ -154,6 +178,7 @@
         jitem[@"origin"] = origin;
         jitem[@"port"] = port;
         jitem[@"available"] = available;
+//        jitem[@"iscollection"]= @(iscollection);
         
         //        jitem[@"unit_price"] =@( [item[3] doubleValue]);
         //        jitem[@"stockUom"] = @([item[4] intValue]);
@@ -233,6 +258,11 @@
 
 - (IBAction)onAddToCart:(id)sender {
     
+//    [self.lastedit endEditing:true];
+   if(self.lastedit)
+       [self textFieldDidEndEditing:self.lastedit];
+    
+    if(self.edit_check)
     [self dismissViewControllerAnimated:true completion:^{
             if(self.returnValue)
                 self.returnValue(self.modellist);
@@ -274,10 +304,14 @@
 
 - (void)textFieldDidBeginEditing:(UITextField *)textField
 {
-   
+    self.lastedit = textField;
     
 //    self.lastedit = textField;
-//    UITableViewCell *cell = (UITableViewCell *) textField.superview.superview;
+    UITableViewCell *cell = (UITableViewCell *) textField.superview.superview;
+    ScanModelListCell * scancell = (ScanModelListCell*)cell;
+    
+//    scancell.pre_val=[textField.text intValue];
+    
 //    self.lastedit_from  = [self.editorTable indexPathForCell:cell];
 //    
 //    NSDictionary* item_json =((NSMutableArray*)self.content_data_control[self.lastedit_from.section])[self.lastedit_from.row];
@@ -295,12 +329,39 @@
 - (void)textFieldDidEndEditing:(UITextField *)textField
 {
     
- 
+    self.lastedit = nil;
     UITableViewCell *cell = (UITableViewCell *) textField.superview.superview;
     NSIndexPath *   indexPath = [self.tableView indexPathForCell:cell];
-    int qty = [textField.text intValue];
+    ScanModelListCell * scancell = (ScanModelListCell*)cell;
     
     NSMutableDictionary* item= self.modellist[indexPath.row];
+    int qty = [textField.text intValue];
+    
+    int c=qty;
+    
+    int mpack= [item[@"stockUom"] intValue];
+    
+    int m=c%mpack;
+    if(m!=0)
+        
+    {
+        [RAUtils message_alert:[NSString stringWithFormat:@"QTY must be a multiple of %d",mpack] title:@"Warrning" controller:self];
+        textField.text = [NSString stringWithFormat:@"%d",[item[@"count"] intValue]];
+        self.edit_check = false;
+        return;
+    }
+
+//self.pre_val = qty;
+
+    
+    
+    
+    
+    self.edit_check=true;
+    
+    
+    scancell.steper.value = qty;
+  
     
     
     item[@"count"] = @(qty);

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

@@ -27,6 +27,12 @@
     
     // Do any additional setup after loading the view.
 }
+- (BOOL)shouldAutorotate
+{
+    
+    return false;
+    
+}
 - (void)viewWillAppear:(BOOL)animated
 {
     [super viewWillAppear:animated];
@@ -137,7 +143,7 @@
 {
     
     
-    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+//    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
     int qty = [textField.text intValue];
     
     if(qty==0)

+ 9 - 0
RedAnt ERP Mobile/HMLG Scan Order/ScanSearchViewController.m

@@ -327,6 +327,7 @@
     __weak typeof(self) weakself = self;
     NSBlockOperation *operation = [NSBlockOperation blockOperationWithBlock:^{
         
+        
         if (weakself) {
             __strong typeof(weakself) strongself = weakself;
             [strongself operation_reload];
@@ -381,6 +382,12 @@
                 
                 
                 int c=[[category_data valueForKey:@"count"] intValue];
+                
+                if(c==0)
+                {
+                    [RAUtils message_alert:@"No results found" title:@"Search" controller:self];
+                    return;
+                }
                 self.offset = c;
                 for (int i=0;i<c;i++)
                 {
@@ -453,6 +460,8 @@
     
     self.keywords=searchBar.text;
     self.offset = 0;
+    [self.modellist removeAllObjects];
+    [self.tableview reloadData];
     //  [self.content_data removeAllObjects];
     [self reload];
     

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

@@ -42,7 +42,7 @@
                                       reuseIdentifier:MyIdentifier];
 
     }
-    cell.textLabel.text = self.serverlist[indexPath.row][@"name"];
+    cell.textLabel.text = self.serverlist[indexPath.row][@"show_name"];
     
     return cell;
 }

+ 25 - 3
RedAnt ERP Mobile/HMLG Scan Order/ServerSettingViewController.m

@@ -57,6 +57,28 @@
         //   self.btop = false;
         //  <#code#>
     }];
+    
+    
+//    
+//    
+//    UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:aboutVC] ;
+//    
+//
+//    
+//    
+//    
+//    //    [self hackModalSheetSize:CGSizeMake(450, 200) ofVC:navi];
+//    
+//    navi.modalPresentationStyle = UIModalTransitionStyleCrossDissolve;//有三种状态,自己看看是哪种
+//    [self presentViewController:navi animated:YES completion:^{
+//        
+//        //        navi.view.superview.bounds = CGRectMake(0, 0, 480, 320);
+//        
+//        DebugLog(@"about present.........");
+//        
+//        //   self.btop = false;
+//        //  <#code#>
+//    }];
 }
 - (IBAction)onPrivacyClick:(id)sender {
     
@@ -125,7 +147,7 @@
             sa=ia;
         }
         self.internalText= sa;
-        self.nameTextField.text = [addressDic objectForKey:@"name"];
+        self.nameTextField.text = [addressDic objectForKey:@"show_name"];
 //        RASingleton.sharedInstance.price_index =[addressDic[@"price_type"] intValue];
 //        NSUInteger selectedIndex = [[addressDic objectForKey:@"selectedIndex"] integerValue];
 //        switch (selectedIndex) {
@@ -402,8 +424,8 @@
                 if (addressDic) {
                     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
                     MainViewController* main_vc=(MainViewController*)appDelegate.main_vc;
-                    main_vc.labelServer.text = [addressDic objectForKey:@"name"];
-                    self.nameTextField.text = [addressDic objectForKey:@"name"];
+                    main_vc.labelServer.text = [addressDic objectForKey:@"show_name"];
+                    self.nameTextField.text = [addressDic objectForKey:@"show_name"];
                     self.internalText = [addressDic objectForKey:@"serverAddress"];
 
                 }

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

@@ -53,7 +53,9 @@
                 NSUInteger selectedIndex = 1;
              
                         // 保存信息
+                        
                         NSString *name = self.server[@"name"];
+                NSString *show_name = self.server[@"show_name"];
                         NSString *internalAddr = self.server[@"url"];
               int price_index = [self.server[@"price_type"] intValue];
             //            NSString *externalAddr = weakself.externalTextField.text;
@@ -67,6 +69,9 @@
                         if (name.length) {
                             [addressDic setObject:name forKey:@"name"];
                         }
+                if (show_name.length) {
+                    [addressDic setObject:show_name forKey:@"show_name"];
+                }
                 [addressDic setObject:@(price_index) forKey:@"price_index"];
                         [addressDic setObject:@(selectedIndex) forKey:@"selectedIndex"];
                 NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
@@ -174,6 +179,8 @@
                             NSString* datetime= [RAUtils current_date_time];
                             templateDic[@"updatetime"]= datetime;
                             [self setUserDefaultsValue:templateDic forKey:@"ScanTemplate"];
+                            
+                            [OLDataProvider guestLogin];
 //                            [self loadTemplate];
                             
                             
@@ -211,13 +218,14 @@
     }
 
 }
+
 - (IBAction)onSelectServer:(id)sender {
     
     ScanServerListViewController * servervc =[[UIStoryboard storyboardWithName:@"SO" bundle:nil] instantiateViewControllerWithIdentifier:@"ScanServerListViewController"];
     servervc.serverlist = self.serverlist;
     servervc.returnValue = ^(int index) {
         self.server = self.serverlist[index];
-        [self.btnSelectServer setTitle:self.server[@"name"] forState:UIControlStateNormal];
+        [self.btnSelectServer setTitle:self.server[@"show_name"] forState:UIControlStateNormal];
     };
     [self.navigationController pushViewController:servervc animated:true];
     

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

@@ -12,6 +12,8 @@
 #define BACKORDER_PROCESS // 允许backorder process
 
 
+#define GLES_SILENCE_DEPRECATION //关闭glkview警告
+
 #define RA_NOTIFICATION
 
 # ifdef DEBUG
@@ -47,9 +49,9 @@
 #define CONTACT_LIST 1
 
 #define  APP_NAME @"HMLG Scan Order"
-#define COMPANY_SHORT_NAME @"HMLG"
-#define  COMPANY_NAME @"HMLG"
-#define  COMPANY_INFO @"Sales: sales@united-us.net\nPhone: 510-574-8180"
+#define COMPANY_SHORT_NAME @"HMLG Scan Order"
+#define  COMPANY_NAME @"Homelegance"
+#define  COMPANY_INFO @"Email: IT@homelegance.com\nPhone: (510) 933-6888"
 #define  COMPANY_WEB @"www.united-us.net"
 #define  COMPANY_FULL_NAME @"United Software Applications, Inc."
 
@@ -208,6 +210,7 @@
 #endif
 
 #define URL_SERVER_LIST BASE_URL@"offlineorder_isales.php"
+#define URL_SCAN_NEWS BASE_URL@"offlineorder_isales.php"
 #define URL_SERVER_CHECK @"offlineorder_isales.php"
 #define URL_SIGN_UP @"offlineorder_isales.php"
 #define  URL_RETRIEVE_PASS  @"offlineorder_isales.php"

+ 3 - 5
RedAnt ERP Mobile/Launch Screen.storyboard

@@ -1,11 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
-    <device id="ipad9_7" orientation="portrait">
-        <adaptation id="fullscreen"/>
-    </device>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
+    <device id="ipad9_7" orientation="portrait" layout="fullscreen" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <scenes>

+ 9 - 1
RedAnt ERP Mobile/common/AppDelegateBase.m

@@ -119,7 +119,10 @@
     _user = user;
     [RASingleton.sharedInstance setGlobalParameter:_user forKey:@"user"];
 }
-
+- (void)setUser_type:(long)user_type
+{
+    _user_type = user_type;
+}
 - (void)setPassword:(NSString *)password {
     _password = password;
     [RASingleton.sharedInstance setGlobalParameter:_password forKey:@"password"];
@@ -415,7 +418,9 @@
         }
         else
         {
+#ifndef SCANNER_ORDER
             main_vc.btnContact.hidden = NO;
+#endif
             if(self.user_type==USER_ROLE_CUSTOMER)
             {
                 NSString* title = [NSString stringWithFormat:@"%@",self.user];
@@ -599,6 +604,9 @@ void UncaughtExceptionHandler(NSException *exception) {
 
 - (void)handleErrorLog {
     
+#ifdef SCANNER_ORDER
+    return;
+#endif
     __block NSMutableArray *err_array = [NSMutableArray array];
     [iSalesDB jk_query:@"select errmsg,params,create_time from errlog;" completion:^(sqlite3_stmt *stmt, NSMutableDictionary *container, long *count) {
         

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

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="19529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
-    <device id="ipad9_7" orientation="portrait" layout="fullscreen" appearance="light"/>
+<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="retina6_1" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19519"/>
+        <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"/>
@@ -13,19 +13,19 @@
         <scene sceneID="s6l-Bm-hcn">
             <objects>
                 <viewController storyboardIdentifier="CartViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="K4s-dn-ekA" customClass="CartViewController" sceneMemberID="viewController">
-                    <view key="view" contentMode="scaleToFill" id="dPU-c4-Qhu">
-                        <rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
+                    <view key="view" contentMode="scaleToFill" ambiguous="YES" id="dPU-c4-Qhu">
+                        <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                         <subviews>
-                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="EdG-w6-IAt" userLabel="cart item view">
-                                <rect key="frame" x="0.0" y="40" width="768" height="860"/>
+                            <view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="EdG-w6-IAt" userLabel="cart item view">
+                                <rect key="frame" x="0.0" y="40" width="768" height="732"/>
                                 <subviews>
-                                    <activityIndicatorView opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" hidesWhenStopped="YES" animating="YES" style="whiteLarge" translatesAutoresizingMaskIntoConstraints="NO" id="hlZ-3P-GUS" userLabel="mum">
-                                        <rect key="frame" x="365.5" y="411.5" width="37" height="37"/>
+                                    <activityIndicatorView opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" ambiguous="YES" hidesWhenStopped="YES" animating="YES" style="whiteLarge" translatesAutoresizingMaskIntoConstraints="NO" id="hlZ-3P-GUS" userLabel="mum">
+                                        <rect key="frame" x="365.5" y="347.5" width="37" height="37"/>
                                         <color key="color" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                     </activityIndicatorView>
-                                    <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="120" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="OMD-NW-nZo">
-                                        <rect key="frame" x="0.0" y="0.0" width="768" height="860"/>
+                                    <tableView clipsSubviews="YES" contentMode="scaleToFill" ambiguous="YES" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="120" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="OMD-NW-nZo">
+                                        <rect key="frame" x="0.0" y="0.0" width="768" height="732"/>
                                         <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                                         <color key="sectionIndexBackgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                         <prototypes>
@@ -41,7 +41,7 @@
                                                             <fontDescription key="fontDescription" name="HelveticaNeue" family="Helvetica Neue" pointSize="15"/>
                                                             <nil key="highlightedColor"/>
                                                         </label>
-                                                        <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="9999" borderStyle="roundedRect" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="cfH-6d-98v" userLabel="qty">
+                                                        <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" ambiguous="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="9999" borderStyle="roundedRect" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="cfH-6d-98v" userLabel="qty">
                                                             <rect key="frame" x="438" y="41" width="60" height="32"/>
                                                             <constraints>
                                                                 <constraint firstAttribute="height" constant="32" id="9qV-vK-2rq"/>
@@ -67,7 +67,7 @@
                                                                 <action selector="imgbtnClick:" destination="K4s-dn-ekA" eventType="touchUpInside" id="nsM-B6-1hs"/>
                                                             </connections>
                                                         </button>
-                                                        <stepper opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="1" maximumValue="99999" translatesAutoresizingMaskIntoConstraints="NO" id="Icr-T0-BzH">
+                                                        <stepper opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" ambiguous="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="1" maximumValue="99999" translatesAutoresizingMaskIntoConstraints="NO" id="Icr-T0-BzH">
                                                             <rect key="frame" x="513" y="41" width="94" height="32"/>
                                                             <constraints>
                                                                 <constraint firstAttribute="height" constant="32" id="8h7-sY-BPG"/>
@@ -77,7 +77,7 @@
                                                                 <action selector="setpperChanged:" destination="9d9-Fh-IGR" eventType="touchUpInside" id="jbq-k8-acA"/>
                                                             </connections>
                                                         </stepper>
-                                                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="12345678.99" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9e7-U4-taE" userLabel="unit price">
+                                                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="12345678.99" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9e7-U4-taE" userLabel="unit price">
                                                             <rect key="frame" x="313" y="46.5" width="110" height="21"/>
                                                             <constraints>
                                                                 <constraint firstAttribute="width" constant="110" id="W0G-CU-uww"/>
@@ -124,7 +124,7 @@
                                                             <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                                             <nil key="highlightedColor"/>
                                                         </label>
-                                                        <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="123456789.00" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4CM-f3-iTa" userLabel="subtotal price">
+                                                        <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="123456789.00" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4CM-f3-iTa" userLabel="subtotal price">
                                                             <rect key="frame" x="622" y="46.5" width="115" height="21"/>
                                                             <constraints>
                                                                 <constraint firstAttribute="width" constant="115" id="H2W-Ot-Soh"/>
@@ -394,8 +394,8 @@ Stock</string>
                                             <outlet property="delegate" destination="K4s-dn-ekA" id="Dsa-Vu-1mo"/>
                                         </connections>
                                     </tableView>
-                                    <label hidden="YES" opaque="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Cannot get data from server.
Tap to try again." textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="c8z-jb-g0B">
-                                        <rect key="frame" x="263.5" y="407.5" width="241.5" height="45.5"/>
+                                    <label hidden="YES" opaque="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" text="Cannot get data from server.
Tap to try again." textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="c8z-jb-g0B">
+                                        <rect key="frame" x="263.5" y="343.5" width="241.5" height="45.5"/>
                                         <fontDescription key="fontDescription" type="system" pointSize="19"/>
                                         <color key="textColor" red="0.33333333329999998" green="0.33333333329999998" blue="0.33333333329999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                         <nil key="highlightedColor"/>
@@ -413,8 +413,8 @@ Stock</string>
                                     <constraint firstItem="hlZ-3P-GUS" firstAttribute="centerY" secondItem="EdG-w6-IAt" secondAttribute="centerY" id="zRg-dN-0zQ"/>
                                 </constraints>
                             </view>
-                            <toolbar hidden="YES" opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="JjI-8g-Zx7">
-                                <rect key="frame" x="0.0" y="980" width="768" height="44"/>
+                            <toolbar hidden="YES" opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="JjI-8g-Zx7">
+                                <rect key="frame" x="0.0" y="852" width="768" height="44"/>
                                 <constraints>
                                     <constraint firstAttribute="height" constant="44" id="882-wy-gda"/>
                                 </constraints>
@@ -444,11 +444,11 @@ Stock</string>
                                     </barButtonItem>
                                 </items>
                             </toolbar>
-                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="gh3-Tt-1Iu">
-                                <rect key="frame" x="0.0" y="900" width="768" height="124"/>
+                            <view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="gh3-Tt-1Iu">
+                                <rect key="frame" x="0.0" y="772" width="768" height="124"/>
                                 <subviews>
                                     <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Total QTY:" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bJB-df-Qia" userLabel="total price">
-                                        <rect key="frame" x="511" y="10" width="110" height="20"/>
+                                        <rect key="frame" x="193" y="10" width="110" height="20"/>
                                         <constraints>
                                             <constraint firstAttribute="width" constant="110" id="ASl-r2-ue5"/>
                                             <constraint firstAttribute="height" constant="20" id="nCB-t9-EXm"/>
@@ -458,7 +458,7 @@ Stock</string>
                                         <nil key="highlightedColor"/>
                                     </label>
                                     <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Subtotal Price:" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="e8a-7k-glR" userLabel="total price">
-                                        <rect key="frame" x="511" y="62" width="110" height="20"/>
+                                        <rect key="frame" x="193" y="62" width="110" height="20"/>
                                         <constraints>
                                             <constraint firstAttribute="height" constant="20" id="eys-5N-MvF"/>
                                             <constraint firstAttribute="width" constant="110" id="mjO-Mx-uZY"/>
@@ -468,7 +468,7 @@ Stock</string>
                                         <nil key="highlightedColor"/>
                                     </label>
                                     <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="BdK-WN-iBd" userLabel="value">
-                                        <rect key="frame" x="629" y="61.5" width="124" height="20"/>
+                                        <rect key="frame" x="311" y="61.5" width="124" height="20"/>
                                         <constraints>
                                             <constraint firstAttribute="width" constant="124" id="Vtk-fK-PuB"/>
                                             <constraint firstAttribute="height" constant="20" id="att-Sj-4TY"/>
@@ -478,7 +478,7 @@ Stock</string>
                                         <nil key="highlightedColor"/>
                                     </label>
                                     <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="QFj-Yq-8py" userLabel="value">
-                                        <rect key="frame" x="357" y="9.5" width="124" height="20"/>
+                                        <rect key="frame" x="39" y="9.5" width="124" height="20"/>
                                         <constraints>
                                             <constraint firstAttribute="height" constant="20" id="fF3-qa-JIv"/>
                                             <constraint firstAttribute="width" constant="124" id="u0P-tW-8Ag"/>
@@ -487,7 +487,7 @@ Stock</string>
                                         <nil key="highlightedColor"/>
                                     </label>
                                     <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Yo2-dv-uQb" userLabel="value">
-                                        <rect key="frame" x="357" y="35.5" width="124" height="20"/>
+                                        <rect key="frame" x="39" y="35.5" width="124" height="20"/>
                                         <constraints>
                                             <constraint firstAttribute="width" constant="124" id="aCa-A9-n1v"/>
                                             <constraint firstAttribute="height" constant="20" id="zlU-CH-UxH"/>
@@ -496,7 +496,7 @@ Stock</string>
                                         <nil key="highlightedColor"/>
                                     </label>
                                     <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="oeZ-Yi-d5I" userLabel="value">
-                                        <rect key="frame" x="357" y="61.5" width="124" height="20"/>
+                                        <rect key="frame" x="39" y="61.5" width="124" height="20"/>
                                         <constraints>
                                             <constraint firstAttribute="width" constant="124" id="Ri7-Tx-fGs"/>
                                             <constraint firstAttribute="height" constant="20" id="xFK-gK-N8c"/>
@@ -505,7 +505,7 @@ Stock</string>
                                         <nil key="highlightedColor"/>
                                     </label>
                                     <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Rdv-8s-Jy6" customClass="DefaultImageButton">
-                                        <rect key="frame" x="623" y="84" width="130" height="30"/>
+                                        <rect key="frame" x="305" y="84" width="130" height="30"/>
                                         <constraints>
                                             <constraint firstAttribute="height" constant="30" id="BbJ-vM-qDn"/>
                                             <constraint firstAttribute="width" constant="130" id="Zsq-V3-xKe"/>
@@ -523,7 +523,7 @@ Stock</string>
                                         </connections>
                                     </button>
                                     <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="WY7-cp-N9a" customClass="DefaultImageButton">
-                                        <rect key="frame" x="573" y="84" width="30" height="30"/>
+                                        <rect key="frame" x="255" y="84" width="30" height="30"/>
                                         <constraints>
                                             <constraint firstAttribute="width" constant="30" id="3ZM-R4-EV0"/>
                                             <constraint firstAttribute="height" constant="30" id="A0j-fv-eZx"/>
@@ -552,7 +552,7 @@ Stock</string>
                                         </connections>
                                     </button>
                                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Total CuFt:" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jqa-Zp-Sg2">
-                                        <rect key="frame" x="239" y="10" width="110" height="20"/>
+                                        <rect key="frame" x="-79" y="10" width="110" height="20"/>
                                         <constraints>
                                             <constraint firstAttribute="width" constant="110" id="OSa-ja-uLx"/>
                                             <constraint firstAttribute="height" constant="20" id="tkj-g6-THx"/>
@@ -562,7 +562,7 @@ Stock</string>
                                         <nil key="highlightedColor"/>
                                     </label>
                                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Total Weight:" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PWY-Zc-LEx">
-                                        <rect key="frame" x="239" y="36" width="110" height="20"/>
+                                        <rect key="frame" x="-79" y="36" width="110" height="20"/>
                                         <constraints>
                                             <constraint firstAttribute="width" constant="110" id="ImV-Hf-ek0"/>
                                             <constraint firstAttribute="height" constant="20" id="w5u-XI-iou"/>
@@ -572,7 +572,7 @@ Stock</string>
                                         <nil key="highlightedColor"/>
                                     </label>
                                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Total Carton:" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1bF-Cv-KYG">
-                                        <rect key="frame" x="239" y="62" width="110" height="20"/>
+                                        <rect key="frame" x="-79" y="62" width="110" height="20"/>
                                         <constraints>
                                             <constraint firstAttribute="width" constant="110" id="6qd-WY-Ify"/>
                                             <constraint firstAttribute="height" constant="20" id="hcr-ZH-FNy"/>
@@ -582,7 +582,7 @@ Stock</string>
                                         <nil key="highlightedColor"/>
                                     </label>
                                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Total  Items:" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4kM-vh-YbC">
-                                        <rect key="frame" x="511" y="36" width="110" height="20"/>
+                                        <rect key="frame" x="193" y="36" width="110" height="20"/>
                                         <constraints>
                                             <constraint firstAttribute="width" constant="110" id="Umv-oU-RnI"/>
                                             <constraint firstAttribute="height" constant="20" id="bFa-SW-aPi"/>
@@ -603,7 +603,7 @@ Stock</string>
                                         </connections>
                                     </button>
                                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9Da-eJ-p37">
-                                        <rect key="frame" x="629" y="35.5" width="124" height="20"/>
+                                        <rect key="frame" x="311" y="35.5" width="124" height="20"/>
                                         <constraints>
                                             <constraint firstAttribute="width" constant="124" id="Nup-mi-BKD"/>
                                             <constraint firstAttribute="height" constant="20" id="Oji-iQ-rBl"/>
@@ -613,7 +613,7 @@ Stock</string>
                                         <nil key="highlightedColor"/>
                                     </label>
                                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zeq-Qm-obt">
-                                        <rect key="frame" x="629" y="9.5" width="124" height="20"/>
+                                        <rect key="frame" x="311" y="9.5" width="124" height="20"/>
                                         <constraints>
                                             <constraint firstAttribute="width" constant="124" id="OMw-e6-rkf"/>
                                             <constraint firstAttribute="height" constant="20" id="Wzz-8C-fgu"/>
@@ -623,7 +623,7 @@ Stock</string>
                                         <nil key="highlightedColor"/>
                                     </label>
                                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3H2-JS-FOj">
-                                        <rect key="frame" x="135" y="89" width="318" height="20"/>
+                                        <rect key="frame" x="135" y="89" width="0.0" height="20"/>
                                         <constraints>
                                             <constraint firstAttribute="height" constant="20" id="8fm-fp-Kxk"/>
                                         </constraints>
@@ -648,7 +648,7 @@ Stock</string>
                                         </connections>
                                     </button>
                                     <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="y50-hu-fgy">
-                                        <rect key="frame" x="523" y="84" width="30" height="30"/>
+                                        <rect key="frame" x="205" y="84" width="30" height="30"/>
                                         <constraints>
                                             <constraint firstAttribute="width" constant="30" id="aLc-U8-fS9"/>
                                             <constraint firstAttribute="height" constant="30" id="h0h-KZ-y4A"/>
@@ -659,7 +659,7 @@ Stock</string>
                                         </connections>
                                     </button>
                                     <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Y27-jk-l1Z">
-                                        <rect key="frame" x="473" y="84" width="30" height="30"/>
+                                        <rect key="frame" x="155" y="84" width="30" height="30"/>
                                         <constraints>
                                             <constraint firstAttribute="height" constant="30" id="dEP-Jv-ccc"/>
                                             <constraint firstAttribute="width" constant="30" id="tzu-IE-AXt"/>
@@ -777,13 +777,13 @@ Stock</string>
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                         <subviews>
                             <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="d3M-dW-oMp">
-                                <rect key="frame" x="10" y="10" width="460" height="250"/>
+                                <rect key="frame" x="10" y="44" width="460" height="202"/>
                                 <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                 <textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
                             </textView>
                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="2mZ-oE-Upn" customClass="DefaultImageButton">
-                                <rect key="frame" x="358" y="270" width="102" height="30"/>
+                                <rect key="frame" x="358" y="256" width="102" height="30"/>
                                 <constraints>
                                     <constraint firstAttribute="height" constant="30" id="zsK-mj-wNb"/>
                                 </constraints>
@@ -805,10 +805,10 @@ Stock</string>
                         <viewLayoutGuide key="safeArea" id="ht7-8i-y2A"/>
                         <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <constraints>
-                            <constraint firstItem="2mZ-oE-Upn" firstAttribute="top" secondItem="d3M-dW-oMp" secondAttribute="bottom" constant="10" id="02U-fr-sgW"/>
-                            <constraint firstItem="d3M-dW-oMp" firstAttribute="top" secondItem="yC9-0J-puC" secondAttribute="top" constant="10" id="5eM-VQ-uKP"/>
+                            <constraint firstItem="d3M-dW-oMp" firstAttribute="top" secondItem="ht7-8i-y2A" secondAttribute="top" id="5eM-VQ-uKP"/>
                             <constraint firstItem="d3M-dW-oMp" firstAttribute="leading" secondItem="ht7-8i-y2A" secondAttribute="leading" constant="10" id="Qcf-vv-9on"/>
-                            <constraint firstAttribute="bottom" secondItem="2mZ-oE-Upn" secondAttribute="bottom" constant="20" id="ps3-Tf-yMj"/>
+                            <constraint firstItem="2mZ-oE-Upn" firstAttribute="top" secondItem="d3M-dW-oMp" secondAttribute="bottom" constant="10" id="e8w-eD-Kn4"/>
+                            <constraint firstItem="ht7-8i-y2A" firstAttribute="bottom" secondItem="2mZ-oE-Upn" secondAttribute="bottom" id="ps3-Tf-yMj"/>
                             <constraint firstItem="ht7-8i-y2A" firstAttribute="trailing" secondItem="2mZ-oE-Upn" secondAttribute="trailing" constant="20" id="qbu-51-uIN"/>
                             <constraint firstItem="ht7-8i-y2A" firstAttribute="trailing" secondItem="d3M-dW-oMp" secondAttribute="trailing" constant="10" id="tke-WU-3R1"/>
                         </constraints>
@@ -970,7 +970,7 @@ Stock</string>
             <objects>
                 <viewController id="H3V-ep-3dc" sceneMemberID="viewController">
                     <view key="view" contentMode="scaleToFill" id="MLp-rr-7PZ">
-                        <rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
+                        <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <viewLayoutGuide key="safeArea" id="Rxk-rC-Cfr"/>
                         <color key="backgroundColor" systemColor="systemBackgroundColor"/>

+ 225 - 99
RedAnt ERP Mobile/common/ERP_Mobile_Order.storyboard

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="19529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
-    <device id="ipad9_7" orientation="portrait" layout="fullscreen" appearance="light"/>
+<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="ipad9_7" orientation="landscape" layout="fullscreen" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19519"/>
+        <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"/>
@@ -14,22 +14,22 @@
             <objects>
                 <viewController storyboardIdentifier="OrderDetailViewController" title="OrderDetailViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="SQE-Xv-k3T" customClass="OrderDetailViewController" sceneMemberID="viewController">
                     <view key="view" contentMode="scaleToFill" id="xxC-Xb-2C0">
-                        <rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
+                        <rect key="frame" x="0.0" y="0.0" width="1024" height="768"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
                             <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" allowsSelection="NO" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="oO0-Aa-nhV">
-                                <rect key="frame" x="0.0" y="20" width="768" height="1004"/>
+                                <rect key="frame" x="0.0" y="20" width="1024" height="748"/>
                                 <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <prototypes>
                                     <tableViewCell contentMode="scaleToFill" restorationIdentifier="OrderDetailInfoCell" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="OrderDetailInfoCell" id="j6Z-EZ-h51" customClass="OrderDetailInfoCell">
-                                        <rect key="frame" x="0.0" y="44.5" width="768" height="44"/>
+                                        <rect key="frame" x="0.0" y="44.5" width="1024" height="44"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="j6Z-EZ-h51" id="XdH-yQ-RbM">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="44"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="1024" height="44"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="wbf-Qs-Bfm" customClass="RTLabel">
-                                                    <rect key="frame" x="-23" y="-26" width="773" height="29"/>
+                                                    <rect key="frame" x="-23" y="-26" width="1029" height="29"/>
                                                     <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                                     <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                                 </view>
@@ -40,14 +40,14 @@
                                         </connections>
                                     </tableViewCell>
                                     <tableViewCell contentMode="scaleToFill" restorationIdentifier="OrderDetailModelCell" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="OrderDetailModelCell" rowHeight="190" id="1Fs-vK-Pg3" customClass="OrderDetailModelCell">
-                                        <rect key="frame" x="0.0" y="88.5" width="768" height="190"/>
+                                        <rect key="frame" x="0.0" y="88.5" width="1024" height="190"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="1Fs-vK-Pg3" id="dka-AS-2v7">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="190"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="1024" height="190"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="12345678.00" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="v2a-Vh-u5V" userLabel="unit price">
-                                                    <rect key="frame" x="498" y="44" width="125" height="21"/>
+                                                    <rect key="frame" x="754" y="44" width="125" height="21"/>
                                                     <constraints>
                                                         <constraint firstAttribute="width" constant="125" id="1GU-hr-4BK"/>
                                                         <constraint firstAttribute="height" constant="21" id="DeV-QP-bfX"/>
@@ -57,7 +57,7 @@
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="123456789.00" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="w87-zj-bCW" userLabel="sub total">
-                                                    <rect key="frame" x="498" y="98" width="125" height="21"/>
+                                                    <rect key="frame" x="754" y="98" width="125" height="21"/>
                                                     <constraints>
                                                         <constraint firstAttribute="height" constant="21" id="K7o-rW-5hj"/>
                                                         <constraint firstAttribute="width" constant="125" id="mHy-ze-1NG"/>
@@ -67,7 +67,7 @@
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="x9999" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yZz-tn-3y6" userLabel="qty">
-                                                    <rect key="frame" x="498" y="71" width="125" height="21"/>
+                                                    <rect key="frame" x="754" y="71" width="125" height="21"/>
                                                     <constraints>
                                                         <constraint firstAttribute="width" constant="125" id="7z7-SC-PSj"/>
                                                         <constraint firstAttribute="height" constant="21" id="n7X-pp-b7v"/>
@@ -77,7 +77,7 @@
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Price:" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="253-RS-2wN">
-                                                    <rect key="frame" x="422" y="44" width="70" height="21"/>
+                                                    <rect key="frame" x="678" y="44" width="70" height="21"/>
                                                     <constraints>
                                                         <constraint firstAttribute="width" constant="70" id="0N1-Nx-eWh"/>
                                                         <constraint firstAttribute="height" constant="21" id="fLJ-JL-G9u"/>
@@ -87,7 +87,7 @@
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="QTY:" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="sbm-I1-hea">
-                                                    <rect key="frame" x="422" y="71" width="70" height="21"/>
+                                                    <rect key="frame" x="678" y="71" width="70" height="21"/>
                                                     <constraints>
                                                         <constraint firstAttribute="height" constant="21" id="WYD-iZ-C7s"/>
                                                         <constraint firstAttribute="width" constant="70" id="aQB-TW-GvN"/>
@@ -97,7 +97,7 @@
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Subtotal:" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zlP-Th-OiZ">
-                                                    <rect key="frame" x="422" y="98" width="70" height="21"/>
+                                                    <rect key="frame" x="678" y="98" width="70" height="21"/>
                                                     <constraints>
                                                         <constraint firstAttribute="width" constant="70" id="HI9-Jh-6lb"/>
                                                         <constraint firstAttribute="height" constant="21" id="PU7-ZJ-ae0"/>
@@ -107,7 +107,7 @@
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Dwj-LQ-RTY" userLabel="status">
-                                                    <rect key="frame" x="648" y="71" width="105" height="20.5"/>
+                                                    <rect key="frame" x="904" y="71" width="105" height="20.5"/>
                                                     <constraints>
                                                         <constraint firstAttribute="width" constant="105" id="sUl-Ne-aBX"/>
                                                     </constraints>
@@ -116,13 +116,13 @@
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ncC-kn-LMx" userLabel="description">
-                                                    <rect key="frame" x="123" y="71" width="291" height="20.5"/>
+                                                    <rect key="frame" x="123" y="71" width="547" height="20.5"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                                     <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Status" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="E4y-0p-yxO">
-                                                    <rect key="frame" x="648" y="44" width="105" height="21"/>
+                                                    <rect key="frame" x="904" y="44" width="105" height="21"/>
                                                     <constraints>
                                                         <constraint firstAttribute="height" constant="21" id="7G8-fE-z7R"/>
                                                         <constraint firstAttribute="width" constant="105" id="AOo-Ce-BFk"/>
@@ -132,7 +132,7 @@
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="jem-ju-7ya">
-                                                    <rect key="frame" x="123" y="99.5" width="522" height="30"/>
+                                                    <rect key="frame" x="123" y="99.5" width="778" height="30"/>
                                                     <constraints>
                                                         <constraint firstAttribute="height" constant="30" id="G0t-9u-U3i"/>
                                                     </constraints>
@@ -142,7 +142,7 @@
                                                     </connections>
                                                 </button>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="12345678.00" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="XJC-fn-vh5" customClass="StrikethroughLabel">
-                                                    <rect key="frame" x="573" y="15" width="125" height="21"/>
+                                                    <rect key="frame" x="829" y="15" width="125" height="21"/>
                                                     <constraints>
                                                         <constraint firstAttribute="height" constant="21" id="2gM-O4-dNB"/>
                                                         <constraint firstAttribute="width" constant="125" id="dzD-Wv-PC2"/>
@@ -152,7 +152,7 @@
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="10.00% off" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="V6q-rE-pIH">
-                                                    <rect key="frame" x="443" y="15" width="100" height="21"/>
+                                                    <rect key="frame" x="699" y="15" width="100" height="21"/>
                                                     <constraints>
                                                         <constraint firstAttribute="height" constant="21" id="HNv-3O-JLQ"/>
                                                         <constraint firstAttribute="width" constant="100" id="PYZ-AV-JeJ"/>
@@ -175,7 +175,7 @@
                                                     </connections>
                                                 </button>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="B6b-5O-Ywt">
-                                                    <rect key="frame" x="15" y="161" width="738" height="21"/>
+                                                    <rect key="frame" x="15" y="161" width="994" height="21"/>
                                                     <constraints>
                                                         <constraint firstAttribute="height" constant="21" id="cMA-Jt-cjX"/>
                                                     </constraints>
@@ -184,7 +184,7 @@
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="tCx-RZ-0dk">
-                                                    <rect key="frame" x="653" y="99.5" width="100" height="30"/>
+                                                    <rect key="frame" x="909" y="99.5" width="100" height="30"/>
                                                     <constraints>
                                                         <constraint firstAttribute="height" constant="30" id="SJt-TD-mdf"/>
                                                         <constraint firstAttribute="width" constant="100" id="i5d-HF-i0X"/>
@@ -247,14 +247,14 @@
                                         </connections>
                                     </tableViewCell>
                                     <tableViewCell contentMode="scaleToFill" restorationIdentifier="OrderDetailPriceCell" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="OrderDetailPriceCell" id="7bD-vr-aXj" customClass="OrderDetailPriceCell">
-                                        <rect key="frame" x="0.0" y="278.5" width="768" height="44"/>
+                                        <rect key="frame" x="0.0" y="278.5" width="1024" height="44"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="7bD-vr-aXj" id="3fR-xo-Duc">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="44"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="1024" height="44"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="$123456789.00" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="DMR-2D-GN0" userLabel="price">
-                                                    <rect key="frame" x="534" y="11.5" width="191" height="21"/>
+                                                    <rect key="frame" x="790" y="11.5" width="191" height="21"/>
                                                     <constraints>
                                                         <constraint firstAttribute="width" constant="191" id="a1U-12-0c9"/>
                                                         <constraint firstAttribute="height" constant="21" id="yuv-Nz-4GL"/>
@@ -264,7 +264,7 @@
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="name" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="k0G-s0-PuV" userLabel="charge type">
-                                                    <rect key="frame" x="281" y="11.5" width="246" height="21"/>
+                                                    <rect key="frame" x="537" y="11.5" width="246" height="21"/>
                                                     <constraints>
                                                         <constraint firstAttribute="height" constant="21" id="6Wc-CD-Lj5"/>
                                                         <constraint firstAttribute="width" constant="246" id="o7a-OM-TFC"/>
@@ -287,14 +287,14 @@
                                         </connections>
                                     </tableViewCell>
                                     <tableViewCell contentMode="scaleToFill" restorationIdentifier="OrderDetailHtmlCell" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="OrderDetailHtmlCell" rowHeight="44" id="7Vz-DF-k8E" customClass="OrderDetailHtmlCell">
-                                        <rect key="frame" x="0.0" y="322.5" width="768" height="44"/>
+                                        <rect key="frame" x="0.0" y="322.5" width="1024" height="44"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="7Vz-DF-k8E" id="jPD-gn-rpJ">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="44"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="1024" height="44"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <wkWebView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="J8C-fZ-Luz">
-                                                    <rect key="frame" x="0.0" y="0.0" width="768" height="44"/>
+                                                    <rect key="frame" x="0.0" y="0.0" width="1024" height="44"/>
                                                     <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                                     <wkWebViewConfiguration key="configuration" allowsAirPlayForMediaPlayback="NO" allowsPictureInPictureMediaPlayback="NO">
                                                         <audiovisualMediaTypes key="mediaTypesRequiringUserActionForPlayback" none="YES"/>
@@ -314,14 +314,14 @@
                                         </connections>
                                     </tableViewCell>
                                     <tableViewCell contentMode="scaleToFill" restorationIdentifier="OrderDetailSignatureCell" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="OrderDetailSignatureCell" rowHeight="148" id="a2N-8P-mNM" customClass="OrderDetailSignatureCell">
-                                        <rect key="frame" x="0.0" y="366.5" width="768" height="148"/>
+                                        <rect key="frame" x="0.0" y="366.5" width="1024" height="148"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="a2N-8P-mNM" id="Puc-DI-9DR">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="148"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="1024" height="148"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Bi1-oa-UQV">
-                                                    <rect key="frame" x="180" y="10" width="573" height="128"/>
+                                                    <rect key="frame" x="180" y="10" width="829" height="128"/>
                                                 </imageView>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Signature" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7Of-as-Twc">
                                                     <rect key="frame" x="15" y="63.5" width="143" height="21"/>
@@ -347,10 +347,10 @@
                                         </connections>
                                     </tableViewCell>
                                     <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="OrderDetailPickInfoCell" rowHeight="218" id="oDs-9g-3Lq" customClass="OrderDetailPickInfoCell">
-                                        <rect key="frame" x="0.0" y="514.5" width="768" height="218"/>
+                                        <rect key="frame" x="0.0" y="514.5" width="1024" height="218"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="oDs-9g-3Lq" translatesAutoresizingMaskIntoConstraints="NO" id="0gN-bu-MIM">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="218"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="1024" height="218"/>
                                             <subviews>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Tracking Number:" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="OXJ-pQ-zyu">
                                                     <rect key="frame" x="15" y="8" width="136.5" height="44"/>
@@ -363,7 +363,7 @@
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Booked" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1Zn-Ni-zrl">
-                                                    <rect key="frame" x="73" y="60" width="680" height="44"/>
+                                                    <rect key="frame" x="73" y="60" width="936" height="44"/>
                                                     <constraints>
                                                         <constraint firstAttribute="height" constant="44" id="Nq6-NO-D9H"/>
                                                     </constraints>
@@ -372,7 +372,7 @@
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="ABC123456" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Fsr-eu-3ca">
-                                                    <rect key="frame" x="155.5" y="8" width="597.5" height="44"/>
+                                                    <rect key="frame" x="155.5" y="8" width="853.5" height="44"/>
                                                     <constraints>
                                                         <constraint firstAttribute="height" constant="44" id="xkM-Fe-vDd"/>
                                                     </constraints>
@@ -391,7 +391,7 @@
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Carrier" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="e7r-9k-rZ7">
-                                                    <rect key="frame" x="142.5" y="112" width="610.5" height="44"/>
+                                                    <rect key="frame" x="142.5" y="112" width="866.5" height="44"/>
                                                     <constraints>
                                                         <constraint firstAttribute="height" constant="44" id="7GX-Xa-b77"/>
                                                     </constraints>
@@ -420,7 +420,7 @@
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" bounces="NO" scrollEnabled="NO" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" bouncesZoom="NO" editable="NO" text="URL" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="Swi-Wi-Cq6">
-                                                    <rect key="frame" x="161" y="164" width="592" height="44"/>
+                                                    <rect key="frame" x="161" y="164" width="848" height="44"/>
                                                     <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                                                     <constraints>
                                                         <constraint firstAttribute="height" constant="44" id="ObN-EI-5l5"/>
@@ -473,11 +473,11 @@
                                 </connections>
                             </tableView>
                             <activityIndicatorView opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" hidesWhenStopped="YES" animating="YES" style="whiteLarge" translatesAutoresizingMaskIntoConstraints="NO" id="i1C-Y1-S7o">
-                                <rect key="frame" x="365.5" y="493.5" width="37" height="37"/>
+                                <rect key="frame" x="493.5" y="365.5" width="37" height="37"/>
                                 <color key="color" red="0.59999999999999998" green="0.40000000000000002" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                             </activityIndicatorView>
                             <label hidden="YES" opaque="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Cannot get data from server.
Tap to try again." textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9SM-7Q-zs1">
-                                <rect key="frame" x="263.5" y="489.5" width="241.5" height="45.5"/>
+                                <rect key="frame" x="391.5" y="361.5" width="241.5" height="45.5"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="19"/>
                                 <color key="textColor" red="0.33333333329999998" green="0.33333333329999998" blue="0.33333333329999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <nil key="highlightedColor"/>
@@ -512,11 +512,11 @@
             <objects>
                 <viewController storyboardIdentifier="OrderListViewController" title="Order History" useStoryboardIdentifierAsRestorationIdentifier="YES" id="Q3R-QB-OJA" userLabel="OrderListViewController" customClass="OrderListViewController" sceneMemberID="viewController">
                     <view key="view" contentMode="scaleToFill" id="Q2c-bd-Qtd">
-                        <rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
+                        <rect key="frame" x="0.0" y="0.0" width="1024" height="768"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
                             <toolbar opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="MSe-Rl-r7w">
-                                <rect key="frame" x="0.0" y="20" width="768" height="50"/>
+                                <rect key="frame" x="0.0" y="20" width="1024" height="50"/>
                                 <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <items>
                                     <barButtonItem title="Select Order Status" id="Wkf-BC-Ol7">
@@ -528,7 +528,7 @@
                                     <barButtonItem style="plain" systemItem="flexibleSpace" id="kVI-mI-APr"/>
                                     <barButtonItem style="plain" id="dBx-tt-ebQ">
                                         <searchBar key="customView" contentMode="redraw" searchBarStyle="minimal" placeholder="Sale order number, sales rep, create by, contact" id="bEb-Vy-SpG">
-                                            <rect key="frame" x="217" y="3" width="364" height="44"/>
+                                            <rect key="frame" x="302" y="3" width="364" height="44"/>
                                             <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
                                             <textInputTraits key="textInputTraits"/>
                                             <connections>
@@ -554,14 +554,14 @@
                                 <color key="barTintColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                             </toolbar>
                             <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="E4J-T4-LdO">
-                                <rect key="frame" x="0.0" y="121.5" width="768" height="902.5"/>
+                                <rect key="frame" x="0.0" y="121.5" width="1024" height="646.5"/>
                                 <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <prototypes>
                                     <tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="OrderListTableViewCell" rowHeight="66" id="WVB-xn-Efd" customClass="OrderListTableViewCell">
-                                        <rect key="frame" x="0.0" y="44.5" width="768" height="66"/>
+                                        <rect key="frame" x="0.0" y="44.5" width="1024" height="66"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="WVB-xn-Efd" translatesAutoresizingMaskIntoConstraints="NO" id="LkX-13-tk6">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="66"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="1024" height="66"/>
                                             <subviews>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="WEB1509140024" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="XDq-A7-Nls" userLabel="So#">
                                                     <rect key="frame" x="15" y="37" width="135" height="21"/>
@@ -574,7 +574,7 @@
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="123456789.00" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dWI-HF-943" userLabel="price">
-                                                    <rect key="frame" x="492" y="37" width="102" height="21"/>
+                                                    <rect key="frame" x="748" y="37" width="102" height="21"/>
                                                     <constraints>
                                                         <constraint firstAttribute="height" constant="21" id="CMN-KB-NrM"/>
                                                     </constraints>
@@ -582,7 +582,7 @@
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="02/02/2015 10:10:10" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Nvm-mp-Jwp" userLabel="date">
-                                                    <rect key="frame" x="604" y="37" width="149" height="21"/>
+                                                    <rect key="frame" x="860" y="37" width="149" height="21"/>
                                                     <constraints>
                                                         <constraint firstAttribute="height" constant="21" id="PJf-yc-w9P"/>
                                                         <constraint firstAttribute="width" constant="149" id="tBy-ZF-zOY"/>
@@ -602,13 +602,13 @@
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="contact" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="iJQ-Uf-kLq">
-                                                    <rect key="frame" x="298" y="8" width="184" height="50"/>
+                                                    <rect key="frame" x="298" y="8" width="440" height="50"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="15"/>
                                                     <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="999999" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pRq-QX-KFd">
-                                                    <rect key="frame" x="492" y="5" width="102" height="18"/>
+                                                    <rect key="frame" x="748" y="5" width="102" height="18"/>
                                                     <constraints>
                                                         <constraint firstAttribute="height" constant="18" id="Azd-RS-vE9"/>
                                                         <constraint firstAttribute="width" constant="102" id="rDJ-xt-euO"/>
@@ -638,7 +638,7 @@
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="MOBPO" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="j8x-nv-a5Z">
-                                                    <rect key="frame" x="604" y="12" width="55" height="21"/>
+                                                    <rect key="frame" x="860" y="12" width="55" height="21"/>
                                                     <constraints>
                                                         <constraint firstAttribute="height" constant="21" id="gsd-MJ-zvV"/>
                                                     </constraints>
@@ -696,11 +696,11 @@
                                 </connections>
                             </tableView>
                             <activityIndicatorView opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" hidesWhenStopped="YES" animating="YES" style="whiteLarge" translatesAutoresizingMaskIntoConstraints="NO" id="c7L-F4-nRJ">
-                                <rect key="frame" x="365.5" y="493.5" width="37" height="37"/>
+                                <rect key="frame" x="493.5" y="365.5" width="37" height="37"/>
                                 <color key="color" red="0.59999999999999998" green="0.40000000000000002" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                             </activityIndicatorView>
                             <label hidden="YES" opaque="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Cannot get data from server.
Tap to try again." textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="026-gJ-EDh">
-                                <rect key="frame" x="263.5" y="489.5" width="241.5" height="45.5"/>
+                                <rect key="frame" x="391.5" y="361.5" width="241.5" height="45.5"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="19"/>
                                 <color key="textColor" red="0.33333333329999998" green="0.33333333329999998" blue="0.33333333329999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <nil key="highlightedColor"/>
@@ -716,7 +716,7 @@
                                 <nil key="highlightedColor"/>
                             </label>
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xKm-bM-vOg">
-                                <rect key="frame" x="153" y="69.5" width="595" height="21"/>
+                                <rect key="frame" x="153" y="69.5" width="851" height="21"/>
                                 <constraints>
                                     <constraint firstAttribute="height" constant="21" id="Bp8-eN-GHB"/>
                                 </constraints>
@@ -725,7 +725,7 @@
                                 <nil key="highlightedColor"/>
                             </label>
                             <segmentedControl opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" selectedSegmentIndex="0" translatesAutoresizingMaskIntoConstraints="NO" id="ohH-1K-QsE">
-                                <rect key="frame" x="0.0" y="90.5" width="768" height="32"/>
+                                <rect key="frame" x="0.0" y="90.5" width="1024" height="32"/>
                                 <segments>
                                     <segment title="Store Order"/>
                                     <segment title="Purchase Order to NPD"/>
@@ -790,15 +790,15 @@
             <objects>
                 <viewController storyboardIdentifier="RAOrderEditorViewController" title="RAOrderEditorViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="8cx-d2-dwe" customClass="RAOrderEditorViewController" sceneMemberID="viewController">
                     <view key="view" contentMode="scaleToFill" id="EbR-wm-qmV">
-                        <rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
+                        <rect key="frame" x="0.0" y="0.0" width="1024" height="768"/>
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                         <subviews>
                             <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Bfq-vH-yU5" customClass="CommonEditorTableContainerView">
-                                <rect key="frame" x="0.0" y="20" width="768" height="960"/>
+                                <rect key="frame" x="0.0" y="20" width="1024" height="704"/>
                                 <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                             </view>
                             <toolbar opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="MGc-zD-JUk">
-                                <rect key="frame" x="0.0" y="980" width="768" height="44"/>
+                                <rect key="frame" x="0.0" y="724" width="1024" height="44"/>
                                 <constraints>
                                     <constraint firstAttribute="height" constant="44" id="Vyr-xx-lp4"/>
                                 </constraints>
@@ -848,35 +848,22 @@
             <objects>
                 <viewController storyboardIdentifier="ScanOrderListViewController" title="Order History" useStoryboardIdentifierAsRestorationIdentifier="YES" id="LNa-Wq-bWf" userLabel="ScanOrderListViewController" customClass="ScanOrderListViewController" sceneMemberID="viewController">
                     <view key="view" contentMode="scaleToFill" id="G1e-qe-u3C">
-                        <rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
+                        <rect key="frame" x="0.0" y="0.0" width="1024" height="768"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
-                            <toolbar opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="oZx-AD-gXG">
-                                <rect key="frame" x="0.0" y="20" width="768" height="50"/>
-                                <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                                <items>
-                                    <barButtonItem style="plain" systemItem="flexibleSpace" id="w4w-O7-Tmb"/>
-                                    <barButtonItem title="New Order" id="rgW-na-gao">
-                                        <connections>
-                                            <action selector="onNewOrderClicked:" destination="LNa-Wq-bWf" id="0pQ-8a-WRM"/>
-                                        </connections>
-                                    </barButtonItem>
-                                </items>
-                                <color key="barTintColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                            </toolbar>
                             <tableView hidden="YES" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="xxx-Rl-Yvi">
-                                <rect key="frame" x="0.0" y="101" width="768" height="923"/>
+                                <rect key="frame" x="0.0" y="51" width="1024" height="717"/>
                                 <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <prototypes>
                                     <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="UploadCell" rowHeight="100" id="Bww-5l-BiC" customClass="UploadCell">
-                                        <rect key="frame" x="0.0" y="44.5" width="768" height="100"/>
+                                        <rect key="frame" x="0.0" y="44.5" width="1024" height="100"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Bww-5l-BiC" id="1P1-CU-Qyh">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="100"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="1024" height="100"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="QS8884456999666666" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cwY-qp-nb8">
-                                                    <rect key="frame" x="10" y="5" width="748" height="20"/>
+                                                    <rect key="frame" x="10" y="5" width="1004" height="20"/>
                                                     <constraints>
                                                         <constraint firstAttribute="height" constant="20" id="VDg-gC-3k1"/>
                                                     </constraints>
@@ -885,13 +872,13 @@
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <progressView opaque="NO" contentMode="scaleToFill" verticalHuggingPriority="750" progress="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="vHH-Yd-1OW">
-                                                    <rect key="frame" x="10" y="35" width="748" height="5"/>
+                                                    <rect key="frame" x="10" y="35" width="1004" height="5"/>
                                                     <constraints>
                                                         <constraint firstAttribute="height" constant="5" id="2HV-In-7mn"/>
                                                     </constraints>
                                                 </progressView>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="99.9%" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bfp-K3-xcV">
-                                                    <rect key="frame" x="708" y="45" width="50" height="21"/>
+                                                    <rect key="frame" x="964" y="45" width="50" height="21"/>
                                                     <constraints>
                                                         <constraint firstAttribute="width" constant="50" id="O6Y-Kw-Ti2"/>
                                                         <constraint firstAttribute="height" constant="21" id="Xid-WA-kwm"/>
@@ -901,13 +888,13 @@
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Waiting" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="quC-0r-nse">
-                                                    <rect key="frame" x="10" y="45" width="688" height="21"/>
+                                                    <rect key="frame" x="10" y="45" width="944" height="21"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                                     <nil key="textColor"/>
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Error:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="h9l-Ql-1of">
-                                                    <rect key="frame" x="10" y="71" width="748" height="17"/>
+                                                    <rect key="frame" x="10" y="71" width="1004" height="17"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                                     <nil key="textColor"/>
                                                     <nil key="highlightedColor"/>
@@ -945,19 +932,125 @@
                                     <outlet property="delegate" destination="LNa-Wq-bWf" id="6CH-jc-j9I"/>
                                 </connections>
                             </tableView>
+                            <tableView hidden="YES" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="tla-Jv-Qec" userLabel="table submit">
+                                <rect key="frame" x="0.0" y="51" width="1024" height="717"/>
+                                <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                <prototypes>
+                                    <tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="OrderListTableViewCell" rowHeight="66" id="Pwl-ez-L6T" customClass="OrderListTableViewCell">
+                                        <rect key="frame" x="0.0" y="44.5" width="1024" height="66"/>
+                                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                        <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Pwl-ez-L6T" id="tFl-dI-DEO">
+                                            <rect key="frame" x="0.0" y="0.0" width="1024" height="66"/>
+                                            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                            <subviews>
+                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="123456789.00" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SHO-7T-8T9" userLabel="price">
+                                                    <rect key="frame" x="748" y="37" width="102" height="21"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="height" constant="21" id="rYK-7L-ggS"/>
+                                                    </constraints>
+                                                    <fontDescription key="fontDescription" type="system" pointSize="15"/>
+                                                    <nil key="highlightedColor"/>
+                                                </label>
+                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="02/02/2015 10:10:10" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="atL-Ys-aJA" userLabel="date">
+                                                    <rect key="frame" x="860" y="37" width="149" height="21"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="height" constant="21" id="G5r-8h-f9p"/>
+                                                        <constraint firstAttribute="width" constant="149" id="qkn-nj-0mi"/>
+                                                    </constraints>
+                                                    <fontDescription key="fontDescription" type="system" pointSize="15"/>
+                                                    <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                                    <nil key="highlightedColor"/>
+                                                </label>
+                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="commit" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="83T-G6-GvV" userLabel="status">
+                                                    <rect key="frame" x="15" y="12" width="135" height="42"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="width" constant="135" id="aWR-92-DaV"/>
+                                                        <constraint firstAttribute="height" constant="21" id="wBy-uR-dfw"/>
+                                                    </constraints>
+                                                    <fontDescription key="fontDescription" type="system" pointSize="15"/>
+                                                    <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                                    <nil key="highlightedColor"/>
+                                                </label>
+                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="contact" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dyY-tU-pby">
+                                                    <rect key="frame" x="310" y="8" width="428" height="50"/>
+                                                    <fontDescription key="fontDescription" type="system" pointSize="15"/>
+                                                    <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                                    <nil key="highlightedColor"/>
+                                                </label>
+                                                <label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="999999" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="VAs-ve-xJN">
+                                                    <rect key="frame" x="748" y="5" width="102" height="18"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="width" constant="102" id="7lj-rQ-8hy"/>
+                                                        <constraint firstAttribute="height" constant="18" id="Gyu-Wx-23o"/>
+                                                    </constraints>
+                                                    <fontDescription key="fontDescription" type="system" pointSize="15"/>
+                                                    <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                                    <nil key="highlightedColor"/>
+                                                </label>
+                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="create by" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="U4c-ol-otv" userLabel="creator">
+                                                    <rect key="frame" x="165" y="22.5" width="125" height="21"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="height" constant="21" id="BJM-lC-93z"/>
+                                                        <constraint firstAttribute="width" constant="125" id="CWP-9r-tAY"/>
+                                                    </constraints>
+                                                    <fontDescription key="fontDescription" type="system" pointSize="15"/>
+                                                    <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                                    <nil key="highlightedColor"/>
+                                                </label>
+                                            </subviews>
+                                            <constraints>
+                                                <constraint firstItem="VAs-ve-xJN" firstAttribute="top" secondItem="tFl-dI-DEO" secondAttribute="top" constant="5" id="269-QF-AWG"/>
+                                                <constraint firstItem="83T-G6-GvV" firstAttribute="leading" secondItem="tFl-dI-DEO" secondAttribute="leading" constant="15" id="2qN-9T-R66"/>
+                                                <constraint firstItem="SHO-7T-8T9" firstAttribute="leading" secondItem="dyY-tU-pby" secondAttribute="trailing" constant="10" id="4mP-ir-dea"/>
+                                                <constraint firstItem="U4c-ol-otv" firstAttribute="centerY" secondItem="tFl-dI-DEO" secondAttribute="centerY" id="73G-r8-YSa"/>
+                                                <constraint firstItem="dyY-tU-pby" firstAttribute="top" secondItem="tFl-dI-DEO" secondAttribute="top" constant="8" id="82v-pf-UFH"/>
+                                                <constraint firstItem="dyY-tU-pby" firstAttribute="leading" secondItem="U4c-ol-otv" secondAttribute="trailing" constant="20" id="Afb-V6-hE4"/>
+                                                <constraint firstItem="U4c-ol-otv" firstAttribute="leading" secondItem="83T-G6-GvV" secondAttribute="trailing" constant="15" id="H4X-aV-12w"/>
+                                                <constraint firstItem="atL-Ys-aJA" firstAttribute="baseline" secondItem="dyY-tU-pby" secondAttribute="baseline" id="Nmu-on-9dO"/>
+                                                <constraint firstItem="83T-G6-GvV" firstAttribute="centerY" secondItem="tFl-dI-DEO" secondAttribute="centerY" id="R57-ae-r5o"/>
+                                                <constraint firstAttribute="trailing" secondItem="atL-Ys-aJA" secondAttribute="trailing" constant="15" id="UdM-2X-nEx"/>
+                                                <constraint firstAttribute="bottom" secondItem="dyY-tU-pby" secondAttribute="bottom" constant="8" id="VHr-i5-pVP"/>
+                                                <constraint firstItem="83T-G6-GvV" firstAttribute="top" secondItem="tFl-dI-DEO" secondAttribute="top" constant="12" id="hzC-Os-TKp"/>
+                                                <constraint firstItem="atL-Ys-aJA" firstAttribute="leading" secondItem="SHO-7T-8T9" secondAttribute="trailing" constant="10" id="ler-wc-5sQ"/>
+                                                <constraint firstItem="VAs-ve-xJN" firstAttribute="centerX" secondItem="SHO-7T-8T9" secondAttribute="centerX" id="mot-y8-P7i"/>
+                                                <constraint firstItem="VAs-ve-xJN" firstAttribute="trailing" secondItem="SHO-7T-8T9" secondAttribute="trailing" id="nmj-hl-tlB"/>
+                                                <constraint firstItem="atL-Ys-aJA" firstAttribute="baseline" secondItem="SHO-7T-8T9" secondAttribute="baseline" id="wc6-WN-rdS"/>
+                                            </constraints>
+                                        </tableViewCellContentView>
+                                        <constraints>
+                                            <constraint firstItem="tFl-dI-DEO" firstAttribute="leading" secondItem="Pwl-ez-L6T" secondAttribute="leading" id="8xY-wD-MiE"/>
+                                            <constraint firstItem="tFl-dI-DEO" firstAttribute="top" secondItem="Pwl-ez-L6T" secondAttribute="top" id="DMu-gE-Gm0"/>
+                                            <constraint firstAttribute="bottom" secondItem="tFl-dI-DEO" secondAttribute="bottom" id="KQH-bY-wb3"/>
+                                            <constraint firstAttribute="trailing" secondItem="tFl-dI-DEO" secondAttribute="trailing" id="cgH-kb-PWd"/>
+                                        </constraints>
+                                        <connections>
+                                            <outlet property="label_contact" destination="dyY-tU-pby" id="hXW-BP-pe2"/>
+                                            <outlet property="label_creator" destination="U4c-ol-otv" id="VBS-Kg-MRR"/>
+                                            <outlet property="label_date" destination="atL-Ys-aJA" id="bea-Lw-wER"/>
+                                            <outlet property="label_model" destination="VAs-ve-xJN" id="cqg-y3-UCH"/>
+                                            <outlet property="label_status" destination="83T-G6-GvV" id="dDQ-JT-6mF"/>
+                                            <outlet property="labelprice" destination="SHO-7T-8T9" id="v7k-eL-BMh"/>
+                                        </connections>
+                                    </tableViewCell>
+                                </prototypes>
+                                <connections>
+                                    <outlet property="dataSource" destination="LNa-Wq-bWf" id="oXt-h9-rzV"/>
+                                    <outlet property="delegate" destination="LNa-Wq-bWf" id="YsK-ri-grY"/>
+                                </connections>
+                            </tableView>
                             <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="okE-6e-1XS">
-                                <rect key="frame" x="0.0" y="101" width="768" height="923"/>
+                                <rect key="frame" x="0.0" y="51" width="1024" height="717"/>
                                 <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <prototypes>
                                     <tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="OrderListTableViewCell" rowHeight="66" id="X1d-0l-bjq" customClass="OrderListTableViewCell">
-                                        <rect key="frame" x="0.0" y="44.5" width="768" height="66"/>
+                                        <rect key="frame" x="0.0" y="44.5" width="1024" height="66"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="X1d-0l-bjq" id="3SE-8W-1Ko">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="66"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="1024" height="66"/>
                                             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                             <subviews>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="123456789.00" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="IcS-uQ-aJ9" userLabel="price">
-                                                    <rect key="frame" x="492" y="37" width="102" height="21"/>
+                                                    <rect key="frame" x="748" y="37" width="102" height="21"/>
                                                     <constraints>
                                                         <constraint firstAttribute="height" constant="21" id="RzM-6p-uL1"/>
                                                     </constraints>
@@ -965,7 +1058,7 @@
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="02/02/2015 10:10:10" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yU1-tY-7yp" userLabel="date">
-                                                    <rect key="frame" x="604" y="37" width="149" height="21"/>
+                                                    <rect key="frame" x="860" y="37" width="149" height="21"/>
                                                     <constraints>
                                                         <constraint firstAttribute="height" constant="21" id="GM9-00-Tz4"/>
                                                         <constraint firstAttribute="width" constant="149" id="mee-Mg-lf4"/>
@@ -985,13 +1078,13 @@
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="contact" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kx8-Rf-daE">
-                                                    <rect key="frame" x="310" y="8" width="172" height="50"/>
+                                                    <rect key="frame" x="310" y="8" width="428" height="50"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="15"/>
                                                     <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="999999" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="i3l-Nh-iIk">
-                                                    <rect key="frame" x="492" y="5" width="102" height="18"/>
+                                                    <rect key="frame" x="748" y="5" width="102" height="18"/>
                                                     <constraints>
                                                         <constraint firstAttribute="height" constant="18" id="cZ2-9h-eCQ"/>
                                                         <constraint firstAttribute="width" constant="102" id="fae-eM-tUr"/>
@@ -1052,41 +1145,74 @@
                                 </connections>
                             </tableView>
                             <label hidden="YES" opaque="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Cannot get data from server.
Tap to try again." textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UGJ-LO-fre">
-                                <rect key="frame" x="263.5" y="489.5" width="241.5" height="45.5"/>
+                                <rect key="frame" x="391.5" y="361.5" width="241.5" height="45.5"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="19"/>
                                 <color key="textColor" red="0.33333333329999998" green="0.33333333329999998" blue="0.33333333329999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <nil key="highlightedColor"/>
                             </label>
                             <segmentedControl opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" selectedSegmentIndex="0" translatesAutoresizingMaskIntoConstraints="NO" id="ni4-Ku-8zb">
-                                <rect key="frame" x="0.0" y="70" width="768" height="32"/>
+                                <rect key="frame" x="0.0" y="20" width="1024" height="32"/>
                                 <segments>
-                                    <segment title="Order List"/>
-                                    <segment title="Upload List"/>
+                                    <segment title="Unsubmitted"/>
+                                    <segment title="Submitted"/>
+                                    <segment title="Create Order"/>
                                 </segments>
                                 <connections>
                                     <action selector="onSegmentChanged:" destination="LNa-Wq-bWf" eventType="valueChanged" id="4UH-f2-Obg"/>
                                 </connections>
                             </segmentedControl>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="jjJ-Ft-a70">
+                                <rect key="frame" x="682.5" y="20" width="341.5" height="31"/>
+                                <state key="normal" title="Button"/>
+                                <buttonConfiguration key="configuration" style="plain" title=" "/>
+                                <connections>
+                                    <action selector="onNewOrderClicked:" destination="LNa-Wq-bWf" eventType="touchUpInside" id="Bcx-MV-yGr"/>
+                                </connections>
+                            </button>
+                            <button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="eVO-Vb-aKi">
+                                <rect key="frame" x="341.5" y="30.5" width="341" height="31"/>
+                                <color key="backgroundColor" red="0.95287781953811646" green="0.61227613687515259" blue="0.62031883001327515" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                <state key="normal" title="Button"/>
+                                <buttonConfiguration key="configuration" style="plain" title="Button"/>
+                            </button>
+                            <button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="c2D-UH-6Ax">
+                                <rect key="frame" x="0.0" y="20" width="341.5" height="31"/>
+                                <color key="backgroundColor" red="0.95287781953811646" green="0.61227613687515259" blue="0.62031883001327515" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                <state key="normal" title="Button"/>
+                                <buttonConfiguration key="configuration" style="plain"/>
+                            </button>
                         </subviews>
                         <viewLayoutGuide key="safeArea" id="87c-G3-bR6"/>
                         <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <constraints>
+                            <constraint firstItem="87c-G3-bR6" firstAttribute="bottom" secondItem="tla-Jv-Qec" secondAttribute="bottom" id="0ke-Nq-zmT"/>
                             <constraint firstItem="UGJ-LO-fre" firstAttribute="centerY" secondItem="G1e-qe-u3C" secondAttribute="centerY" id="1hN-9J-IhR"/>
-                            <constraint firstItem="ni4-Ku-8zb" firstAttribute="top" secondItem="oZx-AD-gXG" secondAttribute="bottom" id="9hi-XT-OCv"/>
+                            <constraint firstItem="jjJ-Ft-a70" firstAttribute="width" secondItem="c2D-UH-6Ax" secondAttribute="width" id="31y-rD-AoM"/>
                             <constraint firstItem="ni4-Ku-8zb" firstAttribute="trailing" secondItem="87c-G3-bR6" secondAttribute="trailing" id="BCq-ef-bKa"/>
                             <constraint firstItem="xxx-Rl-Yvi" firstAttribute="top" secondItem="ni4-Ku-8zb" secondAttribute="bottom" id="Br7-BM-zYP"/>
                             <constraint firstItem="okE-6e-1XS" firstAttribute="trailing" secondItem="87c-G3-bR6" secondAttribute="trailing" id="CYw-dN-lKm"/>
                             <constraint firstItem="UGJ-LO-fre" firstAttribute="centerX" secondItem="87c-G3-bR6" secondAttribute="centerX" id="DgH-Cz-nMY"/>
+                            <constraint firstItem="eVO-Vb-aKi" firstAttribute="leading" secondItem="c2D-UH-6Ax" secondAttribute="trailing" id="I1k-kv-Ngg"/>
+                            <constraint firstItem="xxx-Rl-Yvi" firstAttribute="top" secondItem="c2D-UH-6Ax" secondAttribute="bottom" id="IZY-t5-8hK"/>
+                            <constraint firstItem="tla-Jv-Qec" firstAttribute="leading" secondItem="87c-G3-bR6" secondAttribute="leading" id="JiE-5j-ta9"/>
+                            <constraint firstItem="c2D-UH-6Ax" firstAttribute="top" secondItem="87c-G3-bR6" secondAttribute="top" id="JyN-w9-lSO"/>
                             <constraint firstItem="xxx-Rl-Yvi" firstAttribute="leading" secondItem="87c-G3-bR6" secondAttribute="leading" id="RtC-y6-XAw"/>
-                            <constraint firstItem="oZx-AD-gXG" firstAttribute="trailing" secondItem="87c-G3-bR6" secondAttribute="trailing" id="Vq5-YW-sv3"/>
+                            <constraint firstItem="eVO-Vb-aKi" firstAttribute="baseline" secondItem="c2D-UH-6Ax" secondAttribute="baseline" id="TOR-ln-oat"/>
+                            <constraint firstItem="ni4-Ku-8zb" firstAttribute="top" secondItem="87c-G3-bR6" secondAttribute="top" id="TR7-ff-xNk"/>
+                            <constraint firstItem="c2D-UH-6Ax" firstAttribute="leading" secondItem="87c-G3-bR6" secondAttribute="leading" id="Vbc-Da-dPp"/>
                             <constraint firstItem="87c-G3-bR6" firstAttribute="bottom" secondItem="okE-6e-1XS" secondAttribute="bottom" id="VrZ-UR-j9V"/>
-                            <constraint firstItem="oZx-AD-gXG" firstAttribute="leading" secondItem="87c-G3-bR6" secondAttribute="leading" id="XrA-am-r8P"/>
                             <constraint firstItem="ni4-Ku-8zb" firstAttribute="leading" secondItem="87c-G3-bR6" secondAttribute="leading" id="cVY-4b-je4"/>
-                            <constraint firstItem="oZx-AD-gXG" firstAttribute="top" secondItem="87c-G3-bR6" secondAttribute="top" id="dZs-hK-Y2k"/>
+                            <constraint firstItem="tla-Jv-Qec" firstAttribute="trailing" secondItem="87c-G3-bR6" secondAttribute="trailing" id="dCl-sR-DZG"/>
                             <constraint firstItem="xxx-Rl-Yvi" firstAttribute="trailing" secondItem="87c-G3-bR6" secondAttribute="trailing" id="fEq-Te-TL2"/>
+                            <constraint firstItem="tla-Jv-Qec" firstAttribute="top" secondItem="ni4-Ku-8zb" secondAttribute="bottom" id="hHO-QF-Ygg"/>
+                            <constraint firstItem="jjJ-Ft-a70" firstAttribute="leading" secondItem="eVO-Vb-aKi" secondAttribute="trailing" id="koA-3M-pRh"/>
+                            <constraint firstItem="jjJ-Ft-a70" firstAttribute="trailing" secondItem="87c-G3-bR6" secondAttribute="trailing" id="kt9-Kv-IUW"/>
                             <constraint firstItem="okE-6e-1XS" firstAttribute="top" secondItem="ni4-Ku-8zb" secondAttribute="bottom" id="n8D-H8-YNt"/>
+                            <constraint firstItem="jjJ-Ft-a70" firstAttribute="top" secondItem="87c-G3-bR6" secondAttribute="top" id="pbH-ms-2tK"/>
+                            <constraint firstItem="xxx-Rl-Yvi" firstAttribute="top" secondItem="jjJ-Ft-a70" secondAttribute="bottom" id="r0w-ry-MdB"/>
                             <constraint firstItem="87c-G3-bR6" firstAttribute="bottom" secondItem="xxx-Rl-Yvi" secondAttribute="bottom" id="uZr-Eg-xf0"/>
                             <constraint firstItem="okE-6e-1XS" firstAttribute="leading" secondItem="87c-G3-bR6" secondAttribute="leading" id="vFE-Su-x3Y"/>
+                            <constraint firstItem="eVO-Vb-aKi" firstAttribute="width" secondItem="c2D-UH-6Ax" secondAttribute="width" id="xY4-89-Kex"/>
                         </constraints>
                         <inset key="insetFor6xAndEarlier" minX="0.0" minY="20" maxX="0.0" maxY="-20"/>
                     </view>
@@ -1102,13 +1228,13 @@
                         <outlet property="orderTypeSegmentControl" destination="ni4-Ku-8zb" id="AIo-vd-42F"/>
                         <outlet property="tableTopConstraint" destination="n8D-H8-YNt" id="B2u-cz-hZ6"/>
                         <outlet property="table_order" destination="okE-6e-1XS" id="ilq-MS-I4G"/>
+                        <outlet property="table_submit" destination="tla-Jv-Qec" id="Ur6-pd-JTV"/>
                         <outlet property="table_upload" destination="xxx-Rl-Yvi" id="YQk-5r-i5l"/>
-                        <outlet property="toolbarView" destination="oZx-AD-gXG" id="CeH-Jo-8Ko"/>
                     </connections>
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="HND-Qs-fSM" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="1083.59375" y="-57.421874999999993"/>
+            <point key="canvasLocation" x="1082.8125" y="-58.007812499999993"/>
         </scene>
     </scenes>
     <resources>

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

@@ -75,7 +75,7 @@
     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
         if(appDelegate.user.length<=0)
         {
-            [RAUtils message_alert:@"Please select a sales first" title:@"Create Offline Order" controller:self];
+            [RAUtils message_alert:@"Please login first" title:@"Create Offline Order" controller:self];
             return;
         }
     

+ 2 - 0
RedAnt ERP Mobile/common/Functions/OLO/ScanOrderListViewController.h

@@ -15,10 +15,12 @@ NS_ASSUME_NONNULL_BEGIN
 
 @interface ScanOrderListViewController : ActiveViewController
 @property (strong, nonatomic) IBOutlet UITableView *table_order;
+@property (weak, nonatomic) IBOutlet UITableView *table_submit;
 
 @property (weak, nonatomic) IBOutlet UITableView *table_upload;
 //@property (strong, nonatomic) IBOutlet UIActivityIndicatorView *mum;
 @property (strong,nonatomic) NSMutableArray * content_data;
+@property (strong,nonatomic) NSMutableArray * submit_content_data;
 @property dispatch_queue_t  loading_queue;
 @property int offset;
 @property int limit;

+ 673 - 249
RedAnt ERP Mobile/common/Functions/OLO/ScanOrderListViewController.m

@@ -74,7 +74,9 @@
     [self.mergeList removeAllObjects];
     self.offset = 0;
     [self.content_data removeAllObjects];
+    [self.submit_content_data removeAllObjects];
     [self.table_order reloadData];
+    [self.table_submit reloadData];
     self.status_cadedate = nil;
 }
 #ifndef RA_NOTIFICATION
@@ -137,6 +139,36 @@
     //    NSLog(@"old: %@", [change objectForKey:NSKeyValueChangeNewKey]);
     //    NSLog(@"context: %@", context);
 }
+- (void)onNewOrder: (NSNotification *)notification
+{
+    [self onNewOrderClicked:nil];
+    
+}
+- (void)onShowList: (NSNotification *)notification
+{
+    
+    if([notification.name isEqualToString:@"ShowUnSubmit"])
+    {
+        [self.orderTypeSegmentControl setSelectedSegmentIndex:0];
+        
+        self.table_order.hidden=true;
+        self.table_upload.hidden = false;
+        [self.table_upload reloadData];
+
+        
+//        onSegmentChanged
+    }
+    else
+    {
+        
+        [self.orderTypeSegmentControl setSelectedSegmentIndex:1];
+        
+        self.table_order.hidden=false;
+        self.table_upload.hidden = true;
+        [self.table_order reloadData];
+    }
+    
+}
 - (void)viewDidLoad {
     [super viewDidLoad];
     self.edgesForExtendedLayout = UIRectEdgeNone;
@@ -156,6 +188,9 @@
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleUserLogin:) name:User_LoginOK_Notification object:nil];
     
     
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onNewOrder:) name:@"NewOrder" object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onShowList:) name:@"ShowSubmit" object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onShowList:) name:@"ShowUnSubmit" object:nil];
     
     
     AppDelegate* appdelegate=(AppDelegate*)[UIApplication sharedApplication].delegate;
@@ -174,6 +209,7 @@
     self.offset = 0;
     self.limit = 25;
     self.content_data = [[NSMutableArray alloc]init];
+    self.submit_content_data = [[NSMutableArray alloc]init];
     // Customer Order Type 0 Shop Order/ 1 Sales Order
     //    self.orderType = self.orderTypeSegmentControl.selectedSegmentIndex;
     [RASingleton sharedInstance].customer_order_type = self.orderType;
@@ -406,7 +442,7 @@
     
     if(appDelegate.user.length==0)
     {
-        [RAUtils message_alert:@"Please select a sales first." title:@"Warring" controller:self];
+        [RAUtils message_alert:@"Please login first." title:@"Warring" controller:self];
         return;
     }
     
@@ -416,10 +452,11 @@
     
     
     
-    appDelegate.user_type = USER_ROLE_EMPLOYEE;
+//    appDelegate.user_type = USER_ROLE_EMPLOYEE;
     appDelegate.can_set_cart_price = true;
     appDelegate.can_see_price = true;
-    
+    RASingleton.sharedInstance.scan_cart = nil;
+    RASingleton.sharedInstance.price_type = 0;
     //    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
     //    NSString *documents = [paths objectAtIndex:0];
     
@@ -467,12 +504,25 @@
         
         
     }
+    
+    
+#ifdef RA_NOTIFICATION
+                        [ActiveViewController Notify:@"CartViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
+                        MainViewController* main_vc=(MainViewController*)appDelegate.main_vc;
+                        [main_vc reloadCart:true immediately:false];
+#endif
+    
     //    MainViewController * mainvc=(MainViewController * )appDelegate.main_vc;
     //    mainvc.btnScan.enabled = true;
     
     //    [appDelegate updateScanButton:true];
     
+//    AppDelegate* appDelegate = (AppDelegate*)UIApplication.sharedApplication.delegate;
+    MainViewController * mainvc = (MainViewController*)appDelegate.main_vc;
     
+//    [ActiveViewController Notify:@"ScanOrderListViewController" Message:@"NewOrder"];
+    [mainvc switchToCart];
     
 }
 - (IBAction)onNewOrderClicked:(id)sender {
@@ -482,7 +532,7 @@
     
     if(appDelegate.user.length<=0)
     {
-        [RAUtils message_alert:@"Please select a sales first." title:@"Warring" controller:self];
+        [RAUtils message_alert:@"Please login first." title:@"Warring" controller:self];
         return;
     }
     
@@ -491,9 +541,13 @@
         //        当前订单先关闭
         //        [OLDataProvider deleteScanOrder:appDelegate.order_code];
         appDelegate.order_code = nil;
-        appDelegate.customerInfo = nil;
+        RASingleton.sharedInstance.scan_temp_code = nil;
+        if(appDelegate.customer_type!=USER_ROLE_CUSTOMER ) //customer 角色不清空customer info
+        {   appDelegate.customerInfo = nil;
+            appDelegate.contact_id = nil;
+        }
         RASingleton.sharedInstance.scan_cart = nil;
-        appDelegate.contact_id = nil;
+        RASingleton.sharedInstance.price_type = 0;
         //        [appDelegate updateScanButton:false];
         
         [appDelegate update_count_mark];
@@ -678,6 +732,7 @@
     NSString *orderlistPath = [userdir stringByAppendingPathComponent:@"orderlist.json"];
     orderlist=[[RAUtils dictfromfile:orderlistPath] mutableCopy];
     [self.content_data removeAllObjects];
+
     int count = [orderlist[@"count"] intValue];
     for(int i=0;i<count;i++)
     {
@@ -688,6 +743,22 @@
     }
     
     
+    
+    NSMutableDictionary* submitlist = nil;
+    NSString *submitlistPath = [userdir stringByAppendingPathComponent:@"submitlist.json"];
+    submitlist=[[RAUtils dictfromfile:submitlistPath] mutableCopy];
+    [self.submit_content_data removeAllObjects];
+
+    int scount = [submitlist[@"count"] intValue];
+    for(int i=0;i<scount;i++)
+    {
+        
+        NSDictionary* objmsg = [submitlist objectForKey:[NSString stringWithFormat:@"item_%d",i]];
+        [self.submit_content_data addObject:[NSMutableDictionary dictionaryWithDictionary:objmsg]];
+        
+    }
+    
+    
     //                    int i =self.btnrefresh.state;
     self.load_more_hint=@"All loaded";
     //                    self.btnrefresh.titleLabel.text =NSLocalizedString(@"no_more", nil);
@@ -697,6 +768,7 @@
     
     dispatch_sync(dispatch_get_main_queue(), ^{
         self.table_order.hidden = false;
+        self.table_submit.hidden = false;
         self.reset_result=false;
         [self.table_order reloadData ];
     });
@@ -1213,7 +1285,7 @@
 #pragma mark - Table view data source
 - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath;
 {
-    if(tableView==self.table_order)
+    if(tableView==self.table_order||tableView==self.table_submit)
         return 66;
     else
         return 100;
@@ -1362,6 +1434,132 @@
         //
         return myView;
     }
+    else
+        if(tableView==self.table_submit)
+        {
+            NSString* value =[DefaultAppearance get_noneappearance_value:@"DefaultTableHeaderView" valuename:@"title_text_color"];
+            
+            if(value==nil)
+                value=@"";
+            unsigned long color = strtoul([value UTF8String],0,16);
+            
+            DefaultTableHeaderView* myView = [[DefaultTableHeaderView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 0.0001)];
+            //  myView.backgroundColor =  UIColorFromRGB(0x996633);
+            myView.layer.shadowPath =[UIBezierPath bezierPathWithRect:myView.bounds].CGPath;
+            myView.layer.shadowColor = [UIColor blackColor].CGColor;
+            myView.layer.shadowOffset = CGSizeMake(0, 0);
+            myView.layer.shadowOpacity = 0.5;
+            myView.layer.shadowRadius = 2.0;
+            
+            
+            UILabel *statuslabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 11, 130, 22)];
+            statuslabel.textColor=UIColorFromRGB(color);
+            statuslabel.backgroundColor = [UIColor clearColor];
+            statuslabel.text=NSLocalizedString(@"Status", nil);
+            [statuslabel sizeToFit];
+            [myView addSubview:statuslabel];
+            
+            //        UILabel *solabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 21, 130, 22)];
+            //        solabel.textColor=UIColorFromRGB(color);
+            //        solabel.backgroundColor = [UIColor clearColor];
+            //        solabel.text=NSLocalizedString(@"SO#", nil);
+            //        [solabel sizeToFit];
+            //        [myView addSubview:solabel];
+            
+            //        UILabel *userlabel = [[UILabel alloc] initWithFrame:CGRectMake(165, 21, 125, 22)];
+            //        userlabel.textColor=UIColorFromRGB(color);
+            //        userlabel.backgroundColor = [UIColor clearColor];
+            //        userlabel.text=NSLocalizedString(@"Sales rep", nil);
+            //        [userlabel sizeToFit];
+            //        [myView addSubview:userlabel];
+            
+            UILabel *creatorlabel = [[UILabel alloc] initWithFrame:CGRectMake(165, 11, 125, 22)];
+            creatorlabel.textColor=UIColorFromRGB(color);
+            creatorlabel.backgroundColor = [UIColor clearColor];
+            creatorlabel.text=NSLocalizedString(@"Create by", nil);
+            [creatorlabel sizeToFit];
+            [myView addSubview:creatorlabel];
+            
+            UILabel *contactlabel = [[UILabel alloc] initWithFrame:CGRectMake(296, 11, 150, 22)];
+            
+            contactlabel.textColor=UIColorFromRGB(color);
+            contactlabel.backgroundColor = [UIColor clearColor];
+            contactlabel.text=NSLocalizedString(@"Contact", nil);
+            [contactlabel sizeToFit];
+            [myView addSubview:contactlabel];
+            
+            
+            
+            //
+            //    UILabel *modellabel = [[UILabel alloc] initWithFrame:CGRectMake(424, 11, 52, 22)];
+            //    modellabel.textColor=[UIColor whiteColor];
+            //    modellabel.backgroundColor = [UIColor clearColor];
+            //    modellabel.text=NSLocalizedString(@"Model", nil);
+            //    [modellabel sizeToFit];
+            //    [myView addSubview:modellabel];
+            
+            //    UILabel *modellabel = [[UILabel alloc] initWithFrame:CGRectMake(self.table_order.frame.size.width-276, 2, 100, 22)];
+            //    modellabel.autoresizingMask=UIViewAutoresizingFlexibleLeftMargin;
+            //    modellabel.textColor=[UIColor whiteColor];
+            //    modellabel.backgroundColor = [UIColor clearColor];
+            //    modellabel.text=NSLocalizedString(@"Items/QTY", nil);
+            //    [modellabel sizeToFit];
+            //    [myView addSubview:modellabel];
+            
+            
+            
+            AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+            
+            UILabel *pricelabel = nil;
+            if(appDelegate.user_type==USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore && self.orderType==1)
+                pricelabel=[[UILabel alloc] initWithFrame:CGRectMake(/*492*/self.table_order.frame.size.width-276, 2, 100, 22)];
+            else
+                pricelabel=[[UILabel alloc] initWithFrame:CGRectMake(/*492*/self.table_order.frame.size.width-276, 11, 100, 22)];
+            pricelabel.autoresizingMask=UIViewAutoresizingFlexibleLeftMargin;
+            pricelabel.textColor=UIColorFromRGB(color);
+            pricelabel.backgroundColor = [UIColor clearColor];
+            pricelabel.text=NSLocalizedString(@"Order Total", nil);
+            [pricelabel sizeToFit];
+            [myView addSubview:pricelabel];
+            
+            
+            if(appDelegate.user_type==USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore && self.orderType==1)
+            {
+                UILabel *polabel = nil;
+                polabel=[[UILabel alloc] initWithFrame:CGRectMake(/*492*/self.table_order.frame.size.width-276, 21, 100, 22)];
+                polabel.autoresizingMask=UIViewAutoresizingFlexibleLeftMargin;
+                polabel.textColor=UIColorFromRGB(color);
+                polabel.backgroundColor = [UIColor clearColor];
+                polabel.text=NSLocalizedString(@"PO#", nil);
+                [polabel sizeToFit];
+                [myView addSubview:polabel];
+            }
+            
+            
+            UILabel *timelabel = [[UILabel alloc] initWithFrame:CGRectMake(self.table_order.frame.size.width-163/*605*/,11, 148, 22)];
+            timelabel.autoresizingMask=UIViewAutoresizingFlexibleLeftMargin;
+            timelabel.textColor=UIColorFromRGB(color);
+            timelabel.backgroundColor = [UIColor clearColor];
+            if(self.time_zone==nil)
+                timelabel.text=@"Create time";
+            else
+                timelabel.text=[NSString stringWithFormat:@"Create time (%@)",self.time_zone];
+            [timelabel sizeToFit];
+            [myView addSubview:timelabel];
+            
+            myView.autoresizesSubviews=true;
+            // [myView setAutoresizingMask:UIViewAutoresizingFlexibleWidth  | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleLeftMargin];
+            
+            
+            
+            
+            //    modellabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
+            //    pricelabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
+            //    timelabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
+            myView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
+            //
+            return myView;
+        }
     else return nil;
     
 }
@@ -1391,6 +1589,14 @@
         //        return 0;
         //    return self.content_data.count+1;
     }
+    if(tableView==self.table_submit)
+    {
+        return self.submit_content_data.count;
+        // NSDictionary * item_json = [self.content_data objectForKey:@"items"];
+        //    if( self.content_data.count==0)
+        //        return 0;
+        //    return self.content_data.count+1;
+    }
     else
     {
         AppDelegate* Appdelegate=(AppDelegate*)[UIApplication sharedApplication].delegate;
@@ -1450,7 +1656,7 @@
             //            price=nil;
             //        }
             //
-            NSInteger statusCode = [[self.content_data[indexPath.row] valueForKey:@"orderStatus"] integerValue];
+//            NSInteger statusCode = [[self.content_data[indexPath.row] valueForKey:@"orderStatus"] integerValue];
             NSString* purchase_time= [self.content_data[indexPath.row] valueForKey:@"purchase_time"];
             NSString* status = [self.content_data[indexPath.row] valueForKey:@"order_status"] ;
             //        if (appDelegate.user && appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore) {
@@ -1490,6 +1696,66 @@
             return cell;
         }
     }
+    else if(tableView==self.table_submit)
+    {
+        
+        AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+      
+        {
+            NSString *CellIdentifier = @"OrderListTableViewCell";
+            OrderListTableViewCell * cell= [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
+            
+            NSString* so= [self.submit_content_data[indexPath.row] valueForKey:@"so#"];
+            NSString* price= [self.submit_content_data[indexPath.row] valueForKey:@"price"];
+            //        if(appDelegate.can_see_price&&appDelegate.price_hidden==false)
+            //        {
+            //
+            //        }
+            //        else
+            //        {
+            //            price=nil;
+            //        }
+            //
+//            NSInteger statusCode = [[self.content_data[indexPath.row] valueForKey:@"orderStatus"] integerValue];
+            NSString* purchase_time= [self.submit_content_data[indexPath.row] valueForKey:@"purchase_time"];
+            NSString* status = [self.submit_content_data[indexPath.row] valueForKey:@"order_status"] ;
+            //        if (appDelegate.user && appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore) {
+            //            status = [ERPUtils orderStatus:statusCode];
+            //        }
+            NSString* customer_name = [self.submit_content_data[indexPath.row] valueForKey:@"customer_name"];
+            NSString* model_count = [self.submit_content_data[indexPath.row] valueForKey:@"model_count"];
+            NSString* sales = [self.submit_content_data[indexPath.row] valueForKey:@"sales_rep"];
+            NSString* creator = [self.submit_content_data[indexPath.row] valueForKey:@"create_by"];
+            NSString *po = [self.submit_content_data[indexPath.row] valueForKey:@"po_id"];
+            
+            CGRect price_frame = cell.labelprice.frame;
+            if (appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore && self.orderType == 1) {
+                
+                cell.label_po.hidden = NO;
+                price_frame.origin.y = 5;
+                cell.label_po.text = po;
+                
+            } else {
+                
+                cell.label_po.hidden = YES;
+                price_frame.origin.y = 21;
+            }
+            cell.labelprice.frame = price_frame;
+            cell.label_so.text=so;
+            cell.labelprice.text=price;
+            cell.label_date.text=purchase_time;
+            cell.label_contact.text=customer_name;
+            cell.label_model.hidden = false;
+            cell.label_model.text = model_count;
+            
+            cell.label_sales.text = sales;
+            cell.label_creator.text = creator;
+            
+            cell.label_status.text=status;
+            cell.backgroundColor = [UIColor whiteColor];
+            return cell;
+        }
+    }
     else
     {
         AppDelegate* Appdelegate=(AppDelegate*)[UIApplication sharedApplication].delegate;
@@ -1608,10 +1874,7 @@
         if(indexPath.row==self.content_data.count)
             return;
         
-        
-        
-        UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:@"Open Saved Order" message:nil preferredStyle:UIAlertControllerStyleAlert];
-        UIAlertAction *actionOne = [UIAlertAction actionWithTitle:@"Open" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
+        {
             AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
             
             
@@ -1622,15 +1885,15 @@
             [appDelegate setUser:orderitem[@"create_by"]];
             //            appDelegate.user =;
             //        appDelegate.custo orderitem[@"customer_name"]
-            appDelegate.user_type = USER_ROLE_EMPLOYEE;
+//            appDelegate.user_type = USER_ROLE_EMPLOYEE;
             appDelegate.can_set_cart_price = true;
             appDelegate.can_see_price = true;
             
             
             NSMutableDictionary * params= [[NSMutableDictionary alloc] init];
             
-            NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
-            NSString *documents = [paths objectAtIndex:0];
+//            NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
+//            NSString *documents = [paths objectAtIndex:0];
             
             
             
@@ -1641,6 +1904,7 @@
             //        NSMutableDictionary* app= [[RAUtils dictfromfile:[orderdir stringByAppendingPathComponent:@"app.json"]] mutableCopy];
             
             [appDelegate setCustomerInfo: contact];
+            appDelegate.contact_id = contact[@"customer_cid"];
             RASingleton.sharedInstance.scan_cart = cart;
             RASingleton.sharedInstance.price_type = [cart[@"price_type"] intValue];
             
@@ -1666,28 +1930,100 @@
             //    orderinfoVC.have_tail = true
             //    }
             
+            
+#ifdef RA_NOTIFICATION
+            [ActiveViewController Notify:@"CartViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+#else
+            
+            
+            [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
+#endif
+            
             [self.navigationController pushViewController:orderinfoVC animated:true];
             
             return;
             
             
-        }];
-        
-        
-        
-        UIAlertAction *alertCancel = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
-            
-        }];
-        
-        [alertControl addAction:actionOne];
-        
-        //        [alertControl addAction:alertthree];
-        [alertControl addAction:alertCancel];
-        
-        [self presentViewController:alertControl animated:YES completion:nil];
-        
-        
+        }
         
+//        UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:@"Open Saved Order" message:nil preferredStyle:UIAlertControllerStyleAlert];
+//        UIAlertAction *actionOne = [UIAlertAction actionWithTitle:@"Open" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
+//            AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+//
+//
+//            NSMutableDictionary* orderitem =self.content_data[indexPath.row];
+//            NSString* ordercode =orderitem[@"order_code"];
+//            appDelegate.order_code = ordercode;
+//
+//            [appDelegate setUser:orderitem[@"create_by"]];
+//            //            appDelegate.user =;
+//            //        appDelegate.custo orderitem[@"customer_name"]
+//            appDelegate.user_type = USER_ROLE_EMPLOYEE;
+//            appDelegate.can_set_cart_price = true;
+//            appDelegate.can_see_price = true;
+//
+//
+//            NSMutableDictionary * params= [[NSMutableDictionary alloc] init];
+//
+////            NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
+////            NSString *documents = [paths objectAtIndex:0];
+//
+//
+//
+//            NSString *orderdir = [OLDataProvider getScanPath];
+//            //        NSMutableDictionary* order= [[RAUtils dictfromfile:[orderdir stringByAppendingPathComponent:@"order.json"]] mutableCopy];
+//            NSMutableDictionary* cart= [[RAUtils dictfromfile:[orderdir stringByAppendingPathComponent:@"cart.json"]] mutableCopy];
+//            NSMutableDictionary* contact= [[RAUtils dictfromfile:[orderdir stringByAppendingPathComponent:@"contact.json"]] mutableCopy];
+//            //        NSMutableDictionary* app= [[RAUtils dictfromfile:[orderdir stringByAppendingPathComponent:@"app.json"]] mutableCopy];
+//
+//            [appDelegate setCustomerInfo: contact];
+//            RASingleton.sharedInstance.scan_cart = cart;
+//            RASingleton.sharedInstance.price_type = [cart[@"price_type"] intValue];
+//
+//
+//            [appDelegate update_count_mark];
+//            //            [appDelegate updateScanButton:true];
+//            [appDelegate SetMode:@""];
+//
+//            CreateOrderViewController * orderinfoVC = [[CreateOrderViewController alloc] initWithNibName:@"CommonEditor.iPad" bundle:nil];
+//
+//
+//
+//            orderinfoVC.disable_dropdown_refresh=true;
+//            orderinfoVC.url_type = URL_FILE;
+//            orderinfoVC.request_url=[orderdir stringByAppendingPathComponent:@"order.json"];
+//
+//            orderinfoVC.params = params;
+//            orderinfoVC.title=@"";
+//            //            orderinfoVC.delegate=self;
+//            //
+//            //    if(checked.count==count)
+//            //    {
+//            //    orderinfoVC.have_tail = true
+//            //    }
+//
+//            [self.navigationController pushViewController:orderinfoVC animated:true];
+//
+//            return;
+//
+//
+//        }];
+//
+//
+//
+//        UIAlertAction *alertCancel = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
+//
+//        }];
+//
+//        [alertControl addAction:actionOne];
+//
+//        //        [alertControl addAction:alertthree];
+//        [alertControl addAction:alertCancel];
+//
+//        [self presentViewController:alertControl animated:YES completion:nil];
+//
+//
+//
         
         
         //    NSString* orderid= [ valueForKey:@"order_id"];
@@ -1770,7 +2106,9 @@
                 UIAlertAction *actionOne = [UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
                     
                     [OLDataProvider deleteScanOrder:order_code];
-                    [appDelegate closeOrder];
+                    
+                    if([appDelegate.order_code isEqualToString:order_code])
+                        [appDelegate closeOrder];
                     
                     
                     //
@@ -1806,7 +2144,7 @@
                 
                 
             }];
-            deleteRowAction.backgroundColor = UIColorFromRGB(0x336699);
+            deleteRowAction.backgroundColor = UIColor.redColor;//UIColorFromRGB(0x336699);
             
             // 添加一个编辑按钮
             
@@ -1845,6 +2183,78 @@
         
         return @[];
     }
+    else if(tableView==self.table_submit)
+    {
+       
+        AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+        //    NSString* so= [self.content_data[indexPath.row] valueForKey:@"so#"];
+        NSString* order_code= [self.submit_content_data[indexPath.row] valueForKey:@"order_code"];
+        //    NSString* order_status= [self.content_data[indexPath.row] valueForKey:@"order_status"];
+        //    NSInteger statusCode = [[self.content_data[indexPath.row] valueForKey:@"orderStatus"] integerValue];
+        
+        {
+            
+            UITableViewRowAction *deleteRowAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"Delete" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
+                
+                DebugLog(@"delete click");
+                
+                
+                NSString * title =@"Are you sure to delete the submitted record?";
+                
+                UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:title message:nil preferredStyle:UIAlertControllerStyleAlert];
+                //block代码块取代了delegate
+                
+
+                UIAlertAction *actionOne = [UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
+                    
+                    [OLDataProvider deleteSubmittedOrder:order_code];
+                    
+
+                    
+
+                    
+                    return;
+                }];
+                
+                UIAlertAction *alertthree = [UIAlertAction actionWithTitle:@"No" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
+                    DebugLog(@"Cancel");
+                }];
+                [alertControl addAction:actionOne];
+                
+                [alertControl addAction:alertthree];
+                
+                //UIAlertControllerStyle类型为UIAlertControllerStyleAlert可以添加addTextFieldWithConfigurationHandler:^(UITextField *textField)
+                
+                
+                [self presentViewController:alertControl animated:YES completion:nil];
+                
+                
+                
+                
+                
+                
+                
+            }];
+            deleteRowAction.backgroundColor = UIColorFromRGB(0x336699);
+            
+            // 添加一个编辑按钮
+            
+            
+
+            {
+                NSMutableArray* arr=[@[] mutableCopy];
+                if(appDelegate.can_delete_order)
+                    [arr addObject:deleteRowAction];
+                //                if(appDelegate.can_cancel_order)
+                //                    [arr addObject:cancelAction];
+                return arr;
+            }
+            //        }
+            
+            
+            
+        }
+    }
     else
     {
         AppDelegate* Appdelegate=(AppDelegate*)[UIApplication sharedApplication].delegate;
@@ -1925,47 +2335,51 @@
         if(indexPath.row==self.content_data.count)
             return NO;
         
-        //    if(self.init_style==OL_OPEN)
-        //        return NO;
-        
-        AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-        //    NSString* order_status= [self.content_data[indexPath.row] valueForKey:@"order_status"];
-        NSInteger statusCode = [[self.content_data[indexPath.row] valueForKey:@"orderStatus"] integerValue];
-        
-        if(appDelegate.user_type==USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore) {
-            // saved && ((type==0 && merge_permission) || type == 1 || can_cancel)
-            
-            BOOL isSavedOrder = /*[order_status isEqualToString:@"Saved Order"]*/statusCode == 1;
-            switch (self.orderType) {
-                case 0:{ // Shop Order
-                    
-                    if (!isSavedOrder) {
-                        return NO;
-                    } else {
-                        if ([RASingleton sharedInstance].permissions_merge_order || appDelegate.can_cancel_order) {
-                            return YES;
-                        } else {
-                            return NO;
-                        }
-                    }
-                    
-                }
-                    break;
-                case 1:{ // Sales Order
-                    if (isSavedOrder && appDelegate.can_cancel_order) {
-                        return YES;
-                    }
-                    return NO;
-                }
-                    break;
-                    
-                default:
-                    break;
-            }
-            
-        } else {
-            return YES;
-        }
+//        //    if(self.init_style==OL_OPEN)
+//        //        return NO;
+//        
+//        AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+//        //    NSString* order_status= [self.content_data[indexPath.row] valueForKey:@"order_status"];
+//        NSInteger statusCode = [[self.content_data[indexPath.row] valueForKey:@"orderStatus"] integerValue];
+//        
+//        if(appDelegate.user_type==USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore) {
+//            // saved && ((type==0 && merge_permission) || type == 1 || can_cancel)
+//            
+//            BOOL isSavedOrder = /*[order_status isEqualToString:@"Saved Order"]*/statusCode == 1;
+//            switch (self.orderType) {
+//                case 0:{ // Shop Order
+//                    
+//                    if (!isSavedOrder) {
+//                        return NO;
+//                    } else {
+//                        if ([RASingleton sharedInstance].permissions_merge_order || appDelegate.can_cancel_order) {
+//                            return YES;
+//                        } else {
+//                            return NO;
+//                        }
+//                    }
+//                    
+//                }
+//                    break;
+//                case 1:{ // Sales Order
+//                    if (isSavedOrder && appDelegate.can_cancel_order) {
+//                        return YES;
+//                    }
+//                    return NO;
+//                }
+//                    break;
+//                    
+//                default:
+//                    break;
+//            }
+//            
+//        } else {
+//            return YES;
+//        }
+        return YES;
+    }
+    else if(tableView==self.table_submit)
+    {
         return YES;
     }
     else
@@ -2106,80 +2520,80 @@
     }
     return nil;
 }
-
-- (IBAction)mergeListButtonClick:(UIBarButtonItem *)sender {
-    
-    if (!self.table_order.isEditing) {
-        
-        [RAUtils message_alert:@"You have to click select firstly then select some saved order" title:@"Warning" controller:self];
-        return;
-    }
-    
-    [self handleSelectedOrders];
-    
-    if (!self.mergeList.count) {
-        
-        //        [RAUtils message_alert:@"Combine List is Empty" title:@"Warning" controller:self];
-        return;
-    }
-    
-    SelectUploadOrderViewController *mergeVC = [[UIStoryboard storyboardWithName:@"OLM" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"SelectUploadOrderViewController"];
-    
-    UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:mergeVC];
-    
-    mergeVC.mergeList = self.mergeList;
-    
-    mergeVC.title = @"Combine List";
-    
-    __weak typeof(self) weakself = self;
-    
-    mergeVC.mergeBlock = ^(NSDictionary *ret) {
-        
-        
-        if (weakself) {
-            
-            __strong typeof(weakself) strongself = weakself;
-            
-            if([[ret objectForKey:@"result"]integerValue] == RESULT_TRUE) {
-                
-                [weakself.mergeList removeAllObjects];
-                [strongself.table_order endEditing:YES];
-                [strongself ReloadData];
-                
-                if ([RASingleton sharedInstance].customer_can_see_sales_Order) {
-                    
-                    [strongself openOrder:ret];
-                    
-                }
-                
-            } else {
-                
-                NSString *msg = [ret objectForKey:@"err_msg"];
-                [RAUtils message_alert:msg title:nil controller:strongself];
-            }
-        }
-        
-    };
-    
-    mergeVC.deleteBlock = ^(NSString *orderID){
-        NSIndexPath *indexPath = [weakself indexPathOfDeleteOrder:orderID];
-        [weakself.table_order deselectRowAtIndexPath:indexPath animated:YES];
-    };
-    
-    mergeVC.clearBlock = ^{
-        for (NSDictionary *order in self.mergeList) {
-            
-            NSString *order_id = [NSString stringWithFormat:@"%@",[order objectForKey:@"order_id"]];
-            NSIndexPath *indexPath = [weakself indexPathOfDeleteOrder:order_id];
-            [weakself.table_order deselectRowAtIndexPath:indexPath animated:YES];
-        }
-    };
-    
-    nav.modalPresentationStyle = UIModalPresentationFormSheet;
-    
-    [self presentViewController:nav animated:YES completion:nil];
-    
-}
+//
+//- (IBAction)mergeListButtonClick:(UIBarButtonItem *)sender {
+//
+//    if (!self.table_order.isEditing) {
+//
+//        [RAUtils message_alert:@"You have to click select firstly then select some saved order" title:@"Warning" controller:self];
+//        return;
+//    }
+//
+//    [self handleSelectedOrders];
+//
+//    if (!self.mergeList.count) {
+//
+//        //        [RAUtils message_alert:@"Combine List is Empty" title:@"Warning" controller:self];
+//        return;
+//    }
+//
+//    SelectUploadOrderViewController *mergeVC = [[UIStoryboard storyboardWithName:@"OLM" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"SelectUploadOrderViewController"];
+//
+//    UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:mergeVC];
+//
+//    mergeVC.mergeList = self.mergeList;
+//
+//    mergeVC.title = @"Combine List";
+//
+//    __weak typeof(self) weakself = self;
+//
+//    mergeVC.mergeBlock = ^(NSDictionary *ret) {
+//
+//
+//        if (weakself) {
+//
+//            __strong typeof(weakself) strongself = weakself;
+//
+//            if([[ret objectForKey:@"result"]integerValue] == RESULT_TRUE) {
+//
+//                [weakself.mergeList removeAllObjects];
+//                [strongself.table_order endEditing:YES];
+//                [strongself ReloadData];
+//
+//                if ([RASingleton sharedInstance].customer_can_see_sales_Order) {
+//
+//                    [strongself openOrder:ret];
+//
+//                }
+//
+//            } else {
+//
+//                NSString *msg = [ret objectForKey:@"err_msg"];
+//                [RAUtils message_alert:msg title:nil controller:strongself];
+//            }
+//        }
+//
+//    };
+//
+//    mergeVC.deleteBlock = ^(NSString *orderID){
+//        NSIndexPath *indexPath = [weakself indexPathOfDeleteOrder:orderID];
+//        [weakself.table_order deselectRowAtIndexPath:indexPath animated:YES];
+//    };
+//
+//    mergeVC.clearBlock = ^{
+//        for (NSDictionary *order in self.mergeList) {
+//
+//            NSString *order_id = [NSString stringWithFormat:@"%@",[order objectForKey:@"order_id"]];
+//            NSIndexPath *indexPath = [weakself indexPathOfDeleteOrder:order_id];
+//            [weakself.table_order deselectRowAtIndexPath:indexPath animated:YES];
+//        }
+//    };
+//
+//    nav.modalPresentationStyle = UIModalPresentationFormSheet;
+//
+//    [self presentViewController:nav animated:YES completion:nil];
+//
+//}
 
 - (void)handleSelectedOrders {
     
@@ -2269,112 +2683,122 @@
         self.table_upload.hidden = true;
         [self.table_order reloadData];
     }
-    else
+    else  if(sender.selectedSegmentIndex==1)
     {
-        self.table_order.hidden=true;
-        self.table_upload.hidden = false;
-        [self.table_upload reloadData];
-    }
-    
-}
-
-- (void)openOrder:(NSDictionary *)order {
-    
-    if (!order) {
-        return;
-    }
-    
-    NSString *orderCode = [order objectForKey:@"orderCode"];
-    NSInteger orderStatus = [[order objectForKey:@"orderStatus"] integerValue];
-    NSString *so = [order objectForKey:@"so#"];
-    
-    __weak typeof(self) weakself = self;
-    
-    [RANetwork request_open_order:orderCode completionHandler:^(NSMutableDictionary *result) {
-        NSDictionary* order_json = result ;
-        
-        
-        if([[order_json valueForKey:@"result"] intValue]==2)
-        {
-            AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-            appDelegate.order_code = orderCode;
-            appDelegate.order_status = (int)orderStatus;
-            [appDelegate SetSo:so];
-            
-            __weak MainViewController *mainVC = (MainViewController*)appDelegate.main_vc;
-            
-#ifdef RA_NOTIFICATION
-            [ActiveViewController Notify:@"CartViewController,OrderListViewController,ContactListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
-#else
-            
-            
-            [((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
-            [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
-            [((MainViewController*)appDelegate.main_vc) reloadContact:true immediately:false];
-#endif
-            
-            [((MainViewController*)appDelegate.main_vc) switchToCart];
-            
-            mainVC.cartViewController.onFinishLoad=^{
-                [mainVC.cartViewController placeOrder];
-                mainVC.cartViewController.onFinishLoad=nil;
-            };
-            
-        }
-        else
-        {
-            [RAUtils message_alert:[order_json valueForKey:@"err_msg"] title:@"Open Order" controller:weakself] ;
-        }
-        
+//        self.table_order.hidden=true;
+//        self.table_upload.hidden = false;
+//        [self.table_upload reloadData];
         
         
+        self.table_order.hidden=true;
+        self.table_submit.hidden = false;
+        [self.table_submit reloadData];
         
-    }];
-    //    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-    //
-    //        NSDictionary* order_json = [RANetwork open_Order:orderCode];
-    //
-    //        dispatch_async(dispatch_get_main_queue(), ^{
-    //
-    //            if([[order_json valueForKey:@"result"] intValue]==2)
-    //            {
-    //                AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-    //                appDelegate.order_code = orderCode;
-    //                appDelegate.order_status = orderStatus;
-    //                [appDelegate SetSo:so];
-    //
-    //                __weak MainViewController *mainVC = (MainViewController*)appDelegate.main_vc;
-    //
-    //#ifdef RA_NOTIFICATION
-    //                [ActiveViewController Notify:@"CartViewController,OrderListViewController,ContactListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
-    //#else
-    //
-    //
-    //                [((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
-    //                [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
-    //                [((MainViewController*)appDelegate.main_vc) reloadContact:true immediately:false];
-    //#endif
-    //
-    //                [((MainViewController*)appDelegate.main_vc) switchToCart];
-    //
-    //                mainVC.cartViewController.onFinishLoad=^{
-    //                    [mainVC.cartViewController placeOrder];
-    //                    mainVC.cartViewController.onFinishLoad=nil;
-    //                };
-    //
-    //            }
-    //            else
-    //            {
-    //                [RAUtils message_alert:[order_json valueForKey:@"err_msg"] title:@"Open Order" controller:weakself] ;
-    //            }
-    //
-    //
-    //
-    //        });
-    //    });
-    
-    
+    }
+//    else
+//    {
+//        [self onNewOrderClicked:nil];
+//    }
+//
 }
+//
+//- (void)openOrder:(NSDictionary *)order {
+//    
+//    if (!order) {
+//        return;
+//    }
+//    
+//    NSString *orderCode = [order objectForKey:@"orderCode"];
+//    NSInteger orderStatus = [[order objectForKey:@"orderStatus"] integerValue];
+//    NSString *so = [order objectForKey:@"so#"];
+//    
+//    __weak typeof(self) weakself = self;
+//    
+//    [RANetwork request_open_order:orderCode completionHandler:^(NSMutableDictionary *result) {
+//        NSDictionary* order_json = result ;
+//        
+//        
+//        if([[order_json valueForKey:@"result"] intValue]==2)
+//        {
+//            AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+//            appDelegate.order_code = orderCode;
+//            appDelegate.order_status = (int)orderStatus;
+//            [appDelegate SetSo:so];
+//            
+//            __weak MainViewController *mainVC = (MainViewController*)appDelegate.main_vc;
+//            
+//#ifdef RA_NOTIFICATION
+//            [ActiveViewController Notify:@"CartViewController,OrderListViewController,ContactListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+//#else
+//            
+//            
+//            [((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
+//            [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
+//            [((MainViewController*)appDelegate.main_vc) reloadContact:true immediately:false];
+//#endif
+//            
+//            [((MainViewController*)appDelegate.main_vc) switchToCart];
+//            
+//            mainVC.cartViewController.onFinishLoad=^{
+//                [mainVC.cartViewController placeOrder];
+//                mainVC.cartViewController.onFinishLoad=nil;
+//            };
+//            
+//        }
+//        else
+//        {
+//            [RAUtils message_alert:[order_json valueForKey:@"err_msg"] title:@"Open Order" controller:weakself] ;
+//        }
+//        
+//        
+//        
+//        
+//    }];
+//    //    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+//    //
+//    //        NSDictionary* order_json = [RANetwork open_Order:orderCode];
+//    //
+//    //        dispatch_async(dispatch_get_main_queue(), ^{
+//    //
+//    //            if([[order_json valueForKey:@"result"] intValue]==2)
+//    //            {
+//    //                AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+//    //                appDelegate.order_code = orderCode;
+//    //                appDelegate.order_status = orderStatus;
+//    //                [appDelegate SetSo:so];
+//    //
+//    //                __weak MainViewController *mainVC = (MainViewController*)appDelegate.main_vc;
+//    //
+//    //#ifdef RA_NOTIFICATION
+//    //                [ActiveViewController Notify:@"CartViewController,OrderListViewController,ContactListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+//    //#else
+//    //
+//    //
+//    //                [((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
+//    //                [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
+//    //                [((MainViewController*)appDelegate.main_vc) reloadContact:true immediately:false];
+//    //#endif
+//    //
+//    //                [((MainViewController*)appDelegate.main_vc) switchToCart];
+//    //
+//    //                mainVC.cartViewController.onFinishLoad=^{
+//    //                    [mainVC.cartViewController placeOrder];
+//    //                    mainVC.cartViewController.onFinishLoad=nil;
+//    //                };
+//    //
+//    //            }
+//    //            else
+//    //            {
+//    //                [RAUtils message_alert:[order_json valueForKey:@"err_msg"] title:@"Open Order" controller:weakself] ;
+//    //            }
+//    //
+//    //
+//    //
+//    //        });
+//    //    });
+//    
+//    
+//}
 
 #pragma mark - notification action
 

+ 18 - 0
RedAnt ERP Mobile/common/Functions/OLO/guest.json

@@ -0,0 +1,18 @@
+{
+  "result": 2,
+  "header": {
+    "can_see_price": "true",
+    "can_set_cart_price": "true",
+    "can_submit_order": "true",
+    "can_update_contact_info": "true",
+    "can_delete_order": "true",
+    "can_show_price": "true",
+    "can_cancel_order": "true",
+    "can_create_order": "true",
+    "can_place_order": "true",
+    "user_type": "1",
+    "username": "GUEST",
+    "contact_id": "GUEST"
+    
+  }
+}

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

@@ -55,6 +55,10 @@
 //    return (toInterfaceOrientation == UIInterfaceOrientationPortrait);
 //    
 //}
+//- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
+//    return UIInterfaceOrientationLandscapeRight;
+////    return UIInterfaceOrientationPortrait;
+//}
 - (BOOL)shouldAutorotate
 {
     
@@ -74,7 +78,7 @@
             //    rect.size.height = rect.size.height-40;
             
             
-            
+//        self->_previewLayer
             
             
             
@@ -232,7 +236,20 @@
 - (void)viewDidLoad
 {
     [super viewDidLoad];
+#ifdef SCANNER_ORDER
+#if TARGET_IPHONE_SIMULATOR//模拟器
     
+//    if(RASingleton.sharedInstance.enable_OfflineOrder)
+    {
+        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 addtocart];
+    }
+
+    return;
+#endif
+    
+
+#endif
   
 #ifdef SCANNER_ORDER
     self.auto_style = true;
@@ -244,7 +261,9 @@
                                                                     style:UIBarButtonItemStylePlain
                                                                    target:self
                                                                    action:@selector( onBackClick:)];
-    
+#ifdef SCANNER_ORDER
+    closeButton.tintColor = [UIColor whiteColor];
+#endif
   //  closeButton.tintColor = UIColorFromRGB(0x996633);
     
     self.navigationItem.leftBarButtonItem = closeButton;
@@ -273,15 +292,7 @@
     
     
 #ifdef SCANNER_ORDER
-#if TARGET_IPHONE_SIMULATOR//模拟器
-    
-//    if(RASingleton.sharedInstance.enable_OfflineOrder)
-    {
-        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 addtocart];
-    }
-        
-#endif
+
     
     self.targetButton.hidden = true;
 #endif
@@ -408,7 +419,12 @@
     _decodedMessage.backgroundColor = [UIColor colorWithWhite:0.8 alpha:0.9];
     _decodedMessage.textColor = [UIColor darkGrayColor];
     _decodedMessage.textAlignment = NSTextAlignmentCenter;
+    
     [self.view addSubview:_decodedMessage];
+#ifdef SCANNER_ORDER
+    _decodedMessage.hidden = TRUE;
+#endif
+ 
     
     self.scanButton.layer.shadowColor = [UIColor blackColor].CGColor;
     self.scanButton.layer.shadowOffset = CGSizeMake(0, 0);
@@ -507,8 +523,8 @@
     _boundingBox.corners = translatedCorners;
     
     // Update the view with the decoded text
-    _decodedMessage.text = [transformed stringValue];
     
+
     // Start the timer which will hide the overlay
     [self startOverlayHideTimer];
     [self playSound];
@@ -912,6 +928,9 @@
             
             for(int j=0;j<modellist.count;j++)
             {
+                
+                if([modellist[j][@"count"] intValue]==0)
+                    continue;
                 NSMutableDictionary* jitem = nil;
                  jitem = [modellist[j] mutableCopy];
                 

+ 4 - 1
RedAnt ERP Mobile/common/Functions/cart/CartGeneralNotesViewController.m

@@ -17,6 +17,9 @@
 
 - (void)viewDidLoad {
     [super viewDidLoad];
+#ifdef SCANNER_ORDER
+    self.title = @"Special Instructions";
+#endif
         self.tv_notes.text = self.notes;
     // Do any additional setup after loading the view.
     
@@ -30,7 +33,7 @@
 //        self.automaticallyAdjustsScrollViewInsets = NO;
 //    }
 //    self.automaticallyAdjustsScrollViewInsets = NO;
-    self.navigationController.navigationBar.translucent = NO;
+//    self.navigationController.navigationBar.translucent = NO;
     self.tv_notes.layer.borderColor = [UIColor lightGrayColor].CGColor;
     self.tv_notes.layer.borderWidth = 1.0f;
 }

+ 1 - 0
RedAnt ERP Mobile/common/Functions/cart/CartViewController.h

@@ -33,6 +33,7 @@
 @property int total_carton;
 @property int total_item;
 @property int total_QTY;
+@property bool edit_check;
 
 @property (strong,nonatomic) NSString* notes;
 

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

@@ -1083,7 +1083,23 @@
     contactlabel.textColor=UIColorFromRGB(color);
     contactlabel.autoresizingMask=UIViewAutoresizingFlexibleLeftMargin;
     contactlabel.backgroundColor = [UIColor clearColor];
+    
+#ifdef SCANNER_ORDER
+    
+    NSString* pricename;
+    switch(RASingleton.sharedInstance.price_type)
+    {
+        case 0: pricename = @"DDP";
+            break;;
+        case 1: pricename = @"WHSE";
+            break;;
+//        case 2: pricename = @"25%";
+//            break;
+    }
+    contactlabel.text=pricename;
+#else
     contactlabel.text=NSLocalizedString(@"Unit price", nil);
+#endif
     [contactlabel sizeToFit];
     [myView addSubview:contactlabel];
     
@@ -1256,8 +1272,8 @@
 //
     
     
-    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
-    NSString *documents = [paths objectAtIndex:0];
+//    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
+//    NSString *documents = [paths objectAtIndex:0];
     
         
         
@@ -1307,8 +1323,10 @@
                         }
                     }
                     else
-                        item[@"value"]=appDelegate.customerInfo[name];
-                    
+                    {
+                        if(item[@"value"]==nil ||[item[@"value"] stringValue].length==0) //order 内没有值才从customer 复制
+                            item[@"value"]=appDelegate.customerInfo[name];
+                    }
                     section[[NSString stringWithFormat:@"item_%d",j]] = item;
                 }
                 
@@ -1413,10 +1431,10 @@
     }
     
     UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:@"Change Price" message:nil preferredStyle:UIAlertControllerStyleAlert];
-    UIAlertAction *action1 = [UIAlertAction actionWithTitle:@"FOB CTNR" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
+    UIAlertAction *action1 = [UIAlertAction actionWithTitle:@"DDP" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
 
 //        self.btnPrice.titleLabel.text = @"FOB CTNR";
-        [self.btnPrice setTitle: @"FOB CTNR" forState:UIControlStateNormal];
+        [self.btnPrice setTitle: @"DDP" forState:UIControlStateNormal];
         RASingleton.sharedInstance.price_type=0;
         NSMutableDictionary* section = [RASingleton.sharedInstance.scan_cart[@"section_0"] mutableCopy];
             int count = [section[@"count"] intValue];
@@ -1430,11 +1448,14 @@
         RASingleton.sharedInstance.scan_cart[@"section_0"]  = section;
         RASingleton.sharedInstance.scan_cart[@"price_type"] = @0;
         [OLDataProvider saveScanCart:RASingleton.sharedInstance.scan_cart];
+        [self.cartIndicatorBar removeFromSuperview];
+        self.cartIndicatorBar = [self setupCartIndicatorBar];
+        [self.view addSubview:self.cartIndicatorBar];
         [self reload_data];
     }];
-    UIAlertAction *action2 = [UIAlertAction actionWithTitle:@"FOB N.CA" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
+    UIAlertAction *action2 = [UIAlertAction actionWithTitle:@"WHSE" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
 
-        [self.btnPrice setTitle: @"FOB N.CA" forState:UIControlStateNormal];
+        [self.btnPrice setTitle: @"WHSE" forState:UIControlStateNormal];
         RASingleton.sharedInstance.price_type=1;
         NSMutableDictionary* section = [RASingleton.sharedInstance.scan_cart[@"section_0"] mutableCopy];
             int count = [section[@"count"] intValue];
@@ -1448,6 +1469,9 @@
         RASingleton.sharedInstance.scan_cart[@"price_type"] = @1;
         RASingleton.sharedInstance.scan_cart[@"section_0"]  = section;
         [OLDataProvider saveScanCart:RASingleton.sharedInstance.scan_cart];
+        [self.cartIndicatorBar removeFromSuperview];
+        self.cartIndicatorBar = [self setupCartIndicatorBar];
+        [self.view addSubview:self.cartIndicatorBar];
         [self reload_data];
     }];
     
@@ -1468,6 +1492,10 @@
         RASingleton.sharedInstance.scan_cart[@"section_0"]  = section;
         RASingleton.sharedInstance.scan_cart[@"price_type"] = @2;
         [OLDataProvider saveScanCart:RASingleton.sharedInstance.scan_cart];
+        
+        [self.cartIndicatorBar removeFromSuperview];
+        self.cartIndicatorBar = [self setupCartIndicatorBar];
+        [self.view addSubview:self.cartIndicatorBar];
         [self reload_data];
     }];
     
@@ -1477,7 +1505,7 @@
     
     [alertControl addAction:action1];
     [alertControl addAction:action2];
-    [alertControl addAction:action3];
+//    [alertControl addAction:action3];
     
 //        [alertControl addAction:alertthree];
     [alertControl addAction:alertCancel];
@@ -1492,7 +1520,7 @@
     
     if(appDelegate.user.length==0)
     {
-        [RAUtils message_alert:@"Please select a sales first." title:@"Warring" controller:self];
+        [RAUtils message_alert:@"Please login first." title:@"Warring" controller:self];
         return;
     }
     
@@ -1502,7 +1530,7 @@
     
     
     
-    appDelegate.user_type = USER_ROLE_EMPLOYEE;
+//    appDelegate.user_type = USER_ROLE_EMPLOYEE;
     appDelegate.can_set_cart_price = true;
     appDelegate.can_see_price = true;
     
@@ -2133,18 +2161,21 @@
 #ifdef SCANNER_ORDER
     
     NSString* pricename;
-    switch([RASingleton.sharedInstance.scan_cart[@"price_type"] intValue])
+    switch(RASingleton.sharedInstance.price_type )
     {
-        case 0: pricename = @"FOB CTNR";
+        case 0: pricename = @"DDP";
             break;;
-        case 1: pricename = @"FOB N.CA";
+        case 1: pricename = @"WHSE";
             break;;
-        case 2: pricename = @"25%";
-            break;
+//        case 2: pricename = @"25%";
+//            break;
     }
     
     [self.btnPrice setTitle:pricename forState:UIControlStateNormal];
-    
+//    self.cartIndicatorBar = [self setupCartIndicatorBar];
+    [self.cartIndicatorBar removeFromSuperview];
+    self.cartIndicatorBar = [self setupCartIndicatorBar];
+    [self.view addSubview:self.cartIndicatorBar];
     
 #endif
     
@@ -2206,7 +2237,7 @@
         
         
     }
-    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+    
     NSString* subtotal = [NSString stringWithFormat:@"$%.2f",self.total];
     NSString* subcuft = [NSString stringWithFormat:@"%.2f ft³",self.total_cuft];
     NSString* subcarton = [NSString stringWithFormat:@"%d",self.total_carton];
@@ -2217,6 +2248,7 @@
     
     NSString* subqty = [NSString stringWithFormat:@"%d",self.total_QTY];
 #ifndef SCANNER_ORDER
+    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
     if(appDelegate.can_see_price&&appDelegate.price_hidden==false)
     {
         
@@ -2237,11 +2269,11 @@
     
 }
 - (IBAction)onEditGeneralNotes:(id)sender {
-    
+#ifndef SCANNER_ORDER
     if (![self isOrderAvailable]) {
         return;
     }
-    
+#endif
     UIViewController* parentvc=self;
     
     
@@ -2702,7 +2734,7 @@
 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
 {
     
-    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+  
     //    if(tableView==self.itemListTable)
     //    {
     
@@ -2863,7 +2895,7 @@
     return cell;
     
 #else
-    
+    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
     CellIdentifier = @"CartItemCell";
     ModelItemCell * cell= [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
     
@@ -3404,6 +3436,9 @@
                                                   
                                               }
                                           }
+#ifdef SCANNER_ORDER
+                                          self.cart_json = cart_json;
+#endif
                                           [self.itemListTable reloadData];
                                           [self refresh_total];
                  #ifdef RA_NOTIFICATION

+ 3 - 0
RedAnt ERP Mobile/common/Functions/offline/OLDataProvider.h

@@ -155,6 +155,8 @@ typedef void(^resultHandler)(NSMutableDictionary *result);
 +(void) saveScanCart:(NSMutableDictionary*) cart;
 +(void) save2submitScanOrder;
 +(void) deleteScanOrder:(NSString*) order_code;
++(void) deleteSubmittedOrder:(NSString*) order_code;
++(void) updateScanOrder:(NSString*) order_code orderitem:(NSMutableDictionary*) orderitem;
 +(NSMutableDictionary*) loadScanTemplate:(NSString*)file;
 +(NSString*) scanTemplatePath:(NSString*)file;
 //+(NSString*) getScanTempPath;
@@ -163,4 +165,5 @@ typedef void(^resultHandler)(NSMutableDictionary *result);
 +(NSString*) getUserPath;
 +(NSString*) getScanPath;
 +(void) moveScanTemp2Order;
++(void) guestLogin;
 @end

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 264 - 264
RedAnt ERP Mobile/common/Functions/offline/OLDataProvider.m


+ 8 - 1
RedAnt ERP Mobile/common/Functions/order/CreateOrderViewController.h

@@ -18,7 +18,14 @@
 @property (strong,nonatomic) UIBarButtonItem *btnSubmitOrder;
 
 @property (nonatomic,assign) BOOL resumeOrder;///<恢复订单
-
+///
+@property (nonatomic,strong) NSString* origincontent;
+
+#ifdef SCANNER_ORDER
+@property bool fail_submit;
+@property (nonatomic,strong) NSString* realuser;
+@property (nonatomic,strong) NSString* realpassword;
+#endif
 
 //@property (nonatomic , copy) void (^printPdfCallback)(NSString* url);
 

+ 497 - 115
RedAnt ERP Mobile/common/Functions/order/CreateOrderViewController.m

@@ -322,6 +322,10 @@
         [items addObject:fixedItem];
     }
     
+    
+#ifdef SCANNER_ORDER
+    [items addObject:self.btnSubmitOrder];
+#else
     if (!self.isResume) {
         // 正常情况
         if (appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore) {
@@ -349,6 +353,8 @@
         [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"urgency_userType"];
         [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"urgency_submitOrder"];
     }
+#endif
+    
     
     
     
@@ -405,11 +411,80 @@
     
     
     // Do any additional setup after loading the view.
+    
+    self.origincontent = [RAConvertor dict2string:self.content_data_download];
 }
 - (void)onCommitOrderClick:(id)sender {
+    
+    
+    
+    
     // get customer info
     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
     
+    
+#ifdef SCANNER_ORDER
+    
+    
+    if([appDelegate.user isEqualToString:@"GUEST"]&& self.realuser.length==0)
+    {
+        
+        UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Submit Order" message:@"Please enter your user name and password." preferredStyle:UIAlertControllerStyleAlert];
+        [alertController addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
+            textField.placeholder = @"User";
+//                textField.secureTextEntry = YES;
+        }];
+        [alertController addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
+            textField.placeholder = @"Password";
+            textField.secureTextEntry = YES;
+        }];
+
+        UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
+            UITextField *user = alertController.textFields[0];
+            UITextField *password = alertController.textFields[1];
+            if(user.text.length<=0)
+            {
+                [RAUtils message_alert:@"User can't be empty." title:@"Warring" controller:self];
+                return;
+            }
+            
+            if(password.text.length<=0)
+            {
+                [RAUtils message_alert:@"Password can't be empty." title:@"Warring" controller:self];
+                return;
+            }
+            self.realuser =user.text;
+            self.realpassword =password.text;
+            [self onCommitOrderClick:sender];
+            return;
+            
+//                if (![user.text isEqualToString:@""]) {
+//
+//                    //change password
+//
+//                }
+//                else{
+//                    [self presentViewController:alertController animated:YES completion:nil];
+//                }
+        }];
+        
+        
+        [alertController addAction:okAction];
+        UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
+            NSLog(@"Canelled");
+        }];
+        [alertController addAction:cancelAction];
+        [self presentViewController:alertController animated:YES completion:nil];
+     
+        return;
+    }
+#endif
+    
+    
+    
+    
+    
+    
 //    if (appDelegate.user_type == USER_ROLE_CUSTOMER) {
 //        
 //        // 检查价格类型
@@ -484,12 +559,15 @@
                 return;
             
             // 2018-1-2 Modify
+            
+#ifndef SCANNER_ORDER
             if(appDelegate.user_type == USER_ROLE_CUSTOMER)
             {
                 [self customer_commit_order:upparams];
             }
             else // USER_ROLE_EMPLOYEE
             {
+#endif
                 if([upparams[@"shipping"] isEqualToString:@"Shipping To Be Quoted"]||[upparams[@"shipping"] isEqualToString:@"To Be Quoted"])
                 {
                     upparams[@"shipping"] = nil;
@@ -517,9 +595,9 @@
                     
                     [self presentViewController:alertControl animated:YES completion:nil];
                 }
-                
+#ifndef SCANNER_ORDER
             }
-            
+#endif
             
 
         }
@@ -578,7 +656,67 @@
     demoView.frame = CGRectMake(0, 0, 290, lineLabel.frame.origin.y+lineLabel.frame.size.height+25);
     return demoView;
 }
+-(bool)checkDirty
+{
+    return self.isdirty;
+//    bool dirty = false;
+//    int isection =[self.content_data_download[@"section_count"] intValue];
+//    for(int i = 0;i <isection;i++ )
+//    {
+//        NSDictionary * section = self.content_data_download[[NSString stringWithFormat:@"section_%d",i]];
+//        int iitem =[section[@"count"] intValue];
+//        for(int j = 0;j <iitem;j++ )
+//        {
+//            NSDictionary * item = section[[NSString stringWithFormat:@"item_%d",j]];
+//            if([item[@"dirty"] boolValue])
+//                return true;
+//        }
+//    }
+//    return false;
+}
 - (void)onCloseClick:(UIButton *)sender {
+#ifdef SCANNER_ORDER
+    
+    [self.lastedit endEditing:true];
+    [self.lasttextview endEditing:true];
+    
+    if(![self checkDirty])
+        [self.navigationController popViewControllerAnimated:true];
+    else
+        
+    {
+        
+        UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Close" message:@"Do you want to save your changes?" preferredStyle:UIAlertControllerStyleAlert];
+        
+        
+        UIAlertAction *action_0 = [UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+
+            [self onSaveClick:nil];
+        }];
+        
+        UIAlertAction *action_1 = [UIAlertAction actionWithTitle:@"No" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
+            [self.navigationController popViewControllerAnimated:true];
+            
+        }];
+     
+        UIAlertAction *action_3 = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
+            
+            
+            
+        }];
+        [alertController addAction:action_0];
+        [alertController addAction:action_1];
+        
+        [alertController addAction:action_3];
+        
+        
+        [self presentViewController:alertController animated:YES completion:nil];
+        
+        
+        
+    }
+    return;
+#endif
     
      AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
     if (self.resumeOrder) {
@@ -832,6 +970,210 @@
     [super didReceiveMemoryWarning];
     // Dispose of any resources that can be recreated.
 }
+#ifdef SCANNER_ORDER
+-(void) scanSave:(NSMutableDictionary*) upparams
+{
+    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+        
+        
+    NSString *orderdir = [OLDataProvider getScanPath];
+    NSString* userdir = [OLDataProvider getUserPath];
+    NSString *orderPath = [orderdir stringByAppendingPathComponent:@"order.json"];
+    
+    
+    
+    [RAUtils dicttofile:orderPath dict:self.content_data_download];
+    
+    
+
+    
+    
+    
+    int section_count = [self.content_data_download[@"section_count"] intValue];
+    
+    for(int i=0;i<section_count;i++)
+    {
+        NSMutableDictionary* section = [self.content_data_download[[NSString stringWithFormat:@"section_%d",i]] mutableCopy];
+        NSString* title = section[@"title"];
+//            if([title isEqualToString:@"Model Information"])
+//            {
+//
+//                NSMutableDictionary* cart_section = RASingleton.sharedInstance.scan_cart[@"section_0"];
+//                int cart_count = [cart_section[@"count"] intValue];
+//                for(int j=0;j<cart_count;j++)
+//                {
+//                    NSMutableDictionary* cart_item = [cart_section[[NSString stringWithFormat:@"item_%d",j]] mutableCopy];
+//                    cart_item[@"description"]= [NSString stringWithFormat:@"%@\n%@\n%@",cart_item[@"model"],cart_item[@"description"],cart_item[@"dimension"] ];
+//                    cart_item[@"control"]=@"model";
+//                    section[[NSString stringWithFormat:@"item_%d",j]] = cart_item;
+//
+//                }
+//                section[@"count"] = @(cart_count);
+//                dict[[NSString stringWithFormat:@"section_%d",i]] = section;
+//            }
+//            else
+            if([title isEqualToString:@"Customer"])
+            {
+                // 订单信息会写customer info
+                
+                int scount = [section[@"count"] intValue];
+                for(int j=0;j<scount;j++)
+                {
+                    NSMutableDictionary * item = [section[[NSString stringWithFormat:@"item_%d",j]] mutableCopy];
+                    NSString * name = item[@"name"];
+                    
+                
+                        if(item[@"value"]!=nil )
+                            appDelegate.customerInfo[name]=item[@"value"];
+                
+                
+                }
+                
+//                    NSDictionary* item_0=@{@"control":@"text",@"name":@"customer_cid",@"aname":@"Contact",@"value":appDelegate.contact_id};
+                
+                
+                
+            }
+//                else
+//                    if([title isEqualToString:@"Remarks Content"])
+//                    {
+//
+//                        int scount = [section[@"count"] intValue];
+//                        for(int j=0;j<scount;j++)
+//                        {
+//                            NSMutableDictionary * item = [section[[NSString stringWithFormat:@"item_%d",j]] mutableCopy];
+//                            NSString * name = item[@"name"];
+//
+//
+//                            if([name isEqualToString:@"comments"])
+//                            {
+//                                item[@"value"] = RASingleton.sharedInstance.scan_cart[@"general_note"];
+//                                section[[NSString stringWithFormat:@"item_%d",j]] = item;
+//                            }
+//
+//
+//                        }
+//
+//    //                    NSDictionary* item_0=@{@"control":@"text",@"name":@"customer_cid",@"aname":@"Contact",@"value":appDelegate.contact_id};
+//                        dict[[NSString stringWithFormat:@"section_%d",i]] = section;
+//
+//
+//                    }
+//            else if([title isEqualToString:@"Order Total"])
+//            {
+//
+//                int scount = [section[@"count"] intValue];
+//                for(int j=0;j<scount;j++)
+//                {
+//                    NSMutableDictionary * item = [section[[NSString stringWithFormat:@"item_%d",j]] mutableCopy];
+//                    NSString * name = item[@"name"];
+//
+//
+//                    if([name isEqualToString:@"totalPrice"])
+//                    {
+//                        item[@"value"] = [NSString stringWithFormat:@"%.2f",self.total];
+//                        section[[NSString stringWithFormat:@"item_%d",j]] = item;
+//                    }
+//
+//
+//                }
+//
+//    //                    NSDictionary* item_0=@{@"control":@"text",@"name":@"customer_cid",@"aname":@"Contact",@"value":appDelegate.contact_id};
+//                dict[[NSString stringWithFormat:@"section_%d",i]] = section;
+//
+//
+//
+//            }
+           
+        
+        
+        
+    }
+    
+    
+    
+    NSString *contactpath = [orderdir stringByAppendingPathComponent:@"contact.json"];
+    
+    
+    
+    [RAUtils dicttofile:contactpath dict:appDelegate.customerInfo];
+    
+    
+    NSString *cartpath = [orderdir stringByAppendingPathComponent:@"cart.json"];
+    
+    RASingleton.sharedInstance.scan_cart[@"price_type"] = @(RASingleton.sharedInstance.price_type);
+    
+    [RAUtils dicttofile:cartpath dict:RASingleton.sharedInstance.scan_cart];
+    
+    
+    
+    
+    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];
+            }
+    
+    NSMutableDictionary* orderitem = [NSMutableDictionary new];
+    orderitem[@"create_by"] = appDelegate.user;
+    orderitem[@"price"] = upparams[@"totalPrice"];
+    orderitem[@"customer_name"] = upparams[@"customer_contact"];
+    orderitem[@"purchase_time"] = [RAUtils current_date_time];
+    if(self.fail_submit)
+        orderitem[@"order_status"] = @"Unsubmitted Order";
+    else
+        orderitem[@"order_status"] = @"Saved Order";
+    orderitem[@"order_code"] = appDelegate.order_code;
+    orderitem[@"model_count"] =[ NSString stringWithFormat:@"%@",RASingleton.sharedInstance.scan_cart[@"section_0"][@"count"] ];
+    
+    
+    int count = [orderlist[@"count"] intValue];
+    
+    NSMutableDictionary* newlist  = [NSMutableDictionary new];
+    
+    newlist[@"item_0"]=orderitem;
+    int newcount = 1;
+    for(int i=0;i<count;i++)
+    {
+        NSMutableDictionary* item = orderlist[[NSString stringWithFormat:@"item_%d",i]];
+        if([item[@"order_code"] isEqualToString: appDelegate.order_code ])
+            continue;
+        else
+        {
+            newlist[[NSString stringWithFormat:@"item_%d",newcount]] = item;
+            newcount++;
+        }
+    }
+    newlist[@"count"] = @(newcount);
+    [RAUtils dicttofile:orderlistPath dict:newlist];
+#ifdef RA_NOTIFICATION
+    [ActiveViewController Notify:@"CartViewController,ScanOrderListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+    
+#else
+        
+        AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+        [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
+#endif
+}
+#endif
 - (IBAction)onSaveClick:(id)sender {
 //    id foo = nil;
 //    [[NSMutableArray array] addObject:foo];
@@ -853,100 +1195,14 @@
 //    if(RASingleton.sharedInstance.enable_OfflineOrder)
     {
         
-        NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
+//        NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
 //        NSString *documents = [paths objectAtIndex:0];
-        AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-            
-            
-        NSString *orderdir = [OLDataProvider getScanPath];
-        NSString* userdir = [OLDataProvider getUserPath];
-        NSString *orderPath = [orderdir stringByAppendingPathComponent:@"order.json"];
-        
-        
-        
-        [RAUtils dicttofile:orderPath dict:self.content_data_download];
-        
-        
 
+        [self scanSave:upparams];
         
-        
-        NSString *contactpath = [orderdir stringByAppendingPathComponent:@"contact.json"];
-        
-        
-        
-        [RAUtils dicttofile:contactpath dict:appDelegate.customerInfo];
-        
-        
-        NSString *cartpath = [orderdir stringByAppendingPathComponent:@"cart.json"];
-        
-        RASingleton.sharedInstance.scan_cart[@"price_type"] = @(RASingleton.sharedInstance.price_type);
-        
-        [RAUtils dicttofile:cartpath dict:RASingleton.sharedInstance.scan_cart];
-        
-        
-        
-        
-        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];
-                }
-        
-        NSMutableDictionary* orderitem = [NSMutableDictionary new];
-        orderitem[@"create_by"] = appDelegate.user;
-        orderitem[@"price"] = upparams[@"totalPrice"];
-        orderitem[@"customer_name"] = upparams[@"customer_contact"];
-        orderitem[@"purchase_time"] = [RAUtils current_date_time];
-        orderitem[@"order_status"] = @"Saved Order";
-        orderitem[@"order_code"] = appDelegate.order_code;
-        orderitem[@"model_count"] =[ NSString stringWithFormat:@"%@",RASingleton.sharedInstance.scan_cart[@"section_0"][@"count"] ];
-        
-        
-        int count = [orderlist[@"count"] intValue];
-        
-        NSMutableDictionary* newlist  = [NSMutableDictionary new];
-        
-        newlist[@"item_0"]=orderitem;
-        int newcount = 1;
-        for(int i=0;i<count;i++)
-        {
-            NSMutableDictionary* item = orderlist[[NSString stringWithFormat:@"item_%d",i]];
-            if([item[@"order_code"] isEqualToString: appDelegate.order_code ])
-                continue;
-            else
-            {
-                newlist[[NSString stringWithFormat:@"item_%d",newcount]] = item;
-                newcount++;
-            }
-        }
-        newlist[@"count"] = @(newcount);
-        [RAUtils dicttofile:orderlistPath dict:newlist];
-#ifdef RA_NOTIFICATION
-        [ActiveViewController Notify:@"CartViewController,ScanOrderListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
-        
-#else
-            
-            AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-            [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
-#endif
+        [RAUtils message_alert:@"Save Successful" title:@"Message" controller:self action_handler:^(UIAlertAction * _Nonnull action) {
+            [self.navigationController popViewControllerAnimated:true];
+        } completion:nil];
         return;
     }
 #endif
@@ -2689,6 +2945,7 @@
     }
 
     
+    upparams[@"price_type"] = @(RASingleton.sharedInstance.price_type);
     return upparams;
     
 }
@@ -2702,10 +2959,50 @@
     {
         
         
+        AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+        
+//        if([appDelegate.user isEqualToString:@"GUEST"])
+//        {
+//
+//            UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Submit Order" message:@"Please enter your user name and password." preferredStyle:UIAlertControllerStyleAlert];
+//            [alertController addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
+//                textField.placeholder = @"User";
+////                textField.secureTextEntry = YES;
+//            }];
+//            [alertController addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
+//                textField.placeholder = @"Password";
+//                textField.secureTextEntry = YES;
+//            }];
+//
+//            UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
+//                UITextField *user = alertController.textFields[0];
+//                UITextField *password = alertController.textFields[1];
+////                if (![user.text isEqualToString:@""]) {
+////
+////                    //change password
+////
+////                }
+////                else{
+////                    [self presentViewController:alertController animated:YES completion:nil];
+////                }
+//            }];
+//
+//
+//            [alertController addAction:okAction];
+//            UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
+//                NSLog(@"Canelled");
+//            }];
+//            [alertController addAction:cancelAction];
+//            [self presentViewController:alertController animated:YES completion:nil];
+//
+//
+//
+//        }
+//
         
         NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
         NSString *documents = [paths objectAtIndex:0];
-        AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+        
             
             
         NSString *orderdir = [OLDataProvider getScanPath];
@@ -2789,6 +3086,7 @@
         NSString * parampath= [orderdir stringByAppendingPathComponent:@"param.json"];
         
         NSDictionary* param=[self convertScanOrder:self.content_data_download];
+        
         [RAUtils dicttofile:parampath dict:param];
         
         NSString *contactpath = [orderdir stringByAppendingPathComponent:@"contact.json"];
@@ -2844,34 +3142,118 @@
 
         
         NSString *md5 = [RAUtils md5WithFile:zippath];
-        [self addTasks:filepath md5:md5];
-        
         
-        [OLDataProvider save2submitScanOrder];
         
-        [appDelegate closeOrder];
-        RASingleton.sharedInstance.scan_cart = nil;
         
-        #ifdef RA_NOTIFICATION
-                            [ActiveViewController Notify:@"CartViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
-        #else
-                            MainViewController* main_vc=(MainViewController*)appDelegate.main_vc;
-                            [main_vc reloadCart:true immediately:false];
-        #endif
-        
-//
+        {
+            //括号内为单个文件上传
+            NSString *fileName = [zippath lastPathComponent];
+            NSData * file_data= [NSData dataWithContentsOfFile:zippath];
+            
+            
+            NSString* realuser;
+            NSString* realpassword;
+            
+            if(self.realuser.length>0)
+            {
+                realuser = self.realuser;
+                realpassword = self.realpassword;
+            }
+            else
+            {
+                realuser = appDelegate.user;
+                realpassword = appDelegate.password;
+            }
+            NSDictionary* params = @{
+//                @"site_name":[RADataProvider getSiteName],
+                @"user":realuser,
+                @"_method":@"uploadOfflineOrder",
+                @"password" : realpassword,
+                @"md5":md5
+                                     };
+                    [RANetwork request_fastupload:[params mutableCopy] filename:fileName data:file_data url:appDelegate.uploadurl completionHandler:^(NSMutableDictionary *result) {
+                                int iresult = [result[@"result"] intValue];
+                        if(iresult == RESULT_TRUE)
+                        {
+                            [self scanSave:upparams];
+                            [OLDataProvider save2submitScanOrder];
+                            [appDelegate closeOrder];
+                            RASingleton.sharedInstance.scan_cart = nil;
+                            
+                            #ifdef RA_NOTIFICATION
+                                                [ActiveViewController Notify:@"CartViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+                            #else
+                                                MainViewController* main_vc=(MainViewController*)appDelegate.main_vc;
+                                                [main_vc reloadCart:true immediately:false];
+                            #endif
+                            
+                    //
 
+                            
+                            [self prepareReturn:nil];
+                            
+                            
+                            
+                            [self.navigationController popViewControllerAnimated:true];
+                            [((MainViewController*)appDelegate.main_vc) switchToOrder];
+                    //        NSMutableDictionary* ret = [[NSMutableDictionary alloc] init];
+                    //        ret[@"result"]=@2;
+                    //        ret[@"file"]=zippath;
+                    //        result(ret);
+                            return;
+                        }
+                        else if(iresult==1)
+                        {
+                            self.fail_submit = true;
+                            self.realuser = nil;
+                            self.realpassword = nil;
+                            [RAUtils message_alert:@"Can not submit the order, wrong password" title:@"Submit Order" controller:self];
+                            
+                            
+                            
+                        }
+                        else
+                        {
+                            self.fail_submit = true;
+                            [RAUtils message_alert:@"Can not submit the order, please check your network" title:@"Submit Order" controller:self];
+                            
+                            
+                            
+                        }
+                    }];
+        }
         
-        [self prepareReturn:nil];
-        
+//        [self addTasks:filepath md5:md5];
         
+
+      
         
-        [self.navigationController popViewControllerAnimated:true];
-        [((MainViewController*)appDelegate.main_vc) switchToOrder];
-//        NSMutableDictionary* ret = [[NSMutableDictionary alloc] init];
-//        ret[@"result"]=@2;
-//        ret[@"file"]=zippath;
-//        result(ret);
+//
+//        [OLDataProvider save2submitScanOrder];
+//
+//        [appDelegate closeOrder];
+//        RASingleton.sharedInstance.scan_cart = nil;
+//
+//        #ifdef RA_NOTIFICATION
+//                            [ActiveViewController Notify:@"CartViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+//        #else
+//                            MainViewController* main_vc=(MainViewController*)appDelegate.main_vc;
+//                            [main_vc reloadCart:true immediately:false];
+//        #endif
+//
+////
+//
+//
+//        [self prepareReturn:nil];
+//
+//
+//
+//        [self.navigationController popViewControllerAnimated:true];
+//        [((MainViewController*)appDelegate.main_vc) switchToOrder];
+////        NSMutableDictionary* ret = [[NSMutableDictionary alloc] init];
+////        ret[@"result"]=@2;
+////        ret[@"file"]=zippath;
+////        result(ret);
         return;
     }
     

+ 3 - 2
RedAnt ERP Mobile/common/Functions/sidemenu/AboutViewController.m

@@ -19,7 +19,7 @@
 - (void)viewDidLoad {
     [super viewDidLoad];
     
-      self.edgesForExtendedLayout = UIRectEdgeNone;
+//      self.edgesForExtendedLayout = UIRectEdgeNone;
     
     // Do any additional setup after loading the view.
     
@@ -29,7 +29,8 @@
                                                                    action:@selector( onCloseClick:)];
     self.navigationItem.rightBarButtonItem = closeButton;
     
-    
+//    self.navigationController.navigationBar.barTintColor = UIColor.blackColor;
+//    self.navigationController.navigationBar.backgroundColor = UIColor.whiteColor;
     NSDictionary* infoDict =[[NSBundle mainBundle] infoDictionary];
     NSString* build =[infoDict objectForKey:@"CFBundleVersion"];
     NSString* version =[infoDict objectForKey:@"CFBundleShortVersionString"];

+ 1 - 0
RedAnt ERP Mobile/common/Functions/signature/SignatureView.m

@@ -8,6 +8,7 @@
 
 #import "SignatureView.h"
 #import <OpenGLES/ES2/glext.h>
+
 //
 //@interface SignatureView ()
 //

+ 1 - 0
RedAnt ERP Mobile/common/data_provider/RADataProvider.h

@@ -20,6 +20,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 +(void)request_scansearch:(long ) offset limit :(long)limit keywords :(NSString*) keywords completionHandler:(resultHandler)result;
 +(void)request_scan_server:(resultHandler)result;
++(void)request_scan_news:(resultHandler)result;
 +(void)request_sign_up:user email:(NSString*)email password:(NSString*) pwd completionHandler:(resultHandler)result;
 +(void)request_validate_scan_server:(NSString*)url name:(NSString*)name password:(NSString*)password completionHandler:(resultHandler)result;
 +(NSString*)getSiteName;

+ 8 - 0
RedAnt ERP Mobile/common/data_provider/RADataProvider.m

@@ -10,6 +10,14 @@
 
 @implementation RADataProvider
 
++(void) request_scan_news:(resultHandler)result
+{
+    
+    NSMutableDictionary* param = [NSMutableDictionary new];
+    param[@"_method"]=@"offlineNews";
+    [self request_interface:URL_SCAN_NEWS parameters:param err_record_url:nil completionHandler:result retry:0];
+}
+
 +(void) request_scan_server :(resultHandler)result
 {
     

+ 4 - 0
RedAnt ERP Mobile/common/data_provider/RANetwork.h

@@ -273,4 +273,8 @@ extern NSString *const ScreenCodeOfflineSync;
 +(void) request_download_offline:(NSString* )vid completionHandler:(resultHandler)result;
 + (void)request_fastupload:(NSMutableDictionary *)params filename:(NSString*)filename data:(NSData*) data url:(NSString *)url completionHandler:(resultHandler)result;
 +(void)request_err_log:(NSString*) up_params result:(NSString*)result_str module:(NSString*) module code:(int) code completionHandler:(resultHandler)result;
+
+
+
++(int)parse_logininfo : (NSMutableDictionary *) jsobj user:(NSString*) user password:(NSString*) password;
 @end

+ 30 - 7
RedAnt ERP Mobile/common/data_provider/RANetwork.m

@@ -5342,27 +5342,45 @@ NSString *const ScreenCodeOfflineSync = @"Offline Sync Screen";
     }
     
     NSString* url;
+    bool scan_guest = false;
 #ifdef SCANNER_ORDER
     params[@"site_name"]=[RADataProvider getSiteName];
     params[@"_method"]=@"login";
     url = [appDelegate.address stringByAppendingPathComponent:URL_UPDATE_AUTH];
-    
+    if([user.uppercaseString isEqualToString:@"GUEST"]&&[password.uppercaseString isEqualToString:@"GUEST"])
+        scan_guest = true;
 #else
     url = URL_UPDATE_AUTH;
 #endif
-    [self request_interface:url parameters:params err_record_url:nil completionHandler:^(NSMutableDictionary *chresult) {
-        int ret = [self parse_logininfo:chresult user:user password:password] ;
+    if(scan_guest)
+    {
+        [OLDataProvider guestLogin];
+//        int ret = [self parse_logininfo:chresult user:user password:password] ;
         
         
         NSMutableDictionary * retjson = [NSMutableDictionary new];
         
-        retjson[@"result"]= [NSNumber numberWithInt:ret];
+        retjson[@"result"]= [NSNumber numberWithInt:RESULT_TRUE];
         
         result(retjson);
+    }
+    else
+    {
+        [self request_interface:url parameters:params err_record_url:nil completionHandler:^(NSMutableDictionary *chresult) {
+            int ret = [self parse_logininfo:chresult user:user password:password] ;
+            
+            
+            NSMutableDictionary * retjson = [NSMutableDictionary new];
+            
+            retjson[@"result"]= [NSNumber numberWithInt:ret];
+            
+            result(retjson);
+            
+            
+        } retry:0];
         
-        
-    } retry:0];
-    
+    }
+
     
     //
     //    NSData* json= nil;
@@ -8976,6 +8994,7 @@ NSString *const ScreenCodeOfflineSync = @"Offline Sync Screen";
         RASingleton.sharedInstance.scan_cart[@"section_0"] = section;
         [OLDataProvider saveScanCart:RASingleton.sharedInstance.scan_cart];
         result(RASingleton.sharedInstance.scan_cart);
+//        [OLDataProvider updateScanOrder:appDelegate.order_code orderitem:nil];
         return;
     }
 #endif
@@ -11237,6 +11256,10 @@ NSString *const ScreenCodeOfflineSync = @"Offline Sync Screen";
     
 //    [self request_file_fast:url parameters:params completionHandler:result];
     
+#ifdef SCANNER_ORDER
+    params[@"site_name"]=[RADataProvider getSiteName];
+#endif
+    
     [self request_upload_fast:data FileName:filename server:url parameters:params completionHandler:result];
 }
 

+ 1 - 7
RedAnt ERP Mobile/iSales-CONTRAST.xcodeproj/project.pbxproj

@@ -64,7 +64,6 @@
 		3C7E5A8E237BDB0C006D0105 /* PortfolioListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C7E5A8C237BDB0C006D0105 /* PortfolioListViewController.m */; };
 		3C872A232797F1C800BE1FC8 /* OLOSettingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C872A202797F1C800BE1FC8 /* OLOSettingViewController.m */; };
 		3C872A242797F1C800BE1FC8 /* scan_cart.json in Resources */ = {isa = PBXBuildFile; fileRef = 3C872A212797F1C800BE1FC8 /* scan_cart.json */; };
-		3C88559727E1D233005DC3FA /* RANetworkTaskDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C88558F27E1D233005DC3FA /* RANetworkTaskDelegate.m */; };
 		3C88559827E1D233005DC3FA /* RAUploadOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C88559027E1D233005DC3FA /* RAUploadOperation.m */; };
 		3C88559927E1D233005DC3FA /* RAUploadListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C88559227E1D233005DC3FA /* RAUploadListViewController.m */; };
 		3C88559A27E1D233005DC3FA /* RAUploadManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C88559527E1D233005DC3FA /* RAUploadManager.m */; };
@@ -409,11 +408,9 @@
 		3C872A202797F1C800BE1FC8 /* OLOSettingViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OLOSettingViewController.m; path = common/Functions/OLO/OLOSettingViewController.m; sourceTree = SOURCE_ROOT; };
 		3C872A212797F1C800BE1FC8 /* scan_cart.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = scan_cart.json; path = common/Functions/OLO/scan_cart.json; sourceTree = SOURCE_ROOT; };
 		3C872A222797F1C800BE1FC8 /* OLOSettingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OLOSettingViewController.h; path = common/Functions/OLO/OLOSettingViewController.h; sourceTree = SOURCE_ROOT; };
-		3C88558F27E1D233005DC3FA /* RANetworkTaskDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RANetworkTaskDelegate.m; sourceTree = "<group>"; };
 		3C88559027E1D233005DC3FA /* RAUploadOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RAUploadOperation.m; sourceTree = "<group>"; };
 		3C88559127E1D233005DC3FA /* RAUploadManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RAUploadManager.h; sourceTree = "<group>"; };
 		3C88559227E1D233005DC3FA /* RAUploadListViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RAUploadListViewController.m; sourceTree = "<group>"; };
-		3C88559327E1D233005DC3FA /* RANetworkTaskDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RANetworkTaskDelegate.h; sourceTree = "<group>"; };
 		3C88559427E1D233005DC3FA /* RAUploadOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RAUploadOperation.h; sourceTree = "<group>"; };
 		3C88559527E1D233005DC3FA /* RAUploadManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RAUploadManager.m; sourceTree = "<group>"; };
 		3C88559627E1D233005DC3FA /* RAUploadListViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RAUploadListViewController.h; sourceTree = "<group>"; };
@@ -983,11 +980,9 @@
 		3C88558E27E1D233005DC3FA /* upload */ = {
 			isa = PBXGroup;
 			children = (
-				3C88558F27E1D233005DC3FA /* RANetworkTaskDelegate.m */,
 				3C88559027E1D233005DC3FA /* RAUploadOperation.m */,
 				3C88559127E1D233005DC3FA /* RAUploadManager.h */,
 				3C88559227E1D233005DC3FA /* RAUploadListViewController.m */,
-				3C88559327E1D233005DC3FA /* RANetworkTaskDelegate.h */,
 				3C88559427E1D233005DC3FA /* RAUploadOperation.h */,
 				3C88559527E1D233005DC3FA /* RAUploadManager.m */,
 				3C88559627E1D233005DC3FA /* RAUploadListViewController.h */,
@@ -2104,7 +2099,7 @@
 		713F769E1929F4A7006A7305 /* Project object */ = {
 			isa = PBXProject;
 			attributes = {
-				LastUpgradeCheck = 1200;
+				LastUpgradeCheck = 1330;
 				ORGANIZATIONNAME = "United Software Applications, Inc";
 				TargetAttributes = {
 					713F76A51929F4A7006A7305 = {
@@ -2413,7 +2408,6 @@
 				7162A5C51C5873BB00AB630E /* SearchViewController.m in Sources */,
 				7162A5191C58704600AB630E /* EditModelPriceViewController.m in Sources */,
 				3C514969273D0B1E00F78617 /* RADataProvider.m in Sources */,
-				3C88559727E1D233005DC3FA /* RANetworkTaskDelegate.m in Sources */,
 				7162A5721C58728D00AB630E /* DetailKVCell.m in Sources */,
 				7141DD501C57459B00F7DF59 /* QRCodeGenerator.m in Sources */,
 				3C8855A127E1D2FA005DC3FA /* UploadCell.m in Sources */,

+ 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>6</integer>
+			<integer>1</integer>
 		</dict>
 		<key>iSales-USAI.xcscheme_^#shared#^_</key>
 		<dict>

+ 1 - 7
RedAnt ERP Mobile/iSales-NPD.xcodeproj/project.pbxproj

@@ -9,7 +9,6 @@
 /* Begin PBXBuildFile section */
 		3C2F99BB237BE1880000808F /* PortfolioListTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C2F99BA237BE1880000808F /* PortfolioListTableViewCell.m */; };
 		3C2F99BF237BE7190000808F /* NPD_Mobile.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3C2F99BE237BE7190000808F /* NPD_Mobile.storyboard */; };
-		3C3E26AF27CDF83300EF6F5C /* RANetworkTaskDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C3E26A727CDF83300EF6F5C /* RANetworkTaskDelegate.m */; };
 		3C3E26B027CDF83300EF6F5C /* RAUploadOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C3E26A827CDF83300EF6F5C /* RAUploadOperation.m */; };
 		3C3E26B127CDF83300EF6F5C /* RAUploadListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C3E26AA27CDF83300EF6F5C /* RAUploadListViewController.m */; };
 		3C3E26B227CDF83300EF6F5C /* RAUploadManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C3E26AD27CDF83300EF6F5C /* RAUploadManager.m */; };
@@ -319,11 +318,9 @@
 		3C2F99B9237BE1880000808F /* PortfolioListTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PortfolioListTableViewCell.h; path = common/Functions/portfolio/PortfolioListTableViewCell.h; sourceTree = SOURCE_ROOT; };
 		3C2F99BA237BE1880000808F /* PortfolioListTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PortfolioListTableViewCell.m; path = common/Functions/portfolio/PortfolioListTableViewCell.m; sourceTree = SOURCE_ROOT; };
 		3C2F99BE237BE7190000808F /* NPD_Mobile.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = NPD_Mobile.storyboard; sourceTree = "<group>"; };
-		3C3E26A727CDF83300EF6F5C /* RANetworkTaskDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RANetworkTaskDelegate.m; sourceTree = "<group>"; };
 		3C3E26A827CDF83300EF6F5C /* RAUploadOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RAUploadOperation.m; sourceTree = "<group>"; };
 		3C3E26A927CDF83300EF6F5C /* RAUploadManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RAUploadManager.h; sourceTree = "<group>"; };
 		3C3E26AA27CDF83300EF6F5C /* RAUploadListViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RAUploadListViewController.m; sourceTree = "<group>"; };
-		3C3E26AB27CDF83300EF6F5C /* RANetworkTaskDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RANetworkTaskDelegate.h; sourceTree = "<group>"; };
 		3C3E26AC27CDF83300EF6F5C /* RAUploadOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RAUploadOperation.h; sourceTree = "<group>"; };
 		3C3E26AD27CDF83300EF6F5C /* RAUploadManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RAUploadManager.m; sourceTree = "<group>"; };
 		3C3E26AE27CDF83300EF6F5C /* RAUploadListViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RAUploadListViewController.h; sourceTree = "<group>"; };
@@ -906,11 +903,9 @@
 		3C3E26A627CDF83300EF6F5C /* upload */ = {
 			isa = PBXGroup;
 			children = (
-				3C3E26A727CDF83300EF6F5C /* RANetworkTaskDelegate.m */,
 				3C3E26A827CDF83300EF6F5C /* RAUploadOperation.m */,
 				3C3E26A927CDF83300EF6F5C /* RAUploadManager.h */,
 				3C3E26AA27CDF83300EF6F5C /* RAUploadListViewController.m */,
-				3C3E26AB27CDF83300EF6F5C /* RANetworkTaskDelegate.h */,
 				3C3E26AC27CDF83300EF6F5C /* RAUploadOperation.h */,
 				3C3E26AD27CDF83300EF6F5C /* RAUploadManager.m */,
 				3C3E26AE27CDF83300EF6F5C /* RAUploadListViewController.h */,
@@ -2092,7 +2087,7 @@
 		713F769E1929F4A7006A7305 /* Project object */ = {
 			isa = PBXProject;
 			attributes = {
-				LastUpgradeCheck = 1200;
+				LastUpgradeCheck = 1330;
 				ORGANIZATIONNAME = "United Software Applications, Inc";
 				TargetAttributes = {
 					713F76A51929F4A7006A7305 = {
@@ -2401,7 +2396,6 @@
 				7162A5441C58719D00AB630E /* RATreeNodeInfo+Private.m in Sources */,
 				7162A5C51C5873BB00AB630E /* SearchViewController.m in Sources */,
 				7162A5191C58704600AB630E /* EditModelPriceViewController.m in Sources */,
-				3C3E26AF27CDF83300EF6F5C /* RANetworkTaskDelegate.m in Sources */,
 				7162A5721C58728D00AB630E /* DetailKVCell.m in Sources */,
 				7141DD501C57459B00F7DF59 /* QRCodeGenerator.m in Sources */,
 				715671331E10A0EF006324A0 /* RectDrawable.m in Sources */,

+ 9 - 9
RedAnt ERP Mobile/iSales-NPD/Base.lproj/OLM.storyboard

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="19529" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
     <device id="ipad9_7" orientation="portrait" layout="fullscreen" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19519"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -301,7 +301,7 @@
                                                     <rect key="frame" x="10" y="32" width="21" height="21"/>
                                                     <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                                     <state key="normal" image="button:hrK-DY-RbO:image"/>
-                                                    <state key="selected" image="05B5B60E-FDE8-4B10-A481-0D2903452EF1"/>
+                                                    <state key="selected" image="DAA6F769-E374-4FCC-973F-6915ACB9C2E4"/>
                                                     <connections>
                                                         <action selector="checkButtonClick:" destination="XXr-fU-67o" eventType="touchUpInside" id="KeU-ld-H4J"/>
                                                     </connections>
@@ -879,19 +879,19 @@
                                 <nil key="textColor"/>
                                 <nil key="highlightedColor"/>
                             </label>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Upload Setting" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zhm-2h-vLW">
+                            <label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Upload Setting" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zhm-2h-vLW">
                                 <rect key="frame" x="30" y="297" width="128.5" height="21"/>
                                 <fontDescription key="fontDescription" type="boldSystem" pointSize="18"/>
                                 <nil key="textColor"/>
                                 <nil key="highlightedColor"/>
                             </label>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Max Retry Count" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ao6-r1-uXr">
+                            <label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Max Retry Count" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ao6-r1-uXr">
                                 <rect key="frame" x="30" y="338" width="127.5" height="20.5"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                 <nil key="textColor"/>
                                 <nil key="highlightedColor"/>
                             </label>
-                            <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Rj3-QR-Agk">
+                            <textField hidden="YES" opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Rj3-QR-Agk">
                                 <rect key="frame" x="688" y="331.5" width="50" height="34"/>
                                 <constraints>
                                     <constraint firstAttribute="width" constant="50" id="vR6-EP-Mmm"/>
@@ -902,13 +902,13 @@
                                     <action selector="onRetryChange:" destination="4E6-80-nis" eventType="editingChanged" id="tsc-b4-Uot"/>
                                 </connections>
                             </textField>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Retry Wait TimeInterval" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bt3-RG-tEN">
+                            <label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Retry Wait TimeInterval" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bt3-RG-tEN">
                                 <rect key="frame" x="30" y="378.5" width="177" height="20.5"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                 <nil key="textColor"/>
                                 <nil key="highlightedColor"/>
                             </label>
-                            <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="yzC-7l-hc0">
+                            <textField hidden="YES" opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="yzC-7l-hc0">
                                 <rect key="frame" x="688" y="372" width="50" height="34"/>
                                 <constraints>
                                     <constraint firstAttribute="width" constant="50" id="XIG-Hs-C1i"/>
@@ -1090,7 +1090,7 @@
         </scene>
     </scenes>
     <resources>
-        <image name="05B5B60E-FDE8-4B10-A481-0D2903452EF1" width="24" height="24">
+        <image name="DAA6F769-E374-4FCC-973F-6915ACB9C2E4" width="24" height="24">
             <mutableData key="keyedArchiveRepresentation">
 YnBsaXN0MDDUAQIDBAUGBwpYJHZlcnNpb25ZJGFyY2hpdmVyVCR0b3BYJG9iamVjdHMSAAGGoF8QD05T
 S2V5ZWRBcmNoaXZlctEICVRyb290gAGuCwwZGh8UJCkqMTQ3PUBVJG51bGzWDQ4PEBESExQVFhcYVk5T

+ 1 - 7
RedAnt ERP Mobile/iSales-USAI.xcodeproj/project.pbxproj

@@ -38,7 +38,6 @@
 		3C514994273E091500F78617 /* VideoPreviewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C51498E273E091500F78617 /* VideoPreviewCell.m */; };
 		3C514995273E091500F78617 /* PhotoPreviewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C514990273E091500F78617 /* PhotoPreviewCell.m */; };
 		3C514999273E097C00F78617 /* RAProgressHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C514998273E097B00F78617 /* RAProgressHUD.m */; };
-		3C51E7CA27B261EC00E61163 /* RANetworkTaskDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C51E7C227B261EC00E61163 /* RANetworkTaskDelegate.m */; };
 		3C51E7CB27B261EC00E61163 /* RAUploadOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C51E7C327B261EC00E61163 /* RAUploadOperation.m */; };
 		3C51E7CC27B261EC00E61163 /* RAUploadListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C51E7C527B261EC00E61163 /* RAUploadListViewController.m */; };
 		3C51E7CD27B261EC00E61163 /* RAUploadManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C51E7C827B261EC00E61163 /* RAUploadManager.m */; };
@@ -380,11 +379,9 @@
 		3C514997273E097B00F78617 /* RAProgressHUD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RAProgressHUD.h; sourceTree = "<group>"; };
 		3C514998273E097B00F78617 /* RAProgressHUD.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RAProgressHUD.m; sourceTree = "<group>"; };
 		3C51499A273E0B6400F78617 /* common_const.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = common_const.h; path = ../../common/common_const.h; sourceTree = "<group>"; };
-		3C51E7C227B261EC00E61163 /* RANetworkTaskDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RANetworkTaskDelegate.m; sourceTree = "<group>"; };
 		3C51E7C327B261EC00E61163 /* RAUploadOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RAUploadOperation.m; sourceTree = "<group>"; };
 		3C51E7C427B261EC00E61163 /* RAUploadManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RAUploadManager.h; sourceTree = "<group>"; };
 		3C51E7C527B261EC00E61163 /* RAUploadListViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RAUploadListViewController.m; sourceTree = "<group>"; };
-		3C51E7C627B261EC00E61163 /* RANetworkTaskDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RANetworkTaskDelegate.h; sourceTree = "<group>"; };
 		3C51E7C727B261EC00E61163 /* RAUploadOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RAUploadOperation.h; sourceTree = "<group>"; };
 		3C51E7C827B261EC00E61163 /* RAUploadManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RAUploadManager.m; sourceTree = "<group>"; };
 		3C51E7C927B261EC00E61163 /* RAUploadListViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RAUploadListViewController.h; sourceTree = "<group>"; };
@@ -977,11 +974,9 @@
 		3C51E7C127B261EC00E61163 /* upload */ = {
 			isa = PBXGroup;
 			children = (
-				3C51E7C227B261EC00E61163 /* RANetworkTaskDelegate.m */,
 				3C51E7C327B261EC00E61163 /* RAUploadOperation.m */,
 				3C51E7C427B261EC00E61163 /* RAUploadManager.h */,
 				3C51E7C527B261EC00E61163 /* RAUploadListViewController.m */,
-				3C51E7C627B261EC00E61163 /* RANetworkTaskDelegate.h */,
 				3C51E7C727B261EC00E61163 /* RAUploadOperation.h */,
 				3C51E7C827B261EC00E61163 /* RAUploadManager.m */,
 				3C51E7C927B261EC00E61163 /* RAUploadListViewController.h */,
@@ -2102,7 +2097,7 @@
 		713F769E1929F4A7006A7305 /* Project object */ = {
 			isa = PBXProject;
 			attributes = {
-				LastUpgradeCheck = 1200;
+				LastUpgradeCheck = 1330;
 				ORGANIZATIONNAME = "United Software Applications, Inc";
 				TargetAttributes = {
 					713F76A51929F4A7006A7305 = {
@@ -2404,7 +2399,6 @@
 				713F76B61929F4A7006A7305 /* main.m in Sources */,
 				71BF06FE1D2F3CBA00981938 /* OfflineSettingViewController.m in Sources */,
 				71DF74341C5757DA00F2789C /* ActiveViewController.m in Sources */,
-				3C51E7CA27B261EC00E61163 /* RANetworkTaskDelegate.m in Sources */,
 				7162A5431C58719D00AB630E /* RATreeNodeInfo.m in Sources */,
 				3C51494B273D095900F78617 /* CommonEditorCellLabel.m in Sources */,
 				71FFBBE91C60894900D91DC2 /* iSalesDB.m in Sources */,

+ 18 - 7
RedAnt ERP Mobile/iSales-USAI/config.h

@@ -31,12 +31,12 @@
 #define OFFLINE_MODE
 // 离线订单开关
 //#define SCANNER_ORDER
-#ifdef SCANNER_ORDER
-//#define  URL_SO_CONTACT  @"abc"
-#define URL_SO_NEW_CONTACT @"offline_order_new_contact"
-#define URL_SO_ORDER @"scan_order"
-#define URL_SO_CART @"scan_cart"
-#endif
+//#ifdef SCANNER_ORDER
+////#define  URL_SO_CONTACT  @"abc"
+//#define URL_SO_NEW_CONTACT @"offline_order_new_contact"
+//#define URL_SO_ORDER @"scan_order"
+//#define URL_SO_CART @"scan_cart"
+//#endif
 //google analytics 开关
 //#define GOOGLE_ANALYTICS
 //pdf 调试开关
@@ -61,7 +61,11 @@
 // http://192.168.0.133:8080/site
 // http://12.196.120.217
 #ifdef test_server
-
+#define  URL_DELETE_ACCOUNT @""
+#define  URL_SERVER_LIST @""
+#define  URL_SERVER_CHECK @""
+#define  URL_CHANGE_PASSWORD @""
+#define URL_SIGN_UP @""
 //------------------- chen server-----------------------
 #define  URL_BACK_ORDER_PREVIEW  @"http://12.196.120.217/isales/cartDeliveryBackOrderReview.htm"
 #define  URL_MOVE_TO_BACK_ORDER @"http://12.196.120.217/isales/moveToBackOrder.htm"
@@ -201,6 +205,13 @@
 
 
 //------------------- NPD server-----------------------
+
+#define  URL_DELETE_ACCOUNT @""
+#define  URL_SERVER_LIST @""
+#define  URL_SERVER_CHECK @""
+#define  URL_CHANGE_PASSWORD @""
+#define URL_SIGN_UP @""
+
 #define  URL_UPDATE_AUTH  @"https://central.united-us.com/usai_demo/shopping/isales/login.htm"
 #define  URL_LOGOUT  @"https://central.united-us.com/usai_demo/shopping/isales/loginOut.htm"
 #define  URL_RETRIEVE_PASS  @"https://central.united-us.com/usai_demo/shopping/isales/forgotPassword.htm"

+ 1 - 0
common/NetworkUtils.m

@@ -1291,6 +1291,7 @@ repeat:
         }
         else
         {
+     
             NSMutableDictionary* dict =[[RAConvertor data2dict:responseData] mutableCopy];
             if([dict[@"result"] intValue]==RESULT_USERAUTH_ERROR)
             {

+ 3 - 0
common/customUI/commoneditor/CommonEditorViewController.h

@@ -102,6 +102,7 @@
 -(NSMutableDictionary*) fill_enum_subitem:(NSMutableDictionary *) enum_item subid:(NSArray*) subid source:(NSMutableDictionary*)source mapping:(NSDictionary*)mapping;
 //-(void) refresh1:(NSString*) trigger;
 -(void) refresh:(NSString*) trigger discardDirty:(bool) discardDirty;
+
 -(void) handle_action_return:(NSMutableDictionary *)value indexPath :(NSIndexPath*) indexPath action:(int) action_code;
 
 // Urgency
@@ -131,4 +132,6 @@
 #pragma mark 为子类暴露的接口
 -(void) handle_editor_cell_select:(UITableView *)tableView IndexPath:(NSIndexPath *)indexPath;
 
+
+@property bool isdirty;
 @end

+ 21 - 3
common/customUI/commoneditor/CommonEditorViewController.m

@@ -2548,8 +2548,15 @@ if(!self.alert.isBeingDismissed)
     
     NSString* subid=[item_json valueForKey:@"subid"];
     NSString* refresh_trigger = [item_json valueForKey:@"name"];
-    
-    [item_json setValue:@"true" forKey:@"dirty"];
+    NSString* item_value = item_json[@"value"];
+    if(item_value.length==0)
+        item_value = @"";
+    if(![val isEqualToString:item_value])
+    {
+        //值不相同才设置dirty
+        [item_json setValue:@"true" forKey:@"dirty"];
+        self.isdirty = true;
+    }
     [item_json setValue:val forKey:@"value"];
     if([[item_json valueForKey:@"keyboard"] isEqualToString:@"number"])
     {
@@ -5749,7 +5756,18 @@ if(!self.alert.isBeingDismissed)
     NSString* subid=[item_json valueForKey:@"subid"];
     
     
-    [item_json setValue:@"true" forKey:@"dirty"];
+    NSString* item_value = item_json[@"value"];
+    if(item_value.length==0)
+        item_value = @"";
+    if(![textView.text isEqualToString:item_value])
+    {
+        //值不相同才设置dirty
+        [item_json setValue:@"true" forKey:@"dirty"];
+        self.isdirty = true;
+    }
+    
+    
+//    [item_json setValue:@"true" forKey:@"dirty"];
     [item_json setValue:textView.text forKey:@"value"];
     
     

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä