瀏覽代碼

扫码功能增加自动扫码开关和逻辑 -- Scan code function adds automatic code scan switch and logic(resolve: #14869)
修复Scan Order 的 place order 界面退出购物车没有切换到购物车 --The place order interface of Scan Order exits the shopping cart and does not switch to the shopping cart(resolve: #14868)
增加扫码结果处理机制 -- Add scanning result processing mechanism(resolve: #14865)
修复扫码下单扫到格式不对的二维码,会在购物车添加一条空白行的bug-- fix scan module scan a incorrect qr code will add an empty line in Scan Order Cart(resolve: #14864)
Scan Order app 扫码界面隐藏target 按钮 -- hide target button in scan UI of the Scan Order app(resolve: #14863)

Ray Zhang 4 年之前
父節點
當前提交
2140b7f0df
共有 19 個文件被更改,包括 799 次插入45 次删除
  1. 18 2
      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. 5 0
      RedAnt ERP Mobile/HMLG Scan Order/MainViewController.m
  4. 155 6
      RedAnt ERP Mobile/HMLG Scan Order/QRCode.storyboard
  5. 1 1
      RedAnt ERP Mobile/HMLG Scan Order/RAQRCodeScannerViewController.h
  6. 41 5
      RedAnt ERP Mobile/HMLG Scan Order/RAQRCodeScannerViewController.m
  7. 153 0
      RedAnt ERP Mobile/HMLG Scan Order/SO.storyboard
  8. 26 0
      RedAnt ERP Mobile/HMLG Scan Order/ScanOrderScanModelViewController.h
  9. 216 0
      RedAnt ERP Mobile/HMLG Scan Order/ScanOrderScanModelViewController.m
  10. 3 1
      RedAnt ERP Mobile/HMLG Scan Order/ServerSettingViewController.m
  11. 20 0
      RedAnt ERP Mobile/common/Functions/camscan/ScanResultViewController.h
  12. 39 0
      RedAnt ERP Mobile/common/Functions/camscan/ScanResultViewController.m
  13. 1 0
      RedAnt ERP Mobile/common/Functions/camscan/ScannerControllerView.h
  14. 18 15
      RedAnt ERP Mobile/common/Functions/camscan/ScannerControllerView.m
  15. 4 1
      RedAnt ERP Mobile/common/Functions/camscan/ScannerViewController.h
  16. 84 11
      RedAnt ERP Mobile/common/Functions/camscan/ScannerViewController.m
  17. 12 0
      RedAnt ERP Mobile/common/Functions/cart/CartViewController.m
  18. 1 1
      RedAnt ERP Mobile/common/Functions/order/CreateOrderViewController.m
  19. 1 1
      RedAnt ERP Mobile/iSales-CONTRAST.xcodeproj/xcuserdata/ruizhang.xcuserdatad/xcschemes/xcschememanagement.plist

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

@@ -8,6 +8,9 @@
 
 /* Begin PBXBuildFile section */
 		3C2F99B8237BE1790000808F /* PortfolioListTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C2F99B6237BE1790000808F /* PortfolioListTableViewCell.m */; };
+		3C3A5AFE27D74E50005F4EFB /* ScanResultViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C3A5AFD27D74E4F005F4EFB /* ScanResultViewController.m */; };
+		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 */; };
@@ -327,6 +330,11 @@
 /* Begin PBXFileReference section */
 		3C2F99B6237BE1790000808F /* PortfolioListTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PortfolioListTableViewCell.m; path = common/Functions/portfolio/PortfolioListTableViewCell.m; sourceTree = SOURCE_ROOT; };
 		3C2F99B7237BE1790000808F /* PortfolioListTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PortfolioListTableViewCell.h; path = common/Functions/portfolio/PortfolioListTableViewCell.h; sourceTree = SOURCE_ROOT; };
+		3C3A5AFC27D74E4F005F4EFB /* ScanResultViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ScanResultViewController.h; path = common/Functions/camscan/ScanResultViewController.h; sourceTree = SOURCE_ROOT; };
+		3C3A5AFD27D74E4F005F4EFB /* ScanResultViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = ScanResultViewController.m; path = common/Functions/camscan/ScanResultViewController.m; sourceTree = SOURCE_ROOT; };
+		3C3A5AFF27D74F91005F4EFB /* ScanOrderScanModelViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ScanOrderScanModelViewController.h; sourceTree = "<group>"; };
+		3C3A5B0027D74F91005F4EFB /* ScanOrderScanModelViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ScanOrderScanModelViewController.m; sourceTree = "<group>"; };
+		3C3A5B0227D87BA1005F4EFB /* SO.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = SO.storyboard; sourceTree = "<group>"; };
 		3C473C8F27C4D22900CC8C12 /* ScanUserListViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ScanUserListViewController.h; sourceTree = "<group>"; };
 		3C473C9027C4D22900CC8C12 /* ScanUserListViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ScanUserListViewController.m; sourceTree = "<group>"; };
 		3C4DA61527B4E95C001EB44E /* HMLG Scan Order-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "HMLG Scan Order-Info.plist"; sourceTree = "<group>"; };
@@ -1018,6 +1026,11 @@
 				3C51E7CF27B2623700E61163 /* UploadCell.m */,
 				3C473C8F27C4D22900CC8C12 /* ScanUserListViewController.h */,
 				3C473C9027C4D22900CC8C12 /* ScanUserListViewController.m */,
+				3C3A5AFC27D74E4F005F4EFB /* ScanResultViewController.h */,
+				3C3A5AFD27D74E4F005F4EFB /* ScanResultViewController.m */,
+				3C3A5AFF27D74F91005F4EFB /* ScanOrderScanModelViewController.h */,
+				3C3A5B0027D74F91005F4EFB /* ScanOrderScanModelViewController.m */,
+				3C3A5B0227D87BA1005F4EFB /* SO.storyboard */,
 			);
 			name = OLO;
 			sourceTree = "<group>";
@@ -2198,6 +2211,7 @@
 				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 */,
 				7141DD341C57269B00F7DF59 /* include in Resources */,
@@ -2448,12 +2462,14 @@
 				3C514966273D0A2F00F78617 /* SRMonthPicker.m in Sources */,
 				3C69618223C7156D0075172A /* RAPDFViewController.m in Sources */,
 				7162A5CA1C58761500AB630E /* SignatureView.m in Sources */,
+				3C3A5B0127D74F91005F4EFB /* ScanOrderScanModelViewController.m in Sources */,
 				7162A5181C58704600AB630E /* CartViewController.m in Sources */,
 				42BF67CC1E5179970081F90A /* ERPUtils.m in Sources */,
 				42FD1A031FBD1A3000C5D9A8 /* RAOrderPreviewController.m in Sources */,
 				7141DD3C1C5726B700F7DF59 /* ScanApiHelper.mm in Sources */,
 				7162A5261C58706C00AB630E /* CategoryViewController.m in Sources */,
 				7162A50A1C586FC100AB630E /* NSTimer+Addition.m in Sources */,
+				3C3A5AFE27D74E50005F4EFB /* ScanResultViewController.m in Sources */,
 				3C514949273D095900F78617 /* CommonEditorCellEnum.m in Sources */,
 				712AFED91DBA050200254965 /* GroupDrawable.m in Sources */,
 				3C51E7CD27B261EC00E61163 /* RAUploadManager.m in Sources */,
@@ -2611,7 +2627,7 @@
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				CURRENT_PROJECT_VERSION = 200119;
+				CURRENT_PROJECT_VERSION = 50448;
 				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -2655,7 +2671,7 @@
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				CURRENT_PROJECT_VERSION = 200119;
+				CURRENT_PROJECT_VERSION = 50448;
 				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",

+ 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>1</integer>
+			<integer>2</integer>
 		</dict>
 	</dict>
 </dict>

+ 5 - 0
RedAnt ERP Mobile/HMLG Scan Order/MainViewController.m

@@ -33,6 +33,7 @@
 #import "NotificationNameCenter.h"
 //#import "OLOSettingViewController.h"
 #import "CustomerEditViewController.h"
+#import "ScanOrderScanModelViewController.h"
 
 #import "ScanUserListViewController.h"
 @interface MainViewController ()
@@ -971,6 +972,10 @@
 - (IBAction)onScanClick:(id)sender {
     ScannerViewController * scannerVC =[[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"ScannerViewController"];
     
+    
+//    LoginViewController * loginvc =[[UIStoryboard storyboardWithName:@"SO" bundle:nil] instantiateViewControllerWithIdentifier:@"LoginViewController"];
+        ScanOrderScanModelViewController *scanresult = [[UIStoryboard storyboardWithName:@"SO" bundle:nil] instantiateViewControllerWithIdentifier:@"ScanOrderScanModelViewController"];
+    scannerVC.resultvc = scanresult;
     [self.navigationController pushViewController:scannerVC animated:true];
     
     

+ 155 - 6
RedAnt ERP Mobile/HMLG Scan Order/QRCode.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" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
-    <device id="retina5_5" orientation="landscape">
-        <adaptation id="fullscreen"/>
-    </device>
+<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="retina5_5" orientation="landscape" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19519"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -65,6 +63,7 @@
                                 </connections>
                             </button>
                         </subviews>
+                        <viewLayoutGuide key="safeArea" id="TEW-wV-M4S"/>
                         <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                         <constraints>
                             <constraint firstItem="0ig-dn-iSa" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="vCI-Zm-N7X" secondAttribute="trailing" priority="999" constant="10" id="29i-AW-HSH"/>
@@ -100,7 +99,6 @@
                             <constraint firstItem="D8z-rA-Qpf" firstAttribute="height" secondItem="aiT-qZ-M5f" secondAttribute="height" id="swA-T5-xSR"/>
                             <constraint firstAttribute="bottom" secondItem="vCI-Zm-N7X" secondAttribute="bottom" constant="60" id="uOO-Nq-OMU"/>
                         </constraints>
-                        <viewLayoutGuide key="safeArea" id="TEW-wV-M4S"/>
                         <variation key="default">
                             <mask key="constraints">
                                 <exclude reference="7a1-vL-ZwM"/>
@@ -178,6 +176,157 @@
             </objects>
             <point key="canvasLocation" x="-155.70652173913044" y="160.86956521739131"/>
         </scene>
+        <!--Code Scanner View Controller-->
+        <scene sceneID="3xu-LD-bSC">
+            <objects>
+                <viewController storyboardIdentifier="RAQRCodeScannerViewControllerAuto" useStoryboardIdentifierAsRestorationIdentifier="YES" id="T5n-Ld-InS" customClass="RAQRCodeScannerViewController" sceneMemberID="viewController">
+                    <view key="view" contentMode="scaleToFill" id="XG1-BH-5Yn">
+                        <rect key="frame" x="0.0" y="0.0" width="736" height="414"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <subviews>
+                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Ada-GD-fnS">
+                                <rect key="frame" x="0.0" y="0.0" width="736" height="414"/>
+                                <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                            </view>
+                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="OxG-xD-O68">
+                                <rect key="frame" x="0.0" y="0.0" width="736" height="414"/>
+                                <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                            </view>
+                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="RQP-kc-U9i">
+                                <rect key="frame" x="0.0" y="0.0" width="736" height="414"/>
+                                <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                            </view>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ZVa-fu-Anm">
+                                <rect key="frame" x="596" y="177" width="60" height="60"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" secondItem="ZVa-fu-Anm" secondAttribute="height" multiplier="1:1" id="EVk-AS-ca9"/>
+                                    <constraint firstAttribute="width" constant="60" id="OR3-hA-sW8"/>
+                                </constraints>
+                                <connections>
+                                    <action selector="scannerBtnTouchCancel:" destination="T5n-Ld-InS" eventType="touchCancel" id="Hod-Jp-vRQ"/>
+                                    <action selector="scannerBtnTouchDown:" destination="T5n-Ld-InS" eventType="touchDown" id="ssg-7k-DsL"/>
+                                    <action selector="scannerBtnTouchUp:" destination="T5n-Ld-InS" eventType="touchUpInside" id="Zqm-7x-PH2"/>
+                                    <action selector="scannerBtnTouchUpOutSide:" destination="T5n-Ld-InS" eventType="touchUpOutside" id="z3f-Dx-KjM"/>
+                                </connections>
+                            </button>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="GaA-2B-enV">
+                                <rect key="frame" x="10" y="20" width="30" height="30"/>
+                                <state key="normal" image="qr_back_btn"/>
+                                <connections>
+                                    <action selector="backBtnClick:" destination="T5n-Ld-InS" eventType="touchUpInside" id="bcH-Wf-Geh"/>
+                                </connections>
+                            </button>
+                        </subviews>
+                        <viewLayoutGuide key="safeArea" id="7LN-2I-0kE"/>
+                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                        <constraints>
+                            <constraint firstItem="Ada-GD-fnS" firstAttribute="top" secondItem="XG1-BH-5Yn" secondAttribute="top" id="0TT-7U-avg"/>
+                            <constraint firstItem="OxG-xD-O68" firstAttribute="height" secondItem="Ada-GD-fnS" secondAttribute="height" id="1RB-Dy-CMB"/>
+                            <constraint firstAttribute="trailing" secondItem="ZVa-fu-Anm" secondAttribute="trailing" constant="80" id="4Xk-os-lf2"/>
+                            <constraint firstAttribute="bottom" secondItem="ZVa-fu-Anm" secondAttribute="bottom" constant="100" id="7zP-kW-kfl"/>
+                            <constraint firstItem="OxG-xD-O68" firstAttribute="width" secondItem="Ada-GD-fnS" secondAttribute="width" id="8Lx-FN-qmp"/>
+                            <constraint firstItem="RQP-kc-U9i" firstAttribute="centerX" secondItem="XG1-BH-5Yn" secondAttribute="centerX" id="8xY-Zj-CWq"/>
+                            <constraint firstItem="Ada-GD-fnS" firstAttribute="leading" secondItem="XG1-BH-5Yn" secondAttribute="leading" id="ATR-hp-3NY"/>
+                            <constraint firstAttribute="trailing" secondItem="RQP-kc-U9i" secondAttribute="trailing" id="Anl-Kq-3Hz"/>
+                            <constraint firstItem="GaA-2B-enV" firstAttribute="top" secondItem="7LN-2I-0kE" secondAttribute="top" constant="20" id="CFM-am-fjr"/>
+                            <constraint firstItem="ZVa-fu-Anm" firstAttribute="centerY" secondItem="RQP-kc-U9i" secondAttribute="centerY" id="Ctr-fp-1Du"/>
+                            <constraint firstItem="RQP-kc-U9i" firstAttribute="top" secondItem="XG1-BH-5Yn" secondAttribute="top" constant="60" id="ItM-cP-b4W"/>
+                            <constraint firstAttribute="bottom" secondItem="RQP-kc-U9i" secondAttribute="bottom" constant="81" id="LId-87-goU"/>
+                            <constraint firstItem="RQP-kc-U9i" firstAttribute="centerY" secondItem="XG1-BH-5Yn" secondAttribute="centerY" constant="-70" id="NXe-za-28a"/>
+                            <constraint firstAttribute="bottom" secondItem="RQP-kc-U9i" secondAttribute="bottom" id="Nho-ky-KsO"/>
+                            <constraint firstItem="ZVa-fu-Anm" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="RQP-kc-U9i" secondAttribute="trailing" priority="999" constant="10" id="P2P-rr-rbi"/>
+                            <constraint firstAttribute="bottom" secondItem="ZVa-fu-Anm" secondAttribute="bottom" constant="70" id="QQv-4I-OPC"/>
+                            <constraint firstAttribute="trailing" secondItem="RQP-kc-U9i" secondAttribute="trailing" constant="70" id="Rh5-qS-eN1"/>
+                            <constraint firstItem="Ada-GD-fnS" firstAttribute="height" secondItem="XG1-BH-5Yn" secondAttribute="height" id="SIj-Tj-H6x"/>
+                            <constraint firstItem="RQP-kc-U9i" firstAttribute="centerX" secondItem="XG1-BH-5Yn" secondAttribute="centerX" id="Shg-2w-jbh"/>
+                            <constraint firstAttribute="trailing" secondItem="ZVa-fu-Anm" secondAttribute="trailing" constant="104" id="U2T-Rw-rJv"/>
+                            <constraint firstItem="ZVa-fu-Anm" firstAttribute="centerX" secondItem="RQP-kc-U9i" secondAttribute="centerX" id="VTR-af-Vme"/>
+                            <constraint firstItem="RQP-kc-U9i" firstAttribute="top" secondItem="XG1-BH-5Yn" secondAttribute="top" id="XN0-5G-6N3"/>
+                            <constraint firstItem="ZVa-fu-Anm" firstAttribute="centerY" secondItem="OxG-xD-O68" secondAttribute="centerY" id="Xjg-tG-R82"/>
+                            <constraint firstItem="ZVa-fu-Anm" firstAttribute="centerX" secondItem="RQP-kc-U9i" secondAttribute="centerX" id="YaB-tf-HMi"/>
+                            <constraint firstItem="OxG-xD-O68" firstAttribute="top" secondItem="Ada-GD-fnS" secondAttribute="top" id="Zc3-tk-wCe"/>
+                            <constraint firstItem="RQP-kc-U9i" firstAttribute="centerY" secondItem="XG1-BH-5Yn" secondAttribute="centerY" constant="-110" id="arS-wn-wNR"/>
+                            <constraint firstItem="RQP-kc-U9i" firstAttribute="leading" secondItem="XG1-BH-5Yn" secondAttribute="leading" id="fwV-gR-dax"/>
+                            <constraint firstItem="ZVa-fu-Anm" firstAttribute="top" relation="greaterThanOrEqual" secondItem="RQP-kc-U9i" secondAttribute="bottom" priority="999" constant="10" id="jRH-fe-9Z1"/>
+                            <constraint firstItem="OxG-xD-O68" firstAttribute="leading" secondItem="Ada-GD-fnS" secondAttribute="leading" id="lqp-xr-h52"/>
+                            <constraint firstItem="RQP-kc-U9i" firstAttribute="centerX" secondItem="XG1-BH-5Yn" secondAttribute="centerX" constant="-80" id="rxK-GN-MQq"/>
+                            <constraint firstItem="Ada-GD-fnS" firstAttribute="width" secondItem="XG1-BH-5Yn" secondAttribute="width" id="xjC-fg-9BG"/>
+                            <constraint firstItem="RQP-kc-U9i" firstAttribute="leading" secondItem="XG1-BH-5Yn" secondAttribute="leading" constant="70" id="zTt-gT-8Pj"/>
+                            <constraint firstItem="GaA-2B-enV" firstAttribute="leading" secondItem="7LN-2I-0kE" secondAttribute="leading" constant="10" id="zql-fK-xR8"/>
+                        </constraints>
+                        <variation key="default">
+                            <mask key="constraints">
+                                <exclude reference="8xY-Zj-CWq"/>
+                                <exclude reference="ItM-cP-b4W"/>
+                                <exclude reference="LId-87-goU"/>
+                                <exclude reference="NXe-za-28a"/>
+                                <exclude reference="Nho-ky-KsO"/>
+                                <exclude reference="Rh5-qS-eN1"/>
+                                <exclude reference="Shg-2w-jbh"/>
+                                <exclude reference="XN0-5G-6N3"/>
+                                <exclude reference="arS-wn-wNR"/>
+                                <exclude reference="rxK-GN-MQq"/>
+                                <exclude reference="zTt-gT-8Pj"/>
+                                <exclude reference="4Xk-os-lf2"/>
+                                <exclude reference="7zP-kW-kfl"/>
+                                <exclude reference="Ctr-fp-1Du"/>
+                                <exclude reference="P2P-rr-rbi"/>
+                                <exclude reference="QQv-4I-OPC"/>
+                                <exclude reference="U2T-Rw-rJv"/>
+                                <exclude reference="VTR-af-Vme"/>
+                                <exclude reference="YaB-tf-HMi"/>
+                                <exclude reference="jRH-fe-9Z1"/>
+                            </mask>
+                        </variation>
+                        <variation key="heightClass=compact-widthClass=compact">
+                            <mask key="constraints">
+                                <include reference="ItM-cP-b4W"/>
+                                <include reference="LId-87-goU"/>
+                                <include reference="rxK-GN-MQq"/>
+                                <include reference="Ctr-fp-1Du"/>
+                                <include reference="P2P-rr-rbi"/>
+                                <include reference="U2T-Rw-rJv"/>
+                            </mask>
+                        </variation>
+                        <variation key="heightClass=compact-widthClass=regular">
+                            <mask key="constraints">
+                                <include reference="Nho-ky-KsO"/>
+                                <include reference="XN0-5G-6N3"/>
+                                <include reference="4Xk-os-lf2"/>
+                            </mask>
+                        </variation>
+                        <variation key="heightClass=regular-widthClass=compact">
+                            <mask key="constraints">
+                                <include reference="NXe-za-28a"/>
+                                <include reference="Rh5-qS-eN1"/>
+                                <include reference="Shg-2w-jbh"/>
+                                <include reference="zTt-gT-8Pj"/>
+                                <include reference="QQv-4I-OPC"/>
+                                <include reference="YaB-tf-HMi"/>
+                                <include reference="jRH-fe-9Z1"/>
+                            </mask>
+                        </variation>
+                        <variation key="heightClass=regular-widthClass=regular">
+                            <mask key="constraints">
+                                <include reference="8xY-Zj-CWq"/>
+                                <include reference="arS-wn-wNR"/>
+                                <include reference="7zP-kW-kfl"/>
+                                <include reference="VTR-af-Vme"/>
+                            </mask>
+                        </variation>
+                    </view>
+                    <connections>
+                        <outlet property="backBtn" destination="GaA-2B-enV" id="bNe-C8-v4O"/>
+                        <outlet property="maskView" destination="OxG-xD-O68" id="oPx-fr-2gE"/>
+                        <outlet property="previewContainer" destination="Ada-GD-fnS" id="NkS-pP-tuy"/>
+                        <outlet property="scanBtn" destination="ZVa-fu-Anm" id="IeW-DK-EZe"/>
+                        <outlet property="scanerView" destination="RQP-kc-U9i" id="vqj-8k-3PF"/>
+                    </connections>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="jFm-OQ-ocS" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="-155.70652173913044" y="160.86956521739131"/>
+        </scene>
     </scenes>
     <resources>
         <image name="qr_back_btn" width="30" height="30"/>

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

@@ -14,5 +14,5 @@
 @property (nonatomic,copy) void (^QRCodeViewControllerDidCanceled)(RAQRCodeScannerViewController *qrcodeViewController);///< 需要在Block中返回
 
 + (instancetype)viewControllerFromStoryboard;
-
+@property bool auto_style;
 @end

+ 41 - 5
RedAnt ERP Mobile/HMLG Scan Order/RAQRCodeScannerViewController.m

@@ -8,6 +8,7 @@
 
 #import "RAQRCodeScannerViewController.h"
 #import <AVKit/AVKit.h>
+#import "config.h"
 
 @interface RAQRCodeScannerViewController () <AVCaptureMetadataOutputObjectsDelegate>
 
@@ -47,6 +48,28 @@
 
 - (void)viewDidLoad {
     [super viewDidLoad];
+    
+    
+#ifdef SCANNER_ORDER
+    self.auto_style = true;
+#else
+    self.auto_style = false;
+#endif
+    
+    
+    
+    if(self.auto_style)
+    {
+//        cgrectoff
+
+        self.scanBtn.hidden = true;
+        
+        
+       
+        self.scannerEnable = true;
+    }
+    
+    
     // Do any additional setup after loading the view.
     if (self.navigationController) {
         self.navigationBarStatus = self.navigationController.navigationBarHidden;
@@ -197,15 +220,22 @@
         
         rect = CGRectMake(CGRectGetMinY(self.scanerView.frame) / h, CGRectGetMinX(self.scanerView.frame) / w, CGRectGetHeight(self.scanerView.frame) / h, CGRectGetWidth(self.scanerView.frame) / w);
     }
-    
+    if(!self.auto_style)
+    {
     [self.output setRectOfInterest:rect];
-    
+    }
+//    else
+//    {
+//        [self.output setRectOfInterest:self.scanerView.frame];
+//    }
     [self.view bringSubviewToFront:self.scanerView];
     
+    if(!self.auto_style)
+    {
     CGRect scanlineFrame = CGRectMake(0, CGRectGetMidY(self.scanerView.bounds) - 0.5, CGRectGetWidth(self.scanerView.bounds), 1);
     self.scanLineLayer.frame = scanlineFrame;
     [self.scanerView.layer insertSublayer:self.scanLineLayer atIndex:0];
-    
+    }
     
     UIBezierPath *path = [UIBezierPath bezierPathWithRect:self.maskView.bounds];
     UIBezierPath *subPath = [UIBezierPath bezierPathWithRect:self.scanerView.frame];
@@ -224,8 +254,14 @@
         self.rectLayer.strokeColor = [UIColor whiteColor].CGColor;
         self.rectLayer.lineWidth = 0.5f;
     }
-    self.rectLayer.path = subPath.CGPath;
-    
+//    if(self.auto_style)
+//    {
+//        self.rectLayer.frame = self.view.frame;
+//    }
+//    else
+//    {
+//    self.rectLayer.path = subPath.CGPath;
+//    }
     [self.maskLayer addSublayer:self.rectLayer];
     [self.maskView.layer addSublayer:self.maskLayer];
 }

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

@@ -0,0 +1,153 @@
+<?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="ipad7_9" orientation="portrait" layout="fullscreen" appearance="light"/>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19519"/>
+        <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"/>
+    </dependencies>
+    <scenes>
+        <!--Set Quantity-->
+        <scene sceneID="s0d-6b-0kx">
+            <objects>
+                <viewController storyboardIdentifier="ScanOrderScanModelViewController" title="Set Quantity" useStoryboardIdentifierAsRestorationIdentifier="YES" id="Y6W-OH-hqX" customClass="ScanOrderScanModelViewController" sceneMemberID="viewController">
+                    <view key="view" contentMode="scaleToFill" id="5EZ-qb-Rvc">
+                        <rect key="frame" x="0.0" y="0.0" width="480" height="320"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <subviews>
+                            <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="name aaaaaaaaaaaaa aaaaaaaaaa BBBBB  CCCCC" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PRk-Ka-jS0" userLabel="name ">
+                                <rect key="frame" x="148" y="24" width="308" height="100"/>
+                                <fontDescription key="fontDescription" name="HelveticaNeue" family="Helvetica Neue" pointSize="15"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="cgR-Wk-NQr">
+                                <rect key="frame" x="384.5" y="249" width="71.5" height="31"/>
+                                <state key="normal" title="Button"/>
+                                <buttonConfiguration key="configuration" style="plain" title="Update"/>
+                                <connections>
+                                    <action selector="onUpdate:" destination="Y6W-OH-hqX" eventType="touchUpInside" id="czo-ja-q2a"/>
+                                </connections>
+                            </button>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="mGr-dd-c4r">
+                                <rect key="frame" x="24" y="249" width="44" height="31"/>
+                                <state key="normal" title="Button"/>
+                                <buttonConfiguration key="configuration" style="plain" title="OK"/>
+                                <connections>
+                                    <action selector="onOK:" destination="Y6W-OH-hqX" eventType="touchUpInside" id="5pr-zY-3wo"/>
+                                </connections>
+                            </button>
+                            <stepper opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="1" maximumValue="99999" translatesAutoresizingMaskIntoConstraints="NO" id="jKb-jW-Rds">
+                                <rect key="frame" x="366" y="179.5" width="94" height="32"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="32" id="8rX-l5-A6F"/>
+                                    <constraint firstAttribute="width" constant="94" id="gvx-w5-P7c"/>
+                                </constraints>
+                            </stepper>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="G7K-ET-ViD" userLabel="imgbtn detail">
+                                <rect key="frame" x="24" y="24" width="100" height="100"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="100" id="9yV-y3-PVn"/>
+                                    <constraint firstAttribute="height" constant="100" id="ZUL-Ix-psD"/>
+                                </constraints>
+                                <state key="normal" image="notfound_s">
+                                    <color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                </state>
+                            </button>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="QTY:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="j28-du-bFd">
+                                <rect key="frame" x="240" y="185" width="41" height="21"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                <nil key="textColor"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Price:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gGe-DV-etn">
+                                <rect key="frame" x="20" y="144" width="44" height="21"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                <nil key="textColor"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6Gl-5w-SXW">
+                                <rect key="frame" x="84" y="144" width="42" height="21"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                <nil key="textColor"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="z2t-CO-48M">
+                                <rect key="frame" x="316" y="144" width="42" height="21"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                <nil key="textColor"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Mpack:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zIY-Ho-SNj">
+                                <rect key="frame" x="240" y="144" width="56" height="21"/>
+                                <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" text="9999" borderStyle="roundedRect" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="gOI-tN-7Fh" userLabel="qty">
+                                <rect key="frame" x="296" y="178.5" width="55" height="34"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="55" id="Lfa-9S-dCt"/>
+                                </constraints>
+                                <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                                <textInputTraits key="textInputTraits" keyboardType="numberPad"/>
+                            </textField>
+                        </subviews>
+                        <viewLayoutGuide key="safeArea" id="vDu-zF-Fre"/>
+                        <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                        <constraints>
+                            <constraint firstItem="gGe-DV-etn" firstAttribute="top" secondItem="G7K-ET-ViD" secondAttribute="bottom" constant="20" id="3GU-k4-ifh"/>
+                            <constraint firstItem="zIY-Ho-SNj" firstAttribute="centerY" secondItem="gGe-DV-etn" secondAttribute="centerY" id="4LP-ex-cNh"/>
+                            <constraint firstItem="vDu-zF-Fre" firstAttribute="bottom" secondItem="mGr-dd-c4r" secondAttribute="bottom" constant="20" id="58c-Jv-wgG"/>
+                            <constraint firstItem="jKb-jW-Rds" firstAttribute="centerY" secondItem="j28-du-bFd" secondAttribute="centerY" id="5Pu-Nk-VwB"/>
+                            <constraint firstItem="gGe-DV-etn" firstAttribute="leading" secondItem="vDu-zF-Fre" secondAttribute="leading" constant="20" id="6fi-Oz-HkC"/>
+                            <constraint firstItem="vDu-zF-Fre" firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="z2t-CO-48M" secondAttribute="trailing" constant="20" id="8jD-tF-gTK"/>
+                            <constraint firstItem="cgR-Wk-NQr" firstAttribute="centerY" secondItem="mGr-dd-c4r" secondAttribute="centerY" id="9xE-KH-OIN"/>
+                            <constraint firstItem="6Gl-5w-SXW" firstAttribute="leading" secondItem="gGe-DV-etn" secondAttribute="trailing" constant="20" id="GSW-ov-hBX"/>
+                            <constraint firstItem="zIY-Ho-SNj" firstAttribute="leading" secondItem="j28-du-bFd" secondAttribute="leading" id="HmV-uz-Xuf"/>
+                            <constraint firstItem="PRk-Ka-jS0" firstAttribute="top" secondItem="G7K-ET-ViD" secondAttribute="top" id="KV3-yY-Wg6"/>
+                            <constraint firstItem="PRk-Ka-jS0" firstAttribute="leading" secondItem="G7K-ET-ViD" secondAttribute="trailing" constant="24" id="QLn-1y-I6u"/>
+                            <constraint firstItem="j28-du-bFd" firstAttribute="top" secondItem="zIY-Ho-SNj" secondAttribute="bottom" constant="20" id="RVa-FV-loq"/>
+                            <constraint firstItem="PRk-Ka-jS0" firstAttribute="bottom" secondItem="G7K-ET-ViD" secondAttribute="bottom" id="aRe-X1-y7i"/>
+                            <constraint firstItem="mGr-dd-c4r" firstAttribute="leading" secondItem="vDu-zF-Fre" secondAttribute="leading" constant="24" id="aUg-jz-E4l"/>
+                            <constraint firstItem="gOI-tN-7Fh" firstAttribute="centerY" secondItem="j28-du-bFd" secondAttribute="centerY" id="cIa-HA-X5q"/>
+                            <constraint firstItem="G7K-ET-ViD" firstAttribute="leading" secondItem="vDu-zF-Fre" secondAttribute="leading" constant="24" id="fMj-BF-B9w"/>
+                            <constraint firstAttribute="trailing" secondItem="PRk-Ka-jS0" secondAttribute="trailing" constant="24" id="gn5-Dq-cBI"/>
+                            <constraint firstItem="vDu-zF-Fre" firstAttribute="trailing" secondItem="cgR-Wk-NQr" secondAttribute="trailing" constant="24" id="hQT-d0-UO8"/>
+                            <constraint firstItem="vDu-zF-Fre" firstAttribute="trailing" secondItem="jKb-jW-Rds" secondAttribute="trailing" constant="20" id="iSh-ii-5V7"/>
+                            <constraint firstItem="z2t-CO-48M" firstAttribute="leading" secondItem="zIY-Ho-SNj" secondAttribute="trailing" constant="20" id="jda-JG-ryM"/>
+                            <constraint firstItem="G7K-ET-ViD" firstAttribute="top" secondItem="vDu-zF-Fre" secondAttribute="top" id="kwA-bE-daq"/>
+                            <constraint firstItem="jKb-jW-Rds" firstAttribute="leading" secondItem="gOI-tN-7Fh" secondAttribute="trailing" constant="15" id="sGw-T2-LQO"/>
+                            <constraint firstItem="zIY-Ho-SNj" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="6Gl-5w-SXW" secondAttribute="trailing" constant="20" id="t5O-Yw-eva"/>
+                            <constraint firstItem="zIY-Ho-SNj" firstAttribute="leading" secondItem="5EZ-qb-Rvc" secondAttribute="leading" constant="240" id="u1d-JP-AUm"/>
+                            <constraint firstItem="6Gl-5w-SXW" firstAttribute="centerY" secondItem="gGe-DV-etn" secondAttribute="centerY" id="uD0-dH-GtW"/>
+                            <constraint firstItem="gOI-tN-7Fh" firstAttribute="leading" secondItem="j28-du-bFd" secondAttribute="trailing" constant="15" id="wUj-99-2IP"/>
+                            <constraint firstItem="z2t-CO-48M" firstAttribute="centerY" secondItem="zIY-Ho-SNj" secondAttribute="centerY" id="yMs-sK-Llu"/>
+                        </constraints>
+                    </view>
+                    <value key="contentSizeForViewInPopover" type="size" width="480" height="320"/>
+                    <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
+                    <size key="freeformSize" width="480" height="320"/>
+                    <connections>
+                        <outlet property="descriptionLabel" destination="PRk-Ka-jS0" id="YwR-We-n0U"/>
+                        <outlet property="imagebtn" destination="G7K-ET-ViD" id="xjy-Hz-MCI"/>
+                        <outlet property="mpackLabel" destination="z2t-CO-48M" id="DMk-ZO-xt9"/>
+                        <outlet property="priceLabel" destination="6Gl-5w-SXW" id="4ce-5A-rx5"/>
+                        <outlet property="qtyEdit" destination="gOI-tN-7Fh" id="iOb-AJ-xr0"/>
+                        <outlet property="qtystepper" destination="jKb-jW-Rds" id="gTc-Er-Thz"/>
+                    </connections>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="Ief-a0-LHa" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="130.64516129032259" y="109.62047661076787"/>
+        </scene>
+    </scenes>
+    <resources>
+        <image name="notfound_s" width="180" height="180"/>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
+    </resources>
+</document>

+ 26 - 0
RedAnt ERP Mobile/HMLG Scan Order/ScanOrderScanModelViewController.h

@@ -0,0 +1,26 @@
+//
+//  ScanOrderScanModelViewController.h
+//  HMLG Scan Order
+//
+//  Created by Rui Zhang on 3/8/22.
+//  Copyright © 2022 United Software Applications, Inc. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "ScanResultViewController.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface ScanOrderScanModelViewController : ScanResultViewController <UITextFieldDelegate>
+@property (weak, nonatomic) IBOutlet UIButton *imagebtn;
+@property (weak, nonatomic) IBOutlet UILabel *descriptionLabel;
+@property (weak, nonatomic) IBOutlet UITextField *qtyEdit;
+@property (weak, nonatomic) IBOutlet UIStepper *qtystepper;
+@property (weak, nonatomic) IBOutlet UILabel *priceLabel;
+@property (weak, nonatomic) IBOutlet UILabel *mpackLabel;
+//@property (strong,nonatomic) NSString* pre_val;
+@property int pre_val;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 216 - 0
RedAnt ERP Mobile/HMLG Scan Order/ScanOrderScanModelViewController.m

@@ -0,0 +1,216 @@
+//
+//  ScanOrderScanModelViewController.m
+//  HMLG Scan Order
+//
+//  Created by Rui Zhang on 3/8/22.
+//  Copyright © 2022 United Software Applications, Inc. All rights reserved.
+//
+
+#import "ScanOrderScanModelViewController.h"
+#import "RAConvertor.h"
+#import "RAUtils.h"
+#import "AppDelegate.h"
+
+#define NUMBERS @"0123456789\n"
+@interface ScanOrderScanModelViewController ()
+
+@end
+
+@implementation ScanOrderScanModelViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    
+    self.qtyEdit.delegate = self;
+    
+  
+    
+    // Do any additional setup after loading the view.
+}
+- (void)viewWillAppear:(BOOL)animated
+{
+    [super viewWillAppear:animated];
+    
+
+    NSMutableDictionary* jitem =(NSMutableDictionary*) self.scan_val;
+    
+//    jitem[@"product_id"]= item[0];
+//    NSString* model =item[1];
+//    NSString* description =item[2];
+//    jitem[@"model"] =model;
+//    jitem[@"description"] = [NSString stringWithFormat:@"%@ \r\n%@",model,description];
+//    jitem[@"unit_price"] =@( [item[3] doubleValue]);
+//    jitem[@"stockUom"] = @([item[4] intValue]);
+//    jitem[@"count"] = @([item[4] intValue]);
+//    jitem[@"subtotal_price"] = @([item[4] intValue]* [item[3] doubleValue]);
+//
+//    jitem[@"check"]=@(true);
+    
+    
+ //   NSString* model =jitem[@"model"];
+    NSString* description =jitem[@"description"];
+    double unit_price = [jitem[@"unit_price"] doubleValue];
+//    jitem[@"model"] =model;
+//    jitem[@"description"] = [NSString stringWithFormat:@"%@ \r\n%@",model,description];
+//    jitem[@"unit_price"] =@( [item[3] doubleValue]);
+//    jitem[@"stockUom"] = @([item[4] intValue]);
+//    jitem[@"count"] = @([item[4] intValue]);
+//    jitem[@"subtotal_price"] = @([item[4] intValue]* [item[3] doubleValue]);
+//
+//    jitem[@"check"]=@(true);
+//
+    int stockUom =[jitem[@"stockUom"] intValue];
+    
+    [self init_Stepper:stockUom max:9999 min:stockUom value:stockUom];
+    
+    self.descriptionLabel.text =  description;
+    
+    self.qtyEdit.text =[NSString stringWithFormat:@"%d",stockUom];
+    self.priceLabel.text =  [NSString stringWithFormat:@"%.2f",unit_price];
+    self.mpackLabel.text =  [NSString stringWithFormat:@"%d",stockUom];
+}
+-(void) init_Stepper:(int) step max:(int) max min:(int)min value:(int)value
+{
+    
+//    [self.stepper becomeFirstResponder];
+    if(self.qtystepper!=nil)
+    {
+        if(min<=0)
+            min=1;
+        if(step<=0)
+            step=1;
+        self.qtystepper.minimumValue= min;
+        
+        
+        
+        self.qtystepper.stepValue= step;
+        
+        self.qtystepper.value= value;
+        
+       
+        
+        [self.qtystepper addTarget:self action:@selector(valueChanged:) forControlEvents:UIControlEventValueChanged];
+        
+        
+    }
+}
+- (void)valueChanged:(UIStepper *)sender {
+    
+    
+    
+    self.qtyEdit.text = [NSString stringWithFormat:@"%d",(int)sender.value ];
+    
+//    self.pre_val = (int)sender.value;
+//    [self set_Count:(int)sender.value ];
+    
+    
+    //
+    //    [celldelegate stepClicked:(int)sender.value];
+    //    -(void) stepClicked:(int) value;
+}
+#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.qtystepper.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];
+        return;
+    }
+#endif
+    
+        
+        int c=qty;
+        
+        int m=c%(int)(self.qtystepper.stepValue);
+        if(m!=0)
+            
+        {
+            [RAUtils message_alert:[NSString stringWithFormat:@"QTY must be a multiple of %d",(int)self.qtystepper.stepValue] title:@"Warrning" controller: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;
+}
+
+- (IBAction)onOK:(id)sender {
+    [self dismissViewControllerAnimated:true completion:^{
+            if(self.returnValue)
+                self.returnValue(self.scan_val);
+        }];
+}
+- (IBAction)onUpdate:(id)sender {
+    NSMutableDictionary* jitem =(NSMutableDictionary*) self.scan_val;
+    int qty = [self.qtyEdit.text intValue];
+    
+    jitem[@"count"] = @(qty);
+    jitem[@"subtotal_price"] = @(qty* [jitem[@"unit_price"] doubleValue] );
+    
+    [self dismissViewControllerAnimated:true completion:^{
+            if(self.returnValue)
+                self.returnValue(self.scan_val);
+        }];
+}
+
+/*
+#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.
+}
+*/
+
+@end

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

@@ -323,7 +323,9 @@
 //    };
 //    [self presentViewController:scannerVC animated:YES completion:nil];
     
-    RAQRCodeScannerViewController *scannerVC = [RAQRCodeScannerViewController viewControllerFromStoryboard];
+    RAQRCodeScannerViewController *scannerVC = [[UIStoryboard storyboardWithName:@"QRCode" bundle:nil] instantiateViewControllerWithIdentifier:@"RAQRCodeScannerViewControllerAuto"];
+    
+//    RAQRCodeScannerViewController *scannerVC = [RAQRCodeScannerViewController viewControllerFromStoryboard];
     scannerVC.QRCodeViewControllerDidCompletion = ^(RAQRCodeScannerViewController *qrcodeViewController, NSString *value) {
         
         if (weakself) {

+ 20 - 0
RedAnt ERP Mobile/common/Functions/camscan/ScanResultViewController.h

@@ -0,0 +1,20 @@
+//
+//  ScanResultViewController.h
+//  HMLG Scan Order
+//
+//  Created by Rui Zhang on 3/8/22.
+//  Copyright © 2022 United Software Applications, Inc. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface ScanResultViewController : UIViewController
+@property (strong, nonatomic)  id scan_val;
+@property (strong, nonatomic)  NSString *handeled_val;
+
+@property (nonatomic,copy) void(^returnValue)(id val);
+@end
+
+NS_ASSUME_NONNULL_END

+ 39 - 0
RedAnt ERP Mobile/common/Functions/camscan/ScanResultViewController.m

@@ -0,0 +1,39 @@
+//
+//  ScanResultViewController.m
+//  HMLG Scan Order
+//
+//  Created by Rui Zhang on 3/8/22.
+//  Copyright © 2022 United Software Applications, Inc. All rights reserved.
+//
+
+#import "ScanResultViewController.h"
+
+@interface ScanResultViewController ()
+
+@end
+
+@implementation ScanResultViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+}
+
+
+- (void)viewWillDisappear:(BOOL)animated
+{
+    [super viewWillDisappear:animated];
+//    if(self.returnValue)
+//        self.returnValue(self.handeled_val);
+}
+/*
+#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.
+}
+*/
+
+@end

+ 1 - 0
RedAnt ERP Mobile/common/Functions/camscan/ScannerControllerView.h

@@ -10,4 +10,5 @@
 
 @interface ScannerControllerView : UIView
 @property CGRect highLightRect;
+@property bool auto_style;
 @end

+ 18 - 15
RedAnt ERP Mobile/common/Functions/camscan/ScannerControllerView.m

@@ -36,22 +36,25 @@
     
     
     
-    
+    if(!self.auto_style)
+    {
+        //    CGRect frame = self.contentView.frame;
+        
+        // //   CGContextAddRect(context,frame);
+           CGContextSetLineWidth(con, 1.0);
+        //
+            CGContextSetStrokeColorWithColor(con, [[UIColor redColor] CGColor]);
+        //
+    //        CGRect selrect = self.highLightRect;
+        
+            CGContextMoveToPoint(con, self.highLightRect.origin.x, self.highLightRect.origin.y+ self.highLightRect.size.height/2.0);
+        
+            CGContextAddLineToPoint(con, self.highLightRect.origin.x+ self.highLightRect.size.width, self.highLightRect.origin.y+self.highLightRect.size.height/2.0);
+        //
+           CGContextStrokePath(con);
+    }
+
 
-    //    CGRect frame = self.contentView.frame;
-    
-    // //   CGContextAddRect(context,frame);
-       CGContextSetLineWidth(con, 1.0);
-    //
-        CGContextSetStrokeColorWithColor(con, [[UIColor redColor] CGColor]);
-    //
-//        CGRect selrect = self.highLightRect;
-    
-        CGContextMoveToPoint(con, self.highLightRect.origin.x, self.highLightRect.origin.y+ self.highLightRect.size.height/2.0);
-    
-        CGContextAddLineToPoint(con, self.highLightRect.origin.x+ self.highLightRect.size.width, self.highLightRect.origin.y+self.highLightRect.size.height/2.0);
-    //    
-       CGContextStrokePath(con);
     
     [super drawRect:rect];
 }

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

@@ -18,6 +18,7 @@
 #import <UIKit/UIKit.h>
 //#import "ScannerControlViewController.h"
 #import "ScannerControllerView.h"
+#import "ScanResultViewController.h"
 @interface ScannerViewController : UIViewController
 @property bool handelOutput;
 @property (strong, nonatomic) IBOutlet UIButton *scanButton;
@@ -26,10 +27,12 @@
 //@property (strong,nonatomic) ScannerControllerView* scannerController;
 @property (strong, nonatomic) IBOutlet UIImageView *focusZone;
 @property (weak, nonatomic) IBOutlet UIButton *typeButton;
-
+@property (strong, nonatomic) ScanResultViewController* resultvc;
 @property (strong, nonatomic) IBOutlet UIButton *targetButton;
 @property  int target;
 @property  int type;
 @property (strong, nonatomic)  NSString *scan_val;
 
+@property bool auto_style;
+
 @end

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

@@ -232,6 +232,14 @@
 - (void)viewDidLoad
 {
     [super viewDidLoad];
+    
+  
+#ifdef SCANNER_ORDER
+    self.auto_style = true;
+#else
+    self.auto_style = false;
+#endif
+    
     UIBarButtonItem *closeButton = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"back"] imageWithRenderingMode:UIImageRenderingModeAutomatic]
                                                                     style:UIBarButtonItemStylePlain
                                                                    target:self
@@ -244,10 +252,27 @@
     //        return;
   //  [self.backgroundView removeFromSuperview];
     //self.back = (ScannerControllerView*)self.view;
-    self.backgroundView.highLightRect = CGRectInset(self.focusZone.frame,6,6);
+    
+    if(self.auto_style)
+    {
+//        cgrectoff
+        self.focusZone.frame = self.view.frame;
+        self.backgroundView.auto_style = self.auto_style;
+        self.backgroundView.highLightRect = self.view.frame;
+        self.scanButton.hidden = true;
+        self.handelOutput = true;
+    }
+    else
+    {
+        self.backgroundView.highLightRect = CGRectInset(self.focusZone.frame,6,6);
+        self.handelOutput = false;
+    }
+    
+    
    // self.backgroundView.autoresizingMask=0xff;
-    self.handelOutput = false;
     
+    
+#ifdef SCANNER_ORDER
 #if TARGET_IPHONE_SIMULATOR//模拟器
     
     if(RASingleton.sharedInstance.enable_OfflineOrder)
@@ -257,7 +282,10 @@
     }
         
 #endif
-
+    
+    self.targetButton.hidden = true;
+#endif
+   
     
     // Do any additional setup after loading the view, typically from a nib.
     
@@ -476,9 +504,11 @@
     
     
     
-    self.handelOutput = false;
-    [self StopScan];
-    
+    if(!self.auto_style)
+    {
+        self.handelOutput = false;
+        [self StopScan];
+    }
     
     
     self.scan_val = [transformed stringValue];
@@ -802,13 +832,24 @@
         
         NSString* key =@"usai2010";
         NSString * cart_item = [AESCrypt decrypt:self.scan_val password:key];
+        
+        if(cart_item == nil)
+        {
+            //二维码不是scan order的格式
+            [RAUtils message_alert:@"QR CODE incorrect." title:@"Add To Cart" controller:self] ;
+            return;
+        }
 #if TARGET_IPHONE_SIMULATOR
         cart_item = self.scan_val;
 #endif
+        
+     
+
+        
         NSMutableArray* item = [[RAConvertor string2dict:cart_item] mutableCopy];
         
         
-        NSMutableDictionary* jitem = [NSMutableDictionary new];
+        __block NSMutableDictionary* jitem = [NSMutableDictionary new];
         jitem[@"product_id"]= item[0];
         NSString* model =item[1];
         NSString* description =item[2];
@@ -820,6 +861,33 @@
         jitem[@"subtotal_price"] = @([item[4] intValue]* [item[3] doubleValue]);
         
         jitem[@"check"]=@(true);
+        
+        
+        self.resultvc.scan_val = jitem;
+        self.resultvc.modalPresentationStyle = UIModalPresentationFormSheet;//有三种状态,自己看看是哪种
+        __weak typeof(self) weakself = self;
+        self.resultvc.returnValue = ^(id  _Nonnull val) {
+            jitem = (NSMutableDictionary*)val;
+            weakself.handelOutput=true;
+            ;
+        };
+        self.handelOutput = false;
+        [self presentViewController:self.resultvc animated:YES completion:nil];
+        
+//        UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:loginvc] ;
+
+
+
+
+
+        //    [self hackModalSheetSize:CGSizeMake(450, 200) ofVC:navi];
+
+//        navi.modalPresentationStyle = UIModalTransitionStyleCrossDissolve;//
+        
+        
+
+        
+        
         if(RASingleton.sharedInstance.scan_cart ==nil)
         {
 //            NSData* json =[NSData dataWithContentsOfFile:[[NSBundle mainBundle]  pathForResource:URL_SO_CART ofType:@"json" ]];
@@ -835,12 +903,15 @@
             if([litem[@"product_id"] isEqualToString:jitem[@"product_id"]])
             {
                 
-                int unit = [litem[@"stockUom"] intValue];
+//                int unit = [litem[@"stockUom"] intValue];
                 newitem = false;
-                litem[@"count"]=@([litem[@"count"] intValue] +unit);
+            
+//                litem[@"count"]=@([litem[@"count"] intValue] +unit);
                 
-                section[[NSString stringWithFormat:@"item_%i",i]] = litem;
-                break;
+//                section[[NSString stringWithFormat:@"item_%i",i]] = litem;
+//                break;
+                
+                return;
             }
         }
         
@@ -1154,6 +1225,8 @@
 }
 -(void) StopScan
 {
+    if(self.auto_style)
+        return;
     self.scanButton.backgroundColor = [UIColor redColor];
   [self.scanButton setTitle:@"Tap" forState:UIControlStateNormal];
 }

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

@@ -614,6 +614,11 @@
     return self;
 }
 - (IBAction)imgbtnClick:(UIButton *)sender {
+    
+#ifdef SCANNER_ORDER
+    
+    return;
+#endif
     UITableViewCell* cell =(UITableViewCell*) sender.superview.superview;
     
     NSIndexPath *   indexPath = [self.itemListTable indexPathForCell:cell];
@@ -2481,6 +2486,13 @@
 }
 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
 {
+    
+#ifdef SCANNER_ORDER
+    
+    return;
+    
+#endif
+    
     NSMutableDictionary * item_json = nil;
     if (self.back_order_flag) {
         item_json = [[self itemJsonAtIndexPath:indexPath] mutableCopy];

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

@@ -611,7 +611,7 @@
         
         
         UIAlertAction *action_0 = [UIAlertAction actionWithTitle:@"Switch to cart" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
-            
+            [((MainViewController*)appDelegate.main_vc) switchToCart];
             [self.navigationController popViewControllerAnimated:true];
             
         }];

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