Commit 85bfd8db76c12b1d2ada3aaf5da457d4421396cc

Authored by Imanol-Mikel Barba Sabariego
1 parent 5c4e1acc

--no commit message

DUREX Vendor Control/Base.lproj/DatePickerViewController.xib
... ... @@ -13,11 +13,11 @@
13 13 </placeholder>
14 14 <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
15 15 <view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="7fx-e7-JEt">
16   - <rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
  16 + <rect key="frame" x="0.0" y="0.0" width="320" height="480"/>
17 17 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
18 18 <subviews>
19 19 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="o92-Jq-3Xo">
20   - <rect key="frame" x="6" y="126" width="308" height="296"/>
  20 + <rect key="frame" x="6" y="70" width="308" height="296"/>
21 21 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
22 22 <subviews>
23 23 <button opaque="NO" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8vW-ig-tUA">
... ... @@ -73,11 +73,11 @@ AQABAAEAAQAB//+dkAEA//+PgAAE//+dkAEI//+dkAEMUERUAFBTVABQV1QAUFBUAAAAAAEAAAABA
73 73 </subviews>
74 74 <color key="backgroundColor" red="0.023529414087533951" green="0.0039215688593685627" blue="0.0039215688593685627" alpha="0.5" colorSpace="deviceRGB"/>
75 75 <constraints>
76   - <constraint firstItem="o92-Jq-3Xo" firstAttribute="top" secondItem="7fx-e7-JEt" secondAttribute="top" constant="126" id="7ki-Mk-J5B"/>
  76 + <constraint firstItem="o92-Jq-3Xo" firstAttribute="top" secondItem="7fx-e7-JEt" secondAttribute="top" constant="70" id="R2Y-Fr-tLL"/>
77 77 <constraint firstAttribute="centerX" secondItem="o92-Jq-3Xo" secondAttribute="centerX" id="fTS-XF-GoP"/>
78 78 </constraints>
79 79 <simulatedStatusBarMetrics key="simulatedStatusBarMetrics"/>
80   - <simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina4"/>
  80 + <simulatedScreenMetrics key="simulatedDestinationMetrics"/>
81 81 </view>
82 82 </objects>
83 83 </document>
... ...
DUREX Vendor Control/Base.lproj/Localizable.strings
... ... @@ -87,4 +87,9 @@
87 87 "Success!" = "Success!";
88 88 "Connection to server failed" = "Connection to server failed";
89 89 "Error" = "Error";
90   -"Product" = "Product";
91 90 \ No newline at end of file
  91 +"Product" = "Product";
  92 +"Entered price has an invalid format" = "Entered price has an invalid format";
  93 +"Entered product code has an invalid format" = "Entered product code has an invalid format";
  94 +"Entered channel has an invalid format" = "Entered channel has an invalid format";
  95 +"Missing channel" = "Missing channel";
  96 +"Missing product code" = "Missing product code";
92 97 \ No newline at end of file
... ...
DUREX Vendor Control/Base.lproj/NameChangerViewController.xib
... ... @@ -19,7 +19,7 @@
19 19 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
20 20 <subviews>
21 21 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Yfy-pU-0Wn">
22   - <rect key="frame" x="7" y="170" width="307" height="181"/>
  22 + <rect key="frame" x="7" y="70" width="307" height="181"/>
23 23 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
24 24 <subviews>
25 25 <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="vbt-3v-Jzm">
... ... @@ -102,7 +102,7 @@
102 102 </subviews>
103 103 <color key="backgroundColor" red="0.023529414089999999" green="0.0039215688589999999" blue="0.0039215688589999999" alpha="0.5" colorSpace="deviceRGB"/>
104 104 <constraints>
105   - <constraint firstItem="Yfy-pU-0Wn" firstAttribute="top" secondItem="orJ-qi-Y62" secondAttribute="top" constant="170" id="Mv8-ll-5jP"/>
  105 + <constraint firstItem="Yfy-pU-0Wn" firstAttribute="top" secondItem="orJ-qi-Y62" secondAttribute="top" constant="70" id="Mv8-ll-5jP"/>
106 106 <constraint firstAttribute="centerX" secondItem="Yfy-pU-0Wn" secondAttribute="centerX" constant="-0.5" id="oiN-2m-voi"/>
107 107 </constraints>
108 108 <simulatedStatusBarMetrics key="simulatedStatusBarMetrics"/>
... ...
DUREX Vendor Control/Base.lproj/PriceChangerViewController.xib
... ... @@ -6,7 +6,7 @@
6 6 <objects>
7 7 <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="PriceChangerViewController">
8 8 <connections>
9   - <outlet property="channel" destination="0IF-Ml-nmK" id="8uw-9W-nHO"/>
  9 + <outlet property="channel" destination="Yrc-dD-lC1" id="Ojk-T9-Ot6"/>
10 10 <outlet property="code" destination="0IF-Ml-nmK" id="oeg-QC-UEa"/>
11 11 <outlet property="price" destination="0ap-q1-lJS" id="sSP-HQ-Xcj"/>
12 12 <outlet property="priceChangerView" destination="6eG-rz-OsA" id="cZv-wv-biI"/>
... ... @@ -15,11 +15,11 @@
15 15 </placeholder>
16 16 <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
17 17 <view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="Vhv-I1-cgL">
18   - <rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
  18 + <rect key="frame" x="0.0" y="0.0" width="320" height="480"/>
19 19 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
20 20 <subviews>
21 21 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="6eG-rz-OsA">
22   - <rect key="frame" x="7" y="170" width="307" height="181"/>
  22 + <rect key="frame" x="7" y="70" width="307" height="181"/>
23 23 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
24 24 <subviews>
25 25 <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Yrc-dD-lC1">
... ... @@ -102,11 +102,11 @@
102 102 </subviews>
103 103 <color key="backgroundColor" red="0.023529414089999999" green="0.0039215688589999999" blue="0.0039215688589999999" alpha="0.5" colorSpace="deviceRGB"/>
104 104 <constraints>
105   - <constraint firstItem="6eG-rz-OsA" firstAttribute="top" secondItem="Vhv-I1-cgL" secondAttribute="top" constant="170" id="JVE-no-tdA"/>
  105 + <constraint firstItem="6eG-rz-OsA" firstAttribute="top" secondItem="Vhv-I1-cgL" secondAttribute="top" constant="70" id="JVE-no-tdA"/>
106 106 <constraint firstAttribute="centerX" secondItem="6eG-rz-OsA" secondAttribute="centerX" constant="-0.5" id="ShJ-gZ-P8L"/>
107 107 </constraints>
108 108 <simulatedStatusBarMetrics key="simulatedStatusBarMetrics"/>
109   - <simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina4"/>
  109 + <simulatedScreenMetrics key="simulatedDestinationMetrics"/>
110 110 </view>
111 111 </objects>
112 112 </document>
... ...
DUREX Vendor Control/CommunicationProtocol.m
... ... @@ -148,8 +148,11 @@
148 148 {
149 149 [[EMConnectionManager sharedManager] readResource:@"data" onSuccess:^(id readValue)
150 150 {
151   - [message appendString: readValue];
152   - [message setString: [message substringToIndex:numBytes]];
  151 + if([readValue length] < numBytes)
  152 + {
  153 + NSLog(@"[CommunicationProtocol.m]: WARNING: Device issued wrong numBytes, possible truncated message.");
  154 + }
  155 + [message appendString:[readValue substringToIndex:numBytes]];
153 156 NSLog(@"[CommunicationProtocol.m]: data read: %@",message);
154 157 }
155 158 onFail:^(NSError *error)
... ...
DUREX Vendor Control/DUREX Vendor Control.xcodeproj/project.pbxproj
... ... @@ -18,6 +18,8 @@
18 18 34AAB88D189805300019860D /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 34AAB88C189805300019860D /* Images.xcassets */; };
19 19 F9015D9019B73052006C7882 /* DatePickerViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F9015D9219B73052006C7882 /* DatePickerViewController.xib */; };
20 20 F9015D9719B7305E006C7882 /* DatePickerViewController_iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = F9015D9919B7305E006C7882 /* DatePickerViewController_iPad.xib */; };
  21 + F915612919C3D16D00126FE2 /* DateRangePickerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F915612719C3D16D00126FE2 /* DateRangePickerViewController.m */; };
  22 + F915612A19C3D16D00126FE2 /* DateRangePickerViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F915612819C3D16D00126FE2 /* DateRangePickerViewController.xib */; };
21 23 F92F567919B75F5E00A1EACA /* PriceChangerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F92F567719B75F5E00A1EACA /* PriceChangerViewController.m */; };
22 24 F92F567D19B7609C00A1EACA /* PriceChangerViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F92F567F19B7609C00A1EACA /* PriceChangerViewController.xib */; };
23 25 F92F568419B760A800A1EACA /* PriceChangerViewController_iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = F92F568619B760A800A1EACA /* PriceChangerViewController_iPad.xib */; };
... ... @@ -82,6 +84,9 @@
82 84 F9015D9819B7305E006C7882 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/DatePickerViewController_iPad.xib; sourceTree = "<group>"; };
83 85 F9015D9B19B73062006C7882 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/DatePickerViewController_iPad.strings; sourceTree = "<group>"; };
84 86 F9015D9D19B73062006C7882 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/DatePickerViewController_iPad.strings; sourceTree = "<group>"; };
  87 + F915612619C3D16D00126FE2 /* DateRangePickerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DateRangePickerViewController.h; sourceTree = SOURCE_ROOT; };
  88 + F915612719C3D16D00126FE2 /* DateRangePickerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DateRangePickerViewController.m; sourceTree = SOURCE_ROOT; };
  89 + F915612819C3D16D00126FE2 /* DateRangePickerViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = DateRangePickerViewController.xib; sourceTree = SOURCE_ROOT; };
85 90 F92F567619B75F5E00A1EACA /* PriceChangerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PriceChangerViewController.h; sourceTree = SOURCE_ROOT; };
86 91 F92F567719B75F5E00A1EACA /* PriceChangerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PriceChangerViewController.m; sourceTree = SOURCE_ROOT; };
87 92 F92F567E19B7609C00A1EACA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/PriceChangerViewController.xib; sourceTree = "<group>"; };
... ... @@ -202,6 +207,7 @@
202 207 F933F80219B6819400521B90 /* DatePickerViewController.m */,
203 208 F92F567719B75F5E00A1EACA /* PriceChangerViewController.m */,
204 209 F92F568E19B763FD00A1EACA /* NameChangerViewController.m */,
  210 + F915612719C3D16D00126FE2 /* DateRangePickerViewController.m */,
205 211 34AAB880189804FF0019860D /* main.m */,
206 212 F98446EF19B9EAE9005C4992 /* Sensors.m */,
207 213 F989B5FE19BCD7A100657DD9 /* Sale.m */,
... ... @@ -291,6 +297,7 @@
291 297 F92F568619B760A800A1EACA /* PriceChangerViewController_iPad.xib */,
292 298 F92F569419B7665F00A1EACA /* NameChangerViewController.xib */,
293 299 F92F569D19B76A5D00A1EACA /* NameChangerViewController_iPad.xib */,
  300 + F915612819C3D16D00126FE2 /* DateRangePickerViewController.xib */,
294 301 );
295 302 name = Views;
296 303 path = ..;
... ... @@ -307,6 +314,7 @@
307 314 F933F80119B6819400521B90 /* DatePickerViewController.h */,
308 315 F92F567619B75F5E00A1EACA /* PriceChangerViewController.h */,
309 316 F92F568D19B763FD00A1EACA /* NameChangerViewController.h */,
  317 + F915612619C3D16D00126FE2 /* DateRangePickerViewController.h */,
310 318 F98446EE19B9EAE9005C4992 /* Sensors.h */,
311 319 F989B5FD19BCD7A100657DD9 /* Sale.h */,
312 320 F989B60019BCE28C00657DD9 /* SalesLog.h */,
... ... @@ -393,6 +401,7 @@
393 401 F92F569B19B76A5D00A1EACA /* NameChangerViewController_iPad.xib in Resources */,
394 402 F92F567D19B7609C00A1EACA /* PriceChangerViewController.xib in Resources */,
395 403 F92F569219B7665F00A1EACA /* NameChangerViewController.xib in Resources */,
  404 + F915612A19C3D16D00126FE2 /* DateRangePickerViewController.xib in Resources */,
396 405 F961D80C199A5F2D00E9282C /* back_arrow.png in Resources */,
397 406 F961D816199A5FA000E9282C /* Localizable.strings in Resources */,
398 407 F97B90CB19B859F500DDA9EF /* icon_checkmark.png in Resources */,
... ... @@ -410,6 +419,7 @@
410 419 isa = PBXSourcesBuildPhase;
411 420 buildActionMask = 2147483647;
412 421 files = (
  422 + F915612919C3D16D00126FE2 /* DateRangePickerViewController.m in Sources */,
413 423 F92F569019B763FD00A1EACA /* NameChangerViewController.m in Sources */,
414 424 F933F80419B6819400521B90 /* DatePickerViewController.m in Sources */,
415 425 F989B5FF19BCD7A100657DD9 /* Sale.m in Sources */,
... ...
DUREX Vendor Control/DUREX Vendor Control.xcodeproj/project.xcworkspace/xcuserdata/imanol.xcuserdatad/UserInterfaceState.xcuserstate
No preview for this file type
DUREX Vendor Control/DUREX Vendor Control.xcodeproj/xcuserdata/imanol.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
... ... @@ -26,11 +26,11 @@
26 26 ignoreCount = "0"
27 27 continueAfterRunningActions = "No"
28 28 filePath = "MenuTableViewController.m"
29   - timestampString = "431887175.109814"
  29 + timestampString = "432265160.899922"
30 30 startingColumnNumber = "9223372036854775807"
31 31 endingColumnNumber = "9223372036854775807"
32   - startingLineNumber = "724"
33   - endingLineNumber = "724"
  32 + startingLineNumber = "717"
  33 + endingLineNumber = "717"
34 34 landmarkName = "-tableView:cellForRowAtIndexPath:"
35 35 landmarkType = "5">
36 36 </BreakpointContent>
... ... @@ -42,11 +42,11 @@
42 42 ignoreCount = "0"
43 43 continueAfterRunningActions = "No"
44 44 filePath = "MenuTableViewController.m"
45   - timestampString = "431887175.109814"
  45 + timestampString = "432265160.899922"
46 46 startingColumnNumber = "9223372036854775807"
47 47 endingColumnNumber = "9223372036854775807"
48   - startingLineNumber = "666"
49   - endingLineNumber = "666"
  48 + startingLineNumber = "659"
  49 + endingLineNumber = "659"
50 50 landmarkName = "-tableView:cellForRowAtIndexPath:"
51 51 landmarkType = "5">
52 52 </BreakpointContent>
... ... @@ -58,11 +58,11 @@
58 58 ignoreCount = "0"
59 59 continueAfterRunningActions = "No"
60 60 filePath = "MenuTableViewController.m"
61   - timestampString = "431887175.109814"
  61 + timestampString = "432265052.909736"
62 62 startingColumnNumber = "9223372036854775807"
63 63 endingColumnNumber = "9223372036854775807"
64   - startingLineNumber = "522"
65   - endingLineNumber = "522"
  64 + startingLineNumber = "511"
  65 + endingLineNumber = "511"
66 66 landmarkName = "-tableView:didSelectRowAtIndexPath:"
67 67 landmarkType = "5">
68 68 </BreakpointContent>
... ... @@ -74,11 +74,11 @@
74 74 ignoreCount = "0"
75 75 continueAfterRunningActions = "No"
76 76 filePath = "CommunicationProtocol.m"
77   - timestampString = "431825157.011553"
  77 + timestampString = "432263020.427289"
78 78 startingColumnNumber = "9223372036854775807"
79 79 endingColumnNumber = "9223372036854775807"
80   - startingLineNumber = "359"
81   - endingLineNumber = "359"
  80 + startingLineNumber = "362"
  81 + endingLineNumber = "362"
82 82 landmarkName = "-readSensorData"
83 83 landmarkType = "5">
84 84 </BreakpointContent>
... ... @@ -90,11 +90,11 @@
90 90 ignoreCount = "0"
91 91 continueAfterRunningActions = "No"
92 92 filePath = "CommunicationProtocol.m"
93   - timestampString = "431825158.083281"
  93 + timestampString = "432263020.427289"
94 94 startingColumnNumber = "9223372036854775807"
95 95 endingColumnNumber = "9223372036854775807"
96   - startingLineNumber = "358"
97   - endingLineNumber = "358"
  96 + startingLineNumber = "361"
  97 + endingLineNumber = "361"
98 98 landmarkName = "-readSensorData"
99 99 landmarkType = "5">
100 100 </BreakpointContent>
... ... @@ -106,11 +106,11 @@
106 106 ignoreCount = "0"
107 107 continueAfterRunningActions = "No"
108 108 filePath = "CommunicationProtocol.m"
109   - timestampString = "431950031.704831"
  109 + timestampString = "432263020.427289"
110 110 startingColumnNumber = "9223372036854775807"
111 111 endingColumnNumber = "9223372036854775807"
112   - startingLineNumber = "377"
113   - endingLineNumber = "377"
  112 + startingLineNumber = "380"
  113 + endingLineNumber = "380"
114 114 landmarkName = "-readSensorData"
115 115 landmarkType = "5">
116 116 </BreakpointContent>
... ... @@ -121,38 +121,6 @@
121 121 shouldBeEnabled = "No"
122 122 ignoreCount = "0"
123 123 continueAfterRunningActions = "No"
124   - filePath = "MenuTableViewController.m"
125   - timestampString = "431887175.109814"
126   - startingColumnNumber = "9223372036854775807"
127   - endingColumnNumber = "9223372036854775807"
128   - startingLineNumber = "559"
129   - endingLineNumber = "559"
130   - landmarkName = "-tableView:didSelectRowAtIndexPath:"
131   - landmarkType = "5">
132   - </BreakpointContent>
133   - </BreakpointProxy>
134   - <BreakpointProxy
135   - BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
136   - <BreakpointContent
137   - shouldBeEnabled = "No"
138   - ignoreCount = "0"
139   - continueAfterRunningActions = "No"
140   - filePath = "MenuTableViewController.m"
141   - timestampString = "431887175.109814"
142   - startingColumnNumber = "9223372036854775807"
143   - endingColumnNumber = "9223372036854775807"
144   - startingLineNumber = "558"
145   - endingLineNumber = "558"
146   - landmarkName = "-tableView:didSelectRowAtIndexPath:"
147   - landmarkType = "5">
148   - </BreakpointContent>
149   - </BreakpointProxy>
150   - <BreakpointProxy
151   - BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
152   - <BreakpointContent
153   - shouldBeEnabled = "No"
154   - ignoreCount = "0"
155   - continueAfterRunningActions = "No"
156 124 filePath = "SalesLog.m"
157 125 timestampString = "431825829.779956"
158 126 startingColumnNumber = "9223372036854775807"
... ... @@ -218,11 +186,11 @@
218 186 ignoreCount = "0"
219 187 continueAfterRunningActions = "No"
220 188 filePath = "MenuTableViewController.m"
221   - timestampString = "431887175.109814"
  189 + timestampString = "432265160.899922"
222 190 startingColumnNumber = "9223372036854775807"
223 191 endingColumnNumber = "9223372036854775807"
224   - startingLineNumber = "775"
225   - endingLineNumber = "775"
  192 + startingLineNumber = "768"
  193 + endingLineNumber = "768"
226 194 landmarkName = "-tableView:cellForRowAtIndexPath:"
227 195 landmarkType = "5">
228 196 </BreakpointContent>
... ... @@ -234,11 +202,11 @@
234 202 ignoreCount = "0"
235 203 continueAfterRunningActions = "No"
236 204 filePath = "CommunicationProtocol.m"
237   - timestampString = "431854565.924087"
  205 + timestampString = "432263020.427289"
238 206 startingColumnNumber = "9223372036854775807"
239 207 endingColumnNumber = "9223372036854775807"
240   - startingLineNumber = "210"
241   - endingLineNumber = "210"
  208 + startingLineNumber = "213"
  209 + endingLineNumber = "213"
242 210 landmarkName = "-writeMessage:"
243 211 landmarkType = "5">
244 212 </BreakpointContent>
... ... @@ -250,11 +218,11 @@
250 218 ignoreCount = "0"
251 219 continueAfterRunningActions = "No"
252 220 filePath = "MenuTableViewController.m"
253   - timestampString = "431867660.218473"
  221 + timestampString = "432263020.427289"
254 222 startingColumnNumber = "9223372036854775807"
255 223 endingColumnNumber = "9223372036854775807"
256   - startingLineNumber = "91"
257   - endingLineNumber = "91"
  224 + startingLineNumber = "92"
  225 + endingLineNumber = "92"
258 226 landmarkName = "-generateMaintenanceLevel"
259 227 landmarkType = "5">
260 228 </BreakpointContent>
... ... @@ -266,11 +234,11 @@
266 234 ignoreCount = "0"
267 235 continueAfterRunningActions = "No"
268 236 filePath = "MenuTableViewController.m"
269   - timestampString = "431867660.218473"
  237 + timestampString = "432265052.909736"
270 238 startingColumnNumber = "9223372036854775807"
271 239 endingColumnNumber = "9223372036854775807"
272   - startingLineNumber = "124"
273   - endingLineNumber = "124"
  240 + startingLineNumber = "114"
  241 + endingLineNumber = "114"
274 242 landmarkName = "-generateSaleListNavLevel"
275 243 landmarkType = "5">
276 244 </BreakpointContent>
... ... @@ -282,11 +250,11 @@
282 250 ignoreCount = "0"
283 251 continueAfterRunningActions = "No"
284 252 filePath = "MenuTableViewController.m"
285   - timestampString = "431867660.218473"
  253 + timestampString = "432265052.909736"
286 254 startingColumnNumber = "9223372036854775807"
287 255 endingColumnNumber = "9223372036854775807"
288   - startingLineNumber = "127"
289   - endingLineNumber = "127"
  256 + startingLineNumber = "117"
  257 + endingLineNumber = "117"
290 258 landmarkName = "-generateSaleListNavLevel"
291 259 landmarkType = "5">
292 260 </BreakpointContent>
... ... @@ -298,11 +266,11 @@
298 266 ignoreCount = "0"
299 267 continueAfterRunningActions = "No"
300 268 filePath = "MenuTableViewController.m"
301   - timestampString = "431867660.218473"
  269 + timestampString = "432265052.909736"
302 270 startingColumnNumber = "9223372036854775807"
303 271 endingColumnNumber = "9223372036854775807"
304   - startingLineNumber = "136"
305   - endingLineNumber = "136"
  272 + startingLineNumber = "125"
  273 + endingLineNumber = "125"
306 274 landmarkName = "-generateSaleListNavLevel"
307 275 landmarkType = "5">
308 276 </BreakpointContent>
... ... @@ -314,11 +282,11 @@
314 282 ignoreCount = "0"
315 283 continueAfterRunningActions = "No"
316 284 filePath = "MenuTableViewController.m"
317   - timestampString = "431884750.147748"
  285 + timestampString = "432265052.909736"
318 286 startingColumnNumber = "9223372036854775807"
319 287 endingColumnNumber = "9223372036854775807"
320   - startingLineNumber = "208"
321   - endingLineNumber = "208"
  288 + startingLineNumber = "197"
  289 + endingLineNumber = "197"
322 290 landmarkName = "-changeNavLevel::"
323 291 landmarkType = "5">
324 292 </BreakpointContent>
... ... @@ -330,11 +298,11 @@
330 298 ignoreCount = "0"
331 299 continueAfterRunningActions = "No"
332 300 filePath = "MenuTableViewController.m"
333   - timestampString = "431887175.109814"
  301 + timestampString = "432265052.909736"
334 302 startingColumnNumber = "9223372036854775807"
335 303 endingColumnNumber = "9223372036854775807"
336   - startingLineNumber = "507"
337   - endingLineNumber = "507"
  304 + startingLineNumber = "496"
  305 + endingLineNumber = "496"
338 306 landmarkName = "-tableView:numberOfRowsInSection:"
339 307 landmarkType = "5">
340 308 </BreakpointContent>
... ... @@ -346,11 +314,11 @@
346 314 ignoreCount = "0"
347 315 continueAfterRunningActions = "No"
348 316 filePath = "MenuTableViewController.m"
349   - timestampString = "431887175.109814"
  317 + timestampString = "432265160.899922"
350 318 startingColumnNumber = "9223372036854775807"
351 319 endingColumnNumber = "9223372036854775807"
352   - startingLineNumber = "651"
353   - endingLineNumber = "651"
  320 + startingLineNumber = "644"
  321 + endingLineNumber = "644"
354 322 landmarkName = "-tableView:indentationLevelForRowAtIndexPath:"
355 323 landmarkType = "5">
356 324 </BreakpointContent>
... ... @@ -362,11 +330,11 @@
362 330 ignoreCount = "0"
363 331 continueAfterRunningActions = "No"
364 332 filePath = "MenuTableViewController.m"
365   - timestampString = "431887175.109814"
  333 + timestampString = "432265160.899922"
366 334 startingColumnNumber = "9223372036854775807"
367 335 endingColumnNumber = "9223372036854775807"
368   - startingLineNumber = "671"
369   - endingLineNumber = "671"
  336 + startingLineNumber = "664"
  337 + endingLineNumber = "664"
370 338 landmarkName = "-tableView:cellForRowAtIndexPath:"
371 339 landmarkType = "5">
372 340 </BreakpointContent>
... ... @@ -378,11 +346,11 @@
378 346 ignoreCount = "0"
379 347 continueAfterRunningActions = "No"
380 348 filePath = "MenuTableViewController.m"
381   - timestampString = "431887175.109814"
  349 + timestampString = "432265160.899922"
382 350 startingColumnNumber = "9223372036854775807"
383 351 endingColumnNumber = "9223372036854775807"
384   - startingLineNumber = "864"
385   - endingLineNumber = "864"
  352 + startingLineNumber = "857"
  353 + endingLineNumber = "857"
386 354 landmarkName = "-tableView:cellForRowAtIndexPath:"
387 355 landmarkType = "5">
388 356 </BreakpointContent>
... ... @@ -394,11 +362,11 @@
394 362 ignoreCount = "0"
395 363 continueAfterRunningActions = "No"
396 364 filePath = "MenuTableViewController.m"
397   - timestampString = "431887175.109814"
  365 + timestampString = "432265160.899922"
398 366 startingColumnNumber = "9223372036854775807"
399 367 endingColumnNumber = "9223372036854775807"
400   - startingLineNumber = "865"
401   - endingLineNumber = "865"
  368 + startingLineNumber = "858"
  369 + endingLineNumber = "858"
402 370 landmarkName = "-tableView:cellForRowAtIndexPath:"
403 371 landmarkType = "5">
404 372 </BreakpointContent>
... ... @@ -426,11 +394,11 @@
426 394 ignoreCount = "0"
427 395 continueAfterRunningActions = "No"
428 396 filePath = "MenuTableViewController.m"
429   - timestampString = "431887175.109814"
  397 + timestampString = "432265160.899922"
430 398 startingColumnNumber = "9223372036854775807"
431 399 endingColumnNumber = "9223372036854775807"
432   - startingLineNumber = "984"
433   - endingLineNumber = "984"
  400 + startingLineNumber = "977"
  401 + endingLineNumber = "977"
434 402 landmarkName = "-tableView:cellForRowAtIndexPath:"
435 403 landmarkType = "5">
436 404 </BreakpointContent>
... ... @@ -442,11 +410,11 @@
442 410 ignoreCount = "0"
443 411 continueAfterRunningActions = "No"
444 412 filePath = "MenuTableViewController.m"
445   - timestampString = "431887175.109814"
  413 + timestampString = "432265052.909736"
446 414 startingColumnNumber = "9223372036854775807"
447 415 endingColumnNumber = "9223372036854775807"
448   - startingLineNumber = "463"
449   - endingLineNumber = "463"
  416 + startingLineNumber = "452"
  417 + endingLineNumber = "452"
450 418 landmarkName = "-toggleDropList:"
451 419 landmarkType = "5">
452 420 </BreakpointContent>
... ... @@ -458,11 +426,11 @@
458 426 ignoreCount = "0"
459 427 continueAfterRunningActions = "No"
460 428 filePath = "MenuTableViewController.m"
461   - timestampString = "431887175.109814"
  429 + timestampString = "432265160.899922"
462 430 startingColumnNumber = "9223372036854775807"
463 431 endingColumnNumber = "9223372036854775807"
464   - startingLineNumber = "1069"
465   - endingLineNumber = "1069"
  432 + startingLineNumber = "1062"
  433 + endingLineNumber = "1062"
466 434 landmarkName = "-tableView:cellForRowAtIndexPath:"
467 435 landmarkType = "5">
468 436 </BreakpointContent>
... ... @@ -474,11 +442,11 @@
474 442 ignoreCount = "0"
475 443 continueAfterRunningActions = "No"
476 444 filePath = "MenuTableViewController.m"
477   - timestampString = "431887175.109814"
  445 + timestampString = "432265160.899922"
478 446 startingColumnNumber = "9223372036854775807"
479 447 endingColumnNumber = "9223372036854775807"
480   - startingLineNumber = "1061"
481   - endingLineNumber = "1061"
  448 + startingLineNumber = "1054"
  449 + endingLineNumber = "1054"
482 450 landmarkName = "-tableView:cellForRowAtIndexPath:"
483 451 landmarkType = "5">
484 452 </BreakpointContent>
... ... @@ -490,11 +458,11 @@
490 458 ignoreCount = "0"
491 459 continueAfterRunningActions = "No"
492 460 filePath = "MenuTableViewController.m"
493   - timestampString = "431950315.399317"
  461 + timestampString = "432265160.899922"
494 462 startingColumnNumber = "9223372036854775807"
495 463 endingColumnNumber = "9223372036854775807"
496   - startingLineNumber = "856"
497   - endingLineNumber = "856"
  464 + startingLineNumber = "849"
  465 + endingLineNumber = "849"
498 466 landmarkName = "-tableView:cellForRowAtIndexPath:"
499 467 landmarkType = "5">
500 468 </BreakpointContent>
... ... @@ -506,14 +474,46 @@
506 474 ignoreCount = "0"
507 475 continueAfterRunningActions = "No"
508 476 filePath = "MenuTableViewController.m"
509   - timestampString = "431950324.585151"
  477 + timestampString = "432265160.899922"
510 478 startingColumnNumber = "9223372036854775807"
511 479 endingColumnNumber = "9223372036854775807"
512   - startingLineNumber = "854"
513   - endingLineNumber = "854"
  480 + startingLineNumber = "847"
  481 + endingLineNumber = "847"
514 482 landmarkName = "-tableView:cellForRowAtIndexPath:"
515 483 landmarkType = "5">
516 484 </BreakpointContent>
517 485 </BreakpointProxy>
  486 + <BreakpointProxy
  487 + BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
  488 + <BreakpointContent
  489 + shouldBeEnabled = "No"
  490 + ignoreCount = "0"
  491 + continueAfterRunningActions = "No"
  492 + filePath = "MenuTableViewController.m"
  493 + timestampString = "432265160.899922"
  494 + startingColumnNumber = "9223372036854775807"
  495 + endingColumnNumber = "9223372036854775807"
  496 + startingLineNumber = "708"
  497 + endingLineNumber = "708"
  498 + landmarkName = "-tableView:cellForRowAtIndexPath:"
  499 + landmarkType = "5">
  500 + </BreakpointContent>
  501 + </BreakpointProxy>
  502 + <BreakpointProxy
  503 + BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
  504 + <BreakpointContent
  505 + shouldBeEnabled = "No"
  506 + ignoreCount = "0"
  507 + continueAfterRunningActions = "No"
  508 + filePath = "PriceChangerViewController.m"
  509 + timestampString = "432259134.170788"
  510 + startingColumnNumber = "9223372036854775807"
  511 + endingColumnNumber = "9223372036854775807"
  512 + startingLineNumber = "48"
  513 + endingLineNumber = "48"
  514 + landmarkName = "-dismissKeyboard"
  515 + landmarkType = "5">
  516 + </BreakpointContent>
  517 + </BreakpointProxy>
518 518 </Breakpoints>
519 519 </Bucket>
... ...
DUREX Vendor Control/DateRangePickerViewController.h 0 → 100644
  1 +//
  2 +// DateRangePickerViewController.h
  3 +// DUREX Vendor Control
  4 +//
  5 +// Created by Imanol Barba on 9/13/14.
  6 +// Copyright (c) 2014 Emmoco. All rights reserved.
  7 +//
  8 +
  9 +//
  10 +// DatePickerViewController.h
  11 +// DUREX Vendor Control
  12 +//
  13 +// Created by Imanol Barba on 03/09/14.
  14 +// Copyright (c) 2014 Emmoco. All rights reserved.
  15 +//
  16 +
  17 +@class DateRangePickerViewController;
  18 +
  19 +#import <UIKit/UIKit.h>
  20 +#import <QuartzCore/QuartzCore.h>
  21 +#import "DUREXAppDelegate.h"
  22 +
  23 +@protocol DateRangePickerViewControllerDelegate <NSObject>
  24 +- (void)passDateRangeViewController:(DateRangePickerViewController*)controller didFinishEnteringItem:(NSDate*) from : (NSDate*) to;
  25 +
  26 +@end
  27 +
  28 +@interface DateRangePickerViewController : UIViewController
  29 +
  30 +@property (strong, nonatomic) IBOutlet UIView *dateRangePickerView;
  31 +@property (strong, nonatomic) IBOutlet UIDatePicker *fromDate;
  32 +@property (strong, nonatomic) IBOutlet UIDatePicker *toDate;
  33 +@property (strong, nonatomic) IBOutlet UISwitch *fromToggler;
  34 +@property (strong, nonatomic) IBOutlet UISwitch *toToggler;
  35 +@property (nonatomic, strong) id <DateRangePickerViewControllerDelegate> delegate;
  36 +
  37 +- (void)showInView:(UIView *)aView animated:(BOOL)animated;
  38 +- (IBAction)toggleFromDate:(id)sender;
  39 +- (IBAction)toggleToDate:(id)sender;
  40 +- (IBAction)closePopup:(id)sender;
  41 +
  42 +@end
... ...
DUREX Vendor Control/DateRangePickerViewController.m 0 → 100644
  1 +//
  2 +// DateRangePickerViewController.m
  3 +// DUREX Vendor Control
  4 +//
  5 +// Created by Imanol Barba on 9/13/14.
  6 +// Copyright (c) 2014 Emmoco. All rights reserved.
  7 +//
  8 +
  9 +#import "DateRangePickerViewController.h"
  10 +
  11 +@interface DateRangePickerViewController ()
  12 +
  13 +@end
  14 +
  15 +@implementation DateRangePickerViewController
  16 +
  17 +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
  18 +{
  19 + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
  20 + if (self) {
  21 + // Custom initialization
  22 + }
  23 + return self;
  24 +}
  25 +
  26 +- (void)viewDidLoad
  27 +{
  28 + self.view.backgroundColor=[[UIColor blackColor] colorWithAlphaComponent:.7];
  29 + self.dateRangePickerView.layer.cornerRadius = 5;
  30 + self.dateRangePickerView.layer.shadowOpacity = 0.8;
  31 + self.dateRangePickerView.layer.shadowOffset = CGSizeMake(0.0f, 0.0f);
  32 +
  33 + //Fix transparency glitch on iPad
  34 + [self.fromDate setDate:[NSDate dateWithTimeIntervalSince1970:NSTimeIntervalSince1970]];
  35 + [self.fromDate setDate:[NSDate date]];
  36 + [self.toDate setDate:[NSDate dateWithTimeIntervalSince1970:NSTimeIntervalSince1970]];
  37 + [self.toDate setDate:[NSDate date]];
  38 +
  39 + [super viewDidLoad];
  40 + // Do any additional setup after loading the view from its nib.
  41 +}
  42 +
  43 +- (void)didReceiveMemoryWarning
  44 +{
  45 + [super didReceiveMemoryWarning];
  46 + // Dispose of any resources that can be recreated.
  47 +}
  48 +
  49 +- (void)showAnimate
  50 +{
  51 + self.view.transform = CGAffineTransformMakeScale(1.3, 1.3);
  52 + self.view.alpha = 0;
  53 + [UIView animateWithDuration:.25 animations:^{
  54 + self.view.alpha = 1;
  55 + self.view.transform = CGAffineTransformMakeScale(1, 1);
  56 + }];
  57 +}
  58 +
  59 +- (void)removeAnimate
  60 +{
  61 + [UIView animateWithDuration:.25 animations:^{
  62 + self.view.transform = CGAffineTransformMakeScale(1.3, 1.3);
  63 + self.view.alpha = 0.0;
  64 + } completion:^(BOOL finished) {
  65 + if (finished) {
  66 + [self.view removeFromSuperview];
  67 + }
  68 + }];
  69 +}
  70 +
  71 +- (IBAction)toggleFromDate:(id)sender
  72 +{
  73 + if([[self fromToggler] isOn])
  74 + {
  75 + [[self fromDate] setEnabled:TRUE];
  76 + [[self fromDate] setHidden:FALSE];
  77 + }
  78 + else
  79 + {
  80 + [[self fromDate] setEnabled:FALSE];
  81 + [[self fromDate] setHidden:TRUE];
  82 + }
  83 +}
  84 +- (IBAction)toggleToDate:(id)sender
  85 +{
  86 + if([[self toToggler] isOn])
  87 + {
  88 + [[self toDate] setEnabled:TRUE];
  89 + [[self toDate] setHidden:FALSE];
  90 + }
  91 + else
  92 + {
  93 + [[self toDate] setEnabled:FALSE];
  94 + [[self toDate] setHidden:TRUE];
  95 + }
  96 +}
  97 +
  98 +- (IBAction)closePopup:(id)sender
  99 +{
  100 + NSDate *from = nil;
  101 + NSDate *to = nil;
  102 + if([[self fromToggler] isOn])
  103 + {
  104 + from = [[self fromDate] date];
  105 + }
  106 + if([[self toToggler] isOn])
  107 + {
  108 + to = [[self toDate] date];
  109 + }
  110 + [self.delegate passDateRangeViewController:self didFinishEnteringItem:from : to];
  111 + [self removeAnimate];
  112 +}
  113 +
  114 +- (void)showInView:(UIView *)aView animated:(BOOL)animated
  115 +{
  116 + [aView addSubview:self.view];
  117 + if (animated) {
  118 + [self showAnimate];
  119 + }
  120 +}
  121 +
  122 +@end
0 123 \ No newline at end of file
... ...
DUREX Vendor Control/DateRangePickerViewController.xib 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2 +<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="5056" systemVersion="12F45" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES">
  3 + <dependencies>
  4 + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
  5 + </dependencies>
  6 + <objects>
  7 + <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="DateRangePickerViewController">
  8 + <connections>
  9 + <outlet property="dateRangePickerView" destination="fz9-NP-VLV" id="SCJ-Kj-RVG"/>
  10 + <outlet property="fromDate" destination="P5u-F4-X4a" id="O8W-IK-kwx"/>
  11 + <outlet property="fromToggler" destination="gUl-8z-CPz" id="cxE-U3-SjF"/>
  12 + <outlet property="toDate" destination="mwj-Ys-4vf" id="gNf-g2-mOs"/>
  13 + <outlet property="toToggler" destination="IjI-S6-otK" id="L9P-kq-pcF"/>
  14 + <outlet property="view" destination="kvr-be-fbh" id="KCt-Co-8O9"/>
  15 + </connections>
  16 + </placeholder>
  17 + <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
  18 + <view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="kvr-be-fbh">
  19 + <rect key="frame" x="0.0" y="0.0" width="320" height="480"/>
  20 + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
  21 + <subviews>
  22 + <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="fz9-NP-VLV">
  23 + <rect key="frame" x="0.0" y="70" width="320" height="340"/>
  24 + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
  25 + <subviews>
  26 + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bPF-XH-a36">
  27 + <rect key="frame" x="0.0" y="0.0" width="320" height="602"/>
  28 + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
  29 + <subviews>
  30 + <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="gUl-8z-CPz">
  31 + <rect key="frame" x="73" y="20" width="51" height="31"/>
  32 + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
  33 + <connections>
  34 + <action selector="toggleFromDate:" destination="-1" eventType="valueChanged" id="VPw-c1-nAd"/>
  35 + </connections>
  36 + </switch>
  37 + <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="From:" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xIo-vd-lE7">
  38 + <rect key="frame" x="20" y="25" width="45" height="21"/>
  39 + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
  40 + <fontDescription key="fontDescription" type="system" pointSize="17"/>
  41 + <nil key="highlightedColor"/>
  42 + </label>
  43 + <datePicker hidden="YES" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" datePickerMode="dateAndTime" minuteInterval="1" translatesAutoresizingMaskIntoConstraints="NO" id="P5u-F4-X4a">
  44 + <rect key="frame" x="0.0" y="59" width="320" height="162"/>
  45 + <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
  46 + <date key="date" timeIntervalSinceReferenceDate="432266305.732934">
  47 + <!--2014-09-13 01:58:25 +0000-->
  48 + </date>
  49 + <timeZone key="timeZone" name="America/Los_Angeles">
  50 + <mutableData key="data">
  51 +VFppZgAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAC5AAAABAAAABCepkign7sVkKCGKqChmveQ
  52 +y4kaoNIj9HDSYSYQ1v50INiArZDa/tGg28CQENzes6DdqayQ3r6VoN+JjpDgnneg4WlwkOJ+WaDjSVKQ
  53 +5F47oOUpNJDmR1gg5xJREOgnOiDo8jMQ6gccIOrSFRDr5v4g7LH3EO3G4CDukdkQ76/8oPBxuxDxj96g
  54 +8n/BkPNvwKD0X6OQ9U+ioPY/hZD3L4Sg+CiiEPkPZqD6CIQQ+viDIPvoZhD82GUg/chIEP64RyD/qCoQ
  55 +AJgpIAGIDBACeAsgA3EokARhJ6AFUQqQBkEJoAcw7JAHjUOgCRDOkAmtvyAK8LCQC+CvoAzZzRANwJGg
  56 +DrmvEA+priAQmZEQEYmQIBJ5cxATaXIgFFlVEBVJVCAWOTcQFyk2IBgiU5AZCRggGgI1kBryNKAb4heQ
  57 +HNIWoB3B+ZAesfigH6HbkCB2KyAhgb2QIlYNICNq2hAkNe8gJUq8ECYV0SAnKp4QJ/7toCkKgBAp3s+g
  58 +KupiECu+saAs036QLZ6ToC6zYJAvfnWgMJNCkDFnkiAycySQM0d0IDRTBpA1J1YgNjLokDcHOCA4HAUQ
  59 +OOcaIDn75xA6xvwgO9vJEDywGKA9u6sQPo/6oD+bjRBAb9ygQYSpkEJPvqBDZIuQRC+goEVEbZBF89Mg
  60 +Ry2KEEfTtSBJDWwQSbOXIErtThBLnLOgTNZqkE18laBOtkyQT1x3oFCWLpBRPFmgUnYQkFMcO6BUVfKQ
  61 +VPwdoFY11JBW5TogWB7xEFjFHCBZ/tMQWqT+IFvetRBchOAgXb6XEF5kwiBfnnkQYE3eoGGHlZBiLcCg
  62 +Y2d3kGQNoqBlR1mQZe2EoGcnO5BnzWagaQcdkGmtSKBq5v+Qa5ZlIGzQHBBtdkcgbq/+EG9WKSBwj+AQ
  63 +cTYLIHJvwhBzFe0gdE+kEHT/CaB2OMCQdt7roHgYopB4vs2gefiEkHqer6B72GaQfH6RoH24SJB+XnOg
  64 +f5gqkAABAAECAwEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEA
  65 +AQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEA
  66 +AQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEA
  67 +AQABAAEAAQAB//+dkAEA//+PgAAE//+dkAEI//+dkAEMUERUAFBTVABQV1QAUFBUAAAAAAEAAAABA
  68 +</mutableData>
  69 + </timeZone>
  70 + </datePicker>
  71 + <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="To:" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="J6Y-lM-Rjf">
  72 + <rect key="frame" x="20" y="234" width="23" height="31"/>
  73 + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
  74 + <fontDescription key="fontDescription" type="system" pointSize="17"/>
  75 + <nil key="highlightedColor"/>
  76 + </label>
  77 + <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="IjI-S6-otK">
  78 + <rect key="frame" x="51" y="229" width="51" height="31"/>
  79 + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
  80 + <connections>
  81 + <action selector="toggleToDate:" destination="-1" eventType="valueChanged" id="JNu-fd-64c"/>
  82 + </connections>
  83 + </switch>
  84 + <datePicker hidden="YES" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" datePickerMode="dateAndTime" minuteInterval="1" translatesAutoresizingMaskIntoConstraints="NO" id="mwj-Ys-4vf">
  85 + <rect key="frame" x="0.0" y="268" width="320" height="162"/>
  86 + <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
  87 + <date key="date" timeIntervalSinceReferenceDate="432266362.26397198">
  88 + <!--2014-09-13 01:59:22 +0000-->
  89 + </date>
  90 + <timeZone key="timeZone" name="America/Los_Angeles">
  91 + <mutableData key="data">
  92 +VFppZgAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAC5AAAABAAAABCepkign7sVkKCGKqChmveQ
  93 +y4kaoNIj9HDSYSYQ1v50INiArZDa/tGg28CQENzes6DdqayQ3r6VoN+JjpDgnneg4WlwkOJ+WaDjSVKQ
  94 +5F47oOUpNJDmR1gg5xJREOgnOiDo8jMQ6gccIOrSFRDr5v4g7LH3EO3G4CDukdkQ76/8oPBxuxDxj96g
  95 +8n/BkPNvwKD0X6OQ9U+ioPY/hZD3L4Sg+CiiEPkPZqD6CIQQ+viDIPvoZhD82GUg/chIEP64RyD/qCoQ
  96 +AJgpIAGIDBACeAsgA3EokARhJ6AFUQqQBkEJoAcw7JAHjUOgCRDOkAmtvyAK8LCQC+CvoAzZzRANwJGg
  97 +DrmvEA+priAQmZEQEYmQIBJ5cxATaXIgFFlVEBVJVCAWOTcQFyk2IBgiU5AZCRggGgI1kBryNKAb4heQ
  98 +HNIWoB3B+ZAesfigH6HbkCB2KyAhgb2QIlYNICNq2hAkNe8gJUq8ECYV0SAnKp4QJ/7toCkKgBAp3s+g
  99 +KupiECu+saAs036QLZ6ToC6zYJAvfnWgMJNCkDFnkiAycySQM0d0IDRTBpA1J1YgNjLokDcHOCA4HAUQ
  100 +OOcaIDn75xA6xvwgO9vJEDywGKA9u6sQPo/6oD+bjRBAb9ygQYSpkEJPvqBDZIuQRC+goEVEbZBF89Mg
  101 +Ry2KEEfTtSBJDWwQSbOXIErtThBLnLOgTNZqkE18laBOtkyQT1x3oFCWLpBRPFmgUnYQkFMcO6BUVfKQ
  102 +VPwdoFY11JBW5TogWB7xEFjFHCBZ/tMQWqT+IFvetRBchOAgXb6XEF5kwiBfnnkQYE3eoGGHlZBiLcCg
  103 +Y2d3kGQNoqBlR1mQZe2EoGcnO5BnzWagaQcdkGmtSKBq5v+Qa5ZlIGzQHBBtdkcgbq/+EG9WKSBwj+AQ
  104 +cTYLIHJvwhBzFe0gdE+kEHT/CaB2OMCQdt7roHgYopB4vs2gefiEkHqer6B72GaQfH6RoH24SJB+XnOg
  105 +f5gqkAABAAECAwEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEA
  106 +AQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEA
  107 +AQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEA
  108 +AQABAAEAAQAB//+dkAEA//+PgAAE//+dkAEI//+dkAEMUERUAFBTVABQV1QAUFBUAAAAAAEAAAABA
  109 +</mutableData>
  110 + </timeZone>
  111 + </datePicker>
  112 + <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="aYc-3W-Uqn">
  113 + <rect key="frame" x="137" y="438" width="37" height="30"/>
  114 + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
  115 + <state key="normal" title="Done">
  116 + <color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
  117 + </state>
  118 + <connections>
  119 + <action selector="closePopup:" destination="-1" eventType="touchUpInside" id="20s-GW-y67"/>
  120 + </connections>
  121 + </button>
  122 + </subviews>
  123 + <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
  124 + <constraints>
  125 + <constraint firstAttribute="centerX" secondItem="P5u-F4-X4a" secondAttribute="centerX" id="3kI-JI-Z1h"/>
  126 + <constraint firstAttribute="height" constant="602" id="9TX-1i-78Z"/>
  127 + <constraint firstItem="IjI-S6-otK" firstAttribute="top" secondItem="P5u-F4-X4a" secondAttribute="bottom" constant="8" id="F2V-Vc-2cb"/>
  128 + <constraint firstItem="gUl-8z-CPz" firstAttribute="leading" secondItem="xIo-vd-lE7" secondAttribute="trailing" constant="8" id="GGW-gp-gX0"/>
  129 + <constraint firstAttribute="width" constant="320" id="HeC-5b-Jcm"/>
  130 + <constraint firstItem="xIo-vd-lE7" firstAttribute="top" secondItem="bPF-XH-a36" secondAttribute="top" constant="25" id="Lre-tN-KLY"/>
  131 + <constraint firstItem="mwj-Ys-4vf" firstAttribute="top" secondItem="J6Y-lM-Rjf" secondAttribute="bottom" constant="13" id="QFK-8l-qS9"/>
  132 + <constraint firstItem="IjI-S6-otK" firstAttribute="leading" secondItem="J6Y-lM-Rjf" secondAttribute="trailing" constant="8" id="SiP-L0-vna"/>
  133 + <constraint firstItem="xIo-vd-lE7" firstAttribute="leading" secondItem="bPF-XH-a36" secondAttribute="leading" constant="20" id="UYd-kA-RVe"/>
  134 + <constraint firstItem="J6Y-lM-Rjf" firstAttribute="top" secondItem="P5u-F4-X4a" secondAttribute="bottom" constant="13" id="W89-jA-XLF"/>
  135 + <constraint firstItem="aYc-3W-Uqn" firstAttribute="leading" secondItem="bPF-XH-a36" secondAttribute="leading" constant="137" id="aYI-pb-BGP"/>
  136 + <constraint firstItem="P5u-F4-X4a" firstAttribute="top" secondItem="gUl-8z-CPz" secondAttribute="bottom" constant="8" id="cA8-yk-fVJ"/>
  137 + <constraint firstItem="J6Y-lM-Rjf" firstAttribute="leading" secondItem="bPF-XH-a36" secondAttribute="leading" constant="20" id="jXK-cV-gUA"/>
  138 + <constraint firstItem="P5u-F4-X4a" firstAttribute="top" secondItem="xIo-vd-lE7" secondAttribute="bottom" constant="13" id="jfl-Gt-5hY"/>
  139 + <constraint firstItem="aYc-3W-Uqn" firstAttribute="top" secondItem="mwj-Ys-4vf" secondAttribute="bottom" constant="8" id="k8t-h6-GS2"/>
  140 + <constraint firstItem="mwj-Ys-4vf" firstAttribute="top" secondItem="IjI-S6-otK" secondAttribute="bottom" constant="8" id="n0B-8A-b9s"/>
  141 + <constraint firstAttribute="centerX" secondItem="mwj-Ys-4vf" secondAttribute="centerX" id="vvq-Wh-sPa"/>
  142 + <constraint firstItem="gUl-8z-CPz" firstAttribute="top" secondItem="bPF-XH-a36" secondAttribute="top" constant="20" id="wxd-X3-cbH"/>
  143 + </constraints>
  144 + </view>
  145 + </subviews>
  146 + <color key="backgroundColor" white="1" alpha="0.94999999999999996" colorSpace="calibratedWhite"/>
  147 + <constraints>
  148 + <constraint firstAttribute="bottom" secondItem="bPF-XH-a36" secondAttribute="bottom" id="0Bb-cL-qKB"/>
  149 + <constraint firstAttribute="trailing" secondItem="bPF-XH-a36" secondAttribute="trailing" id="GAG-Q1-iFr"/>
  150 + <constraint firstItem="bPF-XH-a36" firstAttribute="leading" secondItem="fz9-NP-VLV" secondAttribute="leading" id="I3Y-5Z-L9J"/>
  151 + <constraint firstItem="bPF-XH-a36" firstAttribute="top" secondItem="fz9-NP-VLV" secondAttribute="top" id="lZu-uv-29b"/>
  152 + </constraints>
  153 + </scrollView>
  154 + </subviews>
  155 + <color key="backgroundColor" red="0.023529414089999999" green="0.0039215688589999999" blue="0.0039215688589999999" alpha="0.5" colorSpace="deviceRGB"/>
  156 + <constraints>
  157 + <constraint firstItem="fz9-NP-VLV" firstAttribute="top" secondItem="kvr-be-fbh" secondAttribute="top" constant="70" id="ENJ-tA-Y3H"/>
  158 + <constraint firstAttribute="centerX" secondItem="fz9-NP-VLV" secondAttribute="centerX" id="X8u-75-ogj"/>
  159 + <constraint firstAttribute="bottom" secondItem="fz9-NP-VLV" secondAttribute="bottom" constant="70" id="qh2-6H-Nq5"/>
  160 + </constraints>
  161 + <simulatedStatusBarMetrics key="simulatedStatusBarMetrics"/>
  162 + <simulatedScreenMetrics key="simulatedDestinationMetrics"/>
  163 + </view>
  164 + </objects>
  165 +</document>
... ...
DUREX Vendor Control/FirstAppExample/EMDevicePickerViewController.m
... ... @@ -34,6 +34,7 @@
34 34 - (void)viewDidLoad
35 35 {
36 36 [super viewDidLoad];
  37 + [[EMConnectionManager sharedManager] setBackgroundUpdatesEnabled:TRUE];
37 38 [[EMConnectionListManager sharedManager] addObserver:self forKeyPath:@"devices" options:0 context:NULL];
38 39 }
39 40  
... ... @@ -105,7 +106,7 @@
105 106  
106 107 -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
107 108 {
108   - //[self performSegueWithIdentifier:@"ConnectionSegue" sender:self];
  109 + [self performSegueWithIdentifier:@"ConnectionSegue" sender:self];
109 110 if(![[[[tableView cellForRowAtIndexPath:indexPath] textLabel] text] isEqualToString:NSLocalizedString(@"Searching for devices...",nil)])
110 111 {
111 112 [self _showConnectingView];
... ...
DUREX Vendor Control/MenuTableViewController.h
... ... @@ -13,6 +13,7 @@
13 13 #import "DatePickerViewController.h"
14 14 #import "PriceChangerViewController.h"
15 15 #import "NameChangerViewController.h"
  16 +#import "DateRangePickerViewController.h"
16 17 #import "Sensors.h"
17 18 #import "SalesLog.h"
18 19 #import "UIView+Toast.h"
... ... @@ -55,12 +56,18 @@ enum {
55 56 REPORT,
56 57 } navigationLevel;
57 58  
58   -@interface MenuTableViewController : UITableViewController <DatePickerViewControllerDelegate,PriceChangerViewControllerDelegate,NameChangerViewControllerDelegate,NSURLConnectionDataDelegate>
  59 +enum {
  60 + SALES_LOG = 0,
  61 + INCIDENT_LOG,
  62 +} logType;
  63 +
  64 +@interface MenuTableViewController : UITableViewController <DatePickerViewControllerDelegate,PriceChangerViewControllerDelegate,NameChangerViewControllerDelegate, DateRangePickerViewControllerDelegate, NSURLConnectionDataDelegate>
59 65  
60 66 @property (strong,nonatomic) Stack *parentLayout;
61 67 @property (strong,nonatomic) DatePickerViewController *datePickerViewController;
62 68 @property (strong,nonatomic) PriceChangerViewController *priceChangerViewController;
63 69 @property (strong,nonatomic) NameChangerViewController *nameChangerViewController;
  70 +@property (strong,nonatomic) DateRangePickerViewController *dateRangePickerViewController;
64 71 @property (strong,nonatomic) Sensors *sensorStatus;
65 72 @property (strong,nonatomic) SalesLog *salesLog;
66 73 @property (strong,nonatomic) Sale *currentSale;
... ...
DUREX Vendor Control/MenuTableViewController.m
... ... @@ -42,6 +42,7 @@
42 42 @property const NSMutableArray *currentStructure;
43 43 @property const NSMutableArray *currentHeaders;
44 44  
  45 +@property uint8_t requestedLog;
45 46 @end
46 47  
47 48 @implementation MenuTableViewController
... ... @@ -108,19 +109,8 @@
108 109 return TRUE;
109 110 }
110 111  
111   -- (Boolean) generateSaleListNavLevel
  112 +- (void) generateSaleListNavLevel
112 113 {
113   - //Initialize sales log
114   - [self setSalesLog:[[SalesLog alloc]init]];
115   -
116   - //LAUNCH DATE RANGE SELECTOR
117   - NSString *salesData = [_protocol readSalesLog: nil : nil];
118   - if(salesData == nil)
119   - {
120   - NSLog(@"[MenuTableViewController.m]: Error reading sales log");
121   - return FALSE;
122   - }
123   - [[self salesLog] setResponseValue:salesData];
124 114 NSMutableArray *dateArray = [[NSMutableArray alloc] init];
125 115 for(int i = 0; i < [[[self salesLog] sales]count]; i++)
126 116 {
... ... @@ -133,7 +123,6 @@
133 123 [self setSaleListElements:[[NSMutableArray alloc] initWithArray:dateArray]];
134 124 [self setSaleListStructure:[[NSMutableArray alloc] initWithObjects:[NSNumber numberWithInt:[dateArray count]], nil]];
135 125 [self setSaleListHeaders:nil];
136   - return TRUE;
137 126 }
138 127  
139 128 - (Boolean) generateSaleNavLevel : (NSInteger) numSale
... ... @@ -312,7 +301,7 @@
312 301 //DUREX protocol
313 302 if(![_protocol establishConnection])
314 303 {
315   - UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"Communication error" message:@"Error while trying to connect to the device" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
  304 + UIAlertView* alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Communication error",nil) message:NSLocalizedString(@"Error while trying to connect to the device",nil) delegate:nil cancelButtonTitle:NSLocalizedString(@"OK",nil) otherButtonTitles:nil];
316 305 [alert show];
317 306 UIViewController *previous = [[[self navigationController] viewControllers] objectAtIndex:[[[self navigationController] viewControllers] count]-2];
318 307 [[self navigationController] popToViewController:previous animated:YES];
... ... @@ -521,7 +510,7 @@
521 510 NSLog(@"[MenuTableViewController.m]: Changing to navLevel: MAINTENANCE");
522 511 if([self generateMaintenanceLevel])
523 512 {
524   - [NSThread sleepForTimeInterval:1];
  513 + [NSThread sleepForTimeInterval:1]; //HACK!
525 514 [self changeNavLevel:MAINTENANCE:TRUE];
526 515 }
527 516 else
... ... @@ -554,16 +543,20 @@
554 543 }
555 544 else if([cellName isEqualToString:NSLocalizedString(@"Sales log", nil)])
556 545 {
557   - [NSThread sleepForTimeInterval:1];
558   - NSLog(@"[MenuTableViewController.m]: Changing to navLevel: SALE_LIST");
559   - if([self generateSaleListNavLevel])
  546 + [self setRequestedLog:SALES_LOG];
  547 + if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
560 548 {
561   - [self changeNavLevel:SALE_LIST:TRUE];
  549 + self.dateRangePickerViewController = [[DateRangePickerViewController alloc] initWithNibName:@"DateRangePickerViewController_iPad" bundle:nil];
  550 + self.dateRangePickerViewController.delegate = self;
  551 + [self.dateRangePickerViewController showInView:self.navigationController.view animated:YES];
562 552 }
563 553 else
564 554 {
565   - NSLog(@"[MenuTableViewController.m]: Error while changing to navLevel: SALE_LIST");
  555 + self.dateRangePickerViewController = [[DateRangePickerViewController alloc] initWithNibName:@"DateRangePickerViewController" bundle:nil];
  556 + self.dateRangePickerViewController.delegate = self;
  557 + [self.dateRangePickerViewController showInView:self.navigationController.view animated:YES];
566 558 }
  559 +
567 560 }
568 561 else if([cellName isEqualToString:NSLocalizedString(@"Send report", nil)])
569 562 {
... ... @@ -712,7 +705,7 @@
712 705 }
713 706 //PARSE AND REMOVE TAG
714 707 NSInteger lastPos = [cellText rangeOfString:@"]"].location;
715   - NSInteger cellTag = [[cellText substringWithRange:NSMakeRange(1,lastPos)] intValue];
  708 + NSInteger cellTag = [[cellText substringWithRange:NSMakeRange(1,lastPos-1)] intValue];
716 709 [cell setTag:cellTag];
717 710 [cellText setString:[cellText substringFromIndex:lastPos+1]];
718 711 //SET FINAL TEXT
... ... @@ -1086,20 +1079,108 @@
1086 1079 {
1087 1080 NSLog(@"[MenuTableViewController.m]: %@", data);
1088 1081 //Channel,Code,Price
1089   - int channel = [[data objectAtIndex:0] intValue];
1090   - int code = [[data objectAtIndex:1] intValue];
1091   - NSArray *price = [[data objectAtIndex:2] componentsSeparatedByString:@","];
1092   - [_protocol updatePrice:channel :code :[[price objectAtIndex:0] intValue] :[[price objectAtIndex:1] intValue]];
  1082 + NSString *channelString = [data objectAtIndex:0];
  1083 + NSString *codeString = [data objectAtIndex:1];
  1084 + NSString *priceString = [data objectAtIndex:2];
  1085 + if(![[NSRegularExpression regularExpressionWithPattern:[NSString stringWithFormat:@"^\\d+(\\.\\d+)?$"] options:0 error:NULL] numberOfMatchesInString:priceString options:0 range:NSMakeRange(0,[priceString length])])
  1086 + {
  1087 + UIAlertView* alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Error",nil) message:NSLocalizedString(@"Entered price has an invalid format",nil) delegate:nil cancelButtonTitle:NSLocalizedString(@"OK",nil) otherButtonTitles:nil];
  1088 + [alert show];
  1089 + }
  1090 + else if([channelString length] == 0)
  1091 + {
  1092 + UIAlertView* alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Error",nil) message:NSLocalizedString(@"Missing channel",nil) delegate:nil cancelButtonTitle:NSLocalizedString(@"OK",nil) otherButtonTitles:nil];
  1093 + [alert show];
  1094 + }
  1095 + else if([codeString length] == 0)
  1096 + {
  1097 + UIAlertView* alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Error",nil) message:NSLocalizedString(@"Missing product code",nil) delegate:nil cancelButtonTitle:NSLocalizedString(@"OK",nil) otherButtonTitles:nil];
  1098 + [alert show];
  1099 + }
  1100 + else if(![[NSRegularExpression regularExpressionWithPattern:[NSString stringWithFormat:@"\\d+"] options:0 error:NULL] numberOfMatchesInString:channelString options:0 range:NSMakeRange(0,[channelString length])])
  1101 + {
  1102 + UIAlertView* alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Error",nil) message:NSLocalizedString(@"Entered channel has an invalid format",nil) delegate:nil cancelButtonTitle:NSLocalizedString(@"OK",nil) otherButtonTitles:nil];
  1103 + [alert show];
  1104 + }
  1105 + else if(![[NSRegularExpression regularExpressionWithPattern:[NSString stringWithFormat:@"\\d+"] options:0 error:NULL] numberOfMatchesInString:codeString options:0 range:NSMakeRange(0,[codeString length])])
  1106 + {
  1107 + UIAlertView* alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Error",nil) message:NSLocalizedString(@"Entered product code has an invalid format",nil) delegate:nil cancelButtonTitle:NSLocalizedString(@"OK",nil) otherButtonTitles:nil];
  1108 + [alert show];
  1109 + }
  1110 + else
  1111 + {
  1112 + int channel = [channelString intValue];
  1113 + int code = [codeString intValue];
  1114 + NSArray *price = [priceString componentsSeparatedByString:@"."];
  1115 + [_protocol updatePrice:channel :code :[[price objectAtIndex:0] intValue] :[[price objectAtIndex:1] intValue]];
  1116 + }
1093 1117 }
1094 1118  
1095 1119 - (void)passNameViewController:(PriceChangerViewController *)controller didFinishEnteringItem:(NSArray *)data
1096 1120 {
1097 1121 NSLog(@"[MenuTableViewController.m]: %@", data);
1098 1122 //Channel,Code,Name
1099   - int channel = [[data objectAtIndex:0] intValue];
1100   - int code = [[data objectAtIndex:1] intValue];
  1123 + NSString *channelString = [data objectAtIndex:0];
  1124 + NSString *codeString = [data objectAtIndex:1];
1101 1125 NSString *name = [data objectAtIndex:2];
1102   - [_protocol updateProductName:channel :code :name];
  1126 + if([channelString length] == 0)
  1127 + {
  1128 + UIAlertView* alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Error",nil) message:NSLocalizedString(@"Missing channel",nil) delegate:nil cancelButtonTitle:NSLocalizedString(@"OK",nil) otherButtonTitles:nil];
  1129 + [alert show];
  1130 + }
  1131 + else if([codeString length] == 0)
  1132 + {
  1133 + UIAlertView* alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Error",nil) message:NSLocalizedString(@"Missing product code",nil) delegate:nil cancelButtonTitle:NSLocalizedString(@"OK",nil) otherButtonTitles:nil];
  1134 + [alert show];
  1135 + }
  1136 + else if(![[NSRegularExpression regularExpressionWithPattern:[NSString stringWithFormat:@"\\d+"] options:0 error:NULL] numberOfMatchesInString:channelString options:0 range:NSMakeRange(0,[channelString length])])
  1137 + {
  1138 + UIAlertView* alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Error",nil) message:NSLocalizedString(@"Entered channel has an invalid format",nil) delegate:nil cancelButtonTitle:NSLocalizedString(@"OK",nil) otherButtonTitles:nil];
  1139 + [alert show];
  1140 + }
  1141 + else if(![[NSRegularExpression regularExpressionWithPattern:[NSString stringWithFormat:@"\\d+"] options:0 error:NULL] numberOfMatchesInString:codeString options:0 range:NSMakeRange(0,[codeString length])])
  1142 + {
  1143 + UIAlertView* alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Error",nil) message:NSLocalizedString(@"Entered product code has an invalid format",nil) delegate:nil cancelButtonTitle:NSLocalizedString(@"OK",nil) otherButtonTitles:nil];
  1144 + [alert show];
  1145 + }
  1146 + else
  1147 + {
  1148 + int channel = [channelString intValue];
  1149 + int code = [codeString intValue];
  1150 + [_protocol updateProductName:channel :code :name];
  1151 + }
  1152 +}
  1153 +
  1154 +- (void) passDateRangeViewController:(DateRangePickerViewController*)controller didFinishEnteringItem:(NSDate*) from : (NSDate*) to
  1155 +{
  1156 + [NSThread sleepForTimeInterval:1]; //HACK!
  1157 + if([self requestedLog] == SALES_LOG)
  1158 + {
  1159 + NSLog(@"[MenuTableViewController.m]: Changing to navLevel: SALE_LIST");
  1160 +
  1161 + //Initialize sales log
  1162 + [self setSalesLog:[[SalesLog alloc]init]];
  1163 +
  1164 + NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
  1165 + NSCalendarUnit units = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit;
  1166 + NSDateComponents *componentsFrom = [calendar components:units fromDate:from];
  1167 + NSDateComponents *componentsTo = [calendar components:units fromDate:to];
  1168 + NSString *salesData = [_protocol readSalesLog: componentsFrom : componentsTo];
  1169 + if(salesData == nil)
  1170 + {
  1171 + NSLog(@"[MenuTableViewController.m]: Error reading sales log");
  1172 + }
  1173 + else
  1174 + {
  1175 + [[self salesLog] setResponseValue:salesData];
  1176 + [self generateSaleListNavLevel];
  1177 + [self changeNavLevel:SALE_LIST:TRUE];
  1178 + }
  1179 + }
  1180 + else if([self requestedLog] == INCIDENT_LOG)
  1181 + {
  1182 +
  1183 + }
1103 1184 }
1104 1185  
1105 1186 @end
... ...
DUREX Vendor Control/PriceChangerViewController.m
... ... @@ -84,8 +84,25 @@
84 84 }];
85 85 }
86 86  
  87 +- (void) formatPrice
  88 +{
  89 + NSMutableString *priceText = [NSMutableString stringWithString:[[self price] text]];
  90 + [priceText replaceOccurrencesOfString:@"," withString:@"." options:NSLiteralSearch range:NSMakeRange(0, [priceText length])];
  91 + NSUInteger commaPos = [priceText rangeOfString:@"."].location;
  92 + if(commaPos == NSNotFound)
  93 + {
  94 + [priceText appendString:@".00"];
  95 + }
  96 + else if(commaPos == [priceText length] - 2)
  97 + {
  98 + [priceText appendString:@"0"];
  99 + }
  100 + [[self price] setText:priceText];
  101 +}
  102 +
87 103 - (IBAction)closePopup:(id)sender
88 104 {
  105 + [self formatPrice];
89 106 NSArray *data = [[NSArray alloc] initWithObjects:[[self channel] text],[[self code] text],[[self price] text], nil];
90 107 [self.delegate passPriceViewController:self didFinishEnteringItem:data];
91 108 [self removeAnimate];
... ...
DUREX Vendor Control/en.lproj/Localizable.strings
... ... @@ -87,4 +87,9 @@
87 87 "Success!" = "Success!";
88 88 "Connection to server failed" = "Connection to server failed";
89 89 "Error" = "Error";
90   -"Product" = "Product";
91 90 \ No newline at end of file
  91 +"Product" = "Product";
  92 +"Entered price has an invalid format" = "Entered price has an invalid format";
  93 +"Entered product code has an invalid format" = "Entered product code has an invalid format";
  94 +"Entered channel has an invalid format" = "Entered channel has an invalid format";
  95 +"Missing channel" = "Missing channel";
  96 +"Missing product code" = "Missing product code";
92 97 \ No newline at end of file
... ...
DUREX Vendor Control/es.lproj/Localizable.strings
... ... @@ -87,4 +87,9 @@
87 87 "Success!" = "Éxito!";
88 88 "Connection to server failed" = "Conexión al servidor fallida";
89 89 "Error" = "Error";
90   -"Product" = "Producto";
91 90 \ No newline at end of file
  91 +"Product" = "Producto";
  92 +"Entered price has an invalid format" = "El precio introducido está en un formato incorrecto";
  93 +"Entered code has an invalid format" = "El código de producto introducido está en un formato incorrecto";
  94 +"Entered channel has an invalid format" = "El canal introducido está en un formato incorrecto";
  95 +"Missing channel" = "Falta el canal";
  96 +"Missing product code" = "Falta el código del producto";
92 97 \ No newline at end of file
... ...
1 1 BUGS:
2 2 - On date change, response is overwritten by previous query, trimming needed according to numBytes
3   -- Sanitize input on name/price change
4   -- Handle disconnects properly
5   -- Month headers on sale list
6   -- Add robustness in case of invalid length
7   -- Add landscape layout and inverted layout
8 3  
9 4 TODO:
10 5  
11 6 - Reimplement protocol with async pattern
  7 +(WIP) - Add date range on Log request
  8 +- Handle disconnects properly
12 9 - Incident class
13 10 - Incident parser
14 11 - A3 command
15 12 - Channels and codes to 2 ciphers
  13 +- Add landscape layout and inverted layout
  14 +- Month/Year headers on sale list
16 15  
17 16 - Batch command files, definition, parsing and pushing them to the app
18 17 - Implement user auth. Server authenticates the app ONCE on install and allows to control ONE machine (key gets validated on server and then stored on app)
... ...