Ray Zhang 3 роки тому
батько
коміт
e1bfcf9a24

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

@@ -17,6 +17,7 @@
 		3C473C9127C4D22900CC8C12 /* ScanUserListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C473C9027C4D22900CC8C12 /* ScanUserListViewController.m */; };
 		3C4DA61F27B50199001EB44E /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3C4DA61D27B50199001EB44E /* Main.storyboard */; };
 		3C4DA62527B503B1001EB44E /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C4DA62327B503B1001EB44E /* MainViewController.m */; };
+		3C4F575928656BA5003C0005 /* CartViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C4F575828656BA5003C0005 /* CartViewController.m */; };
 		3C51492F273CF9B900F78617 /* DBUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C51492E273CF9B900F78617 /* DBUtil.m */; };
 		3C514932273D092A00F78617 /* EnumSelectViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C514931273D092A00F78617 /* EnumSelectViewController.m */; };
 		3C514947273D095900F78617 /* CommonEditorCellSwitch.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C514934273D095800F78617 /* CommonEditorCellSwitch.m */; };
@@ -219,7 +220,6 @@
 		7162A50B1C586FC100AB630E /* SliderPage.m in Sources */ = {isa = PBXBuildFile; fileRef = 7162A5081C586FC100AB630E /* SliderPage.m */; };
 		7162A5161C58704600AB630E /* BundleModelCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 7162A50D1C58704600AB630E /* BundleModelCell.m */; };
 		7162A5171C58704600AB630E /* BundleModelViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7162A50F1C58704600AB630E /* BundleModelViewController.m */; };
-		7162A5181C58704600AB630E /* CartViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7162A5111C58704600AB630E /* CartViewController.m */; };
 		7162A5191C58704600AB630E /* EditModelPriceViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7162A5131C58704600AB630E /* EditModelPriceViewController.m */; };
 		7162A51A1C58704600AB630E /* ModelItemCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 7162A5151C58704600AB630E /* ModelItemCell.m */; };
 		7162A5251C58706C00AB630E /* CategoryCellSmall.m in Sources */ = {isa = PBXBuildFile; fileRef = 7162A5201C58706C00AB630E /* CategoryCellSmall.m */; };
@@ -361,6 +361,8 @@
 		3C4DA61E27B50199001EB44E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
 		3C4DA62327B503B1001EB44E /* MainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = "<group>"; };
 		3C4DA62427B503B1001EB44E /* MainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = "<group>"; };
+		3C4F575728656BA5003C0005 /* CartViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CartViewController.h; path = common/Functions/cart/CartViewController.h; sourceTree = SOURCE_ROOT; };
+		3C4F575828656BA5003C0005 /* CartViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CartViewController.m; path = common/Functions/cart/CartViewController.m; sourceTree = SOURCE_ROOT; };
 		3C51492D273CF9B900F78617 /* DBUtil.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = DBUtil.h; path = common/DBUtil.h; sourceTree = SOURCE_ROOT; };
 		3C51492E273CF9B900F78617 /* DBUtil.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = DBUtil.m; path = common/DBUtil.m; sourceTree = SOURCE_ROOT; };
 		3C514930273D092A00F78617 /* EnumSelectViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EnumSelectViewController.h; path = ../../common/customUI/commoneditor/EnumSelectViewController.h; sourceTree = "<group>"; };
@@ -716,8 +718,6 @@
 		7162A50D1C58704600AB630E /* BundleModelCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BundleModelCell.m; path = common/Functions/cart/BundleModelCell.m; sourceTree = SOURCE_ROOT; };
 		7162A50E1C58704600AB630E /* BundleModelViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BundleModelViewController.h; path = common/Functions/cart/BundleModelViewController.h; sourceTree = SOURCE_ROOT; };
 		7162A50F1C58704600AB630E /* BundleModelViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BundleModelViewController.m; path = common/Functions/cart/BundleModelViewController.m; sourceTree = SOURCE_ROOT; };
-		7162A5101C58704600AB630E /* CartViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CartViewController.h; path = common/Functions/cart/CartViewController.h; sourceTree = SOURCE_ROOT; };
-		7162A5111C58704600AB630E /* CartViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CartViewController.m; path = common/Functions/cart/CartViewController.m; sourceTree = SOURCE_ROOT; };
 		7162A5121C58704600AB630E /* EditModelPriceViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EditModelPriceViewController.h; path = common/Functions/cart/EditModelPriceViewController.h; sourceTree = SOURCE_ROOT; };
 		7162A5131C58704600AB630E /* EditModelPriceViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = EditModelPriceViewController.m; path = common/Functions/cart/EditModelPriceViewController.m; sourceTree = SOURCE_ROOT; };
 		7162A5141C58704600AB630E /* ModelItemCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ModelItemCell.h; path = common/Functions/cart/ModelItemCell.h; sourceTree = SOURCE_ROOT; };
@@ -1586,12 +1586,12 @@
 		7143E0C919414E4B00B2EB1A /* cartView */ = {
 			isa = PBXGroup;
 			children = (
+				3C4F575728656BA5003C0005 /* CartViewController.h */,
+				3C4F575828656BA5003C0005 /* CartViewController.m */,
 				7162A50C1C58704600AB630E /* BundleModelCell.h */,
 				7162A50D1C58704600AB630E /* BundleModelCell.m */,
 				7162A50E1C58704600AB630E /* BundleModelViewController.h */,
 				7162A50F1C58704600AB630E /* BundleModelViewController.m */,
-				7162A5101C58704600AB630E /* CartViewController.h */,
-				7162A5111C58704600AB630E /* CartViewController.m */,
 				7162A5121C58704600AB630E /* EditModelPriceViewController.h */,
 				7162A5131C58704600AB630E /* EditModelPriceViewController.m */,
 				7162A5141C58704600AB630E /* ModelItemCell.h */,
@@ -2379,6 +2379,7 @@
 				71E9F6C21F8B57E40052C78E /* RANetworkTaskDelegate.m in Sources */,
 				712C40B91C731126000E6831 /* ItemNotesViewController.m in Sources */,
 				3CDDB268273A5A0400681F78 /* StrikethroughLabel.m in Sources */,
+				3C4F575928656BA5003C0005 /* CartViewController.m in Sources */,
 				7162A5AD1C58735900AB630E /* TearSheetParamViewController.m in Sources */,
 				7141DD611C5747CE00F7DF59 /* NSData+Base64.m in Sources */,
 				71BBA2431CEAEF0700C91DED /* zip.c in Sources */,
@@ -2548,7 +2549,6 @@
 				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 */,
 				3C8855AA27E85A0C005DC3FA /* ScanCartItemCell.m in Sources */,
@@ -2713,7 +2713,7 @@
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				CURRENT_PROJECT_VERSION = 51205;
+				CURRENT_PROJECT_VERSION = 51252;
 				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -2730,7 +2730,7 @@
 					"$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib",
 					"$(PROJECT_DIR)/GoogleAnalytics/GoogleAnalytics/Libraries",
 				);
-				MARKETING_VERSION = 1.07;
+				MARKETING_VERSION = 1.08;
 				OTHER_LDFLAGS = (
 					"$(inherited)",
 					"-ObjC",
@@ -2757,7 +2757,7 @@
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				CURRENT_PROJECT_VERSION = 51205;
+				CURRENT_PROJECT_VERSION = 51252;
 				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -2774,7 +2774,7 @@
 					"$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib",
 					"$(PROJECT_DIR)/GoogleAnalytics/GoogleAnalytics/Libraries",
 				);
-				MARKETING_VERSION = 1.07;
+				MARKETING_VERSION = 1.08;
 				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>7</integer>
+			<integer>6</integer>
 		</dict>
 	</dict>
 </dict>

+ 90 - 40
RedAnt ERP Mobile/HMLG Scan Order/SO.storyboard

@@ -1545,10 +1545,21 @@ Stock</string>
                                                                 <action selector="onScanDiscount:" destination="oRS-pB-8jo" eventType="touchUpInside" id="d9h-lA-RcO"/>
                                                             </connections>
                                                         </button>
+                                                        <label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="12345678.99" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="boP-G8-Lp6" userLabel="price before discount" customClass="StrikethroughLabel">
+                                                            <rect key="frame" x="300" y="76" width="110" height="21"/>
+                                                            <constraints>
+                                                                <constraint firstAttribute="width" constant="110" id="v3j-Sh-hTs"/>
+                                                            </constraints>
+                                                            <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                            <color key="textColor" red="0.33333333329999998" green="0.33333333329999998" blue="0.33333333329999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                                            <nil key="highlightedColor"/>
+                                                        </label>
                                                     </subviews>
                                                     <constraints>
                                                         <constraint firstItem="ATy-eu-2mi" firstAttribute="leading" secondItem="V3e-A3-y8I" secondAttribute="leading" id="24u-kB-ZTW"/>
                                                         <constraint firstItem="8RN-F1-G0M" firstAttribute="trailing" secondItem="sfo-Yw-I0g" secondAttribute="trailing" id="5gN-4E-b0J"/>
+                                                        <constraint firstItem="boP-G8-Lp6" firstAttribute="top" secondItem="Hlt-a1-Obi" secondAttribute="bottom" constant="8" symbolic="YES" id="5kv-xC-Mgl"/>
+                                                        <constraint firstItem="Hlt-a1-Obi" firstAttribute="leading" secondItem="boP-G8-Lp6" secondAttribute="leading" id="6CT-Ah-YWm"/>
                                                         <constraint firstItem="V3e-A3-y8I" firstAttribute="leading" secondItem="Hlt-a1-Obi" secondAttribute="trailing" constant="15" id="6TO-z7-7Kt"/>
                                                         <constraint firstItem="6dX-9b-w6l" firstAttribute="top" secondItem="3Cs-3s-CCg" secondAttribute="bottom" constant="5" id="87y-Z7-Hjd"/>
                                                         <constraint firstItem="3Cs-3s-CCg" firstAttribute="leading" secondItem="6UY-HP-ApY" secondAttribute="leading" constant="15" id="8sb-DO-kZb"/>
@@ -1562,6 +1573,7 @@ Stock</string>
                                                         <constraint firstAttribute="trailing" secondItem="8RN-F1-G0M" secondAttribute="trailing" constant="20" id="Q90-Vd-eCT"/>
                                                         <constraint firstItem="8RN-F1-G0M" firstAttribute="centerY" secondItem="Hlt-a1-Obi" secondAttribute="centerY" id="R13-ks-goL"/>
                                                         <constraint firstItem="3Cs-3s-CCg" firstAttribute="top" secondItem="6UY-HP-ApY" secondAttribute="top" constant="11" id="RWt-7Z-Ux1"/>
+                                                        <constraint firstItem="Hlt-a1-Obi" firstAttribute="trailing" secondItem="boP-G8-Lp6" secondAttribute="trailing" id="Reb-Rf-V7w"/>
                                                         <constraint firstItem="93p-eO-r5r" firstAttribute="top" secondItem="6dX-9b-w6l" secondAttribute="bottom" constant="7" id="U4m-dk-ipl"/>
                                                         <constraint firstItem="sfo-Yw-I0g" firstAttribute="top" secondItem="3Cs-3s-CCg" secondAttribute="top" id="VHF-PX-bed"/>
                                                         <constraint firstItem="8RN-F1-G0M" firstAttribute="leading" secondItem="S0K-Bu-637" secondAttribute="trailing" constant="15" id="c2w-AI-hFk"/>
@@ -1578,6 +1590,7 @@ Stock</string>
                                                     <outlet property="labelModel" destination="3Cs-3s-CCg" id="bL7-Bb-deE"/>
                                                     <outlet property="labelMpack" destination="sfo-Yw-I0g" id="Vmm-hZ-BfX"/>
                                                     <outlet property="labelNotes" destination="93p-eO-r5r" id="jUe-eq-2M6"/>
+                                                    <outlet property="labelOldPrice" destination="boP-G8-Lp6" id="xzi-lI-1ZK"/>
                                                     <outlet property="labelSubtotal" destination="8RN-F1-G0M" id="SmT-Mi-C57"/>
                                                     <outlet property="labelUnitPrice" destination="Hlt-a1-Obi" id="shy-5B-Yxo"/>
                                                     <outlet property="setpperQTY" destination="S0K-Bu-637" id="lcy-u9-jZk"/>
@@ -1672,7 +1685,7 @@ Stock</string>
                                 <rect key="frame" x="0.0" y="1009" width="744" 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="DdS-4S-1zx" userLabel="total price">
-                                        <rect key="frame" x="487" y="10" width="110" height="20"/>
+                                        <rect key="frame" x="219" y="6" width="110" height="20"/>
                                         <constraints>
                                             <constraint firstAttribute="width" constant="110" id="JkE-9G-otz"/>
                                             <constraint firstAttribute="height" constant="20" id="eFU-xu-5Ku"/>
@@ -1682,7 +1695,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="lRq-Ow-fEk" userLabel="total price">
-                                        <rect key="frame" x="487" y="62" width="110" height="20"/>
+                                        <rect key="frame" x="487" y="6" width="110" height="20"/>
                                         <constraints>
                                             <constraint firstAttribute="height" constant="20" id="Baf-Qx-Zjc"/>
                                             <constraint firstAttribute="width" constant="110" id="dah-IQ-F5m"/>
@@ -1691,18 +1704,18 @@ Stock</string>
                                         <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="" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eiF-G7-95R" userLabel="value">
-                                        <rect key="frame" x="605" y="61.5" width="124" height="20"/>
+                                    <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eiF-G7-95R" userLabel="val_subtotal">
+                                        <rect key="frame" x="605" y="6" width="124" height="20"/>
                                         <constraints>
                                             <constraint firstAttribute="width" constant="124" id="KRd-69-btU"/>
                                             <constraint firstAttribute="height" constant="20" id="cob-nE-6nX"/>
                                         </constraints>
                                         <fontDescription key="fontDescription" type="system" pointSize="16"/>
-                                        <color key="textColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                        <nil key="textColor"/>
                                         <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="8gM-ne-ChU" userLabel="value">
-                                        <rect key="frame" x="333" y="36" width="124" height="20"/>
+                                    <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="8gM-ne-ChU" userLabel="val_cuft">
+                                        <rect key="frame" x="337" y="55.5" width="124" height="20"/>
                                         <constraints>
                                             <constraint firstAttribute="height" constant="20" id="5Nx-rU-92d"/>
                                             <constraint firstAttribute="width" constant="124" id="LBs-do-I4g"/>
@@ -1742,9 +1755,8 @@ 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="IpA-sg-I9m">
-                                        <rect key="frame" x="215" y="36" width="110" height="20"/>
+                                        <rect key="frame" x="250.5" y="55.5" width="78.5" height="20"/>
                                         <constraints>
-                                            <constraint firstAttribute="width" constant="110" id="4la-F2-4NM"/>
                                             <constraint firstAttribute="height" constant="20" id="BSO-lV-Isl"/>
                                         </constraints>
                                         <fontDescription key="fontDescription" type="system" pointSize="16"/>
@@ -1752,7 +1764,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="UVG-on-4aI">
-                                        <rect key="frame" x="487" y="36" width="110" height="20"/>
+                                        <rect key="frame" x="219" y="30.5" width="110" height="20"/>
                                         <constraints>
                                             <constraint firstAttribute="width" constant="110" id="kM6-ac-A26"/>
                                             <constraint firstAttribute="height" constant="20" id="tXP-jf-Jbq"/>
@@ -1772,18 +1784,8 @@ Stock</string>
                                             <action selector="onEditGeneralNotes:" destination="oRS-pB-8jo" eventType="touchUpInside" id="1M2-S8-TH2"/>
                                         </connections>
                                     </button>
-                                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="DcE-qL-jJq">
-                                        <rect key="frame" x="605" y="35.5" width="124" height="20"/>
-                                        <constraints>
-                                            <constraint firstAttribute="height" constant="20" id="6he-ZG-y1N"/>
-                                            <constraint firstAttribute="width" constant="124" id="oco-zZ-8nm"/>
-                                        </constraints>
-                                        <fontDescription key="fontDescription" type="system" pointSize="16"/>
-                                        <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="" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="sS1-r0-cLw">
-                                        <rect key="frame" x="605" y="9.5" width="124" height="20"/>
+                                        <rect key="frame" x="337" y="6" width="124" height="20"/>
                                         <constraints>
                                             <constraint firstAttribute="height" constant="20" id="QK3-oa-eZO"/>
                                             <constraint firstAttribute="width" constant="124" id="r2b-D2-1Q0"/>
@@ -1840,13 +1842,13 @@ Stock</string>
                                         </connections>
                                     </button>
                                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Price Type:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ubF-HT-6Rg">
-                                        <rect key="frame" x="15" y="9.5" width="85" height="21"/>
+                                        <rect key="frame" x="15" y="5.5" width="85" height="21"/>
                                         <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                         <nil key="textColor"/>
                                         <nil key="highlightedColor"/>
                                     </label>
                                     <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="0i6-zY-RD3">
-                                        <rect key="frame" x="110" y="5" width="100" height="30"/>
+                                        <rect key="frame" x="110" y="1" width="100" height="30"/>
                                         <constraints>
                                             <constraint firstAttribute="width" constant="100" id="zeS-YR-DtO"/>
                                         </constraints>
@@ -1868,47 +1870,93 @@ Stock</string>
                                             <action selector="onScanChangeCustomerType:" destination="oRS-pB-8jo" eventType="touchUpInside" id="bfl-wr-XOX"/>
                                         </connections>
                                     </button>
+                                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Surcharge Fee:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pfb-lq-2lh">
+                                        <rect key="frame" x="481" y="30" width="116" 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="Total Price:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="y4m-c1-DFh">
+                                        <rect key="frame" x="512" y="55" width="85" 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="Dx2-do-qf9" userLabel="val_total">
+                                        <rect key="frame" x="605" y="55" width="124" 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="Dd5-g0-8Ub" userLabel="val_surcharge">
+                                        <rect key="frame" x="605" y="30" width="124" 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="" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="DcE-qL-jJq">
+                                        <rect key="frame" x="337" y="30.5" width="124" height="20"/>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="20" id="6he-ZG-y1N"/>
+                                            <constraint firstAttribute="width" constant="124" id="oco-zZ-8nm"/>
+                                        </constraints>
+                                        <fontDescription key="fontDescription" type="system" pointSize="16"/>
+                                        <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                        <nil key="highlightedColor"/>
+                                    </label>
                                 </subviews>
                                 <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <constraints>
                                     <constraint firstAttribute="bottom" secondItem="MkS-tT-MEd" secondAttribute="bottom" constant="9" id="0NU-Hk-RyZ"/>
-                                    <constraint firstItem="DcE-qL-jJq" firstAttribute="trailing" secondItem="sS1-r0-cLw" secondAttribute="trailing" id="0Oq-Tl-aOo"/>
                                     <constraint firstAttribute="trailing" secondItem="Prh-BQ-CkY" secondAttribute="trailing" constant="15" id="0by-01-SwR"/>
                                     <constraint firstItem="3hY-G2-bAt" firstAttribute="leading" secondItem="g1j-nr-vEW" secondAttribute="trailing" constant="20" id="1Fc-Xk-22e"/>
                                     <constraint firstItem="Prh-BQ-CkY" firstAttribute="leading" secondItem="MkS-tT-MEd" secondAttribute="trailing" constant="20" id="2Ei-HL-QLf"/>
                                     <constraint firstAttribute="bottom" secondItem="EcM-RL-hry" secondAttribute="bottom" constant="10" id="2Z3-SC-CW7"/>
-                                    <constraint firstItem="DcE-qL-jJq" firstAttribute="firstBaseline" secondItem="UVG-on-4aI" secondAttribute="firstBaseline" id="5kH-Vg-fzN"/>
-                                    <constraint firstItem="sS1-r0-cLw" firstAttribute="firstBaseline" secondItem="DdS-4S-1zx" secondAttribute="firstBaseline" id="7ox-bV-elE"/>
-                                    <constraint firstItem="8gM-ne-ChU" firstAttribute="centerY" secondItem="IpA-sg-I9m" secondAttribute="centerY" id="7r9-02-GvP"/>
+                                    <constraint firstItem="Dx2-do-qf9" firstAttribute="trailing" secondItem="eiF-G7-95R" secondAttribute="trailing" id="6Um-xe-vpu"/>
+                                    <constraint firstItem="sS1-r0-cLw" firstAttribute="centerY" secondItem="DdS-4S-1zx" secondAttribute="centerY" id="7tL-kh-m4G"/>
+                                    <constraint firstItem="Dx2-do-qf9" firstAttribute="leading" secondItem="y4m-c1-DFh" secondAttribute="trailing" constant="8" id="7zD-OG-qN5"/>
+                                    <constraint firstItem="8gM-ne-ChU" firstAttribute="leading" secondItem="IpA-sg-I9m" secondAttribute="trailing" constant="8" id="8LW-Qd-1SA"/>
+                                    <constraint firstItem="sS1-r0-cLw" firstAttribute="leading" secondItem="DdS-4S-1zx" secondAttribute="trailing" constant="8" id="9kd-tB-d7V"/>
                                     <constraint firstAttribute="height" constant="124" id="Adt-4W-5pA"/>
-                                    <constraint firstItem="DdS-4S-1zx" firstAttribute="top" secondItem="G78-MN-iaL" secondAttribute="top" constant="10" id="BjC-bA-ALS"/>
-                                    <constraint firstItem="UVG-on-4aI" firstAttribute="top" secondItem="DdS-4S-1zx" secondAttribute="bottom" constant="6" id="Esb-kd-FZb"/>
                                     <constraint firstItem="3hY-G2-bAt" firstAttribute="bottom" secondItem="XBV-xN-bZf" secondAttribute="bottom" id="FJg-9B-RhK"/>
+                                    <constraint firstItem="sS1-r0-cLw" firstAttribute="trailing" secondItem="8gM-ne-ChU" secondAttribute="trailing" id="Fdi-w6-6FZ"/>
+                                    <constraint firstItem="y4m-c1-DFh" firstAttribute="centerY" secondItem="IpA-sg-I9m" secondAttribute="centerY" id="Ier-bH-HNo"/>
                                     <constraint firstItem="Prh-BQ-CkY" firstAttribute="leading" secondItem="3hY-G2-bAt" secondAttribute="trailing" constant="20" id="JNx-Ee-BQv"/>
                                     <constraint firstItem="XBV-xN-bZf" firstAttribute="leading" secondItem="jbJ-5K-Qgr" secondAttribute="trailing" constant="20" id="Jh4-cl-d5N"/>
-                                    <constraint firstItem="lRq-Ow-fEk" firstAttribute="top" secondItem="UVG-on-4aI" secondAttribute="bottom" constant="6" id="JqM-06-bA1"/>
-                                    <constraint firstItem="UVG-on-4aI" firstAttribute="centerY" secondItem="IpA-sg-I9m" secondAttribute="centerY" id="L0g-Gm-0Sm"/>
+                                    <constraint firstItem="Dx2-do-qf9" firstAttribute="width" secondItem="eiF-G7-95R" secondAttribute="width" id="Jqd-oi-Yb2"/>
                                     <constraint firstItem="g1j-nr-vEW" firstAttribute="leading" secondItem="XBV-xN-bZf" secondAttribute="trailing" constant="20" id="MD2-e8-SCH"/>
                                     <constraint firstItem="Fkc-Lk-5jB" firstAttribute="leading" secondItem="G78-MN-iaL" secondAttribute="leading" constant="15" id="MEJ-ty-xl7"/>
-                                    <constraint firstItem="Prh-BQ-CkY" firstAttribute="trailing" secondItem="sS1-r0-cLw" secondAttribute="trailing" id="MsO-PZ-a84"/>
+                                    <constraint firstItem="lRq-Ow-fEk" firstAttribute="centerY" secondItem="DdS-4S-1zx" secondAttribute="centerY" id="MSq-ha-BfK"/>
+                                    <constraint firstItem="Dd5-g0-8Ub" firstAttribute="trailing" secondItem="Dx2-do-qf9" secondAttribute="trailing" id="OFt-aB-Lir"/>
                                     <constraint firstItem="Fkc-Lk-5jB" firstAttribute="top" secondItem="G78-MN-iaL" secondAttribute="top" constant="10" id="R0N-8I-YGp"/>
+                                    <constraint firstItem="Dd5-g0-8Ub" firstAttribute="leading" secondItem="pfb-lq-2lh" secondAttribute="trailing" constant="8" id="S4u-zG-m5P"/>
                                     <constraint firstItem="EcM-RL-hry" firstAttribute="leading" secondItem="G78-MN-iaL" secondAttribute="leading" constant="15" id="U1h-9m-98l"/>
-                                    <constraint firstItem="DdS-4S-1zx" firstAttribute="centerY" secondItem="ubF-HT-6Rg" secondAttribute="centerY" id="X2N-xu-p9v"/>
+                                    <constraint firstItem="Dx2-do-qf9" firstAttribute="top" secondItem="Dd5-g0-8Ub" secondAttribute="bottom" constant="4" id="UCm-qj-4i1"/>
+                                    <constraint firstItem="pfb-lq-2lh" firstAttribute="centerY" secondItem="UVG-on-4aI" secondAttribute="centerY" id="UgX-Nr-jCj"/>
+                                    <constraint firstItem="3hY-G2-bAt" firstAttribute="top" secondItem="y4m-c1-DFh" secondAttribute="bottom" constant="8" symbolic="YES" id="VbZ-74-TKJ"/>
+                                    <constraint firstItem="Dx2-do-qf9" firstAttribute="centerY" secondItem="y4m-c1-DFh" secondAttribute="centerY" id="X2k-c2-n9v"/>
                                     <constraint firstItem="g1j-nr-vEW" firstAttribute="bottom" secondItem="XBV-xN-bZf" secondAttribute="bottom" id="ZAm-rp-exn"/>
-                                    <constraint firstItem="8gM-ne-ChU" firstAttribute="leading" secondItem="IpA-sg-I9m" secondAttribute="trailing" constant="8" id="aSt-SN-Z33"/>
-                                    <constraint firstItem="DdS-4S-1zx" firstAttribute="leading" secondItem="8gM-ne-ChU" secondAttribute="trailing" constant="30" id="akl-rO-LQ6"/>
-                                    <constraint firstItem="DcE-qL-jJq" firstAttribute="leading" secondItem="UVG-on-4aI" secondAttribute="trailing" constant="8" id="btY-O9-P6i"/>
+                                    <constraint firstItem="Dd5-g0-8Ub" firstAttribute="centerY" secondItem="pfb-lq-2lh" secondAttribute="centerY" id="arw-Jf-7XY"/>
                                     <constraint firstItem="0i6-zY-RD3" firstAttribute="leading" secondItem="ubF-HT-6Rg" secondAttribute="trailing" constant="10" id="cY6-Bd-slj"/>
                                     <constraint firstAttribute="bottom" secondItem="Prh-BQ-CkY" secondAttribute="bottom" constant="10" id="d7A-oO-Jo6"/>
+                                    <constraint firstItem="eiF-G7-95R" firstAttribute="centerY" secondItem="lRq-Ow-fEk" secondAttribute="centerY" id="eLd-54-oYn"/>
                                     <constraint firstItem="ubF-HT-6Rg" firstAttribute="leading" secondItem="EcM-RL-hry" secondAttribute="leading" id="eRY-Ny-QmT"/>
                                     <constraint firstItem="Prh-BQ-CkY" firstAttribute="bottom" secondItem="XBV-xN-bZf" secondAttribute="bottom" id="eSI-6t-C2i"/>
+                                    <constraint firstItem="eiF-G7-95R" firstAttribute="centerY" secondItem="lRq-Ow-fEk" secondAttribute="centerY" id="gHc-dR-peo"/>
+                                    <constraint firstItem="pfb-lq-2lh" firstAttribute="leading" secondItem="DcE-qL-jJq" secondAttribute="trailing" constant="20" id="gMX-6c-gtH"/>
+                                    <constraint firstItem="8gM-ne-ChU" firstAttribute="centerY" secondItem="IpA-sg-I9m" secondAttribute="centerY" id="gqF-yN-NoD"/>
                                     <constraint firstItem="jbJ-5K-Qgr" firstAttribute="firstBaseline" secondItem="EcM-RL-hry" secondAttribute="firstBaseline" id="hvb-Hs-p0i"/>
-                                    <constraint firstItem="sS1-r0-cLw" firstAttribute="leading" secondItem="DdS-4S-1zx" secondAttribute="trailing" constant="8" id="lSr-h4-TVl"/>
-                                    <constraint firstItem="eiF-G7-95R" firstAttribute="trailing" secondItem="sS1-r0-cLw" secondAttribute="trailing" id="nIM-HS-Y70"/>
+                                    <constraint firstItem="DcE-qL-jJq" firstAttribute="leading" secondItem="UVG-on-4aI" secondAttribute="trailing" constant="8" id="lra-rF-9Kp"/>
+                                    <constraint firstAttribute="trailing" secondItem="Dx2-do-qf9" secondAttribute="trailing" constant="15" id="n0m-0v-x5e"/>
+                                    <constraint firstItem="DcE-qL-jJq" firstAttribute="trailing" secondItem="8gM-ne-ChU" secondAttribute="trailing" id="nPe-ck-WmZ"/>
                                     <constraint firstItem="jbJ-5K-Qgr" firstAttribute="leading" secondItem="EcM-RL-hry" secondAttribute="trailing" id="o2n-hY-mEQ"/>
                                     <constraint firstItem="0i6-zY-RD3" firstAttribute="centerY" secondItem="ubF-HT-6Rg" secondAttribute="centerY" id="odm-FA-KLw"/>
-                                    <constraint firstItem="eiF-G7-95R" firstAttribute="leading" secondItem="lRq-Ow-fEk" secondAttribute="trailing" constant="8" id="rrE-cA-toh"/>
-                                    <constraint firstItem="eiF-G7-95R" firstAttribute="firstBaseline" secondItem="lRq-Ow-fEk" secondAttribute="firstBaseline" id="ycs-nm-Vmu"/>
+                                    <constraint firstItem="y4m-c1-DFh" firstAttribute="top" secondItem="pfb-lq-2lh" secondAttribute="bottom" constant="4" id="vMz-bA-3MY"/>
+                                    <constraint firstItem="DcE-qL-jJq" firstAttribute="centerY" secondItem="UVG-on-4aI" secondAttribute="centerY" id="w9o-01-z1E"/>
+                                    <constraint firstItem="DdS-4S-1zx" firstAttribute="centerY" secondItem="ubF-HT-6Rg" secondAttribute="centerY" id="xuh-fD-gA1"/>
+                                    <constraint firstItem="pfb-lq-2lh" firstAttribute="top" secondItem="lRq-Ow-fEk" secondAttribute="bottom" constant="4" id="xum-Fh-kcO"/>
+                                    <constraint firstItem="eiF-G7-95R" firstAttribute="leading" secondItem="lRq-Ow-fEk" secondAttribute="trailing" constant="8" id="zdd-AC-WId"/>
+                                    <constraint firstItem="Dd5-g0-8Ub" firstAttribute="width" secondItem="eiF-G7-95R" secondAttribute="width" id="zy5-1Q-Hx3"/>
                                 </constraints>
                             </view>
                         </subviews>
@@ -1938,6 +1986,8 @@ Stock</string>
                         <outlet property="emailButton" destination="g1j-nr-vEW" id="FhI-0v-CCx"/>
                         <outlet property="itemListTable" destination="3W5-s1-uRe" id="dc7-kL-vlD"/>
                         <outlet property="labelTotal" destination="eiF-G7-95R" id="ZB7-6l-YLY"/>
+                        <outlet property="labelTotalPrice" destination="Dx2-do-qf9" id="oSu-rJ-PtB"/>
+                        <outlet property="labelTotalSurcharge" destination="Dd5-g0-8Ub" id="Sc1-ba-EIu"/>
                         <outlet property="labelTotalcuft" destination="IpA-sg-I9m" id="gvT-Bh-Cug"/>
                         <outlet property="label_cuft" destination="8gM-ne-ChU" id="Ovj-aG-Fj6"/>
                         <outlet property="label_items" destination="DcE-qL-jJq" id="hBY-Ws-0Sw"/>

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

@@ -7,7 +7,7 @@
 //
 
 #import <UIKit/UIKit.h>
-
+#import "StrikethroughLabel.h"
 NS_ASSUME_NONNULL_BEGIN
 
 @interface ScanCartItemCell : UITableViewCell
@@ -28,6 +28,7 @@ NS_ASSUME_NONNULL_BEGIN
 -(void) init_Stepper:(int) step max:(int) max min:(int)min value:(int)value;
 @property (weak, nonatomic) IBOutlet UIButton *btnScanDiscount;
 @property (nonatomic , copy) void (^onReturnQTY)(int qty , NSDictionary* ext);
+@property (weak, nonatomic) IBOutlet StrikethroughLabel *labelOldPrice;
 @end
 
 NS_ASSUME_NONNULL_END

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

@@ -243,7 +243,7 @@
     
     
 //    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-    NSString* price = [NSString stringWithFormat:@"%.2f",self.unit_price*count*(1-self.discount/100.0) ];
+//    NSString* price = [NSString stringWithFormat:@"%.2f",self.unit_price*count*(1-self.discount/100.0) ];
 //    if(appDelegate.can_see_price&&appDelegate.price_hidden==false)
 //    {
 //        
@@ -257,7 +257,7 @@
     if(self.noprice&&self.unit_price==0.0)
         self.labelSubtotal.text =@"No Price";
     else
-        self.labelSubtotal.text =price;
+        self.labelSubtotal.text =[RAConvertor currencyNumber:self.unit_price*count*(1-self.discount/100.0)];//price;
     
     self.editQTY.text =[NSString stringWithFormat:@"%d",count];
 }

+ 59 - 45
RedAnt ERP Mobile/HMLG Scan Order/ScanListCell.m

@@ -86,19 +86,18 @@
             jitem[@"cart_item_id"]=[NSUUID UUID].UUIDString;
             
             NSString * unit_price;
-            if(RASingleton.sharedInstance.price_type==2)
+            if(_modelJson [@"net_price"])
+                unit_price=_modelJson[@"price3"];
+            else if(_modelJson [@"special_price"])
             {
-                unit_price=jitem[@"price2"];
-            }
-            else if(RASingleton.sharedInstance.price_type==1)
-            {
-                unit_price=jitem[@"price1"];
+                unit_price= _modelJson[@"price2"];
             }
             else
             {
-                unit_price=jitem[@"price0"];
+                unit_price= _modelJson[@"price1"];
             }
-            if(unit_price.length==0)
+
+            if([unit_price isEqualToString:@"N/A"])
                 unit_price = @"0";
             else
             {
@@ -108,6 +107,7 @@
             
             
             jitem[@"unit_price"] = unit_price;
+            jitem[@"erp_unit_price"] = unit_price;
             
             
             section[[NSString stringWithFormat:@"item_%i",count]] = jitem;
@@ -159,37 +159,51 @@
     _labelCuft.text=_modelJson[@"unit_cuft"];
     _labelOrigin.text=origin;
     _labelPort.text=port;
-    NSString* price0=_modelJson[@"price0"];
-    NSString* price1=_modelJson[@"price1"];
-    NSString* price2;
+    NSString* price0=_modelJson[@"price0"]; //DDP
+    NSString* price1=_modelJson[@"price1"]; //WHSE
+    NSString* price2=_modelJson[@"price2"]; //SHOW
+    NSString* price3=_modelJson[@"price3"]; //%25
  
-    if(price0.length==0)
-        price0 = @"N/A";
-    else
+    if(![price0 isEqualToString: @"N/A"])
         price0 = [NSString stringWithFormat:@"%.2f",[_modelJson[@"price0"] doubleValue]];
-    
-    
-    if(price1.length==0)
-        price1 = @"N/A";
-    else
+    if(![price1 isEqualToString: @"N/A"])
         price1 = [NSString stringWithFormat:@"%.2f",[_modelJson[@"price1"] doubleValue]];
-    
-    if(![price1 isEqualToString:@"N/A"])
+    if(![price2 isEqualToString: @"N/A"])
     {
-        price2 =  [NSString stringWithFormat:@"%.2f",[_modelJson[@"price1"] doubleValue] *1.25];
-        _modelJson[@"price2"]= price2;
+        price2 = [NSString stringWithFormat:@"%.2f",[_modelJson[@"price2"] doubleValue]];
+        _modelJson [@"special_price"] = @true;
     }
-    else
+    if(![price3 isEqualToString: @"N/A"])
+        price3 = [NSString stringWithFormat:@"%.2f",[_modelJson[@"price3"] doubleValue]];
+
+    if(![_modelJson [@"special_price"] boolValue]&& ![price1 isEqualToString: @"N/A"] && [price1 isEqual:price3])
     {
-        price2=@"N/A";
+        _modelJson [@"net_price"] = @true;
     }
     
     
-
+//
+//    if(![price1 isEqualToString:@"N/A"])
+//    {
+//        price2 =  [NSString stringWithFormat:@"%.2f",[_modelJson[@"price1"] doubleValue] *1.25];
+//        _modelJson[@"price2"]= price2;
+//    }
+//    else
+//    {
+//        price2=@"N/A";
+//    }
+//
     
-    _labelPriceCTNR.text=price0;
-    _labelPriceNCA.text=price1;
-    _labelPrice25p.text=price2;
+ 
+    if([price0 isEqualToString:@"N/A"])
+        _labelPriceCTNR.text= price0;
+    else
+        _labelPriceCTNR.text=[RAConvertor currencyNumber:[price0 floatValue]];
+    if([price3 isEqualToString:@"N/A"])
+        _labelPriceNCA.text= price3;
+    else
+        _labelPriceNCA.text=[RAConvertor currencyNumber:[price3 floatValue]];
+//    _labelPrice25p.text=price2;
     
     
     NSString * available=_modelJson[@"available"];
@@ -206,27 +220,27 @@
         unit_cuft = [NSString stringWithFormat:@"%.2f", [_modelJson[@"unit_cuft"] doubleValue]];
     }
     
-    NSString * unit_price;
-    if(RASingleton.sharedInstance.price_type==2)
-    {
-        unit_price=_modelJson[@"price2"];
-    }
-    else if(RASingleton.sharedInstance.price_type==1)
-    {
-        unit_price=_modelJson[@"price1"];
-    }
-    else
+    NSString * cell_price;
+
+    if(RASingleton.sharedInstance.price_type==1)
     {
-        unit_price=_modelJson[@"price0"];
+//        if(_modelJson [@"net_price"])
+            cell_price=_modelJson[@"price3"];
+//        else if(_modelJson [@"special_price"])
+//        {
+//            unit_price= _modelJson[@"price2"];
+//        }
+//        else
+//        {
+//            unit_price= _modelJson[@"price1"];
+//        }
     }
-    if(unit_price.length==0)
-        unit_price = @"N/A";
     else
     {
-        
-        unit_price = [NSString stringWithFormat:@"%.2f", [unit_price doubleValue]];
+        cell_price=_modelJson[@"price0"];
     }
     
+    
 
     
     
@@ -235,7 +249,7 @@
     NSString * mpack=_modelJson[@"stockUom"];
     _modelJson[@"count"]=_modelJson[@"stockUom"];
     _modelJson[@"cuft"] = @([mpack intValue]* [unit_cuft doubleValue]);
-    _modelJson[@"subtotal_price"] = @([mpack intValue]* [unit_price doubleValue]);
+    _modelJson[@"subtotal_price"] = @([mpack intValue]* [cell_price doubleValue]);
 
 
 }

+ 36 - 3
RedAnt ERP Mobile/HMLG Scan Order/ScanModelListCell.m

@@ -8,8 +8,9 @@
 
 #import "ScanModelListCell.h"
 
-
+#import "RAConvertor.h"
 #import "RAUtils.h"
+#import "RASingleton.h"
 
 
 #define NUMBERS @"0123456789\n"
@@ -44,8 +45,40 @@
     _labelCuft.text=_modelJson[@"unit_cuft"];
     _labelOrigin.text=_modelJson[@"origin"];
     _labelPort.text=_modelJson[@"port"];
-    _labelPriceCTNR.text=_modelJson[@"price0"];
-    _labelPriceNCA.text=_modelJson[@"price1"];
+    
+    NSString * cell_price;
+    if(RASingleton.sharedInstance.price_type==1)
+    {
+//        if(_modelJson [@"net_price"])
+            cell_price=_modelJson[@"price3"];
+//            jitem[@"unit_price"] =jitem[@"price3"];
+//            jitem[@"erp_unit_price"] =jitem[@"price3"];
+//        else if(_modelJson [@"special_price"])
+//        {
+//            unit_price= _modelJson[@"price2"];
+//        }
+//        else
+//        {
+//            unit_price= _modelJson[@"price1"];
+//        }
+    }
+    else
+    {
+        cell_price=_modelJson[@"price0"];
+//            jitem[@"unit_price"] =jitem[@"price0"];
+//            jitem[@"erp_unit_price"] =jitem[@"price0"];
+    }
+    
+    
+    if([_modelJson[@"price0"] isEqualToString:@"N/A"])
+        _labelPriceCTNR.text=_modelJson[@"price0"];
+    else
+        _labelPriceCTNR.text=[RAConvertor currencyNumber:[_modelJson[@"price0"] floatValue]];
+    
+    if([cell_price isEqualToString:@"N/A"])
+        _labelPriceNCA.text=cell_price;//_modelJson[@"unit_price"];
+    else
+        _labelPriceNCA.text=[RAConvertor currencyNumber:[cell_price floatValue]];
     _labelPrice25p.text=_modelJson[@"price2"];
     _labelAvailable.text=_modelJson[@"available"];
         _editQTY.text=[_modelJson[@"count"] stringValue];

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

@@ -85,88 +85,103 @@
             unit_cuft = [NSString stringWithFormat:@"%.2f", [jitem[@"unit_cuft"] doubleValue]];
         }
         
-//        NSString * port=item[6];
-//        if(port.length==0)
-//            port = @"N/A";
-//
-//        NSString * origin=item[7];
-//        if(origin.length==0)
-//            origin = @"N/A";
-//
-//        NSString * available=item[8];
-//        if(available.length==0)
-//            available = @"N/A";
-//
-//        NSString* price0;
-//        NSString* price1;
-//        NSString* price2;
-//        NSString* price3;
+        NSString* price0=jitem[@"price0"]; //DDP
+        NSString* price1=jitem[@"price1"]; //WHSE
+        NSString* price2=jitem[@"price2"]; //SHOW
+        NSString* price3=jitem[@"price3"]; //%25
         NSDictionary *addressDic = [[NSUserDefaults standardUserDefaults] valueForKey:@"ScanAddress"];
         if (addressDic) {
             
             int price_index =0;//[addressDic[ @"price_index"] intValue];
-    //        NSString* ia=addressDic[@"internalAddress"];
-    //        NSString* ea=addressDic[@"externalAddress"];
-    //        NSString* sa=addressDic[@"serverAddress"];
-    //        if(sa.length==0)
-    //        {
-    //            if(ea.length>0)
-    //                sa=ea;
-    //            else if(ia.length>0)
-    //            sa=ia;
-    //        }
-    //        NSString* server_name=[addressDic objectForKey:@"name"];
+   
             
             int idx = 9+price_index;
 
-//
-//            price0=item[idx];
-//            if(price0.length==0)
-//                price0 = @"N/A";
-//            else
-//                price0 = [NSString stringWithFormat:@"%.2f",[item[idx] doubleValue]];
-//
-//            price1=item[idx+1];
-//            if(price1.length==0)
-//                price1 = @"N/A";
-//            else
-//                price1 = [NSString stringWithFormat:@"%.2f",[item[idx+1] doubleValue]];
-//
-//            if(![price1 isEqualToString:@"N/A"])
-//            {
-//                price2 =  [NSString stringWithFormat:@"%.2f",[item[idx+1] doubleValue] *1.25];
-//            }
-//            else
+
+        }
+
+        
+        if(![price0 isEqualToString: @"N/A"])
+            price0 = [NSString stringWithFormat:@"%.2f",[jitem[@"price0"] doubleValue]];
+        if(![price1 isEqualToString: @"N/A"])
+            price1 = [NSString stringWithFormat:@"%.2f",[jitem[@"price1"] doubleValue]];
+        if(![price2 isEqualToString: @"N/A"])
+        {
+            price2 = [NSString stringWithFormat:@"%.2f",[jitem[@"price2"] doubleValue]];
+            jitem [@"special_price"] = @true;
+        }
+        if(![price3 isEqualToString: @"N/A"])
+            price3 = [NSString stringWithFormat:@"%.2f",[jitem[@"price3"] doubleValue]];
+
+        if(![jitem [@"special_price"] boolValue]&& ![price1 isEqualToString: @"N/A"] && [price1 isEqual:price3])
+        {
+            jitem [@"net_price"] = @true;
+        }
+        
+        
+//            if(RASingleton.sharedInstance.price_type==3)
 //            {
-//                price2 = @"N/A";
+//                jitem[@"unit_price"] =jitem[@"price3"];
 //            }
+//        if(RASingleton.sharedInstance.price_type==2)
+//        {
+//            jitem[@"unit_price"] =jitem[@"price2"];
+//        }
+//        else if(RASingleton.sharedInstance.price_type==1)
+//        {
+//            jitem[@"unit_price"] =jitem[@"price1"];
+//        }
+//        else
+//        {
+//            jitem[@"unit_price"] =jitem[@"price0"];
+//        }
+        
+        NSString * cell_price;
+        if(RASingleton.sharedInstance.price_type==1)
+        {
+    //        if(_modelJson [@"net_price"])
+                cell_price=jitem[@"price3"];
+//            jitem[@"unit_price"] =jitem[@"price3"];
+//            jitem[@"erp_unit_price"] =jitem[@"price3"];
+    //        else if(_modelJson [@"special_price"])
+    //        {
+    //            unit_price= _modelJson[@"price2"];
+    //        }
+    //        else
+    //        {
+    //            unit_price= _modelJson[@"price1"];
+    //        }
+        }
+        else
+        {
+            cell_price=jitem[@"price0"];
+//            jitem[@"unit_price"] =jitem[@"price0"];
+//            jitem[@"erp_unit_price"] =jitem[@"price0"];
         }
-//
-//
-//
-//
-//        jitem[@"product_id"]= pid;
-//        jitem[@"model"] =model;
-//        jitem[@"description"] = description;
-//
         
-            if(RASingleton.sharedInstance.price_type==3)
-            {
-                jitem[@"unit_price"] =jitem[@"price3"];
-            }
-        if(RASingleton.sharedInstance.price_type==2)
+        NSString * unit_price;
+        if(jitem [@"net_price"])
+            unit_price=jitem[@"price3"];
+        else if(jitem [@"special_price"])
         {
-            jitem[@"unit_price"] =jitem[@"price2"];
+            unit_price= jitem[@"price2"];
         }
-        else if(RASingleton.sharedInstance.price_type==1)
+        else
         {
-            jitem[@"unit_price"] =jitem[@"price1"];
+            unit_price= jitem[@"price1"];
         }
+
+        if([unit_price isEqualToString:@"N/A"])
+            unit_price = @"0";
         else
         {
-            jitem[@"unit_price"] =jitem[@"price0"];
+            
+            unit_price = [NSString stringWithFormat:@"%.2f", [unit_price doubleValue]];
         }
         
+                    jitem[@"unit_price"] =unit_price;
+                    jitem[@"erp_unit_price"] =unit_price;
+        
 //        jitem[@"price0"] =price0;
 //        jitem[@"price1"] =price1;
 //        jitem[@"price2"] =price2;
@@ -175,7 +190,7 @@
             jitem[@"count"]=@"0";
         else
             jitem[@"count"] = mpack;
-        jitem[@"subtotal_price"] = @([mpack intValue]* [jitem[@"unit_price"] doubleValue]);
+        jitem[@"subtotal_price"] = @([mpack intValue]* [cell_price doubleValue]);//@([mpack intValue]* [jitem[@"unit_price"] doubleValue]);
 
 //        jitem[@"dimension"] = dimension;
 //        jitem[@"unit_cuft"] = unit_cuft;
@@ -197,18 +212,29 @@
         
         if(RASingleton.sharedInstance.scan_list == nil)
             RASingleton.sharedInstance.scan_list = [NSMutableArray new];
-        int idx = [RASingleton.sharedInstance.scan_list indexOfObject:jitem];
-        if(idx>=0)
+        
+        for(int sli=0;sli<RASingleton.sharedInstance.scan_list.count;sli++)
         {
-            //如果存在,移动到最前。
-            [RASingleton.sharedInstance.scan_list removeObject:jitem];
-            
+            if([RASingleton.sharedInstance.scan_list[sli][@"product_id"] isEqualToString:jitem[@"product_id"]])
+            {
+                [RASingleton.sharedInstance.scan_list removeObject:jitem];
+            }
+
         }
         if(RASingleton.sharedInstance.scan_list.count>=200)
            [RASingleton.sharedInstance.scan_list removeLastObject];
         [RASingleton.sharedInstance.scan_list insertObject:jitem atIndex:0];
-        
         [ActiveViewController Notify:@"ScanHistoryViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
+//        int idx = [RASingleton.sharedInstance.scan_list indexOfObject:jitem];
+//        if(idx>=0)
+//        {
+//            //如果存在,移动到最前。
+//
+//
+//        }
+
+        
+      
         
         
     }

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

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

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

@@ -1683,7 +1683,7 @@
             }
             cell.labelprice.frame = price_frame;
             cell.label_so.text=so;
-            cell.labelprice.text=price;
+            cell.labelprice.text=[RAConvertor currencyNumber:(price.floatValue)];//price;
             cell.label_date.text=purchase_time;
             cell.label_contact.text=customer_name;
             cell.label_model.hidden = false;
@@ -1743,7 +1743,7 @@
             }
             cell.labelprice.frame = price_frame;
             cell.label_so.text=so;
-            cell.labelprice.text=price;
+            cell.labelprice.text=[RAConvertor currencyNumber:(price.floatValue)];//price;
             cell.label_date.text=purchase_time;
             cell.label_contact.text=customer_name;
             cell.label_model.hidden = false;

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

@@ -243,7 +243,7 @@
     {
 //        self.scan_val = @"[[\"1111\",\"name0\",\"description\",\"10.1 X 20.2 X 30.3\",\"2\",\"12.34\",\"VIET\",\"VCSF\",\"May\",\"123.45\",\"234.56\",\"123.45\",\"234.56\",\"123.45\",\"234.56\",\"123.45\",\"234.56\",\"123.45\",\"234.56\",\"123.45\",\"234.56\",\"123.45\",\"234.56\",\"123.45\",\"234.56\"],[\"2222\",\"name1\",\"description\",\"10.1 X 20.2 X 30.3\",\"2\",\"12.34\",\"VIET\",\"VCSF\",\"May\",\"123.45\",\"234.56\",\"123.45\",\"234.56\",\"123.45\",\"234.56\",\"123.45\",\"234.56\",\"123.45\",\"234.56\",\"123.45\",\"234.56\",\"123.45\",\"234.56\",\"123.45\",\"234.56\"]]";
         
-        self.scan_val = @"[\"model_123\",\"model_456\",\"model_567\"]";
+        self.scan_val =@"[\"1000A70AQ\",\"1000A70BK\",\"1000A70WH\",\"1002A70BK\"]";// @"[\"1002A70BK\"]";// 
         [self addtocart];
     }
 

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

@@ -6,6 +6,9 @@
 //  Copyright (c) 2014年 United Software Applications, Inc. All rights reserved.
 //
 
+// SCANNER ORDER  CART
+
+
 #import <UIKit/UIKit.h>
 //#import "CommonGridViewController.h"
 
@@ -28,12 +31,15 @@
 @property (strong, nonatomic) IBOutlet UIButton *btndelete;
 @property (strong, nonatomic)  NSIndexPath *indexPath;
 @property double total;
+@property double surcharge;
 @property double total_cuft;
 @property double total_weight;
 @property int total_carton;
 @property int total_item;
 @property int total_QTY;
 @property bool edit_check;
+@property (weak, nonatomic) IBOutlet UILabel *labelTotalPrice;
+@property (weak, nonatomic) IBOutlet UILabel *labelTotalSurcharge;
 
 //@property (weak, nonatomic) IBOutlet UIButton *btnScanDiscount;
 

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

@@ -1385,10 +1385,19 @@
                 
                 if([name isEqualToString:@"totalPrice"])
                 {
-                    item[@"value"] = [NSString stringWithFormat:@"%.2f",self.total];
+                    item[@"value"] = [RAConvertor currencyNumber:self.total+self.surcharge];//[NSString stringWithFormat:@"%.2f",self.total+self.surcharge];
+                    section[[NSString stringWithFormat:@"item_%d",j]] = item;
+                }
+                else if([name isEqualToString:@"subtotalPrice"])
+                {
+                    item[@"value"] = [RAConvertor currencyNumber:self.total];//[NSString stringWithFormat:@"%.2f",self.total];
+                    section[[NSString stringWithFormat:@"item_%d",j]] = item;
+                }
+                else if([name isEqualToString:@"surcharge"])
+                {
+                    item[@"value"] = [RAConvertor currencyNumber:self.surcharge];//[NSString stringWithFormat:@"%.2f",self.surcharge];
                     section[[NSString stringWithFormat:@"item_%d",j]] = item;
                 }
-                
                 
             }
             
@@ -1443,7 +1452,7 @@
         RASingleton.sharedInstance.scan_cart=cartTemplate;//[[RAConvertor data2dict:json] mutableCopy];
     }
     
-    UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:@"Change Price" message:nil preferredStyle:UIAlertControllerStyleAlert];
+    UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:@"Change Price Type" message:nil preferredStyle:UIAlertControllerStyleAlert];
     UIAlertAction *action1 = [UIAlertAction actionWithTitle:@"DDP" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
 
 //        self.btnPrice.titleLabel.text = @"FOB CTNR";
@@ -2284,30 +2293,32 @@
         if(discount>0)
             bmodify=true;
         
-        NSString* notes = [item_json valueForKey:@"note"];
-        if(notes.length==0)
-            notes=@"";
-        if(bmodify)
-        {
-            if([notes isEqualToString:@""])
-                notes=@"PRICE MODIFIED";
-
-            NSRange range;
-            range = [notes rangeOfString:@"PRICE MODIFIED"];
-            if (range.location != NSNotFound) {
-                
-            }else{
-               notes= [notes stringByAppendingString:@"\nPRICE MODIFIED"];
-            }
-        }
-        else
-            
-        {
-            notes =@"";
-        }
+//        NSString* notes = [item_json valueForKey:@"note"];
+//        if(notes.length==0)
+//            notes=@"";
+//        if(bmodify)
+//        {
+//
+//
+//           // if([notes isEqualToString:@""])
+////                notes=[NSString stringWithFormat:@"Note: discount %d%% off.",(int)discount];
+////
+////            NSRange range;
+////            range = [notes rangeOfString:@"PRICE MODIFIED"];
+////            if (range.location != NSNotFound) {
+////
+////            }else{
+////               notes= [notes stringByAppendingString:@"\nPRICE MODIFIED"];
+////            }
+//        }
+//        else
+//
+//        {
+////            notes =@"";
+//        }
         
         __block UIAlertController * waitalert = [RAUtils waiting_alert:self title:@"Update Price" completion:^{
-            [RANetwork request_update_cart_modelprice:cartid price:price discount:discount notes:notes completionHandler:^(NSMutableDictionary *result) {
+            [RANetwork request_update_cart_modelprice:cartid price:price discount:discount notes:nil completionHandler:^(NSMutableDictionary *result) {
                                         NSDictionary* cart_json = result;
                                         
                             [waitalert dismissViewControllerAnimated:YES completion:^{
@@ -2316,12 +2327,14 @@
                                     [item_json setValue:[NSNumber numberWithDouble:price ] forKey:@"unit_price"];
                                     
                                     [item_json setValue:[NSNumber numberWithDouble:discount ] forKey:@"discount"];
-                                    [item_json setValue:notes forKey:@"note"];
-                                    if (self.back_order_flag) {
-                                        [self updateItemJson:item_json atIndexPath:indexPath];
-                                    } else {
-                                        self.content_arr[indexPath.row ] = item_json;
-                                    }
+//                                    [item_json setValue:notes forKey:@"note"];
+                                    
+//                                    RASingleton.sharedInstance.scan_cart[@"section_0"][[NSString stringWithFormat:@"item_%d",indexPath.row]]=item_json;
+//                                    if (self.back_order_flag) {
+//                                        [self updateItemJson:item_json atIndexPath:indexPath];
+//                                    } else {
+//                                        self.content_arr[indexPath.row ] = item_json;
+//                                    }
 //                                    tableView.editing = false;
                                     //                        [tableView reloadRowsAtIndexPaths:@[indexPath]withRowAnimation:UITableViewRowAnimationMiddle];
                                     //                        [self refresh_total];
@@ -2385,7 +2398,7 @@
     self.total_weight=0;
     self.total_QTY=0;
     self.total_item=0;
-    
+    self.surcharge=0;
     
 #ifdef SCANNER_ORDER
     
@@ -2430,7 +2443,7 @@
             
             int count=[[item_json valueForKey:@"count"] intValue];
             
-            double totalprice =count*unitprice * (1.0-discount/100.0);
+            double totalprice =count*unitprice*(1-discount/100.0);
             
             double cuft=[[item_json valueForKey:@"cuft"] doubleValue];
             double weight=[[item_json valueForKey:@"weight"] doubleValue];
@@ -2439,29 +2452,45 @@
             int item_count=1;
             
             int item_qty=1;
-            NSDictionary * bundle_item =[item_json objectForKey:@"combine"];
+//            NSDictionary * bundle_item =[item_json objectForKey:@"combine"];
             
-            double dprice=0;
-            
-            if(bundle_item!=nil)
+            double msurcharge =0;
+            if(RASingleton.sharedInstance.price_type==1)
             {
-                //  int citem=0;
-                
-                int bcount=[[bundle_item valueForKey:@"count"] intValue];
-                for(int bc=0;bc<bcount;bc++)
+                if([item_json[@"special_price"] boolValue])
                 {
-                    NSDictionary * bitem = [bundle_item objectForKey:[NSString stringWithFormat:@"item_%d",bc]];
-                    int modulus= [[bitem valueForKey:@"modulus"] intValue];
-                    //    citem+= modulus;
-                    item_count+=1;
-                    item_qty+=modulus;
-                    double uprice= [[bitem valueForKey:@"unit_price"]doubleValue];
-                    dprice+= uprice*modulus*count;
-                    
+                    msurcharge=([item_json[@"price3"] doubleValue]-[item_json[@"price2"] doubleValue])*count*(1-discount/100.0);
+                }
+                else
+                {
+                    msurcharge=([item_json[@"price3"] doubleValue]-[item_json[@"price1"] doubleValue])*count*(1-discount/100.0);
                 }
             }
-            totalprice+= dprice;
+
+            
+//            double dprice=0;
             
+//            if(bundle_item!=nil)
+//            {
+//                //  int citem=0;
+//
+//                int bcount=[[bundle_item valueForKey:@"count"] intValue];
+//                for(int bc=0;bc<bcount;bc++)
+//                {
+//                    NSDictionary * bitem = [bundle_item objectForKey:[NSString stringWithFormat:@"item_%d",bc]];
+//                    int modulus= [[bitem valueForKey:@"modulus"] intValue];
+//                    //    citem+= modulus;
+//                    item_count+=1;
+//                    item_qty+=modulus;
+//                    double uprice= [[bitem valueForKey:@"unit_price"]doubleValue];
+//                    dprice+= uprice*modulus*count;
+//
+//                }
+//            }
+//            totalprice+= dprice;
+            
+            
+            self.surcharge+=msurcharge;
             self.total+=totalprice;
             self.total_cuft+=cuft;
             self.total_carton+=carton;
@@ -2475,11 +2504,13 @@
         
     }
     
-    NSString* subtotal = [NSString stringWithFormat:@"$%.2f",self.total];
+    
+    NSString* subtotal = [RAConvertor currencyNumber:self.total];//[NSString stringWithFormat:@"$%@",];
     NSString* subcuft = [NSString stringWithFormat:@"%.2f ft³",self.total_cuft];
     NSString* subcarton = [NSString stringWithFormat:@"%d",self.total_carton];
     NSString* subweight = [NSString stringWithFormat:@"%.2f lbs",self.total_weight];
-    
+    NSString* surcharge = [RAConvertor currencyNumber:self.surcharge];//[NSString stringWithFormat:@"$%@",];
+    NSString* totalprice = [RAConvertor currencyNumber:(self.total+self.surcharge)];//[NSString stringWithFormat:@"$%@",];
     
     NSString* subitems = [NSString stringWithFormat:@"%d",self.total_item];
     
@@ -2501,6 +2532,8 @@
     [OLDataProvider updateScanOrder:appDelegate.order_code];
 #endif
     
+    self.labelTotalSurcharge.text = surcharge;
+    self.labelTotalPrice.text = totalprice;
     self.labelTotal.text=subtotal;
     self.label_cuft.text=subcuft;
     self.label_carton.text=subcarton;
@@ -3074,7 +3107,16 @@
     
     NSString* notes = [item_json valueForKey:@"note"];
     
-    
+    if(notes.length>0)
+    {
+        cell.labelNotes.text = notes;
+        
+    }
+    else
+    {
+        cell.labelNotes.text = nil;
+        
+    }
     
     NSString* description =[item_json valueForKey:@"description"];
     NSString* model =[item_json valueForKey:@"model"];
@@ -3090,6 +3132,25 @@
     
     double discount=[[item_json valueForKey:@"discount"] doubleValue];
     cell.discount = discount;
+    
+    switch(RASingleton.sharedInstance.price_type)
+    {
+        case 0: cell.btnScanDiscount.hidden = true;
+            break;;
+        case 1:
+        {
+            if(![item_json[@"special_price"] boolValue]&&![item_json[@"net_price"] boolValue])
+                cell.btnScanDiscount.hidden = false;
+            else
+                cell.btnScanDiscount.hidden = true;
+        }
+            break;;
+//        case 2: pricename = @"25%";
+//            break;
+    }
+    
+
+    
     NSString* product_id = [item_json valueForKey:@"product_id"];
     
 
@@ -3098,16 +3159,7 @@
     CGRect frame = cell.frame;
     cell.labelMpack.text =[NSString stringWithFormat:@"Sold in QTY of:%d", stockUom];
     
-    if(discount>0)
-    {
-        cell.labelNotes.text = [NSString stringWithFormat:@"Note: discount %d%% off.",(int)discount];
-        frame.size.height = 120;
-    }
-    else
-    {
-        cell.labelNotes.text = nil;
-        frame.size.height = 94;
-    }
+  
     
     
     __weak typeof(self) weakSelf = self;
@@ -3163,13 +3215,59 @@
     };
  //   cell.delegate=self;
  //   cell.from=indexPath;
+    
+    
+    if([item_json[@"net_price"] boolValue]||[item_json[@"special_price"] boolValue]||discount>0)
+    {
+                cell.labelUnitPrice.textColor= [UIColor redColor];
+        if([item_json[@"special_price"] boolValue]||discount>0)
+        {
+            cell.labelOldPrice.hidden = false;
+//            if([item_json[@"special_price"] boolValue])
+//            {
+            cell.labelOldPrice.text=[RAConvertor currencyNumber:[item_json[@"price1"] doubleValue]];//[NSString stringWithFormat:@"%.2f",[item_json[@"price1"] doubleValue]];
+//            }
+//            else
+//            {
+                
+//            }
+        }
+        else
+            cell.labelOldPrice.hidden = true;
+    }
+    else
+            {
+                cell.labelUnitPrice.textColor= [UIColor blackColor];
+                cell.labelOldPrice.hidden = true;
+            }
+    
+//    if(discount>0)
+//    {
+//        cell.labelNotes.text = [NSString stringWithFormat:@"Note: discount %d%% off.",(int)discount];
+//        cell.labelOldPrice.hidden = false;
+////        cell.labelOldPrice.textColor = [UIColor redColor];
+//        cell.labelUnitPrice.textColor= [UIColor redColor];
+//        cell.labelOldPrice.text=[item_json[@"unit_price"] stringValue];
+//        frame.size.height = 120;
+//    }
+//    else
+//    {
+//
+//
+//        cell.labelOldPrice.hidden = true;
+//        cell.labelNotes.text = nil;
+//        frame.size.height = 94;
+//    }
+    
+    
+    
     cell.unit_price = unitprice;
     //    cell.labelAttribute.text = attribute;
     //    cell.labelCurrency.text = currency;
     
     
-    NSString* newprice = [NSString stringWithFormat:@"%.2f",unitprice*count*(1-discount/100)];
-    NSString* newunitprice = [NSString stringWithFormat:@"%.2f",unitprice];
+    NSString* subtotal = [RAConvertor currencyNumber:unitprice*count*(1-discount/100)];//[NSString stringWithFormat:@"%.2f",unitprice*count*(1-discount/100)];
+    NSString* newunitprice = [RAConvertor currencyNumber:unitprice*(1-discount/100)];//[NSString stringWithFormat:@"%.2f",unitprice*(1-discount/100)];
     
     cell.labelModel.text = model;
 
@@ -3185,9 +3283,9 @@
 //    }
 //    else
     {
-        cell.labelSubtotal.text = newprice;
+        cell.labelSubtotal.text =  subtotal;
         
-        cell.labelUnitPrice.text = newunitprice;
+        cell.labelUnitPrice.text =  newunitprice;
     }
     bool check = [[item_json valueForKey:@"check"] boolValue];
 

+ 32 - 1
RedAnt ERP Mobile/common/Functions/offline/OLDataProvider.m

@@ -2355,10 +2355,26 @@
 //    NSMutableDictionary* newlist  = [NSMutableDictionary new];
     
     float p =0;
+    float s =0;
     for(int j=0;j<[RASingleton.sharedInstance.scan_cart[@"section_0"][@"count"] intValue];j++)
     {
         NSDictionary* cartitem =RASingleton.sharedInstance.scan_cart[@"section_0"][[NSString stringWithFormat:@"item_%d",j]];
         p+=[cartitem[@"unit_price"] doubleValue]*[cartitem[@"count"]intValue] * (1-[cartitem[@"discount"]doubleValue]/100.0);
+        int mcount = [cartitem[@"count"] intValue];
+        double msurcharge =0;
+        if(RASingleton.sharedInstance.price_type==1)
+        {
+            if([cartitem[@"special_price"] boolValue])
+            {
+                msurcharge=([cartitem[@"price3"] doubleValue]-[cartitem[@"price2"] doubleValue])*mcount*(1-[cartitem[@"discount"]doubleValue]/100.0);
+            }
+            else
+            {
+                msurcharge=([cartitem[@"price3"] doubleValue]-[cartitem[@"price1"] doubleValue])*mcount*(1-[cartitem[@"discount"]doubleValue]/100.0);
+            }
+        }
+
+        s+=msurcharge;
     }
 //    int newcount = 0;
     for(int i=0;i<count;i++)
@@ -2366,7 +2382,7 @@
         NSMutableDictionary* item = orderlist[[NSString stringWithFormat:@"item_%d",i]];
         if([item[@"order_code"] isEqualToString: order_code ])
         {
-            item[@"price"] = [NSString stringWithFormat:@"%.2f",p];
+            item[@"price"] = [NSString stringWithFormat:@"%.2f",p+s];
             item[@"model_count"] =[ NSString stringWithFormat:@"%@",RASingleton.sharedInstance.scan_cart[@"section_0"][@"count"] ];
             orderlist[[NSString stringWithFormat:@"item_%d",i]] = item;
         }
@@ -2475,7 +2491,22 @@
     //    NSString *documents = [paths objectAtIndex:0];
     //    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
     
+
+    if(RASingleton.sharedInstance.price_type==0)
+    {
+        NSMutableDictionary * section = cart[@"section_0"];
+        int count = [section[@"count"] intValue];
+        for(int i=0;i<count;i++)
+        {
+            NSMutableDictionary* item = [section[[NSString stringWithFormat:@"item_%d",i]] mutableCopy];
+            [item removeObjectForKey:@"discount"];
+            [item removeObjectForKey:@"note"];
+            section[[NSString stringWithFormat:@"item_%d",i]]=item;
+        }
+        cart[@"section_0"]=section;
+    }
     
+
     NSString *orderdir = [self getScanPath];
     
     NSString *cartpath = [orderdir stringByAppendingPathComponent:@"cart.json"];

+ 4 - 1
RedAnt ERP Mobile/common/data_provider/RANetwork.m

@@ -10374,7 +10374,10 @@ NSString *const ScreenCodeOfflineSync = @"Offline Sync Screen";
                 item[@"unit_price"] =@(price);
                 item[@"discount"] =@(discount);
                 item[@"subtotal_price"] =@(price*item_count);
-                item[@"note"] =@"PRICE MODIFIED";
+                if(discount>0)
+                    item[@"note"] =[NSString stringWithFormat:@"Note: discount %d%% off.",(int)discount];
+                else
+                    item[@"note"] =@"";
                 section[[NSString stringWithFormat:@"item_%d",i]] = item;
                 break;
             }

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

+ 1 - 1
common/RAConvertor.h

@@ -23,7 +23,7 @@
 +(NSDictionary*) data2dict:(NSData*) data;
 +(NSDictionary*) string2dict:(NSString*) str;
 +(NSString*) dict2string:(id) dict;
-
++(NSString*) currencyNumber:(float) num;
 
 
 @end

+ 13 - 0
common/RAConvertor.m

@@ -119,7 +119,20 @@ begin:
     NSArray *array = [NSKeyedUnarchiver unarchiveObjectWithData:data];
     return array;
 }
++(NSString*) currencyNumber:(float) num
+{
+    NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
+    [formatter setNumberStyle:NSNumberFormatterCurrencyStyle];
+    NSString *groupingSeparator = [[NSLocale currentLocale] objectForKey:NSLocaleGroupingSeparator];
+    [formatter setGroupingSeparator:groupingSeparator];
+    [formatter setGroupingSize:3];
+    [formatter setAlwaysShowsDecimalSeparator:NO];
+    [formatter setUsesGroupingSeparator:YES];
 
+    
+    NSString *formattedString = [formatter stringFromNumber:[NSNumber numberWithFloat:num]];
+    return formattedString;
+}
 +(NSData*) dict2data:(NSDictionary*) dict
 {
     if(dict==nil)

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

@@ -4299,7 +4299,7 @@ if(!self.alert.isBeingDismissed)
             NSString* discountstr=[NSString stringWithFormat:@"%@%% off", [RAUtils FloatFormat:discount]];
 
             
-            NSString* oldprice =[NSString stringWithFormat:@"%.2f",unitprice];
+            NSString* oldprice =[RAConvertor currencyNumber:unitprice];//[NSString stringWithFormat:@"%.2f",unitprice];
             
 #ifdef SCANNER_ORDER
             if([item_json[@"is_back_order"] boolValue])
@@ -4317,8 +4317,9 @@ if(!self.alert.isBeingDismissed)
             if(dprice>0)
             newunitprice = [NSString stringWithFormat:@"%.2f+%.2f",unitprice* (1.0-discount/100),dprice];
             else
-                newunitprice = [NSString stringWithFormat:@"%.2f",unitprice* (1.0-discount/100)];
-            NSString* totalprice = [NSString stringWithFormat:@"%.2f",(unitprice* (1.0-discount/100)+dprice)*count];
+                newunitprice =[RAConvertor currencyNumber:unitprice* (1.0-discount/100)];// [NSString stringWithFormat:@"%.2f",unitprice* (1.0-discount/100)];
+            NSString* totalprice = [RAConvertor currencyNumber:(unitprice* (1.0-discount/100)+dprice)*count]; //[NSString stringWithFormat:@"%.2f",(unitprice* (1.0-discount/100)+dprice)*count];
+            
             
             
             BOOL can_see_price = [[RASingleton.sharedInstance globalParameterForKey:@"can_see_price"] boolValue];